This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: sys.exc_clear() not flagged in any way
Type: behavior Stage:
Components: 2to3 (2.x to 3.x conversion tool) Versions: Python 3.0
process
Status: closed Resolution: wont fix
Dependencies: Superseder:
Assigned To: benjamin.peterson Nosy List: benjamin.peterson, fabioz, georg.brandl, pitrou
Priority: normal Keywords:

Created on 2008-12-22 11:46 by fabioz, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (10)
msg78173 - (view) Author: Fabio Zadrozny (fabioz) * Date: 2008-12-22 11:46
sys.exc_clear() does not seem to exist in Python 3.0 anymore, so, a way
to deal with it should be provided (maybe put a #TODO comment and point
to somewhere explaining what happened?).
msg78175 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2008-12-22 11:52
There should be no need for sys.exc_clear() anymore. What are you trying
to achieve?
msg78176 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2008-12-22 11:52
In any case, probably a documentation issue :))
msg78177 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2008-12-22 12:32
exc_clear() is not in the 3.0 docs, and the whatsnew contains a note.

Maybe a 2to3 issue?
msg78178 - (view) Author: Fabio Zadrozny (fabioz) * Date: 2008-12-22 12:48
When created it was already marked as a 2to3 issue (in the components),
so, for clarity, yes: it's a 2to3 issue (what should the user do with
that when porting... I think that the 2to3 should do something regarding
that... maybe just changing it for a 'pass'?).

Also, the docs say it was removed, but they don't leave clear that it's
not needed because no info is stored anymore (because that was needed
just to clear the frame that was kept alive when an exception was raised
-- so, note that I'm assuming that issue was fixed and it's not needed
anymore, but the docs don't make that clear)
msg78180 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2008-12-22 12:59
Le lundi 22 décembre 2008 à 12:48 +0000, Fabio Zadrozny a écrit :
> Fabio Zadrozny <fabioz@users.sourceforge.net> added the comment:
> 
> When created it was already marked as a 2to3 issue

Oops, sorry.

> (because that was needed
> just to clear the frame that was kept alive when an exception was raised

To clear the frame and the exception object itself, yes.
msg78181 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2008-12-22 13:30
Actually, I think this should just get a Py3k warning in 2.6 and 2.7.
2to3 doesn't deal with anything else that has been removed.
msg78182 - (view) Author: Fabio Zadrozny (fabioz) * Date: 2008-12-22 13:44
> 2to3 doesn't deal with anything else that has been removed.

That seems a bit odd for me... isn't it the perfect place for that? (it
doesn't even need to change the code for a pass, but it could give the
user some warning about it at that specific line -- maybe with a pointer
to a place explaining why it was removed).

I think that if 2to3 flags it, it can make the porting cycle faster than
having to run the code (and expecting a huge code-coverage) to get those
-- especially as sys.exc_clear is mostly used in cases where you are
expecting some exception... and I believe not everyone gives as much
emphasis for exception cases as they'd for the cases in the 'regular flow'
msg78201 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2008-12-22 17:52
In fact, there is already a Py3k warning for sys.exc_clear(). I'm still
not convinced that 2to3 should play a role. What should it do? Simply
remove the call? I'm apprehensive about trying to guess the intention of
the user.
msg78202 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2008-12-22 17:53
If this is already handled by the -3 flag then I agree it's not a bug.
History
Date User Action Args
2022-04-11 14:56:43adminsetgithub: 48969
2008-12-22 17:54:09benjamin.petersonsetstatus: open -> closed
resolution: wont fix
2008-12-22 17:53:41pitrousetmessages: + msg78202
2008-12-22 17:52:05benjamin.petersonsetmessages: + msg78201
2008-12-22 13:44:53fabiozsetmessages: + msg78182
2008-12-22 13:30:11benjamin.petersonsetmessages: + msg78181
2008-12-22 12:59:35pitrousetmessages: + msg78180
2008-12-22 12:48:12fabiozsetmessages: + msg78178
2008-12-22 12:32:59georg.brandlsetassignee: georg.brandl -> benjamin.peterson
messages: + msg78177
components: + 2to3 (2.x to 3.x conversion tool), - Documentation
nosy: + benjamin.peterson
2008-12-22 11:52:38pitrousetnosy: + georg.brandl
messages: + msg78176
priority: normal
assignee: georg.brandl
components: + Documentation, - 2to3 (2.x to 3.x conversion tool)
type: behavior
2008-12-22 11:52:07pitrousetnosy: + pitrou
messages: + msg78175
2008-12-22 11:46:43fabiozcreate