[issue23780] Surprising behaviour when passing list to os.path.join.

2015-05-21 Thread Serhiy Storchaka
Changes by Serhiy Storchaka storch...@gmail.com: -- resolution: - fixed stage: patch review - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23780 ___

[issue23780] Surprising behaviour when passing list to os.path.join.

2015-05-19 Thread Roundup Robot
Roundup Robot added the comment: New changeset 84af71e8c051 by Serhiy Storchaka in branch 'default': Issue #23780: Improved error message in os.path.join() with single argument. https://hg.python.org/cpython/rev/84af71e8c051 -- nosy: +python-dev ___

[issue23780] Surprising behaviour when passing list to os.path.join.

2015-05-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is extended patch, with tests. -- assignee: - serhiy.storchaka stage: - patch review versions: -Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23780

[issue23780] Surprising behaviour when passing list to os.path.join.

2015-05-16 Thread Florian Bruhin
Florian Bruhin added the comment: Serhiy, I don't see a new patch added - did you forget to attach it or am I missing something? :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23780

[issue23780] Surprising behaviour when passing list to os.path.join.

2015-05-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Oh, sorry, I forget to attach it. -- Added file: http://bugs.python.org/file39394/join_datatype_check_2.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23780

[issue23780] Surprising behaviour when passing list to os.path.join.

2015-03-26 Thread Pikec
Boštjan Mejak (Pikec) added the comment: Using Python 3.4.3 on Windows 7 Home Premium 64 bit, Service Pack 1: import os os.path.join([1, 2, 3]) Traceback (most recent call last): File stdin, line 1, in module File C:\Program Files\Python 3.4\lib\ntpath.py, line 108, in join

[issue23780] Surprising behaviour when passing list to os.path.join.

2015-03-26 Thread Boštjan Mejak
Changes by Boštjan Mejak bostjan.xpe...@gmail.com: -- versions: +Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23780 ___ ___

[issue23780] Surprising behaviour when passing list to os.path.join.

2015-03-26 Thread Florian Bruhin
New submission from Florian Bruhin: I just accidentally passed a list (instead of unpacking it) to os.path.join. I was surprised when it just returned the list unmodified: os.path.join([1, 2, 3]) [1, 2, 3] Looking at the source, it simply returns the first argument (path = a; ...; return

[issue23780] Surprising behaviour when passing list to os.path.join.

2015-03-26 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Error message for ntpath is improved in 3.5. import ntpath ntpath.join([1, 2, 3]) Traceback (most recent call last): File stdin, line 1, in module File /home/serhiy/py/cpython/Lib/ntpath.py, line 111, in join genericpath._check_arg_types('join',

[issue23780] Surprising behaviour when passing list to os.path.join.

2015-03-26 Thread R. David Murray
R. David Murray added the comment: No, I'm not going to write tests...my goal is to commit other people's patches, and I haven't even found time for that lately. And like you, I'm not convinced the fix is needed. There is one argument I can think of in favor, though: currently code that

[issue23780] Surprising behaviour when passing list to os.path.join.

2015-03-26 Thread R. David Murray
R. David Murray added the comment: Python's philosophy is one of duck typing, which means that in general we just let the functions fail with whatever error they produce when the in put datatype is wrong. The error message in this case is fairly straightforward: you passed a list and it says