[New-bugs-announce] [issue15972] wrong error message for os.path.getsize

John Taylor report at bugs.python.org
Wed Sep 19 18:12:02 CEST 2012


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' object to str implicitly


Under Python 3.3.0rc2, this error message is returned:
  File "c:\Python33\lib\genericpath.py", line 49, in getsize
    return os.stat(filename).st_size
TypeError: an integer is required


I feel like the 3.2.3 behavior is more accurate and would like to propose that the 3.3 error message says something about a list instead of an integer.

----------
components: Extension Modules
messages: 170726
nosy: jftuga
priority: normal
severity: normal
status: open
title: wrong error message for os.path.getsize
type: behavior
versions: Python 3.3

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


More information about the New-bugs-announce mailing list