Tim Peters
33dc0a1705
One more crack at join(): stop trying to pretend this isn't a mass of
...
special cases. test_pkg works again on Windows.
2001-07-27 08:09:54 +00:00
Tim Peters
4223f89edd
Change ntpath.join() so that join("d:/", "/whatever") returns
...
d:/whatever instead of /whatever. While I'm afraid changing isabs()
to be *consistent* with this would break lots of code, it makes
best sense for join() to do it this way. Thanks to Alex Martelli for
pushing back on this one!
2001-07-26 21:54:37 +00:00
Fred Drake
79e75e1916
Use string.ascii_letters instead of string.letters (SF bug #226706 ).
2001-07-20 19:05:50 +00:00
Tim Peters
1bdd0f2559
SF bug #44271 : os.path.expanduser problem w/o HOME set.
...
This is a Windows-specific glitch that's really due to that, e.g.,
ntpath.join("c:", "/abc") returned "/abc" instead of "c:/abc". Made
join smarter.
Bugfix candidate.
2001-07-19 17:18:18 +00:00
Fred Drake
da05e977f3
abspath(): Fix inconsistent indentation.
2001-05-15 15:23:01 +00:00
Mark Hammond
ef8b654bbe
Add support for Windows using "mbcs" as the default Unicode encoding when dealing with the file system. As discussed on python-dev and in patch 410465.
2001-05-13 08:04:26 +00:00
Skip Montanaro
269b83bc05
added several more __all__ lists
2001-02-06 01:07:02 +00:00
Tim Peters
2344fae6d0
Whitespace normalization.
2001-01-15 00:50:52 +00:00
Fred Drake
8152d32375
Update the code to better reflect recommended style:
...
Use != instead of <> since <> is documented as "obsolescent".
Use "is" and "is not" when comparing with None or type objects.
2000-12-12 23:20:45 +00:00
Fred Drake
b4e460ac4b
Avoid import of string module; it is only needed for expandvars().
...
Never assume that os.sep is for the module-specific platform; use the
right separator character directly.
Fix some minor style consistency nits.
2000-09-28 16:25:20 +00:00
Tim Peters
0eeba5b24b
Part of SF patch 101481: on Windows, os.path.join("a:", "b") should yield
...
"a:b", not "a:/b". Similar change was made to posixmodule.c earlier.
2000-09-19 20:39:32 +00:00
Skip Montanaro
623583165e
revert semantics of commonprefix to work character-by-character
2000-08-22 13:01:53 +00:00
Mark Hammond
647d2fe145
Fix for Bug #110673 : os.abspatth() now always returns os.getcwd() on Windows, if an empty path is specified. It previously did not if an empty path was delegated to win32api.GetFullPathName())
2000-08-14 06:20:32 +00:00
Skip Montanaro
1d3dd74574
* split on / or \
...
* case insensitive comparison
2000-07-17 03:06:58 +00:00
Skip Montanaro
4d5d5bf5ae
forgot to change copy.copy(m) to m[:]
2000-07-13 01:01:03 +00:00
Skip Montanaro
97bc98aea7
fixed semantics of commonprefix to work by path elements instead of
...
characters.
2000-07-12 16:55:57 +00:00
Fred Drake
162bd855a6
Fix bug #345 reported by David Bolen <db3l@fitlinxx.com>:
...
getatime() returned the mtime instead of the atime.
Similar to an old bug in posixpath.py.
2000-07-01 06:36:51 +00:00
Fred Drake
ef0b5dd080
Typo in a comment: "wheter" --> "whether"
2000-02-17 17:30:40 +00:00
Guido van Rossum
823e91c767
Optimize abspath() slightly for the case that win32api can't be
...
imported; in that case, abspath is replaced by a fallback version.
2000-02-02 16:54:39 +00:00
Guido van Rossum
6dfc792fea
In abspath(), always use normpath(), even when win32api is available
...
(and even when it fails). This avoids the problem where a trailing
separator is not removed when win32api.GetFullPathName() is used.
1999-11-30 15:00:00 +00:00
Guido van Rossum
f618a48d11
Correct typo in walk.__doc__ reported by Francois Pinard.
1999-11-02 13:29:08 +00:00
Guido van Rossum
f3c695c467
Withdraw the UNC support from splitdrive(). Instead, a new function
...
splitunc() parses UNC paths. The contributor of the UNC parsing in
splitdrive() doesn't like it, but I haven't heard a good reason to
keep it, and it causes some problems. (I think there's a
philosophical problem -- to me, the split*() functions are purely
syntactical, and the fact that \\foo is not a valid path doesn't mean
that it shouldn't be considered an absolute path.)
Also (quite separately, but strangely related to the philosophical
issue above) fix abspath() so that if win32api exists, it doesn't fail
when the path doesn't actually exist -- if GetFullPathName() fails,
fall back on the old strategy (join with getcwd() if neccessary, and
then use normpath()).
1999-04-06 19:32:19 +00:00
Guido van Rossum
8f0fa9e47f
New code for split() by Tim Peters, behaves more like posixpath.split().
1999-03-19 21:05:12 +00:00
Guido van Rossum
534972bce2
New splitdrive() that knows about UNC paths (e.g., network paths like
...
\\host\mountpoint\dir\file). By Larry Hastings.
Also cleaned up some docstrings.
1999-02-03 17:20:50 +00:00
Guido van Rossum
9787bea4cd
Use win32api.GetFullPathName(path) if it exists to implement abspath().
1999-01-29 22:30:41 +00:00