| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
It is an alternate constructor which only accepts a single numeric argument.
Unlike to Decimal.from_float() it accepts also Decimal.
Unlike to the standard constructor, it does not accept strings and tuples.
|
|
|
|
|
|
|
|
| |
It is an alternative constructor which only accepts a single numeric argument.
Unlike to Fraction.from_float() and Fraction.from_decimal() it accepts any
real numbers supported by the standard constructor (int, float, Decimal,
Rational numbers, objects with as_integer_ratio()).
Unlike to the standard constructor, it does not accept strings.
|
|
|
|
|
| |
(GH-117766)
Signed-off-by: Jan Chren ~rindeal <dev.rindeal@gmail.com>
|
|
|
|
|
|
|
|
|
|
| |
`PurePath.__init__()` incorrectly uses the `_raw_paths` of a given
`PurePath` object with a different flavour, even though the procedure to
join path segments can differ between flavours.
This change makes the `_raw_paths`-enabled deferred joining apply _only_
when the path flavours match.
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
|
|
|
| |
Make `WeakKeyDictionary` and `WeakValueDictionary` thread safe by copying the underlying the dict before iterating over it.
|
| |
|
|
|
| |
In aeca373b3 (PR gh-12011, issue gh-71500), test_identify() was changed to expect different results on Darwin. Ned's fix was later adjusted by e52f9bee8. This workaround is only needed for some variants of Tk/Tcl on macOS, so we now allow both the workaround and the generic results for these tests.
|
|
|
|
|
|
|
| |
(GH-125385)
Update comments about what running hash -r does
The old comment said "hash -r" forgets "past commands." However, the documentation for "hash" states that it forgets past locations. The old comment was, in my opinion, confusing. This is because it could be interpreted to mean it does something to the command history (HISTORY/HISTFILE etc) vs the cache of locations.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In some locales (like French or Hebrew) the full or abbreviated names of
the default month and weekday used in __calc_date_time can be part of
other name or constant part of the %c format. The month name can also
match %m with constant suffix (like in Japanese). So the code failed to
correctly distinguish formats %a, %A, %b, %B and %m.
Cycle all month and all days of the week to find the variable part
and distinguish %a from %A and %b from %B or %m.
Fixed locales for the following languges:
Arabic, Bislama, Breton, Bodo, Kashubian, Chuvash, Estonian, French, Irish,
Ge'ez, Gurajati, Manx Gaelic, Hebrew, Hindi, Chhattisgarhi, Haitian Kreyol,
Japanese, Kannada, Korean, Marathi, Malay, Norwegian, Nynorsk, Punjabi,
Rajasthani, Tok Pisin, Yoruba, Yue Chinese, Yau/Nungon and Chinese.
Co-authored-by: Eli Bendersky <eliben@gmail.com>
|
|
|
|
|
|
|
|
|
| |
This follows GNU gzip, which defaults to using 0 as the mtime
for compressing stdin, where no file mtime is involved.
This makes the output of gzip.compress() deterministic by default,
greatly helping reproducible builds.
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
|
|
|
|
|
|
| |
Raise ValueError in add_argument() if either explicit nargs=0 or action
that does not consume arguments (like 'store_const' or 'store_true') is
specified for positional argument.
|
|
|
|
|
| |
This was a regression introduced in gh-58573. It was only tested for the
case when the ambiguous option is the last argument in the command line.
|
|
|
|
|
|
|
| |
Also improve the documentation. Specify how dest and metavar are derived
from add_argument() positional arguments.
Co-authored-by: Simon Law <sfllaw@sfllaw.ca>
|
| |
|
|
|
|
|
|
|
| |
This patch is entirely by Thomas and Peter
Co-authored-by: Thomas Grainger <tagrain@gmail.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
|
|
|
|
|
|
| |
positional argument they accept (#125213)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
|
| |
|
|
|
| |
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
|
|
|
|
|
|
|
|
|
| |
(GH-125210)
Previously, all nested mutually exclusive groups lost their connection
to the group containing them and were displayed as belonging directly
to the parser.
Co-authored-by: Danica J. Sutherland <djsutherland@users.noreply.github.com>
|
|
|
|
| |
(GH-125251)
|
|
|
|
|
|
|
|
| |
- Move some Structure tests to test_structunion; use a common base
test class + two subclasses to run them on Union too
- Remove test_union for now as it's redundant
Note: `test_simple_structs` & `test_simple_unions` are in the common
file because they share `formats`.
|
|
|
|
|
|
|
|
|
|
|
| |
memcopy'ing arbitrary values to _Bool variable triggers undefined
behaviour. Avoid this.
We assume that `false` is represented by all zero bytes.
Credits to Alex Gaynor.
Co-authored-by: Sam Gross <colesbury@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
|
|
|
| |
Replace the private _PyUnicodeWriter with the public PyUnicodeWriter.
|
|
|
| |
Skip the locale.ALT_DIGITS test on all Apple platforms, not just macOS.
|
|
|
|
|
|
|
| |
(GH-125212)
Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
|
|
|
|
|
| |
(GH-124823)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
|
|
|
|
|
|
| |
As argparse now detects by default when the code was run as a module.
This leads to using the actual executable name instead of simply "python"
to display in the usage message ("usage: python -m ...").
|
| |
|
|
|
|
|
| |
Generated with Lib/test/certdata/make_ssl_certs.py
using openssl-3.2.2-3.fc40.x86_64 (Fedora 40).
|
|
|
|
|
|
|
|
|
| |
the future by default (GH-107594)
This allows testing Y2038 with system time set to after that,
so that actual Y2038 issues can be exposed, and not masked
by expired certificate errors.
Signed-off-by: Alexander Kanavin <alex.kanavin@gmail.com>
|
|
|
|
|
| |
Now it returns a tuple of up to 100 strings (an empty tuple on most locales).
Previously it returned the first item of that tuple or an empty string.
|
|
|
|
|
| |
implementation issues (#125151)
Skip test_fma_zero_result on NetBSD due to IEE 754-2008 implementation issues
|
|
|
| |
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
|
|
|
|
| |
default (#123859)
|
|
|
| |
This is an alternative to GH-100168.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Make slices marshallable
* Emit slices as constants
* Update Python/marshal.c
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
* Refactor codegen_slice into two functions so it
always has the same net effect
* Fix for free-threaded builds
* Simplify marshal loading of slices
* Only return SUCCESS/ERROR from codegen_slice
---------
Co-authored-by: Mark Shannon <mark@hotpy.org>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
|
|
|
|
|
|
|
| |
If the PYTHON_BASIC_REPL environment variable is set, the site module
no longer imports the _pyrepl module.
Moreover, the site module now respects -E and -I command line
options: ignore PYTHON_BASIC_REPL in this case.
|
|
|
|
|
|
|
| |
Spotted by @ngnpope.
`isatty` returns False to indicate the file is not a TTY. The C
implementation of _io does that (`Py_RETURN_FALSE`) but I got the
bool backwards in the _pyio implementaiton.
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Run them with different locales and different date and time.
Add the @run_with_locales() decorator to run the test with multiple
locales.
Improve the run_with_locale() context manager/decorator -- it now
catches only expected exceptions and reports the test as skipped if no
appropriate locale is available.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- move the Py_Main documentation from the very high level API section
to the initialization and finalization section
- make it clear that it encapsulates a full Py_Initialize/Finalize
cycle of its own
- point out that exactly which settings will be read and applied
correctly when Py_Main is called after a separate runtime
initialization call is version dependent
- be explicit that Py_IsInitialized can be called prior to
initialization
- actually test that Py_IsInitialized can be called prior to
initialization
- flush stdout in the embedding tests that run code so it appears
in the expected order when running with "-vv"
- make "-vv" on the subinterpreter embedding tests less spammy
---------
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
|
|
|
|
|
|
|
| |
The function now sets temporarily the LC_CTYPE locale to the locale
of the category that determines the requested value if the locales are
different and the resulting string is non-ASCII.
This temporary change affects other threads.
|
|
|
| |
Co-authored-by: Victor Stinner <vstinner@python.org>
|
|
|
|
| |
assignment expression topic (#125074)
|
| |
|
|
|
|
|
|
|
| |
Increase currently inadequate vertical spacing for the IDLE browsers (path,
module, and stack) on high-resolution monitors.
---------
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
|
|
|
|
| |
(GH-124897)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-125045)
gh-120762: make_ssl_certs: Don't set extensions for the CSR
`openssl req` fails with openssl 3.2.2 because the config line
authorityKeyIdentifier = keyid:always,issuer:always
is not supported for certificate signing requests (since the issuing
certificate authority is not known).
David von Oheimb, the OpenSSL dev that made the change, commented in:
https://github.com/openssl/openssl/issues/22966#issuecomment-1858396738 :
> This problem did not show up in older OpenSSL versions because of a bug:
> the `req` app ignored the `-extensions` option unless `-x505` is given,
> which I fixed in https://github.com/openssl/openssl/pull/16865.
(I assume `-x505` is a typo for `-x509`.)
In our `make_cert_key` function:
If `sign` is true:
- We don't pass `-x509` to `req`, so in this case it should be safe to
omit the `-extensions` argument. (Old OpenSSL ignores it, new OpenSSL
fails on it.)
- The extensions are passed to the `ca` call later in the function.
There they take effect, and `authorityKeyIdentifier` is valid.
If `sign` is false, this commit has no effect except rearranging the
CLI arguments.
|
|
|
|
|
|
|
| |
* Spill the evaluation around escaping calls in the generated interpreter and JIT.
* The code generator tracks live, cached values so they can be saved to memory when needed.
* Spills the stack pointer around escaping calls, so that the exact stack is visible to the cycle GC.
|
|
|
|
|
| |
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
|