Commit e5fd6a2e authored by Benjamin Peterson's avatar Benjamin Peterson

merge 2.7.6 release branch

parents 3a64c6b9 0c2f9734
...@@ -380,7 +380,7 @@ The module :mod:`curses` defines the following functions: ...@@ -380,7 +380,7 @@ The module :mod:`curses` defines the following functions:
is to be displayed. is to be displayed.
.. function:: newwin(begin_y, begin_x) .. function:: newwin(nlines, ncols)
newwin(nlines, ncols, begin_y, begin_x) newwin(nlines, ncols, begin_y, begin_x)
Return a new window, whose left-upper corner is at ``(begin_y, begin_x)``, and Return a new window, whose left-upper corner is at ``(begin_y, begin_x)``, and
......
...@@ -1720,7 +1720,7 @@ Notes: ...@@ -1720,7 +1720,7 @@ Notes:
making assumptions about the output value. Field orderings will vary (for making assumptions about the output value. Field orderings will vary (for
example, "month/day/year" versus "day/month/year"), and the output may example, "month/day/year" versus "day/month/year"), and the output may
contain Unicode characters encoded using the locale's default encoding (for contain Unicode characters encoded using the locale's default encoding (for
example, if the current locale is ``js_JP``, the default encoding could be example, if the current locale is ``ja_JP``, the default encoding could be
any one of ``eucJP``, ``SJIS``, or ``utf-8``; use :meth:`locale.getlocale` any one of ``eucJP``, ``SJIS``, or ``utf-8``; use :meth:`locale.getlocale`
to determine the current locale's encoding). to determine the current locale's encoding).
......
...@@ -234,25 +234,25 @@ indicates an error, the method raises one of the above exceptions. ...@@ -234,25 +234,25 @@ indicates an error, the method raises one of the above exceptions.
.. method:: NNTP.next() .. method:: NNTP.next()
Send a ``NEXT`` command. Return as for :meth:`stat`. Send a ``NEXT`` command. Return as for :meth:`.stat`.
.. method:: NNTP.last() .. method:: NNTP.last()
Send a ``LAST`` command. Return as for :meth:`stat`. Send a ``LAST`` command. Return as for :meth:`.stat`.
.. method:: NNTP.head(id) .. method:: NNTP.head(id)
Send a ``HEAD`` command, where *id* has the same meaning as for :meth:`stat`. Send a ``HEAD`` command, where *id* has the same meaning as for :meth:`.stat`.
Return a tuple ``(response, number, id, list)`` where the first three are the Return a tuple ``(response, number, id, list)`` where the first three are the
same as for :meth:`stat`, and *list* is a list of the article's headers (an same as for :meth:`.stat`, and *list* is a list of the article's headers (an
uninterpreted list of lines, without trailing newlines). uninterpreted list of lines, without trailing newlines).
.. method:: NNTP.body(id,[file]) .. method:: NNTP.body(id,[file])
Send a ``BODY`` command, where *id* has the same meaning as for :meth:`stat`. Send a ``BODY`` command, where *id* has the same meaning as for :meth:`.stat`.
If the *file* parameter is supplied, then the body is stored in a file. If If the *file* parameter is supplied, then the body is stored in a file. If
*file* is a string, then the method will open a file object with that name, *file* is a string, then the method will open a file object with that name,
write to it then close it. If *file* is a file object, then it will start write to it then close it. If *file* is a file object, then it will start
...@@ -263,7 +263,7 @@ indicates an error, the method raises one of the above exceptions. ...@@ -263,7 +263,7 @@ indicates an error, the method raises one of the above exceptions.
.. method:: NNTP.article(id) .. method:: NNTP.article(id)
Send an ``ARTICLE`` command, where *id* has the same meaning as for Send an ``ARTICLE`` command, where *id* has the same meaning as for
:meth:`stat`. Return as for :meth:`head`. :meth:`.stat`. Return as for :meth:`head`.
.. method:: NNTP.slave() .. method:: NNTP.slave()
...@@ -290,7 +290,7 @@ indicates an error, the method raises one of the above exceptions. ...@@ -290,7 +290,7 @@ indicates an error, the method raises one of the above exceptions.
.. method:: NNTP.post(file) .. method:: NNTP.post(file)
Post an article using the ``POST`` command. The *file* argument is an open file Post an article using the ``POST`` command. The *file* argument is an open file
object which is read until EOF using its :meth:`readline` method. It should be object which is read until EOF using its :meth:`~file.readline` method. It should be
a well-formed news article, including the required headers. The :meth:`post` a well-formed news article, including the required headers. The :meth:`post`
method automatically escapes lines beginning with ``.``. method automatically escapes lines beginning with ``.``.
......
...@@ -1936,6 +1936,10 @@ written in Python, such as a mail server's external command delivery program. ...@@ -1936,6 +1936,10 @@ written in Python, such as a mail server's external command delivery program.
Note that some platforms including FreeBSD <= 6.3, Cygwin and OS/2 EMX have Note that some platforms including FreeBSD <= 6.3, Cygwin and OS/2 EMX have
known issues when using fork() from a thread. known issues when using fork() from a thread.
.. warning::
See :mod:`ssl` for applications that use the SSL module with fork().
Availability: Unix. Availability: Unix.
......
...@@ -30,6 +30,14 @@ probably additional platforms, as long as OpenSSL is installed on that platform. ...@@ -30,6 +30,14 @@ probably additional platforms, as long as OpenSSL is installed on that platform.
operating system socket APIs. The installed version of OpenSSL may also operating system socket APIs. The installed version of OpenSSL may also
cause variations in behavior. cause variations in behavior.
.. warning::
OpenSSL's internal random number generator does not properly handle fork.
Applications must change the PRNG state of the parent process if they use
any SSL feature with with :func:`os.fork`. Any successful call of
:func:`~ssl.RAND_add`, :func:`~ssl.RAND_bytes` or
:func:`~ssl.RAND_pseudo_bytes` is sufficient.
This section documents the objects and functions in the ``ssl`` module; for more This section documents the objects and functions in the ``ssl`` module; for more
general information about TLS, SSL, and certificates, the reader is referred to general information about TLS, SSL, and certificates, the reader is referred to
the documents in the "See Also" section at the bottom. the documents in the "See Also" section at the bottom.
......
...@@ -380,7 +380,7 @@ def merge(*iterables): ...@@ -380,7 +380,7 @@ def merge(*iterables):
while _len(h) > 1: while _len(h) > 1:
try: try:
while True: while 1:
v, itnum, next = s = h[0] v, itnum, next = s = h[0]
yield v yield v
s[0] = next() # raises StopIteration when exhausted s[0] = next() # raises StopIteration when exhausted
......
...@@ -169,7 +169,8 @@ class Pool(object): ...@@ -169,7 +169,8 @@ class Pool(object):
self._task_handler = threading.Thread( self._task_handler = threading.Thread(
target=Pool._handle_tasks, target=Pool._handle_tasks,
args=(self._taskqueue, self._quick_put, self._outqueue, self._pool) args=(self._taskqueue, self._quick_put, self._outqueue,
self._pool, self._cache)
) )
self._task_handler.daemon = True self._task_handler.daemon = True
self._task_handler._state = RUN self._task_handler._state = RUN
...@@ -329,7 +330,7 @@ class Pool(object): ...@@ -329,7 +330,7 @@ class Pool(object):
debug('worker handler exiting') debug('worker handler exiting')
@staticmethod @staticmethod
def _handle_tasks(taskqueue, put, outqueue, pool): def _handle_tasks(taskqueue, put, outqueue, pool, cache):
thread = threading.current_thread() thread = threading.current_thread()
for taskseq, set_length in iter(taskqueue.get, None): for taskseq, set_length in iter(taskqueue.get, None):
...@@ -340,9 +341,12 @@ class Pool(object): ...@@ -340,9 +341,12 @@ class Pool(object):
break break
try: try:
put(task) put(task)
except IOError: except Exception as e:
debug('could not put task on queue') job, ind = task[:2]
break try:
cache[job]._set(ind, (False, e))
except KeyError:
pass
else: else:
if set_length: if set_length:
debug('doing set_length()') debug('doing set_length()')
......
...@@ -276,10 +276,10 @@ def _mk_bitmap(bits): ...@@ -276,10 +276,10 @@ def _mk_bitmap(bits):
# set is constructed. Then, this bitmap is sliced into chunks of 256 # set is constructed. Then, this bitmap is sliced into chunks of 256
# characters, duplicate chunks are eliminated, and each chunk is # characters, duplicate chunks are eliminated, and each chunk is
# given a number. In the compiled expression, the charset is # given a number. In the compiled expression, the charset is
# represented by a 16-bit word sequence, consisting of one word for # represented by a 32-bit word sequence, consisting of one word for
# the number of different chunks, a sequence of 256 bytes (128 words) # the number of different chunks, a sequence of 256 bytes (64 words)
# of chunk numbers indexed by their original chunk position, and a # of chunk numbers indexed by their original chunk position, and a
# sequence of chunks (16 words each). # sequence of 256-bit chunks (8 words each).
# Compression is normally good: in a typical charset, large ranges of # Compression is normally good: in a typical charset, large ranges of
# Unicode will be either completely excluded (e.g. if only cyrillic # Unicode will be either completely excluded (e.g. if only cyrillic
...@@ -294,7 +294,7 @@ def _mk_bitmap(bits): ...@@ -294,7 +294,7 @@ def _mk_bitmap(bits):
# In UCS-4 mode, the BIGCHARSET opcode still supports only subsets # In UCS-4 mode, the BIGCHARSET opcode still supports only subsets
# of the basic multilingual plane; an efficient representation # of the basic multilingual plane; an efficient representation
# for all of UTF-16 has not yet been developed. This means, # for all of Unicode has not yet been developed. This means,
# in particular, that negated charsets cannot be represented as # in particular, that negated charsets cannot be represented as
# bigcharsets. # bigcharsets.
......
...@@ -1117,6 +1117,16 @@ class _TestPool(BaseTestCase): ...@@ -1117,6 +1117,16 @@ class _TestPool(BaseTestCase):
self.assertEqual(pmap(sqr, range(100), chunksize=20), self.assertEqual(pmap(sqr, range(100), chunksize=20),
map(sqr, range(100))) map(sqr, range(100)))
def test_map_unplicklable(self):
# Issue #19425 -- failure to pickle should not cause a hang
if self.TYPE == 'threads':
return
class A(object):
def __reduce__(self):
raise RuntimeError('cannot pickle')
with self.assertRaises(RuntimeError):
self.pool.map(sqr, [A()]*10)
def test_map_chunksize(self): def test_map_chunksize(self):
try: try:
self.pool.map_async(sqr, [], chunksize=1).get(timeout=TIMEOUT1) self.pool.map_async(sqr, [], chunksize=1).get(timeout=TIMEOUT1)
......
...@@ -215,6 +215,9 @@ def library_recipes(): ...@@ -215,6 +215,9 @@ def library_recipes():
name="Tk 8.5.15", name="Tk 8.5.15",
url="ftp://ftp.tcl.tk/pub/tcl//tcl8_5/tk8.5.15-src.tar.gz", url="ftp://ftp.tcl.tk/pub/tcl//tcl8_5/tk8.5.15-src.tar.gz",
checksum='55b8e33f903210a4e1c8bce0f820657f', checksum='55b8e33f903210a4e1c8bce0f820657f',
patches=[
"issue19373_tk_8_5_15_source.patch",
],
buildDir="unix", buildDir="unix",
configure_pre=[ configure_pre=[
'--enable-aqua', '--enable-aqua',
...@@ -797,8 +800,6 @@ def buildRecipe(recipe, basedir, archList): ...@@ -797,8 +800,6 @@ def buildRecipe(recipe, basedir, archList):
workDir = extractArchive(buildDir, sourceArchive) workDir = extractArchive(buildDir, sourceArchive)
os.chdir(workDir) os.chdir(workDir)
if 'buildDir' in recipe:
os.chdir(recipe['buildDir'])
for patch in recipe.get('patches', ()): for patch in recipe.get('patches', ()):
if isinstance(patch, tuple): if isinstance(patch, tuple):
...@@ -825,6 +826,9 @@ def buildRecipe(recipe, basedir, archList): ...@@ -825,6 +826,9 @@ def buildRecipe(recipe, basedir, archList):
runCommand('sh %s' % shellQuote(fn)) runCommand('sh %s' % shellQuote(fn))
os.unlink(fn) os.unlink(fn)
if 'buildDir' in recipe:
os.chdir(recipe['buildDir'])
if configure is not None: if configure is not None:
configure_args = [ configure_args = [
"--prefix=/usr/local", "--prefix=/usr/local",
......
Issue #19373: Patch to Tk 8.5.15 to correct refresh problem on OS x 10.9.
From upstream checkin https://core.tcl.tk/tk/info/5a5abf71f9
--- tk8.5.15/macosx/tkMacOSXDraw.c 2013-09-16 09:41:21.000000000 -0700
+++ Tk_Source_Code-5a5abf71f9fdb0da/macosx/tkMacOSXDraw.c 2013-10-27 13:27:00.000000000 -0700
@@ -1688,6 +1688,7 @@
{
if (dcPtr->context) {
CGContextSynchronize(dcPtr->context);
+ [[dcPtr->view window] setViewsNeedDisplay:YES];
[[dcPtr->view window] enableFlushWindow];
if (dcPtr->focusLocked) {
[dcPtr->view unlockFocus];
Python News Python News
+++++++++++ +++++++++++
What's New in Python 2.7.7?
===========================
*Release date: XXXX-XX-XX*
Core and Builtins
-----------------
Library
-------
Whats' New in Python 2.7.6? Whats' New in Python 2.7.6?
=========================== ===========================
......
...@@ -2753,8 +2753,7 @@ _compile(PyObject* self_, PyObject* args) ...@@ -2753,8 +2753,7 @@ _compile(PyObject* self_, PyObject* args)
\_________\_____/ / \_________\_____/ /
\____________/ \____________/
It also helps that SRE_CODE is always an unsigned type, either 2 bytes or 4 It also helps that SRE_CODE is always an unsigned type.
bytes wide (the latter if Python is compiled for "wide" unicode support).
*/ */
/* Defining this one enables tracing of the validator */ /* Defining this one enables tracing of the validator */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment