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

TypeError: unhashable type: 'Level' #7

Open
adaszko opened this issue Feb 8, 2018 · 1 comment
Open

TypeError: unhashable type: 'Level' #7

adaszko opened this issue Feb 8, 2018 · 1 comment

Comments

@adaszko
Copy link

adaszko commented Feb 8, 2018

Hi! I'm getting this exception during the import of lithoxyl:

In [1]: import lithoxyl
---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
<ipython-input-1-222423bc74ab> in <module>()
----> 1 import lithoxyl

/env/lib/python3.6/site-packages/lithoxyl/__init__.py in <module>()
      3 from lithoxyl.context import get_context, set_context
      4
----> 5 from lithoxyl.logger import Logger, DEBUG, INFO, CRITICAL
      6 from lithoxyl.emitters import StreamEmitter
      7

/env/lib/python3.6/site-packages/lithoxyl/logger.py in <module>()
     15
     16 from lithoxyl.context import get_context
---> 17 from lithoxyl.common import DEBUG, INFO, CRITICAL
     18 from lithoxyl.action import Action, BeginEvent, EndEvent, CommentEvent
     19

/env/lib/python3.6/site-packages/lithoxyl/common.py in <module>()
     65 LEVEL_LIST = []
     66 LEVEL_ALIAS_MAP = {}
---> 67 register_level(MIN_LEVEL)
     68 register_level(MAX_LEVEL)
     69 for level in BUILTIN_LEVELS:

/env/lib/python3.6/site-packages/lithoxyl/common.py in register_level(level_obj)
     59     LEVEL_ALIAS_MAP[level_obj.name.upper()] = level_obj
     60     LEVEL_ALIAS_MAP[level_obj._value] = level_obj
---> 61     LEVEL_ALIAS_MAP[level_obj] = level_obj
     62     LEVEL_LIST[:] = sorted(set(LEVEL_ALIAS_MAP.values()))
     63

TypeError: unhashable type: 'Level'
$ python --version
Python 3.6.4

$ pip freeze | grep lithoxyl
lithoxyl==0.4.1
@ragesoss
Copy link

ragesoss commented Dec 7, 2018

I'm trying to set up pacetrack, and I ran into this same error.

python3 pacetrack/update.py                                                                                               1456ms  Fri 07 Dec 2018 03:55:50 PM PST
Traceback (most recent call last):
  File "pacetrack/update.py", line 24, in <module>
    from log import tlog, set_debug
  File "/home/sage/play/pacetrack/pacetrack/log.py", line 3, in <module>
    from lithoxyl import Logger, SensibleSink, SensibleFormatter, StreamEmitter, SensibleFilter
  File "/home/sage/.local/lib/python3.6/site-packages/lithoxyl/__init__.py", line 5, in <module>
    from lithoxyl.logger import Logger, DEBUG, INFO, CRITICAL
  File "/home/sage/.local/lib/python3.6/site-packages/lithoxyl/logger.py", line 17, in <module>
    from lithoxyl.common import DEBUG, INFO, CRITICAL
  File "/home/sage/.local/lib/python3.6/site-packages/lithoxyl/common.py", line 67, in <module>
    register_level(MIN_LEVEL)
  File "/home/sage/.local/lib/python3.6/site-packages/lithoxyl/common.py", line 61, in register_level
    LEVEL_ALIAS_MAP[level_obj] = level_obj
TypeError: unhashable type: 'Level'

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