fabioz/Pydev — pull request #51 by akruis (2013-08-09 18:05:19+00:00)
Title: Fixes for non ASCII / non UTF-8 file names

Hi Fabio,

many thanks for providing PyDev. I'm using it all the time. Recently I had to sort out encoding issues in one of my applications and I moved the complete eclipse workspace into a directory whose name contained a German umlaut 'ä'. I must have been mad. :-) As a result you get 3 commits fixing Pydev problems.

My environment
eclipse 3.8, Windows 7, Linux, Python 2.7.

I'm out of office for the next 3 weeks. Therefore I only tested my patches with
Python 2.7.5 on Windows, Linux UTF-8 and Linux ISO-8859-1. The patches fix the following defects.

1. Configuration of a Python Interpreter fails, if the path to the Python interpreter is not a valid UTF-8 string. Commit f9238a8.

2. If you run Python unit tests and the path name of an Python file is not a valis UTF-8 string pydev_runfiles_xml_rpc.py creates invalid XML-RPC requests. Commit b5f4a8e sets the
encoding of the XML-RPC request to the file system encoding. That's not an ideal solution,
because it abuses the XML parser to convert file names to unicode. But I do not have the
time to work through all the pydev_runfiles_*.py files to recode file names only.
````
Aug 9, 2013 6:30:57 PM org.apache.xmlrpc.server.XmlRpcErrorLogger log
SEVERE: Failed to read XML-RPC request: Invalid byte 2 of 3-byte UTF-8 sequence.
org.apache.xmlrpc.XmlRpcException: Failed to read XML-RPC request: Invalid byte 2 of 3-byte UTF-8 sequence.
at org.apache.xmlrpc.server.XmlRpcStreamServer.getRequest(XmlRpcStreamServer.java:73)
````

3. If you debug Python code, the debugger sends file names as part of the
thread suspend message. If the debugger is running on Python2 file names
are byte strings encoded in the file system encoding. This patch
converts the names to UTF-8. Without this patch, the debugger GUI is
unable to locate the python source files. Commit 00ef651.