[issue11074] fix tokenize so it can be reloaded

Brett Cannon report at bugs.python.org
Mon Jan 31 05:04:11 CET 2011

New submission from Brett Cannon <brett at python.org>:

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.

assignee: georg.brandl
components: Library (Lib)
files: tokenize_reload.diff
keywords: easy, patch
messages: 127570
nosy: brett.cannon, georg.brandl, haypo
priority: normal
severity: normal
stage: commit review
status: open
title: fix tokenize so it can be reloaded
type: behavior
versions: Python 3.2
Added file: http://bugs.python.org/file20624/tokenize_reload.diff

Python tracker <report at bugs.python.org>

More information about the Python-bugs-list mailing list