Message 191541 - Python tracker

This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Content
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 be actual for Python 3, but it seems that there is bug with it as well.

>>> v = open("VERSION")
>>> import os
>>> os.fchmod(v, 0664)
  File "<stdin>", line 1
    os.fchmod(v, 0664)
                    ^
SyntaxError: invalid token
>>>