[issue11501] distutils.archive_util should handle absence of zlib module

2016-09-27 Thread Berker Peksag

Changes by Berker Peksag :


--
resolution:  -> fixed
stage: needs patch -> resolved
status: pending -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11501] distutils.archive_util should handle absence of zlib module

2016-06-02 Thread Berker Peksag

Berker Peksag added the comment:

Tests are already skipped if zlib is not available in 2.7. To backport 
test_make_zipfile_no_zlib we also need the 'patch' helper so I'm not sure it's 
worth it at this point.

--
nosy: +berker.peksag
status: open -> pending

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11501] distutils.archive_util should handle absence of zlib module

2014-10-03 Thread R. David Murray

R. David Murray added the comment:

If this is still wanted for python2, someone should create a 2.7 specific patch.

--
keywords: +easy
nosy: +r.david.murray
stage: commit review -> needs patch
type: crash -> behavior
versions:  -Python 3.1, Python 3.2, Python 3.3

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11501] distutils.archive_util should handle absence of zlib module

2012-04-11 Thread Éric Araujo

Éric Araujo  added the comment:

Reopening for 2.7.4.

--
assignee: tarek -> eric.araujo
resolution: fixed -> 
stage: committed/rejected -> commit review
status: closed -> open
versions: +Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11501] distutils.archive_util should handle absence of zlib module

2011-03-15 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed
versions: +Python 3.1, Python 3.2

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11501] distutils.archive_util should handle absence of zlib module

2011-03-15 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 6b33aa811821 by Antoine Pitrou in branch '3.1':
On behalf of Tarek: Issue #11501: disutils.archive_utils.make_zipfile no
http://hg.python.org/cpython/rev/6b33aa811821

New changeset 1bf4383f190a by Antoine Pitrou in branch '3.2':
Merge fix for issue #11501
http://hg.python.org/cpython/rev/1bf4383f190a

New changeset cccddd797d95 by Antoine Pitrou in branch 'default':
Merge fix for issue #11501
http://hg.python.org/cpython/rev/cccddd797d95

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11501] distutils.archive_util should handle absence of zlib module

2011-03-15 Thread Tarek Ziadé

Changes by Tarek Ziadé :


Removed file: http://bugs.python.org/file21142/pycon-issue11501.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11501] distutils.archive_util should handle absence of zlib module

2011-03-15 Thread Tarek Ziadé

Changes by Tarek Ziadé :


Removed file: http://bugs.python.org/file21137/pycon-issue11501.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11501] distutils.archive_util should handle absence of zlib module

2011-03-15 Thread Natalia B. Bidart

Natalia B. Bidart  added the comment:

Attaching a new patch with latest changes from trunk merged in (conflicts 
resolved).

--
Added file: http://bugs.python.org/file21211/pycon-issue11501.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11501] distutils.archive_util should handle absence of zlib module

2011-03-15 Thread Natalia B. Bidart

Natalia B. Bidart  added the comment:

On Tue, Mar 15, 2011 at 7:15 AM, Éric Araujo  wrote:
>
> Éric Araujo  added the comment:
>
>> I'm not using "if zlib is not None" since the archive_utils module
>> never explicitly imports zlib.
>
> Well, you can import zlib in that module too to detect in advance whether 
> zipfile will work.

Indeed, but from my POV that's less cleaner than the proposed
solution: importing a module that is not used (other than checking for
a condition) may generate confusion to a reader. IMHO, the proposed
solution may ease the readability of the code block by being
super-explicit about what condition is being handled when creating the
ZipFile.

Let me know if you still consider I should change that.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11501] distutils.archive_util should handle absence of zlib module

2011-03-15 Thread Éric Araujo

Éric Araujo  added the comment:

> I'm not using "if zlib is not None" since the archive_utils module
> never explicitly imports zlib.

Well, you can import zlib in that module too to detect in advance whether 
zipfile will work.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11501] distutils.archive_util should handle absence of zlib module

2011-03-14 Thread Natalia B. Bidart

Natalia B. Bidart  added the comment:

* Added change notice to Misc/NEWS.
* changed patch method implementation so AttributeError is raised when trying 
to patch a non-existent attribute for an object (see Éric's comment).

--
Added file: http://bugs.python.org/file21142/pycon-issue11501.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11501] distutils.archive_util should handle absence of zlib module

2011-03-14 Thread Natalia B. Bidart

Natalia B. Bidart  added the comment:

Hi Éric,

Thanks for looking at the patch. I'm not using "if zlib is not None" since the 
archive_utils module never explicitly imports zlib. Only the zipfile module 
imports zlib and raises RuntimeError if not available (as per 
http://docs.python.org/library/zipfile.html#zipfile-objects).

I'm changing the patch function to raise an exception as requested.

--
versions:  -Python 2.7, Python 3.1, Python 3.2

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11501] distutils.archive_util should handle absence of zlib module

2011-03-14 Thread Éric Araujo

Éric Araujo  added the comment:

Thanks.  One question: why not using a clause like “if zlib is not None” 
instead of catching a RuntimeError?  The if test looks more specific to me, 
whereas the RuntimeError might come from something else, and thus shouldn’t 
always e ignored.

In the patch function, I would not use assert but hasattr and a real exception 
(so that the behavior does not change when run under python -O).

--
versions: +Python 2.7, Python 3.1, Python 3.2

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11501] distutils.archive_util should handle absence of zlib module

2011-03-14 Thread Natalia B. Bidart

Natalia B. Bidart  added the comment:

Attaching patch that performs the following:

* skip all the distutils tests that need zlib in order to run properly.
* add a new test (test_make_zipfile_no_zlib) to ensure that make_zipfile uses 
the compression option from zipfile module that works without zlib.
* add a helper method to patch objects.

The fix itself was discussed with Tarek, and the patch helper implementation 
was discussed with Michael Foord.

--
components: +Distutils -Distutils2
keywords: +patch
Added file: http://bugs.python.org/file21137/pycon-issue11501.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11501] distutils.archive_util should handle absence of zlib module

2011-03-14 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue11501] distutils.archive_util should handle absence of zlib module

2011-03-14 Thread Natalia B. Bidart

New submission from Natalia B. Bidart :

When creating a zipfile, the code:

zip = zipfile.ZipFile(zip_filename, "w",
  compression=zipfile.ZIP_DEFLATED)

does not handle the potential RuntimeError casued by:

"If ZIP_DEFLATED is specified but the zlib module is not available, 
RuntimeError is also raised."

--
assignee: tarek
components: Distutils2
messages: 130847
nosy: alexis, eric.araujo, nessita, tarek
priority: normal
severity: normal
status: open
title: distutils.archive_util should handle absence of zlib module
type: crash
versions: Python 3.3

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com