[issue8898] The email package should defer to the codecs module for all aliases

2019-07-29 Thread STINNER Victor
STINNER Victor added the comment: This issue is not newcomer friendly, I remove the easy keyword. -- keywords: -easy nosy: +vstinner ___ Python tracker ___ ___

[issue8898] The email package should defer to the codecs module for all aliases

2012-05-23 Thread R. David Murray
Changes by R. David Murray : -- assignee: r.david.murray -> components: +email -Library (Lib) nosy: +barry ___ Python tracker ___ ___

[issue8898] The email package should defer to the codecs module for all aliases

2011-05-27 Thread R. David Murray
R. David Murray added the comment: Not in email5. The RFC says that if the charset parameter isn't known you just pass it through. In email6 we will be making a more careful distinction between errors that should be passed silently per the RFC, and ones that should be noisy because the API

[issue8898] The email package should defer to the codecs module for all aliases

2011-05-27 Thread Éric Araujo
Éric Araujo added the comment: > email (silently) failed to encode a string Is this silent error another bug to fix? -- ___ Python tracker ___ __

[issue8898] The email package should defer to the codecs module for all aliases

2011-05-27 Thread Michele Orrù
Changes by Michele Orrù : Added file: http://bugs.python.org/file22153/issue8898_3.patch ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue8898] The email package should defer to the codecs module for all aliases

2011-05-27 Thread R. David Murray
R. David Murray added the comment: The second line in that try: block should have been: mime_name = ALIASES.get(python_name, python_name) -- ___ Python tracker ___ ___

[issue8898] The email package should defer to the codecs module for all aliases

2011-05-27 Thread R. David Murray
R. David Murray added the comment: Prompted on IRC, I see I missed the file because it was so short. This still isn't what I'm looking for. We are assuming that email is going to use the codec eventually so that it is not a bad thing to have charset pre-populate the codec cache. So what I'm

[issue8898] The email package should defer to the codecs module for all aliases

2011-05-27 Thread R. David Murray
R. David Murray added the comment: Your new file isn't in the patch. I'm imagining it is a table and a couple methods, so I think perhaps putting it either in charset or in utils would be better than creating a new file. As for testing it, what I'd love to see is a test that downloads the cu

[issue8898] The email package should defer to the codecs module for all aliases

2011-05-27 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Michele Orrù wrote: > > Michele Orrù added the comment: > > Any idea about how to unittest mime.aliases? Test the APIs you probably created for accessing it. > Also, since I've just created a new file, are there some buracratic issues? I > mean, do I h

[issue8898] The email package should defer to the codecs module for all aliases

2011-05-27 Thread Michele Orrù
Michele Orrù added the comment: Any idea about how to unittest mime.aliases? Also, since I've just created a new file, are there some buracratic issues? I mean, do I have to add something at the top of the file? (I'm just signing the Contributor Agreement) -- Added file: http://bugs.p

[issue8898] The email package should defer to the codecs module for all aliases

2011-05-26 Thread R. David Murray
R. David Murray added the comment: I agree that since we get very few requests to add aliases our current tables are probably what we want. So adding the MIME_preferred_name mapping *somewhere* is indeed what I would like to see happen. It doesn't matter to me whether it is in the codecs mo

[issue8898] The email package should defer to the codecs module for all aliases

2011-05-26 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: R. David Murray wrote: > > R. David Murray added the comment: > > Well, my thought was to avoid having multiple charset alias lists in the > stdlib, and reusing the one in codecs, which is larger than the one in email, > seemed to make sense. This came

[issue8898] The email package should defer to the codecs module for all aliases

2011-05-26 Thread Michele Orrù
Michele Orrù added the comment: In that case, I could still take care of it; it would be really easy to do. So, it's up to you to tell me what is the best design choice. (: -- ___ Python tracker __

[issue8898] The email package should defer to the codecs module for all aliases

2011-05-26 Thread R. David Murray
R. David Murray added the comment: Well, my thought was to avoid having multiple charset alias lists in the stdlib, and reusing the one in codecs, which is larger than the one in email, seemed to make sense. This came up because a bug was reported where email (silently) failed to encode a st

[issue8898] The email package should defer to the codecs module for all aliases

2011-05-26 Thread Michele Orrù
Michele Orrù added the comment: +1 What do you think? Ezio, David? -- title: The email package should defer to the codecs module for all aliases -> The email package should defer to the codecs module for all aliases ___ Python tracker

[issue8898] The email package should defer to the codecs module for all aliases

2011-05-26 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: R. David Murray wrote: > > R. David Murray added the comment: > > What is not-a-charset? > > I apparently misunderstood what normalize_encodings does. It isn't doing a > lookup in the codecs registry and returning the canonical name for the codec. > D

[issue8898] The email package should defer to the codecs module for all aliases

2011-05-26 Thread R. David Murray
R. David Murray added the comment: What is not-a-charset? I apparently misunderstood what normalize_encodings does. It isn't doing a lookup in the codecs registry and returning the canonical name for the codec. Does that mean we actually have to fetch the codec in order to get the canonica

[issue8898] The email package should defer to the codecs module for all aliases

2011-05-24 Thread Michele Orrù
Michele Orrù added the comment: After discussing on IRC, it figured out that the best choice would be to use normalize_encoding plus ALIAS, as the attached patch does. -- Added file: http://bugs.python.org/file22094/issue8898_normalize.patch ___ Pyt

[issue8898] The email package should defer to the codecs module for all aliases

2011-05-23 Thread R. David Murray
R. David Murray added the comment: Well, it turns out that back when I opened this issue I misunderstood what the ALIASES table was used for. it *is* used before doing a codecs lookup, but it is also used to convert whatever charset name the programmer specifies into the standard MIME name f

[issue8898] The email package should defer to the codecs module for all aliases

2011-05-23 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: R. David Murray wrote: > > R. David Murray added the comment: > > euc_jp and euc_kr seem to be backward (that is, codecs translates them to the > _ version, instead of translating the _ version to the - version). I worry > that there might be other dev

[issue8898] The email package should defer to the codecs module for all aliases

2011-05-22 Thread R. David Murray
R. David Murray added the comment: On second thought the resolution order ought to be swapped anyway: if the user has added an ALIAS, they are going to want that used, not the one from codecs. -- ___ Python tracker

[issue8898] The email package should defer to the codecs module for all aliases

2011-05-22 Thread R. David Murray
R. David Murray added the comment: Hmm. Must have misread. Looks like all the common charsets do have MIME entries in the IANA table. -- ___ Python tracker ___ ___

[issue8898] The email package should defer to the codecs module for all aliases

2011-05-22 Thread R. David Murray
R. David Murray added the comment: euc_jp and euc_kr seem to be backward (that is, codecs translates them to the _ version, instead of translating the _ version to the - version). I worry that there might be other deviations from the standard email names. I would suggest we pull the list of

[issue8898] The email package should defer to the codecs module for all aliases

2011-05-22 Thread Michele Orrù
Changes by Michele Orrù : Removed file: http://bugs.python.org/file22064/unnamed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsub

[issue8898] The email package should defer to the codecs module for all aliases

2011-05-22 Thread Michele Orrù
Michele Orrù added the comment: In the sense that the alias for 'tactis' should be removed also in 2.7 and 3.2? -- title: The email package should defer to the codecs module for all aliases -> The email package should defer to the codecs module for all aliases ___

[issue8898] The email package should defer to the codecs module for all aliases

2011-05-22 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Ezio Melotti wrote: > > Ezio Melotti added the comment: > > I suggest to: > 1) remove the alias for tactis; > 2) add the aliases for latin_* and the tests for the aliases; > 3) fix the email.charset to use the new aliases instead of its own dict. >

[issue8898] The email package should defer to the codecs module for all aliases

2011-05-22 Thread Ezio Melotti
Ezio Melotti added the comment: I suggest to: 1) remove the alias for tactis; 2) add the aliases for latin_* and the tests for the aliases; 3) fix the email.charset to use the new aliases instead of its own dict. 2) and 3) should go on 3.3 only, 1) could be considered a bug and fixed on

[issue8898] The email package should defer to the codecs module for all aliases

2011-05-22 Thread Michele Orrù
Changes by Michele Orrù : Added file: http://bugs.python.org/file22066/issue8898_skip.patch ___ Python tracker ___ ___ Python-bugs-list mailing

[issue8898] The email package should defer to the codecs module for all aliases

2011-05-22 Thread Michele Orrù
Changes by Michele Orrù : Removed file: http://bugs.python.org/file22065/issue8898_skip.patch ___ Python tracker ___ ___ Python-bugs-list maili

[issue8898] The email package should defer to the codecs module for all aliases

2011-05-22 Thread Ezio Melotti
Ezio Melotti added the comment: Something like: if name == 'mbcs' and not sys.platform.startswith('win'): continue should be enough. -- ___ Python tracker ___ ___

[issue8898] The email package should defer to the codecs module for all aliases

2011-05-22 Thread Michele Orrù
Michele Orrù added the comment: unittest.skip* are decorators, so useless in this case; also, AFAIS Lib/test/ uses sys.platform. I would suggest to put a try statement in encodings.mbcs, and raise an error in case the imported modules imported are not found. But this is another story. ---

[issue8898] The email package should defer to the codecs module for all aliases

2011-05-22 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Michele Orrù wrote: > > Michele Orrù added the comment: > > Sorry, I was told that email the bugtracker could not work properly. > > >>> - mcbs has something broken in its imports; > >> mbcs is only available on Windows. > > So, what do you prefer? Add

[issue8898] The email package should defer to the codecs module for all aliases

2011-05-22 Thread Michele Orrù
Changes by Michele Orrù : Removed file: http://bugs.python.org/file22057/unnamed ___ Python tracker ___ ___ Python-bugs-list mailing list Unsub

[issue8898] The email package should defer to the codecs module for all aliases

2011-05-22 Thread Michele Orrù
Michele Orrù added the comment: Sorry, I was told that email the bugtracker could not work properly. > > - mcbs has something broken in its imports; > mbcs is only available on Windows. So, what do you prefer? Add a check for sys.platform, or just skip it? > > - tactis module is not present.

[issue8898] The email package should defer to the codecs module for all aliases

2011-05-22 Thread Michele Orrù
Michele Orrù added the comment: So, what do you prefer? Add a check for sys.platform, or just skip it? discussion on python-dev. So I'm +1 for just skipping it for now (with a XXX comment on the right maybe). -- title: The email package should defer to the codecs module for all alias

[issue8898] The email package should defer to the codecs module for all aliases

2011-05-22 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Michele Orrù wrote: > > Michele Orrù added the comment: > > Well, actually encodings.aliases links to the encoding _module name_, as > described in the doc: > """ Encoding Aliases Support > This module is used by the encodings package search function

[issue8898] The email package should defer to the codecs module for all aliases

2011-05-21 Thread Michele Orrù
Changes by Michele Orrù : Added file: http://bugs.python.org/file22060/fail_mcbs.txt ___ Python tracker ___ ___ Python-bugs-list mailing list U

[issue8898] The email package should defer to the codecs module for all aliases

2011-05-21 Thread Michele Orrù
Changes by Michele Orrù : Added file: http://bugs.python.org/file22059/issue8898_withtests.patch ___ Python tracker ___ ___ Python-bugs-list ma

[issue8898] The email package should defer to the codecs module for all aliases

2011-05-21 Thread Michele Orrù
Changes by Michele Orrù : Added file: http://bugs.python.org/file22058/fail_tactis.txt ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue8898] The email package should defer to the codecs module for all aliases

2011-05-21 Thread Michele Orrù
Michele Orrù added the comment: Well, actually encodings.aliases links to the encoding _module name_, as described in the doc: """ Encoding Aliases Support This module is used by the encodings package search function to map encodings names to module names. """ So I've adjusted your snip

[issue8898] The email package should defer to the codecs module for all aliases

2011-05-21 Thread Ezio Melotti
Ezio Melotti added the comment: The patch looks ok to me. AFAIU the lookup will take care to normalize the name and return latin_N. This also implies that other names (like 'latin-N', 'LaTiN~~N' and so on) will be normalized to latin_N and then accepted. Regarding the tests, I don't see test

[issue8898] The email package should defer to the codecs module for all aliases

2011-05-21 Thread Michele Orrù
Changes by Michele Orrù : Added file: http://bugs.python.org/file22053/issue8898.patch ___ Python tracker ___ ___ Python-bugs-list mailing list

[issue8898] The email package should defer to the codecs module for all aliases

2011-05-21 Thread Michele Orrù
Changes by Michele Orrù : Removed file: http://bugs.python.org/file22049/issue8898.patch ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue8898] The email package should defer to the codecs module for all aliases

2011-05-21 Thread Michele Orrù
Changes by Michele Orrù : -- nosy: +eric.araujo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.pyth

[issue8898] The email package should defer to the codecs module for all aliases

2011-05-21 Thread Michele Orrù
Michele Orrù added the comment: The attached patch adds aliases for latin_N in encodings.aliases, and fixes email.charset behaviour according to codecs.lookup, as requested. Tested on (Arch) Linux. Am I supposed to add any unittest? I'm wavering about where they should be placed (in encodings

[issue8898] The email package should defer to the codecs module for all aliases

2010-12-27 Thread R. David Murray
R. David Murray added the comment: Too late for 3.2, will implement for 3.3. -- title: The email package should defer to the codecs module for all aliases -> The email package should defer to the codecs module for all aliases versions: +Python 3.3 -Python 3.2

[issue8898] The email package should defer to the codecs module for all aliases

2010-06-04 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Shashwat Anand wrote: > > Shashwat Anand added the comment: > >> We need to add aliases for those codecs. The current aliases >> list only supports the format "latinN" for N in 1-10. > > latinN means latin1 to latin10 ? Yes. We should add aliases for t

[issue8898] The email package should defer to the codecs module for all aliases

2010-06-04 Thread Shashwat Anand
Shashwat Anand added the comment: >We need to add aliases for those codecs. The current aliases >list only supports the format "latinN" for N in 1-10. latinN means latin1 to latin10 ? But latin_1 is a recognized alias. >>> codecs.lookup('latin_1') -- ___

[issue8898] The email package should defer to the codecs module for all aliases

2010-06-04 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Shashwat Anand wrote: > > Shashwat Anand added the comment: > > from email.charset.ALIASES most of them failed to be recognize by codecs > module. > > for i in email.charset.ALIASES.keys(): > ... try: > ... codecs.lookup(i) > ... e

[issue8898] The email package should defer to the codecs module for all aliases

2010-06-04 Thread Shashwat Anand
Shashwat Anand added the comment: from email.charset.ALIASES most of them failed to be recognize by codecs module. >>> for i in email.charset.ALIASES.keys(): ... try: ... codecs.lookup(i) ... except LookupError: ... print("Not recognized by codecs : alias {} mapped to {

[issue8898] The email package should defer to the codecs module for all aliases

2010-06-04 Thread R. David Murray
New submission from R. David Murray : Currently the email module maintains a set of "charset" aliases that it maps to codec names before looking up the codec in the codecs module. Ideally it should instead be able to just look up any 'charset' name, and if it is a valid alias for a codec, the