[issue14736] Add {encode, decode}_filter_properties() functions to lzma module

2012-05-07 Thread Serhiy Storchaka

Serhiy Storchaka storch...@gmail.com added the comment:

 Changeset 9118ef2b651a was broken, but the bug should have been fixed by
 changeset 10ccbb90a8e9. Which revision have you been using?

I used the revision 76809:ab57e29157bb. Yes, now the bug fixed. Thank
you once again.

--
title: Add {encode,decode}_filter_properties() functions to lzma module - Add 
{encode, decode}_filter_properties() functions to lzma module

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



[issue14736] Add {encode, decode}_filter_properties() functions to lzma module

2012-05-06 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

The functionality looks a bit cryptic to me. What is the use case?

I wonder if Py_LONG_LONG is always defined (although it certainly is on major 
platforms).
Other than that, the patch looks technically correct, though I'm not an lzma 
expert.

--
nosy: +pitrou

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



[issue14736] Add {encode, decode}_filter_properties() functions to lzma module

2012-05-06 Thread Nadeem Vawda

Nadeem Vawda nadeem.va...@gmail.com added the comment:

 The functionality looks a bit cryptic to me. What is the use case?

Serializing filter specifiers for custom file formats. The particular
case that prompted adding the code is zipfile (issue 14366).

I've added a note to the docs and docstrings explaining this.


 I wonder if Py_LONG_LONG is always defined (although it certainly is on major 
 platforms).

I expect it will always be defined on platforms that support liblzma -
the API uses uint64_t in quite a few places, via the lzma_vli typedef.

In any case, _lzmamodule.c checks for PY_LONG_LONG explicitly at
compile-time and gives a useful error message if it is undefined.

--
Added file: http://bugs.python.org/file25480/lzma-properties.diff

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



[issue14736] Add {encode, decode}_filter_properties() functions to lzma module

2012-05-06 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

The updated patch looks ok to me.

--

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



[issue14736] Add {encode, decode}_filter_properties() functions to lzma module

2012-05-06 Thread Nadeem Vawda

Nadeem Vawda nadeem.va...@gmail.com added the comment:

Committed as changeset 9118ef2b651a.

--
resolution:  - fixed
stage: patch review - committed/rejected
status: open - closed

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



[issue14736] Add {encode, decode}_filter_properties() functions to lzma module

2012-05-06 Thread Serhiy Storchaka

Serhiy Storchaka storch...@gmail.com added the comment:

Thank you, Nadeem Vawda. I also wrote a patch for this, but because of the lack 
of experience it was too cumbersome.

But there are no tests for these functions. I tried to use these functions and 
got the random values.

 lzma.decode_filter_properties(lzma.FILTER_LZMA1, 
 lzma.encode_filter_properties({'id': lzma.FILTER_LZMA1, 'preset': 6}))
{'mode': 3075124424, 'dict_size': 8388608, 'id': 4611686018427387905, 'lp': 0, 
'nice_len': 739426833, 'depth': 0, 'lc': 3, 'mf': 0, 'pb': 2}
 lzma.decode_filter_properties(lzma.FILTER_LZMA1, 
 lzma.encode_filter_properties({'id': lzma.FILTER_LZMA1, 'preset': 6}))
{'mode': 0, 'dict_size': 8388608, 'id': 4611686018427387905, 'lp': 0, 
'nice_len': 2053908595, 'depth': 0, 'lc': 3, 'mf': 0, 'pb': 2}
 lzma.decode_filter_properties(lzma.FILTER_LZMA1, 
 lzma.encode_filter_properties({'id': lzma.FILTER_LZMA1, 'preset': 6}))
{'mode': 0, 'dict_size': 8388608, 'id': 4611686018427387905, 'lp': 0, 
'nice_len': 2053908595, 'depth': 0, 'lc': 3, 'mf': 0, 'pb': 2}

It seems, 'mode' and 'nice_len' was not initialized.

Tests for zipfile module with the use of these functions are broken, and I 
don't know, this happens because of errors in these functions or in zipfile 
module.

--
nosy: +storchaka

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



[issue14736] Add {encode, decode}_filter_properties() functions to lzma module

2012-05-06 Thread Nadeem Vawda

Nadeem Vawda nadeem.va...@gmail.com added the comment:

Changeset 9118ef2b651a was broken, but the bug should have been fixed by
changeset 10ccbb90a8e9. Which revision have you been using?

 But there are no tests for these functions.

There *are* tests for these functions, and they were failing on some of
the buildbots for the original changeset. They are currently passing.

--

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



[issue14736] Add {encode, decode}_filter_properties() functions to lzma module

2012-05-05 Thread Nadeem Vawda

New submission from Nadeem Vawda nadeem.va...@gmail.com:

Patch attached. Reviews welcome.

--
components: Extension Modules
files: lzma-properties.diff
keywords: patch
messages: 160051
nosy: nadeem.vawda
priority: normal
severity: normal
stage: patch review
status: open
title: Add {encode,decode}_filter_properties() functions to lzma module
type: enhancement
versions: Python 3.3
Added file: http://bugs.python.org/file25478/lzma-properties.diff

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