Commit Graph

48696 Commits

Author SHA1 Message Date
Christian Heimes cffa4f7854
gh-93616: Fix env changed issue in test_modulefinder (GH-93617) 2022-06-09 08:32:35 +02:00
Christian Heimes 68f6a5da19
gh-79096: Fix/improve http cookiejar tests (GH-93614)
Fixup of GH-93463:
- remove stray print
- use proper way to check file mode
- add working chmod decorator

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2022-06-08 23:51:04 +02:00
Christian Heimes 5442561c1a
gh-93575: Use correct way to calculate PyUnicode struct sizes (GH-93602)
* gh-93575: Use correct way to calculate PyUnicode struct sizes

* Add comment to keep test_sys and test_unicode in sync

* Fix case code < 256
2022-06-08 20:18:08 +02:00
Erlend Egeberg Aasland 875de61c29
gh-93421: Update sqlite3 cursor.rowcount only after SQLITE_DONE (#93526) 2022-06-08 12:43:54 +02:00
Bluenix 5849af7a80
GH-93521: For dataclasses, filter out `__weakref__` slot if present in bases (GH-93535) 2022-06-07 20:53:08 -04:00
Kalyan ffc58a9710
gh-93370: Deprecate sqlite3.version and sqlite3.version_info (#93482)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2022-06-08 01:34:50 +02:00
Irit Katriel f8eae6f5c3
GH-93481: Suppress expected deprecation warning in test_pyclbr (GH-93483) 2022-06-07 21:35:11 +01:00
Adrian Garcia Badaracco 296081a7ce
gh-92592: Allow logging filters to return a LogRecord. (GH-92591) 2022-06-07 16:53:57 +01:00
Christian Heimes cdb73aefec
gh-93162: test_config_queue_handler requires threading (GH-93572) 2022-06-07 12:34:08 +02:00
Mark Shannon f012df706c
Shrink the LOAD_METHOD cache by one codeunit. (#93537) 2022-06-07 10:28:53 +01:00
Hugo van Kemenade f0d0be3493
gh-57539: Increase calendar test coverage (GH-93468)
Co-authored-by: Sean Fleming
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2022-06-07 10:44:29 +02:00
Vinay Sajip 1b74803991
gh-93162: Add ability to configure QueueHandler/QueueListener together (GH-93269)
Also, provide getHandlerByName() and getHandlerNames() APIs.

Closes #93162.
2022-06-07 10:20:35 +02:00
Pascal Wittmann c6f6ede728
gh-79096: Protect cookie file created by {LWP,Mozilla}CookieJar.save() (GH-93463)
Note: This change is not effective on Microsoft Windows.

Cookies can store sensitive information and should therefore be protected
against unauthorized third parties. This is also described in issue #79096.

The filesystem permissions are currently set to 644, everyone can read the
file. This commit changes the permissions to 600, only the creater of the file
can read and modify it. This improves security, because it reduces the attack
surface. Now the attacker needs control of the user that created the cookie or
a ways to circumvent the filesystems permissions.

This change is backwards incompatible. Systems that rely on world-readable
cookies will breake. However, one could argue that those are misconfigured in
the first place.
2022-06-07 10:11:03 +02:00
Evorage 890c3be8fb
Grammar fix to socket error string (GH-93523) 2022-06-07 09:43:16 +02:00
AN Long 3256b178ed
bpo-42658: Use LCMapStringEx in ntpath.normcase to match OS behaviour for case-folding (GH-32010) 2022-06-07 00:47:27 +01:00
Christian Heimes 22fed605e0
gh-90473: Make chmod a dummy on WASI, skip chmod tests (GH-93534)
WASI does not have the ``chmod(2)`` syscall yet.
2022-06-06 19:24:11 +02:00
Christian Heimes 80a39daecd
gh-90473: Skip POSIX tests that don't apply to WASI (GH-93536) 2022-06-06 16:31:59 +02:00
Christian Heimes 4c71d22c4f
gh-90473: WASI requires proper open(2) flags (GH-93529) 2022-06-06 12:08:07 +02:00
Cyker Way 9081bbd036
gh-93247: Fix assert function in asyncio locks test (#93248) 2022-06-05 18:19:18 -07:00
Serhiy Storchaka 0902c3d8ed
gh-89973: Fix re.error in the fnmatch module. (GH-93072)
Character ranges with upper bound less that lower bound (e.g. [c-a])
are now interpreted as empty ranges, for compatibility with other glob
pattern implementations. Previously it was re.error.
2022-06-05 11:46:29 +03:00
Christian Heimes 6f8367d348
gh-90473: wasmtime does not support absolute symlinks (GH-93490) 2022-06-05 09:59:47 +02:00
Neil Schemenauer 713eb184b5
gh-93442: Add test for _Py_CAST(nullptr). (gh-93505) 2022-06-05 12:53:16 +09:00
Neil Schemenauer 8bcc3fa345
gh-93442: Make C++ version of _Py_CAST work with 0/NULL. (#93500)
Add C++ overloads for _Py_CAST_impl() to handle 0/NULL.  This will allow
C++ extensions that pass 0 or NULL to macros using _Py_CAST() to
continue to compile.  Without this, you get an error like:

    invalid ‘static_cast’ from type ‘int’ to type ‘_object*’

The modern way to use a NULL value in C++ is to use nullptr.  However,
we want to not break extensions that do things the old way.

Co-authored-by: serge-sans-paille
2022-06-04 18:49:39 -07:00
Colin Delahunty 3d647e70cf
[doc] Correct a grammatical error in a docstring. (GH-93441) 2022-06-04 17:42:08 +01:00
jackh-ncl 8150b8cf7f
gh-92886: Fix test that fails when running with `-O` in `test_imaplib.py` (#93237) 2022-06-03 20:15:58 -07:00
Ulises Ojeda 3284f86b51
netrc: Remove unused "import shlex" (#93311) 2022-06-03 20:14:58 -07:00
Barney Gale f32e6b48d1
gh-93156 - fix negative indexing into absolute `pathlib.PurePath().parents` (GH-93273)
When a `_PathParents` object has a drive or a root, the length of the
object is *one less* than than the length of `self._parts`, which resulted
in an off-by-one error when `path.parents[-n]` was fed through to
`self._parts[:-n - 1]`. In particular, `path.parents[-1]` was a malformed
path object with spooky properties.

This is addressed by adding `len(self)` to negative indices.
2022-06-03 14:33:20 -07:00
Christian Heimes 1a8a0ddb1c
gh-84461: Skip dtrace/network tests that are enabled by -u all (GH-93473) 2022-06-03 22:14:31 +02:00
Victor Stinner d8f40ead92
test.pythoninfo: Fix typo, Py_REF_DEBUG => Py_TRACE_REFS (#93467) 2022-06-03 15:46:41 +02:00
Petr Viktorin b9509ba7a9
gh-68966: Make mailcap refuse to match unsafe filenames/types/params (GH-91993) 2022-06-03 11:43:35 +02:00
Dong-hee Na b013804134
gh-92932: dis._unpack_opargs should handle EXTENDED_ARG_QUICK (gh-92945) 2022-06-03 11:29:27 +09:00
Christian Heimes 069c96f84c
gh-90473: Skip and document more failing tests on WASI (GH-93436)
- Mark more ``umask()`` cases
- ``dup()`` is not supported
- ``/dev/null`` is not available
- document missing features
- mark more modules as not available
2022-06-03 00:44:48 +02:00
Irit Katriel 94b1586ca5
gh-93356: Lay out exception handling code at end of code unit (GH-92769) 2022-06-02 14:13:43 +01:00
Christian Heimes af5bb1fba4
gh-84461: Skip new async logging tests on Emscripten (GH-93427) 2022-06-02 09:35:06 +02:00
Eric V. Smith ee70c70aa9
gh-93418: Fix an assert when an f-string expression is followed by an '=', but no closing brace. (gh-93419) 2022-06-01 19:20:06 -04:00
Éric 8aa9d40b00
gh-90300: split --help output into separate options (#30331)
Make --help output shorter and add new help options.

--help-env, --help-xoptions and --help-all command-line options are
added to complement --help.
2022-06-01 05:50:01 -04:00
Ezio Melotti 5247389369
Remove the execution bit to some socket-related files. (#93368) 2022-06-01 09:11:46 +02:00
Pablo Galindo Salgado 705eaec28f
gh-92597: Ensure that AST nodes without explicit end positions can be compiled (GH-93359) 2022-06-01 00:00:47 +01:00
Dennis Sweeney f425f3bb27
gh-93143: Avoid NULL check in LOAD_FAST based on analysis in the compiler (GH-93144) 2022-05-31 16:32:30 -04:00
Serhiy Storchaka 07df8d5b2c
gh-93283: Improve error message for f-string with invalid conversion character (GH-93349) 2022-05-31 20:38:29 +03:00
Serhiy Storchaka f545fc955a
gh-93345: Fix a crash in substitution of nested TypeVar after TypeVarTuple (GH-93346)
For example: tuple[*Ts, list[T]][int, str, bool]
2022-05-31 08:46:16 +03:00
Pablo Galindo Salgado 5893b5db98
gh-93351: Ensure the position information in AST nodes created by the parser is always consistent (GH-93352) 2022-05-30 19:30:15 +01:00
luzpaz 4f195f9db1
Fix typo in Lib/idlelib/idle_test/test_parenmatch.py (GH-93332)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2022-05-29 21:41:59 -04:00
Sergei Izmailov 66f5add1f0
bpo-41287: Handle `doc` argument of `property.__init__` in subclasses (#23205)
Fixes #85459

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2022-05-28 20:25:51 -07:00
oda-gitso 7fa9b7daa5
gh-92839: fixed typo in _bisectmodule.c (line 131) (#92849) 2022-05-28 13:08:06 -05:00
Yury Selivanov e6a57678ca
gh-93297: Make asyncio task groups prevent child tasks from being GCed (#93299) 2022-05-27 15:20:21 -07:00
Ethan Furman 70cfe56caf
gh-93250: [Enum] Change IntEnum boundary to KEEP for backwards compatibility (GH-93302)
In previous versions of Python if an IntEnum member was combined with another integer type value using a bit-wise operation, the resulting value would still be the IntEnum type.  This change restores that behavior.
2022-05-27 15:14:28 -07:00
hfinucane 47e68d4515
bpo-46951: Order contents of zipapps (GH-31713)
So that builds are more reproducible.
2022-05-27 19:04:29 +03:00
Dennis Sweeney ddc4a782d3
gh-93223: More aggressive Jump-To-Jump elimination (GH-93229) 2022-05-27 11:17:59 +01:00
Wenzel Jakob 5e34b494a0
gh-60074: add new stable API function PyType_FromMetaclass (GH-93012)
Added a new stable API function ``PyType_FromMetaclass``, which mirrors
the behavior of ``PyType_FromModuleAndSpec`` except that it takes an
additional metaclass argument. This is, e.g., useful for language
binding tools that need to store additional information in the type
object.
2022-05-27 10:27:39 +02:00