flying-circus / pyfilesystem

Automatically exported from code.google.com/p/pyfilesystem
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

error copy binary files into zipfs via fsutils #80

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.open OSFS
2.open ZIPFS
3. copy a binaryfile from OSFS into ZIPFS with the command fsutils.copyfile

What is the expected output? What do you see instead?

Expecting the correct binaryfile but I'm find a file attached with some new end 
of line characters.

What version of the product are you using? On what operating system?

Using rev 716

Please provide any additional information below.

The reason seems to be an not binary write command in the tempfs for zipfs. 
When changing the line 40 in zipfs.py:

from
"self._file = self.fs.open(filename, 'w+')" -> open an text file?
to
"self._file = self.fs.open(filename, 'wb+')" -> open a binary file?
the copyfile command works in the expected way.

There might be more or diffrent changes required for correct implementation.

Original issue reported on code.google.com by br1mobil@gmx.de on 28 Jul 2011 at 12:16

GoogleCodeExporter commented 9 years ago
I've pushed that change. I suspect that's the only issue. I'll go through it 
more thoroughly at some point. In the meantime, if you can confirm that fixes 
your issue, it would be appreciated.

Original comment by willmcgugan on 28 Jul 2011 at 1:58

GoogleCodeExporter commented 9 years ago

Original comment by willmcgugan on 10 Sep 2011 at 9:17