classification
Title: fix tokenize so it can be reloaded
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: brett.cannon Nosy List: brett.cannon, eric.araujo, georg.brandl, haypo
Priority: normal Keywords: easy, patch

Created on 2011-01-31 04:04 by brett.cannon, last changed 2011-02-22 03:35 by brett.cannon. This issue is now closed.

Files
File name Uploaded Description Edit
tokenize_reload.diff brett.cannon, 2011-01-31 04:04 Make tokenize reloadable
Messages (3)
msg127570 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2011-01-31 04:04
The tokenize module stores the built-in open() module in a global assignment statement. Problem is that if you reload the module, that global assignment picks up the module's own open() that came into existence during the initial import.

The attached patch fixes this by having tokenize.open() use builtins.open() instead of its own cached global version.
msg127926 - (view) Author: √Čric Araujo (eric.araujo) * (Python committer) Date: 2011-02-04 19:37
LGTM.
msg129032 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2011-02-22 03:35
r88498 for 3.3
r88499 for 3.2
History
Date User Action Args
2011-02-22 03:35:40brett.cannonsetstatus: open -> closed
nosy: brett.cannon, georg.brandl, haypo, eric.araujo
messages: + msg129032

resolution: fixed
stage: commit review -> resolved
2011-02-04 19:37:07eric.araujosetnosy: + eric.araujo
messages: + msg127926
2011-01-31 19:42:22brett.cannonsetassignee: georg.brandl -> brett.cannon
nosy: brett.cannon, georg.brandl, haypo
versions: + Python 3.3, - Python 3.2
2011-01-31 04:04:10brett.cannoncreate