Issue 23019: pyexpat.errors wrongly bound to message strings instead of message codes (original) (raw)

Created on 2014-12-09 07:45 by bkarge, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (8)
msg232348 - (view) Author: Björn Karge (bkarge) Date: 2014-12-09 07:45
expat.errors should expose the enum values and NOT the associated message strings, so they can be tested against ExpatError.code
msg232383 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2014-12-09 15:24
The API is what it is. In the Python3 docs this is documented as a backward compatibility issue, and the workaround using the new errors.codes is provided. For 2.7 we are stuck with what we have, since we don't add new features to 2.7.
msg232414 - (view) Author: Björn Karge (bkarge) Date: 2014-12-10 06:16
I strongly disagree. The constants are just useless as they are (so this bug can hardly be considered a feature). The behaviour is not matching the 2.7 docs, so fixing it certainly won't be adding a new feature, and the python 3 behaviour can easily be preserved even if these constants are numbers.
msg232426 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2014-12-10 14:27
For backward compatibility reasons this *can not be changed*. We are stuck with it, even though we agree it is broken. Please do not reopen the issue.
msg232427 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2014-12-10 14:36
Actually, I'm going to reopen it as a doc issue. This should be explained in the 2.7 docs.
msg295227 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2017-06-06 01:45
Also, even in the Py 3 docs, the ErrorCode parser attribute is said to be numeric, but there is a suggestion to compare it with “constants” defined in the “errors” (module) object. I guess it should be clarified that you can’t compare it directly; perhaps using ErrorString or Py 3’s “errors.codes” is more appropriate?
msg352153 - (view) Author: Tahia K (ta1hia) * Date: 2019-09-12 13:07
Hi guys, Is this issue still free to pick up?
msg370457 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2020-05-31 13:50
Python 2.7 is no longer supported.
History
Date User Action Args
2022-04-11 14:58:10 admin set github: 67208
2020-05-31 13:50:01 serhiy.storchaka set status: open -> closednosy: + serhiy.storchakamessages: + resolution: wont fix -> out of datestage: needs patch -> resolved
2019-09-12 13:07:29 ta1hia set nosy: + ta1hiamessages: +
2017-06-06 01:45:57 martin.panter set nosy: + martin.pantermessages: +
2014-12-10 14:46:57 berker.peksag set keywords: + easystage: resolved -> needs patch
2014-12-10 14:36:44 r.david.murray set status: closed -> opennosy: + docs@pythonmessages: + assignee: docs@pythoncomponents: + Documentation, - Library (Lib)
2014-12-10 14:27:48 r.david.murray set status: open -> closedmessages: +
2014-12-10 06:16:23 bkarge set status: closed -> openmessages: +
2014-12-09 15:24:49 r.david.murray set status: open -> closednosy: + r.david.murraymessages: + resolution: wont fixstage: resolved
2014-12-09 07:45:27 bkarge create