[issue9632] Remove sys.setfilesystemencoding()

2010-09-11 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: STINNER Victor wrote: > > STINNER Victor added the comment: > > I didn't proposed to add a new parameter to Py_InitializeEx() (which means > create a new function to not break the API), I just wrote that > _Py_SetFileSystemEncoding() doesn't work for yo

[issue9632] Remove sys.setfilesystemencoding()

2010-09-10 Thread STINNER Victor
STINNER Victor added the comment: I didn't proposed to add a new parameter to Py_InitializeEx() (which means create a new function to not break the API), I just wrote that _Py_SetFileSystemEncoding() doesn't work for your use case. > If you embed Python into another application, say as script

[issue9632] Remove sys.setfilesystemencoding()

2010-09-08 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: STINNER Victor wrote: > > STINNER Victor added the comment: > > "keep the C function" > > Hum, currently, Python3 only has a *private* function called > _Py_SetFileSystemEncoding() which can only be called after _Py_InitializeEx() > (because it relies

[issue9632] Remove sys.setfilesystemencoding()

2010-09-07 Thread STINNER Victor
STINNER Victor added the comment: "keep the C function" Hum, currently, Python3 only has a *private* function called _Py_SetFileSystemEncoding() which can only be called after _Py_InitializeEx() (because it relies on the codecs API). If you consider that there is a real use case, we should c

[issue9632] Remove sys.setfilesystemencoding()

2010-09-07 Thread STINNER Victor
STINNER Victor added the comment: About "embedded Python interpreters or py2exe-style applications": do you mean that the application calls a C function to set the encoding before starting the interpreter? Or you mean the Python function, sys.setfilesystemencoding()? I would like to remove th

[issue9632] Remove sys.setfilesystemencoding()

2010-09-03 Thread STINNER Victor
STINNER Victor added the comment: > In such environments you cannot expect the user to configure the > system properly (i.e. set an environment variable). Why would it be different for embeded python? > Instead, the application has to provide an educated guess > to the Python interpreter in s

[issue9632] Remove sys.setfilesystemencoding()

2010-08-27 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Antoine Pitrou wrote: > > Antoine Pitrou added the comment: > Think of e.g. embedded Python interpreters or py2exe-style applications running on Linux or other systems that don't use Unicode APIs for FS-interaction or have fixed FS-encodin

[issue9632] Remove sys.setfilesystemencoding()

2010-08-27 Thread Antoine Pitrou
Antoine Pitrou added the comment: > >> Think of e.g. embedded Python interpreters or py2exe-style applications > >> running on Linux or other systems that don't use Unicode APIs > >> for FS-interaction or have fixed FS-encodings. > > > > What is the problem here? Python does guess the filesyst

[issue9632] Remove sys.setfilesystemencoding()

2010-08-26 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: STINNER Victor wrote: > > STINNER Victor added the comment: > >> Think of e.g. embedded Python interpreters or py2exe-style applications >> running on Linux or other systems that don't use Unicode APIs >> for FS-interaction or have fixed FS-encodings. >

[issue9632] Remove sys.setfilesystemencoding()

2010-08-24 Thread Éric Araujo
Changes by Éric Araujo : -- nosy: +eric.araujo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pytho

[issue9632] Remove sys.setfilesystemencoding()

2010-08-24 Thread STINNER Victor
STINNER Victor added the comment: About the patch: it should patch "Filenames and unicode" section of Doc/whatsnew/3.2.rst (to explain that sys.setfilesystemencoding() is replaced by the PYTHONFSENCODING env var). -- ___ Python tracker

[issue9632] Remove sys.setfilesystemencoding()

2010-08-24 Thread STINNER Victor
STINNER Victor added the comment: > Think of e.g. embedded Python interpreters or py2exe-style applications > running on Linux or other systems that don't use Unicode APIs > for FS-interaction or have fixed FS-encodings. What is the problem here? Python does guess the filesystem encoding. If t

[issue9632] Remove sys.setfilesystemencoding()

2010-08-20 Thread Terry J. Reedy
Changes by Terry J. Reedy : -- stage: -> patch review type: -> feature request ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue9632] Remove sys.setfilesystemencoding()

2010-08-19 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: While you're right that adjusting the FS encoding long after Python has already started is probably not such a good idea, I do think that we need to provide a way to set the FS encoding from within Python without having to rely on external settings. Thin

[issue9632] Remove sys.setfilesystemencoding()

2010-08-19 Thread STINNER Victor
Changes by STINNER Victor : Removed file: http://bugs.python.org/file18565/remove_sys_setfilesystemencoding.patch ___ Python tracker ___ ___ P

[issue9632] Remove sys.setfilesystemencoding()

2010-08-19 Thread STINNER Victor
STINNER Victor added the comment: New version of the patch: remove also _Py_SetFileSystemEncoding(). -- Added file: http://bugs.python.org/file18576/remove_sys_setfilesystemencoding-2.patch ___ Python tracker

[issue9632] Remove sys.setfilesystemencoding()

2010-08-18 Thread STINNER Victor
Changes by STINNER Victor : -- keywords: +patch nosy: +Arfrever, lemburg, pitrou Added file: http://bugs.python.org/file18565/remove_sys_setfilesystemencoding.patch ___ Python tracker __

[issue9632] Remove sys.setfilesystemencoding()

2010-08-18 Thread STINNER Victor
New submission from STINNER Victor : sys.setfilesystemencoding() function is dangerous because it introduces a lot of inconsistencies: this function is unable to reencode all filenames in all objects (eg. Python is unable to find filenames in user objects or 3rd party libraries). Eg. if you ch