Skip to content

Add fix if len(preamble) < 8 #229

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

pandaninjas
Copy link
Contributor

This causes a mysterious struct.error when the handshake fails

@NikOverflow NikOverflow self-requested a review March 30, 2024 08:16
@NikOverflow
Copy link
Collaborator

This causes a mysterious struct.error when the handshake fails

i can't test that. Is it possible that you send a proof of concept how we can trigger that or an stacktrace that shows the error.

Copy link
Collaborator

@NikOverflow NikOverflow left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't split the handshake function in two functions to keep the pull request as small as possible.
Also this error occoured:

Traceback (most recent call last):
  File "/run/media/niklas/Games/pypresence-better/pypresence/test.py", line 14, in <module>
    asyncio.run(main())
  File "/usr/lib/python3.11/asyncio/runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/run/media/niklas/Games/pypresence-better/pypresence/test.py", line 8, in main
    await client.start()
  File "/run/media/niklas/Games/pypresence-better/pypresence/pypresence/client.py", line 378, in start
    await self.handshake()
  File "/run/media/niklas/Games/pypresence-better/pypresence/pypresence/baseclient.py", line 123, in handshake
    await create_reader_writer(ipc_path)
          ^^^^^^^^^^^^^^^^^^^^
NameError: name 'create_reader_writer' is not defined

@pandaninjas
Copy link
Contributor Author

Please don't split the handshake function in two functions to keep the pull request as small as possible. Also this error occoured:

Traceback (most recent call last):
  File "/run/media/niklas/Games/pypresence-better/pypresence/test.py", line 14, in <module>
    asyncio.run(main())
  File "/usr/lib/python3.11/asyncio/runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/run/media/niklas/Games/pypresence-better/pypresence/test.py", line 8, in main
    await client.start()
  File "/run/media/niklas/Games/pypresence-better/pypresence/pypresence/client.py", line 378, in start
    await self.handshake()
  File "/run/media/niklas/Games/pypresence-better/pypresence/pypresence/baseclient.py", line 123, in handshake
    await create_reader_writer(ipc_path)
          ^^^^^^^^^^^^^^^^^^^^
NameError: name 'create_reader_writer' is not defined

I've fixed the create_reader_writer issue, but the splitting of the functions was to make CI pass. I can undo that if you would like

@NikOverflow
Copy link
Collaborator

Please don't split the handshake function in two functions to keep the pull request as small as possible. Also this error occoured:

Traceback (most recent call last):
  File "/run/media/niklas/Games/pypresence-better/pypresence/test.py", line 14, in <module>
    asyncio.run(main())
  File "/usr/lib/python3.11/asyncio/runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/run/media/niklas/Games/pypresence-better/pypresence/test.py", line 8, in main
    await client.start()
  File "/run/media/niklas/Games/pypresence-better/pypresence/pypresence/client.py", line 378, in start
    await self.handshake()
  File "/run/media/niklas/Games/pypresence-better/pypresence/pypresence/baseclient.py", line 123, in handshake
    await create_reader_writer(ipc_path)
          ^^^^^^^^^^^^^^^^^^^^
NameError: name 'create_reader_writer' is not defined

I've fixed the create_reader_writer issue, but the splitting of the functions was to make CI pass. I can undo that if you would like

ok this is fine now. Is a proof of concept possible to trigger the problem?

@NikOverflow
Copy link
Collaborator

Please don't split the handshake function in two functions to keep the pull request as small as possible. Also this error occoured:

Traceback (most recent call last):
  File "/run/media/niklas/Games/pypresence-better/pypresence/test.py", line 14, in <module>
    asyncio.run(main())
  File "/usr/lib/python3.11/asyncio/runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/run/media/niklas/Games/pypresence-better/pypresence/test.py", line 8, in main
    await client.start()
  File "/run/media/niklas/Games/pypresence-better/pypresence/pypresence/client.py", line 378, in start
    await self.handshake()
  File "/run/media/niklas/Games/pypresence-better/pypresence/pypresence/baseclient.py", line 123, in handshake
    await create_reader_writer(ipc_path)
          ^^^^^^^^^^^^^^^^^^^^
NameError: name 'create_reader_writer' is not defined

I've fixed the create_reader_writer issue, but the splitting of the functions was to make CI pass. I can undo that if you would like

Hello, i asked you if you can provide a proof of concept that triggers the error.

@NikOverflow NikOverflow added the question Further information is requested label May 28, 2024
@NikOverflow NikOverflow removed the question Further information is requested label Aug 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants