Max OSX Python 2.5.1 Stackless 3.1b3 breaks export

Bug #254791 reported by Lucio Torre
2
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Low
Unassigned

Bug Description

python 2.5.1 stackless 3.1b3 is broken on Mac OSX; 2.5.2 works fine. The problem exhibits as an attempt to get the abspath of (None) when doing operations to a tarfile object with fileobj rather than a path given to the constructor.

Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 254791] [NEW] export to tar broken on mac os x

On Mon, 2008-08-04 at 21:59 +0000, Lucio Torre wrote:
> Public bug reported:
>
> Mac OS X 10.4, python2.5
>
> running "make check" fails after 204 tests on test_tar_export.

> File "/Users/lucio/Projects/canonical/bzr.dev/bzrlib/export/tar_exporter.py", line 40, in tar_exporter
> ball = tarfile.open(None, 'w|' + compression, sys.stdout)
> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/tarfile.py", line 1168, in open
> _Stream(name, filemode, comptype, fileobj, bufsize))
> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/tarfile.py", line 1047, in __init__
> self.name = os.path.abspath(name)
> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/posixpath.py", line 402, in abspath
> if not isabs(path):
> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/posixpath.py", line 49, in isabs
> return s.startswith('/')
> AttributeError: 'NoneType' object has no attribute 'startswith'

This appears to be a python bug.

 pydoc tarfile.open ->
tarfile.open = open(cls, name=None, mode='r', fileobj=None,
bufsize=10240)

We're passing no name and a fileobj of sys.stdout - your tarfile.py is
being bogus by trying to get the abs path for None.

Are you running a release python?

-Rob
--
GPG key available at: <http://www.robertcollins.net/keys.txt>.

Revision history for this message
Lucio Torre (lucio.torre) wrote :
Download full text (7.3 KiB)

On Mon, Aug 4, 2008 at 7:12 PM, Robert Collins
<email address hidden> wrote:
> On Mon, 2008-08-04 at 21:59 +0000, Lucio Torre wrote:
>> Public bug reported:
>>
>> Mac OS X 10.4, python2.5
>>
>> running "make check" fails after 204 tests on test_tar_export.
>
>> File "/Users/lucio/Projects/canonical/bzr.dev/bzrlib/export/tar_exporter.py", line 40, in tar_exporter
>> ball = tarfile.open(None, 'w|' + compression, sys.stdout)
>> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/tarfile.py", line 1168, in open
>> _Stream(name, filemode, comptype, fileobj, bufsize))
>> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/tarfile.py", line 1047, in __init__
>> self.name = os.path.abspath(name)
>> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/posixpath.py", line 402, in abspath
>> if not isabs(path):
>> File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/posixpath.py", line 49, in isabs
>> return s.startswith('/')
>> AttributeError: 'NoneType' object has no attribute 'startswith'
>
> This appears to be a python bug.
>
> pydoc tarfile.open ->
> tarfile.open = open(cls, name=None, mode='r', fileobj=None,
> bufsize=10240)
>
> We're passing no name and a fileobj of sys.stdout - your tarfile.py is
> being bogus by trying to get the abs path for None.
>
> Are you running a release python?
>
> -Rob
> --
> GPG key available at: <http://www.robertcollins.net/keys.txt>.
>
> --
> export to tar broken on mac os x
> https://bugs.launchpad.net/bugs/254791
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in Bazaar Version Control System: New
>
> Bug description:
> Mac OS X 10.4, python2.5
>
> running "make check" fails after 204 tests on test_tar_export.
>
> traceback:
> ======================================================================
> ERROR: test_tar_export (bzrlib.tests.blackbox.test_export.TestExport)
>
> vvvv[log from bzrlib.tests.blackbox.test_export.TestExport.test_tar_export]---
> 278.671 creating repository in file:///private/tmp/testbzr-zCBSWy.tmp/bzrlib.tests.blackbox.test_export.TestExport.test_tar_export/work/tar/.bzr/.
> 278.706 creating branch <bzrlib.branch.BzrBranchFormat6 object at 0x4066eb0> in file:///private/tmp/testbzr-zCBSWy.tmp/bzrlib.tests.blackbox.test_export.TestExport.test_tar_export/work/tar/.bzr/
> 278.879 trying to create missing lock '/private/tmp/testbzr-zCBSWy.tmp/bzrlib.tests.blackbox.test_export.TestExport.test_tar_export/work/tar/.bzr/checkout/dirstate'
> 278.882 opening working tree '/private/tmp/testbzr-zCBSWy.tmp/bzrlib.tests.blackbox.test_export.TestExport.test_tar_export/work/tar'
> 279.085 run bzr: ['ignore', 'something']
> 279.085 bzr arguments: ['ignore', 'something']
> 279.091 encoding stdout as sys.stdout encoding 'ascii'
> 279.111 opening working tree '/private/tmp/testbzr-zCBSWy.tmp/bzrlib.tests.blackbox.test_export.TestExport.test_tar_export/work/tar'
> 279.202 preparing to commit
> INFO Committing to: /private/tmp/testbzr-zCBSWy.tmp/bzrlib.tests.blackbox.test_export.TestExport.test_tar_export/work/tar/
> 279.261 Selecting files for co...

Read more...

Revision history for this message
Guillermo Gonzalez (verterok) wrote :

Hi Rob,

On Mon, Aug 4, 2008 at 7:12 PM, Robert Collins
<email address hidden> wrote:
>
> This appears to be a python bug.
[snip]
> We're passing no name and a fileobj of sys.stdout - your tarfile.py is
> being bogus by trying to get the abs path for None.
>
> Are you running a release python?
>
I can confirm this with Python 2.5.1 but it's fixed in 2.5.2

Cheers
>
> --
> export to tar broken on mac os x
> https://bugs.launchpad.net/bugs/254791
> You received this bug notification because you are a member of Bazaar
> Developers, which is the registrant for Bazaar.
>

Revision history for this message
Robert Collins (lifeless) wrote :

Verterok reports that this is fixed in python 2.5.2, perhaps we should
add a version check that on macosX python 2.5 < x.x.2 and object/warn?

-Rob

description: updated
Revision history for this message
Robert Collins (lifeless) wrote :

Not really a bzr problem but we could warn people I guess

Changed in bzr:
importance: Undecided → Low
status: New → Confirmed
Samuel Bronson (naesten)
tags: added: mac
Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.