Message163373
| Author |
amaury.forgeotdarc |
| Recipients |
Tony.Malykh, amaury.forgeotdarc |
| Date |
2012年06月21日.22:05:44 |
| SpamBayes Score |
-1.0 |
| Marked as misclassified |
Yes |
| Message-id |
<1340316347.11.0.948094172018.issue15129@psf.upfronthosting.co.za> |
| In-reply-to |
| Content |
Your problem is similar to this discussion:
http://stackoverflow.com/questions/405058/line-reading-chokes-on-0x1a
On Python2, files are based on the fopen() C function, and on Windows files opened in text mode stop reading on the first character 26 (^Z, or EOF)
The best solution here is probably to open the file in "universal" mode:
f = open("test.txt", "rU")
...Or use Python3, which has a completely new implementation of the open() function. |
|
History
|
|---|
| Date |
User |
Action |
Args |
| 2012年06月21日 22:05:47 | amaury.forgeotdarc | set | recipients:
+ amaury.forgeotdarc, Tony.Malykh |
| 2012年06月21日 22:05:47 | amaury.forgeotdarc | set | messageid: <1340316347.11.0.948094172018.issue15129@psf.upfronthosting.co.za> |
| 2012年06月21日 22:05:46 | amaury.forgeotdarc | link | issue15129 messages |
| 2012年06月21日 22:05:44 | amaury.forgeotdarc | create |
|