Issue2263

classification
Title: os.stat throw exception on existing folder on Windows
Type: behaviour Severity: critical
Components: Core Versions: Jython 2.7
Milestone:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: zyasoft Nosy List: kaneg, zyasoft
Priority: Keywords:

Created on 2015-01-30.11:28:32 by kaneg, last changed 2015-02-11.22:10:03 by zyasoft.

Messages
msg9466 (view) Author: Kane Gong (kaneg) Date: 2015-01-30.11:28:32
Code below will throw exception:
import os
a = 'C:\\Windows\\'
from java.io import File
print File(a).exists()
print os.stat(a)

The same code can work well on CPython 2.5, CPython 2.7 and Jython 2.5 except Jython 2.7b3(Java related code only for validation of the file's existence).
If the last '\\' was removed, the code will be OK in Jython 2.7b3. It seems the last '\\' was not handled well.

Since os.stat is used by plenty of functions, such as os.path.isdir, it will block lots of functions
msg9468 (view) Author: Jim Baker (zyasoft) Date: 2015-01-30.16:34:50
Same underlying issue as http://bugs.jython.org/issue2255
msg9471 (view) Author: Jim Baker (zyasoft) Date: 2015-02-02.20:10:04
Fixed as of https://hg.python.org/jython/rev/e04fa277ce19
msg9485 (view) Author: Kane Gong (kaneg) Date: 2015-02-05.05:10:04
After updating and building the latest code, the issue has gone. Thanks a lot.
History
Date User Action Args
2015-02-11 22:10:03zyasoftsetstatus: pending -> closed
2015-02-05 05:10:05kanegsetmessages: + msg9485
2015-02-02 20:10:04zyasoftsetstatus: open -> pending
assignee: zyasoft
resolution: fixed
messages: + msg9471
2015-01-30 16:34:51zyasoftsetnosy: + zyasoft
messages: + msg9468
2015-01-30 11:28:33kanegcreate