Commit Graph

1901 Commits

Author SHA1 Message Date
Pablo Aguiar d5fbe9b1a3 bpo-34246: Use no mutable default args in smtplib (GH-8554)
Some methods of the SMTP class use mutable default arguments. Specially
`send_message` is affected as it mutates one of the args by appending items
to it, which has side effects on further calls.
2018-09-07 23:04:48 +01:00
Elias Zamaria 393f1ff62e bpo-32968: Make modulo and floor division involving Fraction and float consistent with other operations (#5956)
Make mixed-type `%` and `//` operations involving `Fraction` and `float` objects behave like all other mixed-type arithmetic operations: first the `Fraction` object is converted to a `float`, then the `float` operation is performed as normal. This fixes some surprising corner cases, like `Fraction('1/3') % inf` giving a NaN.

Thanks Elias Zamaria for the patch.
2018-08-27 07:59:28 +01:00
Alex Grönholm cca4eec3c0 bpo-34270: Make it possible to name asyncio tasks (GH-8547)
Co-authored-by: Antti Haapala <antti.haapala@anttipatterns.com>
2018-08-08 17:06:47 -04:00
Peter Lamut 20678fd874 Add docstrings to public methods from context.c (GH-8531) 2018-07-30 16:15:44 +01:00
Mickaël Schoentgen 3f8c6913b8 bpo-34035: Fix several AttributeError in zipfile seek() methods. (GH-8527) 2018-07-29 21:26:52 +03:00
Eitan Adler b91a3a0d61 bpo-33648: Remove PY_WARN_ON_C_LOCALE (GH-7114)
This code does not appear to be used anywhere in the python code base.
The use was removed in eb81795d7d.
2018-07-11 20:01:27 +09:00
Marcin Niemira 9c5ba09748 closes bpo-34050: Fix link in SSL docs (GH-8173) 2018-07-07 15:24:20 -07:00
Wonsup Yoon d134809cd3 bpo-29456: Fix bugs in unicodedata.normalize: u1176, u11a7 and u11c3 (GH-1958)
Hangul composition check boundaries are wrong for the second character
([0x1161, 0x1176) instead of [0x1161, 0x1176]) and third character ((0x11A7, 0x11C3)
instead of [0x11A7, 0x11C3]).
2018-06-15 20:03:14 +08:00
Steve Weber 2487f30d55 bpo-30167: Prevent site.main() exception if PYTHONSTARTUP is set. (GH-6731)
Before Python 3.6, os.path.abspath(None) used to report an AttributeError which was properly caught inside site.abs_paths, making it ignore __main__, one of sys.modules, which has __file__ and __cached__ set to None. With 3.6, os.path.abspath(None) raises TypeError instead which site.abs_path was not expecting.  This resulted in an uncaught exception if a user had PYTHONSTARTUP set and the application called site.main() which a number of third-party programs do.
2018-06-10 20:49:34 -04:00
John Reese 3a5b0d8988 bpo-33504: Migrate configparser from OrderedDict to dict. (#6819)
With 3.7+, dictionary are ordered by design.  Configparser still uses
collections.OrderedDict, which is unnecessary.  This updates the module
to use the standard dict implementation by default, and changes the
docs and tests to match.
2018-06-05 16:31:33 -07:00
Ethan Smith c651275afe bpo-32380: Create functools.singledispatchmethod (#6306) 2018-05-26 13:38:33 -07:00
Aaron Hall, MBA 4054b172ab bpo-26103: Fix inspect.isdatadescriptor() and a data descriptor definition. (GH-1959)
Look for '__set__' or '__delete__'.
2018-05-21 02:46:42 +03:00
CtrlZvi c66c342cb4 bpo-33542: Ignore DUID in uuid.get_node on Windows. (GH-6922)
uuid._ipconfig_getnode did not validate the maximum length of the value,
so long as the value had the same type of formatting as a MAC address.
This let it select DUIDs as MAC addresses. It now requires an exact
length match.
2018-05-20 18:03:25 +03:00
Zvezdan Petkovic c2f082e9d1 bpo-13631: Fix the order of initialization for readline libedit on macOS. (GH-6915)
The editline emulation needs to be initialized *after* the name is
defined. This fixes the long open issue.
2018-05-17 02:45:10 -04:00
Christopher Beacham 5db5c0669e bpo-21475: Support the Sitemap extension in robotparser (GH-6883) 2018-05-16 10:52:07 -04:00
Ned Deily d063b84d9e
bpo-33497: Add NEWS and ACKS entries. (GH-6838) 2018-05-14 18:15:15 -04:00
Ned Deily 69a013ec18
bpo-33281: NEWS and ACK (GH-6681) 2018-05-01 22:41:43 -04:00
sblondon 7d68bfa826 bpo-33256: Replace angle brackets around python object repr to display it in html (GH-6442) 2018-04-29 20:48:33 +03:00
Łukasz Langa 650ba4ffd1
acks += chrBrd (#6584) 2018-04-23 14:18:55 -07:00
Łukasz Langa 2bea947628
acks += Zsolt Dollenstein (#6490) 2018-04-16 16:24:05 -07:00
Serhiy Storchaka c93938b5be
bpo-31920: Fixed handling directories as arguments in the ``pygettext`` script. (GH-6259)
Based on patch by Oleg Krasnikov.
2018-04-09 20:09:17 +03:00
Alex Gaynor c87eb09d2e
bpo-29613: Added support for SameSite cookies (GH-6413)
* bpo-29613: Added support for SameSite cookies

Implemented as per draft
https://tools.ietf.org/html/draft-west-first-party-cookies-07

* Documented SameSite

And suggestions by members.

* Missing space :(

* Updated News and contributors

* Added version changed details.

* Fix in documentation

* fix in documentation

* Clubbed test cases for same attribute into single.

* Updates

* Style nits + expand tests

* review feedback
2018-04-07 16:09:42 -04:00
Marcel Plch 3a9ccee0e5 bpo-29673: fix gdb scripts pystack and pystackv (GH-6126) 2018-04-06 17:22:04 -04:00
hui shang dfbbbf16f9 bpo-32337: Update documentats about dict order (GH-4973) 2018-04-04 13:55:05 +09:00
Ned Deily 8534d53333
bpo-32517: fix test_read_pty_output() hangs on macOS 10.13.2+ (GH-6037) (GH-6113)
test_asyncio hangs indefinitely on macOS 10.13.2+ on `read_pty_output()`
using the KqueueSelector. Closing `proto.transport` (as is done in
`write_pty_output()`) seems to fix it.
(cherry picked from commit 12f74d8608)

Co-authored-by: Nathan Henrie <n8henrie@users.noreply.github.com>

Also, re-enable test_read_pty_output on macOS.
2018-03-27 17:16:49 -04:00
jab 40472dd42d bpo-33018: Improve issubclass() error checking and message. (GH-5944)
This improves error message for situations when a non-class is
checked w.r.t. an abstract base class.
2018-03-22 11:26:06 +00:00
Miro Hrončok 5affd5c29e bpo-32885: Tools/scripts/pathfix.py: Add -n option for no backup~ (#5772)
Creating backup files with ~ suffix can be undesirable in some environment,
such as when building RPM packages. Instead of requiring the user to remove
those files manually, option -n was added, that simply disables this feature.

-n was selected because 2to3 has the same option with this behavior.
2018-03-13 05:56:43 -04:00
Jamie Davis 0e6c8ee235 bpo-32981: Fix catastrophic backtracking vulns (#5955)
* Prevent low-grade poplib REDOS (CVE-2018-1060)

The regex to test a mail server's timestamp is susceptible to
catastrophic backtracking on long evil responses from the server.

Happily, the maximum length of malicious inputs is 2K thanks
to a limit introduced in the fix for CVE-2013-1752.

A 2KB evil response from the mail server would result in small slowdowns
(milliseconds vs. microseconds) accumulated over many apop calls.
This is a potential DOS vector via accumulated slowdowns.

Replace it with a similar non-vulnerable regex.

The new regex is RFC compliant.
The old regex was non-compliant in edge cases.

* Prevent difflib REDOS (CVE-2018-1061)

The default regex for IS_LINE_JUNK is susceptible to
catastrophic backtracking.
This is a potential DOS vector.

Replace it with an equivalent non-vulnerable regex.

Also introduce unit and REDOS tests for difflib.

Co-authored-by: Tim Peters <tim.peters@gmail.com>
Co-authored-by: Christian Heimes <christian@python.org>
2018-03-03 21:33:32 -08:00
Sergey Fedoseev 6b5df906af bpo-32147: Improved perfomance of binascii.unhexlify(). (GH-4586) 2018-02-26 22:35:41 +02:00
Anselm Kruis 33dddac00b bpo-30028: make test.support.temp_cwd() fork-safe (GH-1066)
Make test.support.temp_cwd() fork-safe. The context manager test.support.temp_cwd() no longer removes the temporary directory when executing in a process other than the parent it entered from.
If a forked child exits the context manager it won't do the cleanup.
2018-02-22 17:37:38 -08:00
Eddie Elizondo 745dc65b17 closes bpo-32898: Fix debug build crash with COUNT_ALLOCS (GH-5800) 2018-02-21 20:55:18 -08:00
Zackery Spytz 80d20b918b bpo-31848: Fix broken error handling in Aifc_read.initfp() when the SSND chunk is not found (#5240)
Initialize self._ssnd_chunk so that aifc.Error is raised as intended,
not AttributeError.
2018-02-20 23:06:11 +02:00
Serhiy Storchaka a445feb729
bpo-30688: Support \N{name} escapes in re patterns. (GH-5588)
Co-authored-by: Jonathan Eunice <jonathan.eunice@gmail.com>
2018-02-10 00:08:17 +02:00
Serhiy Storchaka 2411292ba8
bpo-30157: Fix csv.Sniffer.sniff() regex pattern. (GH-5601)
Co-authored-by: Jake Davis <jcdavis@awedge.net>
2018-02-09 20:00:49 +02:00
Alan D Moore a48e78a0b7 bpo-32585: Add tkinter.ttk.Spinbox. (#5221) 2018-02-09 02:03:55 +02:00
Bar Harel 2f79c01493 bpo-32734: Fix asyncio.Lock multiple acquire safety issue (GH-5466) 2018-02-02 17:04:00 -05:00
Bo Bayles ce0f33d045 bpo-32102 Add "capture_output=True" to subprocess.run (GH-5149)
Add "capture_output=True" option to subprocess.run, this is equivalent to
setting stdout=PIPE, stderr=PIPE but is much more readable.
2018-01-29 22:40:39 -08:00
embg 1e34da49ef bpo-28685: Optimize sorted() list.sort() with type-specialized comparisons (#582) 2018-01-28 19:03:23 -08:00
mwidjaja 863b1e4d0e bpo-29237: Create enum for pstats sorting options (GH-5103) 2018-01-25 20:49:56 -08:00
Nathaniel J. Smith fc2f407829 bpo-32591: Add native coroutine origin tracking (#5250)
* Add coro.cr_origin and sys.set_coroutine_origin_tracking_depth
* Use coroutine origin information in the unawaited coroutine warning
* Stop using set_coroutine_wrapper in asyncio debug mode
* In BaseEventLoop.set_debug, enable debugging in the correct thread
2018-01-21 09:44:07 -05:00
Neil Aspinall f7686c1f55 bpo-29970: Add timeout for SSL handshake in asyncio
10 seconds by default.
2017-12-19 21:45:42 +02:00
Segev Finer b2a6083eb0 bpo-19764: Implemented support for subprocess.Popen(close_fds=True) on Windows (#1218)
Even though Python marks any handles it opens as non-inheritable there
is still a race when using `subprocess.Popen` since creating a process
with redirected stdio requires temporarily creating inheritable handles.
By implementing support for `subprocess.Popen(close_fds=True)` we fix
this race.

In order to implement this we use PROC_THREAD_ATTRIBUTE_HANDLE_LIST
which is available since Windows Vista. Which allows to pass an explicit
list of handles to inherit when creating a process.

This commit also adds `STARTUPINFO.lpAttributeList["handle_list"]`
which can be used to control PROC_THREAD_ATTRIBUTE_HANDLE_LIST
directly.
2017-12-18 10:28:19 +01:00
Licht Takeuchi 2001900b0c bpo-32255: Always quote a single empty field when write into a CSV file. (#4769)
This allows to distinguish an empty row from a row consisting of a single empty field.
2017-12-12 11:57:06 +02:00
Mandeep Singh ede2ac913e bpo-23033: Improve SSL Certificate handling (GH-937)
Wildcard is now supported in hostname when it is one and only character in
the leftmost segment.
2017-11-26 14:31:27 -08:00
Berker Peksag 8d9bb11d8f
bpo-28334: netrc() now uses expanduser() to find .netrc file (GH-4537)
Previously, netrc.netrc() was raised an exception if $HOME is not set.

Authored-By: Dimitri Merejkowsky <dimitri.merejkowsky@tanker.io>
2017-11-25 13:37:22 +03:00
Antoine Pitrou f6f90ff079
bpo-30057: Fix potential missed signal in signal.signal(). (#4258)
Bug report and patch by Jeroen Demeyer.
2017-11-03 19:58:46 +01:00
stratakis e8b1965639 bpo-23699: Use a macro to reduce boilerplate code in rich comparison functions (GH-793) 2017-11-02 20:32:54 +10:00
Alexander Belopolsky 66c88ce30c Closes bpo-28281: Remove year (1-9999) limits on the weekday() function. (#4109)
Patch by Mark Gollahon.
2017-10-26 15:34:11 -04:00
jlacoline ea2ef5d0ca bpo-31632: fix set_protocol() in _SSLProtocolTransport (#3817) (#3817) 2017-10-19 13:49:57 -04:00
Zane Bitter de86073a76 bpo-28603: Fix formatting tracebacks for unhashable exceptions (#4014) 2017-10-18 00:29:39 +03:00