diff -u python2.7-2.7.3/debian/changelog python2.7-2.7.3/debian/changelog --- python2.7-2.7.3/debian/changelog +++ python2.7-2.7.3/debian/changelog @@ -1,3 +1,20 @@ +python2.7 (2.7.3-5ubuntu4) quantal-proposed; urgency=low + + * Fix issue #16012: Fix a regression in pyexpat. The parser's UseForeignDTD() + method doesn't require an argument again. LP: #1056740. + + -- Matthias Klose Wed, 26 Sep 2012 13:08:17 +0200 + +python2.7 (2.7.3-5ubuntu3) quantal; urgency=low + + * Update to 20120921, taken from the 2.7 branch. + - Issue #15970: xml.etree.ElementTree now serializes correctly the empty + HTML elements 'meta' and 'param'. + - Issue #11715: Fix multiarch detection without having Debian development + tools (dpkg-dev) installed. + + -- Matthias Klose Fri, 21 Sep 2012 14:23:58 +0200 + python2.7 (2.7.3-5ubuntu2) quantal; urgency=low * Update to 20120915, taken from the 2.7 branch. Posix relevant patches: diff -u python2.7-2.7.3/debian/patches/series.in python2.7-2.7.3/debian/patches/series.in --- python2.7-2.7.3/debian/patches/series.in +++ python2.7-2.7.3/debian/patches/series.in @@ -1,5 +1,6 @@ hg-updates.diff issue9189.diff +issue16012.diff deb-setup.diff deb-locations.diff site-locations.diff diff -u python2.7-2.7.3/debian/patches/hg-updates.diff python2.7-2.7.3/debian/patches/hg-updates.diff --- python2.7-2.7.3/debian/patches/hg-updates.diff +++ python2.7-2.7.3/debian/patches/hg-updates.diff @@ -1,4 +1,4 @@ -# DP: hg updates of the 2.7 release branch (until 2012-09-15). +# DP: hg updates of the 2.7 release branch (until 2012-09-21). # hg diff -r v2.7.3 | filterdiff --exclude=.*ignore --exclude=.hg* --remove-timestamps @@ -849,6 +849,36 @@ largeString = 'z' * (100 * 1024) myPickle = cPickle.dumps(largeString, protocol=1) +diff -r 70274d53c1dd Doc/faq/windows.rst +--- a/Doc/faq/windows.rst ++++ b/Doc/faq/windows.rst +@@ -460,13 +460,13 @@ + Why does os.path.isdir() fail on NT shared directories? + ------------------------------------------------------- + +-The solution appears to be always append the "\\" on the end of shared +-drives. ++In order to work correctly, :func:`os.path.isdir` requires a ``"\\"`` at the ++end of the shared drive:: + + >>> import os +- >>> os.path.isdir( '\\\\rorschach\\public') ++ >>> os.path.isdir('\\\\rorschach\\public') + 0 +- >>> os.path.isdir( '\\\\rorschach\\public\\') ++ >>> os.path.isdir('\\\\rorschach\\public\\') + 1 + + It helps to think of share points as being like drive letters. Example:: +@@ -476,7 +476,7 @@ + k:\media is a directory + k:\media\ is not a directory + +-The same rules apply if you substitute "k:" with "\\conky\foo":: ++The same rules apply if you substitute ``"k:"`` with ``"\\conky\foo"``:: + + \\conky\foo is not a directory + \\conky\foo\ is a directory diff -r 70274d53c1dd Doc/glossary.rst --- a/Doc/glossary.rst +++ b/Doc/glossary.rst @@ -2062,6 +2092,15 @@ diff -r 70274d53c1dd Doc/howto/regex.rst --- a/Doc/howto/regex.rst +++ b/Doc/howto/regex.rst +@@ -265,7 +265,7 @@ + + >>> import re + >>> p = re.compile('ab*') +- >>> print p ++ >>> p #doctest: +ELLIPSIS + <_sre.SRE_Pattern object at 0x...> + + :func:`re.compile` also accepts an optional *flags* argument, used to enable @@ -365,7 +365,7 @@ You can learn about this by interactively experimenting with the :mod:`re` @@ -2071,6 +2110,53 @@ Python distribution. It allows you to enter REs and strings, and displays whether the RE matches or fails. :file:`redemo.py` can be quite useful when trying to debug a complicated RE. Phil Schwartz's `Kodos +@@ -378,7 +378,7 @@ + Python 2.2.2 (#1, Feb 10 2003, 12:57:01) + >>> import re + >>> p = re.compile('[a-z]+') +- >>> p ++ >>> p #doctest: +ELLIPSIS + <_sre.SRE_Pattern object at 0x...> + + Now, you can try matching various strings against the RE ``[a-z]+``. An empty +@@ -396,7 +396,7 @@ + result in a variable for later use. :: + + >>> m = p.match('tempo') +- >>> print m ++ >>> m #doctest: +ELLIPSIS + <_sre.SRE_Match object at 0x...> + + Now you can query the :class:`MatchObject` for information about the matching +@@ -435,7 +435,7 @@ + + >>> print p.match('::: message') + None +- >>> m = p.search('::: message') ; print m ++ >>> m = p.search('::: message'); print m #doctest: +ELLIPSIS + <_sre.SRE_Match object at 0x...> + >>> m.group() + 'message' +@@ -464,8 +464,8 @@ + instances as an :term:`iterator`. [#]_ :: + + >>> iterator = p.finditer('12 drummers drumming, 11 ... 10 ...') +- >>> iterator +- ++ >>> iterator #doctest: +ELLIPSIS ++ + >>> for match in iterator: + ... print match.span() + ... +@@ -486,7 +486,7 @@ + + >>> print re.match(r'From\s+', 'Fromage amk') + None +- >>> re.match(r'From\s+', 'From amk Thu May 14 19:12:10 1998') ++ >>> re.match(r'From\s+', 'From amk Thu May 14 19:12:10 1998') #doctest: +ELLIPSIS + <_sre.SRE_Match object at 0x...> + + Under the hood, these functions simply create a pattern object for you @@ -501,7 +501,7 @@ the same ones in several locations, then it might be worthwhile to collect all the definitions in one place, in a section of code that compiles all the REs @@ -2080,6 +2166,59 @@ ref = re.compile( ... ) entityref = re.compile( ... ) +@@ -687,7 +687,7 @@ + For example, if you wish to match the word ``From`` only at the beginning of a + line, the RE to use is ``^From``. :: + +- >>> print re.search('^From', 'From Here to Eternity') ++ >>> print re.search('^From', 'From Here to Eternity') #doctest: +ELLIPSIS + <_sre.SRE_Match object at 0x...> + >>> print re.search('^From', 'Reciting From Memory') + None +@@ -699,11 +699,11 @@ + Matches at the end of a line, which is defined as either the end of the string, + or any location followed by a newline character. :: + +- >>> print re.search('}$', '{block}') ++ >>> print re.search('}$', '{block}') #doctest: +ELLIPSIS + <_sre.SRE_Match object at 0x...> + >>> print re.search('}$', '{block} ') + None +- >>> print re.search('}$', '{block}\n') ++ >>> print re.search('}$', '{block}\n') #doctest: +ELLIPSIS + <_sre.SRE_Match object at 0x...> + + To match a literal ``'$'``, use ``\$`` or enclose it inside a character class, +@@ -728,7 +728,7 @@ + match when it's contained inside another word. :: + + >>> p = re.compile(r'\bclass\b') +- >>> print p.search('no class at all') ++ >>> print p.search('no class at all') #doctest: +ELLIPSIS + <_sre.SRE_Match object at 0x...> + >>> print p.search('the declassified algorithm') + None +@@ -746,7 +746,7 @@ + >>> p = re.compile('\bclass\b') + >>> print p.search('no class at all') + None +- >>> print p.search('\b' + 'class' + '\b') ++ >>> print p.search('\b' + 'class' + '\b') #doctest: +ELLIPSIS + <_sre.SRE_Match object at 0x...> + + Second, inside a character class, where there's no use for this assertion, +@@ -1187,9 +1187,9 @@ + In the following example, the replacement function translates decimals into + hexadecimal:: + +- >>> def hexrepl( match ): ++ >>> def hexrepl(match): + ... "Return the hex string for a decimal number" +- ... value = int( match.group() ) ++ ... value = int(match.group()) + ... return hex(value) + ... + >>> p = re.compile(r'\d+') diff -r 70274d53c1dd Doc/howto/sockets.rst --- a/Doc/howto/sockets.rst +++ b/Doc/howto/sockets.rst @@ -3377,6 +3516,15 @@ diff -r 70274d53c1dd Doc/library/doctest.rst --- a/Doc/library/doctest.rst +++ b/Doc/library/doctest.rst +@@ -363,7 +363,7 @@ + Backslashes in a raw docstring: m\n + + Otherwise, the backslash will be interpreted as part of the string. For example, +- the "\\" above would be interpreted as a newline character. Alternatively, you ++ the ``\n`` above would be interpreted as a newline character. Alternatively, you + can double each backslash in the doctest version (and not use a raw string):: + + >>> def f(x): @@ -1060,6 +1060,16 @@ .. versionchanged:: 2.5 The parameter *encoding* was added. @@ -3950,7 +4098,28 @@ This is a versatile function to create lists containing arithmetic progressions. It is most often used in :keyword:`for` loops. The arguments must be plain -@@ -1174,6 +1209,8 @@ +@@ -1157,13 +1192,14 @@ + Added the possibility to write a custom :meth:`__reversed__` method. + + +-.. function:: round(x[, n]) ++.. function:: round(number[, ndigits]) + +- Return the floating point value *x* rounded to *n* digits after the decimal +- point. If *n* is omitted, it defaults to zero. The result is a floating point +- number. Values are rounded to the closest multiple of 10 to the power minus +- *n*; if two multiples are equally close, rounding is done away from 0 (so. for +- example, ``round(0.5)`` is ``1.0`` and ``round(-0.5)`` is ``-1.0``). ++ Return the floating point value *number* rounded to *ndigits* digits after ++ the decimal point. If *ndigits* is omitted, it defaults to zero. The result ++ is a floating point number. Values are rounded to the closest multiple of ++ 10 to the power minus *ndigits*; if two multiples are equally close, ++ rounding is done away from 0 (so. for example, ``round(0.5)`` is ``1.0`` and ++ ``round(-0.5)`` is ``-1.0``). + + + .. note:: +@@ -1174,6 +1210,8 @@ can't be represented exactly as a float. See :ref:`tut-fp-issues` for more information. @@ -3959,7 +4128,7 @@ .. function:: set([iterable]) :noindex: -@@ -1195,7 +1232,8 @@ +@@ -1195,7 +1233,8 @@ ``x.foobar = 123``. @@ -3969,7 +4138,7 @@ .. index:: single: Numerical Python -@@ -1471,7 +1509,8 @@ +@@ -1471,7 +1510,8 @@ dictionary are ignored. @@ -3979,7 +4148,7 @@ This function is very similar to :func:`range`, but returns an "xrange object" instead of a list. This is an opaque sequence type which yields the same values -@@ -1535,7 +1574,7 @@ +@@ -1535,7 +1575,7 @@ .. note:: This is an advanced function that is not needed in everyday Python @@ -3988,7 +4157,7 @@ This function is invoked by the :keyword:`import` statement. It can be replaced (by importing the :mod:`__builtin__` module and assigning to -@@ -1586,15 +1625,8 @@ +@@ -1586,15 +1626,8 @@ names. If you simply want to import a module (potentially within a package) by name, @@ -5230,6 +5399,18 @@ Like :func:`readmodule`, but the returned dictionary, in addition to mapping class names to class descriptor objects, also maps top-level +diff -r 70274d53c1dd Doc/library/pyexpat.rst +--- a/Doc/library/pyexpat.rst ++++ b/Doc/library/pyexpat.rst +@@ -437,7 +437,7 @@ + .. method:: xmlparser.CommentHandler(data) + + Called for comments. *data* is the text of the comment, excluding the leading +- '````'. ++ ``''``. + + + .. method:: xmlparser.StartCdataSectionHandler() diff -r 70274d53c1dd Doc/library/queue.rst --- a/Doc/library/queue.rst +++ b/Doc/library/queue.rst @@ -5788,6 +5969,18 @@ .. versionadded:: 2.2 +diff -r 70274d53c1dd Doc/library/site.rst +--- a/Doc/library/site.rst ++++ b/Doc/library/site.rst +@@ -26,7 +26,7 @@ + For the head part, it uses ``sys.prefix`` and ``sys.exec_prefix``; empty heads + are skipped. For the tail part, it uses the empty string and then + :file:`lib/site-packages` (on Windows) or +-:file:`lib/python|version|/site-packages` and then :file:`lib/site-python` (on ++:file:`lib/python{X.Y}/site-packages` and then :file:`lib/site-python` (on + Unix and Macintosh). For each of the distinct head-tail combinations, it sees + if it refers to an existing directory, and if so, adds it to ``sys.path`` and + also inspects the newly added path for configuration files. diff -r 70274d53c1dd Doc/library/socket.rst --- a/Doc/library/socket.rst +++ b/Doc/library/socket.rst @@ -6730,6 +6923,77 @@ diff -r 70274d53c1dd Doc/library/timeit.rst --- a/Doc/library/timeit.rst +++ b/Doc/library/timeit.rst +@@ -23,7 +23,7 @@ + The module defines the following public class: + + +-.. class:: Timer([stmt='pass' [, setup='pass' [, timer=]]]) ++.. class:: Timer(stmt='pass', setup='pass', timer=) + + Class for timing execution speed of small code snippets. + +@@ -33,18 +33,18 @@ + may also contain multiple statements separated by ``;`` or newlines, as long as + they don't contain multi-line string literals. + +- To measure the execution time of the first statement, use the :meth:`timeit` +- method. The :meth:`repeat` method is a convenience to call :meth:`timeit` ++ To measure the execution time of the first statement, use the :meth:`Timer.timeit` ++ method. The :meth:`repeat` method is a convenience to call :meth:`.timeit` + multiple times and return a list of results. + + .. versionchanged:: 2.6 + The *stmt* and *setup* parameters can now also take objects that are callable + without arguments. This will embed calls to them in a timer function that will +- then be executed by :meth:`timeit`. Note that the timing overhead is a little +- larger in this case because of the extra function calls. ++ then be executed by :meth:`.timeit`. Note that the timing overhead is a ++ little larger in this case because of the extra function calls. + + +-.. method:: Timer.print_exc([file=None]) ++.. method:: Timer.print_exc(file=None) + + Helper to print a traceback from the timed code. + +@@ -61,14 +61,14 @@ + traceback is sent; it defaults to ``sys.stderr``. + + +-.. method:: Timer.repeat([repeat=3 [, number=1000000]]) ++.. method:: Timer.repeat(repeat=3, number=1000000) + +- Call :meth:`timeit` a few times. ++ Call :meth:`.timeit` a few times. + +- This is a convenience function that calls the :meth:`timeit` repeatedly, ++ This is a convenience function that calls the :meth:`.timeit` repeatedly, + returning a list of results. The first argument specifies how many times to +- call :meth:`timeit`. The second argument specifies the *number* argument for +- :func:`timeit`. ++ call :meth:`.timeit`. The second argument specifies the *number* argument for ++ :meth:`.timeit`. + + .. note:: + +@@ -82,7 +82,7 @@ + and apply common sense rather than statistics. + + +-.. method:: Timer.timeit([number=1000000]) ++.. method:: Timer.timeit(number=1000000) + + Time *number* executions of the main statement. This executes the setup + statement once, and then returns the time it takes to execute the main statement +@@ -92,7 +92,7 @@ + + .. note:: + +- By default, :meth:`timeit` temporarily turns off :term:`garbage collection` ++ By default, :meth:`.timeit` temporarily turns off :term:`garbage collection` + during the timing. The advantage of this approach is that it makes + independent timings more comparable. This disadvantage is that GC may be + an important component of the performance of the function being measured. @@ -101,10 +101,20 @@ timeit.Timer('for i in xrange(10): oct(i)', 'gc.enable()').timeit() @@ -6753,7 +7017,7 @@ Create a :class:`Timer` instance with the given statement, setup code and timer function and run its :meth:`repeat` method with the given repeat count and -@@ -113,7 +123,7 @@ +@@ -113,10 +123,10 @@ .. versionadded:: 2.6 @@ -6761,7 +7025,11 @@ +.. function:: timeit(stmt, setup='pass', timer=default_timer, number=1000000) Create a :class:`Timer` instance with the given statement, setup code and timer - function and run its :meth:`timeit` method with *number* executions. +- function and run its :meth:`timeit` method with *number* executions. ++ function and run its :meth:`.timeit` method with *number* executions. + + .. versionadded:: 2.6 + @@ -168,13 +178,9 @@ If :option:`-n` is not given, a suitable number of loops is calculated by trying successive powers of 10 until the total time is at least 0.2 seconds. @@ -6779,6 +7047,15 @@ the timing a few times and use the best time. The :option:`-r` option is good for this; the default of 3 repetitions is probably enough in most cases. On Unix, you can use :func:`time.clock` to measure CPU time. +@@ -242,7 +248,7 @@ + 3.15 usec/pass + + To give the :mod:`timeit` module access to functions you define, you can pass a +-``setup`` parameter which contains an import statement:: ++*setup* parameter which contains an import statement:: + + def test(): + """Stupid test function""" diff -r 70274d53c1dd Doc/library/tix.rst --- a/Doc/library/tix.rst +++ b/Doc/library/tix.rst @@ -13740,6 +14017,18 @@ def python_is_optimized(): cflags = sysconfig.get_config_vars()['PY_CFLAGS'] final_opt = "" +@@ -141,6 +150,11 @@ + err = err.replace("warning: Cannot initialize thread debugging" + " library: Debugger service failed\n", + '') ++ err = err.replace('warning: Could not load shared library symbols for ' ++ 'linux-vdso.so.1.\n' ++ 'Do you need "set solib-search-path" or ' ++ '"set sysroot"?\n', ++ '') + + # Ensure no unexpected error messages: + self.assertEqual(err, '') diff -r 70274d53c1dd Lib/test/test_hashlib.py --- a/Lib/test/test_hashlib.py +++ b/Lib/test/test_hashlib.py @@ -16896,6 +17185,36 @@ QueryValueEx(HKEY_PERFORMANCE_DATA, None) # Reflection requires XP x64/Vista at a minimum. XP doesn't have this stuff +diff -r 70274d53c1dd Lib/test/test_xml_etree.py +--- a/Lib/test/test_xml_etree.py ++++ b/Lib/test/test_xml_etree.py +@@ -1822,6 +1822,26 @@ + + """ + ++def check_html_empty_elems_serialization(self): ++ # issue 15970 ++ # from http://www.w3.org/TR/html401/index/elements.html ++ """ ++ ++ >>> empty_elems = ['AREA', 'BASE', 'BASEFONT', 'BR', 'COL', 'FRAME', 'HR', ++ ... 'IMG', 'INPUT', 'ISINDEX', 'LINK', 'META', 'PARAM'] ++ >>> elems = ''.join('<%s />' % elem for elem in empty_elems) ++ >>> serialize(ET.XML('%s' % elems), method='html') ++ '

' ++ >>> serialize(ET.XML('%s' % elems.lower()), method='html') ++ '

' ++ >>> elems = ''.join('<%s>' % (elem, elem) for elem in empty_elems) ++ >>> serialize(ET.XML('%s' % elems), method='html') ++ '

' ++ >>> serialize(ET.XML('%s' % elems.lower()), method='html') ++ '

' ++ ++ """ ++ + # -------------------------------------------------------------------- + + diff -r 70274d53c1dd Lib/test/test_zipfile.py --- a/Lib/test/test_zipfile.py +++ b/Lib/test/test_zipfile.py @@ -17278,6 +17597,18 @@ url, query = url.split('?', 1) v = SplitResult(scheme, netloc, url, query, fragment) _parse_cache[key] = v +diff -r 70274d53c1dd Lib/xml/etree/ElementTree.py +--- a/Lib/xml/etree/ElementTree.py ++++ b/Lib/xml/etree/ElementTree.py +@@ -945,7 +945,7 @@ + write(_escape_cdata(elem.tail, encoding)) + + HTML_EMPTY = ("area", "base", "basefont", "br", "col", "frame", "hr", +- "img", "input", "isindex", "link", "meta" "param") ++ "img", "input", "isindex", "link", "meta", "param") + + try: + HTML_EMPTY = set(HTML_EMPTY) diff -r 70274d53c1dd Lib/zipfile.py --- a/Lib/zipfile.py +++ b/Lib/zipfile.py @@ -18261,7 +18592,7 @@ diff -r 70274d53c1dd Misc/NEWS --- a/Misc/NEWS +++ b/Misc/NEWS -@@ -1,17 +1,445 @@ +@@ -1,17 +1,451 @@ Python News +++++++++++ @@ -18371,6 +18702,9 @@ Library ------- ++- Issue #15970: xml.etree.ElementTree now serializes correctly the empty HTML ++ elements 'meta' and 'param'. ++ +- Issue #15676: Now "mmap" check for empty files before doing the + offset check. Patch by Steven Willis. + @@ -18665,6 +18999,9 @@ +Build +----- + ++- Issue #11715: Fix multiarch detection without having Debian development ++ tools (dpkg-dev) installed. ++ +- Issue #15819: Make sure we can build Python out-of-tree from a readonly + source directory. (Somewhat related to Issue #9860.) + @@ -18711,7 +19048,7 @@ What's New in Python 2.7.3 release candidate 2? =============================================== -@@ -498,6 +926,10 @@ +@@ -498,6 +932,10 @@ Extension Modules ----------------- @@ -18722,7 +19059,7 @@ - bsddb module: Erratic behaviour of "DBEnv->rep_elect()" because a typo. Possible crash. -@@ -572,6 +1004,9 @@ +@@ -572,6 +1010,9 @@ Tests ----- @@ -18732,7 +19069,7 @@ - Issue #11689: Fix a variable scoping error in an sqlite3 test. Initial patch by Torsten Landschoff. -@@ -624,7 +1059,8 @@ +@@ -624,7 +1065,8 @@ Documentation ------------- @@ -19672,6 +20009,18 @@ ret = -1; done: +diff -r 70274d53c1dd Modules/_io/iobase.c +--- a/Modules/_io/iobase.c ++++ b/Modules/_io/iobase.c +@@ -437,7 +437,7 @@ + "\n" + "If limit is specified, at most limit bytes will be read.\n" + "\n" +- "The line terminator is always b'\n' for binary files; for text\n" ++ "The line terminator is always b'\\n' for binary files; for text\n" + "files, the newlines argument to open can be used to select the line\n" + "terminator(s) recognized.\n"); + diff -r 70274d53c1dd Modules/_io/stringio.c --- a/Modules/_io/stringio.c +++ b/Modules/_io/stringio.c @@ -32023,7 +32372,35 @@ for ext in self.extensions[:]: ext.sources = [ find_module_file(filename, moddirlist) for filename in ext.sources ] -@@ -451,6 +454,10 @@ +@@ -348,6 +351,27 @@ + def add_multiarch_paths(self): + # Debian/Ubuntu multiarch support. + # https://wiki.ubuntu.com/MultiarchSpec ++ cc = sysconfig.get_config_var('CC') ++ tmpfile = os.path.join(self.build_temp, 'multiarch') ++ if not os.path.exists(self.build_temp): ++ os.makedirs(self.build_temp) ++ ret = os.system( ++ '%s -print-multiarch > %s 2> /dev/null' % (cc, tmpfile)) ++ multiarch_path_component = '' ++ try: ++ if ret >> 8 == 0: ++ with open(tmpfile) as fp: ++ multiarch_path_component = fp.readline().strip() ++ finally: ++ os.unlink(tmpfile) ++ ++ if multiarch_path_component != '': ++ add_dir_to_list(self.compiler.library_dirs, ++ '/usr/lib/' + multiarch_path_component) ++ add_dir_to_list(self.compiler.include_dirs, ++ '/usr/include/' + multiarch_path_component) ++ return ++ + if not find_executable('dpkg-architecture'): + return + tmpfile = os.path.join(self.build_temp, 'multiarch') +@@ -451,6 +475,10 @@ if platform in ['osf1', 'unixware7', 'openunix8']: lib_dirs += ['/usr/ccs/lib'] @@ -32034,7 +32411,7 @@ if platform == 'darwin': # This should work on any unixy platform ;-) # If the user has bothered specifying additional -I and -L flags -@@ -1021,12 +1028,12 @@ +@@ -1021,12 +1049,12 @@ if sys.platform == 'darwin': sysroot = macosx_sdk_root() @@ -32052,7 +32429,7 @@ if os.path.exists(f): if sqlite_setup_debug: print "sqlite: found %s"%f incf = open(f).read() -@@ -1154,10 +1161,14 @@ +@@ -1154,10 +1182,14 @@ for cand in dbm_order: if cand == "ndbm": if find_file("ndbm.h", inc_dirs, []) is not None: @@ -32068,7 +32445,7 @@ else: ndbm_libs = [] print "building dbm using ndbm" -@@ -1861,6 +1872,8 @@ +@@ -1861,6 +1893,8 @@ from distutils.dir_util import mkpath mkpath(ffi_builddir) config_args = [] only in patch2: unchanged: --- python2.7-2.7.3.orig/debian/patches/issue16012.diff +++ python2.7-2.7.3/debian/patches/issue16012.diff @@ -0,0 +1,87 @@ +# DP: - Issue #16012: Fix a regression in pyexpat. The parser's UseForeignDTD() +# DP: method doesn't require an argument again. + +diff -r bfdf366a779a -r 3e0d632ce910 Lib/test/test_pyexpat.py +--- a/Lib/test/test_pyexpat.py Fri Sep 21 17:26:35 2012 +0300 ++++ b/Lib/test/test_pyexpat.py Mon Sep 24 13:17:08 2012 +0200 +@@ -588,6 +588,58 @@ + except expat.ExpatError as e: + self.assertEqual(str(e), 'XML declaration not well-formed: line 1, column 14') + ++class ForeignDTDTests(unittest.TestCase): ++ """ ++ Tests for the UseForeignDTD method of expat parser objects. ++ """ ++ def test_use_foreign_dtd(self): ++ """ ++ If UseForeignDTD is passed True and a document without an external ++ entity reference is parsed, ExternalEntityRefHandler is first called ++ with None for the public and system ids. ++ """ ++ handler_call_args = [] ++ def resolve_entity(context, base, system_id, public_id): ++ handler_call_args.append((public_id, system_id)) ++ return 1 ++ ++ parser = expat.ParserCreate() ++ parser.UseForeignDTD(True) ++ parser.SetParamEntityParsing(expat.XML_PARAM_ENTITY_PARSING_ALWAYS) ++ parser.ExternalEntityRefHandler = resolve_entity ++ parser.Parse("") ++ self.assertEqual(handler_call_args, [(None, None)]) ++ ++ # test UseForeignDTD() is equal to UseForeignDTD(True) ++ handler_call_args[:] = [] ++ ++ parser = expat.ParserCreate() ++ parser.UseForeignDTD() ++ parser.SetParamEntityParsing(expat.XML_PARAM_ENTITY_PARSING_ALWAYS) ++ parser.ExternalEntityRefHandler = resolve_entity ++ parser.Parse("") ++ self.assertEqual(handler_call_args, [(None, None)]) ++ ++ def test_ignore_use_foreign_dtd(self): ++ """ ++ If UseForeignDTD is passed True and a document with an external ++ entity reference is parsed, ExternalEntityRefHandler is called with ++ the public and system ids from the document. ++ """ ++ handler_call_args = [] ++ def resolve_entity(context, base, system_id, public_id): ++ handler_call_args.append((public_id, system_id)) ++ return 1 ++ ++ parser = expat.ParserCreate() ++ parser.UseForeignDTD(True) ++ parser.SetParamEntityParsing(expat.XML_PARAM_ENTITY_PARSING_ALWAYS) ++ parser.ExternalEntityRefHandler = resolve_entity ++ parser.Parse( ++ "") ++ self.assertEqual(handler_call_args, [("bar", "baz")]) ++ ++ + def test_main(): + run_unittest(SetAttributeTest, + ParseTest, +@@ -598,7 +650,8 @@ + PositionTest, + sf1296433Test, + ChardataBufferTest, +- MalformedInputText) ++ MalformedInputText, ++ ForeignDTDTests) + + if __name__ == "__main__": + test_main() +diff -r bfdf366a779a -r 3e0d632ce910 Modules/pyexpat.c +--- a/Modules/pyexpat.c Fri Sep 21 17:26:35 2012 +0300 ++++ b/Modules/pyexpat.c Mon Sep 24 13:17:08 2012 +0200 +@@ -1176,7 +1176,7 @@ + PyObject *flagobj = NULL; + int flag = 1; + enum XML_Error rc; +- if (!PyArg_ParseTuple(args, "O:UseForeignDTD", &flagobj)) ++ if (!PyArg_ParseTuple(args, "|O:UseForeignDTD", &flagobj)) + return NULL; + if (flagobj != NULL) { + flag = PyObject_IsTrue(flagobj);