destream-py / destream

A tool & Python 3 library to decompress anything
GNU General Public License v2.0
12 stars 1 forks source link

Python 3 Support #1

Closed jruere closed 9 years ago

jruere commented 9 years ago

Are there plans to support Python 3?

cecton commented 9 years ago

It should be supported but I didn't find time yet to do it. PR are welcome though :)

jruere commented 9 years ago

I'll do as soon as I find the time. :)

El mié, 3 de junio de 2015 06:05, Cecile Tonglet notifications@github.com escribió:

It should be supported but I didn't find time yet to do it. PR are welcome though :)

— Reply to this email directly or view it on GitHub https://github.com/cecton/destream/issues/1#issuecomment-108256516.

cecton commented 9 years ago

Just started the job. Let me know your opinion about it.

I've come to realized that the code for the tests is quite old. It used to be compatible with Python 2.6. But I don't think it's related to the issue with unclosed files (cfr commit message).

Here is the output:

[0] [15:07:21] ~/r/d/tests master > python3 -m unittest -f *
..../usr/lib/python3.4/unittest/case.py:577: ResourceWarning: unclosed file <_io.BufferedReader name=8>
  testMethod()
./usr/lib/python3.4/unittest/case.py:577: ResourceWarning: unclosed file <_io.BufferedReader name=8>
  testMethod()
../home/cecile/repos/destream/tests/test_30_decompressors.py:125: ResourceWarning: unclosed file <_io.BufferedReader name=8>
  archive = None
..../home/cecile/repos/destream/tests/test_30_decompressors.py:125: ResourceWarning: unclosed file <_io.BufferedReader name=7>
  archive = None
..../home/cecile/repos/destream/tests/test_30_decompressors.py:82: ResourceWarning: unclosed file <_io.BufferedReader name=7>
  for fileobj in (archive.open(m) for m in archive.members()):
/home/cecile/repos/destream/tests/test_30_decompressors.py:82: ResourceWarning: unclosed file <_io.BufferedReader name=9>
  for fileobj in (archive.open(m) for m in archive.members()):
/home/cecile/repos/destream/tests/test_30_decompressors.py:82: ResourceWarning: unclosed file <_io.BufferedReader name=5>
  for fileobj in (archive.open(m) for m in archive.members()):
/home/cecile/repos/destream/tests/test_30_decompressors.py:94: ResourceWarning: unclosed file <_io.BufferedReader name=5>
  archive.extract(member, tempdir)
/home/cecile/repos/destream/tests/test_30_decompressors.py:110: ResourceWarning: unclosed file <_io.BufferedReader name=5>
  archive.extractall(tempdir)
/home/cecile/repos/destream/tests/test_30_decompressors.py:271: ResourceWarning: unclosed file <_io.BufferedReader name=7>
  raw, uncompressed)
./home/cecile/repos/destream/tests/test_30_decompressors.py:356: ResourceWarning: unclosed file <_io.BufferedReader name=7>
  raw, uncompressed)
...
----------------------------------------------------------------------
Ran 19 tests in 0.311s

OK
[0] [15:08:33] ~/r/d/tests master > unit2-2 discover -s . -v -f
test_10_plain_text (test_30_decompressors.GuesserTest) ... ok
test_20_external_pipe_bzip2 (test_30_decompressors.GuesserTest) ... ok
test_20_external_pipe_gzip (test_30_decompressors.GuesserTest) ... ok
test_20_external_pipe_lzma (test_30_decompressors.GuesserTest) ... ok
test_20_external_pipe_xz (test_30_decompressors.GuesserTest) ... ok
test_30_7z_single_file (test_30_decompressors.GuesserTest) ... ok
test_30_rar_single_file (test_30_decompressors.GuesserTest) ... ok
test_30_tar_single_file (test_30_decompressors.GuesserTest) ... ok
test_30_zip_single_file (test_30_decompressors.GuesserTest) ... ok
test_40_7z_multiple_files (test_30_decompressors.GuesserTest) ... ok
test_40_rar_multiple_files (test_30_decompressors.GuesserTest) ... ok
test_40_tar_multiple_files (test_30_decompressors.GuesserTest) ... ok
test_40_zip_multiple_files (test_30_decompressors.GuesserTest) ... ok
test_10_guess_basename (test_10_base.Archive) ... ok
test_10_passing_file_object (test_10_base.ArchiveFileTest) ... ok
test_20_passing_filename (test_10_base.ArchiveFileTest) ... ok
test_30_closefd (test_10_base.ArchiveFileTest) ... ok
test_10_create_temp_archive_from_externalpipe (test_10_base.ArchiveTempTest) ... ok
test_10_check_output (test_10_base.ExternalPipeTest) ... ok

----------------------------------------------------------------------
Ran 19 tests in 0.323s

OK
cecton commented 9 years ago

Yeay! Now it's clean.

...but we're missing a feature.

In the past, it was possible to find the stderr of the process. It was part of the objects I created to be able to get the error messages. I'm not sure if that feature is very useful though... But if we want to keep this, we need to store it to a string in the decompressor instances.

Let me know your opinion about it.

jruere commented 9 years ago

Thank you very much. I'll check it out soon.

jruere commented 9 years ago

I've tested it in Python 2 and 3 in my applications and it appears to be working properly!

Thank you very much! Looking forward to a release with the Python 3 category in PyPI! ;)

jruere commented 9 years ago

Regarding stderr, I never noticed it or felt the need for such feature. If it fails, I'd prefer an exception of some sort with a message. :)

cecton commented 9 years ago

Okay! I will add that later on a version 4.1. Here is already the 4.0 version that works fine with Pytohn 2 & 3.

jruere commented 9 years ago

Thank you very much!