| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
A datetime object d is aware if d.tzinfo is not None and
d.tzinfo.utcoffset(d) does not return None. If d.tzinfo is None,
or if d.tzinfo is not None but d.tzinfo.utcoffset(d) returns None,
d is naive.
This commit ensures that instances with non-None d.tzinfo, but
d.tzinfo.utcoffset(d) returning None are treated as naive.
In addition, C acceleration code will raise TypeError if
d.tzinfo.utcoffset(d) returns an object with the type other than
timedelta.
* Updated the documentation.
Assume that the term "naive" is defined elsewhere and remove the
not entirely correct clarification. Thanks, Tim.
(cherry picked from commit 877b23202b7e7d4f57b58504fd0eb886e8c0b377)
Co-authored-by: Alexander Belopolsky <abalkin@users.noreply.github.com>
|
| |
|
|
|
|
|
|
|
| |
Move the floor() call into fbound() to call floor() on a double
rather than an int. The change should enhance the rounding.
Document also (int)double rounding mode.
(cherry picked from commit 45e4efba7fa2abe61d25e4f8b5bf482e19ff1280)
Co-authored-by: Victor Stinner <vstinner@redhat.com>
|
| |
|
|
|
|
| |
Raise TypeError instead of SystemError for unsupported operations.
(cherry picked from commit e9e397605789b2a67b67558fbbe756b7b88934f5)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
|
| |
|
|
|
|
|
| |
(GH-7307)
(cherry picked from commit e905c84494526363086f66a979e317e155bf9536)
Co-authored-by: pkerling <pkerling@casix.org>
|
| |
|
|
|
|
|
| |
(GH-7269)
(cherry picked from commit a5c42284e69fb309bdd17ee8c1c120d1be383012)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
| |
|
|
|
|
|
| |
(GH-7125)
(cherry picked from commit 19de8b3dd742fb53681478ad4fff57ed7c37a953)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
| |
|
|
|
|
|
|
|
| |
* Fixed a leak when the GC fails to add an object with __del__ into
the gc.garbage list.
* PyGC_Collect() can now be called when an exception is set and
preserves it.
* Fixed an undefined behavior with comparing a dead pointer with NULL.
(cherry picked from commit 301e3cc8a5bc68c5347ab6ac6f83428000d31ab2)
|
| |
|
|
|
| |
(cherry picked from commit 1179f4b40f375af5c59cd4b6be9cc313fa0e1a37)
Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
|
| |
|
|
|
| |
* repr() was called for a borrowed link.
* str() was used instead of repr() in formatting one error message.
(cherry picked from commit 6655354afcd116c27486bb5ba1dfa50b369d8d85)
|
| |
|
|
|
| |
`socketmodule.c` on Windows (GH-5120)
(cherry picked from commit af11a15c586e980a157c04ee60b6e33dc7228f3f)
|
| |
|
|
|
| |
(cherry picked from commit 735abadd5bd91db4a9e6f4311969b0afacca0a1a)
Co-authored-by: Segev Finer <segev208@gmail.com>
|
| |
|
|
|
|
|
| |
type (GH-3859)
(cherry picked from commit d518d8bc8d5dac1a1270612f424d33e0e5afc2b5)
Co-authored-by: Oren Milman <orenmn@gmail.com>
|
| |
|
|
|
|
| |
(GH-6630). (GH-6633)
(cherry picked from commit 2e38cc39330bd7f3003652869b644110a97a78d8)
|
| |
|
|
|
|
|
|
|
|
| |
(GH-6582)
Starting with glibc 2.27.9000-xxx, sigaddset() can return EINVAL for some
reserved signal numbers between 1 and NSIG. The `range(1, NSIG)` idiom
is commonly used to select all signals for blocking with `pthread_sigmask`.
So we ignore the sigaddset() return value until we expose sigfillset()
to provide a better idiom.
(cherry picked from commit 25038ecfb665bef641abf8cb61afff7505b0e008)
|
| |
|
|
|
|
| |
Converting with line_info=False and col_info=True crashed before.
(cherry picked from commit e5362eaa75a154c6e91c5b1c47719d0a0f5ca48b)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
| |
|
|
|
| |
(cherry picked from commit f178028f37c9dafb72608b719eb03e5a70af4ff5)
Co-authored-by: Devon R <Gorialis@users.noreply.github.com>
|
| |
|
|
|
|
|
| |
pickle.Pickler.dump(). (GH-6363)
(cherry picked from commit c869529ea9fbed574d34cf7ac139ca3f81b62ef0)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
| |
|
|
|
| |
(cherry picked from commit 030345c0bfc2f76684666fe5c61e766ba5debfe6)
Co-authored-by: Takuya Akiba <469803+iwiwi@users.noreply.github.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
bpo-32844: subprocess: Fix a potential misredirection of a low fd to stderr.
When redirecting, subprocess attempts to achieve the following state:
each fd to be redirected to is less than or equal to the fd
it is redirected from, which is necessary because redirection
occurs in the ascending order of destination descriptors.
It fails to do so in a couple of corner cases,
for example, if 1 is redirected to 2 and 0 is closed in the parent.
(cherry picked from commit 0e7144b064a19493a146af94175a087b3888c37b)
Co-authored-by: Alexey Izbyshev <izbyshev@users.noreply.github.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
LibreSSL 2.7 introduced OpenSSL 1.1.0 API. The ssl module now detects
LibreSSL 2.7 and only provides API shims for OpenSSL < 1.1.0 and
LibreSSL < 2.7.
Documentation updates and fixes for failing tests will be provided in
another patch set.
Signed-off-by: Christian Heimes <christian@python.org>.
(cherry picked from commit 4ca0739c9d97ac7cd45499e0d31be68dc659d0e1)
Co-authored-by: Christian Heimes <christian@python.org>
|
| |
|
|
|
| |
(cherry picked from commit 9308dea3e1fd565d50a76a667e4e8ef0568b7053)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
fstat may block for long time if the file descriptor is on a
non-responsive NFS server, hanging all threads. Most fstat() calls are
handled by _Py_fstat(), releasing the GIL internally, but but
_Py_fstat_noraise() does not release the GIL, and most calls release the
GIL explicitly around it.
This patch fixes last 2 calls to _Py_fstat_no_raise(), avoiding hangs
when calling:
- mmap.mmap()
- os.urandom()
- random.seed()
(cherry picked from commit 4484f9dca9149da135bbae035f10a50d20d1cbbb)
Co-authored-by: Nir Soffer <nirsof@gmail.com>
|
| |
|
|
|
|
|
|
| |
Multi-phase initialized modules allow m_traverse to be called while the
module is still being initialized, so module authors may need to account
for that.
(cherry picked from commit c2b0b12d1a137ada1023ab7c10b8d9a0249d95f9)
Co-authored-by: Marcel Plch <gmarcel.plch@gmail.com>
|
| |
|
|
|
| |
Fix backport a79591cf of bpo-30622 to 3.6 branch.
Signed-off-by: Christian Heimes <christian@python.org>
|
| |
|
|
| |
(GH-6032)
|
| |
|
|
|
|
|
|
| |
(GH-1559) (GH-5954)
(cherry picked from commit 9ba3aa4d02a110d1a1ea464a8aff3be7dd9c63c3)
Co-authored-by: Erik Bray <erik.m.bray@gmail.com>
|
| |
|
|
|
| |
(cherry picked from commit bc3f2289b9007396bfb7f986bee477b6176c1822)
Co-authored-by: Xiang Zhang <angwerzx@126.com>
|
| | |
|
| |
|
|
|
| |
(cherry picked from commit 3e197c7a6740d564ad52fb7901c07d5ff49460f5)
Co-authored-by: Alexey Izbyshev <izbyshev@users.noreply.github.com>
|
| |
|
|
|
|
|
| |
encoding. (GH-5832). (GH-5906)
(cherry picked from commit 6f600ff1734ca2fdcdd37a809adf8130f0d8cc4e)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
| |
|
| |
(cherry picked from commit 63ae04461fb0cc93ca57cd151103a8dd295581d6)
|
| | |
|
| |
|
|
|
|
| |
Signed-off-by: Christian Heimes <christian@python.org>.
(cherry picked from commit 29eab55309b9f78b79074d26db16a44e7841c639)
Co-authored-by: Christian Heimes <christian@python.org>
|
| |
|
|
|
|
|
|
|
| |
The ssl module now detects missing NPN support in LibreSSL.
Co-Authored-By: Bernard Spil <brnrd@FreeBSD.org>
Signed-off-by: Christian Heimes <christian@python.org>.
(cherry picked from commit 6cdb7954b0a578d899e4b78b868ea59eef08480a)
Co-authored-by: Christian Heimes <christian@python.org>
|
| |
|
|
|
|
| |
The SSL module no longer sends IP addresses in SNI TLS extension on
platforms with OpenSSL 1.0.2+ or inet_pton.
Signed-off-by: Christian Heimes <christian@python.org>
|
| |
|
|
|
|
| |
The 'optimization' is for space in the executable file, not for run time.
(cherry picked from commit 186b606d8a2ea4fd51b7286813302c8e8c7006cc)
Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
|
| |
|
|
|
| |
(cherry picked from commit 42c35d9c0c8175332f50fbe034a001fe52f057b9)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
| |
os.dup2() tests for dup3() system call availability at runtime,
but doesn't remember the result across calls, repeating
the test on each call with inheritable=False.
Since the caller of os.dup2() is expected to hold the GIL,
fix this by making the variable holding the test result static.
(cherry picked from commit b3caf388a0418f6c031e4dbdcc0c1ce7e5cc36bd)
Co-authored-by: Alexey Izbyshev <izbyshev@users.noreply.github.com>
|
| |
|
|
|
|
|
|
| |
A closing parentheses was missing.
Signed-off-by: Ngie Cooper <yaneurabeya@gmail.com>
(cherry picked from commit 7745ec4e356ac1f4eaf43b155f4482c20a907d48)
Co-authored-by: ngie-eign <1574099+ngie-eign@users.noreply.github.com>
|
| |
|
| |
(cherry picked from commit d019bc8319ea35e93bf4baa38098ff1b57cd3ee5)
|
| |
|
|
|
|
|
|
| |
The PrintNameOffset field of the reparse data buffer
was treated as a number of characters instead of bytes.
(cherry picked from commit 3c34aad4e7a95913ec7db8e5e948a8fc69047bf7)
Co-authored-by: SSE4 <tomskside@gmail.com>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
(GH-5563)
Fix a rare but potential pre-exec child process deadlock in subprocess on POSIX systems when marking file descriptors inheritable on exec in the child process. This bug appears to have been introduced in 3.4 with the inheritable file descriptors support.
This also changes Python/fileutils.c `set_inheritable` to use the "slow" two `fcntl` syscall path instead of the "fast" single `ioctl` syscall path when asked to be async signal safe (by way of being asked not to raise exceptions). `ioctl` is not a POSIX async-signal-safe approved function.
ref: http://pubs.opengroup.org/onlinepubs/9699919799/functions/V2_chap02.html
(cherry picked from commit c1e46e94de38a92f98736af9a42d89c3975a9919)
Co-authored-by: Alexey Izbyshev <izbyshev@users.noreply.github.com>
|
| |
|
|
|
|
|
|
|
| |
Fix typos found by codespell in docs, docstrings, and comments.
Fixes for the following files were in post-3.6 code and not backported:
Lib/ctypes/_aix.py (new), Lib/test/test_concurrent_futures.py,
Modules/_asynciomodule.c, Modules/_pickle.c, Objects/obmalloc.c.
(cherry picked from commit c3d9508ff22ece9a96892b628dd5813e2fb0cd80)
|
| |
|
|
|
| |
(GH-3000) (GH-3000) (#4101)
(cherry picked from commit d4b93e21c2664d6a78e0656e7a7be0807be1c352)
|
| |
|
|
|
| |
Ensure that ``truncate()`` preserves the file position (as reported by ``tell()``) after writes longer than the buffer size..
(cherry picked from commit 059f58ce938d9c3f0286412a4efb1b9131339421)
|
| |
|
|
|
|
|
|
|
|
| |
* Add _Py_GetLocaleconvNumeric() function: decode decimal_point and
thousands_sep fields of localeconv() from the LC_NUMERIC encoding,
rather than decoding from the LC_CTYPE encoding.
* Modify locale.localeconv() and "n" formatter of str.format() (for
int, float and complex to use _Py_GetLocaleconvNumeric()
internally.
(cherry picked from commit cb064fc2321ce8673fe365e9ef60445a27657f54)
|
| |
|
| |
(cherry picked from commit 83cb778b4a3f856f2243b0f0d36fefb5c44b388f)
|
| |
|
|
| |
sys.flags.hash_randomization is now properly set to 0 when hash
randomization is turned off by PYTHONHASHSEED=0.
|
| |
|
|
|
| |
(GH-4797) (#4869)
(cherry picked from commit 233ef249cc5c18d796fb581747179c5e062b4083)
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#4864)
* [3.6] bpo-32297: Few misspellings found in Python source code comments. (GH-4803)
* Fix multiple typos in code comments
* Add spacing in comments (test_logging.py, test_math.py)
* Fix spaces at the beginning of comments in test_logging.py.
(cherry picked from commit 53f7a7c2814fbfd8a29200926601a32fa48bacb3)
|