classification
Title: Non cross-platform behavior of os.path.split
Type: Stage: resolved
Components: Documentation, Library (Lib) Versions: Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 2.7
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, georg.brandl, serhiy.storchaka, techtonik
Priority: normal Keywords:

Created on 2012-11-05 11:24 by techtonik, last changed 2012-12-26 18:14 by serhiy.storchaka. This issue is now closed.

Messages (7)
msg174890 - (view) Author: anatoly techtonik (techtonik) Date: 2012-11-05 11:24
os.path.split('c:foo') gives ('c:', 'foo') on Windows and ('', 'c:foo') on Linux, which is not documented. IIUC, the behavior change in os module is not possible, so a documentation note will be appreciated.
msg174891 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2012-11-05 11:29
.. note::

   Since different operating systems have different path name conventions, there
   are several versions of this module in the standard library.  The
   :mod:`os.path` module is always the path module suitable for the operating
   system Python is running on, and therefore usable for local paths.  However,
   you can also import and use the individual modules if you want to manipulate
   a path that is *always* in one of the different formats.  They all have the
   same interface:

   * :mod:`posixpath` for UNIX-style paths
   * :mod:`ntpath` for Windows paths
   * :mod:`macpath` for old-style MacOS paths
msg174895 - (view) Author: anatoly techtonik (techtonik) Date: 2012-11-05 11:59
Historically os.path.split() on Windows is able to grok UNIX paths easily.

Don't you think that Python language reference for the os.path should include less vague definition of Windows, UNIX-style and old-style MacOS paths it works with?
msg174896 - (view) Author: anatoly techtonik (techtonik) Date: 2012-11-05 12:01
User story: as a Python programmer working with different systems, I'd like to know how os.path module threats paths on these systems.
msg174931 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2012-11-05 19:19
Please submit a patch.
msg175051 - (view) Author: anatoly techtonik (techtonik) Date: 2012-11-07 08:35
I don't know about the differences. An expert is required.
msg176290 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2012-11-24 14:46
I don't think that Python should include documentation on all supported OSes, formats, protocols and algorithms. There are documentation outside Python. I think this is not Python issue.
History
Date User Action Args
2012-12-26 18:14:38serhiy.storchakasetstatus: pending -> closed
resolution: not a bug
2012-11-24 14:46:33serhiy.storchakasetstatus: open -> pending

messages: + msg176290
2012-11-07 08:35:12techtoniksetmessages: + msg175051
2012-11-05 19:19:47georg.brandlsetnosy: + georg.brandl
messages: + msg174931
2012-11-05 12:01:21techtoniksetmessages: + msg174896
2012-11-05 11:59:52techtoniksetstatus: closed -> open
resolution: not a bug -> (no value)
messages: + msg174895
2012-11-05 11:55:09r.david.murraysetstatus: open -> closed
stage: resolved
2012-11-05 11:29:36serhiy.storchakasetresolution: not a bug

messages: + msg174891
nosy: + serhiy.storchaka
2012-11-05 11:24:28techtonikcreate