[issue18269] Clarify which integer is required in os.chmod() exception

2013-06-20 Thread anatoly techtonik
anatoly techtonik added the comment: Right. This report is about improving error message. It doesn't say what is expected where. If you have a call like: os.fchmod(outfile, unixperm) it is easy to assume that unixperm is not integer, while in fact the problem is in outfile. This could not

[issue18269] Clarify which integer is required in os.chmod() exception

2013-06-20 Thread Brett Cannon
Brett Cannon added the comment: That's expected with that kind of argument. os.fchmod() and os.chmod() only accept a path as a string or a file descriptor as an integer as specified in the docs: http://docs.python.org/3/library/os.html#os.chmod -- resolution: -> invalid status: open -

[issue18269] Clarify which integer is required in os.chmod() exception

2013-06-20 Thread anatoly techtonik
anatoly techtonik added the comment: >>> v = open("VERSION") >>> import os >>> os.fchmod(v, 0664) Traceback (most recent call last): File "", line 1, in TypeError: an integer is required -- status: pending -> open ___ Python tracker

[issue18269] Clarify which integer is required in os.chmod() exception

2013-06-20 Thread Brett Cannon
Brett Cannon added the comment: os.chmod is implemented in posixmodule.c and the argument parsing code can be found at http://hg.python.org/cpython/file/3acbb23c73bc/Modules/posixmodule.c#l2605 . You will notice that the argument parsing is specified as "O&i|$O&p". That means the first argume

[issue18269] Clarify which integer is required in os.chmod() exception

2013-06-19 Thread anatoly techtonik
New submission from anatoly techtonik: (, '0755') (, '0644') Traceback (most recent call last): File "./tools/bootstrap.py", line 185, in extract_zip os.fchmod(outfile, unixperm) TypeError: an integer is required Here the integer that is required is not `unixperm`, but `outfile`. ---