Commit graph

106147 commits

Author SHA1 Message Date
Mark Shannon 9af0e47b17
bpo-39156: Break up COMPARE_OP into four logically distinct opcodes. (GH-17754)
Break up COMPARE_OP into four logically distinct opcodes:
* COMPARE_OP for rich comparisons
* IS_OP for 'is' and 'is not' tests
* CONTAINS_OP for 'in' and 'is not' tests
* JUMP_IF_NOT_EXC_MATCH for checking exceptions in 'try-except' statements.
2020-01-14 10:12:45 +00:00
Dong-hee Na 62e3973395 bpo-39259: smtp.SMTP/SMTP_SSL now reject timeout = 0 (GH-17958) 2020-01-14 08:49:59 +01:00
Anthony Shaw 2de064e630 bpo-39160 Align the verbs, grammar and defaults for ./configure --help (GH-17747) 2020-01-14 01:40:10 -05:00
Dong-hee Na a190e2ade1 bpo-39259: ftplib.FTP/FTP_TLS now reject timeout = 0 (GH-17959) 2020-01-13 20:34:34 +01:00
Chris Withers 31d6de5aba
remove unused __version__ from mock.py (#17977)
This isn't included in `__all__` and could be a source of confusion.
2020-01-13 19:11:34 +00:00
Victor Stinner 2b1df4592e
bpo-38644: Pass tstate to _Py_FinishPendingCalls() (GH-17990)
_Py_FinishPendingCalls() now expects a tstate argument, instead of a
runtime argument.
2020-01-13 18:46:59 +01:00
Julien Danjou 3430c55417 bpo-39164: Add private _PyErr_GetExcInfo() function (GH-17752)
This adds a new function named _PyErr_GetExcInfo() that is a variation of the
original PyErr_GetExcInfo() taking a PyThreadState as its first argument.
That function allows to retrieve the exceptions information of any Python
thread -- not only the current one.
2020-01-13 17:30:14 +01:00
Karthikeyan Singaravelan d8efc14951
bpo-39299: Add more tests for mimetypes and its cli. (GH-17949)
* Add tests for case insensitive check of types and extensions as fallback.
* Add tests for data url with no comma.
* Add tests for read_mime_types.
* Add tests for the mimetypes cli and refactor __main__ code to private function.
* Restore mimetypes.knownfiles value at the end of the test.
2020-01-13 20:09:36 +05:30
Victor Stinner c1ee6e5e9b
bpo-20443: Update What's New In Python 3.9 (GH-17986)
The sys.argv[0] change has been reverted.
2020-01-13 14:57:14 +01:00
Mark Shannon e7c9f4aae1
Cleanup exit code for interpreter. (GH-17756) 2020-01-13 12:51:26 +00:00
Pablo Galindo 97f1267a54
Fix typos in gcmodule.c and restructure comments for clarity (GH-17983) 2020-01-13 12:25:05 +00:00
Emmanuel Arias d23f78267a Remove unused functions in Parser/parsetok.c (GH-17365) 2020-01-13 11:58:52 +00:00
Victor Stinner 0b2ab21956
bpo-39310: Add math.ulp(x) (GH-17965)
Add math.ulp(): return the value of the least significant bit
of a float.
2020-01-13 12:44:35 +01:00
Alex Henrie 7ba6f18de2 bpo-39307: Fix memory leak on error path in parsetok (GH-17953) 2020-01-13 10:35:47 +00:00
Philip McMahon b2b4a51f74 bpo-32021: Support brotli .br encoding in mimetypes (#12200)
Add support for brotli encoding in the encoding_map.
2020-01-12 14:31:49 -08:00
Batuhan Taşkaya 61b14151cc bpo-39313: Add an option to RefactoringTool for using exec as a function (GH-17967)
https://bugs.python.org/issue39313


Automerge-Triggered-By: @pablogsal
2020-01-12 14:13:31 -08:00
Ram Rachum 14dbe4b3f0 Fix outdated comment in _strptime.py (GH-17929)
Can I please get the tags for skipping bpo and skipping a news item?
2020-01-12 12:53:00 -08:00
Batuhan Taşkaya 6680f4a9f5 bpo-3530: Add advice on when to correctly use fix_missing_locations in the AST docs (GH-17172)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-01-12 20:38:53 +00:00
Guðni Natan Gunnarsson 9f3fc6c5b4 bpo-38293: Allow shallow and deep copying of property objects (GH-16438)
Copying property objects results in a TypeError. Steps to reproduce:

```
>>> import copy
>>> obj = property()
>>> copy.copy(obj)
````

This affects both shallow and deep copying.  
My idea for a fix is to add property objects to the list of "atomic" objects in the copy module.
These already include types like functions and type objects.

I also added property objects to the unit tests test_copy_atomic and test_deepcopy_atomic. This is my first PR, and it's highly likely I've made some mistake, so please be kind :)


https://bugs.python.org/issue38293
2020-01-12 09:41:49 -08:00
Victor Stinner 54cfbb2fee
bpo-39288: Add examples to math.nextafter() documentation (GH-17962) 2020-01-12 12:57:47 +01:00
Kyle Stanley 0ca7cc7fc0 bpo-38356: Fix ThreadedChildWatcher thread leak in test_asyncio (GH-16552)
Motivation for this PR (comment from @vstinner in bpo issue):
```
Warning seen o AMD64 Ubuntu Shared 3.x buildbot:
https://buildbot.python.org/all/#/builders/141/builds/2593

test_devnull_output (test.test_a=syncio.test_subprocess.SubprocessThreadedWatcherTests) ...
Warning -- threading_cleanup() failed to cleanup 1 threads (count: 1, dangling: 2)
```
The following implementation details for the new method are TBD:

1) Public vs private

2) Inclusion in `close()`

3) Name

4) Coroutine vs subroutine method

5) *timeout* parameter

If it's a private method, 3, 4, and 5 are significantly less important.

I started with the most minimal implementation that fixes the dangling threads without modifying the regression tests, which I think is particularly important. I typically try to avoid directly modifying existing tests as much as possible unless it's necessary to do so. However, I am open to changing any part of this.


https://bugs.python.org/issue38356
2020-01-12 03:02:50 -08:00
Zac Hatfield-Dodds d7c7adde00 bpo-12159: Document sys.maxsize limit in len() function reference (GH-17934) 2020-01-12 10:04:14 +01:00
Vinay Sajip c12440c371
bpo-16575: Disabled checks for union types being passed by value. (GH-17960)
Although the underlying libffi issue remains open, adding these
checks have caused problems in third-party projects which are in
widespread use. See the issue for examples.

The corresponding tests have also been skipped.
2020-01-12 08:54:00 +00:00
Victor Stinner 100fafcf20
bpo-39288: Add math.nextafter(x, y) (GH-17937)
Return the next floating-point value after x towards y.
2020-01-12 02:15:42 +01:00
Dong-hee Na 1b335ae281 bpo-39259: nntplib.NNTP/NNTP_SSL now reject timeout = 0 (GH-17936)
nntplib.NNTP and nntplib.NNTP_SSL now raise a ValueError
if the given timeout for their constructor is zero to
prevent the creation of a non-blocking socket.
2020-01-11 18:39:15 +01:00
Jason R. Coombs 136735c1a2
bpo-39297: Update for importlib_metadata 1.4. (GH-17947)
* bpo-39297: Update for importlib_metadata 1.4. Includes performance updates.

* 📜🤖 Added by blurb_it.

* Update blurb

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2020-01-11 10:37:28 -05:00
Dong-hee Na 5d978a2e73 bpo-39259: nntplib.NNTP/NNTP_SSL refactoring (GH-17939) 2020-01-11 16:07:36 +01:00
Karthikeyan Singaravelan 43682f1e39
Fix host in address of socket.create_server example. (GH-17706)
Host as None in address raises TypeError since it should be string, bytes or bytearray.
2020-01-11 10:46:30 +05:30
Vinay Sajip ce54519aa0
bpo-39292: Add missing syslog facility codes. (GH-17945) 2020-01-10 19:37:48 +00:00
Dong-hee Na abdc634f33 bpo-39200: Correct the error message for min/max builtin function (GH-17814)
Correct the error message when calling the min() or max() with
no arguments.
2020-01-10 17:31:43 +01:00
Dong-hee Na c39b52f152 bpo-39259: poplib now rejects timeout = 0 (GH-17912)
poplib.POP3 and poplib.POP3_SSL now raise a ValueError
if the given timeout for their constructor is zero to
prevent the creation of a non-blocking socket.
2020-01-10 15:34:05 +01:00
Pablo Galindo 4c53e63cc9 bpo-39166: Fix trace of last iteration of async for loops (#17800) 2020-01-10 09:24:22 +00:00
Serhiy Storchaka 850a8856e1
bpo-39235: Check end_lineno and end_col_offset of AST nodes. (GH-17926) 2020-01-10 10:12:55 +02:00
Guido van Rossum a796d8ef9d bpo-39235: Fix end location for genexp in call args (GH-17925)
The fix changes copy_location() to require an extra node from which to extract the end location, and fixing all 5 call sites.


https://bugs.python.org/issue39235
2020-01-09 11:18:47 -08:00
Daniel Hahler 2f65aa4658 Fix typo in test's docstring (GH-17856)
* Fix typo in test's docstring. contination -> continuation.
2020-01-09 22:37:32 +05:30
Steve Dower ed367815ee
bpo-25172: Reduce scope of crypt import tests (GH-17881) 2020-01-09 09:00:29 -08:00
Karthikeyan Singaravelan eef1b027ab Add test cases for dataclasses. (#17909)
* Add test cases for dataclasses.

* Add test for repr output of field.
* Add test for ValueError to be raised when both default and default_factory are passed.
2020-01-09 08:41:46 -05:00
Petr Viktorin 6c5d661342 bpo-39161: Document multi-phase init modules under Py_NewInterpreter() (GH-17896)
\+ this also adds a stronger warning against sharing objects between (sub-)interpreters.



https://bugs.python.org/issue39161
2020-01-09 04:05:18 -08:00
Alex Henrie f3e5e95669 bpo-39270: Remove dead assignment from config_init_module_search_paths (GH-17914) 2020-01-09 10:14:11 +01:00
Alex Henrie a1c1be24cb bpo-39272: Remove dead assignment from _ssl__SSLContext_load_verify_locations_impl (GH-17916) 2020-01-09 10:12:12 +01:00
Alex Henrie 1a183faccb bpo-39271: Remove dead assignment from pattern_subx (GH-17915) 2020-01-09 08:27:51 +02:00
Alex Henrie 5cae042f68 closes bpo-39262: Use specific out-of-memory message in _sharedexception_bind. (GH-17908) 2020-01-08 18:48:52 -08:00
Alex Henrie 2c7ed417a4 closes bpo-39261: Remove dead assignment from pyinit_config. (GH-17907) 2020-01-08 18:46:55 -08:00
Victor Stinner f3a0a6bbcc
Py_DECREF: only pass filename if Py_REF_DEBUG is defined (GH-17870)
Filename and line numbers are not needed when Py_REF_DEBUG are not
defined.

The static inline _Py_DECREF() function was introduced by
commit 2aaf0c1204.
2020-01-08 21:03:45 +01:00
An Long 5907e61a8d bpo-35292: Avoid calling mimetypes.init when http.server is imported (GH-17822) 2020-01-08 10:28:14 -08:00
Dong-hee Na 2e6a8efa83 bpo-39242: Updated the Gmane domain into news.gmane.io (GH-17903) 2020-01-08 16:29:34 +01:00
Pablo Galindo 9a669d58e8 bpo-39233: Update positional-only section in the glossary (GH-17874)
https://bugs.python.org/issue39233
2020-01-08 05:00:14 -08:00
Alex Henrie 998c54948a bpo-39237, datetime: Remove redundant call to round from delta_new (GH-17877) 2020-01-08 13:52:44 +01:00
Dong-hee Na b821173b54 bpo-38871: Fix lib2to3 for filter-based statements that contain lambda (GH-17780)
Correctly parenthesize filter-based statements that contain lambda
expressions in lib2to3.
2020-01-07 18:30:54 +01:00
Dong-hee Na 13a7ee8d62 bpo-38615: Add timeout parameter for IMAP4 and IMAP4_SSL constructor (GH-17203)
imaplib.IMAP4 and imaplib.IMAP4_SSL now have an 
optional *timeout* parameter for their constructors.
Also, the imaplib.IMAP4.open() method now has an optional *timeout* parameter
with this change. The overridden methods of imaplib.IMAP4_SSL and
imaplib.IMAP4_stream were applied to this change.
2020-01-07 18:28:10 +01:00