Skip to content

TypeError: String or Integer object expected for key, unicode found #12

@sqlalchemy-bot

Description

@sqlalchemy-bot

Migrated issue, originally created by Antoine Bertin (diaoul)

  File "/home/antoine/Documents/Workspace/subliminal/subliminal/services/bierdopje.py", line 56, in query
    request_id = self.get_show_id(series.lower())
  File "/home/antoine/.virtualenvs/subliminal/local/lib/python2.7/site-packages/dogpile/cache/region.py", line 500, in decorate
    return self.get_or_create(key, creator, expiration_time)
  File "/home/antoine/.virtualenvs/subliminal/local/lib/python2.7/site-packages/dogpile/cache/region.py", line 365, in get_or_create
    expiration_time) as value:
  File "/home/antoine/.virtualenvs/subliminal/local/lib/python2.7/site-packages/dogpile/core/dogpile.py", line 142, in __enter__
    return self._enter()
  File "/home/antoine/.virtualenvs/subliminal/local/lib/python2.7/site-packages/dogpile/core/dogpile.py", line 83, in _enter
    value = value_fn()
  File "/home/antoine/.virtualenvs/subliminal/local/lib/python2.7/site-packages/dogpile/cache/region.py", line 346, in get_value
    value = self.backend.get(key)
  File "/home/antoine/.virtualenvs/subliminal/local/lib/python2.7/site-packages/dogpile/cache/backends/file.py", line 168, in get
    value = dbm.get(key, NO_VALUE)
  File "/home/antoine/.virtualenvs/subliminal/lib/python2.7/_abcoll.py", line 342, in get
    return self[key]
  File "/usr/lib/python2.7/bsddb/__init__.py", line 270, in __getitem__
    return _DeadlockWrap(lambda: self.db[key])  # self.db[key]
  File "/usr/lib/python2.7/bsddb/dbutils.py", line 68, in DeadlockWrap
    return function(*_args, **_kwargs)
  File "/usr/lib/python2.7/bsddb/__init__.py", line 270, in <lambda>
    return _DeadlockWrap(lambda: self.db[key])  # self.db[key]
TypeError: String or Integer object expected for key, unicode found

Might be the first time I encounter a module able to work with bytestrings but not unicode... This is usually the other way around.

Could you fix this by encoding/decoding with utf-8 by default?
Don't know if this is the same for other backends but not being able to use unicode is a real problem IMO.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions