Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c8a752e

Browse files
committed
merge heads
2 parents 0897a55 + da8ea3a commit c8a752e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+2221
-1278
lines changed

.hgeol

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ Lib/test/cjkencodings/* = BIN
3636
Lib/test/decimaltestdata/*.decTest = BIN
3737
Lib/test/sndhdrdata/sndhdr.* = BIN
3838

39+
# Windows only zlib upstream file
40+
Modules/zlib/zlib.map = CRLF
41+
3942
# Windows batch files work best with CRLF, there can be subtle problems with LF
4043
**.bat = CRLF
4144

Doc/library/random.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -71,17 +71,17 @@ from sources provided by the operating system.
7171
Bookkeeping functions:
7272

7373

74-
.. function:: seed([x])
74+
.. function:: seed(a=None)
7575

76-
Initialize the basic random number generator. Optional argument *x* can be any
77-
:term:`hashable` object. If *x* is omitted or ``None``, current system time is used;
78-
current system time is also used to initialize the generator when the module is
79-
first imported. If randomness sources are provided by the operating system,
80-
they are used instead of the system time (see the :func:`os.urandom` function
81-
for details on availability).
76+
Initialize internal state of the random number generator.
8277

83-
If a :term:`hashable` object is given, deterministic results are only assured
84-
when :envvar:`PYTHONHASHSEED` is disabled.
78+
``None`` or no argument seeds from current time or from an operating
79+
system specific randomness source if available (see the :func:`os.urandom`
80+
function for details on availability).
81+
82+
If *a* is not ``None`` or an :class:`int` or a :class:`long`, then
83+
``hash(a)`` is used instead. Note that the hash values for some types
84+
are nondeterministic when :envvar:`PYTHONHASHSEED` is enabled.
8585

8686
.. versionchanged:: 2.4
8787
formerly, operating system resources were not used.

Doc/library/urllib.rst

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -415,18 +415,18 @@ URL Opener objects
415415
users for the required information on the controlling terminal. A subclass may
416416
override this method to support more appropriate behavior if needed.
417417

418-
The :class:`FancyURLopener` class offers one additional method that should be
419-
overloaded to provide the appropriate behavior:
418+
The :class:`FancyURLopener` class offers one additional method that should be
419+
overloaded to provide the appropriate behavior:
420420

421-
.. method:: prompt_user_passwd(host, realm)
421+
.. method:: prompt_user_passwd(host, realm)
422422

423-
Return information needed to authenticate the user at the given host in the
424-
specified security realm. The return value should be a tuple, ``(user,
425-
password)``, which can be used for basic authentication.
423+
Return information needed to authenticate the user at the given host in the
424+
specified security realm. The return value should be a tuple, ``(user,
425+
password)``, which can be used for basic authentication.
426426

427-
The implementation prompts for this information on the terminal; an application
428-
should override this method to use an appropriate interaction model in the local
429-
environment.
427+
The implementation prompts for this information on the terminal; an application
428+
should override this method to use an appropriate interaction model in the local
429+
environment.
430430

431431
.. exception:: ContentTooShortError(msg[, content])
432432

Doc/library/uuid.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ random UUID.
104104
.. attribute:: UUID.variant
105105

106106
The UUID variant, which determines the internal layout of the UUID. This will be
107-
one of the integer constants :const:`RESERVED_NCS`, :const:`RFC_4122`,
107+
one of the constants :const:`RESERVED_NCS`, :const:`RFC_4122`,
108108
:const:`RESERVED_MICROSOFT`, or :const:`RESERVED_FUTURE`.
109109

110110

Lib/random.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,12 +98,14 @@ def __init__(self, x=None):
9898
self.gauss_next = None
9999

100100
def seed(self, a=None):
101-
"""Initialize internal state from hashable object.
101+
"""Initialize internal state of the random number generator.
102102
103103
None or no argument seeds from current time or from an operating
104104
system specific randomness source if available.
105105
106-
If a is not None or an int or long, hash(a) is used instead.
106+
If a is not None or is an int or long, hash(a) is used instead.
107+
Hash values for some types are nondeterministic when the
108+
PYTHONHASHSEED environment variable is enabled.
107109
"""
108110

109111
if a is None:

Lib/test/test_curses.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -240,7 +240,7 @@ def test_module_funcs(self):
240240
# Functions only available on a few platforms
241241
def test_colors_funcs(self):
242242
if not curses.has_colors():
243-
self.skip('requires colors support')
243+
self.skipTest('requires colors support')
244244
curses.start_color()
245245
curses.init_pair(2, 1,1)
246246
curses.color_content(1)
@@ -263,7 +263,7 @@ def test_has_key(self):
263263
def test_getmouse(self):
264264
(availmask, oldmask) = curses.mousemask(curses.BUTTON1_PRESSED)
265265
if availmask == 0:
266-
self.skip('mouse stuff not available')
266+
self.skipTest('mouse stuff not available')
267267
curses.mouseinterval(10)
268268
# just verify these don't cause errors
269269
curses.ungetmouse(0, 0, 0, 0, curses.BUTTON1_PRESSED)

Lib/test/test_urllib.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,12 @@ def test_proxy_cgi_ignore(self):
185185
def test_proxy_bypass_environment_host_match(self):
186186
bypass = urllib.proxy_bypass_environment
187187
self.env.set('NO_PROXY',
188-
'localhost, anotherdomain.com, newdomain.com:1234')
188+
'localhost, anotherdomain.com, newdomain.com:1234, .d.o.t')
189189
self.assertTrue(bypass('localhost'))
190190
self.assertTrue(bypass('LocalHost')) # MixedCase
191191
self.assertTrue(bypass('LOCALHOST')) # UPPERCASE
192192
self.assertTrue(bypass('newdomain.com:1234'))
193+
self.assertTrue(bypass('foo.d.o.t')) # issue 29142
193194
self.assertTrue(bypass('anotherdomain.com:8888'))
194195
self.assertTrue(bypass('www.newdomain.com:1234'))
195196
self.assertFalse(bypass('prelocalhost'))

Lib/urllib.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1427,6 +1427,7 @@ def proxy_bypass_environment(host, proxies=None):
14271427
no_proxy_list = [proxy.strip() for proxy in no_proxy.split(',')]
14281428
for name in no_proxy_list:
14291429
if name:
1430+
name = name.lstrip('.') # ignore leading dots
14301431
name = re.escape(name)
14311432
pattern = r'(.+\.)?%s$' % name
14321433
if (re.match(pattern, hostonly, re.I)

Misc/ACKS

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1548,6 +1548,7 @@ Robert Xiao
15481548
Florent Xicluna
15491549
Alakshendra Yadav
15501550
Hirokazu Yamamoto
1551+
Masayuki Yamamoto
15511552
Ka-Ping Yee
15521553
Jason Yeo
15531554
EungJun Yi
@@ -1574,4 +1575,4 @@ Tarek Ziadé
15741575
Jelle Zijlstra
15751576
Gennadiy Zlobin
15761577
Peter Åstrand
1577-
Dhushyanth Ramasamy
1578+
Dhushyanth Ramasamy

Misc/NEWS

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,31 @@ What's New in Python 2.7.14?
1010
Core and Builtins
1111
-----------------
1212

13+
- Issue #29145: Fix overflow checks in string, bytearray and unicode.
14+
Patch by jan matejek and Xiang Zhang.
15+
1316
- Issue #28932: Do not include <sys/random.h> if it does not exist.
1417

18+
Extension Modules
19+
-----------------
20+
21+
- Issue #29169: Update zlib to 1.2.10.
22+
1523
Library
1624
-------
1725

1826
- Issue #29006: Revert change from issue #10513 for making sqlite more liable to
1927
emit "database table is locked" errors.
2028

29+
- Issue #29188: Support glibc 2.24 on Linux: don't use getentropy() function
30+
but read from /dev/urandom to get random bytes, for example in os.urandom().
31+
On Linux, getentropy() is implemented which getrandom() is blocking mode,
32+
whereas os.urandom() should not block.
33+
34+
- Issue #29142: In urllib, suffixes in no_proxy environment variable with
35+
leading dots could match related hostnames again (e.g. .b.c matches a.b.c).
36+
Patch by Milan Oberkirch.
37+
2138
- Issue #29094: Offsets in a ZIP file created with extern file object and mode
2239
"w" now are relative to the start of the file.
2340

@@ -45,6 +62,12 @@ Library
4562
- Issue #28925: cPickle now correctly propagates errors when unpickle instances
4663
of old-style classes.
4764

65+
Build
66+
-----
67+
68+
- Issue #28768: Fix implicit declaration of function _setmode. Patch by
69+
Masayuki Yamamoto
70+
4871

4972
What's New in Python 2.7.13
5073
===========================

Modules/_io/fileio.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
#ifdef HAVE_SYS_STAT_H
99
#include <sys/stat.h>
1010
#endif
11+
#ifdef HAVE_IO_H
12+
#include <io.h>
13+
#endif
1114
#ifdef HAVE_FCNTL_H
1215
#include <fcntl.h>
1316
#endif

Modules/_json.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2077,8 +2077,11 @@ encoder_listencode_obj(PyEncoderObject *s, PyObject *rval, PyObject *obj, Py_ssi
20772077
return -1;
20782078
}
20792079

2080-
if (Py_EnterRecursiveCall(" while encoding a JSON object"))
2080+
if (Py_EnterRecursiveCall(" while encoding a JSON object")) {
2081+
Py_DECREF(newobj);
2082+
Py_XDECREF(ident);
20812083
return -1;
2084+
}
20822085
rv = encoder_listencode_obj(s, rval, newobj, indent_level);
20832086
Py_LeaveRecursiveCall();
20842087

Modules/main.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
#endif
1111

1212
#if defined(MS_WINDOWS) || defined(__CYGWIN__)
13+
#ifdef HAVE_IO_H
14+
#include <io.h>
15+
#endif
1316
#ifdef HAVE_FCNTL_H
1417
#include <fcntl.h>
1518
#endif

Modules/zlib/ChangeLog

Lines changed: 45 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,49 @@
11

22
ChangeLog file for zlib
33

4+
Changes in 1.2.10 (2 Jan 2017)
5+
- Avoid warnings on snprintf() return value
6+
- Fix bug in deflate_stored() for zero-length input
7+
- Fix bug in gzwrite.c that produced corrupt gzip files
8+
- Remove files to be installed before copying them in Makefile.in
9+
- Add warnings when compiling with assembler code
10+
11+
Changes in 1.2.9 (31 Dec 2016)
12+
- Fix contrib/minizip to permit unzipping with desktop API [Zouzou]
13+
- Improve contrib/blast to return unused bytes
14+
- Assure that gzoffset() is correct when appending
15+
- Improve compress() and uncompress() to support large lengths
16+
- Fix bug in test/example.c where error code not saved
17+
- Remedy Coverity warning [Randers-Pehrson]
18+
- Improve speed of gzprintf() in transparent mode
19+
- Fix inflateInit2() bug when windowBits is 16 or 32
20+
- Change DEBUG macro to ZLIB_DEBUG
21+
- Avoid uninitialized access by gzclose_w()
22+
- Allow building zlib outside of the source directory
23+
- Fix bug that accepted invalid zlib header when windowBits is zero
24+
- Fix gzseek() problem on MinGW due to buggy _lseeki64 there
25+
- Loop on write() calls in gzwrite.c in case of non-blocking I/O
26+
- Add --warn (-w) option to ./configure for more compiler warnings
27+
- Reject a window size of 256 bytes if not using the zlib wrapper
28+
- Fix bug when level 0 used with Z_HUFFMAN or Z_RLE
29+
- Add --debug (-d) option to ./configure to define ZLIB_DEBUG
30+
- Fix bugs in creating a very large gzip header
31+
- Add uncompress2() function, which returns the input size used
32+
- Assure that deflateParams() will not switch functions mid-block
33+
- Dramatically speed up deflation for level 0 (storing)
34+
- Add gzfread(), duplicating the interface of fread()
35+
- Add gzfwrite(), duplicating the interface of fwrite()
36+
- Add deflateGetDictionary() function
37+
- Use snprintf() for later versions of Microsoft C
38+
- Fix *Init macros to use z_ prefix when requested
39+
- Replace as400 with os400 for OS/400 support [Monnerat]
40+
- Add crc32_z() and adler32_z() functions with size_t lengths
41+
- Update Visual Studio project files [AraHaan]
42+
443
Changes in 1.2.8 (28 Apr 2013)
544
- Update contrib/minizip/iowin32.c for Windows RT [Vollant]
645
- Do not force Z_CONST for C++
7-
- Clean up contrib/vstudio [Ro�]
46+
- Clean up contrib/vstudio [Roß]
847
- Correct spelling error in zlib.h
948
- Fix mixed line endings in contrib/vstudio
1049

@@ -34,7 +73,7 @@ Changes in 1.2.7.1 (24 Mar 2013)
3473
- Clean up the usage of z_const and respect const usage within zlib
3574
- Clean up examples/gzlog.[ch] comparisons of different types
3675
- Avoid shift equal to bits in type (caused endless loop)
37-
- Fix unintialized value bug in gzputc() introduced by const patches
76+
- Fix uninitialized value bug in gzputc() introduced by const patches
3877
- Fix memory allocation error in examples/zran.c [Nor]
3978
- Fix bug where gzopen(), gzclose() would write an empty file
4079
- Fix bug in gzclose() when gzwrite() runs out of memory
@@ -194,7 +233,7 @@ Changes in 1.2.5.2 (17 Dec 2011)
194233
- Add a transparent write mode to gzopen() when 'T' is in the mode
195234
- Update python link in zlib man page
196235
- Get inffixed.h and MAKEFIXED result to match
197-
- Add a ./config --solo option to make zlib subset with no libary use
236+
- Add a ./config --solo option to make zlib subset with no library use
198237
- Add undocumented inflateResetKeep() function for CAB file decoding
199238
- Add --cover option to ./configure for gcc coverage testing
200239
- Add #define ZLIB_CONST option to use const in the z_stream interface
@@ -564,7 +603,7 @@ Changes in 1.2.3.1 (16 August 2006)
564603
- Update make_vms.com [Zinser]
565604
- Use -fPIC for shared build in configure [Teredesai, Nicholson]
566605
- Use only major version number for libz.so on IRIX and OSF1 [Reinholdtsen]
567-
- Use fdopen() (not _fdopen()) for Interix in zutil.h [B�ck]
606+
- Use fdopen() (not _fdopen()) for Interix in zutil.h [Bäck]
568607
- Add some FAQ entries about the contrib directory
569608
- Update the MVS question in the FAQ
570609
- Avoid extraneous reads after EOF in gzio.c [Brown]
@@ -1178,7 +1217,7 @@ Changes in 1.0.6 (19 Jan 1998)
11781217
386 asm code replacing longest_match().
11791218
contrib/iostream/ by Kevin Ruland <[email protected]>
11801219
A C++ I/O streams interface to the zlib gz* functions
1181-
contrib/iostream2/ by Tyge L�vset <[email protected]>
1220+
contrib/iostream2/ by Tyge Løvset <[email protected]>
11821221
Another C++ I/O streams interface
11831222
contrib/untgz/ by "Pedro A. Aranda Guti\irrez" <[email protected]>
11841223
A very simple tar.gz file extractor using zlib
@@ -1267,7 +1306,7 @@ Changes in 1.0.1 (20 May 96) [1.0 skipped to avoid confusion]
12671306
- fix array overlay in deflate.c which sometimes caused bad compressed data
12681307
- fix inflate bug with empty stored block
12691308
- fix MSDOS medium model which was broken in 0.99
1270-
- fix deflateParams() which could generated bad compressed data.
1309+
- fix deflateParams() which could generate bad compressed data.
12711310
- Bytef is define'd instead of typedef'ed (work around Borland bug)
12721311
- added an INDEX file
12731312
- new makefiles for DJGPP (Makefile.dj2), 32-bit Borland (Makefile.b32),

0 commit comments

Comments
 (0)