4424: CRITICAL: 'ascii' codec can't decode byte 0xe9 in position 3: ordinal not in range(128)

sdompierre

What version are you running?

0.7.5

What steps will reproduce the problem?

  1. Have a registry key with forein character in it in the MIME types database (example: Vidéo pour Adobe Flash)
  2. Use rbt post to upload a review with Perforce (occurs with or without the --update option)
  3. Wait for the diff generation, the error should appear after.

What is the expected output? What do you see instead?

expected output:
The review diff is generated correclty

what is seen:
CRITICAL: 'ascii' codec can't decode byte 0xe9 in position 3: ordinal not in range(128) and the review submission fails

What operating system are you using?

Windows 7

Attach the debug out from the command.

$ rbt <command> --debug <args>
<debug output>

Traceback (most recent call last):
File "C:\Program Files (x86)\RBTools\bin..\Python27\Scripts\rbt-script.py", line 8, in <module>
load_entry_point('RBTools==0.7.5alpha0', 'console_scripts', 'rbt')()
File "C:\Program Files (x86)\RBTools\Python27\lib\site-packages\rbtools-0.7.5alpha0-py2.7.egg\rbtools\commands\main.py
", line 133, in main
command.run_from_argv([RB_MAIN, command_name] + args)
File "C:\Program Files (x86)\RBTools\Python27\lib\site-packages\rbtools-0.7.5alpha0-py2.7.egg\rbtools\commands_init
_.py", line 622, in run_from_argv
exit_code = self.main(*args) or 0
File "C:\Program Files (x86)\RBTools\Python27\lib\site-packages\rbtools-0.7.5alpha0-py2.7.egg\rbtools\commands\post.py
", line 746, in main
validate_kwargs)
File "C:\Program Files (x86)\RBTools\Python27\lib\site-packages\rbtools-0.7.5alpha0-py2.7.egg\rbtools\api\decorators.p
y", line 27, in request_method
*args,
kwargs)
File "C:\Program Files (x86)\RBTools\Python27\lib\site-packages\rbtools-0.7.5alpha0-py2.7.egg\rbtools\api\transport\sy
nc.py", line 75, in execute_request_method
return self._execute_request(request)
File "C:\Program Files (x86)\RBTools\Python27\lib\site-packages\rbtools-0.7.5alpha0-py2.7.egg\rbtools\api\transport\sy
nc.py", line 84, in _execute_request
rsp = self.server.make_request(request)
File "C:\Program Files (x86)\RBTools\Python27\lib\site-packages\rbtools-0.7.5alpha0-py2.7.egg\rbtools\api\request.py",
line 572, in make_request
content_type, body = request.encode_multipart_formdata()
File "C:\Program Files (x86)\RBTools\Python27\lib\site-packages\rbtools-0.7.5alpha0-py2.7.egg\rbtools\api\request.py",
line 119, in encode_multipart_formdata
mime_type = mimetypes.guess_type(filename)[0]
File "C:\Program Files (x86)\RBTools\Python27\lib\mimetypes.py", line 297, in guess_type
init()
File "C:\Program Files (x86)\RBTools\Python27\lib\mimetypes.py", line 358, in init
db.read_windows_registry()
File "C:\Program Files (x86)\RBTools\Python27\lib\mimetypes.py", line 258, in read_windows_registry
for subkeyname in enum_types(hkcr):
File "C:\Program Files (x86)\RBTools\Python27\lib\mimetypes.py", line 249, in enum_types
ctype = ctype.encode(default_encoding) # omit in 3.x!
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe9 in position 3: ordinal not in range(128)

Please provide any additional information below.

This started to happen after installing Adobe Flash (french version). Changing the 'é' character in the registry key for an 'e' bypassed the issue.

chipx86
#1 chipx86

This looks to be https://bugs.python.org/issue9291. I'm not really sure what version this ended up in, but RBTools for Windows is shipping with an older Python for now (due to the fact that the installer we're using is no longer maintained and no longer shipping new versions... It's on our todo list to replace this).

Another option for now (other than changing the registry) would be to install an official build of Python and then install RBTools using pip.

  • -New
    +Confirmed
  • +Release-0.8.x
  • +OpSys:Windows
chipx86
#2 chipx86
  • +Unicode
david
#3 david

RBTools 0.7.8 ships with a modern version of python.

  • -Confirmed
    +Fixed