[issue23615] Reloading tokenize breaks tokenize.open()

2015-03-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: LGTM. Do you want to write a patch for other cases Thomas? -- ___ Python tracker ___ ___ Python-bu

[issue23615] Reloading tokenize breaks tokenize.open()

2015-03-12 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: The same issue exists in Lib/bz2.py, Lib/tarfile.py, Tools/freeze/bkfile.py. May be write a code as from builtins import open as _builtin_open ? -- nosy: +brett.cannon, eric.snow, ncoghlan, serhiy.storchaka type: -> behavior __

[issue23615] Reloading tokenize breaks tokenize.open()

2015-03-11 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Only grep. -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.

[issue23615] Reloading tokenize breaks tokenize.open()

2015-03-11 Thread STINNER Victor
STINNER Victor added the comment: Is there a method to detect other reload bugs? -- ___ Python tracker ___ ___ Python-bugs-list mailin

[issue23615] Reloading tokenize breaks tokenize.open()

2015-03-11 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- resolution: -> fixed stage: commit review -> resolved status: open -> closed ___ Python tracker ___

[issue23615] Reloading tokenize breaks tokenize.open()

2015-03-11 Thread Roundup Robot
Roundup Robot added the comment: New changeset 383ba3699084 by Serhiy Storchaka in branch '3.4': Issue #23615: Modules bz2, tarfile and tokenize now can be reloaded with https://hg.python.org/cpython/rev/383ba3699084 New changeset 6e736a57a482 by Serhiy Storchaka in branch 'default': Issue #2361

[issue23615] Reloading tokenize breaks tokenize.open()

2015-03-11 Thread Brett Cannon
Brett Cannon added the comment: LGTM as well. You want to commit, Serhiy? If not assign to me and I will get to it on Friday. -- assignee: -> serhiy.storchaka ___ Python tracker __

[issue23615] Reloading tokenize breaks tokenize.open()

2015-03-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: LGTM. -- stage: -> commit review ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubsc

[issue23615] Reloading tokenize breaks tokenize.open()

2015-03-10 Thread Thomas Kluyver
Thomas Kluyver added the comment: Fixed the other three cases you pointed out (-B2.patch). -- Added file: http://bugs.python.org/file38426/tokenize-reloadable-B2.patch ___ Python tracker ___

[issue23615] Reloading tokenize breaks tokenize.open()

2015-03-10 Thread Thomas Kluyver
Thomas Kluyver added the comment: -B.patch as Serhiy suggests, for tokenize only for the time being. -- Added file: http://bugs.python.org/file38425/tokenize-reloadable-B.patch ___ Python tracker __

[issue23615] Reloading tokenize breaks tokenize.open()

2015-03-10 Thread Thomas Kluyver
Thomas Kluyver added the comment: Patch attached to fix this. -- keywords: +patch Added file: http://bugs.python.org/file38423/tokenize-reloadable.patch ___ Python tracker ___ __

[issue23615] Reloading tokenize breaks tokenize.open()

2015-03-08 Thread Thomas Kluyver
New submission from Thomas Kluyver: Issue #22599 changed tokenize.open() from using builtins.open() 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 tokenize.open from the last execution of