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.

Author takluyver
Recipients takluyver, vstinner
Date 2015-03-09.01:21:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Issue #22599 changed from using to having a module-level reference to _builtin_open, stored by doing _builtin_open = open. However, on reloading the module, _builtin_open is pointed to from the last execution of the code, breaking

>>> import tokenize
<function open at 0x7f15b660fc80>
>>> tokenize._builtin_open
<built-in function open>
>>> import imp; imp.reload(tokenize)
<module 'tokenize' from '/home/takluyver/miniconda3/envs/py34/lib/python3.4/'>
<function open at 0x7f15b660fbf8>
>>> tokenize._builtin_open
<function open at 0x7f15b660fc80>
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/takluyver/miniconda3/envs/py34/lib/python3.4/", line 438, in open
    buffer = _builtin_open(filename, 'rb')
TypeError: open() takes 1 positional argument but 2 were given

The actual case where I'm seeing this error is nose logging a failure in a test suite, so it's not clear what is reloading tokenize, but it appears that something is. This just started failing when our Windows test system updated to Python 3.4.3.
Date User Action Args
2015-03-09 01:21:09takluyversetrecipients: + takluyver, vstinner
2015-03-09 01:21:09takluyversetmessageid: <>
2015-03-09 01:21:08takluyverlinkissue23615 messages
2015-03-09 01:21:06takluyvercreate