Message53770
| Author |
jackjansen |
| Recipients |
| Date |
2003年03月03日.12:10:59 |
| SpamBayes Score |
| Marked as misclassified |
| Message-id |
| In-reply-to |
| Content |
Logged In: YES
user_id=45365
The problem is that codecs.open() forces binary mode on the underlying file object, and this defeats the U mode.
My feeling is that it should be okay to open the underlying file in text mode, thereby enabling the U flag to be passed. Opening the file in text mode would break, however, if one of the following conditions is met:
- there are encodings where 0x0a or 0x0d are valid characters, not end of line.
- there are libc implementations where opening a file in text mode has
more implications than converting \r or \r\n to \n, i.e. if they change
other bytes as well.
Re-assigning to MAL, as he put the binary mode in in the first place. If this was just defensive programming we might try taking it out, if there was a real error case with text mode then codecs.open should probably at least signal an error if universal newline mode is requested. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2007年08月23日 16:06:24 | admin | link | issue691291 messages |
| 2007年08月23日 16:06:24 | admin | create |
|