| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Forgot to raise ModuleNotFoundError when None is found in sys.modules.
This led to introducing the C function PyErr_SetImportErrorSubclass()
to make setting ModuleNotFoundError easier.
Also updated the reference docs to mention ModuleNotFoundError
appropriately. Updated the docs for ModuleNotFoundError to mention the
None in sys.modules case.
Lastly, it was noticed that PyErr_SetImportError() was not setting an
exception when returning None in one case. That issue is now fixed.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ImportError.
The exception is raised by import when a module could not be found.
Technically this is defined as no viable loader could be found for the
specified module. This includes ``from ... import`` statements so that
the module usage is consistent for all situations where import
couldn't find what was requested.
This should allow for the common idiom of::
try:
import something
except ImportError:
pass
to be updated to using ModuleNotFoundError and not accidentally mask
ImportError messages that should propagate (e.g. issues with a
loader).
This work was driven by the fact that the ``from ... import``
statement needed to be able to tell the difference between an
ImportError that simply couldn't find a module (and thus silence the
exception so that ceval can raise it) and an ImportError that
represented an actual problem.
|
| |
|
|
|
|
| |
by their HANDLE which is a pointer (and not a long, which is smaller).
|
|
|
|
|
| |
PyObject_CallMethod() now changed to `const char*`.
Based on patches by Jörg Müller and Lars Buitinck.
|
|
|
|
|
|
| |
(closes #17206)
A patch from Illia Polosukhin.
|
|\
| |
| |
| |
| |
| |
| | |
This affects pyexpat and _elementtree. PyExpat_CAPI now exposes a new
function - DefaultUnknownEncodingHandler.
Based on a patch by Serhiy Storchaka.
|
| |
| |
| |
| |
| |
| |
| | |
This affects pyexpat and _elementtree. PyExpat_CAPI now exposes a new
function - DefaultUnknownEncodingHandler.
Based on a patch by Serhiy Storchaka.
|
|\ \
| |/
| |
| | |
an internal XML encoding is UTF-8 or US-ASCII.
|
| |
| |
| |
| | |
an internal XML encoding is UTF-8 or US-ASCII.
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
the proper environment
|
| | |
|
| |
| |
| |
| | |
(Issue #17807: Generators can now be finalized even when they are part of a reference cycle)
|
| | |
|
| | |
|
| |
| |
| |
| | |
reference cycle.
|
| |
| |
| |
| |
| |
| | |
stderr remains usable.
(should fix Windows buildbot failures on test_gc)
|
| |
| |
| |
| | |
garbage-collected at shutdown.
|
| |
| |
| |
| |
| |
| |
| | |
Note that this is a potentially disruptive change since it may
release some system resources which would otherwise remain
perpetually alive (e.g. database connections kept in thread-local
storage).
|
|\ \
| |/
| |
| | |
the interpreter is shutdown and then started again.
|
| |
| |
| |
| | |
the interpreter is shutdown and then started again.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
* Add also min_char attribute to _PyUnicodeWriter structure (currently unused)
* _PyUnicodeWriter_Init() has no more argument (except the writer itself):
min_length and overallocate must be set explicitly
* In error handlers, only enable overallocation if the replacement string
is longer than 1 character
* CJK decoders don't use overallocation anymore
* Set min_length, instead of preallocating memory using
_PyUnicodeWriter_Prepare(), in many decoders
* _PyUnicode_DecodeUnicodeInternal() checks for integer overflow
|
| |
| |
| |
| |
| |
| | |
the legacy Py_UNICODE API.
Add also a new _PyUnicodeWriter_WriteChar() function.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Write a function to enable more optimizations:
* If the substring is the whole string and overallocation is disabled, just
keep a reference to the string, don't copy characters
* Avoid a call to the expensive _PyUnicode_FindMaxChar() function when
possible
|
| | |
|
| |
| |
| |
| | |
in marshal
|
| |
| |
| |
| | |
Patch from Sven Brauch.
|
| | |
|
| |
| |
| |
| | |
as reported by Serhiy Storchaka and Matthew Barnett.
|
| |
| |
| |
| | |
Patch by Stefan Behnel and I.
|
|\ \
| |/ |
|
| |\ |
|
| | | |
|
| |\ \
| | |/
| | |
| | |
| | |
| | | |
when result of PyLong_AsLong() narrowed to int without checks.
This is a backport of changesets 13e2e44db99d and 525407d89277.
|
| | |
| | |
| | |
| | |
| | |
| | | |
when result of PyLong_AsLong() narrowed to int without checks.
This is a backport of changesets 13e2e44db99d and 525407d89277.
|
| | |
| | |
| | |
| | | |
when result of PyLong_AsLong() narrowed to int without checks.
|
|\ \ \
| |/ / |
|
| | | |
|
| | |
| | |
| | |
| | | |
core modules (#15422)
|
| | | |
|
|\ \ \
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
computation as the overflow behavior of signed integers is undefined.
NOTE: This change is smaller compared to 3.2 as much of this cleanup had
already been done. I added the comment that my change in 3.2 added so that the
code would match up. Otherwise this just adds or synchronizes appropriate UL
designations on some constants to be pedantic.
In practice we require compiling everything with -fwrapv which forces overflow
to be defined as twos compliment but this keeps the code cleaner for checkers
or in the case where someone has compiled it without -fwrapv or their
compiler's equivalent. We could work to get rid of the -fwrapv requirement
in 3.4 but that requires more planning.
Found by Clang trunk's Undefined Behavior Sanitizer (UBSan).
Cleanup only - no functionality or hash values change.
|