Niemann, Hartmut wrote:
> I am not subscribed to this mailing list (so CC me on all replies please), 

How did you send this?  The list only accepts postings from members.


> This is Python 2.7.3 on Windows XP.
>  
> My conclusions:
>  
> (1) I wonder what limitation on windows was hit by the _getfullpathname(path) 
> call. 
> The file name is long but not so exceptionally long. Maybe this is a python 
> problem
> that can be fixed?

How long is the path?  Your sample below is only about 150 characters. 
The GetFullPathName API is limited to 260 characters, unless one uses
the Unicode version and uses the \\?\ prefix, which extends that to
32,768.  I'll have to check the library source code to see which one
they use.

 
> (2) The fact that abspath(path) swallows the windows error, returning
> something that is definitely wrong (a relative path where an absolute
> one is expected) makes it hard to use it safely. Could it simply
> not catch the WindowsError or raise an Error (which one?)?

"Which one" is an excellent question.  It's not clear what the behavior
should be.  Perhaps just allowing the WindowsError to leak through would
be the safest.

 
> (3) why does relpath() need absolute paths at all? Could it work without this
> path normalisation if both paths are relative and path.startswith(start) is 
> true?

The relpath operation is tricky, because it's possible for paths to have
things like a\b\..\..\c\d\..\other.  You generally want to unravel all
of that before you begin.

-- 
Tim Roberts, t...@probo.com
Providenza & Boekelheide, Inc.

_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to