[issue15972] wrong error message for os.path.getsize

2013-01-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Fixed. Thank you for report, John. -- resolution: -> fixed stage: -> committed/rejected status: open -> closed versions: +Python 3.4 ___ Python tracker

[issue15972] wrong error message for os.path.getsize

2013-01-07 Thread Roundup Robot
Roundup Robot added the comment: New changeset 1b68dc917321 by Serhiy Storchaka in branch '3.3': Issue #15972: Fix error messages when os functions expecting a file name or http://hg.python.org/cpython/rev/1b68dc917321 New changeset 71fb426ee972 by Serhiy Storchaka in branch 'default': Issue #15

[issue15972] wrong error message for os.path.getsize

2013-01-07 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- assignee: -> serhiy.storchaka ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue15972] wrong error message for os.path.getsize

2012-09-21 Thread Georg Brandl
Georg Brandl added the comment: This certainly isn't a release blocker. Check it into default, and it will go into 3.3.1. -- priority: release blocker -> normal ___ Python tracker

[issue15972] wrong error message for os.path.getsize

2012-09-21 Thread Larry Hastings
Larry Hastings added the comment: Georg: this okay to check in? It passes the regression test. -- nosy: +georg.brandl ___ Python tracker ___

[issue15972] wrong error message for os.path.getsize

2012-09-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > Serhiy, you have the commit bit? It is zero. -- ___ Python tracker ___ ___ Python-bugs-list mai

[issue15972] wrong error message for os.path.getsize

2012-09-21 Thread Larry Hastings
Larry Hastings added the comment: LGTM. Serhiy, you have the commit bit? -- ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue15972] wrong error message for os.path.getsize

2012-09-21 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : Removed file: http://bugs.python.org/file27243/posix_path_converter_2.patch ___ Python tracker ___ ___ Python-bu

[issue15972] wrong error message for os.path.getsize

2012-09-21 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : Removed file: http://bugs.python.org/file27235/posix_path_converter.patch ___ Python tracker ___ ___ Python-bugs

[issue15972] wrong error message for os.path.getsize

2012-09-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > Patch looks fine, except please fix 80 columns. Patch updated. Long lines in tests fixed. -- Added file: http://bugs.python.org/file27247/posix_path_converter_3.patch ___ Python tracker

[issue15972] wrong error message for os.path.getsize

2012-09-21 Thread Larry Hastings
Larry Hastings added the comment: Patch looks fine, except please fix 80 columns. -- ___ Python tracker ___ ___ Python-bugs-list maili

[issue15972] wrong error message for os.path.getsize

2012-09-21 Thread John Taylor
John Taylor added the comment: OP here. These error messages are much better. Thanks! -- ___ Python tracker ___ ___ Python-bugs-list

[issue15972] wrong error message for os.path.getsize

2012-09-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Patch updated. Added tests. -- Added file: http://bugs.python.org/file27243/posix_path_converter_2.patch ___ Python tracker ___diff -r 24136a7

[issue15972] wrong error message for os.path.getsize

2012-09-21 Thread Larry Hastings
Larry Hastings added the comment: Ah! It seems Python is anti-Oxford Comma. Carry on! ;-) Wouldn't test_os be the natural place? I don't understand why you're having difficulty finding a suitable place. -- ___ Python tracker

[issue15972] wrong error message for os.path.getsize

2012-09-21 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: > But please add regression tests checking > that the error message is what we want. Immediately as soon as I find a suitable place for this test. Should be somewhere tests for bytes/unicode filenames. > I'd personally prefer the Oxford Comma there ("string,

[issue15972] wrong error message for os.path.getsize

2012-09-20 Thread Larry Hastings
Larry Hastings added the comment: Patch looks like it'll work fine. But please add regression tests checking that the error message is what we want. Are the new error messages okay with the OP? It looks like now it'll throw TypeError("argument must be string, bytes or integer, not list").

[issue15972] wrong error message for os.path.getsize

2012-09-20 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch. Are there any tests for string and bytes arguments as filenames? I will add float and list there. -- keywords: +patch Added file: http://bugs.python.org/file27235/posix_path_converter.patch ___ Py

[issue15972] wrong error message for os.path.getsize

2012-09-20 Thread STINNER Victor
STINNER Victor added the comment: Set the priority to release blocker until it is decided if this issue is a regression, or a new feature :-) -- priority: normal -> release blocker ___ Python tracker _

[issue15972] wrong error message for os.path.getsize

2012-09-20 Thread STINNER Victor
STINNER Victor added the comment: Functions of the os module uses PyUnicode_FSConverter() function (which uses PyBytes_Check() on bytes) in Python 3.2, whereas PyBytes_FromObject() is used in Python 3.3. Related change: changeset: 77597:27f9c26fdd8b user:Larry Hastings date:

[issue15972] wrong error message for os.path.getsize

2012-09-20 Thread STINNER Victor
STINNER Victor added the comment: It looks like os.stat() and os.path.getsize() converts the list into a byte string. It does something like: >>> x=[]; y=bytes(x); print(y.decode("ascii")) >>> x=[65, 66, 67]; y=bytes(x); print(y.decode("ascii")) ABC >>> x=[None]; y=bytes(x); print(y.decode("as

[issue15972] wrong error message for os.path.getsize

2012-09-19 Thread Christian Heimes
Christian Heimes added the comment: Linux: >>> os.stat([]) Traceback (most recent call last): File "", line 1, in FileNotFoundError: [Errno 2] No such file or directory: '' [60996 refs] >>> os.stat([None]) Traceback (most recent call last): File "", line 1, in TypeError: an integer is requ

[issue15972] wrong error message for os.path.getsize

2012-09-19 Thread John Taylor
New submission from John Taylor: import os.path a = [ r'c:\Windows\notepad.exe' ] print( os.path.getsize(a) ) Under Python 3.2.3, this error message is returned: File "c:\python32\lib\genericpath.py", line 49, in getsize return os.stat(filename).st_size TypeError: Can't convert 'list' obje