Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
UnicodeDecodeError: 'utf8' codec can't decode byte 0xb6 in position 147: invalid start byte #8070
Comments
FYI: The latest version of youtube-dl is 2015.12.29. You may want to check whether there are multiple versions on your device. |
|
Can you paste the output of the following command?
The actual path may be different. |
|
Ok, there was indeed another version installed on my machine, 2015.11.27.1-1. I apt removed that, but, being unable to build the current version, was left to install v. 2015.11.27.1 from the repositories again. Here's the xxd output of /usr/lib/python2.7/dist-packages/youtube_dl-2015.11.27.1.egg-info/PKG-INFO: |
|
What's the output if you remove all existing versions and build and run the latest version? And the content of |
|
Sorry, but I am unable to build the latest version. I get the same error as above. Personally, I find this strange. |
|
Could you provide more details about "unable to build the latest version"? Including the commands you've tried to build and the error messages. |
|
./setup.py build |
|
In
Could you add a line
And run the build command again? |
|
./setup.py build |
|
Could you paste contents around line 2000~2050 of the original |
|
register_loader_type(zipimport.zipimporter, ZipProvider) class FileMetadata(EmptyProvider):
class PathMetadata(DefaultProvider):
|
|
Seems you've added it to the wrong line. Originally it's
Change it to:
Note that the |
|
Oops, sorry. |
|
Thanks for helping debugging. The problem is |
Thanks for helping create youtube-dl.
There seems to be a problem with Unicode handling. With youtube-dl [any video], OR trying the latest git master HEAD (d5f6429) and ./setup.py build, I get:
Traceback (most recent call last):
File "/usr/local/bin/youtube-dl", line 5, in
from pkg_resources import load_entry_point
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 3138, in
@_call_aside
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 3124, in _call_aside
f(_args, *_kwargs)
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 3151, in _initialize_master_working_set
working_set = WorkingSet._build_master()
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 652, in _build_master
ws = cls()
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 645, in init
self.add_entry(entry)
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 701, in add_entry
for dist in find_distributions(entry, True):
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 2139, in find_on_path
path_item, entry, metadata, precedence=DEVELOP_DIST
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 2521, in from_location
py_version=py_version, platform=platform, **kw
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 2835, in _reload_version
md_version = _version_from_file(self._get_metadata(self.PKG_INFO))
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 2486, in _version_from_file
line = next(iter(version_lines), '')
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 2654, in _get_metadata
for line in self.get_metadata_lines(name):
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 2030, in get_metadata_lines
return yield_lines(self.get_metadata(name))
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 2025, in get_metadata
metadata = f.read()
File "/usr/lib/python2.7/codecs.py", line 314, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xb6 in position 147: invalid start byte
The line in question is:
from pkg_resources import load_entry_point
The installed youtube-dl version (/usr/local/bin/youtube-dl) is 2015.12.18.
Now, to my understanding, 0xb6 is, indeed, invalid as a utf8 start byte. Where this is coming from is beyond me at the moment. As the second byte, it is present in eg. ¶ (U+00B6, aka 0xc2 0xb6) and ö (U+00F6, aka 0xc3 0xb6).
So far, I've found this presentation: http://nedbatchelder.com/text/unipain.html
And this poor fellow, with the ~samish problem: http://www.gossamer-threads.com/lists/engine?do=post_view_flat;post=1070061;page=1;mh=-1;list=python;sb=post_latest_reply;so=ASC