diff options
author | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
---|---|---|
committer | V3n3RiX <venerix@redcorelinux.org> | 2017-10-09 18:53:29 +0100 |
commit | 4f2d7949f03e1c198bc888f2d05f421d35c57e21 (patch) | |
tree | ba5f07bf3f9d22d82e54a462313f5d244036c768 /dev-python/pushbullet-py/files |
reinit the tree, so we can have metadata
Diffstat (limited to 'dev-python/pushbullet-py/files')
-rw-r--r-- | dev-python/pushbullet-py/files/pushbullet-py-0.10.0-fix-filetypes-python3.patch | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/dev-python/pushbullet-py/files/pushbullet-py-0.10.0-fix-filetypes-python3.patch b/dev-python/pushbullet-py/files/pushbullet-py-0.10.0-fix-filetypes-python3.patch new file mode 100644 index 000000000000..09ded3540487 --- /dev/null +++ b/dev-python/pushbullet-py/files/pushbullet-py-0.10.0-fix-filetypes-python3.patch @@ -0,0 +1,28 @@ +diff --git a/pushbullet/filetype.py b/pushbullet/filetype.py +index a2f2be0..22ffedf 100644 +--- a/pushbullet/filetype.py ++++ b/pushbullet/filetype.py +@@ -1,13 +1,22 @@ + def _magic_get_file_type(f, _): + file_type = magic.from_buffer(f.read(1024), mime=True) + f.seek(0) +- return file_type.decode('utf-8') ++ return maybe_decode(file_type) + + + def _guess_file_type(_, filename): + return mimetypes.guess_type(filename)[0] + + ++# return str on python3. Don't want to unconditionally ++# decode because that results in unicode on python2 ++def maybe_decode(s): ++ if str == bytes: ++ return s.decode('utf-8') ++ else: ++ return s ++ ++ + try: + import magic + except ImportError: |