[issue25202] Windows: with-statement doesn't release file handle after exception on "No space left on device" error

2015-09-21 Thread Lauri Kajan

Lauri Kajan added the comment:

Thanks for these.
I'll see what I could do to upgrade our python version.

Sorry for not finding the old issue. Didn't find the right search terms.

--

___
Python tracker 

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



[issue25202] Windows: with-statement doesn't release file handle after exception on "No space left on device" error

2015-09-21 Thread eryksun

eryksun added the comment:

Lauri changed the version from 3.4 to 3.2, and I was able to reproduce the 
problem in 3.2.5:

C:\Temp>py -3.2 --version
Python 3.2.5
C:\Temp>py -3.2 nospace.py
removing fill.txt
Traceback (most recent call last):
  File "nospace.py", line 8, in 
n = f.write(b"\0")
IOError: [Errno 28] No space left on device

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "nospace.py", line 8, in 
n = f.write(b"\0")
IOError: [Errno 28] No space left on device

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "nospace.py", line 12, in 
os.remove(fill)
WindowsError: [Error 32] The process cannot access the file because it is 
being used by another process: 'T:\\fill.txt'

It's a sharing violation, since the file handle isn't closed and wasn't opened 
with FILE_SHARE_DELETE.

There's no problem in 3.4 or 3.5 since it properly closes the file handle even 
if flush() fails:

C:\Temp>py -3.4 --version
Python 3.4.3
C:\Temp>py -3.4 nospace.py
removing fill.txt

C:\Temp>py -3.5 --version
Python 3.5.0
C:\Temp>py -3.5 nospace.py
removing fill.txt

--

___
Python tracker 

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



[issue25202] Windows: with-statement doesn't release file handle after exception on "No space left on device" error

2015-09-21 Thread STINNER Victor

STINNER Victor added the comment:

@Lauri: What is your Python version? Can you retry your test with Python 3.5?

--
nosy: +haypo

___
Python tracker 

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



[issue25202] Windows: with-statement doesn't release file handle after exception on "No space left on device" error

2015-09-21 Thread Zachary Ware

Changes by Zachary Ware :


--
superseder:  -> file descriptor not being closed with context manager on 
IOError when device is full

___
Python tracker 

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



[issue25202] Windows: with-statement doesn't release file handle after exception on "No space left on device" error

2015-09-21 Thread eryksun

eryksun added the comment:

See issue 16597. This wasn't fixed for 3.2, so it won't close the file if 
flush() fails. You'll either have to work around this or upgrade to 3.3+.

--
nosy: +eryksun
resolution:  -> out of date
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue25202] Windows: with-statement doesn't release file handle after exception on "No space left on device" error

2015-09-21 Thread Lauri Kajan

Changes by Lauri Kajan :


--
versions: +Python 3.2 -Python 3.4

___
Python tracker 

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



[issue25202] Windows: with-statement doesn't release file handle after exception on "No space left on device" error

2015-09-21 Thread STINNER Victor

Changes by STINNER Victor :


--
title: with-statement doesn't release file handle after exception -> Windows: 
with-statement doesn't release file handle after exception on "No space left on 
device" error

___
Python tracker 

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



[issue25202] Windows: with-statement doesn't release file handle after exception on "No space left on device" error

2015-09-21 Thread STINNER Victor

Changes by STINNER Victor :


--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware

___
Python tracker 

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