[Patches] [ python-Patches-1214889 ] file.encoding support for file.write and file.writelines

SourceForge.net noreply at sourceforge.net
Sun Jun 5 09:56:21 CEST 2005


Patches item #1214889, was opened at 2005-06-04 19:45
Message generated for change (Comment added) made by birkenfeld
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1214889&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Core (C code)
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Submitted By: Reinhold Birkenfeld (birkenfeld)
Assigned to: Nobody/Anonymous (nobody)
Summary: file.encoding support for file.write and file.writelines

Initial Comment:
Here is a patch that allows Unicode strings written to
a file being automatically encoded. It enables Python
code to set file.encoding and obeys this encoding when
writing Unicode strings with write() or writelines().

It is my first core hackery, so forgive me one leaked
ref or the other. I hope I got the error handling
right; it is kind of confusing...

(btw: Bug #967986 will be fixed with this)

----------------------------------------------------------------------

>Comment By: Reinhold Birkenfeld (birkenfeld)
Date: 2005-06-05 09:56

Message:
Logged In: YES 
user_id=1188172

Third revision; adds new documentation and allows Python
code to set the encoding to Py_None.

----------------------------------------------------------------------

Comment By: Hye-Shik Chang (perky)
Date: 2005-06-05 04:26

Message:
Logged In: YES 
user_id=55188

The idea looks good to me.
I attached a revised patch fixed code style, C99-style local
variable declaration and added a regrtest.
I think some documentation update will be needed also.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1214889&group_id=5470


More information about the Patches mailing list