Message118630
We shouldn't need to reopen the file in the first place. If we already have a file handle, we can rewind it. Then the encoding of the file name becomes irrelevant.
I keep forgetting: what was the plan for deprecating the FILE* functions in the parser interface? If we need to continue to support them, we could read the whole contents of the file before parsing, and then use the memory-based parsing algorithm.
If parsing files can be fully based on the IO module, we shouldn't even need to rewind the file. Instead, the io module should support switching the encoding mid-stream (unless, say, we are in the middle of a multibyte character - since the parser always asks for complete lines, this should not happen). |
|
Date |
User |
Action |
Args |
2010-10-14 07:17:01 | loewis | set | recipients:
+ loewis, vstinner |
2010-10-14 07:17:01 | loewis | set | messageid: <1287040621.55.0.67360038173.issue10095@psf.upfronthosting.co.za> |
2010-10-14 07:16:59 | loewis | link | issue10095 messages |
2010-10-14 07:16:58 | loewis | create | |
|