| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
The Rot-13 codec is for educational use but does not have unit tests,
dragging down test coverage. This adds a few very simple tests.
|
|
|
|
| |
Update the docs as patch can now return an AsyncMock if the patched
object is an async function.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is the converse of GH-15353 -- in addition to plenty of
scripts in the tree that are marked with the executable bit
(and so can be directly executed), there are a few that have
a leading `#!` which could let them be executed, but it doesn't
do anything because they don't have the executable bit set.
Here's a command which finds such files and marks them. The
first line finds files in the tree with a `#!` line *anywhere*;
the next-to-last step checks that the *first* line is actually of
that form. In between we filter out files that already have the
bit set, and some files that are meant as fragments to be
consumed by one or another kind of preprocessor.
$ git grep -l '^#!' \
| grep -vxFf <( \
git ls-files --stage \
| perl -lane 'print $F[3] if (!/^100644/)' \
) \
| grep -ve '\.in$' -e '^Doc/includes/' \
| while read f; do
head -c2 "$f" | grep -qxF '#!' \
&& chmod a+x "$f"; \
done
|
|
|
| |
Constants added by the site module like exit() "should not be used in programs"
|
|
|
|
|
|
|
|
| |
* bpo-34596: Fallback to a default reason when @unittest.skip is uncalled
* Change default reason to empty string
* Fix rst formatting of NEWS entry
|
|
|
|
|
|
|
|
|
|
|
|
| |
* bpo-26185: Fix repr() on empty ZipInfo object
It was failing on AttributeError due to inexistant
but required attributes file_size and compress_size.
They are now initialized to 0 in ZipInfo.__init__().
* Remove useless hasattr() in ZipInfo._open_to_write()
* Completely remove file_size setting in _open_to_write().
|
|
|
|
| |
messages (GH-14310)
|
|
|
|
| |
Authored-By: blueyed <github@thequod.de>
|
|
|
|
|
|
| |
* bpo-32587: Make winreg.REG_MULTI_SZ support PendingFileRenameOperations
* Address review comments.
|
| |
|
|
|
|
| |
(GH-14154)
|
|
|
|
| |
RuntimeError is now raised in this case.
|
| |
|
|
|
|
| |
This is a complement to PR 13375.
|
| |
|
|
|
| |
Restart lines now always start with '=' and never end with ' ' and fill the width of the window unless that would require ending with ' ', which could be wrapped by itself and possible confusing the user.
|
|
|
|
| |
If Python is installed, skip test_tools.test_pathfix test because
Tools/scripts/pathfix.py script is not installed.
|
|
|
| |
Add flag -k to pathscript.py script: preserve shebang flags.
|
|
|
|
| |
* Remove implementation for old plistlib API deprecated in 3.4
|
| |
|
|
|
|
|
| |
It should avoid dynamic lookup including `isinstance`.
This is a regression caused by GH-5351.
|
|
|
|
| |
Modify the wheel event handler so it can also be used for module, path, and stack browsers.
Patch by George Zhang.
|
|
|
|
|
| |
(GH-15522)
https://bugs.python.org/issue22347
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The purpose of the `unicodedata.is_normalized` function is to answer
the question `str == unicodedata.normalized(form, str)` more
efficiently than writing just that, by using the "quick check"
optimization described in the Unicode standard in UAX #15.
However, it turns out the code doesn't implement the full algorithm
from the standard, and as a result we often miss the optimization and
end up having to compute the whole normalized string after all.
Implement the standard's algorithm. This greatly speeds up
`unicodedata.is_normalized` in many cases where our partial variant
of quick-check had been returning MAYBE and the standard algorithm
returns NO.
At a quick test on my desktop, the existing code takes about 4.4 ms/MB
(so 4.4 ns per byte) when the partial quick-check returns MAYBE and it
has to do the slow normalize-and-compare:
$ build.base/python -m timeit -s 'import unicodedata; s = "\uf900"*500000' \
-- 'unicodedata.is_normalized("NFD", s)'
50 loops, best of 5: 4.39 msec per loop
With this patch, it gets the answer instantly (58 ns) on the same 1 MB
string:
$ build.dev/python -m timeit -s 'import unicodedata; s = "\uf900"*500000' \
-- 'unicodedata.is_normalized("NFD", s)'
5000000 loops, best of 5: 58.2 nsec per loop
This restores a small optimization that the original version of this
code had for the `unicodedata.normalize` use case.
With this, that case is actually faster than in master!
$ build.base/python -m timeit -s 'import unicodedata; s = "\u0338"*500000' \
-- 'unicodedata.normalize("NFD", s)'
500 loops, best of 5: 561 usec per loop
$ build.dev/python -m timeit -s 'import unicodedata; s = "\u0338"*500000' \
-- 'unicodedata.normalize("NFD", s)'
500 loops, best of 5: 512 usec per loop
|
|
|
|
|
| |
The HTML5 output from Sphinx 2.x adds '<p>' tags within list elements. Using a new prevtag attribute, ignore these instead of emitting unwanted '\n\n'.
Also stop looking for 'first' classes on tags (no longer present) and fix the bug of double-spacing instead of single spacing after <pre> blocks.
|
|
|
|
| |
Extending the hover delay in test_tooltip should avoid spurious test_idle failures.
One longer delay instead of two shorter delays results in a net speedup.
|
|
|
|
|
| |
-`"""` over `'''`
-no blank line either before or after the docstring.
-place the closing quotes on a line by themselves
|
|
|
| |
Sync importlib.metadata with importlib_metadata 0.20.
|
|
|
|
|
|
| |
* Use the 'p' format unit instead of manually called PyObject_IsTrue().
* Pass boolean value instead 0/1 integers to functions that needs boolean.
* Convert some arguments to boolean only once.
|
| |
|
| |
|
|
|
|
|
| |
Remove methods Element.getchildren(), Element.getiterator() and
ElementTree.getiterator() and the xml.etree.cElementTree module.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fixes a case in which email._header_value_parser.get_unstructured hangs the system for some invalid headers. This covers the cases in which the header contains either:
- a case without trailing whitespace
- an invalid encoded word
https://bugs.python.org/issue37764
This fix should also be backported to 3.7 and 3.8
https://bugs.python.org/issue37764
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix a ctypes regression of Python 3.8. When a ctypes.Structure is
passed by copy to a function, ctypes internals created a temporary
object which had the side effect of calling the structure finalizer
(__del__) twice. The Python semantics requires a finalizer to be
called exactly once. Fix ctypes internals to no longer call the
finalizer twice.
Create a new internal StructParam_Type which is only used by
_ctypes_callproc() to call PyMem_Free(ptr) on Py_DECREF(argument).
StructUnionType_paramfunc() creates such object.
|
| |
|
| |
|
|
|
|
| |
when built on non-Windows system without fd system call support,
like older versions of macOS.
|
|
|
|
| |
Fix faulthandler.cancel_dump_traceback_later() call
if cancel_dump_traceback_later() was not called previously.
|
|
|
|
| |
Argument Clinic. (GH-13593)
|
|
|
|
| |
Added tests for PyDateTime_xxx_GET_xxx() macros of the C API of
the datetime module.
|
| |
|
| |
|
|
|
|
| |
seconds>=24. (GH-14307)
|
|
|
|
| |
(GH-15510)
|
|
|
|
| |
streams. (GH-15543)
|
| |
|