Issue2255
Created on 2015-01-15.22:55:45 by pekka.klarck, last changed 2015-02-11.22:11:45 by zyasoft.
msg9404 (view) |
Author: Pekka Klärck (pekka.klarck) |
Date: 2015-01-15.22:55:44 |
|
Jython 2.7b4 (default:bfc775b6c48d, Jan 9 2015, 04:16:03)
[Java HotSpot(TM) 64-Bit Server VM (Oracle Corporation)] on java1.8.0_25
Type "help", "copyright", "credits" or "license" for more information.
>>> import glob
>>> glob.glob('c:\\temp')
['c:\\temp']
>>> glob.glob('c:\\temp\\')
[]
Having a trailing backspace is not a problem with Jython 2.5 or any Python version.
|
msg9453 (view) |
Author: Jim Baker (zyasoft) |
Date: 2015-01-24.00:22:19 |
|
So this is not an issue for a trailing slash on Windows, just a trailing backslash. Interesting difference.
|
msg9461 (view) |
Author: Jim Baker (zyasoft) |
Date: 2015-01-28.19:11:13 |
|
Blocker for beta 4
|
msg9469 (view) |
Author: Kane Gong (kaneg) |
Date: 2015-01-31.07:13:04 |
|
After reading source code, it was related to os.lstat and os.stat changes in PosixModule which was made on 2/29/2014 and 4/25/2014:
String absolutePath = absolutePath(path);
// round tripping from a string to a file to a string loses
// trailing slashes so add them back back in to get correct posix.lstat
// behaviour if path is not a directory.
if (asPath(path).endsWith(File.separator)) {
absolutePath = absolutePath + File.separator;
}
return PyStatResult.fromFileStat(posix.lstat(absolutePath));
According to the change, it will apppend a backslash(For Windows) to the absolute path if the origin path ends with a backslash. But the posix.lstat will report error if the path ends with a backslash.
Not sure it's an issue for posix implemation in jnr-posix or the path should not be appended a backslash.
|
msg9473 (view) |
Author: Jim Baker (zyasoft) |
Date: 2015-02-02.20:20:12 |
|
The specific issue raised here seems to be fixed as of https://hg.python.org/jython/rev/e04fa277ce19, however, there is one related failing test still in test_glob to be investigated, test_glob_unicode_directory_with_trailing_slash.
@Kane, thanks for your investigation as well. I have completely changed how we do stat on Windows, plus absolute path calculations, so that we follow closer Java 7 Path support and don't use JNR. (Great package, but I prefer not to have a JNI dependency if possible.)
|
msg9492 (view) |
Author: Jim Baker (zyasoft) |
Date: 2015-02-07.01:30:33 |
|
test_glob now works as of https://hg.python.org/jython/rev/8b2db200158f
|
|
Date |
User |
Action |
Args |
2015-02-11 22:11:45 | zyasoft | set | status: pending -> closed |
2015-02-07 01:30:34 | zyasoft | set | status: open -> pending resolution: accepted -> fixed messages:
+ msg9492 |
2015-02-02 20:20:12 | zyasoft | set | messages:
+ msg9473 |
2015-01-31 07:13:05 | kaneg | set | nosy:
+ kaneg messages:
+ msg9469 |
2015-01-28 19:11:47 | zyasoft | set | assignee: zyasoft |
2015-01-28 19:11:13 | zyasoft | set | priority: urgent messages:
+ msg9461 |
2015-01-24 00:22:19 | zyasoft | set | resolution: accepted messages:
+ msg9453 nosy:
+ zyasoft |
2015-01-15 22:55:45 | pekka.klarck | create | |
|