Commit Graph

21013 Commits

Author SHA1 Message Date
Dong-hee Na a489599793 bpo-32046: Update 2to3 when converts operator.isCallable(obj). (#4417) 2017-11-28 11:26:56 -05:00
Serhiy Storchaka 598ceae876
bpo-32150: Expand tabs to spaces in C files. (#4583) 2017-11-28 17:56:10 +02:00
Victor Stinner 4271dfd781
bpo-32154: Remove asyncio.selectors (#4605)
* Remove asyncio.selectors and asyncio._overlapped symbols from the
  namespace of the asyncio module
* Replace "from asyncio import selectors" with "import selectors"
* Replace "from asyncio import _overlapped" with "import _overlapped"

asyncio.selectors was added to support Python 3.3, which doesn't have
selectors in its standard library, and Python 3.4 in the same code
base. Same rationale for asyncio._overlapped. Python 3.3 reached its
end of life, and asyncio is no more maintained as a third party
module on PyPI.
2017-11-28 15:19:56 +01:00
Ned Deily 122fc136b3
Revert "bpo-30487: automatically create a venv and install Sphinx when running make (GH-4346)" (#4592)
Fix breakage documented in bpo-32149.
This reverts commit d8d6b91221.
2017-11-27 17:07:32 -05:00
Jason Yang c172fc5031 bpo-32051: Fix name shadowing in multiprocessing docs (GH-4469) 2017-11-27 04:18:33 +03:00
Mandeep Singh ede2ac913e bpo-23033: Improve SSL Certificate handling (GH-937)
Wildcard is now supported in hostname when it is one and only character in
the leftmost segment.
2017-11-26 14:31:27 -08:00
Ivan Levkivskyi 0cd2e81bea bpo-29879: Update typing documentation. (GH-4573)
- Add "version added: 3.5.2" note where it was missing.
- Remove the mention that Reversible is new in 3.5.2
2017-11-26 14:23:02 -08:00
Caleb Hattingh d8d6b91221 bpo-30487: automatically create a venv and install Sphinx when running make (GH-4346) 2017-11-26 15:18:30 -06:00
Jonas Haag 5b48dc638b bpo-32071: Add unittest -k option (#4496)
* bpo-32071: Add unittest -k option
2017-11-25 16:23:52 +01:00
Berker Peksag 8d9bb11d8f
bpo-28334: netrc() now uses expanduser() to find .netrc file (GH-4537)
Previously, netrc.netrc() was raised an exception if $HOME is not set.

Authored-By: Dimitri Merejkowsky <dimitri.merejkowsky@tanker.io>
2017-11-25 13:37:22 +03:00
Mariatta 9d5ec808de
Improve Scheduler Objects documentation. (GH-4556)
Mention that the lower the priority number, the higher priority it represents.
2017-11-24 21:43:01 -08:00
Mandeep Bhutani 610e5afdcb bpo-30004: Fix the code example of using group in Regex Howto Docs (GH-4443)
The provided code example was supposed to find repeated words, however it returned false results.
2017-11-24 20:56:00 -08:00
Ashley Camba f8802d80b3 Asyncion-Dev docs: Fix the reference to sys.excepthook (GH-4414) 2017-11-24 15:39:39 -08:00
Victor Stinner 84c4b1938f
bpo-32124: Document C functions safe before init (#4540)
Explicitly document C functions and C variables that can be set
before Py_Initialize().
2017-11-24 22:30:27 +01:00
Will White 78a5722ae9 Improve the String tutorial docs (GH-4541)
The paragraph that contains example of string literal concatenation was placed
after the section about concatenation using the '+' sign.
Moved the paragraph to the appropriate section.
2017-11-24 09:28:12 -08:00
Emanuele Gaifas cdfe910e74 Extending Python Doc minor updates (GH-4518)
Move footnote markers to be closer to the related terminology:
before the end of the sentence, instead of after.
2017-11-24 00:49:57 -08:00
Berker Peksag 3df02dbc8e bpo-31325: Fix usage of namedtuple in RobotFileParser.parse() (#4529) 2017-11-23 15:40:26 -08:00
Raymond Hettinger 0858495a50
bpo-32099 Add deque variant of roundrobin() recipe (#4497)
* Minor wording tweaks
2017-11-23 13:32:23 -08:00
Berker Peksag dcaed6b2d9
bpo-19610: setup() now raises TypeError for invalid types (GH-4519)
The Distribution class now explicitly raises an
exception when 'classifiers', 'keywords' and
'platforms' fields are not specified as a list.
2017-11-23 21:34:20 +03:00
Jesse-Bakker 0784a2e5b1 bpo-10049: Add a "no-op" (null) context manager to contextlib (GH-4464)
Adds a simpler and faster alternative to ExitStack for handling
single optional context managers without having to change the
lexical structure of your code.
2017-11-23 10:23:28 +10:00
AraHaan 431665bf19 bpo-32105: add asyncio.BaseEventLoop.connect_accepted_socket versionadded to documentation. (#4491) 2017-11-21 11:06:26 -05:00
Barry Warsaw e256b40888
bpo-31672 - Add one last minor clarification for idpattern (#4483)
Add one last minor clarification for idpattern
2017-11-21 10:28:13 -05:00
Raymond Hettinger 337cbbace0
Add comment and improve variable name in roundrobin() (#4486) 2017-11-21 00:23:34 -08:00
Victor Stinner bc9b6e29cb
bpo-32043: Rephrase -X dev documentation (#4478)
* should not be more verbose if the code is correct
* enabled checks can be "expensive"
2017-11-20 18:59:50 -08:00
Victor Stinner 09f3a8a124
bpo-32089: Fix warnings filters in dev mode (#4482)
The developer mode (-X dev) now creates all default warnings filters
to order filters in the correct order to always show ResourceWarning
and make BytesWarning depend on the -b option.

Write a functional test to make sure that ResourceWarning is logged
twice at the same location in the developer mode.

Add a new 'dev_mode' field to _PyCoreConfig.
2017-11-20 17:32:40 -08:00
Yury Selivanov 423fd362f8
bpo-32066: Support pathlib.Path in create_unix_connection; sock arg should be optional (#4447) 2017-11-20 17:26:28 -05:00
Victor Stinner c5a2071586
bpo-32050: Fix -x option documentation (#4475)
The line number in correct when using the -x option: Py_Main() uses
ungetc() to not skip the first newline character.
2017-11-20 08:08:03 -08:00
Victor Stinner 44862df2ee
bpo-32047: -X dev enables asyncio debug mode (#4418)
The new -X dev command line option now also enables asyncio debug
mode.
2017-11-20 07:14:07 -08:00
Berker Peksag b56becb373
Remove outdated .pyo reference from msilib docs (GH-4461)
Since f299abdafa
the remove_pyc() method no longer tries to
remove .pyo files.
2017-11-19 13:04:25 +03:00
Masayuki Yamamoto 7750bded92 Document parameters of BaseServer.finish_request() (GH-4445) 2017-11-19 10:33:37 +03:00
Moses Koledoye 0c71653cb8 [Doc] Update opcode for var-positional arguments (#4446)
`BUILD_MAP_UNPACK_WITH_CALL` was duplicated as the opcode for both var-positional and var-keyword arguments. The opcode for the former was updated as `BUILD_TUPLE_UNPACK_WITH_CALL`.
2017-11-19 00:49:15 +02:00
Erik Bray d505a29a15 Fix typo in atexit documentation. (GH-4419)
`kargs` -> `kwargs`
2017-11-16 08:48:52 -08:00
Serhiy Storchaka cede8c9edb
bpo-31702: Allow to specify rounds for SHA-2 hashing in crypt.mksalt(). (#4110)
The log_rounds parameter for Blowfish has been replaced with the rounds parameter.
2017-11-16 13:22:51 +02:00
Victor Stinner ccb0442a33
bpo-32043: New "developer mode": "-X dev" option (#4413)
Add a new "developer mode": new "-X dev" command line option to
enable debug checks at runtime.

Changes:

* Add unit tests for -X dev
* test_cmd_line: replace test.support with support.
* Fix _PyRuntimeState_Fini(): Use the same memory allocator
   than _PyRuntimeState_Init().
* Fix _PyMem_GetDefaultRawAllocator()
2017-11-16 03:20:31 -08:00
Serhiy Storchaka 05cb728d68
bpo-30349: Raise FutureWarning for nested sets and set operations (#1553)
in regular expressions.
2017-11-16 12:38:26 +02:00
Serhiy Storchaka 0a2abdfca2
bpo-30143: 2to3 now generates a code that uses abstract collection classes (#1262)
from collections.abc rather than collections.
2017-11-16 09:16:24 +02:00
Antoine Pitrou 4bd41c9b52
bpo-32025: Add time.thread_time() (#4410)
* bpo-32025: Add time.thread_time()

* Add missing #endif

* Add NEWS blurb

* Add docs and whatsnew

* Address review comments

* Review comments
2017-11-15 22:52:21 +01:00
Serhiy Storchaka ddbce13786
bpo-32023: Disallow genexprs without parenthesis in class definitions. (#4400) 2017-11-15 17:39:37 +02:00
Serhiy Storchaka 9165f77d5f
bpo-32012: Disallow trailing comma after genexpr without parenthesis. (#4382) 2017-11-15 08:49:40 +02:00
Jesse-Bakker 3bda02222a bpo-31948: Fix broken links in msilib docs (GH-4397) 2017-11-14 15:06:15 -08:00
Serhiy Storchaka b0b44b4b33
bpo-15606: Improve the re.VERBOSE documentation. (#4366) 2017-11-14 17:21:26 +02:00
xdegaye e0582a37c8
bpo-30696: Fix the REPL looping endlessly when no memory (GH-4160) 2017-11-12 16:50:48 +01:00
Edward Betts e197a8538b The termios man page is in section 3 (GH-2450) 2017-11-11 19:40:26 +03:00
Berker Peksag 7c9da3e5ba
Remove redundant 'exc = True' line (GH-4357)
It can be removed after c28890fb42
2017-11-11 17:55:05 +03:00
Pablo Galindo e184cfd7bf bpo-31824: Document default value of 'errors' parameters (GH-4328) 2017-11-11 02:05:12 +03:00
Brian Curtin 9f914a01af
bpo-31985: Deprecate openfp in aifc, sunau, and wave (#4344)
The openfp functions of aifp, sunau, and wave had pointed to the open
function of each module since 1993 as a matter of backwards
compatibility. In the case of aifc.openfp, it was both undocumented
and untested. This change begins the formal deprecation of those
openfp functions, with their removal coming in 3.9.

This additionally adds a TODO in test_pyclbr around using aifc.openfp,
though it shouldn't be changed until removal in 3.9.
2017-11-10 11:38:25 -05:00
Cody Scott 72fa3014d5 Fix phrasing in Doc/whatsnew/3.7.rst (GH-4318) 2017-11-09 21:58:59 +03:00
Victor Stinner 8c663fd60e
Replace KB unit with KiB (#4293)
kB (*kilo* byte) unit means 1000 bytes, whereas KiB ("kibibyte")
means 1024 bytes. KB was misused: replace kB or KB with KiB when
appropriate.

Same change for MB and GB which become MiB and GiB.

Change the output of Tools/iobench/iobench.py.

Round also the size of the documentation from 5.5 MB to 5 MiB.
2017-11-08 14:44:44 -08:00
Tom Floyer bf9d317626 bpo-31810: added missing keywords to docs. (#4140)
async and await keywords has been merged into upstream, but they are
all missing in the lexical analysis docs. This change adds them to the
appropriate keywords section in documentation.
2017-11-08 12:31:26 -05:00
Petr Viktorin 2138163621 bpo-29179: Document the Py_UNUSED macro (#4341)
Py_UNUSED has a public name, and is used in the wild outside CPython,
but was not documented. Rectify that.

The macro was added in bpo-19976 and referenced in bpo-26179.
2017-11-08 07:59:20 -08:00
James b5d9e08114 bpo-31884 subprocess: add Windows constants for process priority (#4150) 2017-11-08 06:18:59 -08:00
Victor Stinner 54cc0c0789
bpo-31338: C API intro: add missing versionadded (#4339) 2017-11-08 06:06:24 -08:00
Berker Peksag 28ab3ce924
Fix broken link in Doc/whatsnew/3.7.rst (GH-4335) 2017-11-08 16:36:58 +03:00
Petr Viktorin 8bf288e2c5 Docs: Mention that Py_UNREACHABLE was added in 3.7 (#4337)
The macro was added for bpo-31338 in commit b2e5794870
2017-11-08 15:11:16 +02:00
Sanyam Khurana 7973e279a2 bpo-21862: Add -m option to cProfile for profiling modules (#4297)
* bpo-21862: Add -m option to cProfile for profiling modules
2017-11-08 11:50:56 +01:00
Justus Schwabedal 5a8a84b34f Added :const:`mmap.ACCESS_DEFAULT` constant. (#4093) 2017-11-07 12:51:43 -08:00
Julien Palard 5a66c8a64d bpo-31793: Doc: Specialize smart-quotes for Japanese (GH-4006) 2017-11-08 01:46:50 +09:00
Jelle Zijlstra 1e5d54cfa0 bpo-31965: fix doc for multiprocessing.connection.Client and Listener (#4304)
* fix doc for multiprocessing.connection.Client

The authenticate argument does not exist on either Client or Listener:
- https://github.com/python/cpython/blob/master/Lib/multiprocessing/connection.py#L483 (master)
- https://github.com/python/cpython/blob/3.6/Lib/multiprocessing/connection.py#L478 (3.6)
- https://github.com/python/cpython/blob/3.5/Lib/multiprocessing/connection.py#L478 (3.5)
- https://github.com/python/cpython/blob/3.4/Lib/multiprocessing/connection.py#L487 (3.4)
The documentation also claimed that these functions will call `current_process().auth_key`, for which I could find no evidence in the code. I rewrote the documentation to reflect the actual behavior.

Also made some small changes to vary sentence structure.
2017-11-07 17:13:02 +01:00
Antoine Pitrou 22b1128559
bpo-31960: Fix asyncio.Future documentation for thread (un)safety. (#4319) 2017-11-07 17:03:28 +01:00
Berker Peksag a935654f06
bpo-20486: Implement Database.Close() method in msilib (GH-4141) 2017-11-07 15:58:53 +03:00
Antoine Pitrou 4135c89395
bpo-31950: Improve event loop policy doc (#4306) 2017-11-07 10:26:32 +01:00
Marat Sharafutdinov 69cfed1cd7 Add asyncio.Handle.cancelled() method (#2388) 2017-11-07 12:06:05 +03:00
Barry Warsaw 962e2a7317
Fix a minor typo and hyphenate "multi-threading" (#4237) 2017-11-06 18:18:40 -08:00
Anders Lorentsen a22a127458 bpo-31843: sqlite3.connect() now accepts PathLike objects as database name (#4299) 2017-11-06 16:47:43 -08:00
Nir Soffer ad455cd924 bpo-31945: Configurable blocksize in HTTP(S)Connection (#4279)
blocksize was hardcoded to 8192, preventing efficient upload when using
file-like body. Add blocksize argument to __init__, so users can
configure the blocksize to fit their needs.

I tested this uploading data from /dev/zero to a web server dropping the
received data, to test the overhead of the HTTPConnection.send() with a
file-like object.

Here is an example 10g upload with the default buffer size (8192):

$ time ~/src/cpython/release/python upload-httplib.py 10 https://localhost:8000/
Uploaded 10.00g in 17.53 seconds (584.00m/s)

real	0m17.574s
user	0m8.887s
sys	0m5.971s

Same with 512k blocksize:

$ time ~/src/cpython/release/python upload-httplib.py 10 https://localhost:8000/
Uploaded 10.00g in 6.60 seconds (1551.15m/s)

real	0m6.641s
user	0m3.426s
sys	0m2.162s

In real world usage the difference will be smaller, depending on the
local and remote storage and the network.

See https://github.com/nirs/http-bench for more info.
2017-11-06 13:16:37 -08:00
luzpaz a5293b4ff2 Fix miscellaneous typos (#4275) 2017-11-05 15:37:50 +02:00
Nick Coghlan 1b46131ae4
bpo-22257: Mention startup refactoring in What's New (GH-4286)
While technically a purely internal change, bpo-31845 was
a fairly significant externally visible bug caused by
these changes (environment variable based configuration
was being ignored due to a change in the relative order
of reading the environment and reading command line settings,
and the test suite was only testing the command line options)

Hence this note to essentially say "If you see odd startup
problems in 3.7 that you've never seen in previous releases,
it's probably our fault, so let us know, and we'll fix it".
2017-11-05 14:58:45 +10:00
davy wybiral aafece7a9e bpo-31923: Fix spelling in sqlite3 docs (GH-4227) 2017-11-05 02:00:51 +03:00
Berker Peksag 12d60560ac
Add version{changed,added} markers and make minor style changes (GH-4273) 2017-11-04 15:17:56 +03:00
Serhiy Storchaka d4d79bc1ff
bpo-28564: Use os.scandir() in shutil.rmtree(). (#4085)
This speeds up it to 20-40%.
2017-11-04 14:16:35 +02:00
Phobosmir 82cd3cede8 bpo-31678: Fix typo in PyDateTime_DELTA_GET_MICROSECONDS (GH-3869) 2017-11-04 13:39:45 +03:00
Antoine Pitrou 63ff4131af
bpo-21423: Add an initializer argument to {Process,Thread}PoolExecutor (#4241)
* bpo-21423: Add an initializer argument to {Process,Thread}PoolExecutor

* Fix docstring
2017-11-04 11:05:49 +01:00
Chillar Anand b838cc3ff4 bpo-18699: Corrected documentation for window.chgat in curses module (#1430) 2017-11-04 10:13:16 +02:00
Barry Warsaw 93952f8815
Fix a grammatical problem and reword for clarity. (#4257)
bpo-31936
2017-11-03 13:45:46 -07:00
Barry Warsaw 700d2e4755
bpo-31415: Support PYTHONPROFILEIMPORTTIME envvar equivalent to -X importtime (#4240)
Support PYTHONPROFILEIMPORTTIME envvar equivalent to -X importtime
2017-11-02 16:13:36 -07:00
Simon Willison ac03c03b30 Returning 1 from the set_progress_handler handler cancels query (GH-4120) 2017-11-02 17:34:11 +03:00
Victor Stinner c29b585fd4
bpo-31784: Implement PEP 564: add time.time_ns() (#3989)
Add new time functions:

* time.clock_gettime_ns()
* time.clock_settime_ns()
* time.monotonic_ns()
* time.perf_counter_ns()
* time.process_time_ns()
* time.time_ns()

Add new _PyTime functions:

* _PyTime_FromTimespec()
* _PyTime_FromNanosecondsObject()
* _PyTime_FromTimeval()

Other changes:

* Add also os.times() tests to test_os.
* pytime_fromtimeval() and pytime_fromtimeval() now return
  _PyTime_MAX or _PyTime_MIN on overflow, rather than undefined
  behaviour
* _PyTime_FromNanoseconds() parameter type changes from long long to
  _PyTime_t
2017-11-02 07:28:27 -07:00
Vincent Michel e314853d57 bpo-31307: Make ConfigParser.read() accept bytes objects (GH-3420) 2017-11-02 15:47:04 +03:00
Victor Stinner a64ce973a3
bpo-31917: Add 3 new clock identifiers (#4207)
Add new clock identfiers:

* time.CLOCK_BOOTTIME
* time.CLOCK_PROF
* time.CLOCK_UPTIME
2017-11-02 04:19:19 -07:00
stratakis e8b1965639 bpo-23699: Use a macro to reduce boilerplate code in rich comparison functions (GH-793) 2017-11-02 20:32:54 +10:00
Victor Stinner ec2cbdd1df
bpo-20064: Document PyObject_Malloc() (#4199)
Document the following functions:

* PyObject_Malloc()
* PyObject_Calloc()
* PyObject_Realloc()
* PyObject_Free()

Fix also PyMem_RawFree() documentation.
2017-10-31 09:37:25 -07:00
Pablo Galindo 11225753a8 bpo-31304: Update starmap_async documentation. (GH-4168)
Update the kwarg in the documentation of `multiprocessing.pool.Pool.starmap_async`, from `error_back` to `error_callback` to match the source code..
2017-10-30 11:39:28 -07:00
Quentin Dawans fe4ea9cf1e bpo-31245: Asyncio unix socket datagram (#3164) 2017-10-30 09:43:02 -04:00
Serhiy Storchaka a2314283ff
bpo-20047: Make bytearray methods partition() and rpartition() rejecting (#4158)
separators that are not bytes-like objects.
2017-10-29 02:11:54 +03:00
Utkarsh Upadhyay 843ea47a03 bpo-31545: Update documentation containing timedelta repr. (GH-3687)
This is a fix to the documentation to reflect the changes merged
in as part of bpo-30302.
2017-10-27 14:25:15 +03:00
Arthur Darcet 2f3d6993d7 Fixed sorting order of the LogRecord attributes in the documentation. (GH-4133) 2017-10-27 08:06:20 +01:00
cocoatomo d609b0c24e bpo-31053: Remove redundant 'venv' argument in venv example (GH-2907) 2017-10-27 07:42:11 +03:00
Alexander Belopolsky 66c88ce30c Closes bpo-28281: Remove year (1-9999) limits on the weekday() function. (#4109)
Patch by Mark Gollahon.
2017-10-26 15:34:11 -04:00
Vitor Pereira 52ad72dd0a bpo-30553: Add status code 421 to http.HTTPStatus (GH-2589) 2017-10-26 21:49:19 +03:00
xdegaye 56d1f5ca32 bpo-30697: Fix PyErr_NormalizeException() when no memory (GH-2327) 2017-10-26 15:09:06 +02:00
Ammar Askar 275d2d9c46 bpo-30937: Make usage of newline='' consistent in csv docs (GH-2730) 2017-10-26 11:27:46 +03:00
Mario Corchero 32318930da Closes bpo-31800: Support for colon when parsing time offsets (#4015)
Add support to strptime to parse time offsets with a colon between the hour and the minutes.
2017-10-25 20:35:41 -04:00
Serhiy Storchaka 3557b05c5a bpo-31690: Allow the inline flags "a", "L", and "u" to be used as group flags for RE. (#3885) 2017-10-24 23:31:42 +03:00
Alexander Belopolsky fdd9b217c6 Closes bpo-28292: Implemented Calendar.itermonthdays3() and itermonthdays4(). (#4079)
Calendar.itermonthdates() will now consistently raise an exception when a date falls outside of the 0001-01-01 through 9999-12-31 range. To support applications that cannot tolerate such exceptions, the new methods itermonthdays3() and itermonthdays4() are added. The new methods return tuples and are not restricted by the range supported by datetime.date.

Thanks @serhiy-storchaka for suggesting the itermonthdays4() method and for the review.
2017-10-24 13:17:10 -04:00
Serhiy Storchaka eab3ff72eb bpo-31664: Add support for the Blowfish method in crypt. (#3854) 2017-10-24 19:36:17 +03:00
Masayuki Yamamoto 831d61d56c Fix wording about Py_tss_NEEDS_INIT in docs (GH-4096)
Make more sense to replace the word "default value" with
"initializer" for Py_tss_NEEDS_INIT.
2017-10-24 22:58:16 +10:00
Julien Palard 809d173c20 bpo-31812: Add documentation translations to What's New in Python 3.7. (GH-4064) 2017-10-24 02:22:22 -07:00
Victor Stinner 01b5aab7bf bpo-31827: Remove os.stat_float_times() (GH-4061) 2017-10-24 02:02:00 -07:00
andyclegg 7fed7bd8bb bpo-31756: subprocess.run should alias universal_newlines to text (#4049)
Improve human friendliness of the Popen API: Add text=False as a
keyword-only argument to subprocess.Popen along with a Popen
attribute .text_mode and set this based on the
encoding/errors/universal_newlines/text arguments.

The universal_newlines parameter and attribute are maintained for
backwards compatibility.
2017-10-22 19:01:19 -07:00
Cheryl Sabella 91dc64ba3f bpo-20825: Containment test for ip_network in ip_network. 2017-10-22 23:39:49 +02:00