[pypy-svn] r26557 - pypy/dist/lib-python/modified-2.4.1

ale at codespeak.net ale at codespeak.net
Sat Apr 29 06:48:21 CEST 2006

Author: ale
Date: Sat Apr 29 06:48:17 2006
New Revision: 26557

      - copied, changed from r26540, pypy/dist/lib-python/2.4.1/tarfile.py
issue 13 : testing

The test_tarfile passes on CPython, because it relies on base conversion of strings to ints ignoring null characters ie.

Python 2.4.2 (#1, Apr 24 2006, 10:25:58) 
[GCC 4.0.0 20041026 (Apple Computer, Inc. build 4061)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> int('123\x00',10)

This behaviour is only if use base conversion ie.

>>> int('123\x00')
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ValueError: null byte in argument for int()

Rather than changing PyPy's behaviour I have patched tarfile.py, to replace int and long with functions truncating the inputstrings on null characters

More information about the Pypy-commit mailing list