D
Daniel Ortmann
These problems only happen on Windows. On Linux everything works fine.
Has anyone else run into these bugs? Any suggestions?
Where do I find out the proper bug reporting process?
Problem #1:
While using the csv module's DictWriter on MSDOS (a.k.a. Windows2000),
the output files get newlines like \x0d\x0d\x0a instead of \x0d\x0a.
csvwriter = csv.DictWriter( file( out1filename, 'w' ), infieldnames, extrasaction='ignore' )
csvwriter.writerow( dict( zip( infieldnames, infieldnames ) ) )
Problem #2:
While trying to fix up the first problem I run into another problem.
The following string replace code works until right around the boundary
at 2^7 * 1024, i.e. near 131072 (around line 1224), and then inserts a
bunch of \x00's in the string!
Before the \x00's, all of the \x0d's were correctly replaced. After the
\x00's, NONE of them were replaced.
content = file( fname, 'rb' ).read().replace( '\x0d', '' )
file( fname, 'wb' ).write( content )
Problem #3:
The same problem also happens with the re module.
content = re.sub( '\x0d', '', file( fname, 'rb' ).read() )
file( fname, 'wb' ).write( content )
Has anyone else run into these bugs? Any suggestions?
Where do I find out the proper bug reporting process?
Problem #1:
While using the csv module's DictWriter on MSDOS (a.k.a. Windows2000),
the output files get newlines like \x0d\x0d\x0a instead of \x0d\x0a.
csvwriter = csv.DictWriter( file( out1filename, 'w' ), infieldnames, extrasaction='ignore' )
csvwriter.writerow( dict( zip( infieldnames, infieldnames ) ) )
Problem #2:
While trying to fix up the first problem I run into another problem.
The following string replace code works until right around the boundary
at 2^7 * 1024, i.e. near 131072 (around line 1224), and then inserts a
bunch of \x00's in the string!
Before the \x00's, all of the \x0d's were correctly replaced. After the
\x00's, NONE of them were replaced.
content = file( fname, 'rb' ).read().replace( '\x0d', '' )
file( fname, 'wb' ).write( content )
Problem #3:
The same problem also happens with the re module.
content = re.sub( '\x0d', '', file( fname, 'rb' ).read() )
file( fname, 'wb' ).write( content )