Commit Graph

80608 Commits

Author SHA1 Message Date
Xiang Zhang e64a47b37d
bpo-17799: Explain real behaviour of sys.settrace and sys.setprofile (GH-4056). (#5299)
(cherry picked from commit 131fd7f96c)
2018-01-24 22:53:42 +08:00
Miss Islington (bot) 6ccdad7b1f bpo-32635: Fix a segfault when importing the crypt module with libxcrypt. (GH-5284) (#5295)
glibc is deprecating libcrypt in favor of libxcrypt, however python assumes
that crypt.h will always be included. This change makes the header inclusion
explicit when libxcrypt is present on the system.
(cherry picked from commit e768c86ef4)
2018-01-24 10:51:39 +01:00
Pablo Galindo 8ca036d471 bpo-32586: Fix code example in urllib2's doc (GH-5238)
It should be `urllib2.URLError` instead of just `URLError`.
2018-01-18 16:16:13 -08:00
Gregory P. Smith b1a52b1167
Use assertItemsEqual instead of assertEqual. (#5224)
This test doesn't care about order, the underlying filesystem APIs do not
guarantee directory listings on subsequent calls will be in the same order.
2018-01-17 15:15:46 -08:00
Miss Islington (bot) 016f59a716 pythoninfo: add time.time and datetime.datetime.now (GH-5214) (#5220)
(cherry picked from commit 7d91c02504)
2018-01-17 17:58:16 +01:00
Anthony Sottile 27f32e938f bpo-32539: Fix OSError for os.listdir() for extended-length paths on Windows (#5169)
See https://msdn.microsoft.com/en-us/library/windows/desktop/aa365247(v=vs.85).aspx?f=255&MSPPError=-2147217396#maxpath

Paths that begin with `\\?\` are "extended-length paths".
2018-01-15 23:39:04 +02:00
Miss Islington (bot) ab95b3074e bpo-32521: nis libtirpc (GH-5137) (#5166)
glibc has removed Sun RPC. Use replacement libtirpc headers and library in
nis module

Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit f3031b8a7a)
2018-01-12 16:35:25 +01:00
Zachary Ware 0ebf0ae6a2
Fix version in AppVeyor config (GH-5126) 2018-01-07 13:00:56 -06:00
Zachary Ware cd02003b9e
[2.7] Kill the AppVeyor file whitelist (GH-5123)
It's more trouble than it's worth, since AppVeyor only checks the HEAD commit of a PR rather than the full diff against the base branch to decide which files changed.
(cherry picked from commit 7f7de371f9)
2018-01-06 21:16:56 -06:00
Benjamin Peterson e13698172f
[2.7] advance copyright years to 2018 (GH-5094). (#5105)
(cherry picked from commit 65f2a6dcc2)
2018-01-04 23:02:11 -08:00
Serhiy Storchaka ca54740f25
[2.7] bpo-32211: Document the existing bug in re.findall() and re.finditer(). (GH-4695). (#5096)
(cherry picked from commit 1e6d8525f9)
2018-01-04 14:08:27 +02:00
Serhiy Storchaka 0bcba372bc
bpo-32482: Improve syntax and grammar tests. (#5085) 2018-01-04 10:36:14 +02:00
Benjamin Peterson eb08a9290f
coalesce GILless sections in new_buffersize (#5059)
830daae1c8 added some new GIL-releasing to new_buffersize. This is fine, but it's better to avoid reacquiring the GIL for as long as possible. Also, it should use FILE_(BEGIN|END)_ALLOW_THREADS to avoid having the file closed from under it.
2018-01-02 15:52:42 -08:00
Benjamin Peterson dbf52e02f1
bpo-31530: fix crash when multiple threads iterate over a file, round 2 (#5060)
Multiple threads iterating over a file can corrupt the file's internal readahead
buffer resulting in crashes. To fix this, cache buffer state thread-locally for
the duration of a file_iternext call and only update the file's internal state
after reading completes.

No attempt is made to define or provide "reasonable" semantics for iterating
over a file on multiple threads. (Non-crashing) races are still
present. Duplicated, corrupt, and missing data will happen.

This was originally fixed by 6401e56717, which
raised an exception from seek() and next() when concurrent operations were
detected. Alas, this simpler solution breaks legitimate use cases such as
capturing the standard streams when multiple threads are logging.
2018-01-02 09:25:41 -08:00
Miss Islington (bot) 0e0d1017a4 bpo-32452: clarify term 'brackets' in generator tutorial (GH-5079) (#5082)
Updates documentation for generator expressions in classes tutorial: Clarify usage of ambiguous term "brackets" by replacing with "square brackets". Updated subsequent lines to respect line breaks. (GH-5079)
(cherry picked from commit f190eb59e6)
2018-01-02 10:42:12 -05:00
Serhiy Storchaka b495377a8b
[2.7] bpo-32478: Add tests for 'break' and 'return' inside 'finally' clause. (GH-5078). (#5084)
(cherry picked from commit 7cc42c356b)
2018-01-02 10:56:40 +02:00
Miss Islington (bot) 2de47ca109 bpo-32416: Add two new tests in test_sys_settrace. (GH-5072) (#5074)
Move other test to more proper place.
(cherry picked from commit e8ed96550c)
2018-01-01 20:51:12 +02:00
Zachary Ware 4be7420d7c
[2.7] Add missing backslashes in PCbuild bat files (GH-5056) (GH-5058)
(cherry picked from commit fe90efdc07)
2017-12-30 18:34:46 -06:00
Segev Finer 3ceaed0dce bpo-18035: telnetlib: select.error doesn't have an errno attribute (#5044)
select.error doesn't have an errno attribute so access the errno by
indexing instead.
2017-12-29 12:44:04 -08:00
Benjamin Peterson 1f9d549a3b
[2.7] remove unused import (GH-5040). (#5043)
(cherry picked from commit e325608740)
2017-12-28 23:38:55 -08:00
Miss Islington (bot) 417f76a20e make PatternCompiler use the packaged grammar if possible (more bpo-24960) (GH-5034) (#5037)
(cherry picked from commit e5f7dccefa)
2017-12-28 18:05:07 -08:00
Serhiy Storchaka c60eca06ad
[2.7] bpo-32416: Refactor tests for the f_lineno setter and add new tests. (GH-4991). (#5017)
(cherry picked from commit 53f9135667)
2017-12-27 21:32:03 +02:00
Miss Islington (bot) 8b9995f2ae correct wording (GH-4983) (#4985)
(cherry picked from commit d11e8e0d11)
2017-12-22 21:49:49 -08:00
Benjamin Peterson 770a802df7
[2.7] bpo-24960: use pkgutil.get_data in lib2to3 to read pickled grammar files (GH-4977) (#4980)
This is more complicated than it should be because we need to preserve the
useful mtime-based regeneration feature that lib2to3.pgen2.driver.load_grammar
has. We only look for the pickled grammar file with pkgutil.get_data and only if
the source file does not exist..
(cherry picked from commit 8a5877165e)
2017-12-22 12:52:10 -08:00
Miss Islington (bot) e8ab7eb5c7 correct the typos (GH-4950) (#4952)
(cherry picked from commit 83cb778b4a)
2017-12-21 07:42:42 +02:00
Victor Stinner 2316c68640
pythoninfo: sync with master (#4843) 2017-12-13 23:23:40 +01:00
Miss Islington (bot) 3ff488c082 trivial: link updates in documentation (GH-2765) (#4836)
(cherry picked from commit 4f29f3c84b)
2017-12-13 14:45:13 +02:00
Miss Islington (bot) d663549a6a Fix improper use of re.escape() in tests. (GH-4814) (#4817)
(cherry picked from commit b748e3b258)
2017-12-12 20:49:18 +02:00
Steven Loria 3b9173d33a bpo-30806: Fix netrc.__repr__() format (GH-2491)
netrc file format doesn't support quotes and escapes.

See https://linux.die.net/man/5/netrc
2017-12-10 15:09:58 +09:00
Vinay Sajip 292fce9934
bpo-32212: Updated logging documentation to make parameter names more consistent with source. (GH-4765) (GH-4768)
(cherry picked from commit a9f8df646a)
2017-12-09 12:49:10 +00:00
Nir Soffer 830daae1c8 [2.7] bpo-32186: Release the GIL during fstat and lseek calls (#4651)
In fileio, there were 3 fstat() calls and one lseek() call that did not
release the GIL during the call. This can cause all threads to hang for
unlimited time when using io.FileIO with inaccessible NFS server.

Same issue seen in fileio exists also in fileobject, fixed in the same
way.
2017-12-07 21:25:39 +01:00
Mariatta 12fa6b1e2f
Add a missing space in tkinter documentation. (GH-4692). (GH-4723)
(cherry picked from commit ae342cf7de)
2017-12-04 21:15:57 -08:00
Serhiy Storchaka 65d1887170
[2.7] bpo-10544: Deprecate "yield" in comprehensions and generator expressions in Py3k mode. (GH-4579) (#4676) 2017-12-02 21:00:09 +02:00
Victor Stinner be6b74c079
bpo-20891: Fix PyGILState_Ensure() (#4650) (#4657)
When PyGILState_Ensure() is called in a non-Python thread before
PyEval_InitThreads(), only call PyEval_InitThreads() after calling
PyThreadState_New() to fix a crash.

(cherry picked from commit b4d1e1f7c1)
2017-11-30 23:35:14 +01:00
Victor Stinner 7d1cfeef64
make tags: index also Modules/_ctypes/ (#4648) (#4660)
Avoid also "cd $(srcdir)" to not change the current directory.

(cherry picked from commit 3be3b97a97)
2017-11-30 23:28:01 +01:00
Barry Warsaw 56e444f8df
[2.7] bpo-32107 - Backport bitmask check fix (GH-4576) (#4590)
Remove a flakey test and rewrite another one for readability.
2017-11-29 10:34:40 -05:00
Miss Islington (bot) bc19cf57a8 bpo-32139: test_strftime does not anymore modify the locale (GH-4569) (#4636)
(cherry picked from commit cc55e78aca)
2017-11-29 16:29:54 +01:00
Miss Islington (bot) fc73c54dae bpo-32110: codecs.StreamReader.read(n) now returns not more than n (GH-4499) (#4623)
characters/bytes for non-negative n.  This makes it compatible with
read() methods of other file-like objects.
(cherry picked from commit 219c2de5ad)
2017-11-29 02:15:43 +02:00
Victor Stinner 180372c08a
pythoninfo: add Py_DEBUG (#4198) (#4581)
(cherry picked from commit afd055a59f)
2017-11-27 10:44:50 +01:00
Zachary Ware be1faabeef
bpo-30855: Bump Tcl/Tk to 8.5.19 on Windows (GH-4550) 2017-11-26 11:55:46 -06:00
Miss Islington (bot) d6c6e586b4 Improve Scheduler Objects documentation. (GH-4556) (GH-4558)
Mention that the lower the priority number, the higher priority it represents.
(cherry picked from commit 9d5ec808de)
2017-11-24 21:49:10 -08:00
Miss Islington (bot) c02037d622 bpo-30004: Fix the code example of using group in Regex Howto Docs (GH-4443) (GH-4555)
The provided code example was supposed to find repeated words, however it returned false results.
(cherry picked from commit 610e5afdcb)
2017-11-24 21:01:39 -08:00
Miss Islington (bot) 465f3d0820 Improve the String tutorial docs (GH-4541) (GH-4546)
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.
(cherry picked from commit 78a5722ae9)
2017-11-24 09:35:53 -08:00
Miss Islington (bot) 66cdc84e40 Extending Python Doc minor updates (GH-4518) (GH-4536)
Move footnote markers to be closer to the related terminology:
before the end of the sentence, instead of after.
(cherry picked from commit cdfe910e74)
2017-11-24 00:55:33 -08:00
Victor Stinner ed4743a2f2
bpo-31626: Fix _PyObject_DebugReallocApi() (#4310)
_PyObject_DebugReallocApi() now calls Py_FatalError() if realloc()
fails to shrink a memory block.

Call Py_FatalError() because _PyObject_DebugReallocApi() erased freed
bytes *before* realloc(), expecting that realloc() *cannot* fail to
shrink a memory block.
2017-11-24 02:13:26 +01:00
Victor Stinner 35d99830f1
bpo-31324: Optimize support._match_test() (#4523) (#4524)
* bpo-31324: Optimize support._match_test() (#4421)

* Rename support._match_test() to support.match_test(): make it
  public
* Remove support.match_tests global variable. It is replaced with a
  new support.set_match_tests() function, so match_test() doesn't
  have to check each time if patterns were modified.
* Rewrite match_test(): use different code paths depending on the
  kind of patterns for best performances.

Co-Authored-By: Serhiy Storchaka <storchaka@gmail.com>
(cherry picked from commit 803ddd8ce2)

* bpo-31324: Fix test.support.set_match_tests(None) (#4505)

(cherry picked from commit bb11c3c967)
(cherry picked from commit 70b2f87971)
2017-11-23 18:34:59 +01:00
Victor Stinner 2d5890eda6
test_builtin: TestExecFile removes created file (#4525)
Fix the following warning:

Warning -- files was modified by test_builtin
  Before: []
  After:  ['@test_19422_tmp']
1 test altered the execution environment:
    test_builtin
2017-11-23 18:23:37 +01:00
Victor Stinner 448c673987
bpo-29512: Fix Lib/test/bisect.py shebang (#4522)
Replace python3 with python2.
2017-11-23 17:04:34 +01:00
Victor Stinner 733b5f3f2f
bpo-32050: Fix -x option documentation (#4423)
The line number in correct when using the -x option: Py_Main() uses
ungetc() to not skip the first newline character.
2017-11-20 07:08:44 -08:00
Masayuki Yamamoto aa9100567f Document parameters of BaseServer.finish_request() (GH-4445)
(cherry picked from commit 7750bded92)
2017-11-19 15:20:09 +03:00