Commit Graph

110931 Commits

Author SHA1 Message Date
Nikita Sobolev cb07838ab7
bpo-45217: adds note that `allow_no_value` in `configparser` is optional (GH-28396)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-09-17 12:55:51 +02:00
Ken Jin 70bed6f993
bpo-45107: Make LOAD_METHOD_CLASS safer and faster, clean up comments (GH-28177)
* Improve comments

* Check cls is a type, remove dict calculation
2021-09-17 18:47:36 +08:00
Serhiy Storchaka b0a6ede3d0
bpo-45162: Remove many old deprecated unittest features (GH-28268)
* "fail*" and "assert*" aliases of TestCase methods.
* Broken from start TestCase method assertDictContainsSubset().
* Ignored TestLoader.loadTestsFromModule() parameter use_load_tests.
* Old alias _TextTestResult of TextTestResult.
2021-09-17 13:33:27 +03:00
Serhiy Storchaka 0361335b80
bpo-45187: Collect test_socket tests using unittest (GH-28317)
Previously, test classes ISOTPTest, J1939Test, BasicUDPLITETest and
UDPLITETimeoutTest were not included in the list of tests and
were not run by regrtest.
2021-09-17 12:13:09 +02:00
Ken Jin 4857e53890
bpo-45203: fix compiler warnings (GH-28357)
Co-authored-by: Mark Shannon <mark@hotpy.org>
2021-09-17 17:48:44 +08:00
Serhiy Storchaka b2b035a949
bpo-5846: Fix deprecations for obsolete unittest functions and add tests. (GH-28382) 2021-09-17 12:09:32 +03:00
Serhiy Storchaka 773319545b
bpo-45228: Fix stack buffer overflow in parsing J1939 address (GH-28404) 2021-09-17 11:46:19 +03:00
Raymond Hettinger 80d9ff1648
Fix typo and add a module prefix (GH-28401) 2021-09-16 23:49:41 -05:00
Eric Snow fdc6b3d931
bpo-45020: Drop the frozen .h files from the repo. (gh-28392)
The main advantage is that the files will no longer show up in diffs and PRs. That means, for a PR, the number of files / lines changed will more clearly reflect the actual change.  (This is essentially an un-revert of gh-28375.)

https://bugs.python.org/issue45020
2021-09-16 14:20:52 -06:00
speedrun-program a59ede2447
bpo-45225: use map function instead of genexpr in capwords (GH-28342) 2021-09-16 14:49:38 -05:00
Steve Dower f4b94b1f57
bpo-45220: Avoid automatically selecting the Windows 11 SDK preview when building (GH-28393) 2021-09-16 19:29:32 +01:00
Serhiy Storchaka 7dacb70485
bpo-45212: Fix dangling threads in skipped tests in test_socket (GH-28361)
tearDown() is not called if setUp() raises an exception
(including SkipTest). addCleanup() should be used for guaranteed
execution of the cleanup code.
2021-09-16 13:30:00 +03:00
David Hewitt 800bd01b6d
docs: correct references to __isub__ etc (GH-28297) 2021-09-16 11:33:41 +03:00
Eric Snow 9fd87a5fe5
bpo-45020: Revert "Drop the frozen .h files from the repo." (gh-28380)
gh-28375 broke one of the buildbots. Until I figure out why, I'm rolling the change back.

https://bugs.python.org/issue45020
2021-09-15 23:27:38 -06:00
Barry Warsaw 07e737d002
bpo-45155 : Default arguments for int.to_bytes(length=1, byteorder=sys.byteorder) (#28265)
Add default arguments for int.to_bytes() and int.from_bytes()

Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
2021-09-15 19:55:24 -07:00
Eric Snow a9757bf34d
bpo-45020: Drop the frozen .h files from the repo. (gh-28375)
The main advantage is that the files will no longer show up in diffs and PRs. That means, for a PR, the number of files / lines changed will more clearly reflect the actual change.

https://bugs.python.org/issue45020
2021-09-15 19:15:26 -06:00
Hubert Badocha a75a257725
bpo-39710: Remove Python 2-specific sentence from calendar documentation (GH-26985) 2021-09-15 22:36:38 +02:00
Eric Snow 3814e2036d
bpo-45019: Clean up the frozen __hello__ module. (gh-28374)
Here's one more small cleanup that should have been in PR gh-28319. We eliminate stdout side-effects from importing the frozen __hello__ module, and update tests accordingly. We also move the module's source file into Lib/ from Toos/freeze/flag.py.

https://bugs.python.org/issue45019
2021-09-15 14:15:32 -06:00
Konstantin Popov d081eab7df
Fix typo in Lib/sqlite3/test/test_types.py (GH-28226)
preceeding -> preceding

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-09-15 22:09:08 +02:00
Eric Snow 4b30aaa0c9
bpo-45019: Silence a warning in test_ctypes. (gh-28362)
This was missed in PR gh-28319.

https://bugs.python.org/issue45019
2021-09-15 13:33:05 -06:00
Erlend Egeberg Aasland 51056b40e7
bpo-45089: Improve sqlite3 trace callback docs (GH-28238)
- Add link to str object and sqlite3 transaction control
- Mention that exceptions are not propagated
2021-09-15 20:39:05 +02:00
Erlend Egeberg Aasland ff6d2cc55a
bpo-5846: Deprecate obsolete methods in `unittest` (GH-28299)
Deprecate makeSuite, findTestCases, and getTestCaseNames. Scheduled for removal in Python 3.13.
2021-09-15 20:33:31 +02:00
Terry Jan Reedy 9d76d28867
bpo-45193: News for IDLE PR_28343 (GH-28348) 2021-09-15 14:26:43 -04:00
Serhiy Storchaka 5dce51a887
bpo-45167: Fix deepcopying of GenericAlias (GH-28324) 2021-09-15 20:25:41 +02:00
Victor Stinner 84a6061e29
bpo-45207: Make test_gdb.test_pycfunction() quiet (GH-28355)
test_gdb.test_pycfunction() now ignores gdb stderr, it no longer logs
messages like:

    Function "meth_varargs" not defined.
2021-09-15 20:21:06 +02:00
Victor Stinner cc057ff522
bpo-45205: Make test_compileall quiet (GH-28356)
Make test_compileall quiet: test_year_2038_mtime_compilation() and
test_larger_than_32_bit_times() of test_compileall no longer log
"Compiling ..." messages to stdout.
2021-09-15 20:20:45 +02:00
Victor Stinner e08e491a6c
bpo-45208: Make test_pdb.test_checkline_is_not_executable() quiet (GH-28354)
test_pdb.test_checkline_is_not_executable() no longer writes output
to stdout.

Remove also unused variables 'f'.
2021-09-15 20:19:31 +02:00
Pablo Galindo Salgado 764e6823a7
bpo-45204: Reduce verbosity of test_peg_generator (GH-28360) 2021-09-15 20:16:51 +02:00
Steve Dower 09b4ad11f3
bpo-45188: Windows now regenerates frozen modules at the start of build instead of late (GH-28322)
This will enable us to drop the frozen module header files from the repository.

It does currently cause many source files to be built twice, which just takes more time. For whoever comes to fix this in the future, the files shared between freeze_module and pythoncore should be put into a static library that is consumed by both.
2021-09-15 18:11:12 +01:00
Nikita Sobolev d897579a80
bpo-45185: enables `TestEnumerations` in `test_ssl` (GH-28330) 2021-09-15 19:57:03 +03:00
Eric Snow cbeb819710
bpo-45020: Freeze some of the modules imported during startup. (gh-28335)
Doing this provides significant performance gains for runtime startup (~15% with all the imported modules frozen). We don't yet freeze all the imported modules because there are a few hiccups in the build systems we need to sort out first. (See bpo-45186 and bpo-45188.)

Note that in PR GH-28320 we added a command-line flag (-X frozen_modules=[on|off]) that allows users to opt out of (or into) using frozen modules. The default is still "off" but we will change it to "on" as soon as we can do it in a way that does not cause contributors pain.

https://bugs.python.org/issue45020
2021-09-15 10:19:30 -06:00
Serhiy Storchaka 1a9ef57985
bpo-44786: Fix a warning in RE in c-analyzer (GH-28351) 2021-09-15 17:08:48 +03:00
Mark Shannon 11cdf2a670
bpo-45203: Cleanup stats gathering code for LOAD_METHOD (GH-28352) 2021-09-15 14:55:49 +01:00
Victor Stinner b49263b698
bpo-21302: Add _PyTime_AsNanoseconds() (GH-28350)
Refactor pytime.c:

* Add pytime_from_nanoseconds() and pytime_as_nanoseconds(),
  and use explicitly these functions
* Add two empty lines between functions
* PEP 7: add braces { ... }
* C99: declare variables where they are set
* Rename private functions to lowercase
* Rename error_time_t_overflow() to pytime_time_t_overflow()
* Rename win_perf_counter_frequency() to py_win_perf_counter_frequency()
* py_get_monotonic_clock(): add an assertion to detect overflow when
  mach_absolute_time() unsigned uint64_t is casted to _PyTime_t
  (signed int64_t).

_testcapi: use _PyTime_FromNanoseconds().
2021-09-15 14:26:43 +02:00
Irit Katriel 40d2ac92f9
bpo-45152: refactor the dis module to make handling of hasconst opcodes more generic (GH-28258) 2021-09-15 10:14:15 +01:00
Terry Jan Reedy 1afc7b3219
bpo-45193: Restore IDLE completion boxes on Ubuntu (GH-28343)
The line that should not have been needed on macOS tk 8.6.8 but was,
should not be a problem on Ubuntu, but is.  It is not needed on macOS
tk 8.6.11, installed with 3.10.  Disable it but leave it for
now in case some system needs it.
2021-09-15 03:13:23 -04:00
Terry Jan Reedy 369bf949cc
bpo-45020: Don't test IDLE with frozen module. (GH-28344)
Otherwise, test would need special import.
2021-09-15 03:08:44 -04:00
Eric Snow a65c86889e
bpo-45020: Add -X frozen_modules=[on|off] to explicitly control use of frozen modules. (gh-28320)
Currently we freeze several modules into the runtime. For each of these modules it is essential to bootstrapping the runtime that they be frozen. Any other stdlib module that we later freeze into the runtime is not essential. We can just as well import from the .py file.  This PR lets users explicitly choose which should be used, with the new "-X frozen_modules=[on|off]" CLI flag. The default is "off" for now.

https://bugs.python.org/issue45020
2021-09-14 17:31:45 -06:00
Pablo Galindo Salgado 1aaa859497
bpo-4356: Mention the new key arguments for the bisect module APIs in the 3.10 What's new (GH-28339) 2021-09-14 20:53:14 +01:00
junyixie b668cdfa09
bpo-45196: prevent unittest crash on address sanitizer builds (GH-28331) 2021-09-14 11:31:50 -07:00
Benjamin Peterson 024fda47d4
closes bpo-45190: Update Unicode data to version 14.0.0. (GH-28336) 2021-09-14 11:00:38 -07:00
Victor Stinner 797c8eb9ef
bpo-45195: Fix test_readline.test_nonascii() (GH-28329)
Fix test_readline.test_nonascii(): sometimes, the newline character
is not written at the end, so don't expect it in the output.
2021-09-14 17:38:04 +02:00
Nikita Sobolev 7f60c9e1c6
bpo-45156: Fixes inifite loop on unittest.mock.seal() (GH-28300)
Fixes infinite loop on unittest.mock.seal() of mocks created by
unittest.create_autospec().

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2021-09-14 12:20:40 +02:00
Irit Katriel c99fc4e53a
bpo-45168: change dis output to omit missing values rather than replacing them by their index (GH-28313) 2021-09-14 10:09:05 +01:00
Irit Katriel c2f1e95337
bpo-45152: Add HAS_CONST macro and get_const_value() function and use… (#28262) 2021-09-14 09:53:32 +01:00
Hugo van Kemenade 9f93018b69
bpo-42135 Correct version slated for importlib.find_loader removal (GH-28312)
importlib.find_loader should also be slated for 3.12 like the others in GH-25169 and as documented in https://docs.python.org/3.11/whatsnew/3.10.html#deprecated.
2021-09-13 15:57:50 -07:00
Eric Snow a2d8c4b81b
bpo-45019: Do some cleanup related to frozen modules. (gh-28319)
There are a few things I missed in gh-27980. This is a follow-up that will make subsequent PRs cleaner. It includes fixes to tests and tools that reference the frozen modules.

https://bugs.python.org/issue45019
2021-09-13 16:18:37 -06:00
Hugo van Kemenade 1fc41ae870
bpo-45173 Remove configparser deprecations (GH-28292)
In the configparser module, these have been deprecated since Python 3.2:

* the SafeConfigParser class,
* the filename property of the ParsingError class,
* the readfp method of the ConfigParser class,
2021-09-13 19:12:36 +02:00
Victor Stinner 85dc53a463
bpo-21302: Update time.sleep() doc for clock_nanosleep() (GH-28311)
Clean-up also What's New in Python 3.11 doc: move entries to the
correct sections.
2021-09-13 17:40:25 +02:00
Livius 85a4748118
bpo-21302: Add clock_nanosleep() implementation for time.sleep() (GH-28111)
In Unix operating systems, time.sleep() now uses the clock_nanosleep() function,
if available, which allows to sleep for an interval specified with nanosecond precision.

Co-authored-by: Victor Stinner <vstinner@python.org>
2021-09-13 14:37:38 +02:00