Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Bugs

[issue7341] test_tarfile failing (file in use when deleting) on Windows buildbots

 

 

Python bugs RSS feed   Index | Next | Previous | View Threaded


report at bugs

Nov 17, 2009, 11:50 AM

Post #1 of 12 (269 views)
Permalink
[issue7341] test_tarfile failing (file in use when deleting) on Windows buildbots

New submission from Paul Moore <p.f.moore [at] gmail>:

Windows 3.x buildbots are failing in test_tarfile.

The problem, as best I can diagnose it, appears to be a failure
somewhere in the tarfile module to close files on exceptions. The error
is "WindowsError: [Error 32] The process cannot access the file because
it is being used by another process", but I am pretty sure it's actually
the *same* process which still has an open handle on the file. The
problem occurs around test_append_gz, which tries to open the tarfile
but expects an error. I think when the call raises the error, it is
leaving a filehandle open, which is what causes the delete in setUp to fail.

----------
components: Library (Lib), Tests
keywords: buildbot
messages: 95395
nosy: pmoore
priority: normal
severity: normal
status: open
title: test_tarfile failing (file in use when deleting) on Windows buildbots
versions: Python 3.1, Python 3.2

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7341>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Nov 17, 2009, 1:01 PM

Post #2 of 12 (253 views)
Permalink
[issue7341] test_tarfile failing (file in use when deleting) on Windows buildbots [In reply to]

Antoine Pitrou <pitrou [at] free> added the comment:

This is a problem in the Tarfile class, which keeps the underlying
`fileobj` open even when the constructor fails. Here is a possible patch.

----------
assignee: -> lars.gustaebel
keywords: +patch
nosy: +lars.gustaebel, pitrou
stage: -> patch review
type: -> resource usage
versions: +Python 2.6, Python 2.7
Added file: http://bugs.python.org/file15356/tarfile.patch

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7341>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Nov 18, 2009, 4:11 AM

Post #3 of 12 (240 views)
Permalink
[issue7341] test_tarfile failing (file in use when deleting) on Windows buildbots [In reply to]

Lars Gustäbel <lars [at] gustaebel> added the comment:

Any idea why the 2.x buildbots aren't failing? The code is basically the
same. Coincidence?

The patch is okay. Still, I have attached another version of it with a
slightly smaller try-except clause. Is it feasible to test if the patch
actually solves the problem?

----------
Added file: http://bugs.python.org/file15357/issue7341-3.x.diff

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7341>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Nov 18, 2009, 5:43 AM

Post #4 of 12 (240 views)
Permalink
[issue7341] test_tarfile failing (file in use when deleting) on Windows buildbots [In reply to]

Antoine Pitrou <pitrou [at] free> added the comment:

Le mercredi 18 novembre 2009 à 12:11 +0000, Lars Gustäbel a écrit :
> Lars Gustäbel <lars [at] gustaebel> added the comment:
>
> Any idea why the 2.x buildbots aren't failing? The code is basically the
> same. Coincidence?

No, the difference is that exception objects carry the traceback with
them in 3.x, which keeps alive a reference cycle long enough for
`fileobj` not to be garbage collected before the next test run.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7341>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Nov 18, 2009, 7:59 AM

Post #5 of 12 (241 views)
Permalink
[issue7341] test_tarfile failing (file in use when deleting) on Windows buildbots [In reply to]

Paul Moore <p.f.moore [at] gmail> added the comment:

I can run a test on my buildbot - but I may not have a chance until
tomorrow. I'll do that and report back unless someone else reports
that they have managed to run a test before me.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7341>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Nov 18, 2009, 9:07 AM

Post #6 of 12 (237 views)
Permalink
[issue7341] test_tarfile failing (file in use when deleting) on Windows buildbots [In reply to]

Antoine Pitrou <pitrou [at] free> added the comment:

> Still, I have attached another version of it with a
> slightly smaller try-except clause. Is it feasible to test if the patch
> actually solves the problem?

Yes, it does.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7341>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Nov 18, 2009, 9:51 AM

Post #7 of 12 (237 views)
Permalink
[issue7341] test_tarfile failing (file in use when deleting) on Windows buildbots [In reply to]

Paul Moore <p.f.moore [at] gmail> added the comment:

I can confirm it fixes the issue, too.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7341>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Nov 18, 2009, 12:34 PM

Post #8 of 12 (235 views)
Permalink
[issue7341] test_tarfile failing (file in use when deleting) on Windows buildbots [In reply to]

Lars Gustäbel <lars [at] gustaebel> added the comment:

Alright then. I applied the change to the trunk (r76381) and py3k
(r76383). What about release26-maint and release31-maint? IMO this is
not necessary.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7341>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Nov 18, 2009, 12:36 PM

Post #9 of 12 (234 views)
Permalink
[issue7341] test_tarfile failing (file in use when deleting) on Windows buildbots [In reply to]

Antoine Pitrou <pitrou [at] free> added the comment:

> Alright then. I applied the change to the trunk (r76381) and py3k
> (r76383). What about release26-maint and release31-maint? IMO this is
> not necessary.

Unless it might cause compatibility concerns I think it would be better
to backport it.
In general it's bad to rely on reference counting to automatically close
files. The object could be hanging on a traceback, or you could be
running on a Python implementation with a different GC strategy.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7341>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Nov 18, 2009, 12:52 PM

Post #10 of 12 (234 views)
Permalink
[issue7341] test_tarfile failing (file in use when deleting) on Windows buildbots [In reply to]

Lars Gustäbel <lars [at] gustaebel> added the comment:

I have always tried to be very conservative with backporting stuff that
is not clearly a bugfix but alters any kind of behaviour. I am always
very concerned about compatibility, especially if code has been around
for as long as this code has.
But as I don't want to waste anybody's time with a lengthy discussion,
just say a word and I apply it to 2.6 and 3.1 as well ;-)

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7341>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Nov 18, 2009, 12:54 PM

Post #11 of 12 (234 views)
Permalink
[issue7341] test_tarfile failing (file in use when deleting) on Windows buildbots [In reply to]

Antoine Pitrou <pitrou [at] free> added the comment:

> I have always tried to be very conservative with backporting stuff that
> is not clearly a bugfix but alters any kind of behaviour. I am always
> very concerned about compatibility, especially if code has been around
> for as long as this code has.
> But as I don't want to waste anybody's time with a lengthy discussion,
> just say a word and I apply it to 2.6 and 3.1 as well ;-)

What if I say chocolate?
Regardless, I think you should backport it at least to 3.1, and that it
makes sense to backport it to 2.6 too.

----------

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7341>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com


report at bugs

Nov 18, 2009, 1:00 PM

Post #12 of 12 (235 views)
Permalink
[issue7341] test_tarfile failing (file in use when deleting) on Windows buildbots [In reply to]

Lars Gustäbel <lars [at] gustaebel> added the comment:

Mmm, chocolate... ;-)

Okay, consider it done.

----------
resolution: -> accepted
status: open -> closed

_______________________________________
Python tracker <report [at] bugs>
<http://bugs.python.org/issue7341>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/list-python-bugs%40lists.gossamer-threads.com

Python bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.