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

2009-11-17 Thread Paul Moore

New submission from Paul Moore :

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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2009-11-17 Thread Antoine Pitrou

Antoine Pitrou  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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2009-11-18 Thread Lars Gustäbel

Lars Gustäbel  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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2009-11-18 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Le mercredi 18 novembre 2009 à 12:11 +, Lars Gustäbel a écrit :
> Lars Gustäbel  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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2009-11-18 Thread Paul Moore

Paul Moore  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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2009-11-18 Thread Antoine Pitrou

Antoine Pitrou  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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2009-11-18 Thread Paul Moore

Paul Moore  added the comment:

I can confirm it fixes the issue, too.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2009-11-18 Thread Lars Gustäbel

Lars Gustäbel  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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2009-11-18 Thread Antoine Pitrou

Antoine Pitrou  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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2009-11-18 Thread Lars Gustäbel

Lars Gustäbel  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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2009-11-18 Thread Antoine Pitrou

Antoine Pitrou  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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



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

2009-11-18 Thread Lars Gustäbel

Lars Gustäbel  added the comment:

Mmm, chocolate... ;-)

Okay, consider it done.

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

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com