summaryrefslogtreecommitdiffstats
path: root/Python/dtoa.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/dtoa.c')
0 files changed, 0 insertions, 0 deletions
n1'>| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | encoded words. (GH-92281) (#119246) * Fix for email.generator.Generator with whitespace between encoded words. email.generator.Generator currently does not handle whitespace between encoded words correctly when the encoded words span multiple lines. The current generator will create an encoded word for each line. If the end of the line happens to correspond with the end real word in the plaintext, the generator will place an unencoded space at the start of the subsequent lines to represent the whitespace between the plaintext words. A compliant decoder will strip all the whitespace from between two encoded words which leads to missing spaces in the round-tripped output. The fix for this is to make sure that whitespace between two encoded words ends up inside of one or the other of the encoded words. This fix places the space inside of the second encoded word. A second problem happens with continuation lines. A continuation line that starts with whitespace and is followed by a non-encoded word is fine because the newline between such continuation lines is defined as condensing to a single space character. When the continuation line starts with whitespace followed by an encoded word, however, the RFCs specify that the word is run together with the encoded word on the previous line. This is because normal words are filded on syntactic breaks by encoded words are not. The solution to this is to add the whitespace to the start of the encoded word on the continuation line. Test cases are from GH-92081 * Rename a variable so it's not confused with the final variable. (cherry picked from commit a6fdb31b6714c9f3c65fefbb3fe388b2b139a75f) Co-authored-by: Toshio Kuratomi <a.badger@gmail.com> * [3.12] gh-118455: Fix mangle_from_ default value in ↵Miss Islington (bot)2024-05-051-1/+1 | | | | | | | | | | | | | | | | | email.policy.Policy.__doc__ (GH-118456) (#118586) gh-118455: Fix mangle_from_ default value in email.policy.Policy.__doc__ (GH-118456) * Fix mangle_from_ default value in email.policy.Policy.__doc__ The docstring says it defaults to True, but it actually defaults to False. Only the Compat32 subclass overrides that. --------- (cherry picked from commit fed8d73fde779fca41026398376cb3038e9b2b5f) Co-authored-by: wim glenn <jump@wimglenn.com> Co-authored-by: Nikita Sobolev <mail@sobolevn.me> * [3.12] bpo-40944: Fix IndexError when parse emails with truncated ↵Miss Islington (bot)2024-04-231-5/+10 | | | | | | | | Message-ID, address, routes, etc (GH-20790) (GH-117974) (cherry picked from commit 1aa8bbe62f27b564cf15e2aad591c62744354a4e) Co-authored-by: Ivan Savin <acccko@gmail.com> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> * [3.12] gh-80361: Fix TypeError in email.Message.get_payload() (GH-117994) ↵Miss Islington (bot)2024-04-171-1/+1 | | | | | | | | | | (GH-117998) It was raised when the charset is rfc2231 encoded, e.g.: Content-Type: text/plain; charset*=ansi-x3.4-1968''utf-8 (cherry picked from commit deaecb88fa5da68cbffca413c63af95fd99578dd) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> * [3.12] gh-117313: Fix re-folding email messages containing non-standard line ↵Miss Islington (bot)2024-04-171-2/+3 | | | | | | | | | | separators (GH-117369) (GH-117971) Only treat '\n', '\r' and '\r\n' as line separators in re-folding the email messages. Preserve control characters '\v', '\f', '\x1c', '\x1d' and '\x1e' and Unicode line separators '\x85', '\u2028' and '\u2029' as is. (cherry picked from commit aec1dac4efe36a7db51f08385ddcce978814dbe3) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> * [3.12] gh-86650: Fix IndexError when parse emails with invalid Message-ID ↵Miss Islington (bot)2024-04-171-0/+5 | | | | | | | | | | | (GH-117934) (GH-117965) In particularly, one-off addresses generated by Microsoft Outlook: https://learn.microsoft.com/en-us/office/client-developer/outlook/mapi/one-off-addresses (cherry picked from commit f74e51229c83e3265f905dc15283bfe0ec1a659e) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: fsc-eriker <72394365+fsc-eriker@users.noreply.github.com> * [3.12] gh-75171: Fix parsing invalid email address headers starting or ↵Miss Islington (bot)2024-04-171-5/+14 | | | | | | | | | ending with a dot (GH-15600) (GH-117964) (cherry picked from commit 8cc9adbfddc8e37cf7d621b12754eecb0584f5da) Co-authored-by: tsufeki <tsufeki@ymail.com> Co-authored-by: Tim Bell <timothybell@gmail.com> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> * [3.12] gh-76511: Fix email.Message.as_string() for non-ASCII message with ↵Miss Islington (bot)2024-03-052-2/+2 | | | | | | | ASCII charset (GH-116125) (GH-116364) (cherry picked from commit f97f25ef5dfcdfec0d9a359fd970abd139cf3428) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> * [3.12] gh-100884: email/_header_value_parser: don't encode list separators ↵Miss Islington (bot)2024-02-171-1/+2 | | | | | | | | | (GH-100885) (GH-115592) ListSeparator should not be encoded. This could happen when a long line pushes its separator to the next line, which would have been encoded. (cherry picked from commit 09fab93c3d857496c0bd162797fab816c311ee48) Co-authored-by: Thomas Weißschuh <thomas@t-8ch.de> * [3.12] gh-77749: Fix inconsistent behavior of non-ASCII handling in ↵Miss Islington (bot)2024-01-261-1/+8 | | | | | | | | | | EmailPolicy.fold() (GH-6986) (GH-114606) It now always encodes non-ASCII characters in headers if utf8 is false. (cherry picked from commit 504334c7be5a56237df2598d338cd494a42fca4c) Co-authored-by: Rito Takeuchi <licht-t@outlook.jp> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> * [3.12] gh-113594: Fix UnicodeEncodeError in TokenList.fold() (GH-113730) ↵Miss Islington (bot)2024-01-101-0/+7 | | | | | | | | (GH-113907) It occurred when try to re-encode an unknown-8bit part combined with non-unknown-8bit part. (cherry picked from commit e9d5b6ea2d68564f176fdf70c2d7028e060c62b5) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> * [3.12] gh-94606: Fix error when message with Unicode surrogate not ↵Miss Islington (bot)2023-12-112-16/+17 | | | | | | | | surrogateescaped string (GH-94641) (GH-112971) (cherry picked from commit 27a5fd8cb8c88537216d7a498eba9d9177951d76) Co-authored-by: Sidney Markowitz <sidney@sidney.com> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> * [3.12] gh-106186: Don't report MultipartInvariantViolationDefect for valid ↵Miss Islington (bot)2023-07-231-1/+1 | | | | | | | multipart emails when parsing header only (GH-107016) (#107111) (cherry picked from commit c65592c4d6d7552fb6284442906a96a6874cb266) Co-authored-by: htsedebenham <31847376+htsedebenham@users.noreply.github.com> * [3.12] gh-106669: Revert "gh-102988: Detect email address parsing errors ... ↵Gregory P. Smith2023-07-211-57/+6 | | | | | | | | | (GH-105127)" (GH-106733) (#106941) This reverts commit 18dfbd035775c15533d13a98e56b1d2bf5c65f00. Adds a regression test from the issue. See https://github.com/python/cpython/issues/106669.. (cherry picked from commit a31dea1feb61793e48fa9aa5014f358352205c1d) * [3.12] gh-102988: Detect email address parsing errors and return empty tuple ↵Miss Islington (bot)2023-07-101-6/+57 | | | | | | | | | | | | | | to indicate the parsing error (old API) (GH-105127) (#106612) gh-102988: Detect email address parsing errors and return empty tuple to indicate the parsing error (old API) (GH-105127) Detect email address parsing errors and return empty tuple to indicate the parsing error (old API). This fixes or at least ameliorates CVE-2023-27043. --------- (cherry picked from commit 18dfbd035775c15533d13a98e56b1d2bf5c65f00) Co-authored-by: Thomas Dwyer <github@tomd.tel> Co-authored-by: Gregory P. Smith <greg@krypto.org> * GH-103857: Deprecate utcnow and utcfromtimestamp (#103858)Paul Ganssle2023-04-271-4/+4 | | | | | Using `datetime.datetime.utcnow()` and `datetime.datetime.utcfromtimestamp()` will now raise a `DeprecationWarning`. We also have removed our internal uses of these functions and documented the change. * gh-102498 Clean up unused variables and imports in the email module (#102482)JosephSBoyle2023-04-245-10/+6 | | | | | | | | | | | | | | | | | | | | | * Clean up unused variables and imports in the email module * Remove extra newline char * Remove superflous dict+unpacking syntax * Remove unused 'msg' var * Clean up unused variables and imports in the email module * Remove extra newline char * Remove superflous dict+unpacking syntax * Remove unused 'msg' var --------- Co-authored-by: Barry Warsaw <barry@python.org> * gh-72346: Added isdst deprecation warning to email.utils.localtime (GH-91450)Alan Williams2023-03-201-29/+11 | * gh-102507 Remove invisible pagebreak characters (#102531)JosephSBoyle2023-03-0814-35/+2 | | | Co-authored-by: AlexWaygood <alex.waygood@gmail.com> * gh-101021: Document binary parameters as bytes (#101024)Bob Kline2023-01-143-3/+3 | * gh-100792: Make `email.message.Message.__contains__` twice as fast (#100793)Nikita Sobolev2023-01-071-1/+5 | * bpo-45975: Simplify some while-loops with walrus operator (GH-29347)Nick Drozd2022-11-261-4/+1 | * Fix typo on inline comment for email.generator (GH-98210)Gary Donovan2022-11-251-1/+1 | | | Trivial change to comment - no issue or new entry necessary * gh-95087: Fix IndexError in parsing invalid date in the email module (GH-95201)Serhiy Storchaka2022-07-251-0/+4 | | | | Co-authored-by: wouter bolsterlee <wouter@bolsterl.ee> * gh-93010: InvalidHeaderError used but nonexistent (#93015)oda-gitso2022-05-231-1/+1 | | | | | * fix issue 93010 Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> * gh-77630: Change Charset to charset (GH-92439)slateny2022-05-081-5/+5 | * bpo-43323: Fix UnicodeEncodeError in the email module (GH-32137)Serhiy Storchaka2022-04-302-6/+6 | | | | | It was raised if the charset itself contains characters not encodable in UTF-8 (in particular \udcxx characters representing non-decodable bytes in the source). * gh-91217: deprecate uu (GH-92009)Brett Cannon2022-04-281-9/+36 | | | Automerge-Triggered-By: GH:brettcannon * Rewrite audio.py to jive with image.py (#91886)Barry Warsaw2022-04-241-53/+55 | | | | | | | Similar to the rewrite of email/mime/image.py and associated test after the deprecation of imghdr.py, thisrewrites email/mime/audio.py and associated tests after the deprecation of sndhdr.py. Closes #91885 * gh-91217: deprecate-sndhdr (#91806)Brett Cannon2022-04-221-13/+37 | | | | | Also inline necessary functionality from `sndhdr` into `email.mime.audio` for `MIMEAudio`. Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com> * gh-91520: Rewrite imghdr inlining for clarity and completeness (#91521)Barry Warsaw2022-04-151-67/+73 | | | | | | | | | | | | | | | | | | | | * Rewrite imghdr inlining for clarity and completeness * Move MIMEImage class back closer to the top of the file since it's the important thing. * Use a decorate to mark a given rule function and simplify the rule function names for clarity. * Copy over all the imghdr test data files into the email package's test data directory. This way when imghdr is actually removed, it won't affect the MIMEImage guessing tests. * Rewrite and extend the MIMEImage tests to test for all supported auto-detected MIME image subtypes. * Remove the now redundant PyBanner048.gif data file. * See https://github.com/python/cpython/pull/91461#discussion_r850313336 Co-authored-by: Oleg Iarygin <dralife@yandex.ru> Co-authored-by: Oleg Iarygin <dralife@yandex.ru> * gh-91217: deprecate imghdr (#91461)Brett Cannon2022-04-131-11/+110 | | | | | | | | | | | | | | * Deprecate imghdr Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com> * Update Doc/whatsnew/3.11.rst Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com> * Inline `imghdr` into `email.mime.image` Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com> Co-authored-by: Barry Warsaw <barry@python.org> * bpo-26579: Add object.__getstate__(). (GH-2821)Serhiy Storchaka2022-04-06