[issue41842] Add codecs.unregister() to unregister a codec search function

2020-09-28 Thread STINNER Victor
Change by STINNER Victor : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue41842] Add codecs.unregister() to unregister a codec search function

2020-09-28 Thread STINNER Victor
STINNER Victor added the comment: The function is added, I close the issue. Thanks Hai Shi. -- ___ Python tracker ___ ___

[issue41842] Add codecs.unregister() to unregister a codec search function

2020-09-28 Thread STINNER Victor
STINNER Victor added the comment: codecs.unregister() is needed to write unit tests: see PR 19069 of bpo-39337. I don't see a strong need to add a new codecs.unregister_error() function, excpet for completeness. I don't think that completeness is enough to justify to add the function, but

[issue41842] Add codecs.unregister() to unregister a codec search function

2020-09-28 Thread STINNER Victor
STINNER Victor added the comment: PR 22360 required 15 iterations (15 commits) and it changes a lot of code. I wouldn't say that it's an "easy (C)" issue. -- ___ Python tracker

[issue41842] Add codecs.unregister() to unregister a codec search function

2020-09-28 Thread STINNER Victor
STINNER Victor added the comment: New changeset d332e7b8164c3c9c885b9e631f33d9517b628b75 by Hai Shi in branch 'master': bpo-41842: Add codecs.unregister() function (GH-22360) https://github.com/python/cpython/commit/d332e7b8164c3c9c885b9e631f33d9517b628b75 --

[issue41842] Add codecs.unregister() to unregister a codec search function

2020-09-28 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Although unregistering an error handler may be not so easy, so it is better to open a separate issue for it. -- keywords: +easy (C) -patch ___ Python tracker

[issue41842] Add codecs.unregister() to unregister a codec search function

2020-09-28 Thread hai shi
hai shi added the comment: oh, sorry, typo error. multiple search functions-->multiple error handler. -- ___ Python tracker ___

[issue41842] Add codecs.unregister() to unregister a codec search function

2020-09-28 Thread hai shi
hai shi added the comment: > If add a function for unregistering a codec search function, it would be > worth to add also a function for unregistering an error handler. Registering an error handler have no refleaks when registering multiple search functions. +1 if end use

[issue41842] Add codecs.unregister() to unregister a codec search function

2020-09-27 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: If add a function for unregistering a codec search function, it would be worth to add also a function for unregistering an error handler. -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.

[issue41842] Add codecs.unregister() to unregister a codec search function

2020-09-23 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: On 23.09.2020 16:49, STINNER Victor wrote: > > STINNER Victor added the comment: > >> Just found an internal API which already takes care of >> unregistering a search function: _PyCodec_Forget(). >> >> All that needs to be done is to expose this as

[issue41842] Add codecs.unregister() to unregister a codec search function

2020-09-23 Thread hai shi
Change by hai shi : -- keywords: +patch nosy: +shihai1991 nosy_count: 3.0 -> 4.0 pull_requests: +21424 stage: -> patch review pull_request: https://github.com/python/cpython/pull/22360 ___ Python tracker

[issue41842] Add codecs.unregister() to unregister a codec search function

2020-09-23 Thread STINNER Victor
STINNER Victor added the comment: > Just found an internal API which already takes care of > unregistering a search function: _PyCodec_Forget(). > > All that needs to be done is to expose this as codecs.unregister() > and add the clearing of the lookup cache. Yeah, I saw this function, but

Re: [issue41842] Add codecs.unregister() to unregister a codec search function

2020-09-23 Thread M.-A. Lemburg
Just found an internal API which already takes care of unregistering a search function: _PyCodec_Forget(). All that needs to be done is to expose this as codecs.unregister() and add the clearing of the lookup cache. -- Marc-Andre Lemburg eGenix.com Professional Python Services directly from

Re: [issue41842] Add codecs.unregister() to unregister a codec search function

2020-09-23 Thread M.-A. Lemburg
On 23.09.2020 14:56, STINNER Victor wrote: > Marc-Andre Lemburg explained: > > "There is no API to unregister a codec search function, since deregistration > would break the codec cache used by the registry to speedup codec > lookup." > > One simple solut

[issue41842] Add codecs.unregister() to unregister a codec search function

2020-09-23 Thread STINNER Victor
STINNER Victor added the comment: Hai Shi wrote PR 22360 to implement codecs.unregister(). -- ___ Python tracker ___ ___

[issue41842] Add codecs.unregister() to unregister a codec search function

2020-09-23 Thread STINNER Victor
STINNER Victor added the comment: > Writing an unit test on the Python codecs machinery is facing a practical > problem: there is no C nor Python API to unregister a codec search function. For example, see PR 19069 of bpo-39337. -- ___

[issue41842] Add codecs.unregister() to unregister a codec search function

2020-09-23 Thread STINNER Victor
New submission from STINNER Victor : Writing an unit test on the Python codecs machinery is facing a practical problem: there is no C nor Python API to unregister a codec search function. It's even documented in a note of the codecs.register() function: "Note: Search function registr

Re: Codec Search Function

2006-01-27 Thread Giovanni Bajo
James Stroud wrote: How do I get the SVN version? Maybe that is not the one I have. svn export svn://pyinstaller.hpcf.upr.edu/trunk pyinstaller This crashes on the version I have (complete program listing): abcde.encode('hex') LookupError: no codec search functions registered: can't

Re: Codec Search Function

2006-01-26 Thread James Stroud
Giovanni Bajo wrote: James Stroud wrote: I'm using pyinstaller 1.0 (stable) on win32xp and it is not able to find the codec for several encodings (hex, base64, etc.). I resorted to writing my own for hex, just to see if I could get my program deployed. But I think a more permanent solution

Re: Codec Search Function

2006-01-26 Thread Fredrik Lundh
James Stroud wrote: How do I get the SVN version? Maybe that is not the one I have. This crashes on the version I have (complete program listing): abcde.encode('hex') LookupError: no codec search functions registered: can't find encoding I am using the latest enthought python and the

Re: Codec Search Function

2006-01-25 Thread James Stroud
James Stroud wrote: Hello All, I'm using pyinstaller 1.0 (stable) on win32xp and it is not able to find the codec for several encodings (hex, base64, etc.). I resorted to writing my own for hex, just to see if I could get my program deployed. But I think a more permanent solution would

Re: Codec Search Function

2006-01-25 Thread Giovanni Bajo
James Stroud wrote: I'm using pyinstaller 1.0 (stable) on win32xp and it is not able to find the codec for several encodings (hex, base64, etc.). I resorted to writing my own for hex, just to see if I could get my program deployed. But I think a more permanent solution would be to get

Codec Search Function

2006-01-24 Thread James Stroud
Hello All, I'm using pyinstaller 1.0 (stable) on win32xp and it is not able to find the codec for several encodings (hex, base64, etc.). I resorted to writing my own for hex, just to see if I could get my program deployed. But I think a more permanent solution would be to get pyinstaller