summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* bpo-33416: Add end positions to Python AST (GH-11605)Ivan Levkivskyi2019-01-2219-395/+1406
| | | | | | | | | | | | | | | | | | The majority of this PR is tediously passing `end_lineno` and `end_col_offset` everywhere. Here are non-trivial points: * It is not possible to reconstruct end positions in AST "on the fly", some information is lost after an AST node is constructed, so we need two more attributes for every AST node `end_lineno` and `end_col_offset`. * I add end position information to both CST and AST. Although it may be technically possible to avoid adding end positions to CST, the code becomes more cumbersome and less efficient. * Since the end position is not known for non-leaf CST nodes while the next token is added, this requires a bit of extra care (see `_PyNode_FinalizeEndPos`). Unless I made some mistake, the algorithm should be linear. * For statements, I "trim" the end position of suites to not include the terminal newlines and dedent (this seems to be what people would expect), for example in ```python class C: pass pass ``` the end line and end column for the class definition is (2, 8). * For `end_col_offset` I use the common Python convention for indexing, for example for `pass` the `end_col_offset` is 4 (not 3), so that `[0:4]` gives one the source code that corresponds to the node. * I added a helper function `ast.get_source_segment()`, to get source text segment corresponding to a given AST node. It is also useful for testing. An (inevitable) downside of this PR is that AST now takes almost 25% more memory. I think however it is probably justified by the benefits.
* bpo-35758: Fix building on ARM + MSVC (gh-11531)Minmin Gong2019-01-213-2/+5
| | | | | | | | | | * Disable x87 control word for non-x86 targets On msvc, x87 control word is only available on x86 target. Need to disable it for other targets to prevent compiling problems. * Include immintrin.h on x86 and x64 only Immintrin.h is only available on x86 and x64. Need to disable it for other targets to prevent compiling problems.
* bpo-35782: Fix error message in randrange (GH-11620)Kumar Akshay2019-01-211-1/+1
| | | https://bugs.python.org/issue35782
* bpo-35794: Catch PermissionError in test_no_such_executable (GH-11635)Pablo Galindo2019-01-211-1/+3
| | | | PermissionError can be raised if there are directories in the $PATH that are not accessible when using posix_spawnp.
* bpo-35772: Fix test_tarfile on ppc64 (GH-11606)Victor Stinner2019-01-213-2/+15
| | | | | | | | | | | | | | | Fix sparse file tests of test_tarfile on ppc64le with the tmpfs filesystem. Fix the function testing if the filesystem supports sparse files: create a file which contains data and "holes", instead of creating a file which contains no data. tmpfs effective block size is a page size (tmpfs lives in the page cache). RHEL uses 64 KiB pages on aarch64, ppc64 and ppc64le, only s390x and x86_64 use 4 KiB pages, whereas the test punch holes of 4 KiB. test.pythoninfo: Add resource.getpagesize().
* bpo-20239: Allow repeated deletion of unittest.mock.Mock attributes (#11057)Pablo Galindo2019-01-213-4/+32
| | | | | | | | * Allow repeated deletion of unittest.mock.Mock attributes * fixup! Allow repeated deletion of unittest.mock.Mock attributes * fixup! fixup! Allow repeated deletion of unittest.mock.Mock attributes
* Add information about DeprecationWarning for invalid escaped characters in ↵Pablo Galindo2019-01-201-1/+4
| | | | the re module (GH-5255)
* bpo-35699: fix distuils cannot detect Build Tools 2017 anymore (GH-11495)Marc Schlaich2019-01-202-0/+2
|
* bpo-35770: Fix off-by-1 error. (#11618)Terry Jan Reedy2019-01-181-1/+1
|
* bpo-35733: Make isinstance(ast.Constant(boolean), ast.Num) be false. (GH-11547)Anthony Sottile2019-01-183-1/+13
|
* bpo-35770: IDLE macosx deletes Options => Configure IDLE. (GH-11614)Terry Jan Reedy2019-01-183-1/+9
| | | | | It previously deleted Window => Zoom Height by mistake. (Zoom Height is now on the Options menu). On Mac, the settings dialog is accessed via Preferences on the IDLE menu.
* bpo-21257: document http.client.parse_headers (GH-11443)Ashwin Ramaswami2019-01-182-0/+20
| | | Document http.client.parse_headers
* bpo-35045: Accept TLSv1 default in min max test (GH-11510)Christian Heimes2019-01-182-2/+7
| | | | | | Make ssl tests less strict and also accept TLSv1 as system default. The changes unbreaks test_min_max_version on Fedora 29. Signed-off-by: Christian Heimes <christian@python.org>
* bpo-35283: Update the docstring of threading.Thread.join method (GH-11596)Dong-hee Na2019-01-181-1/+1
|
* bpo-35769: Change IDLE's name for new files from 'Untitled' to 'untitled' ↵Terry Jan Reedy2019-01-183-2/+5
| | | | | (GH-11602) 'Untitled' violates the PEP 8 standard for .py files
* bpo-34850: Emit a warning for "is" and "is not" with a literal. (GH-9642)Serhiy Storchaka2019-01-185-11/+95
|
* bpo-35730: IDLE - test squeezer reload() by checking load_font() (GH-11585)Tal Einat2019-01-181-7/+3
|
* bpo-23156: Remove obsolete tix install directions (GH-11595)Terry Jan Reedy2019-01-181-11/+0
| | | Tix was deprecated in 3.6 and the doc is wrong. New users should use ttk.
* bpo-34161: Update idlelib/NEWS.txt to 2019 Jan 17 (GH-11597)Terry Jan Reedy2019-01-171-0/+15
|
* bpo-33687: Fix call to os.chmod() in uu.decode() (GH-7282)Timo Furrer2019-01-173-4/+22
|
* bpo-35701: Added __weakref__ slot to uuid.UUID (GH-11570)David H2019-01-172-1/+7
| | | Added test for weakreferencing a uuid.UUID object.
* bpo-35283: Add deprecation warning for Thread.isAlive (GH-11454)Dong-hee Na2019-01-175-4/+17
| | | Add a deprecated warning for the threading.Thread.isAlive() method.
* Fixes typo in asyncio.queue doc (GH-11581)Slam2019-01-171-1/+1
| | | | | | | Typo fix for method doc, I'm pretty sure coro is meant, because there's no consumer threads for thread-unsafe queue. Most probably this piece of doc was copied from `queue.Queue` There's not BPO bug for this, afaik.
* bpo-35486: Note Py3.6 import system API requirement change (GH-11540)Nick Coghlan2019-01-172-1/+13
| | | | | | | | | | While the introduction of ModuleNotFoundError was fully backwards compatible on the import API consumer side, folks providing alternative implementations of `__import__` need to make an update to be forward compatible with clients that start relying on the new subclass. https://bugs.python.org/issue35486
* Revert "bpo-35537: subprocess can now use os.posix_spawnp (GH-11579)" (GH-11582)Victor Stinner2019-01-163-13/+6
| | | This reverts commit 07858894689047c77f9c12ddc061d30681368d19.
* bpo-35537: subprocess can now use os.posix_spawnp (GH-11579)Victor Stinner2019-01-163-6/+13
| | | | The subprocess module can now use the os.posix_spawnp() function, if it is available, to locate the program in the PATH.
* bpo-35674: Add os.posix_spawnp() (GH-11554)Joannah Nanjekye2019-01-169-112/+322
| | | Add a new os.posix_spawnp() function.
* bpo-35537: subprocess uses os.posix_spawn in some cases (GH-11452)Victor Stinner2019-01-154-0/+99
| | | | | | | | | | | | The subprocess module can now use the os.posix_spawn() function in some cases for better performance. Currently, it is only used on macOS and Linux (using glibc 2.24 or newer) if all these conditions are met: * executable path contains a directory * close_fds=False * preexec_fn, pass_fds, cwd, stdin, stdout, stderr and start_new_session parameters are not set Co-authored-by: Joannah Nanjekye <nanjekyejoannah@gmail.com>
* bpo-35746: Fix segfault in ssl's cert parser (GH-11569)Christian Heimes2019-01-154-0/+51
| | | | | | | | | | | Fix a NULL pointer deref in ssl module. The cert parser did not handle CRL distribution points with empty DP or URI correctly. A malicious or buggy certificate can result into segfault. Signed-off-by: Christian Heimes <christian@python.org> https://bugs.python.org/issue35746
* bpo-23846: Fix ProactorEventLoop._write_to_self() (GH-11566)Victor Stinner2019-01-152-1/+9
| | | | | | asyncio.ProactorEventLoop now catchs and logs send errors when the self-pipe is full: BaseProactorEventLoop._write_to_self() now catchs and logs OSError exceptions, as done by BaseSelectorEventLoop._write_to_self().
* bpo-35742: Fix test_envar_unimportable in test_builtin. (GH-11561)Serhiy Storchaka2019-01-152-10/+16
| | | | | Handle the case of an empty module name in PYTHONBREAKPOINT. Fixes a regression introduced in bpo-34756.
* bpo-11555: Enhance IocpProactor.close() log again (GH-11563)Victor Stinner2019-01-151-3/+2
| | | | Add repr(self) to the log to display the number of pending overlapped in the log.
* bpo-34323: Enhance IocpProactor.close() log (GH-11555)Victor Stinner2019-01-152-3/+18
| | | | | IocpProactor.close() now uses time to decide when to log: wait 1 second before the first log, then log every second. Log also the number of seconds since close() was called.
* bpo-35738: Update the example for timer.Timer.repeat(). (GH-11559)Henry Chen2019-01-151-1/+1
| | | Show correct number of repeats.
* bpo-29707: Document that os.path.ismount() is not able to reliable detect ↵Serhiy Storchaka2019-01-151-3/+4
| | | | bind mounts. (GH-11238)
* bpo-35619: Improve support of custom data descriptors in help() and pydoc. ↵Serhiy Storchaka2019-01-153-46/+182
| | | | (GH-11366)
* bpo-34756: Silence only ImportError and AttributeError in ↵Serhiy Storchaka2019-01-141-0/+6
| | | | sys.breakpointhook(). (GH-9457)
* bpo-35066: _dateime.datetime.strftime copies trailing '%' (GH-10692)MichaelSaah2019-01-143-5/+24
| | | | | | | Previously, calling the strftime() method on a datetime object with a trailing '%' in the format string would result in an exception. However, this only occured when the datetime C module was being used; the python implementation did not match this behavior. Datetime is now PEP-399 compliant, and will not throw an exception on a trailing '%'.
* bpo-35730: Disable IDLE test_reload assertion. (GH-11543)Terry Jan Reedy2019-01-131-1/+3
| | | | IDLE's test_squeezer.SqueezerTest.test_reload, added for issue 35196, failed on both Gentoo buildbots.
* bpo-35196: Optimize Squeezer's write() interception (GH-10454)Tal Einat2019-01-136-263/+247
| | | | The new functionality of Squeezer.reload() is also tested, along with some general re-working of the tests in test_squeezer.py.
* bpo-16806: Fix `lineno` and `col_offset` for multi-line string tokens (GH-10021)Anthony Sottile2019-01-1313-51/+91
|
* bpo-34512: Document platform-specific strftime() behavior for non-ASCII ↵Alexey Izbyshev2019-01-121-0/+6
| | | | format strings (GH-8948)
* bpo-35552: Fix reading past the end in PyUnicode_FromFormat() and ↵Serhiy Storchaka2019-01-123-6/+21
| | | | | | PyBytes_FromFormat(). (GH-11276) Format characters "%s" and "%V" in PyUnicode_FromFormat() and "%s" in PyBytes_FromFormat() no longer read memory past the limit if precision is specified.
* bpo-35634: Raise an error when first passed kwargs contains duplicated keys. ↵Serhiy Storchaka2019-01-123-48/+94
| | | | (GH-11438)
* bpo-35494: Improve syntax error messages for unbalanced parentheses in ↵Serhiy Storchaka2019-01-123-17/+51
| | | | f-string. (GH-11161)
* bpo-33817: Fix _PyBytes_Resize() for empty bytes object. (GH-11516)Serhiy Storchaka2019-01-124-0/+26
| | | | Add also tests for PyUnicode_FromFormat() and PyBytes_FromFormat() with empty result.
* bpo-35719: Optimize multi-argument math functions. (GH-11527)Serhiy Storchaka2019-01-122-19/+20
| | | | | Use the fast call convention for math functions atan2(), copysign(), hypot() and remainder() and inline unpacking arguments. This sped up them by 1.3--2.5 times.
* bpo-35582: Inline arguments tuple unpacking in handwritten code. (GH-11524)Serhiy Storchaka2019-01-122-24/+28
| | | | | Inline PyArg_UnpackTuple() and _PyArg_UnpackStack() in performance sensitive code in the builtins and operator modules.
* bpo-34838: Use subclass_of for math.dist. (GH-9659)Ammar Askar2019-01-123-9/+14
| | | | | Argument clinic now generates fast inline code for positional parsing, so the manually implemented type check in math.dist can be removed.
* bpo-35423: Stop using the "pending calls" machinery for signals. (gh-10972)Eric Snow2019-01-114-25/+94
| | | | | This change separates the signal handling trigger in the eval loop from the "pending calls" machinery. There is no semantic change and the difference in performance is insignificant. The change makes both components less confusing. It also eliminates the risk of changes to the pending calls affecting signal handling. This is particularly relevant for some upcoming pending calls changes I have in the works.