bidict: global name 'BidirectionalMapping' is not defined
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
def __subclasshook__(cls, C): # noqa: N803 (argument name should be lowercase)
"""Check if *C* is a :class:`~collections.abc.Mapping`
that also provides an ``inverse`` attribute,
thus conforming to the :class:`BidirectionalMapping` interface,
in which case it will be considered a (virtual) C
even if it doesn't explicitly extend it.
"""
that also provides an ``inverse`` attribute,
thus conforming to the :class:`BidirectionalMapping` interface,
in which case it will be considered a (virtual) C
even if it doesn't explicitly extend it.
"""
if cls is not BidirectionalMapping: # lgtm [py/comparison-using-is] # global name 'BidirectionalMapping' is not defined here
return NotImplemented
if not Mapping.__subclasshook__(C):
return NotImplemented
mro = getattr(C, '__mro__', None)
if mro is None: # Python 2 old-style class
...
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:
if (args and len(args) == 1 and isinstance(args[0], collections.Mapping)
Could anybody help with this issue? What we are doing wrong? Thanks in advance.
About this issue
- Original URL
- State: closed
- Created 4 years ago
- Comments: 21 (11 by maintainers)
Sure. And thank you very much one more time, @jab!
Hi, @jab! Release (with
bidict
library version update) will happen approx in a two weeks. At this time I can see via logs that issue still happen (on previous release) time to time (for example it happened yesterday). Thus, in a two-three weeks I can provide an update result. Is it OK? Thanks for your attention!P.S.: sorry for delay with answer, there were a public holidays.
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!
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…
Sure, I will notify any updates here (but change-delivery may take some time).