Files are not written as binary

Bug #802728 reported by Roberto Alsina
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ubuntu One Client
Fix Released
High
Manuel de la Peña

Bug Description

When syncing a file created on Linux to Windows, the EOLs are being converted. This corrupts every non-text file.

Here is the example file created on Linux (14 bytes):

>>> print repr(open('test.txt','rb').read())
'Line 1\nLine 2\n'

And here is the same file after it's synced to windows:

>>> print repr(open('test.txt','rb').read())
'Line 1\r\nLine 2\r\n'

Probably a ' b' flag missing in some open call.

Related branches

Changed in ubuntuone-client:
assignee: nobody → Manuel de la Pena (mandel)
importance: Undecided → High
status: New → Triaged
tags: added: u1-zomg-windows
Revision history for this message
Manuel de la Peña (mandel) wrote :

Is more probable that some code is not using the os_helper.open_file method which adds the 'b' in the mode if not present. Lets hope that grep can return the exact places for this.

Revision history for this message
Manuel de la Peña (mandel) wrote :

I correct myself, it looks like in one of our reverts we lost the appending of the 'b' in the open_file from os_helper on windows, this should be a straight fix then :)

Changed in ubuntuone-client:
status: Triaged → In Progress
Changed in ubuntuone-client:
status: In Progress → Fix Committed
dobey (dobey)
Changed in ubuntuone-client:
milestone: none → 1.7.1
dobey (dobey)
Changed in ubuntuone-client:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.