win32: bzr cat is unusable on Windows
Bug #55276 reported by
Alexander Belchenko
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Bazaar |
Fix Released
|
High
|
Alexander Belchenko |
Bug Description
bzr command 'cat' is unusable on Windows because it emit content of file to stabdard stdout that opened on win32 in text mode. So all '\n' converted to '\r\n'. It's make it unusable to obtain past version of file because it mangle line-endings. Especially it affects binary files.
Possible solutions:
1. Reopen sys.stdout in binary mode
2. Provide additional flag for command like '--output=filename' to write file content directly to specified file (as alternative to usage 'bzr cat file1 -rN > file2').
This issue also affects 'diff' and 'bundle-revisions' commands.
Changed in bzr: | |
assignee: | nobody → bialix |
Changed in bzr: | |
status: | Confirmed → In Progress |
To post a comment you must log in.
I did write this plugin: bzr.arbash- meinel. com/plugins/ binary_ sys/
http://
Which changes sys.stdout, and sys.stderr so that they are switched to binary mode.
I was planning on making something more explicit (commands that need exact preservation would call a function to enable binary mode).
But I haven't gotten around to it yet. binary_ output( )' before it continued to do more work.
It could be a simple helper function on Command. And a command like cmd_diff could just call 'self.set_