[issue4947] sys.stdout fails to use default encoding as advertised

2010-09-08 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: I commited my patch (with a new test, iso-8859-1:replace) to 2.7: r84621. I will no backport to 2.6 because this branch now only accept security fixes. -- resolution: - fixed status: open - closed

[issue4947] sys.stdout fails to use default encoding as advertised

2010-09-07 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- nosy: +lemburg ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4947 ___ ___ Python-bugs-list mailing

[issue4947] sys.stdout fails to use default encoding as advertised

2010-08-14 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Attached patch fixes this old and annoying issue. The issue only concerns sys.std* files, because Python only set the encoding and errors attributes for these files. -- keywords: +patch versions: +Python 2.7 Added file:

[issue4947] sys.stdout fails to use default encoding as advertised

2010-08-14 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Oh, I forgot to write that my patch uses also the errors attribute. Update the patch to add tests on errors: file_write-2.7-v2.patch. -- Added file: http://bugs.python.org/file18522/file_write-2.7-v2.patch

[issue4947] sys.stdout fails to use default encoding as advertised

2010-08-14 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: Removed file: http://bugs.python.org/file18521/file_write-2.7.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4947 ___

[issue4947] sys.stdout fails to use default encoding as advertised

2010-08-14 Thread Antoine Pitrou
Antoine Pitrou pit...@free.fr added the comment: Your patch threatens to break compatibility. I think it would be better to simply change the encoding and errors attributes of standard streams. -- ___ Python tracker rep...@bugs.python.org

[issue4947] sys.stdout fails to use default encoding as advertised

2010-08-14 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: Your patch threatens to break compatibility Yes it does. But I think that nobody relies on this bug. If your terminal uses something that utf-8, you will see strange characters if you write something else than ascii characters. I

[issue4947] sys.stdout fails to use default encoding as advertised

2010-08-14 Thread STINNER Victor
STINNER Victor victor.stin...@haypocalc.com added the comment: 3rd version of the patch: accept character buffer objects without reencoding them. Add also tests on character buffer objects. -- Added file: http://bugs.python.org/file18524/file_write-2.7-v3.patch

[issue4947] sys.stdout fails to use default encoding as advertised

2010-08-14 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@haypocalc.com: Removed file: http://bugs.python.org/file18522/file_write-2.7-v2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4947 ___

[issue4947] sys.stdout fails to use default encoding as advertised

2010-08-13 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- nosy: +haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4947 ___ ___ Python-bugs-list mailing list

[issue4947] sys.stdout fails to use default encoding as advertised

2010-06-09 Thread Terry J. Reedy
Changes by Terry J. Reedy tjre...@udel.edu: -- versions: -Python 2.4, Python 2.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4947 ___ ___

[issue4947] sys.stdout fails to use default encoding as advertised

2009-09-24 Thread Sridhar Ratnakumar
Changes by Sridhar Ratnakumar sridh...@activestate.com: -- nosy: +srid ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4947 ___ ___ Python-bugs-list

[issue4947] sys.stdout fails to use default encoding as advertised

2009-07-28 Thread Chris Rebert
Changes by Chris Rebert pyb...@rebertia.com: -- nosy: +cvrebert ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4947 ___ ___ Python-bugs-list

[issue4947] sys.stdout fails to use default encoding as advertised

2009-07-28 Thread Ezio Melotti
Changes by Ezio Melotti ezio.melo...@gmail.com: -- nosy: +ezio.melotti ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4947 ___ ___ Python-bugs-list

[issue4947] sys.stdout fails to use default encoding as advertised

2009-05-26 Thread Denilson Figueiredo de Sá
Changes by Denilson Figueiredo de Sá denilso...@gmail.com: -- nosy: +denilsonsa ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4947 ___ ___

[issue4947] sys.stdout fails to use default encoding as advertised

2009-05-12 Thread Jan Kaliszewski
Jan Kaliszewski z...@chopin.edu.pl added the comment: The matter had been discussed (and not once...), IMO without satisfactory conclusion -- see: * http://bugs.python.org/issue612627 (the feature added) * http://bugs.python.org/issue1214889 (another feature rejected) *

[issue4947] sys.stdout fails to use default encoding as advertised

2009-05-12 Thread Jan Kaliszewski
Jan Kaliszewski z...@chopin.edu.pl added the comment: PS. The main problem is not a lack of feature but that inconsistency, and that's not documented if File type docs: print my_file, my_unicode # - is encoded with my_file.encoding my_file.write(my_unicode) # - is encoded with

[issue4947] sys.stdout fails to use default encoding as advertised

2009-05-12 Thread Jan Kaliszewski
Jan Kaliszewski z...@chopin.edu.pl added the comment: s / if File / in File s / -- works # - is encoded with my_file.encoding / # - is encoded with sys.stdout.encoding (sorry, too little sleep) -- ___ Python tracker rep...@bugs.python.org

[issue4947] sys.stdout fails to use default encoding as advertised

2009-05-12 Thread Jan Kaliszewski
Changes by Jan Kaliszewski z...@chopin.edu.pl: -- assignee: - georg.brandl components: +Documentation nosy: +georg.brandl ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4947 ___

[issue4947] sys.stdout fails to use default encoding as advertised

2009-02-04 Thread Qiangning Hong
Changes by Qiangning Hong hon...@gmail.com: -- nosy: +hongqn ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue4947 ___ ___ Python-bugs-list mailing

[issue4947] sys.stdout fails to use default encoding as advertised

2009-01-14 Thread Steven D'Aprano
New submission from Steven D'Aprano st...@pearwood.info: Documentation for files states that when writing to a file, unicode strings are converted to byte strings using the encoding specified by file.encoding. http://docs.python.org/library/stdtypes.html#file.encoding sys.stdout is a file,

[issue4947] sys.stdout fails to use default encoding as advertised

2009-01-14 Thread Gabriel Genellina
Gabriel Genellina gagsl-...@yahoo.com.ar added the comment: It probably uses sys.getdefaultencoding() instead. That would be wrong too, according to the cited documentation. file.encoding is a read only attribute; it can be set in C code using PyFile_SetEncoding. Apart from its definition in