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
global name 'BidirectionalMapping' is not defined #118
Comments
Hi @andreykryazhev, the version of bidict you're using has a bug in its Over a year ago I announced that bidict would be joining the python3statement.org bandwagon and dropping support for Python 2. I therefore have not backported this fix to a Python 2-compatible release. I hope you are able to either upgrade to Python 3 along with the latest version of bidict, or remove |
Thanks for the reply, @jab ! Looks like the only way for Python2.7 is using forked version of |
You’re welcome, and sorry for this bug! Are you able to update to Python 3 at some point? Then you can more easily benefit from other fixes and features that land upstream. In the meantime, rather than fork bidict, are you able to monkey patch the subclasshook method out of the BidirectionalMapping class in your application? |
Unfortunately we cannot update to Python 3 yet, as for monkey patching - thank for suggestion! I suppose it is fit excellent for tests but not for production code but other developers may have different opinion. Thanks one more time! |
No promises for the future, but I've backported the removal of |
Many thanks for change, @jab! Any chance that it will be possible to install it from pypi? |
Please give https://pypi.org/project/bidict/0.18.4/ a try and let me know if it resolves your issue. |
By the way, I should have done this sooner, but I tried to reproduce the issue you reported based on your description and wasn't able to:
Is there something different your code is actually doing? The only difference from your description that I can see is that I used Python 2.7.16 rather than 2.7.13, since 2.7.16 is the only Python 2 version I still have handy, and it's likely that isn't the reason I couldn't reproduce. (By the way, can you at least upgrade to Python 2.7.18, since it's the last Python 2 release?) |
Actually, this is an issue from logs which happened on remote machines and I agree that possibly some environment issue may lead to this error too (looks like it is not reproduced so simply). Simply seen that such hook was removed from Py3 |
Gotcha. Can you confirm if 0.18.4 fixes the issue for you when you get a chance? Hope so! |
Sure, I will notify any updates here (but change-delivery may take some time). |
Hey, @andreykryazhev, just checking if you've had a chance to confirm the fix yet. Hope bidict 0.18.4 fixed the issue for you! |
Hi, @jab. I saw you have deployed 0.18.4 on PyPi. I think the change will be possible to confirm in a week (or may be two in a worst case). The update is on the way to production-servers still... |
Sad, but finally the change was not included to current release (I do not decide this), so it will be deployed only in next release (in a ~3 months) or if somebody will encounter to this issue again (via patch). |
Too bad you can't yet confirm the fix in 0.18.4 works for you, and thank you for the update! If you can, please do let me know if it fixes the issue for you once you're able to test 0.18.4. In the meantime, if you find a way to reproduce the issue in 0.18.3 that you can share, that could also be helpful (e.g. for adding a regression test). Thanks again! |
Hey @andreykryazhev, hope you’ve been well. Can you say yet whether this fixed your issue? |
Hi, @jab! Release (with P.S.: sorry for delay with answer, there were a public holidays. |
No worries, @andreykryazhev! Any luck? |
Sorry, at this time I am really forgot to notify you, @jab. Last release was deployed approx two week ago and no single similar issue from that time) So I hope it will never arise) |
Great this appears to be fixed, thanks. Please let me know if you ever see otherwise, though with the changes I made, I don’t see how that could happen. |
Sure. And thank you very much one more time, @jab! |
Hi, we are using version bidict==0.18.0 and CPython 2.7.13 and got the following error here:
bidict/_abc.py in subclasshook at line 90
C is a <type 'unicode'> here. So we simply pass unicode string to logger and such error raised. Looks like this happened because of the following line in python2.7/logging/init.py:
Could anybody help with this issue? What we are doing wrong? Thanks in advance.
The text was updated successfully, but these errors were encountered: