[issue28005] Broken encoding modules are silently skipped.

2016-09-09 Thread Steve Dower
Steve Dower added the comment: I reverted the change but wrote the wrong issue number. Also added a comment so the next person to encounter this realises it is the correct behaviour. New changeset 4e80a157ea66 by Steve Dower in branch 'default': Revert #27959: ImportError within an encoding

[issue28005] Broken encoding modules are silently skipped.

2016-09-09 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Yes, that's intended. See e.g. the mbcs codec. If a search function gets an ImportError, it interprets this as "codec is not available/working", and then gives other search functions a chance to find a working one. --

[issue28005] Broken encoding modules are silently skipped.

2016-09-08 Thread Steve Dower
Steve Dower added the comment: Is it deliberate that inner import errors should be treated as if the codec is missing? Another search function isn't going to help in that case unless it finds the same encoding in another place. I didn't see any evidence of that, and apparently neither did

[issue28005] Broken encoding modules are silently skipped.

2016-09-08 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Thinking about this some, we could go ahead and document somewhere that if a codec wants to tell the search function that it cannot work due to some missing dependency, it will have to raise an ImportError from the codec module level (instead of just

[issue28005] Broken encoding modules are silently skipped.

2016-09-08 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Steve, this is not a correct patch. The purpose of skipping ImportErrors is to give other search functions a chance to find and provide a working codec. Your patch causes this to break. -- nosy: +lemburg resolution: fixed -> status: closed ->

[issue28005] Broken encoding modules are silently skipped.

2016-09-07 Thread Roundup Robot
Roundup Robot added the comment: New changeset 2b2e7b39bb68 by Steve Dower in branch 'default': Issue #28005: Allow ImportErrors in encoding implementation to propagate. https://hg.python.org/cpython/rev/2b2e7b39bb68 -- nosy: +python-dev ___ Python

[issue28005] Broken encoding modules are silently skipped.

2016-09-07 Thread Steve Dower
Changes by Steve Dower : -- assignee: -> steve.dower nosy: +steve.dower resolution: -> fixed stage: test needed -> resolved status: open -> closed ___ Python tracker

[issue28005] Broken encoding modules are silently skipped.

2016-09-07 Thread Sye van der Veen
Changes by Sye van der Veen : -- nosy: +syeberman ___ Python tracker ___ ___

[issue28005] Broken encoding modules are silently skipped.

2016-09-07 Thread Eric Snow
New submission from Eric Snow: In Lib/encodings/__init__.py, search_function() looks up an encoding by name. It loads the encoding by importing the corresponding module in the encodings package. If there's an ImportError while importing that module then the encoding gets silently ignored.