Skip to content

Commit 6b8341c

Browse files
committed
Merge branch 'v0.15.x'
2 parents c59ebb8 + 9f60ee0 commit 6b8341c

11 files changed

+1453
-17
lines changed

README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ Features
4242
- ``past.translation`` package supports transparent translation of Python 2
4343
modules to Python 3 upon import. [This feature is currently in alpha.]
4444

45-
- 920+ unit tests, including many from the Py3.3 source tree.
45+
- 1000+ unit tests, including many from the Py3.3 source tree.
4646

4747
- ``futurize`` and ``pasteurize`` scripts based on ``2to3`` and parts of
4848
``3to2`` and ``python-modernize``, for automatic conversion from either Py2

docs/compatible_idioms.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1373,7 +1373,7 @@ Tkinter
13731373
import tkinter
13741374
import tkinter.dialog
13751375
import tkinter.filedialog
1376-
import tkinter.scolledtext
1376+
import tkinter.scrolledtext
13771377
import tkinter.simpledialog
13781378
import tkinter.tix
13791379
import tkinter.constants

docs/faq.rst

+4-4
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,13 @@ How well has it been tested?
123123
currently being used to help with porting 800,000 lines of Python 2 code in
124124
`Sage <http://sagemath.org>`_ to Python 2/3.
125125

126-
Currently ``python-future`` has 990+ unit tests. Many of these are straight
126+
Currently ``python-future`` has over 1000 unit tests. Many of these are straight
127127
from the Python 3.3 and 3.4 test suites.
128128

129129
In general, the ``future`` package itself is in good shape, whereas the
130-
``futurize`` script for automatic porting is incomplete and imperfect.
131-
(Chances are it will require some manual cleanup afterwards.) The ``past``
132-
package also needs to be expanded.
130+
``futurize`` script for automatic porting is imperfect; chances are it will
131+
require some manual cleanup afterwards. The ``past`` package also needs to be
132+
expanded.
133133

134134

135135
Is the API stable?

docs/notebooks/Writing Python 2-3 compatible code.ipynb

+1-1
Original file line numberDiff line numberDiff line change
@@ -2950,7 +2950,7 @@
29502950
"import tkinter\n",
29512951
"import tkinter.dialog\n",
29522952
"import tkinter.filedialog\n",
2953-
"import tkinter.scolledtext\n",
2953+
"import tkinter.scrolledtext\n",
29542954
"import tkinter.simpledialog\n",
29552955
"import tkinter.tix\n",
29562956
"import tkinter.constants\n",

docs/standard_library_imports.rst

+7-1
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,16 @@ follows::
116116
import test.support
117117

118118

119-
The newly exposed ``urllib`` submodules are full backports of those from Py3.x.
119+
The newly exposed ``urllib`` submodules are backports of those from Py3.x.
120120
This means, for example, that ``urllib.parse.unquote()`` now exists and takes
121121
an optional ``encoding`` argument on Py2.x as it does on Py3.x.
122122

123+
**Limitation:** Note that the ``http``-based backports do not currently support
124+
HTTPS (as of 2015-09-11) because the SSL support changed considerably in Python
125+
3.x. If you need HTTPS support, please use this idiom for now::
126+
127+
from future.moves.urllib.request import urlopen
128+
123129
Backports also exist of the following features from Python 3.4:
124130

125131
- ``math.ceil`` returns an int on Py3

docs/whatsnew.rst

+11-1
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,22 @@ What's New
55

66
.. _whats-new-0.15.x:
77

8+
What's new in version 0.15.2 (2015-09-11)
9+
=========================================
10+
11+
This is a minor bug-fix release:
12+
13+
- Fix ``socket.create_connection()`` backport on Py2.6 (issue #162)
14+
- Add more tests of ``urllib.request`` etc.
15+
- Fix ``newsuper()`` calls from the ``__init__`` method of PyQt subclassses
16+
(issue #160, thanks to Christopher Arndt)
17+
818
What's new in version 0.15.1 (2015-09-09)
919
=========================================
1020

1121
This is a minor bug-fix release:
1222

13-
- Use 3-argument socket.create_connection() backport to restore Py2.6
23+
- Use 3-argument ``socket.create_connection()`` backport to restore Py2.6
1424
compatibility in ``urllib.request.urlopen()`` (issue #162)
1525
- Remove breakpoint in ``future.backports.http.client`` triggered on certain
1626
data (issue #164)

src/future/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
__copyright__ = 'Copyright 2013-2015 Python Charmers Pty Ltd'
8989
__ver_major__ = 0
9090
__ver_minor__ = 15
91-
__ver_patch__ = 1
91+
__ver_patch__ = 2
9292
__ver_sub__ = ''
9393
__version__ = "%d.%d.%d%s" % (__ver_major__, __ver_minor__,
9494
__ver_patch__, __ver_sub__)

src/future/backports/misc.py

+13-5
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
import heapq as _heapq
2222
from _weakref import proxy as _proxy
2323
from itertools import repeat as _repeat, chain as _chain, starmap as _starmap
24-
24+
from socket import getaddrinfo, SOCK_STREAM, error, socket
2525

2626
from future.utils import iteritems, itervalues, PY26, PY3
2727

@@ -39,10 +39,18 @@ def ceil(x):
3939
########################################################################
4040

4141
from itertools import islice
42-
try:
43-
from _thread import get_ident
44-
except ImportError:
45-
from _dummy_thread import get_ident
42+
43+
if PY3:
44+
try:
45+
from _thread import get_ident
46+
except ImportError:
47+
from _dummy_thread import get_ident
48+
else:
49+
try:
50+
from thread import get_ident
51+
except ImportError:
52+
from dummy_thread import get_ident
53+
4654

4755
def recursive_repr(fillvalue='...'):
4856
'Decorator to make a repr function return fillvalue for a recursive call'

src/future/builtins/newsuper.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def newsuper(typ=_SENTINEL, type_or_obj=_SENTINEL, framedepth=1):
6262
try:
6363
# Get the MRO so we can crawl it.
6464
mro = type_or_obj.__mro__
65-
except AttributeError:
65+
except (AttributeError, RuntimeError): # see issue #160
6666
try:
6767
mro = type_or_obj.__class__.__mro__
6868
except AttributeError:

tests/test_future/test_standard_library.py

+12-1
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ def test_urllib_request_ssl_redirect(self):
332332
# pprint(r.read().decode('utf-8'))
333333
self.assertTrue(True)
334334

335-
def test_urllib_request_http(self):
335+
def test_moves_urllib_request_http(self):
336336
"""
337337
This site (python-future.org) uses plain http (as of 2014-09-23).
338338
"""
@@ -343,6 +343,17 @@ def test_urllib_request_http(self):
343343
data = r.read()
344344
self.assertTrue(b'</html>' in data)
345345

346+
def test_urllib_request_http(self):
347+
"""
348+
This site (python-future.org) uses plain http (as of 2014-09-23).
349+
"""
350+
import urllib.request as urllib_request
351+
from pprint import pprint
352+
URL = 'http://python-future.org'
353+
r = urllib_request.urlopen(URL)
354+
data = r.read()
355+
self.assertTrue(b'</html>' in data)
356+
346357
def test_html_import(self):
347358
import html
348359
import html.entities

0 commit comments

Comments
 (0)