[issue11378] os.path.join when second starts with '/' (linux/unix)

Alessandro Forghieri report at bugs.python.org
Wed Mar 2 18:45:03 CET 2011


New submission from Alessandro Forghieri <alf at orion.it>:

Observed behavior:

>>>>>>os.path.join('/foo/bar', '/baz')
'/baz'

Expected behavior:

should return '/foo/bar/baz' or (suboptimally) raise an exception.

Why:
Observed beahvior violates the minimal surprise principle and does not appear to respond to any particular rationale (by the same token it could return /foo/bar as well)

----------
components: Library (Lib)
messages: 129906
nosy: al_form2000
priority: normal
severity: normal
status: open
title: os.path.join when second  starts with '/' (linux/unix)
type: behavior
versions: Python 2.5, Python 2.6, Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue11378>
_______________________________________


More information about the Python-bugs-list mailing list