Short form of file names

Guido van Rossum guido at
Fri Jul 6 15:42:25 EDT 2001

Skip Montanaro <skip at> writes:

>     Mikhail> Is there some Python module for converting Windows long paths
>     Mikhail> to short form, i.e. 8.3? os.path.normpath() does not do this..
> Try importing dospath directly:
>     >>> import dospath
>     >>> dospath.normpath("/")
>     '\\'

Yeah, but shouldn't it return '\\' ?  I believe the
algorithm to produce the ~1 part is dependent on what else is in the
same directory.  I guess the ActiveState win32 modules hide an API
somewhere that gets this information directly from the filesystem.

--Guido van Rossum (home page:

More information about the Python-list mailing list