Skip to content
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

Incompatible with Python 3.11 #18

Open
akotlar opened this issue Mar 19, 2023 · 1 comment
Open

Incompatible with Python 3.11 #18

akotlar opened this issue Mar 19, 2023 · 1 comment

Comments

@akotlar
Copy link

akotlar commented Mar 19, 2023

Minimal example:

try:
            job = client.reserve_job(5)
except BeanstalkError as err:
            if err.message == 'TIMED_OUT':
                continue
            raise err

Results in

Traceback (most recent call last):
  File "/home/ec2-user/miniconda/envs/bystro311/lib/python3.11/contextlib.py", line 155, in __exit__
    self.gen.throw(typ, value, traceback)   
  File "/home/ec2-user/miniconda/envs/bystro311/lib/python3.11/site-packages/pystalk/client.py", line 166, in _sock_ctx
    yield self._socket
  File "/home/ec2-user/miniconda/envs/bystro311/lib/python3.11/site-packages/pystalk/client.py", line 425, in reserve_job
    job_id, job_data = self._receive_id_and_data_with_prefix(b'RESERVED', socket)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/ec2-user/miniconda/envs/bystro311/lib/python3.11/site-packages/pystalk/client.py", line 194, in _receive_id_and_data_with_prefix
    raise BeanstalkError(error)
pystalk.client.BeanstalkError: b'TIMED_OUT' 

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/ec2-user/bystro/search2/python/search/index/listener.py", line 209, in <module>
    main()
  File "/home/ec2-user/bystro/search2/python/search/index/listener.py", line 205, in main
    listen(queue_conf, search_conf, config_path_base_dir)
  File "/home/ec2-user/bystro/search2/python/search/index/listener.py", line 125, in listen
    job = client.reserve_job(5)
          ^^^^^^^^^^^^^^^^^^^^^
  File "/home/ec2-user/miniconda/envs/bystro311/lib/python3.11/site-packages/pystalk/client.py", line 423, in reserve_job
    with self._sock_ctx() as socket:
  File "/home/ec2-user/miniconda/envs/bystro311/lib/python3.11/contextlib.py", line 188, in __exit__
    exc.__traceback__ = traceback
    ^^^^^^^^^^^^^^^^^
  File "/home/ec2-user/miniconda/envs/bystro311/lib/python3.11/site-packages/attr/_make.py", line 606, in _frozen_setattrs
    raise FrozenInstanceError()
attr.exceptions.FrozenInstanceError

If you stop modifying traceback the issue should be resolved

@Justintime50
Copy link
Member

Hey @akotlar, thanks for reporting this issue! We don't have any immediate plans to address this issue; however, we are definitely open to PRs if you'd like to submit one that can correct and test this. Otherwise we will revisit this in the future.

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

No branches or pull requests

2 participants