[issue14399] zipfile and creat/update comment

2015-05-14 Thread R. David Murray
R. David Murray added the comment: :( :( OK, next time this comes up I won't say "it will probably be OK". -- ___ Python tracker ___

[issue14399] zipfile and creat/update comment

2015-05-14 Thread Mark Dickinson
Mark Dickinson added the comment: Just for the record, David's comment at msg158136 is apposite: > We've had trouble in the past with a conversion to new style class > breaking people's code. People are less likely to be subclassing > ZipFile, though, so it is probably OK. We just spent some t

[issue14399] zipfile and creat/update comment

2012-04-13 Thread R. David Murray
R. David Murray added the comment: I must have been seeing what I expected to see. The test that failed was the non-empty test. News item fixed, thanks for the correction. -- ___ Python tracker

[issue14399] zipfile and creat/update comment

2012-04-13 Thread Roundup Robot
Roundup Robot added the comment: New changeset b3b7f9dd7ce4 by R David Murray in branch '3.2': #14399: corrected news item http://hg.python.org/cpython/rev/b3b7f9dd7ce4 New changeset 225126c9d4b5 by R David Murray in branch '2.7': #14399: corrected news item http://hg.python.org/cpython/rev/225

[issue14399] zipfile and creat/update comment

2012-04-13 Thread R. David Murray
R. David Murray added the comment: Ah. I based that on the fact that the third test passed without the change. I thought you were adding that test of changing the comment just as a double check. I should have asked instead of assuming. -- ___ Py

[issue14399] zipfile and creat/update comment

2012-04-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > #14399: zipfile now correctly handles comments added to empty zipfiles. This is a wrong description of the issue. On the contrary, the error occurred when adding or changing the comment in a *non-empty* zipfile without adding or changing files. Descriptio

[issue14399] zipfile and creat/update comment

2012-04-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > I mean "with self.assertRaises(TypeError):". Thank you, I did not know that the context managers may catch exceptions from the nested block. -- ___ Python tracker ___

[issue14399] zipfile and creat/update comment

2012-04-12 Thread R. David Murray
R. David Murray added the comment: I mean "with self.assertRaises(TypeError):". -- ___ Python tracker ___ ___ Python-bugs-list mailin

[issue14399] zipfile and creat/update comment

2012-04-12 Thread R. David Murray
R. David Murray added the comment: Thanks, Serhiy. I made one small change, using 'with self.assertEqual' in the TypeError test. You might want to check that out, it is a useful technique. Oh, and I removed the type check from the 2.7 patch. You can use a unicode string as long as it doesn

[issue14399] zipfile and creat/update comment

2012-04-12 Thread Roundup Robot
Roundup Robot added the comment: New changeset ac0ec1f31b0a by R David Murray in branch '2.7': #14399: zipfile now correctly handles comments added to empty zipfiles. http://hg.python.org/cpython/rev/ac0ec1f31b0a New changeset 4186f20d9fa4 by R David Murray in branch '3.2': #14399: zipfile now

[issue14399] zipfile and creat/update comment

2012-04-12 Thread R. David Murray
R. David Murray added the comment: Thanks. We've had trouble in the past with a conversion to new style class breaking people's code. People are less likely to be subclassing ZipFile, though, so it is probably OK. -- ___ Python tracker

[issue14399] zipfile and creat/update comment

2012-04-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you, the TypeError test helped me find the error. Here is the corrected patch. For 2.7 it was necessary to turn the ZipFile in the new-style class. -- Added file: http://bugs.python.org/file25190/fix_zipfile_comment_4.patch Added file: http://b

[issue14399] zipfile and creat/update comment

2012-04-11 Thread R. David Murray
Changes by R. David Murray : -- Removed message: http://bugs.python.org/msg158095 ___ Python tracker ___ ___ Python-bugs-list mailing

[issue14399] zipfile and creat/update comment

2012-04-11 Thread R. David Murray
R. David Murray added the comment: Serhiy: this looks good. I get some test errors when I apply it on 2.7 though. Would you be interested in doing a 2.7 version as well? (Minor comment: the test method would be better as two test methods, and it would be nice to have a third test method tha

[issue14399] zipfile and creat/update comment

2012-04-11 Thread R. David Murray
R. David Murray added the comment: Serhiy: this looks good. I get some test errors when I apply it on 2.7 though. Would you be interested in doing a 2.7 version as well? (Minor comment: the test method would be better as two test methods, and it would be nice to have a third test method tha

[issue14399] zipfile and creat/update comment

2012-03-27 Thread Ethan Furman
Ethan Furman added the comment: I see a comment around line 240 that says: # It is assumed that the "end of central directory" magic # number does not appear in the comment. Any reason not to add that check to comment.setter? -- nosy: +stoneleaf __

[issue14399] zipfile and creat/update comment

2012-03-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: My fault. -- Added file: http://bugs.python.org/file25047/fix_zipfile_comment_3.patch ___ Python tracker ___

[issue14399] zipfile and creat/update comment

2012-03-27 Thread R. David Murray
R. David Murray added the comment: The tests don't seem to be included in the new patch. Also, you could modernize the property definition (@property, @comment.setter). -- ___ Python tracker

[issue14399] zipfile and creat/update comment

2012-03-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Fixed patch with tests attached. -- Added file: http://bugs.python.org/file25043/fix_zipfile_comment_2.patch ___ Python tracker ___ _

[issue14399] zipfile and creat/update comment

2012-03-27 Thread R. David Murray
R. David Murray added the comment: Got you. We'll definitely go with the more complete fix, then. -- ___ Python tracker ___ ___ Pyth

[issue14399] zipfile and creat/update comment

2012-03-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is the second advantage. The first one is that nothing is to be written when zipfile opened in a mode "a", if we don't change anything. -- ___ Python tracker _

[issue14399] zipfile and creat/update comment

2012-03-27 Thread R. David Murray
R. David Murray added the comment: Thanks for the patch. The advantage of the more complicated way being that you get an immediate TypeError instead of a delayed one? Is there any other advantage? (That's probably enough reason, though :) Now we just need a unit test for this. -- s

[issue14399] zipfile and creat/update comment

2012-03-27 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : Added file: http://bugs.python.org/file25039/fix_zipfile_comment_complex.patch ___ Python tracker ___ ___ Python

[issue14399] zipfile and creat/update comment

2012-03-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The bug only occurs for non-empty archives. There are two ways of fixing this bug -- very simple and no so simple. Patches are attached. -- keywords: +patch nosy: +storchaka Added file: http://bugs.python.org/file25038/fix_zipfile_comment_simple.pat

[issue14399] zipfile and creat/update comment

2012-03-26 Thread R. David Murray
R. David Murray added the comment: Hmm. When I did the same (changed to b'...') and ran it, I got an archive test.zip. When I then opened that archive using ZipFile, its comment attribute was b''. Thus I concluded that the bug exists in Python3. I don't remember seeing any output from run

[issue14399] zipfile and creat/update comment

2012-03-26 Thread Jeff Knupp
Jeff Knupp added the comment: I'm unable to reproduce on either 2.7 or 3.3. Running the following: from zipfile import ZipFile z=ZipFile('test.zip','a') z.comment='Create a new comment' z.close() produces the output: Archive: test.zip Create a new comment with the comment changed to b'...'

[issue14399] zipfile and creat/update comment

2012-03-26 Thread Anthony Kong
Changes by Anthony Kong : -- nosy: +Anthony.Kong ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.py

[issue14399] zipfile and creat/update comment

2012-03-26 Thread Cassaigne
Cassaigne added the comment: Tanks à lot. To complete Information about this bug. it up and take a look. The relevant code is in Python, and I'm guessing there is some logic bug when only the comment is set (and nothing is added to the zipfile), but I haven't looked at the code. I'm also addi

[issue14399] zipfile and creat/update comment

2012-03-25 Thread R. David Murray
R. David Murray added the comment: I'm marking this as easy hoping someone in the mentoring group will pick it up and take a look. The relevant code is in Python, and I'm guessing there is some logic bug when only the comment is set (and nothing is added to the zipfile), but I haven't looked

[issue14399] zipfile and creat/update comment

2012-03-24 Thread Cassaigne
New submission from Cassaigne : I want to update or create a comment to zip file. For instance, I have test.zip file. I'm using these statement to create a comment : from zipfile import ZipFile z=ZipFile('test.zip','a') z.comment='Create a new comment' z.close() After to ran this script, the