Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Issue 109 in pyfilesystem: ZipFS inserts extra '\r' characters to binary files on Windows
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all  -  Translate all to Translated (View all originals)
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
pyfilesys...@googlecode.com  
View profile  
 More options Jan 30 2012, 9:42 am
From: pyfilesys...@googlecode.com
Date: Mon, 30 Jan 2012 14:42:14 +0000
Local: Mon, Jan 30 2012 9:42 am
Subject: Issue 109 in pyfilesystem: ZipFS inserts extra '\r' characters to binary files on Windows
Status: New
Owner: ----
Labels: Type-Defect Priority-Medium

New issue 109 by make...@gmail.com: ZipFS inserts extra '\r' characters to  
binary files on Windows
http://code.google.com/p/pyfilesystem/issues/detail?id=109

What steps will reproduce the problem?
1. Run the attached test case under Windows

What is the expected output?
The unit test passes. This happens on Linux.

What do you see instead?
The unit test fails with:
AssertionError: ' \r\n' != ' \n'

(writing binary file on ZipFS has inserted extra '\r' character)

What version of the product are you using? On what operating system?
fs-0.4.0.1-py2.6.egg, Windows 7 64-bit

Attachments:
        zipfs_binary_test.py  886 bytes


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
pyfilesys...@googlecode.com  
View profile  
 More options Jan 30 2012, 9:46 am
From: pyfilesys...@googlecode.com
Date: Mon, 30 Jan 2012 14:46:15 +0000
Local: Mon, Jan 30 2012 9:46 am
Subject: Re: Issue 109 in pyfilesystem: ZipFS inserts extra '\r' characters to binary files on Windows

Comment #1 on issue 109 by make...@gmail.com: ZipFS inserts extra '\r'  
characters to binary files on Windows
http://code.google.com/p/pyfilesystem/issues/detail?id=109

Forgot to add, that I tested Python 2.6 zipfile module functionality with  
similar test case and it seems to work ok - no line ending conversion  
happening.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
pyfilesys...@googlecode.com  
View profile  
 More options Jan 30 2012, 9:54 am
From: pyfilesys...@googlecode.com
Date: Mon, 30 Jan 2012 14:54:17 +0000
Local: Mon, Jan 30 2012 9:54 am
Subject: Re: Issue 109 in pyfilesystem: ZipFS inserts extra '\r' characters to binary files on Windows

Comment #2 on issue 109 by make...@gmail.com: ZipFS inserts extra '\r'  
characters to binary files on Windows
http://code.google.com/p/pyfilesystem/issues/detail?id=109

Ah, simple patch like this fixes the issue:

diff -Naur fs-0.4.0.1-py2.6.egg/fs/zipfs.py fs-0.4.0.1-py2.6.new/fs/zipfs.py
--- fs-0.4.0.1-py2.6.egg/fs/zipfs.py    2012-01-30 10:20:00.368608813 +0200
+++ fs-0.4.0.1-py2.6.new/fs/zipfs.py    2012-01-30 16:51:51.000000000 +0200
@@ -37,7 +37,7 @@
      def __init__(self, fs, filename, close_callback):
          self.fs = fs
          self.filename = filename
-        self._file = self.fs.open(filename, 'w+')
+        self._file = self.fs.open(filename, 'wb+')
          self.close_callback = close_callback

      def write(self, data):


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
pyfilesys...@googlecode.com  
View profile  
 More options Jan 30 2012, 10:13 am
From: pyfilesys...@googlecode.com
Date: Mon, 30 Jan 2012 15:13:27 +0000
Local: Mon, Jan 30 2012 10:13 am
Subject: Re: Issue 109 in pyfilesystem: ZipFS inserts extra '\r' characters to binary files on Windows
Updates:
        Status: Fixed

Comment #3 on issue 109 by willmcgugan: ZipFS inserts extra '\r' characters  
to binary files on Windows
http://code.google.com/p/pyfilesystem/issues/detail?id=109

That looks as though it has already been fixed in trunk. Have added your  
test though. Thanks.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
pyfilesys...@googlecode.com  
View profile  
 More options Jan 30 2012, 10:19 am
From: pyfilesys...@googlecode.com
Date: Mon, 30 Jan 2012 15:19:29 +0000
Local: Mon, Jan 30 2012 10:19 am
Subject: Re: Issue 109 in pyfilesystem: ZipFS inserts extra '\r' characters to binary files on Windows

Comment #4 on issue 109 by gc...@loowis.durge.org: ZipFS inserts extra '\r'  
characters to binary files on Windows
http://code.google.com/p/pyfilesystem/issues/detail?id=109

It was fixed here :)
http://code.google.com/p/pyfilesystem/issues/detail?id=80


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »