msg173140 - (view) |
Author: Ramchandra Apte (Ramchandra Apte) * |
Date: 2012-10-17 08:06 |
Will attach patch.
|
msg173175 - (view) |
Author: Brett Cannon (brett.cannon) *  |
Date: 2012-10-17 13:50 |
One thing to be aware of, Ramchandra, is that there might be a slight backwards-compatibility problem from tightening up what exceptions propagate. Now with proper documentation and only applying things to 3.4 this probably won't be a problem.
|
msg174264 - (view) |
Author: Ramchandra Apte (Ramchandra Apte) * |
Date: 2012-10-31 05:04 |
This seems quite difficult for one person;there are 589 lines having "except:"
I'll work on the Tools directory.
If anybody wants to help, please tell which folder you will do.
|
msg174403 - (view) |
Author: Andrew Svetlov (asvetlov) *  |
Date: 2012-11-01 11:51 |
I'm pretty sure Doc and Lib are already fixed, only Tools left.
|
msg174406 - (view) |
Author: Ramchandra Apte (Ramchandra Apte) * |
Date: 2012-11-01 12:26 |
On 1 November 2012 17:21, Andrew Svetlov <report@bugs.python.org> wrote:
>
> Andrew Svetlov added the comment:
>
> I'm pretty sure Doc and Lib are already fixed, only Tools left.
>
> ----------
> nosy: +asvetlov
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue16261>
> _______________________________________
>
No. 405 are there in Lib. Try running `grep "except:" -R Lib --include
"*.py"` to see yourself.
|
msg174452 - (view) |
Author: Andrew Svetlov (asvetlov) *  |
Date: 2012-11-01 19:36 |
Sorry, looks like I don't understood you correctly.
Do you want to replace `except:` to `except Exception` or something else?
|
msg174489 - (view) |
Author: Ramchandra Apte (Ramchandra Apte) * |
Date: 2012-11-02 04:42 |
Yes.
most of the bare excepts can be replaced with a stricter clause
On 2 November 2012 01:06, Andrew Svetlov <report@bugs.python.org> wrote:
>
> Andrew Svetlov added the comment:
>
> Sorry, looks like I don't understood you correctly.
> Do you want to replace `except:` to `except Exception` or something else?
>
> ----------
>
> _______________________________________
> Python tracker <report@bugs.python.org>
> <http://bugs.python.org/issue16261>
> _______________________________________
>
|
msg174564 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2012-11-02 20:07 |
New changeset b2bd62d1644f by Andrew Svetlov in branch 'default':
Issue #16261: fix bare excepts in Doc/
http://hg.python.org/cpython/rev/b2bd62d1644f
|
msg174565 - (view) |
Author: Andrew Svetlov (asvetlov) *  |
Date: 2012-11-02 20:10 |
I've fixed bare except: in docs.
Tomorrow we will have Python sprint in Kiev.
Maybe somebody will take a look on Lib.
|
msg179441 - (view) |
Author: Ramchandra Apte (Ramchandra Apte) * |
Date: 2013-01-09 13:47 |
Here's a patch on revision 75fe7f5fda9a (I did it on a trip without an internet connection)
There might be some mistakes of this type:
I incorrectly changed instances like this
`
try:
something
except:
close file
raise
`
to
`
try:
something
finally:
close file
`
(the incorrect version closes the file always)
|
msg179442 - (view) |
Author: Ramchandra Apte (Ramchandra Apte) * |
Date: 2013-01-09 13:51 |
Sorry, I entered the wrong filename for the patch and so it didn't get attached. Now I have attached it.
|
msg179445 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2013-01-09 14:33 |
Unhappy Rietveld hasn't recognize your patch. I have regenerated it.
|
msg179448 - (view) |
Author: Richard Oudkerk (sbt) *  |
Date: 2013-01-09 15:00 |
> try:
> _MAXFD = os.sysconf("SC_OPEN_MAX")
> -except:
> +except ValueError:
> _MAXFD = 256
os.sysconf() might raise OSError. I think ValueError is only raised if _SC_OPEN_MAX was undefined when the module was compiled.
|
msg179449 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2013-01-09 15:05 |
See my comments on Rietveld.
|
msg179456 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2013-01-09 15:45 |
Want to make a few warnings. Accepting your confirmation may take a long time. And it is very unlikely that your patch can be applied as a whole. The maintainers of the individual modules can apply it by parts.
|
msg202448 - (view) |
Author: Terry J. Reedy (terry.reedy) *  |
Date: 2013-11-08 22:39 |
The earlier #15313 is about removing bare excepts in Idle code. These should be handled separately for two reasons.
1. Changes can and in most cases should be backported.
2. As with any other Python-coded application, uncaught exceptions cause Idle to quit. Currently, if Idle is started directly, rather than from a console, such an exit looks like a silent crash. So either the added tuple of exceptions to be caught must be complete, or the calling code must be adjusted.
I copied the one idlelib fix (to PyShell.py) to that issue for separate examination. It should be removed from any patch applied here.
|
msg216810 - (view) |
Author: Terry J. Reedy (terry.reedy) *  |
Date: 2014-04-18 22:01 |
See more discussion on duplicate #21259.
|
msg243639 - (view) |
Author: Martin Panter (martin.panter) *  |
Date: 2015-05-20 02:16 |
I reviewed the patch on Reitveld. All of the changes that do not have comments look okay to me, although some will definitely have merge conflicts with the current code. If someone updated the patch based on the comments, I think it may be okay to commit.
|
msg243650 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2015-05-20 07:34 |
New changeset b3a7215b9ce4 by Serhiy Storchaka in branch 'default':
Issue #16261: Converted some bare except statements to except statements
https://hg.python.org/cpython/rev/b3a7215b9ce4
|
msg243651 - (view) |
Author: Serhiy Storchaka (serhiy.storchaka) *  |
Date: 2015-05-20 07:35 |
Resolved conflicts, fixed some noted issues in the patch and committed unquestionable changes. Thank you for your patch Ramchandra.
|
|
Date |
User |
Action |
Args |
2022-04-11 14:57:37 | admin | set | github: 60465 |
2015-09-19 06:02:44 | martin.panter | link | issue21259 superseder |
2015-05-20 07:35:47 | serhiy.storchaka | set | status: open -> closed resolution: fixed messages:
+ msg243651
stage: patch review -> resolved |
2015-05-20 07:34:07 | python-dev | set | messages:
+ msg243650 |
2015-05-20 07:21:54 | serhiy.storchaka | set | assignee: serhiy.storchaka stage: needs patch -> patch review versions:
+ Python 3.5, - Python 3.4 |
2015-05-20 02:16:33 | martin.panter | set | nosy:
+ martin.panter
messages:
+ msg243639 stage: needs patch |
2014-04-18 22:01:41 | terry.reedy | set | messages:
+ msg216810 |
2013-11-08 22:39:39 | terry.reedy | set | nosy:
+ terry.reedy messages:
+ msg202448
|
2013-11-08 19:32:29 | ezio.melotti | set | nosy:
+ ezio.melotti
|
2013-11-07 21:57:23 | vstinner | set | nosy:
+ vstinner
|
2013-01-09 15:45:36 | serhiy.storchaka | set | messages:
+ msg179456 |
2013-01-09 15:05:43 | serhiy.storchaka | set | messages:
+ msg179449 |
2013-01-09 15:00:18 | sbt | set | nosy:
+ sbt messages:
+ msg179448
|
2013-01-09 14:33:58 | serhiy.storchaka | set | files:
+ bare_except.patch nosy:
+ serhiy.storchaka messages:
+ msg179445
|
2013-01-09 13:51:07 | Ramchandra Apte | set | files:
+ patch.patch keywords:
+ patch messages:
+ msg179442
|
2013-01-09 13:47:15 | Ramchandra Apte | set | messages:
+ msg179441 |
2012-11-02 20:10:18 | asvetlov | set | messages:
+ msg174565 |
2012-11-02 20:07:37 | python-dev | set | nosy:
+ python-dev messages:
+ msg174564
|
2012-11-02 04:42:27 | Ramchandra Apte | set | messages:
+ msg174489 |
2012-11-01 19:36:39 | asvetlov | set | messages:
+ msg174452 |
2012-11-01 12:26:01 | Ramchandra Apte | set | messages:
+ msg174406 |
2012-11-01 11:51:57 | asvetlov | set | nosy:
+ asvetlov messages:
+ msg174403
|
2012-10-31 05:04:15 | Ramchandra Apte | set | messages:
+ msg174264 |
2012-10-30 13:40:51 | Ramchandra Apte | set | type: behavior |
2012-10-19 16:17:56 | eric.araujo | set | nosy:
+ eric.araujo
versions:
+ Python 3.4 |
2012-10-17 13:50:08 | brett.cannon | set | nosy:
+ brett.cannon messages:
+ msg173175
|
2012-10-17 08:06:05 | Ramchandra Apte | create | |