New submission from Jan Pokorny:

Encountered a weird behavior when working with variable with the same name as 
exception's alias.

Observed behavior:

- In case variable with the same name (e.g. 'e') already exists when any 
'except Error as e' block is executed, the 'e' variable is removed after 
exception handling finishes (NameError: name 'e' is not defined)

- Happens only in Python 3
- Code reproducing the issue included

Expected behavior:

- Variable is kept in its pre-exception state

Proposed solution:

- Store colliding variable into temporary variable, restore it afterwards

----------
components: Interpreter Core
files: schrodinger.py
messages: 258757
nosy: japokorn
priority: normal
severity: normal
status: open
title: Exception alias cause destruction of existing variable
type: behavior
versions: Python 3.4
Added file: http://bugs.python.org/file41683/schrodinger.py

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue26174>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to