Bug#625509: python3-debian and python 3.3

Stuart Prescott stuart+debian at nanonanonano.net
Mon Jun 18 17:12:09 UTC 2012


Hi Colin!

the patch for python3 support in python-debian works very nicely for python 
3.2. I was experimenting with python 3.3 (not in Debian and not even released 
yet!) because I was interested in lzma support and, with the newer python3, 
there looks like there will be test suite failures. 

The last of these is trivially fixable with

    def seekable(self):
        return True

the others look like a change in the way subprocess thinks about communicate() 
but I can't see anything in the 3.3 release notes that discusses this.

I don't know whether this fixing these for 3.2 in wheezy is important or not as 
it's not obvious to me whether these new failures are indicative of unfound 
bugs or changes in python itself.

cheers
Stuart

(PS I know that using a local install of /opt/bin/python3.3 with debian 
packaged modules (chardet, apt and six) in /usr/lib/python3/dist-packages/ is 
potentially asking for trouble, but I don't believe that this is necessarily 
the issue here)


$ for i in *.py; do PYTHONPATH=/usr/lib/python3/dist-packages/ 
/opt/bin/python3.3 $i; done
.................
----------------------------------------------------------------------
Ran 17 tests in 0.019s

OK
............E..............................EEEE..
======================================================================
ERROR: test_gpg_info (__main__.TestDeb822)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_deb822.py", line 392, in test_gpg_info
    result_from_str = deb822_from_str.get_gpg_info()
  File "../lib/debian/deb822.py", line 702, in get_gpg_info
    keyrings=keyrings)
  File "../lib/debian/deb822.py", line 826, in from_sequence
    out, err = p.communicate(inp)
  File "/opt/lib/python3.3/subprocess.py", line 906, in communicate
    stdout, stderr = self._communicate(input, endtime, timeout)
  File "/opt/lib/python3.3/subprocess.py", line 1513, in _communicate
    orig_timeout)
  File "/opt/lib/python3.3/subprocess.py", line 1581, in 
_communicate_with_poll
    self._input = self._input.encode(self.stdin.encoding)
AttributeError: 'bytes' object has no attribute 'encode'

======================================================================
ERROR: test_from_file (__main__.TestGpgInfo)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_deb822.py", line 1028, in test_from_file
    gpg_info = deb822.GpgInfo.from_file(filename)
  File "../lib/debian/deb822.py", line 855, in from_file
    return cls.from_sequence(target_file, *args, **kwargs)
  File "../lib/debian/deb822.py", line 826, in from_sequence
    out, err = p.communicate(inp)
  File "/opt/lib/python3.3/subprocess.py", line 906, in communicate
    stdout, stderr = self._communicate(input, endtime, timeout)
  File "/opt/lib/python3.3/subprocess.py", line 1513, in _communicate
    orig_timeout)
  File "/opt/lib/python3.3/subprocess.py", line 1581, in 
_communicate_with_poll
    self._input = self._input.encode(self.stdin.encoding)
AttributeError: 'bytes' object has no attribute 'encode'

======================================================================
ERROR: test_from_sequence_newline_terminated (__main__.TestGpgInfo)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_deb822.py", line 1007, in test_from_sequence_newline_terminated
    gpg_info = deb822.GpgInfo.from_sequence(sequence)
  File "../lib/debian/deb822.py", line 826, in from_sequence
    out, err = p.communicate(inp)
  File "/opt/lib/python3.3/subprocess.py", line 906, in communicate
    stdout, stderr = self._communicate(input, endtime, timeout)
  File "/opt/lib/python3.3/subprocess.py", line 1513, in _communicate
    orig_timeout)
  File "/opt/lib/python3.3/subprocess.py", line 1581, in 
_communicate_with_poll
    self._input = self._input.encode(self.stdin.encoding)
AttributeError: 'bytes' object has no attribute 'encode'

======================================================================
ERROR: test_from_sequence_no_newlines (__main__.TestGpgInfo)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_deb822.py", line 1015, in test_from_sequence_no_newlines
    gpg_info = deb822.GpgInfo.from_sequence(sequence)
  File "../lib/debian/deb822.py", line 826, in from_sequence
    out, err = p.communicate(inp)
  File "/opt/lib/python3.3/subprocess.py", line 906, in communicate
    stdout, stderr = self._communicate(input, endtime, timeout)
  File "/opt/lib/python3.3/subprocess.py", line 1513, in _communicate
    orig_timeout)
  File "/opt/lib/python3.3/subprocess.py", line 1581, in 
_communicate_with_poll
    self._input = self._input.encode(self.stdin.encoding)
AttributeError: 'bytes' object has no attribute 'encode'

======================================================================
ERROR: test_from_sequence_string (__main__.TestGpgInfo)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_deb822.py", line 999, in test_from_sequence_string
    gpg_info = deb822.GpgInfo.from_sequence(self.data)
  File "../lib/debian/deb822.py", line 826, in from_sequence
    out, err = p.communicate(inp)
  File "/opt/lib/python3.3/subprocess.py", line 906, in communicate
    stdout, stderr = self._communicate(input, endtime, timeout)
  File "/opt/lib/python3.3/subprocess.py", line 1513, in _communicate
    orig_timeout)
  File "/opt/lib/python3.3/subprocess.py", line 1581, in 
_communicate_with_poll
    self._input = self._input.encode(self.stdin.encoding)
AttributeError: 'bytes' object has no attribute 'encode'

----------------------------------------------------------------------
Ran 49 tests in 0.395s

FAILED (errors=5)
.........E
======================================================================
ERROR: test_tar_bz2 (__main__.TestDebFile)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "test_debfile.py", line 145, in test_tar_bz2
    self.assertEqual(os.path.normpath(bz2_deb.data.tgz().getnames()[10]),
  File "../lib/debian/debfile.py", line 81, in tgz
    self.__tgz = tarfile.open(fileobj=self.__member, mode='r:bz2')
  File "/opt/lib/python3.3/tarfile.py", line 1584, in open
    return func(name, filemode, fileobj, **kwargs)
  File "/opt/lib/python3.3/tarfile.py", line 1664, in bz2open
    t = cls.taropen(name, mode, fileobj, **kwargs)
  File "/opt/lib/python3.3/tarfile.py", line 1614, in taropen
    return cls(name, mode, fileobj, **kwargs)
  File "/opt/lib/python3.3/tarfile.py", line 1488, in __init__
    self.firstmember = self.next()
  File "/opt/lib/python3.3/tarfile.py", line 2254, in next
    self.fileobj.seek(self.offset)
  File "/opt/lib/python3.3/bz2.py", line 361, in seek
    self._check_can_seek()
  File "/opt/lib/python3.3/bz2.py", line 171, in _check_can_seek
    if not self._fp.seekable():
AttributeError: 'ArMember' object has no attribute 'seekable'

----------------------------------------------------------------------
Ran 10 tests in 0.216s

FAILED (errors=1)
......
----------------------------------------------------------------------
Ran 6 tests in 0.005s

OK
...
----------------------------------------------------------------------
Ran 3 tests in 0.003s

OK






-- 
Stuart Prescott    --    www.nanonanonano.net
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.alioth.debian.org/pipermail/pkg-python-debian-maint/attachments/20120618/2c3dac26/attachment.pgp>


More information about the pkg-python-debian-maint mailing list