[issue14907] SSL module cannot handle unicode filenames

2012-06-05 Thread Marc Schlaich
Marc Schlaich added the comment: For example it is broken in the well known requests library: >>> import requests >>> requests.get('x', cert=u'öäü.pem') Traceback (most recent call last): File "", line 1, in ... UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-2: or

[issue14907] SSL module cannot handle unicode filenames

2012-06-05 Thread Marc Schlaich
Marc Schlaich added the comment: Well, the Unicode HOWTO states: When opening a file for reading or writing, you can usually just provide the Unicode string as the filename, and it will be automatically converted to the right encoding for you This is really an unexpected behavior which could

[issue14907] SSL module cannot handle unicode filenames

2012-06-04 Thread Martin v . Löwis
Martin v. Löwis added the comment: I'm closing it as won't fix. I don't think it needs to be documented, but I won't mind if it is. -- nosy: +loewis resolution: -> wont fix status: open -> closed ___ Python tracker

[issue14907] SSL module cannot handle unicode filenames

2012-05-26 Thread Hynek Schlawack
Hynek Schlawack added the comment: I'd just add some general catch-all phrase at the top that all paths are expected to be encoded strings. -- ___ Python tracker ___ __

[issue14907] SSL module cannot handle unicode filenames

2012-05-26 Thread Antoine Pitrou
Antoine Pitrou added the comment: Honestly, I'm not sure it is worth documenting. How to use the ca_certs argument is clear when reading the examples further in the ssl doc page, and detailing the quirks of each and every argument would make the text much less readable. -- _

[issue14907] SSL module cannot handle unicode filenames

2012-05-26 Thread Hynek Schlawack
Hynek Schlawack added the comment: So are we going to add something to the docs or just close as rejected? -- ___ Python tracker ___

[issue14907] SSL module cannot handle unicode filenames

2012-05-26 Thread Antoine Pitrou
Antoine Pitrou added the comment: Indeed, it would probably be a new feature to accept unicode there, and we don't add new features to 2.7. As Hynek said, Python 3 is fine. -- ___ Python tracker _

[issue14907] SSL module cannot handle unicode filenames

2012-05-25 Thread Terry J. Reedy
Terry J. Reedy added the comment: There are other paramaters that take optional 'files'. Whatever change is made should be done uniformly for all. 'File' is unfortunately vague, as it could mean file object or file name or both. If file name, it could be str only or (for 2.7), str and unicode

[issue14907] SSL module cannot handle unicode filenames

2012-05-25 Thread Hynek Schlawack
Hynek Schlawack added the comment: Seems to work fine in Python 3.2+. Two possibilities: 1. document ca_certs is str only 2. encode with sys.getfilesystemencoding() if unicode Would have to be fixed in ssl.get_server_certificate too and maybe even more, I did just a quick glance.

[issue14907] SSL module cannot handle unicode filenames

2012-05-24 Thread Marc Schlaich
New submission from Marc Schlaich : Here is a short example to reproduce the error: >>> import socket, ssl >>> sock = socket.socket() >>> sock = ssl.wrap_socket(sock, cert_reqs=ssl.CERT_REQUIRED, ca_certs=u'ä.crt') >>> sock.connect((None, None)) Traceback (most recent call last): File "", line