Commit Graph

27484 Commits

Author SHA1 Message Date
Serhiy Storchaka b2742ba5f9
[2.7] bpo-34738: Add directory entries in ZIP files created by distutils. (GH-9419). (GH-10950)
(cherry picked from commit 67a93b3a0b)
2018-12-06 00:02:10 +02:00
Serhiy Storchaka abe74feb91
[2.7] bpo-35250: Correct argument name "num" -> "btn" in turtle docs. (GH-10565). (GH-10943)
(cherry picked from commit 4edeaeac4c)

Co-authored-by: Srinivas  Thatiparthy (శ్రీనివాస్  తాటిపర్తి) <thatiparthysreenivas@gmail.com>
2018-12-05 23:10:36 +02:00
Victor Stinner b50b33b4ac
bpo-10496: posixpath.expanduser() catchs pwd.getpwuid() error (GH-10919) (GH-10930)
* posixpath.expanduser() now returns the input path unchanged if
  the HOME environment variable is not set and pwd.getpwuid() raises
  KeyError (the current user identifier doesn't exist in the password
  database).
* Add test_no_home_directory() to test_site.

(cherry picked from commit f2f4555d82)
2018-12-05 21:56:24 +01:00
Miss Islington (bot) bacc272afc
bpo-34185: Fix test module collision in test_bdb when ran as script. (GH-8537)
When running test_bdb.py as a script, `import test_module` would be
importing the existing Lib/test/test_modules.py instead of the
tempcwd/test_module.py module which was dynamically created by
test_bdb.py itself.
(cherry picked from commit 54fd45505b)

Co-authored-by: Alex H <1884912+lajarre@users.noreply.github.com>
2018-12-05 12:04:57 -08:00
Miss Islington (bot) c7976da5c2
bpo-35411: Skip test_urllib2net FTP tests on Travis CI (GH-10907)
On Travis CI, FTP tests of test_urllib2net randomly fail with "425
Security: Bad IP connecting".

test.pythoninfo now also logs TRAVIS environment variable.
(cherry picked from commit c11b3b19a5)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-12-04 17:22:02 -08:00
Serhiy Storchaka 93d7918f77
[2.7] bpo-16865: Support arrays >=2GB in ctypes. (GH-3006). (GH-7441)
(cherry picked from commit 735abadd5b)

Co-Authored-By: Segev Finer <segev208@gmail.com>
2018-12-04 12:38:07 +02:00
Victor Stinner 8687bd86e6
bpo-26544: Make platform.libc_ver() less slow (GH-10868)
Coarse benchmark on Fedora 29: 1.6 sec => 0.1 sec.

Co-Authored-By: Antoine Pitrou <solipsis@pitrou.net>

(cherry-picked from commit ba7c226095)
2018-12-03 16:49:24 +01:00
Victor Stinner 2212ee2bee
Replace 1/0 with 1//0 in tests to avoid Python 3 warns (GH-10833)
Fix DeprecationWarning when tests are run using python -3.
2018-11-30 20:45:04 +01:00
Victor Stinner dab59fa560
bpo-35347: Fix test_socket.NonBlockingTCPTests (GH-10791) (GH-10817)
testAccept() and testRecv() of test_socket.NonBlockingTCPTests have a
race condition: time.sleep() is used as a weak synchronization
primitive and the tests fail randomly on slow buildbots.

Use a reliable threading.Event to fix these tests.

Other changes:

* Replace send() with sendall()
* Add a timeout to select() in testAccept() and testRecv()
* Use addCleanup() to close sockets
* Use assertRaises()

(cherry picked from commit ebd5d6d6e6)
2018-11-30 13:02:41 +01:00
Victor Stinner d7a880c3c2
Fix DeprecationWarning in test_bytes (GH-10805)
Running test_bytes with python -3 -Wd emits two DeprecationWarning on
"1/0". Use "1//0" to prevent the warning.
2018-11-30 11:04:42 +01:00
Victor Stinner f681e93e46
bpo-34021: Windows skips test_regrtest.test_env_changed() (GH-10804)
On Windows, test_env_changed() of test_regrtest is now skipped
because it fails  randomly for an unknown reason on "x86 Windows XP
VS9.0 2.7" buildbot worker.
2018-11-29 23:38:35 +01:00
Victor Stinner 36003003f2
bpo-34279, regrtest: Issue a warning if no tests have been executed (GH-10801)
Co-Authored-By: Pablo Galindo <Pablogsal@gmail.com>
2018-11-29 21:14:42 +01:00
Victor Stinner 22338f3f8b
pythoninfo: log more environment variable (GH-10719) (GH-10774)
Log TZ to debug a timezone issue... and a few more :-)

(cherry picked from commit 282c03d45d)
2018-11-28 21:12:54 +01:00
Serhiy Storchaka 40fdf47193
[2.7] bpo-35021: Fix assertion failures in _datetimemodule.c. (GH-10039) (GH-10617)
Fixes assertion failures in _datetimemodule.c
introduced in the previous fix (see bpo-31752).

Rather of trying to handle an int subclass as exact int,
let it to use overridden special methods, but check the
result of divmod().
(cherry picked from commit 3ec0f49516)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-11-20 21:56:34 +02:00
Miss Islington (bot) 4845aa6ef8 Upgrade pip to 18.1 and setuptools to 40.6.2 (GH-10598)
(cherry picked from commit 8b9c33ea9c)

Co-authored-by: Donald Stufft <donald@stufft.io>
2018-11-19 08:07:58 -05:00
Miss Islington (bot) ffbce43c1a
closes bpo-35171: Fix test_TimeRE_recreation_timezone failure on some systems. (GH-10347)
The test depended on '/usr/share/zoneinfo/posixrules' or equivalent
because it set TZ without explicit DST transition rules. At least
on OpenSUSE Tumbleweed that file is linked to '/etc/localtime',
making the test fail with certain local timezones,
such as 'Europe/Moscow' which doesn't have DST transitions since 2011.
(cherry picked from commit f1b9ad3d38)

Co-authored-by: Alexey Izbyshev <izbyshev@ispras.ru>
2018-11-05 20:59:07 -08:00
Serhiy Storchaka 3e3e1a27f7
[2.7] bpo-35133: Fix mistakes when concatenate string literals on different lines. (GH-10284) (GH-10335) (GH-10336)
Two kind of mistakes:

1. Missed space. After concatenating there is no space between words.

2. Missed comma. Causes unintentional concatenating in a list of strings.
(cherry picked from commit 34fd4c2019)
(cherry picked from commit 7054e5c80b)
2018-11-05 18:16:26 +02:00
Miss Islington (bot) 05acd44ad6
bpo-35062: Fix parsing _io.IncrementalNewlineDecoder's *translate* argument. (GH-10217)
_io.IncrementalNewlineDecoder's initializer possibly assigns out-of-range
value to the bitwise struct field.
(cherry picked from commit b08746bfdf)

Co-authored-by: Xiang Zhang <angwerzx@126.com>
2018-10-31 05:37:06 -07:00
matthewbelisle-wf bc6f74a520 bpo-34866: Add max_num_fields to cgi.FieldStorage (GH-9660) (GH-9969)
Adding `max_num_fields` to `cgi.FieldStorage` to make DOS attacks harder by
limiting the number of `MiniFieldStorage` objects created by `FieldStorage`.

(cherry picked from commit 209144831b)
2018-10-30 22:16:26 +01:00
Serhiy Storchaka 41c7f973b6
[2.7] Fix checking for bugfix Tcl version. (GH-10185). (GH-10188)
(cherry picked from commit 18d57b4d62)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-10-28 20:56:30 +02:00
Denis Ledoux 6f97a50c86 bpo-35017, socketserver: don't accept request after shutdown (GH-9952) (GH-10129)
Prior to this revision, after the shutdown of a `BaseServer`,
the server accepted a last single request
if it was sent between the server socket polling
and the polling timeout.

This can be problematic for instance for a server restart
for which you do not want to interrupt the service,
by not closing the listening socket during the restart.
One request failed because of this behavior.

Note that only one request failed,
following requests were not accepted, as expected.

(cherry picked from commit 10cb3760e8)
2018-10-26 17:15:22 +02:00
Zsolt Cserna 4a59c9699c [2.7] bpo-34260, shutil: fix copy2 and copystat documentation (GH-8523) (GH-10071)
Fix the documentation of copy2, as it does not copy file ownership (user and
group), only mode, mtime, atime and flags.

The original text was confusing to developers as it suggested that this
command is the same as 'cp -p', but according to cp(1), '-p' copies file
ownership as well.

Clarify which metadata is copied by shutil.copystat in its docstring.

(cherry picked from commit 4f399be0e7)
2018-10-24 23:22:27 +02:00
Tal Einat a1f45ec73f bpo-33899: Revert tokenize module adding an implicit final NEWLINE (GH-10072)
This reverts commit 7829bba.
2018-10-24 10:32:21 -07:00
Serhiy Storchaka 427b8c7f7d
[2.7] bpo-34936: Fix TclError in tkinter.Spinbox.selection_element(). (GH-9760) (GH-9957) (GH-9968)
(cherry picked from commit 1deea5e539).
(cherry picked from commit bd9c2ce7ac)

Co-authored-by: Juliette Monsel <j4321@users.noreply.github.com>
2018-10-21 10:10:24 +03:00
Terry Jan Reedy f125d788ff
bpo-31500: Default fonts now are scaled on HiDPI displays. (#10015)
[2.7] bpo-31500: Add idlelib news items about HiDPI scaling
2018-10-20 19:34:12 -04:00
Cheryl Sabella 18c44cc0c1 [2.7] bpo-31500: IDLE: Scale default fonts on HiDPI displays. (GH-3639) (GH-6585)
(cherry picked from commit a96c96f5da)
2018-10-20 16:27:51 -04:00
Miss Islington (bot) 2546ac8eeb bpo-34791: xml package obeys ignore env flags (GH-9544) (GH-9547)
The xml.sax and xml.dom.domreg modules now obey
sys.flags.ignore_environment.

Signed-off-by: Christian Heimes <christian@python.org>

https://bugs.python.org/issue34791
(cherry picked from commit 223e501fb9)

Co-authored-by: Christian Heimes <christian@python.org>
2018-10-20 01:09:35 +02:00
Stéphane Wirtel 6e57382464 [2.7] bpo-23420: Verify the value of '-s' when execute the CLI of cProfile (GH-9925) (GH-9928)
Verify the value for the parameter '-s' of the cProfile CLI. Patch by Robert
Kuska.

Co-authored-by: Robert Kuska <rkuska@gmail.com>
(cherry picked from commit fcd5e84a51)





https://bugs.python.org/issue23420
2018-10-17 04:51:28 -07:00
Zackery Spytz f5e00f490a [2.7] bpo-16965: 2to3 now rewrites execfile() to open with rb. (GH-8569) (GH-9890)
(cherry picked from commit d4d60134b2)
2018-10-16 08:46:35 +03:00
Serhiy Storchaka 43308dfc33
[2.7] bpo-34974: Do not replace unexpected errors in bytearray(). (GH-9852) (GH-9885)
The bytearray constructor converted unexpected exceptions
(e.g. MemoryError and KeyboardInterrupt) to TypeError.
(cherry picked from commit e890421e33)
2018-10-15 08:46:16 +03:00
Serhiy Storchaka 8ba72674bd
[2.7] Add new tests for bytes and bytearray constructors. (GH-9843) (#9866)
Covered all special cases: bytes, tuple, list, differend
kinds of iterables and iterators.
(cherry picked from commit 1a997eb291)
2018-10-14 13:07:54 +03:00
Zackery Spytz 68ddb59417 [2.7] bpo-22851: Fix a segfault when accessing generator.gi_frame.f_restricted. (GH-9348)
Frame's field f_tstate is NULL when the generator is exhausted.
2018-10-13 12:25:05 +03:00
Victor Stinner b274f1ce5c
bpo-32962: Fix test_gdb failure in debug build with -mcet -fcf-protection -O0 (GH-9656) (GH-9788)
When Python is built with the intel control-flow protection flags,
-mcet -fcf-protection, gdb is not able to read the stack without
actually jumping inside the function. This means an extra
'next' command is required to make the $pc (program counter)
enter the function and make the stack of the function exposed to gdb.

test_gdb: get_gdb_repr() now uses the "backtrace 1" command after
breakpoint, as in the master branch.

Co-Authored-By: Marcel Plch <gmarcel.plch@gmail.com>

(cherry picked from commit 9b7c74ca32)
(cherry picked from commit 79d21331e6)
2018-10-10 12:54:04 +02:00
tzickel 4a7dd30f58 [2.7] bpo-34172: multiprocessing.Pool leaks resources after being deleted (GH-9686)
Fix a reference issue inside multiprocessing.Pool that caused the pool to remain alive if it was deleted without being closed or terminated explicitly.
2018-10-03 13:50:04 +02:00
Terry Jan Reedy 65fa1264a3
[2.7] bpo-34162: Update 2.7 idlelib/NEWS.txt to 2018-9-24 (GH-9550) 2018-09-24 19:43:54 -04:00
Serhiy Storchaka 69d0bc1430
[2.7] bpo-34610: Fixed iterator of multiprocessing.managers.DictProxy. (GH-9113). (GH-9500)
(cherry picked from commit e0e5065dae)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-09-22 21:34:16 +03:00
Serhiy Storchaka 6ec2981148
[2.7] bpo-34472: Add data descriptor signature to zipfile (GH-8871) (ПР-9407)
This makes streamed zips compatible with MacOS Archive Utility and
other applications.
(cherry picked from commit 4ba3b50bfe)

Co-authored-by: Silas Sewell <silas@sewell.org>
2018-09-22 20:48:23 +03:00
Miss Islington (bot) fef3a92be9
Fix pickletools doc for NEWFALSE. (GH-9432)
Also make docs for NEWFALSE and NEWTRUE more consistent
with docs for other opcodes.
(cherry picked from commit 488cfb78c8)

Co-authored-by: Krzysztof Wroblewski <krzysiek.wr@gmail.com>
2018-09-22 08:38:57 -07:00
Miss Islington (bot) 170ea8ccd4
bpo-19756: Prevent test failures due to EADDRNOTAVAIL (GH-9446)
(cherry picked from commit 8213eaddf3)

Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
2018-09-20 09:06:04 -07:00
Christian Heimes 49d65958e1 [2.7] bpo-34542: Update test certs and keys (GH-8997) (GH-9397)
Update all test certs and keys to use future proof crypto settings:

* 3072 bit RSA keys
* SHA-256 signature

Signed-off-by: Christian Heimes <christian@python.org>.
(cherry picked from commit e6dac00779)



https://bugs.python.org/issue34542
2018-09-20 03:33:53 -07:00
Vladimir Matveev b63a16febb [2.7] bpo-34603, ctypes/libffi_msvc: Fix returning structs from functions (GH-9258) (GH-9425)
Co-authored-by: Vladimir Matveev <v2matveev@outlook.com>
2018-09-19 13:48:21 -07:00
Serhiy Storchaka 29034baf58
[2.7] bpo-34341: Fix appending to ZIP archives with the ZIP64 extension. (GH-8683). (GH-9400)
(cherry picked from commit 9bdb7be482)
2018-09-18 23:28:34 +03:00
xdegaye 57e70d3802 [2.7] bpo-19417: Add test_bdb.py (GH-5217) (GH-6156)
(cherry picked from commit 3fe33043ee)



https://bugs.python.org/issue19417
2018-09-15 23:09:14 -07:00
Shoham Peller ee78ba2c81 [2.7] closes bpo-8450: a better error message when http status line isn't received (GH-2825)
When the server has closed the connection before sending a status-line,
the client's error message should have a more descriptive error message

https://bugs.python.org/issue8450


https://bugs.python.org/issue8450
2018-09-14 16:28:08 -07:00
Benjamin Peterson 18e21883a4
[2.7] closes bpo-34661: Fix test_shutil if unzip doesn't support -t. (GH-9267)
(cherry picked from commit a710ebd21b)
2018-09-13 11:24:07 -07:00
Chih-Hsuan Yen d919c60e69 [2.7] bpo-32502: Discard 64-bit (and other invalid) hardware addresses (GH-9125)
(cherry picked from commit 6b273f7f40)

Co-authored-by: Bo Bayles <bbayles@gmail.com>
2018-09-11 13:54:57 -07:00
Benjamin Peterson 253279c616
[2.7] closes bpo-31608: Fix a crash in methods of a subclass of _collections.deque with a bad __new__(). (GH-9179) 2018-09-11 13:41:57 -07:00
Miss Islington (bot) 9734024ec6 bpo-26544: Get rid of dependence from distutils in platform. (GH-8356) (GH-8952)
(cherry picked from commit 7d81e8f599)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-09-05 16:46:26 +02:00
Victor Stinner 7056ca880b
bpo-34530: Fix distutils find_executable() (GH-9049) (GH-9058)
distutils.spawn.find_executable() now falls back on os.defpath if the
PATH environment variable is not set.

(cherry picked from commit 39487196c8)
2018-09-04 11:40:29 +02:00
Miss Islington (bot) 5d594f3106
bpo-34007: Skip traceback tests if the Program Counter is not available. (GH-9018)
Sometimes some versions of the shared libraries that are part of the
traceback are compiled in optimised mode and the Program Counter (PC)
is not present, not allowing gdb to walk the frames back. When this
happens, the Python bindings of gdb raise an exception, making the
test impossible to succeed.
(cherry picked from commit f2ef51f8be)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2018-08-31 18:43:24 -04:00