[issue9921] os.path.join('x','') behavior

2011-06-23 Thread R. David Murray
Changes by R. David Murray : -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker ___ _

[issue9921] os.path.join('x','') behavior

2011-06-23 Thread Roundup Robot
Roundup Robot added the comment: New changeset 1e89444f4ebc by R David Murray in branch '2.7': #9921: clarify os.path.join joining algorithm http://hg.python.org/cpython/rev/1e89444f4ebc New changeset f5f5b715be7e by R David Murray in branch '3.2': #9921: clarify os.path.join joining algorithm

[issue9921] os.path.join('x','') behavior

2011-06-23 Thread Brian Brazil
Brian Brazil added the comment: David's change sounds good to me. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscr

[issue9921] os.path.join('x','') behavior

2011-06-22 Thread R. David Murray
R. David Murray added the comment: Here is a patch that I think describes the algorithm correctly, based on the comments in the module, with a clarifying parenthetical to cover the non-obvious consequence of that algorithm. -- versions: +Python 3.3 -Python 3.1 Added file: http://bugs.

[issue9921] os.path.join('x','') behavior

2010-11-19 Thread Éric Araujo
Éric Araujo added the comment: Comment in ntpath.isabs: For Windows it is absolute if it starts with a slash or backslash (current volume), or if a pathname after the volume-letter-and-colon or UNC-resource starts with a slash or backslash. -- ___

[issue9921] os.path.join('x','') behavior

2010-11-19 Thread R. David Murray
R. David Murray added the comment: "first part" by itself sounds like there can only be two parts. How about 'inserts a separator between each pair of...' Also, what does 'absolute' mean on Windows? Does it include the drive? If so, the second sentence should probably say 'if a part starts

[issue9921] os.path.join('x','') behavior

2010-11-19 Thread Éric Araujo
Éric Araujo added the comment: I think the comment is fine as is. +1 to adding your wording to the docs. -- keywords: +patch nosy: +eric.araujo stage: needs patch -> patch review ___ Python tracker ___

[issue9921] os.path.join('x','') behavior

2010-11-19 Thread Éric Araujo
Changes by Éric Araujo : -- Removed message: http://bugs.python.org/msg118372 ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue9921] os.path.join('x','') behavior

2010-10-11 Thread Radu Grigore
Changes by Radu Grigore : -- nosy: -rgrig ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.or

[issue9921] os.path.join('x','') behavior

2010-10-11 Thread Rafe H. Kettler
Rafe H. Kettler added the comment: Radu, while the comments are not as clear for ntpath, the behavior is the same. So, the comment you detailed from posixpath could be adapted to Windows by replacing '/' with 'a separator' or something of that nature. That said, the comment in posixpath could

[issue9921] os.path.join('x','') behavior

2010-10-11 Thread Radu Grigore
Radu Grigore added the comment: Realizing I still don't know what os.join.path does, I looked at the source. The comment in posixpath.py is: # Ignore the previous parts if a part is absolute. # Insert a '/' unless the first part is empty or already ends in '/'. I find this clear and it direct

[issue9921] os.path.join('x','') behavior

2010-10-11 Thread Radu Grigore
Radu Grigore added the comment: posixpath.py's comment says -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue9921] os.path.join('x','') behavior

2010-10-11 Thread Rafe H. Kettler
Rafe H. Kettler added the comment: I think Brian's second solution ("the result is simply path2 when path1 is empty or path2 is an absolute path?") is a strong one. If that were tacked on towards the end it would add some clarity to the docs for people who will end up using this behavior or w

[issue9921] os.path.join('x','') behavior

2010-10-10 Thread Brian Brazil
Brian Brazil added the comment: That doesn't cover the os.path.join('', 'x') case, and I'm not sure it makes os.path.join('x//', 'y') clear - though that doesn't matter as much. How about making (2) "the result is simply path2 when path1 is empty or path2 is an absolute path? -- ___

[issue9921] os.path.join('x','') behavior

2010-10-01 Thread Radu Grigore
Radu Grigore added the comment: I would say something like the following. The function join(path1, path2) is almost like os.sep.join(path1, path2), but (1) trailing path separators in path1 are ignored and (2) the result is simply path2 when path2 is an absolute path. The call join(path1, pat

[issue9921] os.path.join('x','') behavior

2010-09-23 Thread Brian Brazil
Brian Brazil added the comment: The behaviour is a bit more nuanced: >>> os.path.join('x', '') 'x/' >>> os.path.join('x', '', 'y') 'x/y' >>> os.path.join('x', '', 'y', '', '') 'x/y/' >>> os.path.join('', 'x') 'x' I'm unsure how to word this best, maybe "non-trailing empty paths are ignored"? -

[issue9921] os.path.join('x','') behavior

2010-09-22 Thread R. David Murray
R. David Murray added the comment: Since changing the implementation would be a backward incompatible behavior change to a behavior that has existed for a long time, it's the docs that should be updated. -- assignee: -> d...@python components: +Documentation -Library (Lib) nosy: +d..

[issue9921] os.path.join('x','') behavior

2010-09-22 Thread Radu Grigore
New submission from Radu Grigore : The docs say that "the return value is the concatenation of path1, and optionally path2, etc., with exactly one directory separator (os.sep) inserted between components, unless path2 is empty." But os.path.join('x','') returns 'x/' in which path1 and path2 *a