wintermute123 / youtube-upload

Automatically exported from code.google.com/p/youtube-upload
0 stars 0 forks source link

UnicodeDecodeError: 'utf8' codec can't decode byte 0xff in position 3: invalid start byte #112

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
= Versions

youtube-upload: 0.7.2
python: 2.7.4 (default, Apr 19 2013, 18:28:01)
python-gdata: gdata (2.0.17)

= Describe the steps (including the command you run) that will reproduce
the problem?

I get an error as below.
Could you help?

Kind regards,
Povilas

tv@encoder:~/Videos/MASTERIAI/raw_video_files$ youtube-upload 
--email=povilas.paule@gmail.com --password=mypassw --title="Testing automated 
upload" --description="Let’s check"  --category=Nonprofit --keywords="test" 
output01.mts
Login to Youtube API: email='povilas.paule@gmail.com', 
password='****************'
Traceback (most recent call last):
  File "/usr/local/bin/youtube-upload", line 519, in <module>
    sys.exit(catch_exceptions(EXIT_CODES, main, sys.argv[1:]))
  File "/usr/local/bin/youtube-upload", line 111, in catch_exceptions
    fun(*args, **kwargs)
  File "/usr/local/bin/youtube-upload", line 516, in main
    run_main(parser, options, args)
  File "/usr/local/bin/youtube-upload", line 449, in run_main
    url = upload_video(youtube, options, video_path, len(args), index)
  File "/usr/local/bin/youtube-upload", line 363, in upload_video
    data = youtube.get_upload_form_data(*args, **kwargs)
  File "/usr/local/bin/youtube-upload", line 197, in get_upload_form_data
    post_url, token = self.service.GetFormUploadToken(entry)
  File "/usr/local/lib/python2.7/dist-packages/gdata/youtube/service.py", line 719, in GetFormUploadToken
    response = self.Post(video_entry, uri)
  File "/usr/local/lib/python2.7/dist-packages/gdata/service.py", line 1236, in Post
    media_source=media_source, converter=converter)
  File "/usr/local/lib/python2.7/dist-packages/gdata/service.py", line 1322, in PostOrPut
    headers=extra_headers, url_params=url_params)
  File "/usr/local/lib/python2.7/dist-packages/atom/__init__.py", line 93, in optional_warn_function
    return f(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/atom/service.py", line 176, in request
    content_length = CalculateDataLength(data)
  File "/usr/local/lib/python2.7/dist-packages/atom/service.py", line 736, in CalculateDataLength
    return len(str(data))
  File "/usr/local/lib/python2.7/dist-packages/atom/__init__.py", line 377, in __str__
    return self.ToString()
  File "/usr/local/lib/python2.7/dist-packages/atom/__init__.py", line 374, in ToString
    return ElementTree.tostring(self._ToElementTree(), encoding=string_encoding)
  File "/usr/local/lib/python2.7/dist-packages/atom/__init__.py", line 369, in _ToElementTree
    self._AddMembersToElementTree(new_tree)
  File "/usr/local/lib/python2.7/dist-packages/atom/__init__.py", line 331, in _AddMembersToElementTree
    member._BecomeChildElement(tree)
  File "/usr/local/lib/python2.7/dist-packages/atom/__init__.py", line 357, in _BecomeChildElement
    self._AddMembersToElementTree(new_child)
  File "/usr/local/lib/python2.7/dist-packages/atom/__init__.py", line 331, in _AddMembersToElementTree
    member._BecomeChildElement(tree)
  File "/usr/local/lib/python2.7/dist-packages/atom/__init__.py", line 357, in _BecomeChildElement
    self._AddMembersToElementTree(new_child)
  File "/usr/local/lib/python2.7/dist-packages/atom/__init__.py", line 342, in _AddMembersToElementTree
    ExtensionContainer._AddMembersToElementTree(self, tree)
  File "/usr/local/lib/python2.7/dist-packages/atom/__init__.py", line 224, in _AddMembersToElementTree
    tree.text = self.text.decode(MEMBER_STRING_ENCODING)
  File "/usr/lib/python2.7/encodings/utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xff in position 3: invalid 
start byte
tv@encoder:~/Videos/MASTERIAI/raw_video_files$

Original issue reported on code.google.com by povilas....@gmail.com on 7 Jun 2013 at 12:44

GoogleCodeExporter commented 8 years ago
> --description="Let’s check"

This character looks weird, try with '

Original comment by tokland on 7 Jun 2013 at 12:49

GoogleCodeExporter commented 8 years ago
Yes. I changed it to:
--description="Let it check"
and now is OK.

Thanks a lot!!!

Original comment by povilas....@gmail.com on 7 Jun 2013 at 1:09

GoogleCodeExporter commented 8 years ago
> and now is OK

Great. The thing is that it should have worked in a UTF8 terminal (it worked 
here)...

Original comment by tokland on 7 Jun 2013 at 1:14

GoogleCodeExporter commented 8 years ago

Original comment by tokland on 13 May 2014 at 8:32