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: pyexpat.errors wrongly bound to message strings instead of message codes
Type: behavior Stage: resolved
Components: Documentation Versions: Python 2.7
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: docs@python Nosy List: bkarge, docs@python, martin.panter, r.david.murray, serhiy.storchaka, ta1hia
Priority: normal Keywords: easy

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:10adminsetgithub: 67208
2020-05-31 13:50:01serhiy.storchakasetstatus: open -> closed

nosy: + serhiy.storchaka
messages: + msg370457

resolution: wont fix -> out of date
stage: needs patch -> resolved
2019-09-12 13:07:29ta1hiasetnosy: + ta1hia
messages: + msg352153
2017-06-06 01:45:57martin.pantersetnosy: + martin.panter
messages: + msg295227
2014-12-10 14:46:57berker.peksagsetkeywords: + easy
stage: resolved -> needs patch
2014-12-10 14:36:44r.david.murraysetstatus: closed -> open

nosy: + docs@python
messages: + msg232427

assignee: docs@python
components: + Documentation, - Library (Lib)
2014-12-10 14:27:48r.david.murraysetstatus: open -> closed

messages: + msg232426
2014-12-10 06:16:23bkargesetstatus: closed -> open

messages: + msg232414
2014-12-09 15:24:49r.david.murraysetstatus: open -> closed

nosy: + r.david.murray
messages: + msg232383

resolution: wont fix
stage: resolved
2014-12-09 07:45:27bkargecreate