[issue27238] Bare except: usages in turtle.py

2016-06-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for your contribution Jelle.

--
resolution:  -> fixed
stage: commit review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27238] Bare except: usages in turtle.py

2016-06-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 78e5efa3dd9e by Serhiy Storchaka in branch '3.5':
Issue #27238: Got rid of bare excepts in the turtle module.  Original patch
https://hg.python.org/cpython/rev/78e5efa3dd9e

New changeset e9d023b7d676 by Serhiy Storchaka in branch '2.7':
Issue #27238: Got rid of bare excepts in the turtle module.  Original patch
https://hg.python.org/cpython/rev/e9d023b7d676

New changeset cd68cf41adf2 by Serhiy Storchaka in branch 'default':
Issue #27238: Got rid of bare excepts in the turtle module.  Original patch
https://hg.python.org/cpython/rev/cd68cf41adf2

--
nosy: +python-dev

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27238] Bare except: usages in turtle.py

2016-06-14 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

LGTM.

There is no case for bare except here. Actually it is a bug, since (in this 
file) a bare except can swallow KeyboardInterrupt.

--
assignee: Jelle Zijlstra -> serhiy.storchaka
stage: patch review -> commit review
type: enhancement -> behavior
versions: +Python 2.7, Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27238] Bare except: usages in turtle.py

2016-06-10 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Add a comment to indicate that bare exception is intentional and briefly why.

--
nosy: +terry.reedy

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27238] Bare except: usages in turtle.py

2016-06-07 Thread Jelle Zijlstra

Jelle Zijlstra added the comment:

Thanks for the review and comments. This patch addresses your comments and 
changes the __file__-related one to catch Exception.

--
Added file: http://bugs.python.org/file43299/issue27238-cr.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27238] Bare except: usages in turtle.py

2016-06-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thanks Brett and Martin.

Jelle, I think it would be safer to use "except Exception" here. "except 
(TypeError, ValueError):" is not enough.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27238] Bare except: usages in turtle.py

2016-06-06 Thread Martin Panter

Martin Panter added the comment:

The documentation says __file__ can be missing. It is missing for builtin 
modules (e.g. sys) and frozen modules (e.g. __hello__).

--
nosy: +martin.panter

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27238] Bare except: usages in turtle.py

2016-06-06 Thread Brett Cannon

Brett Cannon added the comment:

__file__ could be None if __spec__.origin is None. The import machinery doesn't 
introspect on __file__ for anything, so it won't break import if __file__ has 
alternative values. In general, though, normal imports will set __file__ to a 
string.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27238] Bare except: usages in turtle.py

2016-06-06 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Brett, can __file__ of imported/executed module be None, bytes or absent in 
3.6? Can it be non-str?

--
nosy: +brett.cannon

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27238] Bare except: usages in turtle.py

2016-06-06 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
stage:  -> patch review
type:  -> enhancement

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27238] Bare except: usages in turtle.py

2016-06-06 Thread Jelle Zijlstra

Jelle Zijlstra added the comment:

This patch removes all usages of "except:" in turtle.py. The tests in 
test_turtle.py and turtle.rst still work.

--
keywords: +patch
Added file: http://bugs.python.org/file43258/issue27238.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue27238] Bare except: usages in turtle.py

2016-06-05 Thread Jelle Zijlstra

New submission from Jelle Zijlstra:

Will add a patch

--
assignee: Jelle Zijlstra
components: Library (Lib)
messages: 267493
nosy: Jelle Zijlstra, serhiy.storchaka
priority: normal
severity: normal
status: open
title: Bare except: usages in turtle.py
versions: Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com