--- python3.4-3.4~b1.orig/debian/2to3-3.1 +++ python3.4-3.4~b1/debian/2to3-3.1 @@ -0,0 +1,41 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.40.4. +.TH 2TO3-3.3 "1" "January 2012" "2to3-3.3 3.3" "User Commands" +.SH NAME +2to3-3.3 \- Python2 to Python3 converter +.SH SYNOPSIS +.B 2to3 +[\fIoptions\fR] \fIfile|dir \fR... +.SH OPTIONS +.TP +\fB\-h\fR, \fB\-\-help\fR +show this help message and exit +.TP +\fB\-d\fR, \fB\-\-doctests_only\fR +Fix up doctests only +.TP +\fB\-f\fR FIX, \fB\-\-fix\fR=\fIFIX\fR +Each FIX specifies a transformation; default: all +.TP +\fB\-j\fR PROCESSES, \fB\-\-processes\fR=\fIPROCESSES\fR +Run 2to3 concurrently +.TP +\fB\-x\fR NOFIX, \fB\-\-nofix\fR=\fINOFIX\fR +Prevent a transformation from being run +.TP +\fB\-l\fR, \fB\-\-list\-fixes\fR +List available transformations +.TP +\fB\-p\fR, \fB\-\-print\-function\fR +Modify the grammar so that print() is a function +.TP +\fB\-v\fR, \fB\-\-verbose\fR +More verbose logging +.TP +\fB\-\-no\-diffs\fR +Don't show diffs of the refactoring +.TP +\fB\-w\fR, \fB\-\-write\fR +Write back modified files +.TP +\fB\-n\fR, \fB\-\-nobackups\fR +Don't write backups for modified files --- python3.4-3.4~b1.orig/debian/FAQ.html +++ python3.4-3.4~b1/debian/FAQ.html @@ -0,0 +1,8997 @@ + + +The Whole Python FAQ + + + +

The Whole Python FAQ

+Last changed on Wed Feb 12 21:31:08 2003 CET + +

(Entries marked with ** were changed within the last 24 hours; +entries marked with * were changed within the last 7 days.) +

+ +

+


+

1. General information and availability

+ + +

+


+

2. Python in the real world

+ + +

+


+

3. Building Python and Other Known Bugs

+ + +

+


+

4. Programming in Python

+ + +

+


+

5. Extending Python

+ + +

+


+

6. Python's design

+ + +

+


+

7. Using Python on non-UNIX platforms

+ + +

+


+

8. Python on Windows

+ + +
+

1. General information and availability

+ +
+

1.1. What is Python?

+Python is an interpreted, interactive, object-oriented programming +language. It incorporates modules, exceptions, dynamic typing, very +high level dynamic data types, and classes. Python combines +remarkable power with very clear syntax. It has interfaces to many +system calls and libraries, as well as to various window systems, and +is extensible in C or C++. It is also usable as an extension language +for applications that need a programmable interface. Finally, Python +is portable: it runs on many brands of UNIX, on the Mac, and on PCs +under MS-DOS, Windows, Windows NT, and OS/2. +

+To find out more, the best thing to do is to start reading the +tutorial from the documentation set (see a few questions further +down). +

+See also question 1.17 (what is Python good for). +

+ +Edit this entry / +Log info + +/ Last changed on Mon May 26 16:05:18 1997 by +GvR +

+ +


+

1.2. Why is it called Python?

+Apart from being a computer scientist, I'm also a fan of "Monty +Python's Flying Circus" (a BBC comedy series from the seventies, in +the -- unlikely -- case you didn't know). It occurred to me one day +that I needed a name that was short, unique, and slightly mysterious. +And I happened to be reading some scripts from the series at the +time... So then I decided to call my language Python. +

+By now I don't care any more whether you use a Python, some other +snake, a foot or 16-ton weight, or a wood rat as a logo for Python! +

+ +Edit this entry / +Log info + +/ Last changed on Thu Aug 24 00:50:41 2000 by +GvR +

+ +


+

1.3. How do I obtain a copy of the Python source?

+The latest Python source distribution is always available from +python.org, at http://www.python.org/download. The latest development sources can be obtained via anonymous CVS from SourceForge, at http://www.sf.net/projects/python . +

+The source distribution is a gzipped tar file containing the complete C source, LaTeX +documentation, Python library modules, example programs, and several +useful pieces of freely distributable software. This will compile and +run out of the box on most UNIX platforms. (See section 7 for +non-UNIX information.) +

+Older versions of Python are also available from python.org. +

+ +Edit this entry / +Log info + +/ Last changed on Tue Apr 9 17:06:16 2002 by +A.M. Kuchling +

+ +


+

1.4. How do I get documentation on Python?

+All documentation is available on-line, starting at http://www.python.org/doc/. +

+The LaTeX source for the documentation is part of the source +distribution. If you don't have LaTeX, the latest Python +documentation set is available, in various formats like postscript +and html, by anonymous ftp - visit the above URL for links to the +current versions. +

+PostScript for a high-level description of Python is in the file nluug-paper.ps +(a separate file on the ftp site). +

+ +Edit this entry / +Log info + +/ Last changed on Wed Jan 21 12:02:55 1998 by +Ken Manheimer +

+ +


+

1.5. Are there other ftp sites that mirror the Python distribution?

+The following anonymous ftp sites keep mirrors of the Python +distribution: +

+USA: +

+

+        ftp://ftp.python.org/pub/python/
+        ftp://gatekeeper.dec.com/pub/plan/python/
+        ftp://ftp.uu.net/languages/python/
+        ftp://ftp.wustl.edu/graphics/graphics/sgi-stuff/python/
+        ftp://ftp.sterling.com/programming/languages/python/
+        ftp://uiarchive.cso.uiuc.edu/pub/lang/python/
+        ftp://ftp.pht.com/mirrors/python/python/
+	ftp://ftp.cdrom.com/pub/python/
+
+Europe: +

+

+        ftp://ftp.cwi.nl/pub/python/
+        ftp://ftp.funet.fi/pub/languages/python/
+        ftp://ftp.sunet.se/pub/lang/python/
+        ftp://unix.hensa.ac.uk/mirrors/uunet/languages/python/
+        ftp://ftp.lip6.fr/pub/python/
+        ftp://sunsite.cnlab-switch.ch/mirror/python/
+        ftp://ftp.informatik.tu-muenchen.de/pub/comp/programming/languages/python/
+
+Australia: +

+

+        ftp://ftp.dstc.edu.au/pub/python/
+
+

+ +Edit this entry / +Log info + +/ Last changed on Wed Mar 24 09:20:49 1999 by +A.M. Kuchling +

+ +


+

1.6. Is there a newsgroup or mailing list devoted to Python?

+There is a newsgroup, comp.lang.python, +and a mailing list. The newsgroup and mailing list are gatewayed into +each other -- if you can read news it's unnecessary to subscribe to +the mailing list. To subscribe to the mailing list +(python-list@python.org) visit its Mailman webpage at +http://www.python.org/mailman/listinfo/python-list +

+More info about the newsgroup and mailing list, and about other lists, +can be found at +http://www.python.org/psa/MailingLists.html. +

+Archives of the newsgroup are kept by Deja News and accessible +through the "Python newsgroup search" web page, +http://www.python.org/search/search_news.html. +This page also contains pointer to other archival collections. +

+ +Edit this entry / +Log info + +/ Last changed on Wed Jun 23 09:29:36 1999 by +GvR +

+ +


+

1.7. Is there a WWW page devoted to Python?

+Yes, http://www.python.org/ is the official Python home page. +

+ +Edit this entry / +Log info + +/ Last changed on Fri May 23 14:42:59 1997 by +Ken Manheimer +

+ +


+

1.8. Is the Python documentation available on the WWW?

+Yes. Python 2.0 documentation is available from +http://www.pythonlabs.com/tech/python2.0/doc/ and from +http://www.python.org/doc/. Note that most documentation +is available for on-line browsing as well as for downloading. +

+ +Edit this entry / +Log info + +/ Last changed on Tue Jan 2 03:14:08 2001 by +Moshe Zadka +

+ +


+

1.9. Are there any books on Python?

+Yes, many, and more are being published. See +the python.org Wiki at http://www.python.org/cgi-bin/moinmoin/PythonBooks for a list. +

+You can also search online bookstores for "Python" +(and filter out the Monty Python references; or +perhaps search for "Python" and "language"). +

+ +Edit this entry / +Log info + +/ Last changed on Mon Aug 5 19:08:49 2002 by +amk +

+ +


+

1.10. Are there any published articles about Python that I can reference?

+If you can't reference the web site, and you don't want to reference the books +(see previous question), there are several articles on Python that you could +reference. +

+Most publications about Python are collected on the Python web site: +

+

+    http://www.python.org/doc/Publications.html
+
+It is no longer recommended to reference this +very old article by Python's author: +

+

+    Guido van Rossum and Jelke de Boer, "Interactively Testing Remote
+    Servers Using the Python Programming Language", CWI Quarterly, Volume
+    4, Issue 4 (December 1991), Amsterdam, pp 283-303.
+
+

+ +Edit this entry / +Log info + +/ Last changed on Sat Jul 4 20:52:31 1998 by +GvR +

+ +


+

1.11. Are there short introductory papers or talks on Python?

+There are several - you can find links to some of them collected at +http://www.python.org/doc/Hints.html#intros. +

+ +Edit this entry / +Log info + +/ Last changed on Fri May 23 15:04:05 1997 by +Ken Manheimer +

+ +


+

1.12. How does the Python version numbering scheme work?

+Python versions are numbered A.B.C or A.B. A is the major version +number -- it is only incremented for really major changes in the +language. B is the minor version number, incremented for less +earth-shattering changes. C is the micro-level -- it is +incremented for each bugfix release. See PEP 6 for more information +about bugfix releases. +

+Not all releases have bugfix releases. +Note that in the past (ending with 1.5.2), +micro releases have added significant changes; +in fact the changeover from 0.9.9 to 1.0.0 was the first time +that either A or B changed! +

+Alpha, beta and release candidate versions have an additional suffixes. +The suffix for an alpha version is "aN" for some small number N, the +suffix for a beta version is "bN" for some small number N, and the +suffix for a release candidate version is "cN" for some small number N. +

+Note that (for instance) all versions labeled 2.0aN precede the +versions labeled 2.0bN, which precede versions labeled 2.0cN, and +those precede 2.0. +

+As a rule, no changes are made between release candidates and the final +release unless there are show-stopper bugs. +

+You may also find version numbers with a "+" suffix, e.g. "2.2+". +These are unreleased versions, built directly from the CVS trunk. +

+See also the documentation for sys.version, sys.hexversion, and +sys.version_info. +

+ +Edit this entry / +Log info + +/ Last changed on Mon Jan 14 06:34:17 2002 by +GvR +

+ +


+

1.13. How do I get a beta test version of Python?

+All releases, including alphas, betas and release candidates, are announced on +comp.lang.python and comp.lang.python.announce newsgroups, +which are gatewayed into the python-list@python.org and +python-announce@python.org. In addition, all these announcements appear on +the Python home page, at http://www.python.org. +

+You can also access the development version of Python through CVS. See http://sourceforge.net/cvs/?group_id=5470 for details. If you're not familiar with CVS, documents like http://linux.oreillynet.com/pub/a/linux/2002/01/03/cvs_intro.html +provide an introduction. +

+ +Edit this entry / +Log info + +/ Last changed on Mon Jun 3 00:57:08 2002 by +Neal Norwitz +

+ +


+

1.14. Are there copyright restrictions on the use of Python?

+Hardly. You can do anything you want with the source, as long as +you leave the copyrights in, and display those copyrights in any +documentation about Python that you produce. Also, don't use the +author's institute's name in publicity without prior written +permission, and don't hold them responsible for anything (read the +actual copyright for a precise legal wording). +

+In particular, if you honor the copyright rules, it's OK to use Python +for commercial use, to sell copies of Python in source or binary form, +or to sell products that enhance Python or incorporate Python (or part +of it) in some form. I would still like to know about all commercial +use of Python! +

+ +Edit this entry / +Log info +

+ +


+

1.15. Why was Python created in the first place?

+Here's a very brief summary of what got me started: +

+I had extensive experience with implementing an interpreted language +in the ABC group at CWI, and from working with this group I had +learned a lot about language design. This is the origin of many +Python features, including the use of indentation for statement +grouping and the inclusion of very-high-level data types (although the +details are all different in Python). +

+I had a number of gripes about the ABC language, but also liked many +of its features. It was impossible to extend the ABC language (or its +implementation) to remedy my complaints -- in fact its lack of +extensibility was one of its biggest problems. +I had some experience with using Modula-2+ and talked with the +designers of Modula-3 (and read the M3 report). M3 is the origin of +the syntax and semantics used for exceptions, and some other Python +features. +

+I was working in the Amoeba distributed operating system group at +CWI. We needed a better way to do system administration than by +writing either C programs or Bourne shell scripts, since Amoeba had +its own system call interface which wasn't easily accessible from the +Bourne shell. My experience with error handling in Amoeba made me +acutely aware of the importance of exceptions as a programming +language feature. +

+It occurred to me that a scripting language with a syntax like ABC +but with access to the Amoeba system calls would fill the need. I +realized that it would be foolish to write an Amoeba-specific +language, so I decided that I needed a language that was generally +extensible. +

+During the 1989 Christmas holidays, I had a lot of time on my hand, +so I decided to give it a try. During the next year, while still +mostly working on it in my own time, Python was used in the Amoeba +project with increasing success, and the feedback from colleagues made +me add many early improvements. +

+In February 1991, after just over a year of development, I decided +to post to USENET. The rest is in the Misc/HISTORY file. +

+ +Edit this entry / +Log info + +/ Last changed on Fri May 23 00:06:23 1997 by +GvR +

+ +


+

1.16. Do I have to like "Monty Python's Flying Circus"?

+No, but it helps. Pythonistas like the occasional reference to SPAM, +and of course, nobody expects the Spanish Inquisition +

+The two main reasons to use Python are: +

+

+ - Portable
+ - Easy to learn
+
+The three main reasons to use Python are: +

+

+ - Portable
+ - Easy to learn
+ - Powerful standard library
+
+(And nice red uniforms.) +

+And remember, there is no rule six. +

+ +Edit this entry / +Log info + +/ Last changed on Wed May 28 10:39:21 1997 by +GvR +

+ +


+

1.17. What is Python good for?

+Python is used in many situations where a great deal of dynamism, +ease of use, power, and flexibility are required. +

+In the area of basic text +manipulation core Python (without any non-core extensions) is easier +to use and is roughly as fast as just about any language, and this makes Python +good for many system administration type tasks and for CGI programming +and other application areas that manipulate text and strings and such. +

+When augmented with +standard extensions (such as PIL, COM, Numeric, oracledb, kjbuckets, +tkinter, win32api, etc.) +or special purpose extensions (that you write, perhaps using helper tools such +as SWIG, or using object protocols such as ILU/CORBA or COM) Python +becomes a very convenient "glue" or "steering" +language that helps make heterogeneous collections of unrelated +software packages work together. +For example by combining Numeric with oracledb you can help your +SQL database do statistical analysis, or even Fourier transforms. +One of the features that makes Python excel in the "glue language" role +is Python's simple, usable, and powerful C language runtime API. +

+Many developers also use Python extensively as a graphical user +interface development aide. +

+ +Edit this entry / +Log info + +/ Last changed on Sat May 24 10:13:11 1997 by +Aaron Watters +

+ +


+

1.18. Can I use the FAQ Wizard software to maintain my own FAQ?

+Sure. It's in Tools/faqwiz/ of the python source tree. +

+ +Edit this entry / +Log info + +/ Last changed on Fri Mar 29 06:50:32 2002 by +Aahz +

+ +


+

1.19. Which editor has good support for editing Python source code?

+On Unix, the first choice is Emacs/XEmacs. There's an elaborate +mode for editing Python code, which is available from the Python +source distribution (Misc/python-mode.el). It's also bundled +with XEmacs (we're still working on legal details to make it possible +to bundle it with FSF Emacs). And it has its own web page: +

+

+    http://www.python.org/emacs/python-mode/index.html
+
+There are many other choices, for Unix, Windows or Macintosh. +Richard Jones compiled a table from postings on the Python newsgroup: +

+

+    http://www.bofh.asn.au/~richard/editors.html
+
+See also FAQ question 7.10 for some more Mac and Win options. +

+ +Edit this entry / +Log info + +/ Last changed on Mon Jun 15 23:21:04 1998 by +Gvr +

+ +


+

1.20. I've never programmed before. Is there a Python tutorial?

+There are several, and at least one book. +All information for beginning Python programmers is collected here: +

+

+    http://www.python.org/doc/Newbies.html
+
+

+ +Edit this entry / +Log info + +/ Last changed on Wed Sep 5 05:34:07 2001 by +GvR +

+ +


+

1.21. Where in the world is www.python.org located?

+It's currently in Amsterdam, graciously hosted by XS4ALL: +

+

+    http://www.xs4all.nl
+
+Thanks to Thomas Wouters for setting this up!!!! +

+ +Edit this entry / +Log info + +/ Last changed on Fri Aug 3 21:49:27 2001 by +GvR +

+ +


+

2. Python in the real world

+ +
+

2.1. How many people are using Python?

+Certainly thousands, and quite probably tens of thousands of users. +More are seeing the light each day. The comp.lang.python newsgroup is +very active, but overall there is no accurate estimate of the number of subscribers or Python users. +

+Jacek Artymiak has created a Python Users Counter; you can see the +current count by visiting +http://www.wszechnica.safenet.pl/cgi-bin/checkpythonuserscounter.py +(this will not increment the counter; use the link there if you haven't +added yourself already). Most Python users appear not to have registered themselves. +

+ +Edit this entry / +Log info + +/ Last changed on Thu Feb 21 23:29:18 2002 by +GvR +

+ +


+

2.2. Have any significant projects been done in Python?

+At CWI (the former home of Python), we have written a 20,000 line +authoring environment for transportable hypermedia presentations, a +5,000 line multimedia teleconferencing tool, as well as many many +smaller programs. +

+At CNRI (Python's new home), we have written two large applications: +Grail, a fully featured web browser (see +http://grail.cnri.reston.va.us), +and the Knowbot Operating Environment, +a distributed environment for mobile code. +

+The University of Virginia uses Python to control a virtual reality +engine. See http://alice.cs.cmu.edu. +

+The ILU project at Xerox PARC can generate Python glue for ILU +interfaces. See ftp://ftp.parc.xerox.com/pub/ilu/ilu.html. ILU +is a free CORBA compliant ORB which supplies distributed object +connectivity to a host of platforms using a host of languages. +

+Mark Hammond and Greg Stein and others are interfacing Python to +Microsoft's COM and ActiveX architectures. This means, among other +things, that Python may be used in active server pages or as a COM +controller (for example to automatically extract from or insert information +into Excel or MSAccess or any other COM aware application). +Mark claims Python can even be a ActiveX scripting host (which +means you could embed JScript inside a Python application, if you +had a strange sense of humor). Python/AX/COM is distributed as part +of the PythonWin distribution. +

+The University of California, Irvine uses a student administration +system called TELE-Vision written entirely in Python. Contact: Ray +Price rlprice@uci.edu. +

+The Melbourne Cricket Ground (MCG) in Australia (a 100,000+ person venue) +has it's scoreboard system written largely in Python on MS Windows. +Python expressions are used to create almost every scoring entry that +appears on the board. The move to Python/C++ away from exclusive C++ +has provided a level of functionality that would simply not have been +viable otherwise. +

+See also the next question. +

+Note: this FAQ entry is really old. +See http://www.python.org/psa/Users.html for a more recent list. +

+ +Edit this entry / +Log info + +/ Last changed on Wed Oct 25 13:24:15 2000 by +GvR +

+ +


+

2.3. Are there any commercial projects going on using Python?

+Yes, there's lots of commercial activity using Python. See +http://www.python.org/psa/Users.html for a list. +

+ +Edit this entry / +Log info + +/ Last changed on Wed Oct 14 18:17:33 1998 by +ken +

+ +


+

2.4. How stable is Python?

+Very stable. New, stable releases have been coming out roughly every 3 to 12 months since 1991, and this seems likely to continue. +

+With the introduction of retrospective "bugfix" releases the stability of the language implementations can be, and is being, improved independently of the new features offered by more recent major or minor releases. Bugfix releases, indicated by a third component of the version number, only fix known problems and do not gratuitously introduce new and possibly incompatible features or modified library functionality. +

+Release 2.2 got its first bugfix on April 10, 2002. The new version +number is now 2.2.1. The 2.1 release, at 2.1.3, can probably be +considered the "most stable" platform because it has been bugfixed +twice. +

+ +Edit this entry / +Log info + +/ Last changed on Tue Jul 23 10:20:04 2002 by +Jens Kubieziel +

+ +


+

2.5. What new developments are expected for Python in the future?

+See http://www.python.org/peps/ for the Python Enhancement +Proposals (PEPs). PEPs are design +documents +describing a suggested new feature for Python, providing +a concise technical specification and a rationale. +

+Also, follow the discussions on the python-dev mailing list. +

+ +Edit this entry / +Log info + +/ Last changed on Tue Apr 9 17:09:51 2002 by +A.M. Kuchling +

+ +


+

2.6. Is it reasonable to propose incompatible changes to Python?

+In general, no. There are already millions of lines of Python code +around the world, so any changes in the language that invalidates more +than a very small fraction of existing programs has to be frowned +upon. Even if you can provide a conversion program, there still is +the problem of updating all documentation. Providing a gradual +upgrade path is the only way if a feature has to be changed. +

+See http://www.python.org/peps/pep-0005.html for the proposed +mechanism for creating backwards-incompatibilities. +

+ +Edit this entry / +Log info + +/ Last changed on Mon Apr 1 22:13:47 2002 by +Fred Drake +

+ +


+

2.7. What is the future of Python?

+Please see http://www.python.org/peps/ for proposals of future +activities. One of the PEPs (Python Enhancement Proposals) deals +with the PEP process and PEP format -- see +http://www.python.org/peps/pep-0001.html if you want to +submit a PEP. In http://www.python.org/peps/pep-0042.html there +is a list of wishlists the Python Development team plans to tackle. +

+ +Edit this entry / +Log info + +/ Last changed on Mon Apr 1 22:15:46 2002 by +Fred Drake +

+ +


+

2.8. What was the PSA, anyway?

+The Python Software Activity was +created by a number of Python aficionados who want Python to be more +than the product and responsibility of a single individual. +The PSA was not an independent organization, but lived +under the umbrealla of CNRI. +

+The PSA has been superseded by the Python Software Foundation, +an independent non-profit organization. The PSF's home page +is at http://www.python.org/psf/. +

+Some pages created by the PSA still live at +http://www.python.org/psa/ +

+ +Edit this entry / +Log info + +/ Last changed on Thu Jul 25 18:19:44 2002 by +GvR +

+ +


+

2.9. Deleted

+

+

+ +Edit this entry / +Log info + +/ Last changed on Tue Jan 2 02:51:30 2001 by +Moshe Zadka +

+ +


+

2.10. Deleted

+

+

+ +Edit this entry / +Log info + +/ Last changed on Tue Jan 2 02:52:19 2001 by +Moshe Zadka +

+ +


+

2.11. Is Python Y2K (Year 2000) Compliant?

+As of January, 2001 no major problems have been reported and Y2K +compliance seems to be a non-issue. +

+Since Python is available free of charge, there are no absolute +guarantees. If there are unforeseen problems, liability is the +user's rather than the developers', and there is nobody you can sue for damages. +

+Python does few +date manipulations, and what it does is all based on the Unix +representation for time (even on non-Unix systems) which uses seconds +since 1970 and won't overflow until 2038. +

+ +Edit this entry / +Log info + +/ Last changed on Mon Jan 8 17:19:32 2001 by +Steve Holden +

+ +


+

2.12. Is Python a good language in a class for beginning programmers?

+Yes. This long answer attempts to address any concerns you might +have with teaching Python as a programmer's first language. +(If you want to discuss Python's use in education, then +you may be interested in joining the edu-sig mailinglist. +See http://www.python.org/sigs/edu-sig/ ) +

+It is still common to start students with a procedural +(subset of a) statically typed language such as Pascal, C, or +a subset of C++ or Java. I think that students may be better +served by learning Python as their first language. Python has +a very simple and consistent syntax and a large standard library. +Most importantly, using Python in a beginning programming course +permits students to concentrate on important programming skills, +such as problem decomposition and data type design. +

+With Python, students can be quickly introduced to basic concepts +such as loops and procedures. They can even probably work with +user-defined objects in their very first course. They could +implement a tree structure as nested Python lists, for example. +They could be introduced to objects in their first course if +desired. For a student who has never programmed before, using +a statically typed language seems unnatural. It presents +additional complexity that the student must master and slows +the pace of the course. The students are trying to learn to +think like a computer, decompose problems, design consistent +interfaces, and encapsulate data. While learning to use a +statically typed language is important, it is not necessarily the +best topic to address in the students' first programming course. +

+Many other aspects of Python make it a good first language. +Python has a large standard library (like Java) so that +students can be assigned programming projects very early in the +course that do something. Assignments aren't restricted to the +standard four-function calculator and check balancing programs. +By using the standard library, students can gain the satisfaction +of working on realistic applications as they learn the fundamentals +of programming. Using the standard library also teaches students +about code reuse. +

+Python's interactive interpreter also enables students to +test language features while they're programming. They can keep +a window with the interpreter running while they enter their +programs' source in another window. If they can't remember the +methods for a list, they can do something like this: +

+

+ >>> L = []
+ >>> dir(L)
+ ['append', 'count', 'extend', 'index', 'insert', 'pop', 'remove',
+ 'reverse', 'sort']
+ >>> print L.append.__doc__
+ L.append(object) -- append object to end
+ >>> L.append(1)
+ >>> L
+ [1]
+
+With the interpreter, documentation is never far from the +student as he's programming. +

+There are also good IDEs for Python. Guido van Rossum's IDLE +is a cross-platform IDE for Python that is written in Python +using Tk. There is also a Windows specific IDE called PythonWin. +Emacs users will be happy to know that there is a very good Python +mode for Emacs. All of these programming environments provide +syntax highlighting, auto-indenting, and access to the interactive +interpreter while coding. For more information about IDEs, see XXX. +

+If your department is currently using Pascal because it was +designed to be a teaching language, then you'll be happy to +know that Guido van Rossum designed Python to be simple to +teach to everyone but powerful enough to implement real world +applications. Python makes a good language for first time +programmers because that was one of Python's design goals. +There are papers at http://www.python.org/doc/essays/ on the Python website +by Python's creator explaining his objectives for the language. +One that may interest you is titled "Computer Programming for Everybody" +http://www.python.org/doc/essays/cp4e.html +

+If you're seriously considering Python as a language for your +school, Guido van Rossum may even be willing to correspond with +you about how the language would fit in your curriculum. +See http://www.python.org/doc/FAQ.html#2.2 for examples of +Python's use in the "real world." +

+While Python, its source code, and its IDEs are freely +available, this consideration should not rule +out other languages. There are other free languages (Java, +free C compilers), and many companies are willing to waive some +or all of their fees for student programming tools if it +guarantees that a whole graduating class will know how to +use their tools. That is, if one of the requirements for +the language that will be taught is that it be freely +available, then Python qualifies, but this requirement +does not preclude other languages. +

+While Python jobs may not be as prevalent as C/C++/Java jobs, +teachers should not worry about teaching students critical job +skills in their first course. The skills that win students a +job are those they learn in their senior classes and internships. +Their first programming courses are there to lay a solid +foundation in programming fundamentals. The primary question +in choosing the language for such a course should be which +language permits the students to learn this material without +hindering or limiting them. +

+Another argument for Python is that there are many tasks for +which something like C++ is overkill. That's where languages +like Python, Perl, Tcl, and Visual Basic thrive. It's critical +for students to know something about these languages. (Every +employer for whom I've worked used at least one such language.) +Of the languages listed above, Python probably makes the best +language in a programming curriculum since its syntax is simple, +consistent, and not unlike other languages (C/C++/Java) that +are probably in the curriculum. By starting students with +Python, a department simultaneously lays the foundations for +other programming courses and introduces students to the type +of language that is often used as a "glue" language. As an +added bonus, Python can be used to interface with Microsoft's +COM components (thanks to Mark Hammond). There is also Jython, +a Java implementation of the Python interpreter, that can be +used to connect Java components. +

+If you currently start students with Pascal or C/C++ or Java, +you may be worried they will have trouble learning a statically +typed language after starting with Python. I think that this +fear most often stems from the fact that the teacher started +with a statically typed language, and we tend to like to teach +others in the same way we were taught. In reality, the +transition from Python to one of these other languages is +quite simple. +

+To motivate a statically typed language such as C++, begin the +course by explaining that unlike Python, their first language, +C++ is compiled to a machine dependent executable. Explain +that the point is to make a very fast executable. To permit +the compiler to make optimizations, programmers must help it +by specifying the "types" of variables. By restricting each +variable to a specific type, the compiler can reduce the +book-keeping it has to do to permit dynamic types. The compiler +also has to resolve references at compile time. Thus, the +language gains speed by sacrificing some of Python's dynamic +features. Then again, the C++ compiler provides type safety +and catches many bugs at compile time instead of run time (a +critical consideration for many commercial applications). C++ +is also designed for very large programs where one may want to +guarantee that others don't touch an object's implementation. +C++ provides very strong language features to separate an object's +implementation from its interface. Explain why this separation +is a good thing. +

+The first day of a C++ course could then be a whirlwind introduction +to what C++ requires and provides. The point here is that after +a semester or two of Python, students are hopefully competent +programmers. They know how to handle loops and write procedures. +They've also worked with objects, thought about the benefits of +consistent interfaces, and used the technique of subclassing to +specialize behavior. Thus, a whirlwind introduction to C++ could +show them how objects and subclassing looks in C++. The +potentially difficult concepts of object-oriented design were +taught without the additional obstacles presented by a language +such as C++ or Java. When learning one of these languages, +the students would already understand the "road map." They +understand objects; they would just be learning how objects +fit in a statically typed languages. Language requirements +and compiler errors that seem unnatural to beginning programmers +make sense in this new context. Many students will find it +helpful to be able to write a fast prototype of their algorithms +in Python. Thus, they can test and debug their ideas before +they attempt to write the code in the new language, saving the +effort of working with C++ types for when they've discovered a +working solution for their assignments. When they get annoyed +with the rigidity of types, they'll be happy to learn about +containers and templates to regain some of the lost flexibility +Python afforded them. Students may also gain an appreciation +for the fact that no language is best for every task. They'll +see that C++ is faster, but they'll know that they can gain +flexibility and development speed with a Python when execution +speed isn't critical. +

+If you have any concerns that weren't addressed here, try +posting to the Python newsgroup. Others there have done some +work with using Python as an instructional tool. Good luck. +We'd love to hear about it if you choose Python for your course. +

+ +Edit this entry / +Log info + +/ Last changed on Mon Dec 2 19:32:35 2002 by +Bill Sconce +

+ +


+

3. Building Python and Other Known Bugs

+ +
+

3.1. Is there a test set?

+Sure. You can run it after building with "make test", or you can +run it manually with this command at the Python prompt: +

+

+ import test.autotest
+
+In Python 1.4 or earlier, use +

+

+ import autotest
+
+The test set doesn't test all features of Python, +but it goes a long way to confirm that Python is actually working. +

+NOTE: if "make test" fails, don't just mail the output to the +newsgroup -- this doesn't give enough information to debug the +problem. Instead, find out which test fails, and run that test +manually from an interactive interpreter. For example, if +"make test" reports that test_spam fails, try this interactively: +

+

+ import test.test_spam
+
+This generally produces more verbose output which can be diagnosed +to debug the problem. If you find a bug in Python or the libraries, or in the tests, please report this in the Python bug tracker at SourceForge: +

+http://sourceforge.net/tracker/?func=add&group_id=5470&atid=105470 +

+ +Edit this entry / +Log info + +/ Last changed on Fri Apr 27 10:29:36 2001 by +Fred Drake +

+ +


+

3.2. When running the test set, I get complaints about floating point operations, but when playing with floating point operations I cannot find anything wrong with them.

+The test set makes occasional unwarranted assumptions about the +semantics of C floating point operations. Until someone donates a +better floating point test set, you will have to comment out the +offending floating point tests and execute similar tests manually. +

+ +Edit this entry / +Log info +

+ +


+

3.3. Link errors after rerunning the configure script.

+It is generally necessary to run "make clean" after a configuration +change. +

+ +Edit this entry / +Log info +

+ +


+

3.4. The python interpreter complains about options passed to a script (after the script name).

+You are probably linking with GNU getopt, e.g. through -liberty. +Don't. The reason for the complaint is that GNU getopt, unlike System +V getopt and other getopt implementations, doesn't consider a +non-option to be the end of the option list. A quick (and compatible) +fix for scripts is to add "--" to the interpreter, like this: +

+

+        #! /usr/local/bin/python --
+
+You can also use this interactively: +

+

+        python -- script.py [options]
+
+Note that a working getopt implementation is provided in the Python +distribution (in Python/getopt.c) but not automatically used. +

+ +Edit this entry / +Log info +

+ +


+

3.5. When building on the SGI, make tries to run python to create glmodule.c, but python hasn't been built or installed yet.

+Comment out the line mentioning glmodule.c in Setup and build a +python without gl first; install it or make sure it is in your $PATH, +then edit the Setup file again to turn on the gl module, and make +again. You don't need to do "make clean"; you do need to run "make +Makefile" in the Modules subdirectory (or just run "make" at the +toplevel). +

+ +Edit this entry / +Log info +

+ +


+

3.6. I use VPATH but some targets are built in the source directory.

+On some systems (e.g. Sun), if the target already exists in the +source directory, it is created there instead of in the build +directory. This is usually because you have previously built without +VPATH. Try running "make clobber" in the source directory. +

+ +Edit this entry / +Log info +

+ +


+

3.7. Trouble building or linking with the GNU readline library.

+You can use the GNU readline library to improve the interactive user +interface: this gives you line editing and command history when +calling python interactively. Its sources are distributed with +Python (at least for 2.0). Uncomment the line +

+#readline readline.c -lreadline -ltermcap +

+in Modules/Setup. The configuration option --with-readline +is no longer supported, at least in Python 2.0. Some hints on +building and using the readline library: +On SGI IRIX 5, you may have to add the following +to rldefs.h: +

+

+        #ifndef sigmask
+        #define sigmask(sig) (1L << ((sig)-1))
+        #endif
+
+On some systems, you will have to add #include "rldefs.h" to the +top of several source files, and if you use the VPATH feature, you +will have to add dependencies of the form foo.o: foo.c to the +Makefile for several values of foo. +The readline library requires use of the termcap library. A +known problem with this is that it contains entry points which +cause conflicts with the STDWIN and SGI GL libraries. The STDWIN +conflict can be solved by adding a line saying '#define werase w_erase' to the +stdwin.h file (in the STDWIN distribution, subdirectory H). The +GL conflict has been solved in the Python configure script by a +hack that forces use of the static version of the termcap library. +Check the newsgroup gnu.bash.bug news:gnu.bash.bug for +specific problems with the readline library (I don't read this group +but I've been told that it is the place for readline bugs). +

+ +Edit this entry / +Log info + +/ Last changed on Sat Dec 2 18:23:48 2000 by +Issac Trotts +

+ +


+

3.8. Trouble with socket I/O on older Linux 1.x versions.

+Once you've built Python, use it to run the regen script in the +Lib/plat-linux2 directory. Apparently the files as distributed don't match the system headers on some Linux versions. +

+Note that this FAQ entry only applies to Linux kernel versions 1.x.y; +these are hardly around any more. +

+ +Edit this entry / +Log info + +/ Last changed on Tue Jul 30 20:05:52 2002 by +Jens Kubieziel +

+ +


+

3.9. Trouble with prototypes on Ultrix.

+Ultrix cc seems broken -- use gcc, or edit config.h to #undef +HAVE_PROTOTYPES. +

+ +Edit this entry / +Log info +

+ +


+

3.10. Other trouble building Python on platform X.

+Please submit the details to the SourceForge bug tracker: +

+

+  http://sourceforge.net/tracker/?group_id=5470&atid=105470
+
+and we'll look +into it. Please provide as many details as possible. In particular, +if you don't tell us what type of computer and what operating system +(and version) you are using it will be difficult for us to figure out +what is the matter. If you have compilation output logs, +please use file uploads -- don't paste everything in the message box. +

+In many cases, we won't have access to the same hardware or operating system version, so please, if you have a SourceForge account, log in before filing your report, or if you don't have an account, include an email address at which we can reach you for further questions. Logging in to SourceForge first will also cause SourceForge to send you updates as we act on your report. +

+ +Edit this entry / +Log info + +/ Last changed on Fri Apr 27 10:53:18 2001 by +Fred Drake +

+ +


+

3.11. How to configure dynamic loading on Linux.

+This is now automatic as long as your Linux version uses the ELF +object format (all recent Linuxes do). +

+ +Edit this entry / +Log info +

+ +


+

3.12. I can't get shared modules to work on Linux 2.0 (Slackware96)?

+This is a bug in the Slackware96 release. The fix is simple: Make sure +that there is a link from /lib/libdl.so to /lib/libdl.so.1 so that the +following links are setup: /lib/libdl.so -> /lib/libdl.so.1 +/lib/libdl.so.1 -> /lib/libdl.so.1.7.14 You may have to rerun the +configure script, after rm'ing the config.cache file, before you +attempt to rebuild python after this fix. +

+ +Edit this entry / +Log info + +/ Last changed on Wed May 21 15:45:03 1997 by +GvR +

+ +


+

3.13. Trouble when making modules shared on Linux.

+This happens when you have built Python for static linking and then +enable +
+  *shared*
+
+in the Setup file. Shared library code must be +compiled with "-fpic". If a .o file for the module already exist that +was compiled for static linking, you must remove it or do "make clean" +in the Modules directory. +

+ +Edit this entry / +Log info + +/ Last changed on Fri May 23 13:42:30 1997 by +GvR +

+ +


+

3.14. [deleted]

+[ancient information on threads on linux (when thread support +was not standard) used to be here] +

+ +Edit this entry / +Log info + +/ Last changed on Sun Jun 2 17:27:13 2002 by +Erno Kuusela +

+ +


+

3.15. Errors when linking with a shared library containing C++ code.

+Link the main Python binary with C++. Change the definition of +LINKCC in Modules/Makefile to be your C++ compiler. You may have to +edit config.c slightly to make it compilable with C++. +

+ +Edit this entry / +Log info +

+ +


+

3.16. Deleted

+

+

+ +Edit this entry / +Log info + +/ Last changed on Tue Sep 11 16:02:22 2001 by +GvR +

+ +


+

3.17. Deleted.

+

+

+ +Edit this entry / +Log info + +/ Last changed on Tue Sep 11 15:54:57 2001 by +GvR +

+ +


+

3.18. Compilation or link errors for the _tkinter module

+Most likely, there's a version mismatch between the Tcl/Tk header +files (tcl.h and tk.h) and the Tcl/Tk libraries you are using e.g. +"-ltk8.0" and "-ltcl8.0" arguments for _tkinter in the Setup file). +It is possible to install several versions of the Tcl/Tk libraries, +but there can only be one version of the tcl.h and tk.h header +files. If the library doesn't match the header, you'll get +problems, either when linking the module, or when importing it. +Fortunately, the version number is clearly stated in each file, +so this is easy to find. Reinstalling and using the latest +version usually fixes the problem. +

+(Also note that when compiling unpatched Python 1.5.1 against +Tcl/Tk 7.6/4.2 or older, you get an error on Tcl_Finalize. See +the 1.5.1 patch page at http://www.python.org/1.5/patches-1.5.1/.) +

+ +Edit this entry / +Log info + +/ Last changed on Thu Jun 11 00:49:14 1998 by +Gvr +

+ +


+

3.19. I configured and built Python for Tcl/Tk but "import Tkinter" fails.

+Most likely, you forgot to enable the line in Setup that says +"TKPATH=:$(DESTLIB)/tkinter". +

+ +Edit this entry / +Log info +

+ +


+

3.20. [deleted]

+[ancient information on a gcc+tkinter bug on alpha was here] +

+ +Edit this entry / +Log info + +/ Last changed on Mon Jun 3 16:46:23 2002 by +Erno Kuusela +

+ +


+

3.21. Several common system calls are missing from the posix module.

+Most likely, all test compilations run by the configure script +are failing for some reason or another. Have a look in config.log to +see what could be the reason. A common reason is specifying a +directory to the --with-readline option that doesn't contain the +libreadline.a file. +

+ +Edit this entry / +Log info +

+ +


+

3.22. ImportError: No module named string, on MS Windows.

+Most likely, your PYTHONPATH environment variable should be set to +something like: +

+set PYTHONPATH=c:\python;c:\python\lib;c:\python\scripts +

+(assuming Python was installed in c:\python) +

+ +Edit this entry / +Log info +

+ +


+

3.23. Core dump on SGI when using the gl module.

+There are conflicts between entry points in the termcap and curses +libraries and an entry point in the GL library. There's a hack of a +fix for the termcap library if it's needed for the GNU readline +library, but it doesn't work when you're using curses. Concluding, +you can't build a Python binary containing both the curses and gl +modules. +

+ +Edit this entry / +Log info +

+ +


+

3.24. "Initializer not a constant" while building DLL on MS-Windows

+Static type object initializers in extension modules may cause compiles to +fail with an error message like "initializer not a constant". +Fredrik Lundh <Fredrik.Lundh@image.combitech.se> explains: +

+This shows up when building DLL under MSVC. There's two ways to +address this: either compile the module as C++, or change your code to +something like: +

+

+  statichere PyTypeObject bstreamtype = {
+      PyObject_HEAD_INIT(NULL) /* must be set by init function */
+      0,
+      "bstream",
+      sizeof(bstreamobject),
+
+
+  ...
+
+
+  void
+  initbstream()
+  {
+      /* Patch object type */
+      bstreamtype.ob_type = &PyType_Type;
+      Py_InitModule("bstream", functions);
+      ...
+  }
+
+

+ +Edit this entry / +Log info + +/ Last changed on Sun May 25 14:58:05 1997 by +Aaron Watters +

+ +


+

3.25. Output directed to a pipe or file disappears on Linux.

+Some people have reported that when they run their script +interactively, it runs great, but that when they redirect it +to a pipe or file, no output appears. +

+

+    % python script.py
+    ...some output...
+    % python script.py >file
+    % cat file
+    % # no output
+    % python script.py | cat
+    % # no output
+    %
+
+This was a bug in Linux kernel. It is fixed and should not appear anymore. So most Linux users are not affected by this. +

+If redirection doesn't work on your Linux system, check what shell you are using. Shells like (t)csh doesn't support redirection. +

+ +Edit this entry / +Log info + +/ Last changed on Thu Jan 16 13:38:30 2003 by +Jens Kubieziel +

+ +


+

3.26. [deleted]

+[ancient libc/linux problem was here] +

+ +Edit this entry / +Log info + +/ Last changed on Mon Jun 3 16:48:08 2002 by +Erno Kuusela +

+ +


+

3.27. [deleted]

+[ancient linux + threads + tk problem was described here] +

+ +Edit this entry / +Log info + +/ Last changed on Mon Jun 3 16:49:08 2002 by +Erno Kuusela +

+ +


+

3.28. How can I test if Tkinter is working?

+Try the following: +

+

+  python
+  >>> import _tkinter
+  >>> import Tkinter
+  >>> Tkinter._test()
+
+This should pop up a window with two buttons, +one "Click me" and one "Quit". +

+If the first statement (import _tkinter) fails, your Python +installation probably has not been configured to support Tcl/Tk. +On Unix, if you have installed Tcl/Tk, you have to rebuild Python +after editing the Modules/Setup file to enable the _tkinter module +and the TKPATH environment variable. +

+It is also possible to get complaints about Tcl/Tk version +number mismatches or missing TCL_LIBRARY or TK_LIBRARY +environment variables. These have to do with Tcl/Tk installation +problems. +

+A common problem is to have installed versions of tcl.h and tk.h +that don't match the installed version of the Tcl/Tk libraries; +this usually results in linker errors or (when using dynamic +loading) complaints about missing symbols during loading +the shared library. +

+ +Edit this entry / +Log info + +/ Last changed on Thu Aug 28 17:01:46 1997 by +Guido van Rossum +

+ +


+

3.29. Is there a way to get the interactive mode of the python interpreter to perform function/variable name completion?

+(From a posting by Guido van Rossum) +

+On Unix, if you have enabled the readline module (i.e. if Emacs-style +command line editing and bash-style history works for you), you can +add this by importing the undocumented standard library module +"rlcompleter". When completing a simple identifier, it +completes keywords, built-ins and globals in __main__; when completing +NAME.NAME..., it evaluates (!) the expression up to the last dot and +completes its attributes. +

+This way, you can do "import string", type "string.", hit the +completion key twice, and see the list of names defined by the +string module. +

+Tip: to use the tab key as the completion key, call +

+

+    readline.parse_and_bind("tab: complete")
+
+You can put this in a ~/.pythonrc file, and set the PYTHONSTARTUP +environment variable to ~/.pythonrc. This will cause the completion to be enabled +whenever you run Python interactively. +

+Notes (see the docstring for rlcompleter.py for more information): +

+* The evaluation of the NAME.NAME... form may cause arbitrary +application defined code to be executed if an object with a +__getattr__ hook is found. Since it is the responsibility of the +application (or the user) to enable this feature, I consider this an +acceptable risk. More complicated expressions (e.g. function calls or +indexing operations) are not evaluated. +

+* GNU readline is also used by the built-in functions input() and +raw_input(), and thus these also benefit/suffer from the complete +features. Clearly an interactive application can benefit by +specifying its own completer function and using raw_input() for all +its input. +

+* When stdin is not a tty device, GNU readline is never +used, and this module (and the readline module) are silently inactive. +

+ +Edit this entry / +Log info + +/ Last changed on Fri Jun 12 09:55:24 1998 by +A.M. Kuchling +

+ +


+

3.30. Why is the Python interpreter not built as a shared library?

+(This is a Unix question; on Mac and Windows, it is a shared +library.) +

+It's just a nightmare to get this to work on all different platforms. +Shared library portability is a pain. And yes, I know about GNU libtool +-- but it requires me to use its conventions for filenames etc, and it +would require a complete and utter rewrite of all the makefile and +config tools I'm currently using. +

+In practice, few applications embed Python -- it's much more common to +have Python extensions, which already are shared libraries. Also, +serious embedders often want total control over which Python version +and configuration they use so they wouldn't want to use a standard +shared library anyway. So while the motivation of saving space +when lots of apps embed Python is nice in theory, I +doubt that it will save much in practice. (Hence the low priority I +give to making a shared library.) +

+For Linux systems, the simplest method of producing libpython1.5.so seems to +be (originally from the Minotaur project web page, +http://www.equi4.com/minotaur/minotaur.html): +

+

+  make distclean 
+  ./configure 
+  make OPT="-fpic -O2" 
+  mkdir .extract 
+  (cd .extract; ar xv ../libpython1.5.a) 
+  gcc -shared -o libpython1.5.so .extract/*.o 
+  rm -rf .extract
+
+In Python 2.3 this will be supported by the standard build routine +(at least on Linux) with --enable-shared. Note however that there +is little advantage, and it slows down Python because of the need +for PIC code and the extra cost at startup time to find the library. +

+ +Edit this entry / +Log info + +/ Last changed on Thu May 30 13:36:55 2002 by +GvR +

+ +


+

3.31. Build with GCC on Solaris 2.6 (SunOS 5.6) fails

+If you have upgraded Solaris 2.5 or 2.5.1 to Solaris 2.6, +but you have not upgraded +your GCC installation, the compile may fail, e.g. like this: +

+

+ In file included from /usr/include/sys/stream.h:26,
+                  from /usr/include/netinet/in.h:38,
+                  from /usr/include/netdb.h:96,
+                  from ./socketmodule.c:121:
+ /usr/include/sys/model.h:32: #error "No DATAMODEL_NATIVE specified"
+
+Solution: rebuild GCC for Solaris 2.6. +You might be able to simply re-run fixincludes, but +people have had mixed success with doing that. +

+ +Edit this entry / +Log info + +/ Last changed on Wed Oct 21 11:18:46 1998 by +GvR +

+ +


+

3.32. Running "make clean" seems to leave problematic files that cause subsequent builds to fail.

+Use "make clobber" instead. +

+Use "make clean" to reduce the size of the source/build directory +after you're happy with your build and installation. +If you have already tried to build python and you'd like to start +over, you should use "make clobber". It does a "make clean" and also +removes files such as the partially built Python library from a previous build. +

+ +Edit this entry / +Log info + +/ Last changed on Thu Jun 24 20:39:26 1999 by +TAB +

+ +


+

3.33. Submitting bug reports and patches

+To report a bug or submit a patch, please use the relevant service +from the Python project at SourceForge. +

+Bugs: http://sourceforge.net/tracker/?group_id=5470&atid=105470 +

+Patches: http://sourceforge.net/tracker/?group_id=5470&atid=305470 +

+If you have a SourceForge account, please log in before submitting your bug report; this will make it easier for us to contact you regarding your report in the event we have follow-up questions. It will also enable SourceForge to send you update information as we act on your bug. If you do not have a SourceForge account, please consider leaving your name and email address as part of the report. +

+ +Edit this entry / +Log info + +/ Last changed on Fri Apr 27 10:58:26 2001 by +Fred Drake +

+ +


+

3.34. I can't load shared libraries under Python 1.5.2, Solaris 7, and gcc 2.95.2

+When trying to load shared libraries, you may see errors like: +ImportError: ld.so.1: python: fatal: relocation error: file /usr/local/lib/python1.5/site-packages/Perp/util/du_SweepUtilc.so: +
+ symbol PyExc_RuntimeError: referenced symbol not found
+
+

+There is a problem with the configure script for Python 1.5.2 +under Solaris 7 with gcc 2.95 . configure should set the make variable +LINKFORSHARED=-Xlinker -export-dynamic +

+

+in Modules/Makefile, +

+Manually add this line to the Modules/Makefile. +This builds a Python executable that can load shared library extensions (xxx.so) . +

+ +Edit this entry / +Log info + +/ Last changed on Mon Feb 19 10:37:05 2001 by +GvR +

+ +


+

3.35. In the regression test, test___all__ fails for the profile module. What's wrong?

+If you have been using the profile module, and have properly calibrated a copy of the module as described in the documentation for the profiler: +

+http://www.python.org/doc/current/lib/profile-calibration.html +

+then it is possible that the regression test "test___all__" will fail if you run the regression test manually rather than using "make test" in the Python source directory. This will happen if you have set your PYTHONPATH environment variable to include the directory containing your calibrated profile module. You have probably calibrated the profiler using an older version of the profile module which does not define the __all__ value, added to the module as of Python 2.1. +

+The problem can be fixed by removing the old calibrated version of the profile module and using the latest version to do a fresh calibration. In general, you will need to re-calibrate for each version of Python anyway, since the performance characteristics can change in subtle ways that impact profiling. +

+ +Edit this entry / +Log info + +/ Last changed on Fri Apr 27 10:44:10 2001 by +Fred Drake +

+ +


+

3.36. relocations remain against allocatable but non-writable sections

+This linker error occurs on Solaris if you attempt to build an extension module which incorporates position-dependent (non-PIC) code. A common source of problems is that a static library (.a file), such as libreadline.a or libcrypto.a is linked with the extension module. The error specifically occurs when using gcc as the compiler, but /usr/ccs/bin/ld as the linker. +

+The following solutions and work-arounds are known: +

+1. Rebuild the libraries (libreadline, libcrypto) with -fPIC (-KPIC if using the system compiler). This is recommended; all object files in a shared library should be position-independent. +

+2. Statically link the extension module and its libraries into the Python interpreter, by editing Modules/Setup. +

+3. Use GNU ld instead of /usr/ccs/bin/ld; GNU ld will accept non-PIC code in shared libraries (and mark the section writable) +

+4. Pass -mimpure-text to GCC when linking the module. This will force gcc to not pass -z text to ld; in turn, ld will make all text sections writable. +

+Options 3 and 4 are not recommended, since the ability to share code across processes is lost. +

+ +Edit this entry / +Log info + +/ Last changed on Tue Jan 29 12:05:11 2002 by +Martin v. Löwis +

+ +


+

4. Programming in Python

+ +
+

4.1. Is there a source code level debugger with breakpoints, step, etc.?

+Yes. +

+Module pdb is a rudimentary but adequate console-mode debugger for Python. It is part of the standard Python library, and is documented in the Library Reference Manual. (You can also write your own debugger by using the code for pdb as an example.) +

+The IDLE interactive development environment, which is part of the standard Python distribution (normally available in Tools/idle), includes a graphical debugger. There is documentation for the IDLE debugger at http://www.python.org/idle/doc/idle2.html#Debugger +

+Pythonwin is a Python IDE that includes a GUI debugger based on bdb. The Pythonwin debugger colors breakpoints and has quite a few cool features (including debugging non-Pythonwin programs). A reference can be found at http://www.python.org/ftp/python/pythonwin/pwindex.html +More recent versions of PythonWin are available as a part of the ActivePython distribution (see http://www.activestate.com/Products/ActivePython/index.html). +

+Pydb is a version of the standard Python debugger pdb, modified for use with DDD (Data Display Debugger), a popular graphical debugger front end. Pydb can be found at http://packages.debian.org/unstable/devel/pydb.html +and DDD can be found at http://www.gnu.org/software/ddd/ +

+There are a number of commmercial Python IDEs that include graphical debuggers. They include: +

+

+ * Wing IDE (http://wingide.com/) 
+ * Komodo IDE (http://www.activestate.com/Products/Komodo/)
+
+

+ +Edit this entry / +Log info + +/ Last changed on Tue Jan 28 01:43:41 2003 by +Stephen Ferg +

+ +


+

4.2. Can I create an object class with some methods implemented in C and others in Python (e.g. through inheritance)? (Also phrased as: Can I use a built-in type as base class?)

+In Python 2.2, you can inherit from builtin classes such as int, list, dict, etc. +

+In previous versions of Python, you can easily create a Python class which serves as a wrapper around a built-in object, e.g. (for dictionaries): +

+

+        # A user-defined class behaving almost identical
+        # to a built-in dictionary.
+        class UserDict:
+                def __init__(self): self.data = {}
+                def __repr__(self): return repr(self.data)
+                def __cmp__(self, dict):
+                        if type(dict) == type(self.data):
+                                return cmp(self.data, dict)
+                        else:
+                                return cmp(self.data, dict.data)
+                def __len__(self): return len(self.data)
+                def __getitem__(self, key): return self.data[key]
+                def __setitem__(self, key, item): self.data[key] = item
+                def __delitem__(self, key): del self.data[key]
+                def keys(self): return self.data.keys()
+                def items(self): return self.data.items()
+                def values(self): return self.data.values()
+                def has_key(self, key): return self.data.has_key(key)
+
+A2. See Jim Fulton's ExtensionClass for an example of a mechanism +which allows you to have superclasses which you can inherit from in +Python -- that way you can have some methods from a C superclass (call +it a mixin) and some methods from either a Python superclass or your +subclass. ExtensionClass is distributed as a part of Zope (see +http://www.zope.org), but will be phased out with Zope 3, since +Zope 3 uses Python 2.2 or later which supports direct inheritance +from built-in types. Here's a link to the original paper about +ExtensionClass: +http://debian.acm.ndsu.nodak.edu/doc/python-extclass/ExtensionClass.html +

+A3. The Boost Python Library (BPL, http://www.boost.org/libs/python/doc/index.html) +provides a way of doing this from C++ (i.e. you can inherit from an +extension class written in C++ using the BPL). +

+ +Edit this entry / +Log info + +/ Last changed on Tue May 28 21:09:52 2002 by +GvR +

+ +


+

4.3. Is there a curses/termcap package for Python?

+The standard Python source distribution comes with a curses module in +the Modules/ subdirectory, though it's not compiled by default (note +that this is not available in the Windows distribution -- there is +no curses module for Windows). +

+In Python versions before 2.0 the module only supported plain curses; +you couldn't use ncurses features like colors with it (though it would +link with ncurses). +

+In Python 2.0, the curses module has been greatly extended, starting +from Oliver Andrich's enhanced version, to provide many additional +functions from ncurses and SYSV curses, such as colour, alternative +character set support, pads, and mouse support. This means the +module is no longer compatible with operating systems that only +have BSD curses, but there don't seem to be any currently +maintained OSes that fall into this category. +

+ +Edit this entry / +Log info + +/ Last changed on Sun Jun 23 20:24:06 2002 by +Tim Peters +

+ +


+

4.4. Is there an equivalent to C's onexit() in Python?

+For Python 2.0: The new atexit module provides a register function that +is similar to C's onexit. See the Library Reference for details. For +2.0 you should not assign to sys.exitfunc! +

+For Python 1.5.2: You need to import sys and assign a function to +sys.exitfunc, it will be called when your program exits, is +killed by an unhandled exception, or (on UNIX) receives a +SIGHUP or SIGTERM signal. +

+ +Edit this entry / +Log info + +/ Last changed on Thu Dec 28 12:14:55 2000 by +Bjorn Pettersen +

+ +


+

4.5. [deleted]

+[python used to lack nested scopes, it was explained here] +

+ +Edit this entry / +Log info + +/ Last changed on Thu Mar 21 05:18:22 2002 by +Erno Kuusela +

+ +


+

4.6. How do I iterate over a sequence in reverse order?

+If it is a list, the fastest solution is +

+

+        list.reverse()
+        try:
+                for x in list:
+                        "do something with x"
+        finally:
+                list.reverse()
+
+This has the disadvantage that while you are in the loop, the list +is temporarily reversed. If you don't like this, you can make a copy. +This appears expensive but is actually faster than other solutions: +

+

+        rev = list[:]
+        rev.reverse()
+        for x in rev:
+                <do something with x>
+
+If it's not a list, a more general but slower solution is: +

+

+        for i in range(len(sequence)-1, -1, -1):
+                x = sequence[i]
+                <do something with x>
+
+A more elegant solution, is to define a class which acts as a sequence +and yields the elements in reverse order (solution due to Steve +Majewski): +

+

+        class Rev:
+                def __init__(self, seq):
+                        self.forw = seq
+                def __len__(self):
+                        return len(self.forw)
+                def __getitem__(self, i):
+                        return self.forw[-(i + 1)]
+
+You can now simply write: +

+

+        for x in Rev(list):
+                <do something with x>
+
+Unfortunately, this solution is slowest of all, due to the method +call overhead... +

+ +Edit this entry / +Log info + +/ Last changed on Sun May 25 21:10:50 1997 by +GvR +

+ +


+

4.7. My program is too slow. How do I speed it up?

+That's a tough one, in general. There are many tricks to speed up +Python code; I would consider rewriting parts in C only as a last +resort. One thing to notice is that function and (especially) method +calls are rather expensive; if you have designed a purely OO interface +with lots of tiny functions that don't do much more than get or set an +instance variable or call another method, you may consider using a +more direct way, e.g. directly accessing instance variables. Also see +the standard module "profile" (described in the Library Reference +manual) which makes it possible to find out where +your program is spending most of its time (if you have some patience +-- the profiling itself can slow your program down by an order of +magnitude). +

+Remember that many standard optimization heuristics you +may know from other programming experience may well apply +to Python. For example it may be faster to send output to output +devices using larger writes rather than smaller ones in order to +avoid the overhead of kernel system calls. Thus CGI scripts +that write all output in "one shot" may be notably faster than +those that write lots of small pieces of output. +

+Also, be sure to use "aggregate" operations where appropriate. +For example the "slicing" feature allows programs to chop up +lists and other sequence objects in a single tick of the interpreter +mainloop using highly optimized C implementations. Thus to +get the same effect as +

+

+  L2 = []
+  for i in range[3]:
+       L2.append(L1[i])
+
+it is much shorter and far faster to use +

+

+  L2 = list(L1[:3]) # "list" is redundant if L1 is a list.
+
+Note that the map() function, particularly used with +builtin methods or builtin functions can be a convenient +accelerator. For example to pair the elements of two +lists together: +

+

+  >>> map(None, [1,2,3], [4,5,6])
+  [(1, 4), (2, 5), (3, 6)]
+
+or to compute a number of sines: +

+

+  >>> map( math.sin, (1,2,3,4))
+  [0.841470984808, 0.909297426826, 0.14112000806,   -0.756802495308]
+
+The map operation completes very quickly in such cases. +

+Other examples of aggregate operations include the join and split +methods of string objects. For example if s1..s7 are large (10K+) strings then +"".join([s1,s2,s3,s4,s5,s6,s7]) may be far faster than +the more obvious s1+s2+s3+s4+s5+s6+s7, since the "summation" +will compute many subexpressions, whereas join does all +copying in one pass. For manipulating strings also consider the +regular expression libraries and the "substitution" operations +String % tuple and String % dictionary. Also be sure to use +the list.sort builtin method to do sorting, and see FAQ's 4.51 +and 4.59 for examples of moderately advanced usage -- list.sort beats +other techniques for sorting in all but the most extreme +circumstances. +

+There are many other aggregate operations +available in the standard libraries and in contributed libraries +and extensions. +

+Another common trick is to "push loops into functions or methods." +For example suppose you have a program that runs slowly and you +use the profiler (profile.run) to determine that a Python function ff +is being called lots of times. If you notice that ff +

+

+   def ff(x):
+       ...do something with x computing result...
+       return result
+
+tends to be called in loops like (A) +

+

+   list = map(ff, oldlist)
+
+or (B) +

+

+   for x in sequence:
+       value = ff(x)
+       ...do something with value...
+
+then you can often eliminate function call overhead by rewriting +ff to +

+

+   def ffseq(seq):
+       resultseq = []
+       for x in seq:
+           ...do something with x computing result...
+           resultseq.append(result)
+       return resultseq
+
+and rewrite (A) to +

+

+    list = ffseq(oldlist)
+
+and (B) to +

+

+    for value in ffseq(sequence):
+        ...do something with value...
+
+Other single calls ff(x) translate to ffseq([x])[0] with little +penalty. Of course this technique is not always appropriate +and there are other variants, which you can figure out. +

+You can gain some performance by explicitly storing the results of +a function or method lookup into a local variable. A loop like +

+

+    for key in token:
+        dict[key] = dict.get(key, 0) + 1
+
+resolves dict.get every iteration. If the method isn't going to +change, a faster implementation is +

+

+    dict_get = dict.get  # look up the method once
+    for key in token:
+        dict[key] = dict_get(key, 0) + 1
+
+Default arguments can be used to determine values once, at +compile time instead of at run time. This can only be done for +functions or objects which will not be changed during program +execution, such as replacing +

+

+    def degree_sin(deg):
+        return math.sin(deg * math.pi / 180.0)
+
+with +

+

+    def degree_sin(deg, factor = math.pi/180.0, sin = math.sin):
+        return sin(deg * factor)
+
+Because this trick uses default arguments for terms which should +not be changed, it should only be used when you are not concerned +with presenting a possibly confusing API to your users. +

+

+For an anecdote related to optimization, see +

+

+	http://www.python.org/doc/essays/list2str.html
+
+

+ +Edit this entry / +Log info + +/ Last changed on Mon Jun 3 01:03:54 2002 by +Neal Norwitz +

+ +


+

4.8. When I have imported a module, then edit it, and import it again (into the same Python process), the changes don't seem to take place. What is going on?

+For reasons of efficiency as well as consistency, Python only reads +the module file on the first time a module is imported. (Otherwise a +program consisting of many modules, each of which imports the same +basic module, would read the basic module over and over again.) To +force rereading of a changed module, do this: +

+

+        import modname
+        reload(modname)
+
+Warning: this technique is not 100% fool-proof. In particular, +modules containing statements like +

+

+        from modname import some_objects
+
+will continue to work with the old version of the imported objects. +

+ +Edit this entry / +Log info +

+ +


+

4.9. How do I find the current module name?

+A module can find out its own module name by looking at the +(predefined) global variable __name__. If this has the value +'__main__' you are running as a script. +

+ +Edit this entry / +Log info +

+ +


+

4.10. I have a module in which I want to execute some extra code when it is run as a script. How do I find out whether I am running as a script?

+See the previous question. E.g. if you put the following on the +last line of your module, main() is called only when your module is +running as a script: +

+

+        if __name__ == '__main__': main()
+
+

+ +Edit this entry / +Log info +

+ +


+

4.11. I try to run a program from the Demo directory but it fails with ImportError: No module named ...; what gives?

+This is probably an optional module (written in C!) which hasn't +been configured on your system. This especially happens with modules +like "Tkinter", "stdwin", "gl", "Xt" or "Xm". For Tkinter, STDWIN and +many other modules, see Modules/Setup.in for info on how to add these +modules to your Python, if it is possible at all. Sometimes you will +have to ftp and build another package first (e.g. Tcl and Tk for Tkinter). +Sometimes the module only works on specific platforms (e.g. gl only works +on SGI machines). +

+NOTE: if the complaint is about "Tkinter" (upper case T) and you have +already configured module "tkinter" (lower case t), the solution is +not to rename tkinter to Tkinter or vice versa. There is probably +something wrong with your module search path. Check out the value of +sys.path. +

+For X-related modules (Xt and Xm) you will have to do more work: they +are currently not part of the standard Python distribution. You will +have to ftp the Extensions tar file, i.e. +ftp://ftp.python.org/pub/python/src/X-extension.tar.gz and follow +the instructions there. +

+ +Edit this entry / +Log info + +/ Last changed on Wed Feb 12 21:31:08 2003 by +Jens Kubieziel +

+ +


+

4.12. [deleted]

+[stdwin (long dead windowing library) entry deleted] +

+ +Edit this entry / +Log info + +/ Last changed on Thu Mar 21 08:30:13 2002 by +Erno Kuusela +

+ +


+

4.13. What GUI toolkits exist for Python?

+Depending on what platform(s) you are aiming at, there are several. +

+Currently supported solutions: +

+Cross-platform: +

+Tk: +

+There's a neat object-oriented interface to the Tcl/Tk widget set, +called Tkinter. It is part of the standard Python distribution and +well-supported -- all you need to do is build and install Tcl/Tk and +enable the _tkinter module and the TKPATH definition in Modules/Setup +when building Python. This is probably the easiest to install and +use, and the most complete widget set. It is also very likely that in +the future the standard Python GUI API will be based on or at least +look very much like the Tkinter interface. For more info about Tk, +including pointers to the source, see the Tcl/Tk home page at +http://www.scriptics.com. Tcl/Tk is now fully +portable to the Mac and Windows platforms (NT and 95 only); you need +Python 1.4beta3 or later and Tk 4.1patch1 or later. +

+wxWindows: +

+There's an interface to wxWindows called wxPython. wxWindows is a +portable GUI class library written in C++. It supports GTK, Motif, +MS-Windows and Mac as targets. Ports to other platforms are being +contemplated or have already had some work done on them. wxWindows +preserves the look and feel of the underlying graphics toolkit, and +there is quite a rich widget set and collection of GDI classes. +See the wxWindows page at http://www.wxwindows.org/ for more details. +wxPython is a python extension module that wraps many of the wxWindows +C++ classes, and is quickly gaining popularity amongst Python +developers. You can get wxPython as part of the source or CVS +distribution of wxWindows, or directly from its home page at +http://alldunn.com/wxPython/. +

+Gtk+: +

+PyGtk bindings for the Gtk+ Toolkit by James Henstridge exist; see ftp://ftp.daa.com.au/pub/james/python/. Note that there are two incompatible bindings. If you are using Gtk+ 1.2.x you should get the 0.6.x PyGtk bindings from +

+

+    ftp://ftp.gtk.org/pub/python/v1.2
+
+If you plan to use Gtk+ 2.0 with Python (highly recommended if you are just starting with Gtk), get the most recent distribution from +

+

+    ftp://ftp.gtk.org/pub/python/v2.0
+
+If you are adventurous, you can also check out the source from the Gnome CVS repository. Set your CVS directory to :pserver:anonymous@anoncvs.gnome.org:/cvs/gnome and check the gnome-python module out from the repository. +

+Other: +

+There are also bindings available for the Qt toolkit (PyQt), and for KDE (PyKDE); see http://www.thekompany.com/projects/pykde/. +

+For OpenGL bindings, see http://starship.python.net/~da/PyOpenGL. +

+Platform specific: +

+The Mac port has a rich and ever-growing set of modules that support +the native Mac toolbox calls. See the documentation that comes with +the Mac port. See ftp://ftp.python.org/pub/python/mac. Support +by Jack Jansen jack@cwi.nl. +

+Pythonwin by Mark Hammond (MHammond@skippinet.com.au) +includes an interface to the Microsoft Foundation +Classes and a Python programming environment using it that's written +mostly in Python. See http://www.python.org/windows/. +

+There's an object-oriented GUI based on the Microsoft Foundation +Classes model called WPY, supported by Jim Ahlstrom jim@interet.com. +Programs written in WPY run unchanged and with native look and feel on +Windows NT/95, Windows 3.1 (using win32s), and on Unix (using Tk). +Source and binaries for Windows and Linux are available in +ftp://ftp.python.org/pub/python/wpy/. +

+Obsolete or minority solutions: +

+There's an interface to X11, including the Athena and Motif widget +sets (and a few individual widgets, like Mosaic's HTML widget and +SGI's GL widget) available from +ftp://ftp.python.org/pub/python/src/X-extension.tar.gz. +Support by Sjoerd Mullender sjoerd@cwi.nl. +

+On top of the X11 interface there's the vpApp +toolkit by Per Spilling, now also maintained by Sjoerd Mullender +sjoerd@cwi.nl. See ftp://ftp.cwi.nl/pub/sjoerd/vpApp.tar.gz. +

+For SGI IRIX only, there are unsupported interfaces to the complete +GL (Graphics Library -- low level but very good 3D capabilities) as +well as to FORMS (a buttons-and-sliders-etc package built on top of GL +by Mark Overmars -- ftp'able from +ftp://ftp.cs.ruu.nl/pub/SGI/FORMS/). This is probably also +becoming obsolete, as OpenGL takes over (see above). +

+There's an interface to STDWIN, a platform-independent low-level +windowing interface for Mac and X11. This is totally unsupported and +rapidly becoming obsolete. The STDWIN sources are at +ftp://ftp.cwi.nl/pub/stdwin/. +

+There is an interface to WAFE, a Tcl interface to the X11 +Motif and Athena widget sets. WAFE is at +http://www.wu-wien.ac.at/wafe/wafe.html. +

+ +Edit this entry / +Log info + +/ Last changed on Mon May 13 21:40:39 2002 by +Skip Montanaro +

+ +


+

4.14. Are there any interfaces to database packages in Python?

+Yes! See the Database Topic Guide at +http://www.python.org/topics/database/ for details. +

+ +Edit this entry / +Log info + +/ Last changed on Tue Jan 4 20:12:19 2000 by +Barney Warplug +

+ +


+

4.15. Is it possible to write obfuscated one-liners in Python?

+Yes. See the following three examples, due to Ulf Bartelt: +

+

+        # Primes < 1000
+        print filter(None,map(lambda y:y*reduce(lambda x,y:x*y!=0,
+        map(lambda x,y=y:y%x,range(2,int(pow(y,0.5)+1))),1),range(2,1000)))
+
+
+        # First 10 Fibonacci numbers
+        print map(lambda x,f=lambda x,f:(x<=1) or (f(x-1,f)+f(x-2,f)): f(x,f),
+        range(10))
+
+
+        # Mandelbrot set
+        print (lambda Ru,Ro,Iu,Io,IM,Sx,Sy:reduce(lambda x,y:x+y,map(lambda y,
+        Iu=Iu,Io=Io,Ru=Ru,Ro=Ro,Sy=Sy,L=lambda yc,Iu=Iu,Io=Io,Ru=Ru,Ro=Ro,i=IM,
+        Sx=Sx,Sy=Sy:reduce(lambda x,y:x+y,map(lambda x,xc=Ru,yc=yc,Ru=Ru,Ro=Ro,
+        i=i,Sx=Sx,F=lambda xc,yc,x,y,k,f=lambda xc,yc,x,y,k,f:(k<=0)or (x*x+y*y
+        >=4.0) or 1+f(xc,yc,x*x-y*y+xc,2.0*x*y+yc,k-1,f):f(xc,yc,x,y,k,f):chr(
+        64+F(Ru+x*(Ro-Ru)/Sx,yc,0,0,i)),range(Sx))):L(Iu+y*(Io-Iu)/Sy),range(Sy
+        ))))(-2.1, 0.7, -1.2, 1.2, 30, 80, 24)
+        #    \___ ___/  \___ ___/  |   |   |__ lines on screen
+        #        V          V      |   |______ columns on screen
+        #        |          |      |__________ maximum of "iterations"
+        #        |          |_________________ range on y axis
+        #        |____________________________ range on x axis
+
+Don't try this at home, kids! +

+ +Edit this entry / +Log info + +/ Last changed on Wed May 21 15:48:33 1997 by +GvR +

+ +


+

4.16. Is there an equivalent of C's "?:" ternary operator?

+Not directly. In many cases you can mimic a?b:c with "a and b or +c", but there's a flaw: if b is zero (or empty, or None -- anything +that tests false) then c will be selected instead. In many cases you +can prove by looking at the code that this can't happen (e.g. because +b is a constant or has a type that can never be false), but in general +this can be a problem. +

+Tim Peters (who wishes it was Steve Majewski) suggested the following +solution: (a and [b] or [c])[0]. Because [b] is a singleton list it +is never false, so the wrong path is never taken; then applying [0] to +the whole thing gets the b or c that you really wanted. Ugly, but it +gets you there in the rare cases where it is really inconvenient to +rewrite your code using 'if'. +

+As a last resort it is possible to implement the "?:" operator as a function: +

+

+    def q(cond,on_true,on_false):
+        from inspect import isfunction
+
+
+        if cond:
+            if not isfunction(on_true): return on_true
+            else: return apply(on_true)
+        else:
+            if not isfunction(on_false): return on_false 
+            else: return apply(on_false)
+
+In most cases you'll pass b and c directly: q(a,b,c). To avoid evaluating b +or c when they shouldn't be, encapsulate them +within a lambda function, e.g.: q(a,lambda: b, lambda: c). +

+

+

+It has been asked why Python has no if-then-else expression, +since most language have one; it is a frequently requested feature. +

+There are several possible answers: just as many languages do +just fine without one; it can easily lead to less readable code; +no sufficiently "Pythonic" syntax has been discovered; a search +of the standard library found remarkably few places where using an +if-then-else expression would make the code more understandable. +

+Nevertheless, in an effort to decide once and for all whether +an if-then-else expression should be added to the language, +PEP 308 (http://www.python.org/peps/pep-0308.html) has been +put forward, proposing a specific syntax. The community can +now vote on this issue. +

+ +Edit this entry / +Log info + +/ Last changed on Fri Feb 7 19:41:13 2003 by +David Goodger +

+ +


+

4.17. My class defines __del__ but it is not called when I delete the object.

+There are several possible reasons for this. +

+The del statement does not necessarily call __del__ -- it simply +decrements the object's reference count, and if this reaches zero +__del__ is called. +

+If your data structures contain circular links (e.g. a tree where +each child has a parent pointer and each parent has a list of +children) the reference counts will never go back to zero. You'll +have to define an explicit close() method which removes those +pointers. Please don't ever call __del__ directly -- __del__ should +call close() and close() should make sure that it can be called more +than once for the same object. +

+If the object has ever been a local variable (or argument, which is +really the same thing) to a function that caught an expression in an +except clause, chances are that a reference to the object still exists +in that function's stack frame as contained in the stack trace. +Normally, deleting (better: assigning None to) sys.exc_traceback will +take care of this. If a stack was printed for an unhandled +exception in an interactive interpreter, delete sys.last_traceback +instead. +

+There is code that deletes all objects when the interpreter exits, +but it is not called if your Python has been configured to support +threads (because other threads may still be active). You can define +your own cleanup function using sys.exitfunc (see question 4.4). +

+Finally, if your __del__ method raises an exception, a warning message is printed to sys.stderr. +

+

+Starting with Python 2.0, a garbage collector periodically reclaims the space used by most cycles with no external references. (See the "gc" module documentation for details.) There are, however, pathological cases where it can be expected to fail. Moreover, the garbage collector runs some time after the last reference to your data structure vanishes, so your __del__ method may be called at an inconvenient and random time. This is inconvenient if you're trying to reproduce a problem. Worse, the order in which object's __del__ methods are executed is arbitrary. +

+Another way to avoid cyclical references is to use the "weakref" module, which allows you to point to objects without incrementing their reference count. Tree data structures, for instance, should use weak references for their parent and sibling pointers (if they need them!). +

+Question 6.14 is intended to explain the new garbage collection algorithm. +

+ +Edit this entry / +Log info + +/ Last changed on Mon Jun 10 15:27:28 2002 by +Matthias Urlichs +

+ +


+

4.18. How do I change the shell environment for programs called using os.popen() or os.system()? Changing os.environ doesn't work.

+You must be using either a version of python before 1.4, or on a +(rare) system that doesn't have the putenv() library function. +

+Before Python 1.4, modifying the environment passed to subshells was +left out of the interpreter because there seemed to be no +well-established portable way to do it (in particular, some systems, +have putenv(), others have setenv(), and some have none at all). As +of Python 1.4, almost all Unix systems do have putenv(), and so does +the Win32 API, and thus the os module was modified so that changes to +os.environ are trapped and the corresponding putenv() call is made. +

+ +Edit this entry / +Log info +

+ +


+

4.19. What is a class?

+A class is the particular object type created by executing +a class statement. Class objects are used as templates, to create +instance objects, which embody both the data structure +(attributes) and program routines (methods) specific to a datatype. +

+A class can be based on one or more other classes, called its base +class(es). It then inherits the attributes and methods of its base classes. This allows an object model to be successively refined +by inheritance. +

+The term "classic class" is used to refer to the original +class implementation in Python. One problem with classic +classes is their inability to use the built-in data types +(such as list and dictionary) as base classes. Starting +with Python 2.2 an attempt is in progress to unify user-defined +classes and built-in types. It is now possible to declare classes +that inherit from built-in types. +

+ +Edit this entry / +Log info + +/ Last changed on Mon May 27 01:31:21 2002 by +Steve Holden +

+ +


+

4.20. What is a method?

+A method is a function that you normally call as +x.name(arguments...) for some object x. The term is used for methods +of classes and class instances as well as for methods of built-in +objects. (The latter have a completely different implementation and +only share the way their calls look in Python code.) Methods of +classes (and class instances) are defined as functions inside the +class definition. +

+ +Edit this entry / +Log info +

+ +


+

4.21. What is self?

+Self is merely a conventional name for the first argument of a +method -- i.e. a function defined inside a class definition. A method +defined as meth(self, a, b, c) should be called as x.meth(a, b, c) for +some instance x of the class in which the definition occurs; +the called method will think it is called as meth(x, a, b, c). +

+ +Edit this entry / +Log info +

+ +


+

4.22. What is an unbound method?

+An unbound method is a method defined in a class that is not yet +bound to an instance. You get an unbound method if you ask for a +class attribute that happens to be a function. You get a bound method +if you ask for an instance attribute. A bound method knows which +instance it belongs to and calling it supplies the instance automatically; +an unbound method only knows which class it wants for its first +argument (a derived class is also OK). Calling an unbound method +doesn't "magically" derive the first argument from the context -- you +have to provide it explicitly. +

+Trivia note regarding bound methods: each reference to a bound +method of a particular object creates a bound method object. If you +have two such references (a = inst.meth; b = inst.meth), they will +compare equal (a == b) but are not the same (a is not b). +

+ +Edit this entry / +Log info + +/ Last changed on Wed May 6 18:07:25 1998 by +Clarence Gardner +

+ +


+

4.23. How do I call a method defined in a base class from a derived class that overrides it?

+If your class definition starts with "class Derived(Base): ..." +then you can call method meth defined in Base (or one of Base's base +classes) as Base.meth(self, arguments...). Here, Base.meth is an +unbound method (see previous question). +

+ +Edit this entry / +Log info +

+ +


+

4.24. How do I call a method from a base class without using the name of the base class?

+DON'T DO THIS. REALLY. I MEAN IT. It appears that you could call +self.__class__.__bases__[0].meth(self, arguments...) but this fails when +a doubly-derived method is derived from your class: for its instances, +self.__class__.__bases__[0] is your class, not its base class -- so +(assuming you are doing this from within Derived.meth) you would start +a recursive call. +

+Often when you want to do this you are forgetting that classes +are first class in Python. You can "point to" the class you want +to delegate an operation to either at the instance or at the +subclass level. For example if you want to use a "glorp" +operation of a superclass you can point to the right superclass +to use. +

+

+  class subclass(superclass1, superclass2, superclass3):
+      delegate_glorp = superclass2
+      ...
+      def glorp(self, arg1, arg2):
+            ... subclass specific stuff ...
+            self.delegate_glorp.glorp(self, arg1, arg2)
+       ...
+
+
+  class subsubclass(subclass):
+       delegate_glorp = superclass3
+       ...
+
+Note, however that setting delegate_glorp to subclass in +subsubclass would cause an infinite recursion on subclass.delegate_glorp. Careful! Maybe you are getting too fancy for your own good. Consider simplifying the design (?). +

+ +Edit this entry / +Log info + +/ Last changed on Mon Jul 28 13:58:22 1997 by +aaron watters +

+ +


+

4.25. How can I organize my code to make it easier to change the base class?

+You could define an alias for the base class, assign the real base +class to it before your class definition, and use the alias throughout +your class. Then all you have to change is the value assigned to the +alias. Incidentally, this trick is also handy if you want to decide +dynamically (e.g. depending on availability of resources) which base +class to use. Example: +

+

+        BaseAlias = <real base class>
+        class Derived(BaseAlias):
+                def meth(self):
+                        BaseAlias.meth(self)
+                        ...
+
+

+ +Edit this entry / +Log info + +/ Last changed on Wed May 21 15:49:57 1997 by +GvR +

+ +


+

4.26. How can I find the methods or attributes of an object?

+This depends on the object type. +

+For an instance x of a user-defined class, instance attributes are +found in the dictionary x.__dict__, and methods and attributes defined +by its class are found in x.__class__.__bases__[i].__dict__ (for i in +range(len(x.__class__.__bases__))). You'll have to walk the tree of +base classes to find all class methods and attributes. +

+Many, but not all built-in types define a list of their method names +in x.__methods__, and if they have data attributes, their names may be +found in x.__members__. However this is only a convention. +

+For more information, read the source of the standard (but +undocumented) module newdir. +

+ +Edit this entry / +Log info +

+ +


+

4.27. I can't seem to use os.read() on a pipe created with os.popen().

+os.read() is a low-level function which takes a file descriptor (a +small integer). os.popen() creates a high-level file object -- the +same type used for sys.std{in,out,err} and returned by the builtin +open() function. Thus, to read n bytes from a pipe p created with +os.popen(), you need to use p.read(n). +

+ +Edit this entry / +Log info +

+ +


+

4.28. How can I create a stand-alone binary from a Python script?

+Even though there are Python compilers being developed, +you probably don't need a real compiler, if all you want +is a stand-alone program. There are three solutions to that. +

+One is to use the freeze tool, which is included in the Python +source tree as Tools/freeze. It converts Python byte +code to C arrays. Using a C compiler, you can embed all +your modules into a new program, which is then linked +with the standard Python modules. +

+It works by scanning your source recursively for import statements +(in both forms) and looking for the modules in the standard Python path +as well as in the source directory (for built-in modules). It then +1 the modules written in Python to C code (array initializers +that can be turned into code objects using the marshal module) and +creates a custom-made config file that only contains those built-in +modules which are actually used in the program. It then compiles the +generated C code and links it with the rest of the Python interpreter +to form a self-contained binary which acts exactly like your script. +

+(Hint: the freeze program only works if your script's filename ends in +".py".) +

+There are several utilities which may be helpful. The first is Gordon McMillan's installer at +

+

+    http://www.mcmillan-inc.com/install1.html
+
+which works on Windows, Linux and at least some forms of Unix. +

+Another is Thomas Heller's py2exe (Windows only) at +

+

+    http://starship.python.net/crew/theller/py2exe/
+
+A third is Christian Tismer's SQFREEZE +(http://starship.python.net/crew/pirx/) which appends the byte code +to a specially-prepared Python interpreter, which +will find the byte code in executable. +

+A fourth is Fredrik Lundh's Squeeze +(http://www.pythonware.com/products/python/squeeze/). +

+ +Edit this entry / +Log info + +/ Last changed on Wed Jun 19 14:01:30 2002 by +Gordon McMillan +

+ +


+

4.29. What WWW tools are there for Python?

+See the chapters titled "Internet Protocols and Support" and +"Internet Data Handling" in the Library Reference +Manual. Python is full of good things which will help you build server-side and client-side web systems. +

+A summary of available frameworks is maintained by Paul Boddie at +

+

+    http://thor.prohosting.com/~pboddie/Python/web_modules.html
+
+Cameron Laird maintains a useful set of pages about Python web technologies at +

+

+   http://starbase.neosoft.com/~claird/comp.lang.python/web_python.html/
+
+There was a web browser written in Python, called Grail -- +see http://sourceforge.net/project/grail/. This project has been terminated; http://cvs.sourceforge.net/cgi-bin/viewcvs.cgi/grail/grail/README gives more details. +

+ +Edit this entry / +Log info + +/ Last changed on Mon Nov 11 22:48:25 2002 by +GvR +

+ +


+

4.30. How do I run a subprocess with pipes connected to both input and output?

+Use the standard popen2 module. For example: +

+

+	import popen2
+	fromchild, tochild = popen2.popen2("command")
+	tochild.write("input\n")
+	tochild.flush()
+	output = fromchild.readline()
+
+Warning: in general, it is unwise to +do this, because you can easily cause a deadlock where your +process is blocked waiting for output from the child, while the child +is blocked waiting for input from you. This can be caused +because the parent expects the child to output more text than it does, +or it can be caused by data being stuck in stdio buffers due to lack +of flushing. The Python parent can of course explicitly flush the data +it sends to the child before it reads any output, but if the child is +a naive C program it can easily have been written to never explicitly +flush its output, even if it is interactive, since flushing is +normally automatic. +

+Note that a deadlock is also possible if you use popen3 to read +stdout and stderr. If one of the two is too large for the internal +buffer (increasing the buffersize does not help) and you read() +the other one first, there is a deadlock, too. +

+Note on a bug in popen2: unless your program calls wait() +or waitpid(), finished child processes are never removed, +and eventually calls to popen2 will fail because of a limit on +the number of child processes. Calling os.waitpid with the +os.WNOHANG option can prevent this; a good place to insert such +a call would be before calling popen2 again. +

+Another way to produce a deadlock: Call a wait() and there is +still more output from the program than what fits into the +internal buffers. +

+In many cases, all you really need is to run some data through a +command and get the result back. Unless the data is infinite in size, +the easiest (and often the most efficient!) way to do this is to write +it to a temporary file and run the command with that temporary file as +input. The standard module tempfile exports a function mktemp() which +generates unique temporary file names. +

+

+ import tempfile
+ import os
+ class Popen3:
+    """
+    This is a deadlock-save version of popen, that returns
+    an object with errorlevel, out (a string) and err (a string).
+    (capturestderr may not work under windows.)
+    Example: print Popen3('grep spam','\n\nhere spam\n\n').out
+    """
+    def __init__(self,command,input=None,capturestderr=None):
+        outfile=tempfile.mktemp()
+        command="( %s ) > %s" % (command,outfile)
+        if input:
+            infile=tempfile.mktemp()
+            open(infile,"w").write(input)
+            command=command+" <"+infile
+        if capturestderr:
+            errfile=tempfile.mktemp()
+            command=command+" 2>"+errfile
+        self.errorlevel=os.system(command) >> 8
+        self.out=open(outfile,"r").read()
+        os.remove(outfile)
+        if input:
+            os.remove(infile)
+        if capturestderr:
+            self.err=open(errfile,"r").read()
+            os.remove(errfile)
+
+Note that many interactive programs (e.g. vi) don't work well with +pipes substituted for standard input and output. You will have to use +pseudo ttys ("ptys") instead of pipes. There is some undocumented +code to use these in the library module pty.py -- I'm afraid you're on +your own here. +

+A different answer is a Python interface to Don Libes' "expect" +library. A Python extension that interfaces to expect is called "expy" +and available from +http://expectpy.sourceforge.net/. +

+A pure Python solution that works like expect is pexpect of Noah Spurrier. +A beta version is available from +http://pexpect.sourceforge.net/ +

+ +Edit this entry / +Log info + +/ Last changed on Tue Sep 3 16:31:31 2002 by +Tobias Polzin +

+ +


+

4.31. How do I call a function if I have the arguments in a tuple?

+Use the built-in function apply(). For instance, +

+

+    func(1, 2, 3)
+
+is equivalent to +

+

+    args = (1, 2, 3)
+    apply(func, args)
+
+Note that func(args) is not the same -- it calls func() with exactly +one argument, the tuple args, instead of three arguments, the integers +1, 2 and 3. +

+In Python 2.0, you can also use extended call syntax: +

+f(*args) is equivalent to apply(f, args) +

+ +Edit this entry / +Log info + +/ Last changed on Tue Jan 2 03:42:50 2001 by +Moshe Zadka +

+ +


+

4.32. How do I enable font-lock-mode for Python in Emacs?

+If you are using XEmacs 19.14 or later, any XEmacs 20, FSF Emacs 19.34 +or any Emacs 20, font-lock should work automatically for you if you +are using the latest python-mode.el. +

+If you are using an older version of XEmacs or Emacs you will need +to put this in your .emacs file: +

+

+        (defun my-python-mode-hook ()
+          (setq font-lock-keywords python-font-lock-keywords)
+          (font-lock-mode 1))
+        (add-hook 'python-mode-hook 'my-python-mode-hook)
+
+

+ +Edit this entry / +Log info + +/ Last changed on Mon Apr 6 16:18:46 1998 by +Barry Warsaw +

+ +


+

4.33. Is there a scanf() or sscanf() equivalent?

+Not as such. +

+For simple input parsing, the easiest approach is usually to split +the line into whitespace-delimited words using string.split(), and to +convert decimal strings to numeric values using int(), +long() or float(). (Python's int() is 32-bit and its +long() is arbitrary precision.) string.split supports an optional +"sep" parameter which is useful if the line uses something other +than whitespace as a delimiter. +

+For more complicated input parsing, regular expressions (see module re) +are better suited and more powerful than C's sscanf(). +

+There's a contributed module that emulates sscanf(), by Steve Clift; +see contrib/Misc/sscanfmodule.c of the ftp site: +

+

+    http://www.python.org/ftp/python/contrib-09-Dec-1999/Misc/
+
+

+ +Edit this entry / +Log info + +/ Last changed on Mon Jun 3 01:07:51 2002 by +Neal Norwitz +

+ +


+

4.34. Can I have Tk events handled while waiting for I/O?

+Yes, and you don't even need threads! But you'll have to +restructure your I/O code a bit. Tk has the equivalent of Xt's +XtAddInput() call, which allows you to register a callback function +which will be called from the Tk mainloop when I/O is possible on a +file descriptor. Here's what you need: +

+

+        from Tkinter import tkinter
+        tkinter.createfilehandler(file, mask, callback)
+
+The file may be a Python file or socket object (actually, anything +with a fileno() method), or an integer file descriptor. The mask is +one of the constants tkinter.READABLE or tkinter.WRITABLE. The +callback is called as follows: +

+

+        callback(file, mask)
+
+You must unregister the callback when you're done, using +

+

+        tkinter.deletefilehandler(file)
+
+Note: since you don't know *how many bytes* are available for reading, +you can't use the Python file object's read or readline methods, since +these will insist on reading a predefined number of bytes. For +sockets, the recv() or recvfrom() methods will work fine; for other +files, use os.read(file.fileno(), maxbytecount). +

+ +Edit this entry / +Log info +

+ +


+

4.35. How do I write a function with output parameters (call by reference)?

+[Mark Lutz] The thing to remember is that arguments are passed by +assignment in Python. Since assignment just creates references to +objects, there's no alias between an argument name in the caller and +callee, and so no call-by-reference per se. But you can simulate it +in a number of ways: +

+1) By using global variables; but you probably shouldn't :-) +

+2) By passing a mutable (changeable in-place) object: +

+

+      def func1(a):
+          a[0] = 'new-value'     # 'a' references a mutable list
+          a[1] = a[1] + 1        # changes a shared object
+
+
+      args = ['old-value', 99]
+      func1(args)
+      print args[0], args[1]     # output: new-value 100
+
+3) By returning a tuple, holding the final values of arguments: +

+

+      def func2(a, b):
+          a = 'new-value'        # a and b are local names
+          b = b + 1              # assigned to new objects
+          return a, b            # return new values
+
+
+      x, y = 'old-value', 99
+      x, y = func2(x, y)
+      print x, y                 # output: new-value 100
+
+4) And other ideas that fall-out from Python's object model. For instance, it might be clearer to pass in a mutable dictionary: +

+

+      def func3(args):
+          args['a'] = 'new-value'     # args is a mutable dictionary
+          args['b'] = args['b'] + 1   # change it in-place
+
+
+      args = {'a':' old-value', 'b': 99}
+      func3(args)
+      print args['a'], args['b']
+
+5) Or bundle-up values in a class instance: +

+

+      class callByRef:
+          def __init__(self, **args):
+              for (key, value) in args.items():
+                  setattr(self, key, value)
+
+
+      def func4(args):
+          args.a = 'new-value'        # args is a mutable callByRef
+          args.b = args.b + 1         # change object in-place
+
+
+      args = callByRef(a='old-value', b=99)
+      func4(args)
+      print args.a, args.b
+
+
+   But there's probably no good reason to get this complicated :-).
+
+[Python's author favors solution 3 in most cases.] +

+ +Edit this entry / +Log info + +/ Last changed on Sun Jun 8 23:49:46 1997 by +David Ascher +

+ +


+

4.36. Please explain the rules for local and global variables in Python.

+[Ken Manheimer] In Python, procedure variables are implicitly +global, unless they are assigned anywhere within the block. +In that case +they are implicitly local, and you need to explicitly declare them as +'global'. +

+Though a bit surprising at first, a moment's consideration explains +this. On one hand, requirement of 'global' for assigned vars provides +a bar against unintended side-effects. On the other hand, if global +were required for all global references, you'd be using global all the +time. Eg, you'd have to declare as global every reference to a +builtin function, or to a component of an imported module. This +clutter would defeat the usefulness of the 'global' declaration for +identifying side-effects. +

+ +Edit this entry / +Log info + +/ Last changed on Fri Aug 28 09:53:27 1998 by +GvR +

+ +


+

4.37. How can I have modules that mutually import each other?

+Suppose you have the following modules: +

+foo.py: +

+

+	from bar import bar_var
+	foo_var=1
+
+bar.py: +

+

+	from foo import foo_var
+	bar_var=2
+
+The problem is that the above is processed by the interpreter thus: +

+

+	main imports foo
+	Empty globals for foo are created
+	foo is compiled and starts executing
+	foo imports bar
+	Empty globals for bar are created
+	bar is compiled and starts executing
+	bar imports foo (which is a no-op since there already is a module named foo)
+	bar.foo_var = foo.foo_var
+	...
+
+The last step fails, because Python isn't done with interpreting foo yet and the global symbol dict for foo is still empty. +

+The same thing happens when you use "import foo", and then try to access "foo.one" in global code. +

+

+There are (at least) three possible workarounds for this problem. +

+Guido van Rossum recommends to avoid all uses of "from <module> import ..." (so everything from an imported module is referenced as <module>.<name>) and to place all code inside functions. Initializations of global variables and class variables should use constants or built-in functions only. +

+

+Jim Roskind suggests the following order in each module: +

+

+ exports (globals, functions, and classes that don't need imported base classes)
+ import statements
+ active code (including globals that are initialized from imported values).
+
+Python's author doesn't like this approach much because the imports +appear in a strange place, but has to admit that it works. +

+

+

+Matthias Urlichs recommends to restructure your code so that the recursive import is not necessary in the first place. +

+

+These solutions are not mutually exclusive. +

+ +Edit this entry / +Log info + +/ Last changed on Mon Jun 3 06:52:51 2002 by +Matthias Urlichs +

+ +


+

4.38. How do I copy an object in Python?

+Try copy.copy() or copy.deepcopy() for the general case. Not all objects can be copied, but most can. +

+Dictionaries have a copy method. Sequences can be copied by slicing: +

+ new_l = l[:]
+
+

+ +Edit this entry / +Log info + +/ Last changed on Thu Mar 21 05:40:26 2002 by +Erno Kuusela +

+ +


+

4.39. How to implement persistent objects in Python? (Persistent == automatically saved to and restored from disk.)

+The library module "pickle" now solves this in a very general way +(though you still can't store things like open files, sockets or +windows), and the library module "shelve" uses pickle and (g)dbm to +create persistent mappings containing arbitrary Python objects. +For possibly better performance also look for the latest version +of the relatively recent cPickle module. +

+A more awkward way of doing things is to use pickle's little sister, +marshal. The marshal module provides very fast ways to store +noncircular basic Python types to files and strings, and back again. +Although marshal does not do fancy things like store instances or +handle shared references properly, it does run extremely fast. For +example loading a half megabyte of data may take less than a +third of a second (on some machines). This often beats doing +something more complex and general such as using gdbm with +pickle/shelve. +

+ +Edit this entry / +Log info + +/ Last changed on Sun Jun 8 22:59:00 1997 by +David Ascher +

+ +


+

4.40. I try to use __spam and I get an error about _SomeClassName__spam.

+Variables with double leading underscore are "mangled" to provide a +simple but effective way to define class private variables. See the +chapter "New in Release 1.4" in the Python Tutorial. +

+ +Edit this entry / +Log info +

+ +


+

4.41. How do I delete a file? And other file questions.

+Use os.remove(filename) or os.unlink(filename); for documentation, +see the posix section of the library manual. They are the same, +unlink() is simply the Unix name for this function. In earlier +versions of Python, only os.unlink() was available. +

+To remove a directory, use os.rmdir(); use os.mkdir() to create one. +

+To rename a file, use os.rename(). +

+To truncate a file, open it using f = open(filename, "r+"), and use +f.truncate(offset); offset defaults to the current seek position. +(The "r+" mode opens the file for reading and writing.) +There's also os.ftruncate(fd, offset) for files opened with os.open() +-- for advanced Unix hacks only. +

+The shutil module also contains a number of functions to work on files +including copyfile, copytree, and rmtree amongst others. +

+ +Edit this entry / +Log info + +/ Last changed on Thu Dec 28 12:30:01 2000 by +Bjorn Pettersen +

+ +


+

4.42. How to modify urllib or httplib to support HTTP/1.1?

+Recent versions of Python (2.0 and onwards) support HTTP/1.1 natively. +

+ +Edit this entry / +Log info + +/ Last changed on Tue Jan 2 02:56:56 2001 by +Moshe Zadka +

+ +


+

4.43. Unexplicable syntax errors in compile() or exec.

+When a statement suite (as opposed to an expression) is compiled by +compile(), exec or execfile(), it must end in a newline. In some +cases, when the source ends in an indented block it appears that at +least two newlines are required. +

+ +Edit this entry / +Log info +

+ +


+

4.44. How do I convert a string to a number?

+For integers, use the built-in int() function, e.g. int('144') == 144. Similarly, long() converts from string to long integer, e.g. long('144') == 144L; and float() to floating-point, e.g. float('144') == 144.0. +

+Note that these are restricted to decimal interpretation, so +that int('0144') == 144 and int('0x144') raises ValueError. For Python +2.0 int takes the base to convert from as a second optional argument, so +int('0x144', 16) == 324. +

+For greater flexibility, or before Python 1.5, import the module +string and use the string.atoi() function for integers, +string.atol() for long integers, or string.atof() for +floating-point. E.g., +string.atoi('100', 16) == string.atoi('0x100', 0) == 256. +See the library reference manual section for the string module for +more details. +

+While you could use the built-in function eval() instead of +any of those, this is not recommended, because someone could pass you +a Python expression that might have unwanted side effects (like +reformatting your disk). It also has the effect of interpreting numbers +as Python expressions, so that e.g. eval('09') gives a syntax error +since Python regards numbers starting with '0' as octal (base 8). +

+ +Edit this entry / +Log info + +/ Last changed on Thu Dec 28 12:37:34 2000 by +Bjorn Pettersen +

+ +


+

4.45. How do I convert a number to a string?

+To convert, e.g., the number 144 to the string '144', use the +built-in function repr() or the backquote notation (these are +equivalent). If you want a hexadecimal or octal representation, use +the built-in functions hex() or oct(), respectively. For fancy +formatting, use the % operator on strings, just like C printf formats, +e.g. "%04d" % 144 yields '0144' and "%.3f" % (1/3.0) yields '0.333'. +See the library reference manual for details. +

+ +Edit this entry / +Log info +

+ +


+

4.46. How do I copy a file?

+There's the shutil module which contains a copyfile() +function that implements a copy loop; +it isn't good enough for the Macintosh, though: +it doesn't copy the resource fork and Finder info. +

+ +Edit this entry / +Log info + +/ Last changed on Tue Jan 2 02:59:40 2001 by +Moshe Zadka +

+ +


+

4.47. How do I check if an object is an instance of a given class or of a subclass of it?

+If you are developing the classes from scratch it might be better to +program in a more proper object-oriented style -- instead of doing a different +thing based on class membership, why not use a method and define the +method differently in different classes? +

+However, there are some legitimate situations +where you need to test for class membership. +

+In Python 1.5, you can use the built-in function isinstance(obj, cls). +

+The following approaches can be used with earlier Python versions: +

+An unobvious method is to raise the object +as an exception and to try to catch the exception with the class you're +testing for: +

+

+	def is_instance_of(the_instance, the_class):
+	    try:
+		raise the_instance
+	    except the_class:
+		return 1
+	    except:
+		return 0
+
+This technique can be used to distinguish "subclassness" +from a collection of classes as well +

+

+                try:
+                              raise the_instance
+                except Audible:
+                              the_instance.play(largo)
+                except Visual:
+                              the_instance.display(gaudy)
+                except Olfactory:
+                              sniff(the_instance)
+                except:
+                              raise ValueError, "dunno what to do with this!"
+
+This uses the fact that exception catching tests for class or subclass +membership. +

+A different approach is to test for the presence of a class attribute that +is presumably unique for the given class. For instance: +

+

+	class MyClass:
+	    ThisIsMyClass = 1
+	    ...
+
+
+	def is_a_MyClass(the_instance):
+	    return hasattr(the_instance, 'ThisIsMyClass')
+
+This version is easier to inline, and probably faster (inlined it +is definitely faster). The disadvantage is that someone else could cheat: +

+

+	class IntruderClass:
+	    ThisIsMyClass = 1    # Masquerade as MyClass
+	    ...
+
+but this may be seen as a feature (anyway, there are plenty of other ways +to cheat in Python). Another disadvantage is that the class must be +prepared for the membership test. If you do not "control the +source code" for the class it may not be advisable to modify the +class to support testability. +

+ +Edit this entry / +Log info + +/ Last changed on Fri Jan 2 15:16:04 1998 by +GvR +

+ +


+

4.48. What is delegation?

+Delegation refers to an object oriented technique Python programmers +may implement with particular ease. Consider the following: +

+

+  from string import upper
+
+
+  class UpperOut:
+        def __init__(self, outfile):
+              self.__outfile = outfile
+        def write(self, str):
+              self.__outfile.write( upper(str) )
+        def __getattr__(self, name):
+              return getattr(self.__outfile, name)
+
+Here the UpperOut class redefines the write method +to convert the argument string to upper case before +calling the underlying self.__outfile.write method, but +all other methods are delegated to the underlying +self.__outfile object. The delegation is accomplished +via the "magic" __getattr__ method. Please see the +language reference for more information on the use +of this method. +

+Note that for more general cases delegation can +get trickier. Particularly when attributes must be set +as well as gotten the class must define a __settattr__ +method too, and it must do so carefully. +

+The basic implementation of __setattr__ is roughly +equivalent to the following: +

+

+   class X:
+        ...
+        def __setattr__(self, name, value):
+             self.__dict__[name] = value
+        ...
+
+Most __setattr__ implementations must modify +self.__dict__ to store local state for self without +causing an infinite recursion. +

+ +Edit this entry / +Log info + +/ Last changed on Wed Aug 13 07:11:24 1997 by +aaron watters +

+ +


+

4.49. How do I test a Python program or component.

+We presume for the purposes of this question you are interested +in standalone testing, rather than testing your components inside +a testing framework. The best-known testing framework for Python +is the PyUnit module, maintained at +

+

+    http://pyunit.sourceforge.net/
+
+For standalone testing, it helps to write the program so that +it may be easily tested by using good modular design. +In particular your program +should have almost all functionality encapsulated in either functions +or class methods -- and this sometimes has the surprising and +delightful effect of making the program run faster (because +local variable accesses are faster than global accesses). +Furthermore the program should avoid depending on mutating +global variables, since this makes testing much more difficult to do. +

+The "global main logic" of your program may be as simple +as +

+

+  if __name__=="__main__":
+       main_logic()
+
+at the bottom of the main module of your program. +

+Once your program is organized as a tractable collection +of functions and class behaviours you should write test +functions that exercise the behaviours. A test suite +can be associated with each module which automates +a sequence of tests. This sounds like a lot of work, but +since Python is so terse and flexible it's surprisingly easy. +You can make coding much more pleasant and fun by +writing your test functions in parallel with the "production +code", since this makes it easy to find bugs and even +design flaws earlier. +

+"Support modules" that are not intended to be the main +module of a program may include a "test script interpretation" +which invokes a self test of the module. +

+

+   if __name__ == "__main__":
+      self_test()
+
+Even programs that interact with complex external +interfaces may be tested when the external interfaces are +unavailable by using "fake" interfaces implemented in +Python. For an example of a "fake" interface, the following +class defines (part of) a "fake" file interface: +

+

+ import string
+ testdata = "just a random sequence of characters"
+
+
+ class FakeInputFile:
+   data = testdata
+   position = 0
+   closed = 0
+
+
+   def read(self, n=None):
+       self.testclosed()
+       p = self.position
+       if n is None:
+          result= self.data[p:]
+       else:
+          result= self.data[p: p+n]
+       self.position = p + len(result)
+       return result
+
+
+   def seek(self, n, m=0):
+       self.testclosed()
+       last = len(self.data)
+       p = self.position
+       if m==0: 
+          final=n
+       elif m==1:
+          final=n+p
+       elif m==2:
+          final=len(self.data)+n
+       else:
+          raise ValueError, "bad m"
+       if final<0:
+          raise IOError, "negative seek"
+       self.position = final
+
+
+   def isatty(self):
+       return 0
+
+
+   def tell(self):
+       return self.position
+
+
+   def close(self):
+       self.closed = 1
+
+
+   def testclosed(self):
+       if self.closed:
+          raise IOError, "file closed"
+
+Try f=FakeInputFile() and test out its operations. +

+ +Edit this entry / +Log info + +/ Last changed on Mon Jun 3 01:12:10 2002 by +Neal Norwitz +

+ +


+

4.50. My multidimensional list (array) is broken! What gives?

+You probably tried to make a multidimensional array like this. +

+

+   A = [[None] * 2] * 3
+
+This makes a list containing 3 references to the same list of length +two. Changes to one row will show in all rows, which is probably not +what you want. The following works much better: +

+

+   A = [None]*3
+   for i in range(3):
+        A[i] = [None] * 2
+
+This generates a list containing 3 different lists of length two. +

+If you feel weird, you can also do it in the following way: +

+

+   w, h = 2, 3
+   A = map(lambda i,w=w: [None] * w, range(h))
+
+For Python 2.0 the above can be spelled using a list comprehension: +

+

+   w,h = 2,3
+   A = [ [None]*w for i in range(h) ]
+
+

+ +Edit this entry / +Log info + +/ Last changed on Thu Dec 28 12:18:35 2000 by +Bjorn Pettersen +

+ +


+

4.51. I want to do a complicated sort: can you do a Schwartzian Transform in Python?

+Yes, and in Python you only have to write it once: +

+

+ def st(List, Metric):
+     def pairing(element, M = Metric):
+           return (M(element), element)
+     paired = map(pairing, List)
+     paired.sort()
+     return map(stripit, paired)
+
+
+ def stripit(pair):
+     return pair[1]
+
+This technique, attributed to Randal Schwartz, sorts the elements +of a list by a metric which maps each element to its "sort value". +For example, if L is a list of string then +

+

+   import string
+   Usorted = st(L, string.upper)
+
+
+   def intfield(s):
+         return string.atoi( string.strip(s[10:15] ) )
+
+
+   Isorted = st(L, intfield)
+
+Usorted gives the elements of L sorted as if they were upper +case, and Isorted gives the elements of L sorted by the integer +values that appear in the string slices starting at position 10 +and ending at position 15. In Python 2.0 this can be done more +naturally with list comprehensions: +

+

+  tmp1 = [ (x.upper(), x) for x in L ] # Schwartzian transform
+  tmp1.sort()
+  Usorted = [ x[1] for x in tmp1 ]
+
+
+  tmp2 = [ (int(s[10:15]), s) for s in L ] # Schwartzian transform
+  tmp2.sort()
+  Isorted = [ x[1] for x in tmp2 ]
+
+

+Note that Isorted may also be computed by +

+

+   def Icmp(s1, s2):
+         return cmp( intfield(s1), intfield(s2) )
+
+
+   Isorted = L[:]
+   Isorted.sort(Icmp)
+
+but since this method computes intfield many times for each +element of L, it is slower than the Schwartzian Transform. +

+ +Edit this entry / +Log info + +/ Last changed on Sat Jun 1 19:18:46 2002 by +Neal Norwitz +

+ +


+

4.52. How to convert between tuples and lists?

+The function tuple(seq) converts any sequence into a tuple with +the same items in the same order. +For example, tuple([1, 2, 3]) yields (1, 2, 3) and tuple('abc') +yields ('a', 'b', 'c'). If the argument is +a tuple, it does not make a copy but returns the same object, so +it is cheap to call tuple() when you aren't sure that an object +is already a tuple. +

+The function list(seq) converts any sequence into a list with +the same items in the same order. +For example, list((1, 2, 3)) yields [1, 2, 3] and list('abc') +yields ['a', 'b', 'c']. If the argument is a list, +it makes a copy just like seq[:] would. +

+ +Edit this entry / +Log info + +/ Last changed on Sun Jun 14 14:18:53 1998 by +Tim Peters +

+ +


+

4.53. Files retrieved with urllib contain leading garbage that looks like email headers.

+Extremely old versions of Python supplied libraries which +did not support HTTP/1.1; the vanilla httplib in Python 1.4 +only recognized HTTP/1.0. In Python 2.0 full HTTP/1.1 support is included. +

+ +Edit this entry / +Log info + +/ Last changed on Mon Jan 8 17:26:18 2001 by +Steve Holden +

+ +


+

4.54. How do I get a list of all instances of a given class?

+Python does not keep track of all instances of a class (or of a +built-in type). +

+You can program the class's constructor to keep track of all +instances, but unless you're very clever, this has the disadvantage +that the instances never get deleted,because your list of all +instances keeps a reference to them. +

+(The trick is to regularly inspect the reference counts of the +instances you've retained, and if the reference count is below a +certain level, remove it from the list. Determining that level is +tricky -- it's definitely larger than 1.) +

+ +Edit this entry / +Log info + +/ Last changed on Tue May 27 23:52:16 1997 by +GvR +

+ +


+

4.55. A regular expression fails with regex.error: match failure.

+This is usually caused by too much backtracking; the regular +expression engine has a fixed size stack which holds at most 4000 +backtrack points. Every character matched by e.g. ".*" accounts for a +backtrack point, so even a simple search like +

+

+  regex.match('.*x',"x"*5000)
+
+will fail. +

+This is fixed in the re module introduced with +Python 1.5; consult the Library Reference section on re for more information. +

+ +Edit this entry / +Log info + +/ Last changed on Thu Jul 30 12:35:49 1998 by +A.M. Kuchling +

+ +


+

4.56. I can't get signal handlers to work.

+The most common problem is that the signal handler is declared +with the wrong argument list. It is called as +

+

+	handler(signum, frame)
+
+so it should be declared with two arguments: +

+

+	def handler(signum, frame):
+		...
+
+

+ +Edit this entry / +Log info + +/ Last changed on Wed May 28 09:29:08 1997 by +GvR +

+ +


+

4.57. I can't use a global variable in a function? Help!

+Did you do something like this? +

+

+   x = 1 # make a global
+
+
+   def f():
+         print x # try to print the global
+         ...
+         for j in range(100):
+              if q>3:
+                 x=4
+
+Any variable assigned in a function is local to that function. +unless it is specifically declared global. Since a value is bound +to x as the last statement of the function body, the compiler +assumes that x is local. Consequently the "print x" +attempts to print an uninitialized local variable and will +trigger a NameError. +

+In such cases the solution is to insert an explicit global +declaration at the start of the function, making it +

+

+

+   def f():
+         global x
+         print x # try to print the global
+         ...
+         for j in range(100):
+              if q>3:
+                 x=4
+
+

+In this case, all references to x are interpreted as references +to the x from the module namespace. +

+ +Edit this entry / +Log info + +/ Last changed on Mon Feb 12 15:52:12 2001 by +Steve Holden +

+ +


+

4.58. What's a negative index? Why doesn't list.insert() use them?

+Python sequences are indexed with positive numbers and +negative numbers. For positive numbers 0 is the first index +1 is the second index and so forth. For negative indices -1 +is the last index and -2 is the pentultimate (next to last) index +and so forth. Think of seq[-n] as the same as seq[len(seq)-n]. +

+Using negative indices can be very convenient. For example +if the string Line ends in a newline then Line[:-1] is all of Line except +the newline. +

+Sadly the list builtin method L.insert does not observe negative +indices. This feature could be considered a mistake but since +existing programs depend on this feature it may stay around +forever. L.insert for negative indices inserts at the start of the +list. To get "proper" negative index behaviour use L[n:n] = [x] +in place of the insert method. +

+ +Edit this entry / +Log info + +/ Last changed on Wed Aug 13 07:03:18 1997 by +aaron watters +

+ +


+

4.59. How can I sort one list by values from another list?

+You can sort lists of tuples. +

+

+  >>> list1 = ["what", "I'm", "sorting", "by"]
+  >>> list2 = ["something", "else", "to", "sort"]
+  >>> pairs = map(None, list1, list2)
+  >>> pairs
+  [('what', 'something'), ("I'm", 'else'), ('sorting', 'to'), ('by', 'sort')]
+  >>> pairs.sort()
+  >>> pairs
+  [("I'm", 'else'), ('by', 'sort'), ('sorting', 'to'), ('what', 'something')]
+  >>> result = pairs[:]
+  >>> for i in xrange(len(result)): result[i] = result[i][1]
+  ...
+  >>> result
+  ['else', 'sort', 'to', 'something']
+
+And if you didn't understand the question, please see the +example above ;c). Note that "I'm" sorts before "by" because +uppercase "I" comes before lowercase "b" in the ascii order. +Also see 4.51. +

+In Python 2.0 this can be done like: +

+

+ >>> list1 = ["what", "I'm", "sorting", "by"]
+ >>> list2 = ["something", "else", "to", "sort"]
+ >>> pairs = zip(list1, list2)
+ >>> pairs
+ [('what', 'something'), ("I'm", 'else'), ('sorting', 'to'), ('by', 'sort')]
+ >>> pairs.sort()
+ >>> result = [ x[1] for x in pairs ]
+ >>> result
+ ['else', 'sort', 'to', 'something']
+
+[Followup] +

+Someone asked, why not this for the last steps: +

+

+  result = []
+  for p in pairs: result.append(p[1])
+
+This is much more legible. However, a quick test shows that +it is almost twice as slow for long lists. Why? First of all, +the append() operation has to reallocate memory, and while it +uses some tricks to avoid doing that each time, it still has +to do it occasionally, and apparently that costs quite a bit. +Second, the expression "result.append" requires an extra +attribute lookup. The attribute lookup could be done away +with by rewriting as follows: +

+

+  result = []
+  append = result.append
+  for p in pairs: append(p[1])
+
+which gains back some speed, but is still considerably slower +than the original solution, and hardly less convoluted. +

+ +Edit this entry / +Log info + +/ Last changed on Thu Dec 28 12:56:35 2000 by +Bjorn Pettersen +

+ +


+

4.60. Why doesn't dir() work on builtin types like files and lists?

+It does starting with Python 1.5. +

+Using 1.4, you can find out which methods a given object supports +by looking at its __methods__ attribute: +

+

+    >>> List = []
+    >>> List.__methods__
+    ['append', 'count', 'index', 'insert', 'remove', 'reverse', 'sort']
+
+

+ +Edit this entry / +Log info + +/ Last changed on Thu Sep 16 14:56:42 1999 by +Skip Montanaro +

+ +


+

4.61. How can I mimic CGI form submission (METHOD=POST)?

+I would like to retrieve web pages that are the result of POSTing a +form. Is there existing code that would let me do this easily? +

+Yes. Here's a simple example that uses httplib. +

+

+    #!/usr/local/bin/python
+
+
+    import httplib, sys, time
+
+
+    ### build the query string
+    qs = "First=Josephine&MI=Q&Last=Public"
+
+
+    ### connect and send the server a path
+    httpobj = httplib.HTTP('www.some-server.out-there', 80)
+    httpobj.putrequest('POST', '/cgi-bin/some-cgi-script')
+    ### now generate the rest of the HTTP headers...
+    httpobj.putheader('Accept', '*/*')
+    httpobj.putheader('Connection', 'Keep-Alive')
+    httpobj.putheader('Content-type', 'application/x-www-form-urlencoded')
+    httpobj.putheader('Content-length', '%d' % len(qs))
+    httpobj.endheaders()
+    httpobj.send(qs)
+    ### find out what the server said in response...
+    reply, msg, hdrs = httpobj.getreply()
+    if reply != 200:
+	sys.stdout.write(httpobj.getfile().read())
+
+Note that in general for "url encoded posts" (the default) query strings must be "quoted" to, for example, change equals signs and spaces to an encoded form when they occur in name or value. Use urllib.quote to perform this quoting. For example to send name="Guy Steele, Jr.": +

+

+   >>> from urllib import quote
+   >>> x = quote("Guy Steele, Jr.")
+   >>> x
+   'Guy%20Steele,%20Jr.'
+   >>> query_string = "name="+x
+   >>> query_string
+   'name=Guy%20Steele,%20Jr.'
+
+

+ +Edit this entry / +Log info + +/ Last changed on Mon Jun 21 03:47:07 1999 by +TAB +

+ +


+

4.62. If my program crashes with a bsddb (or anydbm) database open, it gets corrupted. How come?

+Databases opened for write access with the bsddb module (and often by +the anydbm module, since it will preferentially use bsddb) must +explicitly be closed using the close method of the database. The +underlying libdb package caches database contents which need to be +converted to on-disk form and written, unlike regular open files which +already have the on-disk bits in the kernel's write buffer, where they +can just be dumped by the kernel with the program exits. +

+If you have initialized a new bsddb database but not written anything to +it before the program crashes, you will often wind up with a zero-length +file and encounter an exception the next time the file is opened. +

+ +Edit this entry / +Log info + +/ Last changed on Mon Jun 3 01:15:01 2002 by +Neal Norwitz +

+ +


+

4.63. How do I make a Python script executable on Unix?

+You need to do two things: the script file's mode must be executable +(include the 'x' bit), and the first line must begin with #! +followed by the pathname for the Python interpreter. +

+The first is done by executing 'chmod +x scriptfile' or perhaps +'chmod 755 scriptfile'. +

+The second can be done in a number of way. The most straightforward +way is to write +

+

+  #!/usr/local/bin/python
+
+as the very first line of your file - or whatever the pathname is +where the python interpreter is installed on your platform. +

+If you would like the script to be independent of where the python +interpreter lives, you can use the "env" program. On almost all +platforms, the following will work, assuming the python interpreter +is in a directory on the user's $PATH: +

+

+  #! /usr/bin/env python
+
+Note -- *don't* do this for CGI scripts. The $PATH variable for +CGI scripts is often very minimal, so you need to use the actual +absolute pathname of the interpreter. +

+Occasionally, a user's environment is so full that the /usr/bin/env +program fails; or there's no env program at all. +In that case, you can try the following hack (due to Alex Rezinsky): +

+

+  #! /bin/sh
+  """:"
+  exec python $0 ${1+"$@"}
+  """
+
+The disadvantage is that this defines the script's __doc__ string. +However, you can fix that by adding +

+

+  __doc__ = """...Whatever..."""
+
+

+ +Edit this entry / +Log info + +/ Last changed on Mon Jan 15 09:19:16 2001 by +Neal Norwitz +

+ +


+

4.64. How do you remove duplicates from a list?

+See the Python Cookbook for a long discussion of many cool ways: +

+

+    http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/52560
+
+Generally, if you don't mind reordering the List +

+

+   if List:
+      List.sort()
+      last = List[-1]
+      for i in range(len(List)-2, -1, -1):
+          if last==List[i]: del List[i]
+          else: last=List[i]
+
+If all elements of the list may be used as +dictionary keys (ie, they are all hashable) +this is often faster +

+

+   d = {}
+   for x in List: d[x]=x
+   List = d.values()
+
+Also, for extremely large lists you might +consider more optimal alternatives to the first one. +The second one is pretty good whenever it can +be used. +

+ +Edit this entry / +Log info + +/ Last changed on Fri May 24 21:56:33 2002 by +Tim Peters +

+ +


+

4.65. Are there any known year 2000 problems in Python?

+I am not aware of year 2000 deficiencies in Python 1.5. Python does +very few date calculations and for what it does, it relies on the C +library functions. Python generally represent times either as seconds +since 1970 or as a tuple (year, month, day, ...) where the year is +expressed with four digits, which makes Y2K bugs unlikely. So as long +as your C library is okay, Python should be okay. Of course, I cannot +vouch for your Python code! +

+Given the nature of freely available software, I have to add that this statement is not +legally binding. The Python copyright notice contains the following +disclaimer: +

+

+  STICHTING MATHEMATISCH CENTRUM AND CNRI DISCLAIM ALL WARRANTIES WITH
+  REGARD TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF
+  MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH
+  CENTRUM OR CNRI BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL
+  DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR
+  PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+  TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+  PERFORMANCE OF THIS SOFTWARE.
+
+The good news is that if you encounter a problem, you have full +source available to track it down and fix it! +

+ +Edit this entry / +Log info + +/ Last changed on Fri Apr 10 14:59:31 1998 by +GvR +

+ +


+

4.66. I want a version of map that applies a method to a sequence of objects! Help!

+Get fancy! +

+

+  def method_map(objects, method, arguments):
+       """method_map([a,b], "flog", (1,2)) gives [a.flog(1,2), b.flog(1,2)]"""
+       nobjects = len(objects)
+       methods = map(getattr, objects, [method]*nobjects)
+       return map(apply, methods, [arguments]*nobjects)
+
+It's generally a good idea to get to know the mysteries of map and apply +and getattr and the other dynamic features of Python. +

+ +Edit this entry / +Log info + +/ Last changed on Mon Jan 5 14:21:14 1998 by +Aaron Watters +

+ +


+

4.67. How do I generate random numbers in Python?

+The standard library module "random" implements a random number +generator. Usage is simple: +

+

+    import random
+
+
+    random.random()
+
+This returns a random floating point number in the range [0, 1). +

+There are also many other specialized generators in this module, such +as +

+

+    randrange(a, b) chooses an integer in the range [a, b)
+    uniform(a, b) chooses a floating point number in the range [a, b)
+    normalvariate(mean, sdev) sample from normal (Gaussian) distribution
+
+Some higher-level functions operate on sequences directly, such as +

+

+    choice(S) chooses random element from a given sequence
+    shuffle(L) shuffles a list in-place, i.e. permutes it randomly
+
+There's also a class, Random, which you can instantiate +to create independent multiple random number generators. +

+All this is documented in the library reference manual. Note that +the module "whrandom" is obsolete. +

+ +Edit this entry / +Log info + +/ Last changed on Mon Jun 3 01:16:51 2002 by +Neal Norwitz +

+ +


+

4.68. How do I access the serial (RS232) port?

+There's a Windows serial communication module (for communication +over RS 232 serial ports) at +

+

+  ftp://ftp.python.org/pub/python/contrib/sio-151.zip
+  http://www.python.org/ftp/python/contrib/sio-151.zip
+
+For DOS, try Hans Nowak's Python-DX, which supports this, at: +

+

+  http://www.cuci.nl/~hnowak/
+
+For Unix, see a usenet post by Mitch Chapman: +

+

+  http://groups.google.com/groups?selm=34A04430.CF9@ohioee.com
+
+For Win32, POSIX(Linux, BSD, *), Jython, Chris': +

+

+  http://pyserial.sourceforge.net
+
+

+ +Edit this entry / +Log info + +/ Last changed on Tue Jul 2 21:11:07 2002 by +Chris Liechti +

+ +


+

4.69. Images on Tk-Buttons don't work in Py15?

+They do work, but you must keep your own reference to the image +object now. More verbosely, you must make sure that, say, a global +variable or a class attribute refers to the object. +

+Quoting Fredrik Lundh from the mailinglist: +

+

+  Well, the Tk button widget keeps a reference to the internal
+  photoimage object, but Tkinter does not.  So when the last
+  Python reference goes away, Tkinter tells Tk to release the
+  photoimage.  But since the image is in use by a widget, Tk
+  doesn't destroy it.  Not completely.  It just blanks the image,
+  making it completely transparent...
+
+
+  And yes, there was a bug in the keyword argument handling
+  in 1.4 that kept an extra reference around in some cases.  And
+  when Guido fixed that bug in 1.5, he broke quite a few Tkinter
+  programs...
+
+

+ +Edit this entry / +Log info + +/ Last changed on Tue Feb 3 11:31:03 1998 by +Case Roole +

+ +


+

4.70. Where is the math.py (socket.py, regex.py, etc.) source file?

+If you can't find a source file for a module it may be a builtin +or dynamically loaded module implemented in C, C++ or other +compiled language. In this case you may not have the source +file or it may be something like mathmodule.c, somewhere in +a C source directory (not on the Python Path). +

+Fredrik Lundh (fredrik@pythonware.com) explains (on the python-list): +

+There are (at least) three kinds of modules in Python: +1) modules written in Python (.py); +2) modules written in C and dynamically loaded (.dll, .pyd, .so, .sl, etc); +3) modules written in C and linked with the interpreter; to get a list +of these, type: +

+

+    import sys
+    print sys.builtin_module_names
+
+

+ +Edit this entry / +Log info + +/ Last changed on Tue Feb 3 13:55:33 1998 by +Aaron Watters +

+ +


+

4.71. How do I send mail from a Python script?

+The standard library module smtplib does this. +Here's a very simple interactive mail +sender that uses it. This method will work on any host that +supports an SMTP listener. +

+

+    import sys, smtplib
+
+
+    fromaddr = raw_input("From: ")
+    toaddrs  = raw_input("To: ").split(',')
+    print "Enter message, end with ^D:"
+    msg = ''
+    while 1:
+        line = sys.stdin.readline()
+        if not line:
+            break
+        msg = msg + line
+
+
+    # The actual mail send
+    server = smtplib.SMTP('localhost')
+    server.sendmail(fromaddr, toaddrs, msg)
+    server.quit()
+
+If the local host doesn't have an SMTP listener, you need to find one. The simple method is to ask the user. Alternately, you can use the DNS system to find the mail gateway(s) responsible for the source address. +

+A Unix-only alternative uses sendmail. The location of the +sendmail program varies between systems; sometimes it is +/usr/lib/sendmail, sometime /usr/sbin/sendmail. The sendmail manual +page will help you out. Here's some sample code: +

+

+  SENDMAIL = "/usr/sbin/sendmail" # sendmail location
+  import os
+  p = os.popen("%s -t -i" % SENDMAIL, "w")
+  p.write("To: cary@ratatosk.org\n")
+  p.write("Subject: test\n")
+  p.write("\n") # blank line separating headers from body
+  p.write("Some text\n")
+  p.write("some more text\n")
+  sts = p.close()
+  if sts != 0:
+      print "Sendmail exit status", sts
+
+

+ +Edit this entry / +Log info + +/ Last changed on Mon Jun 3 07:05:12 2002 by +Matthias Urlichs +

+ +


+

4.72. How do I avoid blocking in connect() of a socket?

+The select module is widely known to help with asynchronous +I/O on sockets once they are connected. However, it is less +than common knowledge how to avoid blocking on the initial +connect() call. Jeremy Hylton has the following advice (slightly +edited): +

+To prevent the TCP connect from blocking, you can set the socket to +non-blocking mode. Then when you do the connect(), you will either +connect immediately (unlikely) or get an exception that contains the +errno. errno.EINPROGRESS indicates that the connection is in +progress, but hasn't finished yet. Different OSes will return +different errnos, so you're going to have to check. I can tell you +that different versions of Solaris return different errno values. +

+In Python 1.5 and later, you can use connect_ex() to avoid +creating an exception. It will just return the errno value. +

+To poll, you can call connect_ex() again later -- 0 or errno.EISCONN +indicate that you're connected -- or you can pass this socket to +select (checking to see if it is writeable). +

+ +Edit this entry / +Log info + +/ Last changed on Tue Feb 24 21:30:45 1998 by +GvR +

+ +


+

4.73. How do I specify hexadecimal and octal integers?

+To specify an octal digit, precede the octal value with a zero. For example, +to set the variable "a" to the octal value "10" (8 in decimal), type: +

+

+    >>> a = 010
+
+To verify that this works, you can type "a" and hit enter while in the +interpreter, which will cause Python to spit out the current value of "a" +in decimal: +

+

+    >>> a
+    8
+
+Hexadecimal is just as easy. Simply precede the hexadecimal number with a +zero, and then a lower or uppercase "x". Hexadecimal digits can be specified +in lower or uppercase. For example, in the Python interpreter: +

+

+    >>> a = 0xa5
+    >>> a
+    165
+    >>> b = 0XB2
+    >>> b
+    178
+
+

+ +Edit this entry / +Log info + +/ Last changed on Tue Mar 3 12:53:16 1998 by +GvR +

+ +


+

4.74. How to get a single keypress at a time?

+For Windows, see question 8.2. Here is an answer for Unix (see also 4.94). +

+There are several solutions; some involve using curses, which is a +pretty big thing to learn. Here's a solution without curses, due +to Andrew Kuchling (adapted from code to do a PGP-style +randomness pool): +

+

+        import termios, sys, os
+        fd = sys.stdin.fileno()
+        old = termios.tcgetattr(fd)
+        new = termios.tcgetattr(fd)
+        new[3] = new[3] & ~termios.ICANON & ~termios.ECHO
+        new[6][termios.VMIN] = 1
+        new[6][termios.VTIME] = 0
+        termios.tcsetattr(fd, termios.TCSANOW, new)
+        s = ''    # We'll save the characters typed and add them to the pool.
+        try:
+            while 1:
+                c = os.read(fd, 1)
+                print "Got character", `c`
+                s = s+c
+        finally:
+            termios.tcsetattr(fd, termios.TCSAFLUSH, old)
+
+You need the termios module for any of this to work, and I've only +tried it on Linux, though it should work elsewhere. It turns off +stdin's echoing and disables canonical mode, and then reads a +character at a time from stdin, noting the time after each keystroke. +

+ +Edit this entry / +Log info + +/ Last changed on Thu Oct 24 00:36:56 2002 by +chris +

+ +


+

4.75. How can I overload constructors (or methods) in Python?

+(This actually applies to all methods, but somehow the question +usually comes up first in the context of constructors.) +

+Where in C++ you'd write +

+

+    class C {
+        C() { cout << "No arguments\n"; }
+        C(int i) { cout << "Argument is " << i << "\n"; }
+    }
+
+in Python you have to write a single constructor that catches all +cases using default arguments. For example: +

+

+    class C:
+        def __init__(self, i=None):
+            if i is None:
+                print "No arguments"
+            else:
+                print "Argument is", i
+
+This is not entirely equivalent, but close enough in practice. +

+You could also try a variable-length argument list, e.g. +

+

+        def __init__(self, *args):
+            ....
+
+The same approach works for all method definitions. +

+ +Edit this entry / +Log info + +/ Last changed on Mon Apr 20 11:55:55 1998 by +GvR +

+ +


+

4.76. How do I pass keyword arguments from one method to another?

+Use apply. For example: +

+

+    class Account:
+        def __init__(self, **kw):
+            self.accountType = kw.get('accountType')
+            self.balance = kw.get('balance')
+
+
+    class CheckingAccount(Account):
+        def __init__(self, **kw):
+            kw['accountType'] = 'checking'
+            apply(Account.__init__, (self,), kw)
+
+
+    myAccount = CheckingAccount(balance=100.00)
+
+In Python 2.0 you can call it directly using the new ** syntax: +

+

+    class CheckingAccount(Account):
+        def __init__(self, **kw):
+            kw['accountType'] = 'checking'
+            Account.__init__(self, **kw)
+
+or more generally: +

+

+ >>> def f(x, *y, **z):
+ ...  print x,y,z
+ ...
+ >>> Y = [1,2,3]
+ >>> Z = {'foo':3,'bar':None}
+ >>> f('hello', *Y, **Z)
+ hello (1, 2, 3) {'foo': 3, 'bar': None}
+
+

+ +Edit this entry / +Log info + +/ Last changed on Thu Dec 28 13:04:01 2000 by +Bjorn Pettersen +

+ +


+

4.77. What module should I use to help with generating HTML?

+Check out HTMLgen written by Robin Friedrich. It's a class library +of objects corresponding to all the HTML 3.2 markup tags. It's used +when you are writing in Python and wish to synthesize HTML pages for +generating a web or for CGI forms, etc. +

+It can be found in the FTP contrib area on python.org or on the +Starship. Use the search engines there to locate the latest version. +

+It might also be useful to consider DocumentTemplate, which offers clear +separation between Python code and HTML code. DocumentTemplate is part +of the Bobo objects publishing system (http:/www.digicool.com/releases) +but can be used independantly of course! +

+ +Edit this entry / +Log info + +/ Last changed on Fri Aug 28 09:54:58 1998 by +GvR +

+ +


+

4.78. How do I create documentation from doc strings?

+Use gendoc, by Daniel Larson. See +

+http://starship.python.net/crew/danilo/ +

+It can create HTML from the doc strings in your Python source code. +

+ +Edit this entry / +Log info + +/ Last changed on Mon Oct 7 17:15:51 2002 by +Phil Rittenhouse +

+ +


+

4.79. How do I read (or write) binary data?

+For complex data formats, it's best to use +use the struct module. It's documented in the library reference. +It allows you to take a string read from a file containing binary +data (usually numbers) and convert it to Python objects; and vice +versa. +

+For example, the following code reads two 2-byte integers +and one 4-byte integer in big-endian format from a file: +

+

+  import struct
+
+
+  f = open(filename, "rb")  # Open in binary mode for portability
+  s = f.read(8)
+  x, y, z = struct.unpack(">hhl", s)
+
+The '>' in the format string forces bin-endian data; the letter +'h' reads one "short integer" (2 bytes), and 'l' reads one +"long integer" (4 bytes) from the string. +

+For data that is more regular (e.g. a homogeneous list of ints or +floats), you can also use the array module, also documented +in the library reference. +

+ +Edit this entry / +Log info + +/ Last changed on Wed Oct 7 09:16:45 1998 by +GvR +

+ +


+

4.80. I can't get key bindings to work in Tkinter

+An oft-heard complaint is that event handlers bound to events +with the bind() method don't get handled even when the appropriate +key is pressed. +

+The most common cause is that the widget to which the binding applies +doesn't have "keyboard focus". Check out the Tk documentation +for the focus command. Usually a widget is given the keyboard +focus by clicking in it (but not for labels; see the taketocus +option). +

+ +Edit this entry / +Log info + +/ Last changed on Fri Jun 12 09:37:33 1998 by +GvR +

+ +


+

4.81. "import crypt" fails

+[Unix] +

+Starting with Python 1.5, the crypt module is disabled by default. +In order to enable it, you must go into the Python source tree and +edit the file Modules/Setup to enable it (remove a '#' sign in +front of the line starting with '#crypt'). Then rebuild. +You may also have to add the string '-lcrypt' to that same line. +

+ +Edit this entry / +Log info + +/ Last changed on Wed Aug 5 08:57:09 1998 by +GvR +

+ +


+

4.82. Are there coding standards or a style guide for Python programs?

+Yes, Guido has written the "Python Style Guide". See +http://www.python.org/doc/essays/styleguide.html +

+ +Edit this entry / +Log info + +/ Last changed on Tue Sep 29 09:50:27 1998 by +Joseph VanAndel +

+ +


+

4.83. How do I freeze Tkinter applications?

+Freeze is a tool to create stand-alone applications (see 4.28). +

+When freezing Tkinter applications, the applications will not be +truly stand-alone, as the application will still need the tcl and +tk libraries. +

+One solution is to ship the application with the tcl and tk libraries, +and point to them at run-time using the TCL_LIBRARY and TK_LIBRARY +environment variables. +

+To get truly stand-alone applications, the Tcl scripts that form +the library have to be integrated into the application as well. One +tool supporting that is SAM (stand-alone modules), which is part +of the Tix distribution (http://tix.mne.com). Build Tix with SAM +enabled, perform the appropriate call to Tclsam_init etc inside +Python's Modules/tkappinit.c, and link with libtclsam +and libtksam (you might include the Tix libraries as well). +

+ +Edit this entry / +Log info + +/ Last changed on Wed Jan 20 17:35:01 1999 by +Martin v. Löwis +

+ +


+

4.84. How do I create static class data and static class methods?

+[Tim Peters, tim_one@email.msn.com] +

+Static data (in the sense of C++ or Java) is easy; static methods (again in the sense of C++ or Java) are not supported directly. +

+STATIC DATA +

+For example, +

+

+    class C:
+        count = 0   # number of times C.__init__ called
+
+
+        def __init__(self):
+            C.count = C.count + 1
+
+
+        def getcount(self):
+            return C.count  # or return self.count
+
+c.count also refers to C.count for any c such that isinstance(c, C) holds, unless overridden by c itself or by some class on the base-class search path from c.__class__ back to C. +

+Caution: within a method of C, +

+

+    self.count = 42
+
+creates a new and unrelated instance vrbl named "count" in self's own dict. So rebinding of a class-static data name needs the +

+

+    C.count = 314
+
+form whether inside a method or not. +

+

+STATIC METHODS +

+Static methods (as opposed to static data) are unnatural in Python, because +

+

+    C.getcount
+
+returns an unbound method object, which can't be invoked without supplying an instance of C as the first argument. +

+The intended way to get the effect of a static method is via a module-level function: +

+

+    def getcount():
+        return C.count
+
+If your code is structured so as to define one class (or tightly related class hierarchy) per module, this supplies the desired encapsulation. +

+Several tortured schemes for faking static methods can be found by searching DejaNews. Most people feel such cures are worse than the disease. Perhaps the least obnoxious is due to Pekka Pessi (mailto:ppessi@hut.fi): +

+

+    # helper class to disguise function objects
+    class _static:
+        def __init__(self, f):
+            self.__call__ = f
+
+
+    class C:
+        count = 0
+
+
+        def __init__(self):
+            C.count = C.count + 1
+
+
+        def getcount():
+            return C.count
+        getcount = _static(getcount)
+
+
+        def sum(x, y):
+            return x + y
+        sum = _static(sum)
+
+
+    C(); C()
+    c = C()
+    print C.getcount()  # prints 3
+    print c.getcount()  # prints 3
+    print C.sum(27, 15) # prints 42
+
+

+ +Edit this entry / +Log info + +/ Last changed on Thu Jan 21 21:35:38 1999 by +Tim Peters +

+ +


+

4.85. __import__('x.y.z') returns <module 'x'>; how do I get z?

+Try +

+

+   __import__('x.y.z').y.z
+
+For more realistic situations, you may have to do something like +

+

+   m = __import__(s)
+   for i in string.split(s, ".")[1:]:
+       m = getattr(m, i)
+
+

+ +Edit this entry / +Log info + +/ Last changed on Thu Jan 28 11:01:43 1999 by +GvR +

+ +


+

4.86. Basic thread wisdom

+Please note that there is no way to take advantage of +multiprocessor hardware using the Python thread model. The interpreter +uses a global interpreter lock (GIL), +which does not allow multiple threads to be concurrently active. +

+If you write a simple test program like this: +

+

+  import thread
+  def run(name, n):
+      for i in range(n): print name, i
+  for i in range(10):
+      thread.start_new(run, (i, 100))
+
+none of the threads seem to run! The reason is that as soon as +the main thread exits, all threads are killed. +

+A simple fix is to add a sleep to the end of the program, +sufficiently long for all threads to finish: +

+

+  import thread, time
+  def run(name, n):
+      for i in range(n): print name, i
+  for i in range(10):
+      thread.start_new(run, (i, 100))
+  time.sleep(10) # <----------------------------!
+
+But now (on many platforms) the threads don't run in parallel, +but appear to run sequentially, one at a time! The reason is +that the OS thread scheduler doesn't start a new thread until +the previous thread is blocked. +

+A simple fix is to add a tiny sleep to the start of the run +function: +

+

+  import thread, time
+  def run(name, n):
+      time.sleep(0.001) # <---------------------!
+      for i in range(n): print name, i
+  for i in range(10):
+      thread.start_new(run, (i, 100))
+  time.sleep(10)
+
+Some more hints: +

+Instead of using a time.sleep() call at the end, it's +better to use some kind of semaphore mechanism. One idea is to +use a the Queue module to create a queue object, let each thread +append a token to the queue when it finishes, and let the main +thread read as many tokens from the queue as there are threads. +

+Use the threading module instead of the thread module. It's part +of Python since version 1.5.1. It takes care of all these details, +and has many other nice features too! +

+ +Edit this entry / +Log info + +/ Last changed on Fri Feb 7 16:21:55 2003 by +GvR +

+ +


+

4.87. Why doesn't closing sys.stdout (stdin, stderr) really close it?

+Python file objects are a high-level layer of abstraction on top of C streams, which in turn are a medium-level layer of abstraction on top of (among other things) low-level C file descriptors. +

+For most file objects f you create in Python via the builtin "open" function, f.close() marks the Python file object as being closed from Python's point of view, and also arranges to close the underlying C stream. This happens automatically too, in f's destructor, when f becomes garbage. +

+But stdin, stdout and stderr are treated specially by Python, because of the special status also given to them by C: doing +

+

+    sys.stdout.close() # ditto for stdin and stderr
+
+marks the Python-level file object as being closed, but does not close the associated C stream (provided sys.stdout is still bound to its default value, which is the stream C also calls "stdout"). +

+To close the underlying C stream for one of these three, you should first be sure that's what you really want to do (e.g., you may confuse the heck out of extension modules trying to do I/O). If it is, use os.close: +

+

+    os.close(0)   # close C's stdin stream
+    os.close(1)   # close C's stdout stream
+    os.close(2)   # close C's stderr stream
+
+

+ +Edit this entry / +Log info + +/ Last changed on Sat Apr 17 02:22:35 1999 by +Tim Peters +

+ +


+

4.88. What kinds of global value mutation are thread-safe?

+[adapted from c.l.py responses by Gordon McMillan & GvR] +

+A global interpreter lock (GIL) is used internally to ensure that only one thread runs in the Python VM at a time. In general, Python offers to switch among threads only between bytecode instructions (how frequently it offers to switch can be set via sys.setcheckinterval). Each bytecode instruction-- and all the C implementation code reached from it --is therefore atomic. +

+In theory, this means an exact accounting requires an exact understanding of the PVM bytecode implementation. In practice, it means that operations on shared vrbls of builtin data types (ints, lists, dicts, etc) that "look atomic" really are. +

+For example, these are atomic (L, L1, L2 are lists, D, D1, D2 are dicts, x, y +are objects, i, j are ints): +

+

+    L.append(x)
+    L1.extend(L2)
+    x = L[i]
+    x = L.pop()
+    L1[i:j] = L2
+    L.sort()
+    x = y
+    x.field = y
+    D[x] = y
+    D1.update(D2)
+    D.keys()
+
+These aren't: +

+

+    i = i+1
+    L.append(L[-1])
+    L[i] = L[j]
+    D[x] = D[x] + 1
+
+Note: operations that replace other objects may invoke those other objects' __del__ method when their reference count reaches zero, and that can affect things. This is especially true for the mass updates to dictionaries and lists. When in doubt, use a mutex! +

+ +Edit this entry / +Log info + +/ Last changed on Fri Feb 7 16:21:03 2003 by +GvR +

+ +


+

4.89. How do I modify a string in place?

+Strings are immutable (see question 6.2) so you cannot modify a string +directly. If you need an object with this ability, try converting the +string to a list or take a look at the array module. +

+

+    >>> s = "Hello, world"
+    >>> a = list(s)
+    >>> print a
+    ['H', 'e', 'l', 'l', 'o', ',', ' ', 'w', 'o', 'r', 'l', 'd']
+    >>> a[7:] = list("there!")
+    >>> import string
+    >>> print string.join(a, '')
+    'Hello, there!'
+
+
+    >>> import array
+    >>> a = array.array('c', s)
+    >>> print a
+    array('c', 'Hello, world')
+    >>> a[0] = 'y' ; print a
+    array('c', 'yello world')
+    >>> a.tostring()
+    'yello, world'
+
+

+ +Edit this entry / +Log info + +/ Last changed on Tue May 18 01:22:47 1999 by +Andrew Dalke +

+ +


+

4.90. How to pass on keyword/optional parameters/arguments

+Q: How can I pass on optional or keyword parameters from one function to another? +

+

+	def f1(a, *b, **c):
+		...
+
+A: In Python 2.0 and above: +

+

+	def f2(x, *y, **z):
+		...
+		z['width']='14.3c'
+		...
+		f1(x, *y, **z)
+
+
+   Note: y can be any sequence (e.g., list or tuple) and z must be a dict.
+
+

+A: For versions prior to 2.0, use 'apply', like: +

+

+	def f2(x, *y, **z):
+		...
+		z['width']='14.3c'
+		...
+		apply(f1, (x,)+y, z)
+
+

+ +Edit this entry / +Log info + +/ Last changed on Mon Jun 3 07:20:56 2002 by +Matthias Urlichs +

+ +


+

4.91. How can I get a dictionary to display its keys in a consistent order?

+In general, dictionaries store their keys in an unpredictable order, +so the display order of a dictionary's elements will be similarly +unpredictable. +(See +Question 6.12 +to understand why this is so.) +

+This can be frustrating if you want to save a printable version to a +file, make some changes and then compare it with some other printed +dictionary. If you have such needs you can subclass UserDict.UserDict +to create a SortedDict class that prints itself in a predictable order. +Here's one simpleminded implementation of such a class: +

+

+  import UserDict, string
+
+
+  class SortedDict(UserDict.UserDict):
+    def __repr__(self):
+      result = []
+      append = result.append
+      keys = self.data.keys()
+      keys.sort()
+      for k in keys:
+        append("%s: %s" % (`k`, `self.data[k]`))
+      return "{%s}" % string.join(result, ", ")
+
+
+    ___str__ = __repr__
+
+

+This will work for many common situations you might encounter, though +it's far from a perfect solution. (It won't have any effect on the +pprint module and does not transparently handle values that are or +contain dictionaries. +

+ +Edit this entry / +Log info + +/ Last changed on Thu Sep 16 17:31:06 1999 by +Skip Montanaro +

+ +


+

4.92. Is there a Python tutorial?

+Yes. See question 1.20 at +http://www.python.org/doc/FAQ.html#1.20 +

+ +Edit this entry / +Log info + +/ Last changed on Sat Dec 4 16:04:00 1999 by +TAB +

+ +


+

4.93. Deleted

+See 4.28 +

+ +Edit this entry / +Log info + +/ Last changed on Tue May 28 20:40:37 2002 by +GvR +

+ +


+

4.94. How do I get a single keypress without blocking?

+There are several solutions; some involve using curses, which is a +pretty big thing to learn. Here's a solution without curses. (see also 4.74, for Windows, see question 8.2) +

+

+  import termios, fcntl, sys, os
+  fd = sys.stdin.fileno()
+
+
+  oldterm = termios.tcgetattr(fd)
+  newattr = termios.tcgetattr(fd)
+  newattr[3] = newattr[3] & ~termios.ICANON & ~termios.ECHO
+  termios.tcsetattr(fd, termios.TCSANOW, newattr)
+
+
+  oldflags = fcntl.fcntl(fd, fcntl.F_GETFL)
+  fcntl.fcntl(fd, fcntl.F_SETFL, oldflags | os.O_NONBLOCK)
+
+
+  try:
+      while 1:
+          try:
+              c = sys.stdin.read(1)
+              print "Got character", `c`
+          except IOError: pass
+  finally:
+      termios.tcsetattr(fd, termios.TCSAFLUSH, oldterm)
+      fcntl.fcntl(fd, fcntl.F_SETFL, oldflags)
+
+

+You need the termios and the fcntl module for any of this to work, +and I've only tried it on Linux, though it should work elsewhere. +

+In this code, characters are read and printed one at a time. +

+termios.tcsetattr() turns off stdin's echoing and disables canonical +mode. fcntl.fnctl() is used to obtain stdin's file descriptor flags +and modify them for non-blocking mode. Since reading stdin when it is +empty results in an IOError, this error is caught and ignored. +

+ +Edit this entry / +Log info + +/ Last changed on Thu Oct 24 00:39:06 2002 by +chris +

+ +


+

4.95. Is there an equivalent to Perl chomp()? (Remove trailing newline from string)

+There are two partial substitutes. If you want to remove all trailing +whitespace, use the method string.rstrip(). Otherwise, if there is only +one line in the string, use string.splitlines()[0]. +

+

+ -----------------------------------------------------------------------
+
+
+ rstrip() is too greedy, it strips all trailing white spaces.
+ splitlines() takes ControlM as line boundary.
+ Consider these strings as input:
+   "python python    \r\n"
+   "python\rpython\r\n"
+   "python python   \r\r\r\n"
+ The results from rstrip()/splitlines() are perhaps not what we want.
+
+
+ It seems re can perform this task.
+
+

+

+ #!/usr/bin/python 
+ # requires python2                                                             
+
+
+ import re, os, StringIO
+
+
+ lines=StringIO.StringIO(
+   "The Python Programming Language\r\n"
+   "The Python Programming Language \r \r \r\r\n"
+   "The\rProgramming\rLanguage\r\n"
+   "The\rProgramming\rLanguage\r\r\r\r\n"
+   "The\r\rProgramming\r\rLanguage\r\r\r\r\n"
+ )
+
+
+ ln=re.compile("(?:[\r]?\n|\r)$") # dos:\r\n, unix:\n, mac:\r, others: unknown
+ # os.linesep does not work if someone ftps(in binary mode) a dos/mac text file
+ # to your unix box
+ #ln=re.compile(os.linesep + "$")
+
+
+ while 1:
+   s=lines.readline()
+   if not s: break
+   print "1.(%s)" % `s.rstrip()`
+   print "2.(%s)" % `ln.sub( "", s, 1)`
+   print "3.(%s)" % `s.splitlines()[0]`
+   print "4.(%s)" % `s.splitlines()`
+   print
+
+
+ lines.close()
+
+

+ +Edit this entry / +Log info + +/ Last changed on Wed Aug 8 09:51:34 2001 by +Crystal +

+ +


+

4.96. Why is join() a string method when I'm really joining the elements of a (list, tuple, sequence)?

+Strings became much more like other standard types starting in release 1.6, when methods were added which give the same functionality that has always been available using the functions of the string module. These new methods have been widely accepted, but the one which appears to make (some) programmers feel uncomfortable is: +

+

+    ", ".join(['1', '2', '4', '8', '16'])
+
+which gives the result +

+

+    "1, 2, 4, 8, 16"
+
+There are two usual arguments against this usage. +

+The first runs along the lines of: "It looks really ugly using a method of a string literal (string constant)", to which the answer is that it might, but a string literal is just a fixed value. If the methods are to be allowed on names bound to strings there is no logical reason to make them unavailable on literals. Get over it! +

+The second objection is typically cast as: "I am really telling a sequence to join its members together with a string constant". Sadly, you aren't. For some reason there seems to be much less difficulty with having split() as a string method, since in that case it is easy to see that +

+

+    "1, 2, 4, 8, 16".split(", ")
+
+is an instruction to a string literal to return the substrings delimited by the given separator (or, by default, arbitrary runs of white space). In this case a Unicode string returns a list of Unicode strings, an ASCII string returns a list of ASCII strings, and everyone is happy. +

+join() is a string method because in using it you are telling the separator string to iterate over an arbitrary sequence, forming string representations of each of the elements, and inserting itself between the elements' representations. This method can be used with any argument which obeys the rules for sequence objects, inluding any new classes you might define yourself. +

+Because this is a string method it can work for Unicode strings as well as plain ASCII strings. If join() were a method of the sequence types then the sequence types would have to decide which type of string to return depending on the type of the separator. +

+If none of these arguments persuade you, then for the moment you can continue to use the join() function from the string module, which allows you to write +

+

+    string.join(['1', '2', '4', '8', '16'], ", ")
+
+You will just have to try and forget that the string module actually uses the syntax you are compaining about to implement the syntax you prefer! +

+ +Edit this entry / +Log info + +/ Last changed on Fri Aug 2 15:51:58 2002 by +Steve Holden +

+ +


+

4.97. How can my code discover the name of an object?

+Generally speaking, it can't, because objects don't really have names. The assignment statement does not store the assigned value in the name but a reference to it. Essentially, assignment creates a binding of a name to a value. The same is true of def and class statements, but in that case the value is a callable. Consider the following code: +

+

+    class A:
+        pass
+
+
+    B = A
+
+
+    a = B()
+    b = a
+    print b
+    <__main__.A instance at 016D07CC>
+    print a
+    <__main__.A instance at 016D07CC>
+
+

+Arguably the class has a name: even though it is bound to two names and invoked through the name B the created instance is still reported as an instance of class A. However, it is impossible to say whether the instance's name is a or b, since both names are bound to the same value. +

+Generally speaking it should not be necessary for your code to "know the names" of particular values. Unless you are deliberately writing introspective programs, this is usually an indication that a change of approach might be beneficial. +

+ +Edit this entry / +Log info + +/ Last changed on Thu Mar 8 03:53:39 2001 by +Steve Holden +

+ +


+

4.98. Why are floating point calculations so inaccurate?

+The development version of the Python Tutorial now contains an Appendix with more info: +
+    http://www.python.org/doc/current/tut/node14.html
+
+People are often very surprised by results like this: +

+

+ >>> 1.2-1.0
+ 0.199999999999999996
+
+And think it is a bug in Python. It's not. It's a problem caused by +the internal representation of a floating point number. A floating point +number is stored as a fixed number of binary digits. +

+In decimal math, there are many numbers that can't be represented +with a fixed number of decimal digits, i.e. +1/3 = 0.3333333333....... +

+In the binary case, 1/2 = 0.1, 1/4 = 0.01, 1/8 = 0.001, etc. There are +a lot of numbers that can't be represented. The digits are cut off at +some point. +

+Since Python 1.6, a floating point's repr() function prints as many +digits are necessary to make eval(repr(f)) == f true for any float f. +The str() function prints the more sensible number that was probably +intended: +

+

+ >>> 0.2
+ 0.20000000000000001
+ >>> print 0.2
+ 0.2
+
+Again, this has nothing to do with Python, but with the way the +underlying C platform handles floating points, and ultimately with +the inaccuracy you'll always have when writing down numbers of fixed +number of digit strings. +

+One of the consequences of this is that it is dangerous to compare +the result of some computation to a float with == ! +Tiny inaccuracies may mean that == fails. +

+Instead try something like this: +

+

+ epsilon = 0.0000000000001 # Tiny allowed error
+ expected_result = 0.4
+
+
+ if expected_result-epsilon <= computation() <= expected_result+epsilon:
+    ...
+
+

+ +Edit this entry / +Log info + +/ Last changed on Mon Apr 1 22:18:47 2002 by +Fred Drake +

+ +


+

4.99. I tried to open Berkeley DB file, but bsddb produces bsddb.error: (22, 'Invalid argument'). Help! How can I restore my data?

+Don't panic! Your data are probably intact. The most frequent cause +for the error is that you tried to open an earlier Berkeley DB file +with a later version of the Berkeley DB library. +

+Many Linux systems now have all three versions of Berkeley DB +available. If you are migrating from version 1 to a newer version use +db_dump185 to dump a plain text version of the database. +If you are migrating from version 2 to version 3 use db2_dump to create +a plain text version of the database. In either case, use db_load to +create a new native database for the latest version installed on your +computer. If you have version 3 of Berkeley DB installed, you should +be able to use db2_load to create a native version 2 database. +

+You should probably move away from Berkeley DB version 1 files because +the hash file code contains known bugs that can corrupt your data. +

+ +Edit this entry / +Log info + +/ Last changed on Wed Aug 29 16:04:29 2001 by +Skip Montanaro +

+ +


+

4.100. What are the "best practices" for using import in a module?

+First, the standard modules are great. Use them! The standard Python library is large and varied. Using modules can save you time and effort and will reduce maintainenance cost of your code. (Other programs are dedicated to supporting and fixing bugs in the standard Python modules. Coworkers may also be familiar with themodules that you use, reducing the amount of time it takes them to understand your code.) +

+The rest of this answer is largely a matter of personal preference, but here's what some newsgroup posters said (thanks to all who responded) +

+In general, don't use +

+ from modulename import *
+
+Doing so clutters the importer's namespace. Some avoid this idiom even with the few modules that were designed to be imported in this manner. (Modules designed in this manner include Tkinter, thread, and wxPython.) +

+Import modules at the top of a file, one module per line. Doing so makes it clear what other modules your code requires and avoids questions of whether the module name is in scope. Using one import per line makes it easy to add and delete module imports. +

+Move imports into a local scope (such as at the top of a function definition) if there are a lot of imports, and you're trying to avoid the cost (lots of initialization time) of many imports. This technique is especially helpful if many of the imports are unnecessary depending on how the program executes. You may also want to move imports into a function if the modules are only ever used in that function. Note that loading a module the first time may be expensive (because of the one time initialization of the module) but that loading a module multiple times is virtually free (a couple of dictionary lookups). Even if the module name has gone out of scope, the module is probably available in sys.modules. Thus, there isn't really anything wrong with putting no imports at the module level (if they aren't needed) and putting all of the imports at the function level. +

+It is sometimes necessary to move imports to a function or class to avoid problems with circular imports. Gordon says: +

+ Circular imports are fine where both modules use the "import <module>"
+ form of import. They fail when the 2nd module wants to grab a name
+ out of the first ("from module import name") and the import is at
+ the top level. That's because names in the 1st are not yet available,
+ (the first module is busy importing the 2nd).  
+
+In this case, if the 2nd module is only used in one function, then the import can easily be moved into that function. By the time the import is called, the first module will have finished initializing, and the second module can do its import. +

+It may also be necessary to move imports out of the top level of code +if some of the modules are platform-specific. In that case, it may not even be possible to import all of the modules at the top of the file. In this case, importing the correct modules in the corresponding platform-specific code is a good option. +

+If only instances of a specific class uses a module, then it is reasonable to import the module in the class's __init__ method and then assign the module to an instance variable so that the module is always available (via that instance variable) during the life of the object. Note that to delay an import until the class is instantiated, the import must be inside a method. Putting the import inside the class but outside of any method still causes the import to occur when the module is initialized. +

+ +Edit this entry / +Log info + +/ Last changed on Sat Aug 4 04:44:47 2001 by +TAB +

+ +


+

4.101. Is there a tool to help find bugs or perform static analysis?

+Yes. PyChecker is a static analysis tool for finding bugs +in Python source code as well as warning about code complexity +and style. +

+You can get PyChecker from: http://pychecker.sf.net. +

+ +Edit this entry / +Log info + +/ Last changed on Fri Aug 10 15:42:11 2001 by +Neal +

+ +


+

4.102. UnicodeError: ASCII [decoding,encoding] error: ordinal not in range(128)

+This error indicates that your Python installation can handle +only 7-bit ASCII strings. There are a couple ways to fix or +workaround the problem. +

+If your programs must handle data in arbitary character set encodings, the environment the application runs in will generally identify the encoding of the data it is handing you. You need to convert the input to Unicode data using that encoding. For instance, a program that handles email or web input will typically find character set encoding information in Content-Type headers. This can then be used to properly convert input data to Unicode. Assuming the string referred to by "value" is encoded as UTF-8: +

+

+    value = unicode(value, "utf-8")
+
+will return a Unicode object. If the data is not correctly encoded as UTF-8, the above call will raise a UnicodeError. +

+If you only want strings coverted to Unicode which have non-ASCII data, you can try converting them first assuming an ASCII encoding, and then generate Unicode objects if that fails: +

+

+    try:
+        x = unicode(value, "ascii")
+    except UnicodeError:
+        value = unicode(value, "utf-8")
+    else:
+        # value was valid ASCII data
+        pass
+
+

+If you normally use a character set encoding other than US-ASCII and only need to handle data in that encoding, the simplest way to fix the problem may be simply to set the encoding in sitecustomize.py. The following code is just a modified version of the encoding setup code from site.py with the relevant lines uncommented. +

+

+    # Set the string encoding used by the Unicode implementation.
+    # The default is 'ascii'
+    encoding = "ascii" # <= CHANGE THIS if you wish
+
+
+    # Enable to support locale aware default string encodings.
+    import locale
+    loc = locale.getdefaultlocale()
+    if loc[1]:
+        encoding = loc[1]
+    if encoding != "ascii":
+        import sys
+        sys.setdefaultencoding(encoding)
+
+

+Also note that on Windows, there is an encoding known as "mbcs", which uses an encoding specific to your current locale. In many cases, and particularly when working with COM, this may be an appropriate default encoding to use. +

+ +Edit this entry / +Log info + +/ Last changed on Sat Apr 13 04:45:41 2002 by +Skip Montanaro +

+ +


+

4.103. Using strings to call functions/methods

+There are various techniques: +

+* Use a dictionary pre-loaded with strings and functions. The primary +advantage of this technique is that the strings do not need to match the +names of the functions. This is also the primary technique used to +emulate a case construct: +

+

+    def a():
+        pass
+
+
+    def b():
+        pass
+
+
+    dispatch = {'go': a, 'stop': b}  # Note lack of parens for funcs
+
+
+    dispatch[get_input()]()  # Note trailing parens to call function
+
+* Use the built-in function getattr(): +

+

+    import foo
+    getattr(foo, 'bar')()
+
+Note that getattr() works on any object, including classes, class +instances, modules, and so on. +

+This is used in several places in the standard library, like +this: +

+

+    class Foo:
+        def do_foo(self):
+            ...
+
+
+        def do_bar(self):
+            ...
+
+
+     f = getattr(foo_instance, 'do_' + opname)
+     f()
+
+

+* Use locals() or eval() to resolve the function name: +

+def myFunc(): +

+    print "hello"
+
+fname = "myFunc" +

+f = locals()[fname] +f() +

+f = eval(fname) +f() +

+Note: Using eval() can be dangerous. If you don't have absolute control +over the contents of the string, all sorts of things could happen... +

+ +Edit this entry / +Log info + +/ Last changed on Thu Mar 21 08:14:58 2002 by +Erno Kuusela +

+ +


+

4.104. How fast are exceptions?

+A try/except block is extremely efficient. Actually executing an +exception is expensive. In older versions of Python (prior to 2.0), it +was common to code this idiom: +

+

+    try:
+        value = dict[key]
+    except KeyError:
+        dict[key] = getvalue(key)
+        value = dict[key]
+
+This idiom only made sense when you expected the dict to have the key +95% of the time or more; other times, you coded it like this: +

+

+    if dict.has_key(key):
+        value = dict[key]
+    else:
+        dict[key] = getvalue(key)
+        value = dict[key]
+
+In Python 2.0 and higher, of course, you can code this as +

+

+    value = dict.setdefault(key, getvalue(key))
+
+However this evaluates getvalue(key) always, regardless of whether it's needed or not. So if it's slow or has a side effect you should use one of the above variants. +

+ +Edit this entry / +Log info + +/ Last changed on Mon Dec 9 10:12:30 2002 by +Yeti +

+ +


+

4.105. Sharing global variables across modules

+The canonical way to share information across modules within a single +program is to create a special module (often called config or cfg). +Just import the config module in all modules of your application; the +module then becomes available as a global name. Because there is only +one instance of each module, any changes made to the module object get +reflected everywhere. For example: +

+config.py: +

+

+    pass
+
+mod.py: +

+

+    import config
+    config.x = 1
+
+main.py: +

+

+    import config
+    import mod
+    print config.x
+
+Note that using a module is also the basis for implementing the +Singleton design pattern, for the same reason. +

+ +Edit this entry / +Log info + +/ Last changed on Tue Apr 23 23:07:19 2002 by +Aahz +

+ +


+

4.106. Why is cPickle so slow?

+Use the binary option. We'd like to make that the default, but it would +break backward compatibility: +

+

+    largeString = 'z' * (100 * 1024)
+    myPickle = cPickle.dumps(largeString, 1)
+
+

+ +Edit this entry / +Log info + +/ Last changed on Thu Aug 22 19:54:25 2002 by +Aahz +

+ +


+

4.107. When importing module XXX, why do I get "undefined symbol: PyUnicodeUCS2_..." ?

+You are using a version of Python that uses a 4-byte representation for +Unicode characters, but the extension module you are importing (possibly +indirectly) was compiled using a Python that uses a 2-byte representation +for Unicode characters (the default). +

+If instead the name of the undefined symbol starts with PyUnicodeUCS4_, +the problem is the same by the relationship is reversed: Python was +built using 2-byte Unicode characters, and the extension module was +compiled using a Python with 4-byte Unicode characters. +

+This can easily occur when using pre-built extension packages. RedHat +Linux 7.x, in particular, provides a "python2" binary that is compiled +with 4-byte Unicode. This only causes the link failure if the extension +uses any of the PyUnicode_*() functions. It is also a problem if if an +extension uses any of the Unicode-related format specifiers for +Py_BuildValue (or similar) or parameter-specifications for +PyArg_ParseTuple(). +

+You can check the size of the Unicode character a Python interpreter is +using by checking the value of sys.maxunicode: +

+

+  >>> import sys
+  >>> if sys.maxunicode > 65535:
+  ...     print 'UCS4 build'
+  ... else:
+  ...     print 'UCS2 build'
+
+The only way to solve this problem is to use extension modules compiled +with a Python binary built using the same size for Unicode characters. +

+ +Edit this entry / +Log info + +/ Last changed on Tue Aug 27 15:00:17 2002 by +Fred Drake +

+ +


+

4.108. How do I create a .pyc file?

+QUESTION: +

+I have a module and I wish to generate a .pyc file. +How do I do it? Everything I read says that generation of a .pyc file is +"automatic", but I'm not getting anywhere. +

+

+ANSWER: +

+When a module is imported for the first time (or when the source is more +recent than the current compiled file) a .pyc file containing the compiled code should be created in the +same directory as the .py file. +

+One reason that a .pyc file may not be created is permissions problems with the directory. This can happen, for example, if you develop as one user but run as another, such as if you are testing with a web server. +

+However, in most cases, that's not the problem. +

+Creation of a .pyc file is "automatic" if you are importing a module and Python has the +ability (permissions, free space, etc...) to write the compiled module +back to the directory. But note that running Python on a top level script is not considered an +import and so no .pyc will be created automatically. For example, if you have a top-level module abc.py that imports another module xyz.py, when you run abc, xyz.pyc will be created since xyz is imported, but no abc.pyc file will be created since abc isn't imported. +

+If you need to create abc.pyc -- that is, to create a .pyc file for a +module that is not imported -- you can. (Look up +the py_compile and compileall modules in the Library Reference.) +

+You can manually compile any module using the "py_compile" module. One +way is to use the compile() function in that module interactively: +

+

+    >>> import py_compile
+    >>> py_compile.compile('abc.py')
+
+This will write the .pyc to the same location as abc.py (or you +can override that with the optional parameter cfile). +

+You can also automatically compile all files in a directory or +directories using the "compileall" module, which can also be run +straight from the command line. +

+You can do it from the shell (or DOS) prompt by entering: +

+       python compile.py abc.py
+
+or +
+       python compile.py *
+
+Or you can write a script to do it on a list of filenames that you enter. +

+

+     import sys
+     from py_compile import compile
+
+
+     if len(sys.argv) <= 1:
+        sys.exit(1)
+
+
+     for file in sys.argv[1:]:
+        compile(file)
+
+ACKNOWLEDGMENTS: +

+Steve Holden, David Bolen, Rich Somerfield, Oleg Broytmann, Steve Ferg +

+ +Edit this entry / +Log info + +/ Last changed on Wed Feb 12 15:58:25 2003 by +Stephen Ferg +

+ +


+

5. Extending Python

+ +
+

5.1. Can I create my own functions in C?

+Yes, you can create built-in modules containing functions, +variables, exceptions and even new types in C. This is explained in +the document "Extending and Embedding the Python Interpreter" (http://www.python.org/doc/current/ext/ext.html). Also read the chapter +on dynamic loading. +

+There's more information on this in each of the Python books: +Programming Python, Internet Programming with Python, and Das Python-Buch +(in German). +

+ +Edit this entry / +Log info + +/ Last changed on Mon Dec 10 05:18:57 2001 by +Fred L. Drake, Jr. +

+ +


+

5.2. Can I create my own functions in C++?

+Yes, using the C-compatibility features found in C++. Basically +you place extern "C" { ... } around the Python include files and put +extern "C" before each function that is going to be called by the +Python interpreter. Global or static C++ objects with constructors +are probably not a good idea. +

+ +Edit this entry / +Log info +

+ +


+

5.3. How can I execute arbitrary Python statements from C?

+The highest-level function to do this is PyRun_SimpleString() which takes +a single string argument which is executed in the context of module +__main__ and returns 0 for success and -1 when an exception occurred +(including SyntaxError). If you want more control, use PyRun_String(); +see the source for PyRun_SimpleString() in Python/pythonrun.c. +

+ +Edit this entry / +Log info + +/ Last changed on Fri May 23 20:08:14 1997 by +Bill Tutt +

+ +


+

5.4. How can I evaluate an arbitrary Python expression from C?

+Call the function PyRun_String() from the previous question with the +start symbol eval_input (Py_eval_input starting with 1.5a1); it +parses an expression, evaluates it and returns its value. +

+ +Edit this entry / +Log info + +/ Last changed on Wed May 21 22:23:18 1997 by +David Ascher +

+ +


+

5.5. How do I extract C values from a Python object?

+That depends on the object's type. If it's a tuple, +PyTupleSize(o) returns its length and PyTuple_GetItem(o, i) +returns its i'th item; similar for lists with PyListSize(o) +and PyList_GetItem(o, i). For strings, PyString_Size(o) returns +its length and PyString_AsString(o) a pointer to its value +(note that Python strings may contain null bytes so strlen() +is not safe). To test which type an object is, first make sure +it isn't NULL, and then use PyString_Check(o), PyTuple_Check(o), +PyList_Check(o), etc. +

+There is also a high-level API to Python objects which is +provided by the so-called 'abstract' interface -- read +Include/abstract.h for further details. It allows for example +interfacing with any kind of Python sequence (e.g. lists and tuples) +using calls like PySequence_Length(), PySequence_GetItem(), etc.) +as well as many other useful protocols. +

+ +Edit this entry / +Log info + +/ Last changed on Wed May 21 22:34:20 1997 by +David Ascher +

+ +


+

5.6. How do I use Py_BuildValue() to create a tuple of arbitrary length?

+You can't. Use t = PyTuple_New(n) instead, and fill it with +objects using PyTuple_SetItem(t, i, o) -- note that this "eats" a +reference count of o. Similar for lists with PyList_New(n) and +PyList_SetItem(l, i, o). Note that you must set all the tuple items to +some value before you pass the tuple to Python code -- +PyTuple_New(n) initializes them to NULL, which isn't a valid Python +value. +

+ +Edit this entry / +Log info + +/ Last changed on Thu Jul 31 18:15:29 1997 by +Guido van Rossum +

+ +


+

5.7. How do I call an object's method from C?

+The PyObject_CallMethod() function can be used to call an arbitrary +method of an object. The parameters are the object, the name of the +method to call, a format string like that used with Py_BuildValue(), and the argument values: +

+

+    PyObject *
+    PyObject_CallMethod(PyObject *object, char *method_name,
+                        char *arg_format, ...);
+
+This works for any object that has methods -- whether built-in or +user-defined. You are responsible for eventually DECREF'ing the +return value. +

+To call, e.g., a file object's "seek" method with arguments 10, 0 +(assuming the file object pointer is "f"): +

+

+        res = PyObject_CallMethod(f, "seek", "(ii)", 10, 0);
+        if (res == NULL) {
+                ... an exception occurred ...
+        }
+        else {
+                Py_DECREF(res);
+        }
+
+Note that since PyObject_CallObject() always wants a tuple for the +argument list, to call a function without arguments, pass "()" for the +format, and to call a function with one argument, surround the argument +in parentheses, e.g. "(i)". +

+ +Edit this entry / +Log info + +/ Last changed on Thu Jun 6 16:15:46 2002 by +Neal Norwitz +

+ +


+

5.8. How do I catch the output from PyErr_Print() (or anything that prints to stdout/stderr)?

+(Due to Mark Hammond): +

+In Python code, define an object that supports the "write()" method. +Redirect sys.stdout and sys.stderr to this object. +Call print_error, or just allow the standard traceback mechanism to +work. Then, the output will go wherever your write() method sends it. +

+The easiest way to do this is to use the StringIO class in the standard +library. +

+Sample code and use for catching stdout: +

+	>>> class StdoutCatcher:
+	...  def __init__(self):
+	...   self.data = ''
+	...  def write(self, stuff):
+	...   self.data = self.data + stuff
+	...  
+	>>> import sys
+	>>> sys.stdout = StdoutCatcher()
+	>>> print 'foo'
+	>>> print 'hello world!'
+	>>> sys.stderr.write(sys.stdout.data)
+	foo
+	hello world!
+
+

+ +Edit this entry / +Log info + +/ Last changed on Wed Dec 16 18:34:25 1998 by +Richard Jones +

+ +


+

5.9. How do I access a module written in Python from C?

+You can get a pointer to the module object as follows: +

+

+        module = PyImport_ImportModule("<modulename>");
+
+If the module hasn't been imported yet (i.e. it is not yet present in +sys.modules), this initializes the module; otherwise it simply returns +the value of sys.modules["<modulename>"]. Note that it doesn't enter +the module into any namespace -- it only ensures it has been +initialized and is stored in sys.modules. +

+You can then access the module's attributes (i.e. any name defined in +the module) as follows: +

+

+        attr = PyObject_GetAttrString(module, "<attrname>");
+
+Calling PyObject_SetAttrString(), to assign to variables in the module, also works. +

+ +Edit this entry / +Log info + +/ Last changed on Wed May 21 22:56:40 1997 by +david ascher +

+ +


+

5.10. How do I interface to C++ objects from Python?

+Depending on your requirements, there are many approaches. To do +this manually, begin by reading the "Extending and Embedding" document +(Doc/ext.tex, see also http://www.python.org/doc/). Realize +that for the Python run-time system, there isn't a whole lot of +difference between C and C++ -- so the strategy to build a new Python +type around a C structure (pointer) type will also work for C++ +objects. +

+A useful automated approach (which also works for C) is SWIG: +http://www.swig.org/. +

+ +Edit this entry / +Log info + +/ Last changed on Fri Oct 15 05:14:01 1999 by +Sjoerd Mullender +

+ +


+

5.11. mSQLmodule (or other old module) won't build with Python 1.5 (or later)

+Since python-1.4 "Python.h" will have the file includes needed in an +extension module. +Backward compatibility is dropped after version 1.4 and therefore +mSQLmodule.c will not build as "allobjects.h" cannot be found. +The following change in mSQLmodule.c is harmless when building it with +1.4 and necessary when doing so for later python versions: +

+Remove lines: +

+

+	#include "allobjects.h"
+	#include "modsupport.h"
+
+And insert instead: +

+

+	#include "Python.h"
+
+You may also need to add +

+

+                #include "rename2.h"
+
+if the module uses "old names". +

+This may happen with other ancient python modules as well, +and the same fix applies. +

+ +Edit this entry / +Log info + +/ Last changed on Sun Dec 21 02:03:35 1997 by +GvR +

+ +


+

5.12. I added a module using the Setup file and the make fails! Huh?

+Setup must end in a newline, if there is no newline there it gets +very sad. Aside from this possibility, maybe you have other +non-Python-specific linkage problems. +

+ +Edit this entry / +Log info + +/ Last changed on Tue Jun 24 15:54:01 1997 by +aaron watters +

+ +


+

5.13. I want to compile a Python module on my Red Hat Linux system, but some files are missing.

+Red Hat's RPM for Python doesn't include the +/usr/lib/python1.x/config/ directory, which contains various files required +for compiling Python extensions. +Install the python-devel RPM to get the necessary files. +

+ +Edit this entry / +Log info + +/ Last changed on Tue Jan 26 13:44:04 1999 by +A.M. Kuchling +

+ +


+

5.14. What does "SystemError: _PyImport_FixupExtension: module yourmodule not loaded" mean?

+This means that you have created an extension module named "yourmodule", but your module init function does not initialize with that name. +

+Every module init function will have a line similar to: +

+

+  module = Py_InitModule("yourmodule", yourmodule_functions);
+
+If the string passed to this function is not the same name as your extenion module, the SystemError will be raised. +

+ +Edit this entry / +Log info + +/ Last changed on Thu Mar 25 07:16:08 1999 by +Mark Hammond +

+ +


+

5.15. How to tell "incomplete input" from "invalid input"?

+Sometimes you want to emulate the Python interactive interpreter's +behavior, where it gives you a continuation prompt when the input +is incomplete (e.g. you typed the start of an "if" statement +or you didn't close your parentheses or triple string quotes), +but it gives you a syntax error message immediately when the input +is invalid. +

+In Python you can use the codeop module, which approximates the +parser's behavior sufficiently. IDLE uses this, for example. +

+The easiest way to do it in C is to call PyRun_InteractiveLoop() +(in a separate thread maybe) and let the Python interpreter handle +the input for you. You can also set the PyOS_ReadlineFunctionPointer +to point at your custom input function. See Modules/readline.c and +Parser/myreadline.c for more hints. +

+However sometimes you have to run the embedded Python interpreter +in the same thread as your rest application and you can't allow the +PyRun_InteractiveLoop() to stop while waiting for user input. +The one solution then is to call PyParser_ParseString() +and test for e.error equal to E_EOF (then the input is incomplete). +Sample code fragment, untested, inspired by code from Alex Farber: +

+

+  #include <Python.h>
+  #include <node.h>
+  #include <errcode.h>
+  #include <grammar.h>
+  #include <parsetok.h>
+  #include <compile.h>
+
+
+  int testcomplete(char *code)
+    /* code should end in \n */
+    /* return -1 for error, 0 for incomplete, 1 for complete */
+  {
+    node *n;
+    perrdetail e;
+
+
+    n = PyParser_ParseString(code, &_PyParser_Grammar,
+                             Py_file_input, &e);
+    if (n == NULL) {
+      if (e.error == E_EOF) 
+        return 0;
+      return -1;
+    }
+
+
+    PyNode_Free(n);
+    return 1;
+  }
+
+Another solution is trying to compile the received string with +Py_CompileString(). If it compiles fine - try to execute the returned +code object by calling PyEval_EvalCode(). Otherwise save the input for +later. If the compilation fails, find out if it's an error or just +more input is required - by extracting the message string from the +exception tuple and comparing it to the "unexpected EOF while parsing". +Here is a complete example using the GNU readline library (you may +want to ignore SIGINT while calling readline()): +

+

+  #include <stdio.h>
+  #include <readline.h>
+
+
+  #include <Python.h>
+  #include <object.h>
+  #include <compile.h>
+  #include <eval.h>
+
+
+  int main (int argc, char* argv[])
+  {
+    int i, j, done = 0;                          /* lengths of line, code */
+    char ps1[] = ">>> ";
+    char ps2[] = "... ";
+    char *prompt = ps1;
+    char *msg, *line, *code = NULL;
+    PyObject *src, *glb, *loc;
+    PyObject *exc, *val, *trb, *obj, *dum;
+
+
+    Py_Initialize ();
+    loc = PyDict_New ();
+    glb = PyDict_New ();
+    PyDict_SetItemString (glb, "__builtins__", PyEval_GetBuiltins ());
+
+
+    while (!done)
+    {
+      line = readline (prompt);
+
+
+      if (NULL == line)                          /* CTRL-D pressed */
+      {
+        done = 1;
+      }
+      else
+      {
+        i = strlen (line);
+
+
+        if (i > 0)
+          add_history (line);                    /* save non-empty lines */
+
+
+        if (NULL == code)                        /* nothing in code yet */
+          j = 0;
+        else
+          j = strlen (code);
+
+
+        code = realloc (code, i + j + 2);
+        if (NULL == code)                        /* out of memory */
+          exit (1);
+
+
+        if (0 == j)                              /* code was empty, so */
+          code[0] = '\0';                        /* keep strncat happy */
+
+
+        strncat (code, line, i);                 /* append line to code */
+        code[i + j] = '\n';                      /* append '\n' to code */
+        code[i + j + 1] = '\0';
+
+
+        src = Py_CompileString (code, "<stdin>", Py_single_input);       
+
+
+        if (NULL != src)                         /* compiled just fine - */
+        {
+          if (ps1  == prompt ||                  /* ">>> " or */
+              '\n' == code[i + j - 1])           /* "... " and double '\n' */
+          {                                               /* so execute it */
+            dum = PyEval_EvalCode ((PyCodeObject *)src, glb, loc);
+            Py_XDECREF (dum);
+            Py_XDECREF (src);
+            free (code);
+            code = NULL;
+            if (PyErr_Occurred ())
+              PyErr_Print ();
+            prompt = ps1;
+          }
+        }                                        /* syntax error or E_EOF? */
+        else if (PyErr_ExceptionMatches (PyExc_SyntaxError))           
+        {
+          PyErr_Fetch (&exc, &val, &trb);        /* clears exception! */
+
+
+          if (PyArg_ParseTuple (val, "sO", &msg, &obj) &&
+              !strcmp (msg, "unexpected EOF while parsing")) /* E_EOF */
+          {
+            Py_XDECREF (exc);
+            Py_XDECREF (val);
+            Py_XDECREF (trb);
+            prompt = ps2;
+          }
+          else                                   /* some other syntax error */
+          {
+            PyErr_Restore (exc, val, trb);
+            PyErr_Print ();
+            free (code);
+            code = NULL;
+            prompt = ps1;
+          }
+        }
+        else                                     /* some non-syntax error */
+        {
+          PyErr_Print ();
+          free (code);
+          code = NULL;
+          prompt = ps1;
+        }
+
+
+        free (line);
+      }
+    }
+
+
+    Py_XDECREF(glb);
+    Py_XDECREF(loc);
+    Py_Finalize();
+    exit(0);
+  }
+
+

+ +Edit this entry / +Log info + +/ Last changed on Wed Mar 15 09:47:24 2000 by +Alex Farber +

+ +


+

5.16. How do I debug an extension?

+When using gdb with dynamically loaded extensions, you can't set a +breakpoint in your extension until your extension is loaded. +

+In your .gdbinit file (or interactively), add the command +

+br _PyImport_LoadDynamicModule +

+

+$ gdb /local/bin/python +

+gdb) run myscript.py +

+gdb) continue # repeat until your extension is loaded +

+gdb) finish # so that your extension is loaded +

+gdb) br myfunction.c:50 +

+gdb) continue +

+ +Edit this entry / +Log info + +/ Last changed on Fri Oct 20 11:10:32 2000 by +Joe VanAndel +

+ +


+

5.17. How do I find undefined Linux g++ symbols, __builtin_new or __pure_virtural

+To dynamically load g++ extension modules, you must recompile python, relink python using g++ (change LINKCC in the python Modules Makefile), and link your extension module using g++ (e.g., "g++ -shared -o mymodule.so mymodule.o"). +

+ +Edit this entry / +Log info + +/ Last changed on Sun Jan 14 18:03:51 2001 by +douglas orr +

+ +


+

5.18. How do I define and create objects corresponding to built-in/extension types

+Usually you would like to be able to inherit from a Python type when +you ask this question. The bottom line for Python 2.2 is: types and classes are miscible. You build instances by calling classes, and you can build subclasses to your heart's desire. +

+You need to be careful when instantiating immutable types like integers or strings. See http://www.amk.ca/python/2.2/, section 2, for details. +

+Prior to version 2.2, Python (like Java) insisted that there are first-class and second-class objects (the former are types, the latter classes), and never the twain shall meet. +

+The library has, however, done a good job of providing class wrappers for the more commonly desired objects (see UserDict, UserList and UserString for examples), and more are always welcome if you happen to be in the mood to write code. These wrappers still exist in Python 2.2. +

+ +Edit this entry / +Log info + +/ Last changed on Mon Jun 10 15:14:07 2002 by +Matthias Urlichs +

+ +


+

6. Python's design

+ +
+

6.1. Why isn't there a switch or case statement in Python?

+You can do this easily enough with a sequence of +if... elif... elif... else. There have been some proposals for switch +statement syntax, but there is no consensus (yet) on whether and how +to do range tests. +

+ +Edit this entry / +Log info +

+ +


+

6.2. Why does Python use indentation for grouping of statements?

+Basically I believe that using indentation for grouping is +extremely elegant and contributes a lot to the clarity of the average +Python program. Most people learn to love this feature after a while. +Some arguments for it: +

+Since there are no begin/end brackets there cannot be a disagreement +between grouping perceived by the parser and the human reader. I +remember long ago seeing a C fragment like this: +

+

+        if (x <= y)
+                x++;
+                y--;
+        z++;
+
+and staring a long time at it wondering why y was being decremented +even for x > y... (And I wasn't a C newbie then either.) +

+Since there are no begin/end brackets, Python is much less prone to +coding-style conflicts. In C there are loads of different ways to +place the braces (including the choice whether to place braces around +single statements in certain cases, for consistency). If you're used +to reading (and writing) code that uses one style, you will feel at +least slightly uneasy when reading (or being required to write) +another style. +Many coding styles place begin/end brackets on a line by themself. +This makes programs considerably longer and wastes valuable screen +space, making it harder to get a good overview over a program. +Ideally, a function should fit on one basic tty screen (say, 20 +lines). 20 lines of Python are worth a LOT more than 20 lines of C. +This is not solely due to the lack of begin/end brackets (the lack of +declarations also helps, and the powerful operations of course), but +it certainly helps! +

+ +Edit this entry / +Log info + +/ Last changed on Wed May 21 16:00:15 1997 by +GvR +

+ +


+

6.3. Why are Python strings immutable?

+There are two advantages. One is performance: knowing that a +string is immutable makes it easy to lay it out at construction time +-- fixed and unchanging storage requirements. (This is also one of +the reasons for the distinction between tuples and lists.) The +other is that strings in Python are considered as "elemental" as +numbers. No amount of activity will change the value 8 to anything +else, and in Python, no amount of activity will change the string +"eight" to anything else. (Adapted from Jim Roskind) +

+ +Edit this entry / +Log info +

+ +


+

6.4. Delete

+

+

+ +Edit this entry / +Log info + +/ Last changed on Tue Jan 2 03:05:25 2001 by +Moshe Zadka +

+ +


+

6.5. Why does Python use methods for some functionality (e.g. list.index()) but functions for other (e.g. len(list))?

+The major reason is history. Functions were used for those +operations that were generic for a group of types and which +were intended to work even for objects that didn't have +methods at all (e.g. numbers before type/class unification +began, or tuples). +

+It is also convenient to have a function that can readily be applied +to an amorphous collection of objects when you use the functional features of Python (map(), apply() et al). +

+In fact, implementing len(), max(), min() as a built-in function is +actually less code than implementing them as methods for each type. +One can quibble about individual cases but it's a part of Python, +and it's too late to change such things fundamentally now. The +functions have to remain to avoid massive code breakage. +

+Note that for string operations Python has moved from external functions +(the string module) to methods. However, len() is still a function. +

+ +Edit this entry / +Log info + +/ Last changed on Thu May 30 14:08:58 2002 by +Steve Holden +

+ +


+

6.6. Why can't I derive a class from built-in types (e.g. lists or files)?

+As of Python 2.2, you can derive from built-in types. For previous versions, the answer is: +

+This is caused by the relatively late addition of (user-defined) +classes to the language -- the implementation framework doesn't easily +allow it. See the answer to question 4.2 for a work-around. This +may be fixed in the (distant) future. +

+ +Edit this entry / +Log info + +/ Last changed on Thu May 23 02:53:22 2002 by +Neal Norwitz +

+ +


+

6.7. Why must 'self' be declared and used explicitly in method definitions and calls?

+So, is your current programming language C++ or Java? :-) +When classes were added to Python, this was (again) the simplest way of +implementing methods without too many changes to the interpreter. The +idea was borrowed from Modula-3. It turns out to be very useful, for +a variety of reasons. +

+First, it makes it more obvious that you are using a method or +instance attribute instead of a local variable. Reading "self.x" or +"self.meth()" makes it absolutely clear that an instance variable or +method is used even if you don't know the class definition by heart. +In C++, you can sort of tell by the lack of a local variable +declaration (assuming globals are rare or easily recognizable) -- but +in Python, there are no local variable declarations, so you'd have to +look up the class definition to be sure. +

+Second, it means that no special syntax is necessary if you want to +explicitly reference or call the method from a particular class. In +C++, if you want to use a method from base class that is overridden in +a derived class, you have to use the :: operator -- in Python you can +write baseclass.methodname(self, <argument list>). This is +particularly useful for __init__() methods, and in general in cases +where a derived class method wants to extend the base class method of +the same name and thus has to call the base class method somehow. +

+Lastly, for instance variables, it solves a syntactic problem with +assignment: since local variables in Python are (by definition!) those +variables to which a value assigned in a function body (and that +aren't explicitly declared global), there has to be some way to tell +the interpreter that an assignment was meant to assign to an instance +variable instead of to a local variable, and it should preferably be +syntactic (for efficiency reasons). C++ does this through +declarations, but Python doesn't have declarations and it would be a +pity having to introduce them just for this purpose. Using the +explicit "self.var" solves this nicely. Similarly, for using instance +variables, having to write "self.var" means that references to +unqualified names inside a method don't have to search the instance's +directories. +

+ +Edit this entry / +Log info + +/ Last changed on Fri Jan 12 08:01:50 2001 by +Steve Holden +

+ +


+

6.8. Can't you emulate threads in the interpreter instead of relying on an OS-specific thread implementation?

+Answer 1: Unfortunately, the interpreter pushes at least one C stack +frame for each Python stack frame. Also, extensions can call back into +Python at almost random moments. Therefore a complete threads +implementation requires thread support for C. +

+Answer 2: Fortunately, there is Stackless Python, which has a completely redesigned interpreter loop that avoids the C stack. It's still experimental but looks very promising. Although it is binary compatible with standard Python, it's still unclear whether Stackless will make it into the core -- maybe it's just too revolutionary. Stackless Python currently lives here: http://www.stackless.com. A microthread implementation that uses it can be found here: http://world.std.com/~wware/uthread.html. +

+ +Edit this entry / +Log info + +/ Last changed on Sat Apr 15 08:18:16 2000 by +Just van Rossum +

+ +


+

6.9. Why can't lambda forms contain statements?

+Python lambda forms cannot contain statements because Python's +syntactic framework can't handle statements nested inside expressions. +

+However, in Python, this is not a serious problem. Unlike lambda +forms in other languages, where they add functionality, Python lambdas +are only a shorthand notation if you're too lazy to define a function. +

+Functions are already first class objects in Python, and can be +declared in a local scope. Therefore the only advantage of using a +lambda form instead of a locally-defined function is that you don't need to invent a name for the function -- but that's just a local variable to which the function object (which is exactly the same type of object that a lambda form yields) is assigned! +

+ +Edit this entry / +Log info + +/ Last changed on Sun Jun 14 14:15:17 1998 by +Tim Peters +

+ +


+

6.10. [deleted]

+[lambda vs non-nested scopes used to be here] +

+ +Edit this entry / +Log info + +/ Last changed on Thu Mar 21 05:20:56 2002 by +Erno Kuusela +

+ +


+

6.11. [deleted]

+[recursive functions vs non-nested scopes used to be here] +

+ +Edit this entry / +Log info + +/ Last changed on Thu Mar 21 05:22:04 2002 by +Erno Kuusela +

+ +


+

6.12. Why is there no more efficient way of iterating over a dictionary than first constructing the list of keys()?

+As of Python 2.2, you can now iterate over a dictionary directly, +using the new implied dictionary iterator: +

+

+    for k in d: ...
+
+There are also methods returning iterators over the values and items: +

+

+    for k in d.iterkeys(): # same as above
+    for v in d.itervalues(): # iterate over values
+    for k, v in d.iteritems(): # iterate over items
+
+All these require that you do not modify the dictionary during the loop. +

+For previous Python versions, the following defense should do: +

+Have you tried it? I bet it's fast enough for your purposes! In +most cases such a list takes only a few percent of the space occupied +by the dictionary. Apart from the fixed header, +the list needs only 4 bytes (the size of a pointer) per +key. A dictionary uses 12 bytes per key plus between 30 and 70 +percent hash table overhead, plus the space for the keys and values. +By necessity, all keys are distinct objects, and a string object (the most +common key type) costs at least 20 bytes plus the length of the +string. Add to that the values contained in the dictionary, and you +see that 4 bytes more per item really isn't that much more memory... +

+A call to dict.keys() makes one fast scan over the dictionary +(internally, the iteration function does exist) copying the pointers +to the key objects into a pre-allocated list object of the right size. +The iteration time isn't lost (since you'll have to iterate anyway -- +unless in the majority of cases your loop terminates very prematurely +(which I doubt since you're getting the keys in random order). +

+I don't expose the dictionary iteration operation to Python +programmers because the dictionary shouldn't be modified during the +entire iteration -- if it is, there's a small chance that the +dictionary is reorganized because the hash table becomes too full, and +then the iteration may miss some items and see others twice. Exactly +because this only occurs rarely, it would lead to hidden bugs in +programs: it's easy never to have it happen during test runs if you +only insert or delete a few items per iteration -- but your users will +surely hit upon it sooner or later. +

+ +Edit this entry / +Log info + +/ Last changed on Fri May 24 21:24:08 2002 by +GvR +

+ +


+

6.13. Can Python be compiled to machine code, C or some other language?

+Not easily. Python's high level data types, dynamic typing of +objects and run-time invocation of the interpreter (using eval() or +exec) together mean that a "compiled" Python program would probably +consist mostly of calls into the Python run-time system, even for +seemingly simple operations like "x+1". +

+Several projects described in the Python newsgroup or at past +Python conferences have shown that this approach is feasible, +although the speedups reached so far are only modest (e.g. 2x). +JPython uses the same strategy for compiling to Java bytecode. +(Jim Hugunin has demonstrated that in combination with whole-program +analysis, speedups of 1000x are feasible for small demo programs. +See the website for the 1997 Python conference.) +

+Internally, Python source code is always translated into a "virtual +machine code" or "byte code" representation before it is interpreted +(by the "Python virtual machine" or "bytecode interpreter"). In order +to avoid the overhead of parsing and translating modules that rarely +change over and over again, this byte code is written on a file whose +name ends in ".pyc" whenever a module is parsed (from a file whose +name ends in ".py"). When the corresponding .py file is changed, it +is parsed and translated again and the .pyc file is rewritten. +

+There is no performance difference once the .pyc file has been loaded +(the bytecode read from the .pyc file is exactly the same as the bytecode +created by direct translation). The only difference is that loading +code from a .pyc file is faster than parsing and translating a .py +file, so the presence of precompiled .pyc files will generally improve +start-up time of Python scripts. If desired, the Lib/compileall.py +module/script can be used to force creation of valid .pyc files for a +given set of modules. +

+Note that the main script executed by Python, even if its filename +ends in .py, is not compiled to a .pyc file. It is compiled to +bytecode, but the bytecode is not saved to a file. +

+If you are looking for a way to translate Python programs in order to +distribute them in binary form, without the need to distribute the +interpreter and library as well, have a look at the freeze.py script +in the Tools/freeze directory. This creates a single binary file +incorporating your program, the Python interpreter, and those parts of +the Python library that are needed by your program. Of course, the +resulting binary will only run on the same type of platform as that +used to create it. +

+Newsflash: there are now several programs that do this, to some extent. +Look for Psyco, Pyrex, PyInline, Py2Cmod, and Weave. +

+ +Edit this entry / +Log info + +/ Last changed on Fri May 24 21:26:19 2002 by +GvR +

+ +


+

6.14. How does Python manage memory?

+The details of Python memory management depend on the implementation. +The standard Python implementation (the C implementation) uses reference +counting and another mechanism to collect reference cycles. +

+Jython relies on the Java runtime; so it uses +the JVM's garbage collector. This difference can cause some subtle +porting problems if your Python code depends on the behavior of +the reference counting implementation. +

+The reference cycle collector was added in CPython 2.0. It +periodically executes a cycle detection algorithm which looks for inaccessible cycles and deletes the objects involved. A new gc module provides functions to perform a garbage collection, obtain debugging statistics, and tuning the collector's parameters. +

+The detection of cycles can be disabled when Python is compiled, if you can't afford even a tiny speed penalty or suspect that the cycle collection is buggy, by specifying the "--without-cycle-gc" switch when running the configure script. +

+Sometimes objects get stuck in "tracebacks" temporarily and hence are not deallocated when you might expect. Clear the tracebacks via +

+

+       import sys
+       sys.exc_traceback = sys.last_traceback = None
+
+Tracebacks are used for reporting errors and implementing debuggers and related things. They contain a portion of the program state extracted during the handling of an exception (usually the most recent exception). +

+In the absence of circularities and modulo tracebacks, Python programs need not explicitly manage memory. +

+Why python doesn't use a more traditional garbage collection +scheme? For one thing, unless this were +added to C as a standard feature, it's a portability pain in the ass. +And yes, I know about the Xerox library. It has bits of assembler +code for most common platforms. Not for all. And although it is +mostly transparent, it isn't completely transparent (when I once +linked Python with it, it dumped core). +

+Traditional GC also becomes a problem when Python gets embedded into +other applications. While in a stand-alone Python it may be fine to +replace the standard malloc() and free() with versions provided by the +GC library, an application embedding Python may want to have its own +substitute for malloc() and free(), and may not want Python's. Right +now, Python works with anything that implements malloc() and free() +properly. +

+In Jython, the following code (which is +fine in C Python) will probably run out of file descriptors long before +it runs out of memory: +

+

+        for file in <very long list of files>:
+                f = open(file)
+                c = f.read(1)
+
+Using the current reference counting and destructor scheme, each new +assignment to f closes the previous file. Using GC, this is not +guaranteed. Sure, you can think of ways to fix this. But it's not +off-the-shelf technology. If you want to write code that will +work with any Python implementation, you should explicitly close +the file; this will work regardless of GC: +

+

+       for file in <very long list of files>:
+                f = open(file)
+                c = f.read(1)
+                f.close()
+
+

+ +Edit this entry / +Log info + +/ Last changed on Thu Mar 21 05:35:38 2002 by +Erno Kuusela +

+ +


+

6.15. Why are there separate tuple and list data types?

+This is done so that tuples can be immutable while lists are mutable. +

+Immutable tuples are useful in situations where you need to pass a few +items to a function and don't want the function to modify the tuple; +for example, +

+

+	point1 = (120, 140)
+	point2 = (200, 300)
+	record(point1, point2)
+	draw(point1, point2)
+
+You don't want to have to think about what would happen if record() +changed the coordinates -- it can't, because the tuples are immutable. +

+On the other hand, when creating large lists dynamically, it is +absolutely crucial that they are mutable -- adding elements to a tuple +one by one requires using the concatenation operator, which makes it +quadratic in time. +

+As a general guideline, use tuples like you would use structs in C or +records in Pascal, use lists like (variable length) arrays. +

+ +Edit this entry / +Log info + +/ Last changed on Fri May 23 15:26:03 1997 by +GvR +

+ +


+

6.16. How are lists implemented?

+Despite what a Lisper might think, Python's lists are really +variable-length arrays. The implementation uses a contiguous +array of references to other objects, and keeps a pointer +to this array (as well as its length) in a list head structure. +

+This makes indexing a list (a[i]) an operation whose cost is +independent of the size of the list or the value of the index. +

+When items are appended or inserted, the array of references is resized. +Some cleverness is applied to improve the performance of appending +items repeatedly; when the array must be grown, some extra space +is allocated so the next few times don't require an actual resize. +

+ +Edit this entry / +Log info + +/ Last changed on Fri May 23 15:32:24 1997 by +GvR +

+ +


+

6.17. How are dictionaries implemented?

+Python's dictionaries are implemented as resizable hash tables. +

+Compared to B-trees, this gives better performance for lookup +(the most common operation by far) under most circumstances, +and the implementation is simpler. +

+ +Edit this entry / +Log info + +/ Last changed on Fri May 23 23:51:14 1997 by +Vladimir Marangozov +

+ +


+

6.18. Why must dictionary keys be immutable?

+The hash table implementation of dictionaries uses a hash value +calculated from the key value to find the key. If the key were +a mutable object, its value could change, and thus its hash could +change. But since whoever changes the key object can't tell that +is incorporated in a dictionary, it can't move the entry around in +the dictionary. Then, when you try to look up the same object +in the dictionary, it won't be found, since its hash value is different; +and if you try to look up the old value, it won't be found either, +since the value of the object found in that hash bin differs. +

+If you think you need to have a dictionary indexed with a list, +try to use a tuple instead. The function tuple(l) creates a tuple +with the same entries as the list l. +

+Some unacceptable solutions that have been proposed: +

+- Hash lists by their address (object ID). This doesn't work because +if you construct a new list with the same value it won't be found; +e.g., +

+

+  d = {[1,2]: '12'}
+  print d[[1,2]]
+
+will raise a KeyError exception because the id of the [1,2] used +in the second line differs from that in the first line. +In other words, dictionary keys should be compared using '==', not using 'is'. +

+- Make a copy when using a list as a key. This doesn't work because +the list (being a mutable object) could contain a reference to itself, +and then the copying code would run into an infinite loop. +

+- Allow lists as keys but tell the user not to modify them. This would +allow a class of hard-to-track bugs in programs that I'd rather not see; +it invalidates an important invariant of dictionaries (every value in +d.keys() is usable as a key of the dictionary). +

+- Mark lists as read-only once they are used as a dictionary key. +The problem is that it's not just the top-level object that could change +its value; you could use a tuple containing a list as a key. Entering +anything as a key into a dictionary would require marking all objects +reachable from there as read-only -- and again, self-referential objects +could cause an infinite loop again (and again and again). +

+There is a trick to get around this if you need to, but +use it at your own risk: You +can wrap a mutable structure inside a class instance which +has both a __cmp__ and a __hash__ method. +

+

+   class listwrapper:
+        def __init__(self, the_list):
+              self.the_list = the_list
+        def __cmp__(self, other):
+              return self.the_list == other.the_list
+        def __hash__(self):
+              l = self.the_list
+              result = 98767 - len(l)*555
+              for i in range(len(l)):
+                   try:
+                        result = result + (hash(l[i]) % 9999999) * 1001 + i
+                   except:
+                        result = (result % 7777777) + i * 333
+              return result
+
+Note that the hash computation is complicated by the +possibility that some members of the list may be unhashable +and also by the possibility of arithmetic overflow. +

+You must make +sure that the hash value for all such wrapper objects that reside in a +dictionary (or other hash based structure), remain fixed while +the object is in the dictionary (or other structure). +

+Furthermore it must always be the case that if +o1 == o2 (ie o1.__cmp__(o2)==0) then hash(o1)==hash(o2) +(ie, o1.__hash__() == o2.__hash__()), regardless of whether +the object is in a dictionary or not. +If you fail to meet these restrictions dictionaries and other +hash based structures may misbehave! +

+In the case of listwrapper above whenever the wrapper +object is in a dictionary the wrapped list must not change +to avoid anomalies. Don't do this unless you are prepared +to think hard about the requirements and the consequences +of not meeting them correctly. You've been warned! +

+ +Edit this entry / +Log info + +/ Last changed on Thu Jul 10 10:08:40 1997 by +aaron watters +

+ +


+

6.19. How the heck do you make an array in Python?

+["this", 1, "is", "an", "array"] +

+Lists are arrays in the C or Pascal sense of the word (see question +6.16). The array module also provides methods for creating arrays +of fixed types with compact representations (but they are slower to +index than lists). Also note that the Numerics extensions and others +define array-like structures with various characteristics as well. +

+To get Lisp-like lists, emulate cons cells +

+

+    lisp_list = ("like",  ("this",  ("example", None) ) )
+
+using tuples (or lists, if you want mutability). Here the analogue +of lisp car is lisp_list[0] and the analogue of cdr is lisp_list[1]. +Only do this if you're sure you really need to (it's usually a lot +slower than using Python lists). +

+Think of Python lists as mutable heterogeneous arrays of +Python objects (say that 10 times fast :) ). +

+ +Edit this entry / +Log info + +/ Last changed on Wed Aug 13 07:08:27 1997 by +aaron watters +

+ +


+

6.20. Why doesn't list.sort() return the sorted list?

+In situations where performance matters, making a copy of the list +just to sort it would be wasteful. Therefore, list.sort() sorts +the list in place. In order to remind you of that fact, it does +not return the sorted list. This way, you won't be fooled into +accidentally overwriting a list when you need a sorted copy but also +need to keep the unsorted version around. +

+As a result, here's the idiom to iterate over the keys of a dictionary +in sorted order: +

+

+	keys = dict.keys()
+	keys.sort()
+	for key in keys:
+		...do whatever with dict[key]...
+
+

+ +Edit this entry / +Log info + +/ Last changed on Thu Dec 2 17:01:52 1999 by +Fred L. Drake, Jr. +

+ +


+

6.21. How do you specify and enforce an interface spec in Python?

+An interfaces specification for a module as provided +by languages such as C++ and java describes the prototypes +for the methods and functions of the module. Many feel +that compile time enforcement of interface specifications +help aid in the construction of large programs. Python +does not support interface specifications directly, but many +of their advantages can be obtained by an appropriate +test discipline for components, which can often be very +easily accomplished in Python. There is also a tool, PyChecker, +which can be used to find problems due to subclassing. +

+A good test suite for a module can at +once provide a regression test and serve as a module interface +specification (even better since it also gives example usage). Look to +many of the standard libraries which often have a "script +interpretation" which provides a simple "self test." Even +modules which use complex external interfaces can often +be tested in isolation using trivial "stub" emulations of the +external interface. +

+An appropriate testing discipline (if enforced) can help +build large complex applications in Python as well as having interface +specifications would do (or better). Of course Python allows you +to get sloppy and not do it. Also you might want to design +your code with an eye to make it easily tested. +

+ +Edit this entry / +Log info + +/ Last changed on Thu May 23 03:05:29 2002 by +Neal Norwitz +

+ +


+

6.22. Why do all classes have the same type? Why do instances all have the same type?

+The Pythonic use of the word "type" is quite different from +common usage in much of the rest of the programming language +world. A "type" in Python is a description for an object's operations +as implemented in C. All classes have the same operations +implemented in C which sometimes "call back" to differing program +fragments implemented in Python, and hence all classes have the +same type. Similarly at the C level all class instances have the +same C implementation, and hence all instances have the same +type. +

+Remember that in Python usage "type" refers to a C implementation +of an object. To distinguish among instances of different classes +use Instance.__class__, and also look to 4.47. Sorry for the +terminological confusion, but at this point in Python's development +nothing can be done! +

+ +Edit this entry / +Log info + +/ Last changed on Tue Jul 1 12:35:47 1997 by +aaron watters +

+ +


+

6.23. Why isn't all memory freed when Python exits?

+Objects referenced from Python module global name spaces are +not always deallocated when Python exits. +

+This may happen if there are circular references (see question +4.17). There are also certain bits of memory that are allocated +by the C library that are impossible to free (e.g. a tool +like Purify will complain about these). +

+But in general, Python 1.5 and beyond +(in contrast with earlier versions) is quite agressive about +cleaning up memory on exit. +

+If you want to force Python to delete certain things on deallocation +use the sys.exitfunc hook to force those deletions. For example +if you are debugging an extension module using a memory analysis +tool and you wish to make Python deallocate almost everything +you might use an exitfunc like this one: +

+

+  import sys
+
+
+  def my_exitfunc():
+       print "cleaning up"
+       import sys
+       # do order dependant deletions here
+       ...
+       # now delete everything else in arbitrary order
+       for x in sys.modules.values():
+            d = x.__dict__
+            for name in d.keys():
+                 del d[name]
+
+
+  sys.exitfunc = my_exitfunc
+
+Other exitfuncs can be less drastic, of course. +

+(In fact, this one just does what Python now already does itself; +but the example of using sys.exitfunc to force cleanups is still +useful.) +

+ +Edit this entry / +Log info + +/ Last changed on Tue Sep 29 09:46:26 1998 by +GvR +

+ +


+

6.24. Why no class methods or mutable class variables?

+The notation +

+

+    instance.attribute(arg1, arg2)
+
+usually translates to the equivalent of +

+

+    Class.attribute(instance, arg1, arg2)
+
+where Class is a (super)class of instance. Similarly +

+

+    instance.attribute = value
+
+sets an attribute of an instance (overriding any attribute of a class +that instance inherits). +

+Sometimes programmers want to have +different behaviours -- they want a method which does not bind +to the instance and a class attribute which changes in place. +Python does not preclude these behaviours, but you have to +adopt a convention to implement them. One way to accomplish +this is to use "list wrappers" and global functions. +

+

+   def C_hello():
+         print "hello"
+
+
+   class C:
+        hello = [C_hello]
+        counter = [0]
+
+
+    I = C()
+
+Here I.hello[0]() acts very much like a "class method" and +I.counter[0] = 2 alters C.counter (and doesn't override it). +If you don't understand why you'd ever want to do this, that's +because you are pure of mind, and you probably never will +want to do it! This is dangerous trickery, not recommended +when avoidable. (Inspired by Tim Peter's discussion.) +

+In Python 2.2, you can do this using the new built-in operations +classmethod and staticmethod. +See http://www.python.org/2.2/descrintro.html#staticmethods +

+ +Edit this entry / +Log info + +/ Last changed on Tue Sep 11 15:59:37 2001 by +GvR +

+ +


+

6.25. Why are default values sometimes shared between objects?

+It is often expected that a function CALL creates new objects for default +values. This is not what happens. Default values are created when the +function is DEFINED, that is, there is only one such object that all +functions refer to. If that object is changed, subsequent calls to the +function will refer to this changed object. By definition, immutable objects +(like numbers, strings, tuples, None) are safe from change. Changes to mutable +objects (like dictionaries, lists, class instances) is what causes the +confusion. +

+Because of this feature it is good programming practice not to use mutable +objects as default values, but to introduce them in the function. +Don't write: +

+

+	def foo(dict={}):  # XXX shared reference to one dict for all calls
+	    ...
+
+but: +
+	def foo(dict=None):
+		if dict is None:
+			dict = {} # create a new dict for local namespace
+
+See page 182 of "Internet Programming with Python" for one discussion +of this feature. Or see the top of page 144 or bottom of page 277 in +"Programming Python" for another discussion. +

+ +Edit this entry / +Log info + +/ Last changed on Sat Aug 16 07:03:35 1997 by +Case Roole +

+ +


+

6.26. Why no goto?

+Actually, you can use exceptions to provide a "structured goto" +that even works across function calls. Many feel that exceptions +can conveniently emulate all reasonable uses of the "go" or "goto" +constructs of C, Fortran, and other languages. For example: +

+

+   class label: pass # declare a label
+   try:
+        ...
+        if (condition): raise label() # goto label
+        ...
+   except label: # where to goto
+        pass
+   ...
+
+This doesn't allow you to jump into the middle of a loop, but +that's usually considered an abuse of goto anyway. Use sparingly. +

+ +Edit this entry / +Log info + +/ Last changed on Wed Sep 10 07:16:44 1997 by +aaron watters +

+ +


+

6.27. How do you make a higher order function in Python?

+You have two choices: you can use default arguments and override +them or you can use "callable objects." For example suppose you +wanted to define linear(a,b) which returns a function f where f(x) +computes the value a*x+b. Using default arguments: +

+

+     def linear(a,b):
+         def result(x, a=a, b=b):
+             return a*x + b
+         return result
+
+Or using callable objects: +

+

+     class linear:
+        def __init__(self, a, b):
+            self.a, self.b = a,b
+        def __call__(self, x):
+            return self.a * x + self.b
+
+In both cases: +

+

+     taxes = linear(0.3,2)
+
+gives a callable object where taxes(10e6) == 0.3 * 10e6 + 2. +

+The defaults strategy has the disadvantage that the default arguments +could be accidentally or maliciously overridden. The callable objects +approach has the disadvantage that it is a bit slower and a bit +longer. Note however that a collection of callables can share +their signature via inheritance. EG +

+

+      class exponential(linear):
+         # __init__ inherited
+         def __call__(self, x):
+             return self.a * (x ** self.b)
+
+On comp.lang.python, zenin@bawdycaste.org points out that +an object can encapsulate state for several methods in order +to emulate the "closure" concept from functional programming +languages, for example: +

+

+    class counter:
+        value = 0
+        def set(self, x): self.value = x
+        def up(self): self.value=self.value+1
+        def down(self): self.value=self.value-1
+
+
+    count = counter()
+    inc, dec, reset = count.up, count.down, count.set
+
+Here inc, dec and reset act like "functions which share the +same closure containing the variable count.value" (if you +like that way of thinking). +

+ +Edit this entry / +Log info + +/ Last changed on Fri Sep 25 08:38:35 1998 by +Aaron Watters +

+ +


+

6.28. Why do I get a SyntaxError for a 'continue' inside a 'try'?

+This is an implementation limitation, +caused by the extremely simple-minded +way Python generates bytecode. The try block pushes something on the +"block stack" which the continue would have to pop off again. The +current code generator doesn't have the data structures around so that +'continue' can generate the right code. +

+Note that JPython doesn't have this restriction! +

+ +Edit this entry / +Log info + +/ Last changed on Fri May 22 15:01:07 1998 by +GvR +

+ +


+

6.29. Why can't raw strings (r-strings) end with a backslash?

+More precisely, they can't end with an odd number of backslashes: +the unpaired backslash at the end escapes the closing quote character, +leaving an unterminated string. +

+Raw strings were designed to ease creating input for processors (chiefly +regular expression engines) that want to do their own backslash escape processing. Such processors consider an unmatched trailing backslash to be an error anyway, so raw strings disallow that. In return, they allow you to pass on the string quote character by escaping it with a backslash. These rules work well when r-strings are used for their intended purpose. +

+If you're trying to build Windows pathnames, note that all Windows system calls accept forward slashes too: +

+

+    f = open("/mydir/file.txt") # works fine!
+
+If you're trying to build a pathname for a DOS command, try e.g. one of +

+

+    dir = r"\this\is\my\dos\dir" "\\"
+    dir = r"\this\is\my\dos\dir\ "[:-1]
+    dir = "\\this\\is\\my\\dos\\dir\\"
+
+

+ +Edit this entry / +Log info + +/ Last changed on Mon Jul 13 20:50:20 1998 by +Tim Peters +

+ +


+

6.30. Why can't I use an assignment in an expression?

+Many people used to C or Perl complain that they want to be able to +use e.g. this C idiom: +

+

+    while (line = readline(f)) {
+        ...do something with line...
+    }
+
+where in Python you're forced to write this: +

+

+    while 1:
+        line = f.readline()
+        if not line:
+            break
+        ...do something with line...
+
+This issue comes up in the Python newsgroup with alarming frequency +-- search Deja News for past messages about assignment expression. +The reason for not allowing assignment in Python expressions +is a common, hard-to-find bug in those other languages, +caused by this construct: +

+

+    if (x = 0) {
+        ...error handling...
+    }
+    else {
+        ...code that only works for nonzero x...
+    }
+
+Many alternatives have been proposed. Most are hacks that save some +typing but use arbitrary or cryptic syntax or keywords, +and fail the simple criterion that I use for language change proposals: +it should intuitively suggest the proper meaning to a human reader +who has not yet been introduced with the construct. +

+The earliest time something can be done about this will be with +Python 2.0 -- if it is decided that it is worth fixing. +An interesting phenomenon is that most experienced Python programmers +recognize the "while 1" idiom and don't seem to be missing the +assignment in expression construct much; it's only the newcomers +who express a strong desire to add this to the language. +

+One fairly elegant solution would be to introduce a new operator +for assignment in expressions spelled ":=" -- this avoids the "=" +instead of "==" problem. It would have the same precedence +as comparison operators but the parser would flag combination with +other comparisons (without disambiguating parentheses) as an error. +

+Finally -- there's an alternative way of spelling this that seems +attractive but is generally less robust than the "while 1" solution: +

+

+    line = f.readline()
+    while line:
+        ...do something with line...
+        line = f.readline()
+
+The problem with this is that if you change your mind about exactly +how you get the next line (e.g. you want to change it into +sys.stdin.readline()) you have to remember to change two places +in your program -- the second one hidden at the bottom of the loop. +

+ +Edit this entry / +Log info + +/ Last changed on Tue May 18 00:57:41 1999 by +Andrew Dalke +

+ +


+

6.31. Why doesn't Python have a "with" statement like some other languages?

+Basically, because such a construct would be terribly ambiguous. Thanks to Carlos Ribeiro for the following remarks: +

+Some languages, such as Object Pascal, Delphi, and C++, use static types. So it is possible to know, in an unambiguous way, what member is being assigned in a "with" clause. This is the main point - the compiler always knows the scope of every variable at compile time. +

+Python uses dynamic types. It is impossible to know in advance which +attribute will be referenced at runtime. Member attributes may be added or removed from objects on the fly. This would make it impossible to know, from a simple reading, what attribute is being referenced - a local one, a global one, or a member attribute. +

+For instance, take the following snippet (it is incomplete btw, just to +give you the idea): +

+

+   def with_is_broken(a):
+      with a:
+         print x
+
+The snippet assumes that "a" must have a member attribute called "x". +However, there is nothing in Python that guarantees that. What should +happen if "a" is, let us say, an integer? And if I have a global variable named "x", will it end up being used inside the with block? As you see, the dynamic nature of Python makes such choices much harder. +

+The primary benefit of "with" and similar language features (reduction of code volume) can, however, easily be achieved in Python by assignment. Instead of: +

+

+    function(args).dict[index][index].a = 21
+    function(args).dict[index][index].b = 42
+    function(args).dict[index][index].c = 63
+
+would become: +

+

+    ref = function(args).dict[index][index]
+    ref.a = 21
+    ref.b = 42
+    ref.c = 63
+
+This also has the happy side-effect of increasing execution speed, since name bindings are resolved at run-time in Python, and the second method only needs to perform the resolution once. If the referenced object does not have a, b and c attributes, of course, the end result is still a run-time exception. +

+ +Edit this entry / +Log info + +/ Last changed on Fri Jan 11 14:32:58 2002 by +Steve Holden +

+ +


+

6.32. Why are colons required for if/while/def/class?

+The colon is required primarily to enhance readability (one of the +results of the experimental ABC language). Consider this: +

+

+    if a==b
+        print a
+
+versus +

+

+    if a==b:
+        print a
+
+Notice how the second one is slightly easier to read. Notice further how +a colon sets off the example in the second line of this FAQ answer; it's +a standard usage in English. Finally, the colon makes it easier for +editors with syntax highlighting. +

+ +Edit this entry / +Log info + +/ Last changed on Mon Jun 3 07:22:57 2002 by +Matthias Urlichs +

+ +


+

6.33. Can't we get rid of the Global Interpreter Lock?

+The Global Interpreter Lock (GIL) is often seen as a hindrance to +Python's deployment on high-end multiprocessor server machines, +because a multi-threaded Python program effectively only uses +one CPU, due to the insistence that (almost) all Python code +can only run while the GIL is held. +

+Back in the days of Python 1.5, Greg Stein actually implemented +a comprehensive patch set ("free threading") +that removed the GIL, replacing it with +fine-grained locking. Unfortunately, even on Windows (where locks +are very efficient) this ran ordinary Python code about twice as +slow as the interpreter using the GIL. On Linux the performance +loss was even worse (pthread locks aren't as efficient). +

+Since then, the idea of getting rid of the GIL has occasionally +come up but nobody has found a way to deal with the expected slowdown; +Greg's free threading patch set has not been kept up-to-date for +later Python versions. +

+This doesn't mean that you can't make good use of Python on +multi-CPU machines! You just have to be creative with dividing +the work up between multiple processes rather than multiple +threads. +

+

+It has been suggested that the GIL should be a per-interpreter-state +lock rather than truly global; interpreters then wouldn't be able +to share objects. Unfortunately, this isn't likely to happen either. +

+It would be a tremendous amount of work, because many object +implementations currently have global state. E.g. small ints and +small strings are cached; these caches would have to be moved to the +interpreter state. Other object types have their own free list; these +free lists would have to be moved to the interpreter state. And so +on. +

+And I doubt that it can even be done in finite time, because the same +problem exists for 3rd party extensions. It is likely that 3rd party +extensions are being written at a faster rate than you can convert +them to store all their global state in the interpreter state. +

+And finally, once you have multiple interpreters not sharing any +state, what have you gained over running each interpreter +in a separate process? +

+ +Edit this entry / +Log info + +/ Last changed on Fri Feb 7 16:34:01 2003 by +GvR +

+ +


+

7. Using Python on non-UNIX platforms

+ +
+

7.1. Is there a Mac version of Python?

+Yes, it is maintained by Jack Jansen. See Jack's MacPython Page: +

+

+  http://www.cwi.nl/~jack/macpython.html
+
+

+ +Edit this entry / +Log info + +/ Last changed on Fri May 4 09:33:42 2001 by +GvR +

+ +


+

7.2. Are there DOS and Windows versions of Python?

+Yes. The core windows binaries are available from http://www.python.org/windows/. There is a plethora of Windows extensions available, including a large number of not-always-compatible GUI toolkits. The core binaries include the standard Tkinter GUI extension. +

+Most windows extensions can be found (or referenced) at http://www.python.org/windows/ +

+Windows 3.1/DOS support seems to have dropped off recently. You may need to settle for an old version of Python one these platforms. One such port is WPY +

+WPY: Ports to DOS, Windows 3.1(1), Windows 95, Windows NT and OS/2. +Also contains a GUI package that offers portability between Windows +(not DOS) and Unix, and native look and feel on both. +ftp://ftp.python.org/pub/python/wpy/. +

+ +Edit this entry / +Log info + +/ Last changed on Tue Jun 2 20:21:57 1998 by +Mark Hammond +

+ +


+

7.3. Is there an OS/2 version of Python?

+Yes, see http://www.python.org/download/download_os2.html. +

+ +Edit this entry / +Log info + +/ Last changed on Tue Sep 7 11:33:16 1999 by +GvR +

+ +


+

7.4. Is there a VMS version of Python?

+Jean-François Piéronne has ported 2.1.3 to OpenVMS. It can be found at +<http://vmspython.dyndns.org/>. +

+ +Edit this entry / +Log info + +/ Last changed on Thu Sep 19 15:40:38 2002 by +Skip Montanaro +

+ +


+

7.5. What about IBM mainframes, or other non-UNIX platforms?

+I haven't heard about these, except I remember hearing about an +OS/9 port and a port to Vxworks (both operating systems for embedded +systems). If you're interested in any of this, go directly to the +newsgroup and ask there, you may find exactly what you need. For +example, a port to MPE/iX 5.0 on HP3000 computers was just announced, +see http://www.allegro.com/software/. +

+On the IBM mainframe side, for Z/OS there's a port of python 1.4 that goes with their open-unix package, formely OpenEdition MVS, (http://www-1.ibm.com/servers/eserver/zseries/zos/unix/python.html). On a side note, there's also a java vm ported - so, in theory, jython could run too. +

+ +Edit this entry / +Log info + +/ Last changed on Mon Nov 18 03:18:39 2002 by +Bruno Jessen +

+ +


+

7.6. Where are the source or Makefiles for the non-UNIX versions?

+The standard sources can (almost) be used. Additional sources can +be found in the platform-specific subdirectories of the distribution. +

+ +Edit this entry / +Log info +

+ +


+

7.7. What is the status and support for the non-UNIX versions?

+I don't have access to most of these platforms, so in general I am +dependent on material submitted by volunteers. However I strive to +integrate all changes needed to get it to compile on a particular +platform back into the standard sources, so porting of the next +version to the various non-UNIX platforms should be easy. +(Note that Linux is classified as a UNIX platform here. :-) +

+Some specific platforms: +

+Windows: all versions (95, 98, ME, NT, 2000, XP) are supported, +all python.org releases come with a Windows installer. +

+MacOS: Jack Jansen does an admirable job of keeping the Mac version +up to date (both MacOS X and older versions); +see http://www.cwi.nl/~jack/macpython.html +

+For all supported platforms, see http://www.python.org/download/ +(follow the link to "Other platforms" for less common platforms) +

+ +Edit this entry / +Log info + +/ Last changed on Fri May 24 21:34:24 2002 by +GvR +

+ +


+

7.8. I have a PC version but it appears to be only a binary. Where's the library?

+If you are running any version of Windows, then you have the wrong distribution. The FAQ lists current Windows versions. Notably, Pythonwin and wpy provide fully functional installations. +

+But if you are sure you have the only distribution with a hope of working on +your system, then... +

+You still need to copy the files from the distribution directory +"python/Lib" to your system. If you don't have the full distribution, +you can get the file lib<version>.tar.gz from most ftp sites carrying +Python; this is a subset of the distribution containing just those +files, e.g. ftp://ftp.python.org/pub/python/src/lib1.4.tar.gz. +

+Once you have installed the library, you need to point sys.path to it. +Assuming the library is in C:\misc\python\lib, the following commands +will point your Python interpreter to it (note the doubled backslashes +-- you can also use single forward slashes instead): +

+

+        >>> import sys
+        >>> sys.path.insert(0, 'C:\\misc\\python\\lib')
+        >>>
+
+For a more permanent effect, set the environment variable PYTHONPATH, +as follows (talking to a DOS prompt): +

+

+        C> SET PYTHONPATH=C:\misc\python\lib
+
+

+ +Edit this entry / +Log info + +/ Last changed on Fri May 23 16:28:27 1997 by +Ken Manheimer +

+ +


+

7.9. Where's the documentation for the Mac or PC version?

+The documentation for the Unix version also applies to the Mac and +PC versions. Where applicable, differences are indicated in the text. +

+ +Edit this entry / +Log info +

+ +


+

7.10. How do I create a Python program file on the Mac or PC?

+Use an external editor. On the Mac, BBEdit seems to be a popular +no-frills text editor. I work like this: start the interpreter; edit +a module file using BBedit; import and test it in the interpreter; +edit again in BBedit; then use the built-in function reload() to +re-read the imported module; etc. In the 1.4 distribution +you will find a BBEdit extension that makes life a little easier: +it can tell the interpreter to execute the current window. +See :Mac:Tools:BBPy:README. +

+Regarding the same question for the PC, Kurt Wm. Hemr writes: "While +anyone with a pulse could certainly figure out how to do the same on +MS-Windows, I would recommend the NotGNU Emacs clone for MS-Windows. +Not only can you easily resave and "reload()" from Python after making +changes, but since WinNot auto-copies to the clipboard any text you +select, you can simply select the entire procedure (function) which +you changed in WinNot, switch to QWPython, and shift-ins to reenter +the changed program unit." +

+If you're using Windows95 or Windows NT, you should also know about +PythonWin, which provides a GUI framework, with an mouse-driven +editor, an object browser, and a GUI-based debugger. See +

+       http://www.python.org/ftp/python/pythonwin/
+
+for details. +

+ +Edit this entry / +Log info + +/ Last changed on Sun May 25 10:04:25 1997 by +GvR +

+ +


+

7.11. How can I use Tkinter on Windows 95/NT?

+Starting from Python 1.5, it's very easy -- just download and install +Python and Tcl/Tk and you're in business. See +

+

+  http://www.python.org/download/download_windows.html
+
+One warning: don't attempt to use Tkinter from PythonWin +(Mark Hammond's IDE). Use it from the command line interface +(python.exe) or the windowless interpreter (pythonw.exe). +

+ +Edit this entry / +Log info + +/ Last changed on Fri Jun 12 09:32:48 1998 by +GvR +

+ +


+

7.12. cgi.py (or other CGI programming) doesn't work sometimes on NT or win95!

+Be sure you have the latest python.exe, that you are using +python.exe rather than a GUI version of python and that you +have configured the server to execute +

+

+     "...\python.exe -u ..."
+
+for the cgi execution. The -u (unbuffered) option on NT and +win95 prevents the interpreter from altering newlines in the +standard input and output. Without it post/multipart requests +will seem to have the wrong length and binary (eg, GIF) +responses may get garbled (resulting in, eg, a "broken image"). +

+ +Edit this entry / +Log info + +/ Last changed on Wed Jul 30 10:48:02 1997 by +aaron watters +

+ +


+

7.13. Why doesn't os.popen() work in PythonWin on NT?

+The reason that os.popen() doesn't work from within PythonWin is due to a bug in Microsoft's C Runtime Library (CRT). The CRT assumes you have a Win32 console attached to the process. +

+You should use the win32pipe module's popen() instead which doesn't depend on having an attached Win32 console. +

+Example: +

+ import win32pipe
+ f = win32pipe.popen('dir /c c:\\')
+ print f.readlines()
+ f.close()
+
+

+ +Edit this entry / +Log info + +/ Last changed on Thu Jul 31 15:34:09 1997 by +Bill Tutt +

+ +


+

7.14. How do I use different functionality on different platforms with the same program?

+Remember that Python is extremely dynamic and that you +can use this dynamism to configure a program at run-time to +use available functionality on different platforms. For example +you can test the sys.platform and import different modules based +on its value. +

+

+   import sys
+   if sys.platform == "win32":
+      import win32pipe
+      popen = win32pipe.popen
+   else:
+      import os
+      popen = os.popen
+
+(See FAQ 7.13 for an explanation of why you might want to +do something like this.) Also you can try to import a module +and use a fallback if the import fails: +

+

+    try:
+         import really_fast_implementation
+         choice = really_fast_implementation
+    except ImportError:
+         import slower_implementation
+         choice = slower_implementation
+
+

+ +Edit this entry / +Log info + +/ Last changed on Wed Aug 13 07:39:06 1997 by +aaron watters +

+ +


+

7.15. Is there an Amiga version of Python?

+Yes. See the AmigaPython homepage at http://www.bigfoot.com/~irmen/python.html. +

+ +Edit this entry / +Log info + +/ Last changed on Mon Dec 14 06:53:32 1998 by +Irmen de Jong +

+ +


+

7.16. Why doesn't os.popen()/win32pipe.popen() work on Win9x?

+There is a bug in Win9x that prevents os.popen/win32pipe.popen* from working. The good news is there is a way to work around this problem. +The Microsoft Knowledge Base article that you need to lookup is: Q150956. You will find links to the knowledge base at: +http://www.microsoft.com/kb. +

+ +Edit this entry / +Log info + +/ Last changed on Fri Jun 25 10:45:38 1999 by +Bill Tutt +

+ +


+

8. Python on Windows

+ +
+

8.1. Using Python for CGI on Microsoft Windows

+** Setting up the Microsoft IIS Server/Peer Server +

+On the Microsoft IIS +server or on the Win95 MS Personal Web Server +you set up python in the same way that you +would set up any other scripting engine. +

+Run regedt32 and go to: +

+HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\W3SVC\Parameters\ScriptMap +

+and enter the following line (making any specific changes that your system may need) +

+.py :REG_SZ: c:\<path to python>\python.exe -u %s %s +

+This line will allow you to call your script with a simple reference like: +http://yourserver/scripts/yourscript.py +provided "scripts" is an "executable" directory for your server (which +it usually is by default). +The "-u" flag specifies unbuffered and binary mode for stdin - needed when working with binary data +

+In addition, it is recommended by people who would know that using ".py" may +not be a good idea for the file extensions when used in this context +(you might want to reserve *.py for support modules and use *.cgi or *.cgp +for "main program" scripts). +However, that issue is beyond this Windows FAQ entry. +

+

+** Apache configuration +

+In the Apache configuration file httpd.conf, add the following line at +the end of the file: +

+ScriptInterpreterSource Registry +

+Then, give your Python CGI-scripts the extension .py and put them in the cgi-bin directory. +

+

+** Netscape Servers: +Information on this topic exists at: +http://home.netscape.com/comprod/server_central/support/fasttrack_man/programs.htm#1010870 +

+ +Edit this entry / +Log info + +/ Last changed on Wed Mar 27 12:25:54 2002 by +Gerhard Häring +

+ +


+

8.2. How to check for a keypress without blocking?

+Use the msvcrt module. This is a standard Windows-specific extensions +in Python 1.5 and beyond. It defines a function kbhit() which checks +whether a keyboard hit is present; also getch() which gets one +character without echo. Plus a few other goodies. +

+(Search for "keypress" to find an answer for Unix as well.) +

+ +Edit this entry / +Log info + +/ Last changed on Mon Mar 30 16:21:46 1998 by +GvR +

+ +


+

8.3. $PYTHONPATH

+In MS-DOS derived environments, a unix variable such as $PYTHONPATH is +set as PYTHONPATH, without the dollar sign. PYTHONPATH is useful for +specifying the location of library files. +

+ +Edit this entry / +Log info + +/ Last changed on Thu Jun 11 00:41:26 1998 by +Gvr +

+ +


+

8.4. dedent syntax errors

+The FAQ does not recommend using tabs, and Guido's Python Style Guide recommends 4 spaces for distributed Python code; this is also the Emacs python-mode default; see +

+

+    http://www.python.org/doc/essays/styleguide.html
+
+Under any editor mixing tabs and spaces is a bad idea. MSVC is no different in this respect, and is easily configured to use spaces: Take Tools -> Options -> Tabs, and for file type "Default" set "Tab size" and "Indent size" to 4, and select the "Insert spaces" radio button. +

+If you suspect mixed tabs and spaces are causing problems in leading whitespace, run Python with the -t switch or, run Tools/Scripts/tabnanny.py to check a directory tree in batch mode. +

+ +Edit this entry / +Log info + +/ Last changed on Mon Feb 12 15:04:14 2001 by +Steve Holden +

+ +


+

8.5. How do I emulate os.kill() in Windows?

+Use win32api: +

+

+    def kill(pid):
+        """kill function for Win32"""
+        import win32api
+        handle = win32api.OpenProcess(1, 0, pid)
+        return (0 != win32api.TerminateProcess(handle, 0))
+
+

+ +Edit this entry / +Log info + +/ Last changed on Sat Aug 8 18:55:06 1998 by +Jeff Bauer +

+ +


+

8.6. Why does os.path.isdir() fail on NT shared directories?

+The solution appears to be always append the "\\" on +the end of shared drives. +

+

+  >>> import os
+  >>> os.path.isdir( '\\\\rorschach\\public')
+  0
+  >>> os.path.isdir( '\\\\rorschach\\public\\')
+  1
+
+[Blake Winton responds:] +I've had the same problem doing "Start >> Run" and then a +directory on a shared drive. If I use "\\rorschach\public", +it will fail, but if I use "\\rorschach\public\", it will +work. For that matter, os.stat() does the same thing (well, +it gives an error for "\\\\rorschach\\public", but you get +the idea)... +

+I've got a theory about why this happens, but it's only +a theory. NT knows the difference between shared directories, +and regular directories. "\\rorschach\public" isn't a +directory, it's _really_ an IPC abstraction. This is sort +of lended credence to by the fact that when you're mapping +a network drive, you can't map "\\rorschach\public\utils", +but only "\\rorschach\public". +

+[Clarification by funkster@midwinter.com] +It's not actually a Python +question, as Python is working just fine; it's clearing up something +a bit muddled about Windows networked drives. +

+It helps to think of share points as being like drive letters. +Example: +

+        k: is not a directory
+        k:\ is a directory
+        k:\media is a directory
+        k:\media\ is not a directory
+
+The same rules apply if you substitute "k:" with "\\conky\foo": +
+        \\conky\foo  is not a directory
+        \\conky\foo\ is a directory
+        \\conky\foo\media is a directory
+        \\conky\foo\media\ is not a directory
+
+

+ +Edit this entry / +Log info + +/ Last changed on Sun Jan 31 08:44:48 1999 by +GvR +

+ +


+

8.7. PyRun_SimpleFile() crashes on Windows but not on Unix

+I've seen a number of reports of PyRun_SimpleFile() failing +in a Windows port of an application embedding Python that worked +fine on Unix. PyRun_SimpleString() works fine on both platforms. +

+I think this happens because the application was compiled with a +different set of compiler flags than Python15.DLL. It seems that some +compiler flags affect the standard I/O library in such a way that +using different flags makes calls fail. You need to set it for +the non-debug multi-threaded DLL (/MD on the command line, or can be set via MSVC under Project Settings->C++/Code Generation then the "Use rum-time library" dropdown.) +

+Also note that you can not mix-and-match Debug and Release versions. If you wish to use the Debug Multithreaded DLL, then your module _must_ have an "_d" appended to the base name. +

+ +Edit this entry / +Log info + +/ Last changed on Wed Nov 17 17:37:07 1999 by +Mark Hammond +

+ +


+

8.8. Import of _tkinter fails on Windows 95/98

+Sometimes, the import of _tkinter fails on Windows 95 or 98, +complaining with a message like the following: +

+

+  ImportError: DLL load failed: One of the library files needed
+  to run this application cannot be found.
+
+It could be that you haven't installed Tcl/Tk, but if you did +install Tcl/Tk, and the Wish application works correctly, +the problem may be that its installer didn't +manage to edit the autoexec.bat file correctly. It tries to add a +statement that changes the PATH environment variable to include +the Tcl/Tk 'bin' subdirectory, but sometimes this edit doesn't +quite work. Opening it with notepad usually reveals what the +problem is. +

+(One additional hint, noted by David Szafranski: you can't use +long filenames here; e.g. use C:\PROGRA~1\Tcl\bin instead of +C:\Program Files\Tcl\bin.) +

+ +Edit this entry / +Log info + +/ Last changed on Wed Dec 2 22:32:41 1998 by +GvR +

+ +


+

8.9. Can't extract the downloaded documentation on Windows

+Sometimes, when you download the documentation package to a Windows +machine using a web browser, the file extension of the saved file +ends up being .EXE. This is a mistake; the extension should be .TGZ. +

+Simply rename the downloaded file to have the .TGZ extension, and +WinZip will be able to handle it. (If your copy of WinZip doesn't, +get a newer one from http://www.winzip.com.) +

+ +Edit this entry / +Log info + +/ Last changed on Sat Nov 21 13:41:35 1998 by +GvR +

+ +


+

8.10. Can't get Py_RunSimpleFile() to work.

+This is very sensitive to the compiler vendor, version and (perhaps) +even options. If the FILE* structure in your embedding program isn't +the same as is assumed by the Python interpreter it won't work. +

+The Python 1.5.* DLLs (python15.dll) are all compiled +with MS VC++ 5.0 and with multithreading-DLL options (/MD, I think). +

+If you can't change compilers or flags, try using Py_RunSimpleString(). +A trick to get it to run an arbitrary file is to construct a call to +execfile() with the name of your file as argument. +

+ +Edit this entry / +Log info + +/ Last changed on Wed Jan 13 10:58:14 1999 by +GvR +

+ +


+

8.11. Where is Freeze for Windows?

+("Freeze" is a program that allows you to ship a Python program +as a single stand-alone executable file. It is not a compiler, +your programs don't run any faster, but they are more easily +distributable (to platforms with the same OS and CPU). Read the +README file of the freeze program for more disclaimers.) +

+You can use freeze on Windows, but you must download the source +tree (see http://www.python.org/download/download_source.html). +This is recommended for Python 1.5.2 (and betas thereof) only; +older versions don't quite work. +

+You need the Microsoft VC++ 5.0 compiler (maybe it works with +6.0 too). You probably need to build Python -- the project files +are all in the PCbuild directory. +

+The freeze program is in the Tools\freeze subdirectory of the source +tree. +

+ +Edit this entry / +Log info + +/ Last changed on Wed Feb 17 18:47:24 1999 by +GvR +

+ +


+

8.12. Is a *.pyd file the same as a DLL?

+Yes, .pyd files are dll's. But there are a few differences. If you +have a DLL named foo.pyd, then it must have a function initfoo(). You +can then write Python "import foo", and Python will search for foo.pyd +(as well as foo.py, foo.pyc) and if it finds it, will attempt to call +initfoo() to initialize it. You do not link your .exe with foo.lib, +as that would cause Windows to require the DLL to be present. +

+Note that the search path for foo.pyd is PYTHONPATH, not the same as +the path that Windows uses to search for foo.dll. Also, foo.pyd need +not be present to run your program, whereas if you linked your program +with a dll, the dll is required. Of course, foo.pyd is required if +you want to say "import foo". In a dll, linkage is declared in the +source code with __declspec(dllexport). In a .pyd, linkage is defined +in a list of available functions. +

+ +Edit this entry / +Log info + +/ Last changed on Tue Nov 23 02:40:08 1999 by +Jameson Quinn +

+ +


+

8.13. Missing cw3215mt.dll (or missing cw3215.dll)

+Sometimes, when using Tkinter on Windows, you get an error that +cw3215mt.dll or cw3215.dll is missing. +

+Cause: you have an old Tcl/Tk DLL built with cygwin in your path +(probably C:\Windows). You must use the Tcl/Tk DLLs from the +standard Tcl/Tk installation (Python 1.5.2 comes with one). +

+ +Edit this entry / +Log info + +/ Last changed on Fri Jun 11 00:54:13 1999 by +GvR +

+ +


+

8.14. How to make python scripts executable:

+[Blake Coverett] +

+Win2K: +

+The standard installer already associates the .py extension with a file type +(Python.File) and gives that file type an open command that runs the +interpreter (D:\Program Files\Python\python.exe "%1" %*). This is enough to +make scripts executable from the command prompt as 'foo.py'. If you'd +rather be able to execute the script by simple typing 'foo' with no +extension you need to add .py to the PATHEXT environment variable. +

+WinNT: +

+The steps taken by the installed as described above allow you do run a +script with 'foo.py', but a long time bug in the NT command processor +prevents you from redirecting the input or output of any script executed in +this way. This is often important. +

+An appropriate incantation for making a Python script executable under WinNT +is to give the file an extension of .cmd and add the following as the first +line: +

+

+    @setlocal enableextensions & python -x %~f0 %* & goto :EOF
+
+Win9x: +

+[Due to Bruce Eckel] +

+

+  @echo off
+  rem = """
+  rem run python on this bat file. Needs the full path where
+  rem you keep your python files. The -x causes python to skip
+  rem the first line of the file:
+  python -x c:\aaa\Python\\"%0".bat %1 %2 %3 %4 %5 %6 %7 %8 %9
+  goto endofpython
+  rem """
+
+
+  # The python program goes here:
+
+
+  print "hello, Python"
+
+
+  # For the end of the batch file:
+  rem = """
+  :endofpython
+  rem """
+
+

+ +Edit this entry / +Log info + +/ Last changed on Tue Nov 30 10:25:17 1999 by +GvR +

+ +


+

8.15. Warning about CTL3D32 version from installer

+The Python installer issues a warning like this: +

+

+  This version uses CTL3D32.DLL whitch is not the correct version.
+  This version is used for windows NT applications only.
+
+[Tim Peters] +This is a Microsoft DLL, and a notorious +source of problems. The msg means what it says: you have the wrong version +of this DLL for your operating system. The Python installation did not +cause this -- something else you installed previous to this overwrote the +DLL that came with your OS (probably older shareware of some sort, but +there's no way to tell now). If you search for "CTL3D32" using any search +engine (AltaVista, for example), you'll find hundreds and hundreds of web +pages complaining about the same problem with all sorts of installation +programs. They'll point you to ways to get the correct version reinstalled +on your system (since Python doesn't cause this, we can't fix it). +

+David A Burton has written a little program to fix this. Go to +http://www.burtonsys.com/download.html and click on "ctl3dfix.zip" +

+ +Edit this entry / +Log info + +/ Last changed on Thu Oct 26 15:42:00 2000 by +GvR +

+ +


+

8.16. How can I embed Python into a Windows application?

+Edward K. Ream <edream@tds.net> writes +

+When '##' appears in a file name below, it is an abbreviated version number. For example, for Python 2.1.1, ## will be replaced by 21. +

+Embedding the Python interpreter in a Windows app can be summarized as +follows: +

+1. Do _not_ build Python into your .exe file directly. On Windows, +Python must be a DLL to handle importing modules that are themselves +DLL's. (This is the first key undocumented fact.) Instead, link to +python##.dll; it is typically installed in c:\Windows\System. +

+You can link to Python statically or dynamically. Linking statically +means linking against python##.lib The drawback is that your app won't +run if python##.dll does not exist on your system. +

+General note: python##.lib is the so-called "import lib" corresponding +to python.dll. It merely defines symbols for the linker. +

+Borland note: convert python##.lib to OMF format using Coff2Omf.exe +first. +

+Linking dynamically greatly simplifies link options; everything happens +at run time. Your code must load python##.dll using the Windows +LoadLibraryEx() routine. The code must also use access routines and +data in python##.dll (that is, Python's C API's) using pointers +obtained by the Windows GetProcAddress() routine. Macros can make +using these pointers transparent to any C code that calls routines in +Python's C API. +

+2. If you use SWIG, it is easy to create a Python "extension module" +that will make the app's data and methods available to Python. SWIG +will handle just about all the grungy details for you. The result is C +code that you link _into your .exe file_ (!) You do _not_ have to +create a DLL file, and this also simplifies linking. +

+3. SWIG will create an init function (a C function) whose name depends +on the name of the extension module. For example, if the name of the +module is leo, the init function will be called initleo(). If you use +SWIG shadow classes, as you should, the init function will be called +initleoc(). This initializes a mostly hidden helper class used by the +shadow class. +

+The reason you can link the C code in step 2 into your .exe file is that +calling the initialization function is equivalent to importing the +module into Python! (This is the second key undocumented fact.) +

+4. In short, you can use the following code to initialize the Python +interpreter with your extension module. +

+

+    #include "python.h"
+    ...
+    Py_Initialize();  // Initialize Python.
+    initmyAppc();  // Initialize (import) the helper class. 
+    PyRun_SimpleString("import myApp") ;  // Import the shadow class.
+
+5. There are two problems with Python's C API which will become apparent +if you use a compiler other than MSVC, the compiler used to build +python##.dll. +

+Problem 1: The so-called "Very High Level" functions that take FILE * +arguments will not work in a multi-compiler environment; each compiler's +notion of a struct FILE will be different. From an implementation +standpoint these are very _low_ level functions. +

+Problem 2: SWIG generates the following code when generating wrappers to +void functions: +

+

+    Py_INCREF(Py_None);
+    _resultobj = Py_None;
+    return _resultobj;
+
+Alas, Py_None is a macro that expands to a reference to a complex data +structure called _Py_NoneStruct inside python##.dll. Again, this code +will fail in a mult-compiler environment. Replace such code by: +

+

+    return Py_BuildValue("");
+
+It may be possible to use SWIG's %typemap command to make the change +automatically, though I have not been able to get this to work (I'm a +complete SWIG newbie). +

+6. Using a Python shell script to put up a Python interpreter window +from inside your Windows app is not a good idea; the resulting window +will be independent of your app's windowing system. Rather, you (or the +wxPythonWindow class) should create a "native" interpreter window. It +is easy to connect that window to the Python interpreter. You can +redirect Python's i/o to _any_ object that supports read and write, so +all you need is a Python object (defined in your extension module) that +contains read() and write() methods. +

+ +Edit this entry / +Log info + +/ Last changed on Thu Jan 31 16:29:34 2002 by +Victor Kryukov +

+ +


+

8.17. Setting up IIS 5 to use Python for CGI

+In order to set up Internet Information Services 5 to use Python for CGI processing, please see the following links: +

+http://www.e-coli.net/pyiis_server.html (for Win2k Server) +http://www.e-coli.net/pyiis.html (for Win2k pro) +

+ +Edit this entry / +Log info + +/ Last changed on Fri Mar 22 22:05:51 2002 by +douglas savitsky +

+ +


+

8.18. How do I run a Python program under Windows?

+This is not necessarily quite the straightforward question it appears +to be. If you are already familiar with running programs from the +Windows command line then everything will seem really easy and +obvious. If your computer experience is limited then you might need a +little more guidance. Also there are differences between Windows 95, +98, NT, ME, 2000 and XP which can add to the confusion. You might +think of this as "why I pay software support charges" if you have a +helpful and friendly administrator to help you set things up without +having to understand all this yourself. If so, then great! Show them +this page and it should be a done deal. +

+Unless you use some sort of integrated development environment (such +as PythonWin or IDLE, to name only two in a growing family) then you +will end up typing Windows commands into what is variously referred +to as a "DOS window" or "Command prompt window". Usually you can +create such a window from your Start menu (under Windows 2000 I use +"Start | Programs | Accessories | Command Prompt"). You should be +able to recognize when you have started such a window because you will +see a Windows "command prompt", which usually looks like this: +

+

+    C:\>
+
+The letter may be different, and there might be other things after it, +so you might just as easily see something like: +

+

+    D:\Steve\Projects\Python>
+
+depending on how your computer has been set up and what else you have +recently done with it. Once you have started such a window, you are +well on the way to running Python programs. +

+You need to realize that your Python scripts have to be processed by +another program, usually called the "Python interpreter". The +interpreter reads your script, "compiles" it into "Python bytecodes" +(which are instructions for an imaginary computer known as the "Python +Virtual Machine") and then executes the bytecodes to run your +program. So, how do you arrange for the interpreter to handle your +Python? +

+First, you need to make sure that your command window recognises the +word "python" as an instruction to start the interpreter. If you have +opened a command window, you should try entering the command: +

+

+    python
+
+and hitting return. If you then see something like: +

+

+    Python 2.2 (#28, Dec 21 2001, 12:21:22) [MSC 32 bit (Intel)] on win32
+    Type "help", "copyright", "credits" or "license" for more information.
+    >>>
+
+then this part of the job has been correctly managed during Python's +installation process, and you have started the interpreter in +"interactive mode". That means you can enter Python statements or +expressions interactively and have them executed or evaluated while +you wait. This is one of Python's strongest features, but it takes a +little getting used to. Check it by entering a few expressions of your +choice and seeing the results... +

+

+    >>> print "Hello"
+    Hello
+    >>> "Hello" * 3
+    HelloHelloHello
+
+When you want to end your interactive Python session, enter a +terminator (hold the Ctrl key down while you enter a Z, then hit the +"Enter" key) to get back to your Windows command prompt. You may also +find that you have a Start-menu entry such as "Start | Programs | +Python 2.2 | Python (command line)" that results in you seeing the +">>>" prompt in a new window. If so, the window will disappear after +you enter the terminator -- Windows runs a single "python" command in +the window, which terminates when you terminate the interpreter. +

+If the "python" command, instead of displaying the interpreter prompt ">>>", gives you a message like +

+

+    'python' is not recognized as an internal or external command,
+    operable program or batch file.
+
+or +

+

+    Bad command or filename
+
+then you need to make sure that your computer knows where to find the +Python interpreter. To do this you will have to modify a setting +called the PATH, which is a just list of directories where Windows +will look for programs. Rather than just enter the right command every +time you create a command window, you should arrange for Python's +installation directory to be added to the PATH of every command window +as it starts. If you installed Python fairly recently then the command +

+

+    dir C:\py*
+
+will probably tell you where it is installed. Alternatively, perhaps +you made a note. Otherwise you will be reduced to a search of your +whole disk ... break out the Windows explorer and use "Tools | Find" +or hit the "Search" button and look for "python.exe". Suppose you +discover that Python is installed in the C:\Python22 directory (the +default at the time of writing) then you should make sure that +entering the command +

+

+    c:\Python22\python
+
+starts up the interpreter as above (and don't forget you'll need a +"CTRL-Z" and an "Enter" to get out of it). Once you have verified the +directory, you need to add it to the start-up routines your computer +goes through. For older versions of Windows the easiest way to do +this is to edit the C:\AUTOEXEC.BAT file. You would want to add a line +like the following to AUTOEXEC.BAT: +

+

+    PATH C:\Python22;%PATH%
+
+For Windows NT, 2000 and (I assume) XP, you will need to add a string +such as +

+

+    ;C:\Python22
+
+to the current setting for the PATH environment variable, which you +will find in the properties window of "My Computer" under the +"Advanced" tab. Note that if you have sufficient privilege you might +get a choice of installing the settings either for the Current User or +for System. The latter is preferred if you want everybody to be able +to run Python on the machine. +

+If you aren't confident doing any of these manipulations yourself, ask +for help! At this stage you may or may not want to reboot your system +to make absolutely sure the new setting has "taken" (don't you love +the way Windows gives you these freqeuent coffee breaks). You probably +won't need to for Windows NT, XP or 2000. You can also avoid it in +earlier versions by editing the file C:\WINDOWS\COMMAND\CMDINIT.BAT +instead of AUTOEXEC.BAT. +

+You should now be able to start a new command window, enter +

+

+    python
+
+at the "C:>" (or whatever) prompt, and see the ">>>" prompt that +indicates the Python interpreter is reading interactive commands. +

+Let's suppose you have a program called "pytest.py" in directory +"C:\Steve\Projects\Python". A session to run that program might look +like this: +

+

+    C:\> cd \Steve\Projects\Python
+    C:\Steve\Projects\Python> python pytest.py
+
+Because you added a file name to the command to start the interpreter, +when it starts up it reads the Python script in the named file, +compiles it, executes it, and terminates (so you see another "C:\>" +prompt). You might also have entered +

+

+    C:\> python \Steve\Projects\Python\pytest.py
+
+if you hadn't wanted to change your current directory. +

+Under NT, 2000 and XP you may well find that the installation process +has also arranged that the command +

+

+    pytest.py
+
+(or, if the file isn't in the current directory) +

+

+    C:\Steve\Projects\Python\pytest.py
+
+will automatically recognize the ".py" extension and run the Python +interpreter on the named file. Using this feature is fine, but some +versions of Windows have bugs which mean that this form isn't exactly +equivalent to using the interpreter explicitly, so be careful. Easier +to remember, for now, that +

+

+    python C:\Steve\Projects\Python\pytest.py
+
+works pretty close to the same, and redirection will work (more) +reliably. +

+The important things to remember are: +

+1. Start Python from the Start Menu, or make sure the PATH is set +correctly so Windows can find the Python interpreter. +

+

+    python
+
+should give you a '>>>" prompt from the Python interpreter. Don't +forget the CTRL-Z and ENTER to terminate the interpreter (and, if you +started the window from the Start Menu, make the window disappear). +

+2. Once this works, you run programs with commands: +

+

+    python {program-file}
+
+3. When you know the commands to use you can build Windows shortcuts +to run the Python interpreter on any of your scripts, naming +particular working directories, and adding them to your menus, but +that's another lessFAQ. Take a look at +

+

+    python --help
+
+if your needs are complex. +

+4. Interactive mode (where you see the ">>>" prompt) is best used +not for running programs, which are better executed as in steps 2 +and 3, but for checking that individual statements and expressions do +what you think they will, and for developing code by experiment. +

+ +Edit this entry / +Log info + +/ Last changed on Tue Aug 20 16:19:53 2002 by +GvR +

+ +


+Python home / +Python FAQ Wizard 1.0.3 / +Feedback to GvR +

Python Powered
+ + --- python3.4-3.4~b1.orig/debian/PVER-dbg.README.Debian.in +++ python3.4-3.4~b1/debian/PVER-dbg.README.Debian.in @@ -0,0 +1,52 @@ +Contents of the @PVER@-dbg package +------------------------------------- + +For debugging python and extension modules, you may want to add the contents +of /usr/share/doc/@PVER@/gdbinit (found in the @PVER@-dev package) to your +~/.gdbinit file. + +@PVER@-dbg contains two sets of packages: + + - debugging symbols for the standard @PVER@ build. When this package + is installed, gdb will automatically load up the debugging symbols + from it when debugging @PVER@ or one of the included extension + modules. + + - a separate @PVER@-dbg binary, configured --with-pydebug, enabling the + additional debugging code to help debug memory management problems. + +For the latter, all extension modules have to be recompiled to +correctly load with an pydebug enabled build. + + +Debian and Ubuntu specific changes to the debug interpreter +----------------------------------------------------------- +The python2.4 and python2.5 packages in Ubuntu feisty are modified to +first look for extension modules under a different name. + + normal build: foo.so + debug build: foo_d.so foo.so + +This naming schema allows installation of the extension modules into +the same path (The naming is directly taken from the Windows builds +which already uses this naming scheme). + +See https://wiki.ubuntu.com/PyDbgBuilds for more information. + + +Using the python-dbg builds +--------------------------- + + * Call the python-dbg or the pythonX.Y-dbg binaries instead of the + python or pythonX.Y binaries. + + * Properties of the debug build are described in + /usr/share/doc/@PVER@/SpecialBuilds.txt.gz. + The debug interpreter is built with Py_DEBUG defined. + + * From SpecialBuilds.txt: This is what is generally meant by "a debug + build" of Python. Py_DEBUG implies LLTRACE, Py_REF_DEBUG, + Py_TRACE_REFS, and PYMALLOC_DEBUG (if WITH_PYMALLOC is enabled). + In addition, C assert()s are enabled (via the C way: by not defining + NDEBUG), and some routines do additional sanity checks inside + "#ifdef Py_DEBUG" blocks. --- python3.4-3.4~b1.orig/debian/PVER-dbg.overrides.in +++ python3.4-3.4~b1/debian/PVER-dbg.overrides.in @@ -0,0 +1,5 @@ +# just the gdb debug file +@PVER@-dbg binary: python-script-but-no-python-dep + +# pointless lintian ... +@PVER@-dbg binary: hardening-no-fortify-functions --- python3.4-3.4~b1.orig/debian/PVER-dbg.postinst.in +++ python3.4-3.4~b1/debian/PVER-dbg.postinst.in @@ -0,0 +1,36 @@ +#! /bin/sh + +set -e + +if [ "$1" = configure ]; then + files=$(dpkg -L lib@PVER@-dbg | sed -n '/^\/usr\/lib\/@PVER@\/.*\.py$/p') + if [ -n "$files" ]; then + @PVER@ -E -S /usr/lib/@PVER@/py_compile.py $files + if grep -sq '^byte-compile[^#]*optimize' /etc/python/debian_config; then + @PVER@ -E -S -O /usr/lib/@PVER@/py_compile.py $files + fi + else + echo >&2 "@PVER@-dbg: can't get files for byte-compilation" + fi + + if [ -d /usr/include/@PVER@_d ] && [ ! -h /usr/include/@PVER@_d ]; then + if rmdir /usr/include/@PVER@_d 2> /dev/null; then + ln -sf @PVER@dmu /usr/include/@PVER@_d + else + echo >&2 "WARNING: non-empty directory on upgrade: /usr/include/@PVER@_d" + ls -l /usr/include/@PVER@_d + fi + fi + if [ -d /usr/lib/@PVER@/config_d ] && [ ! -h /usr/lib/@PVER@/config_d ]; then + if rmdir /usr/lib/@PVER@/config_d 2> /dev/null; then + ln -sf config-dmu /usr/lib/@PVER@/config_d + else + echo >&2 "WARNING: non-empty directory on upgrade: /usr/lib/@PVER@/config_d" + ls -l /usr/lib/@PVER@/config_d + fi + fi +fi + +#DEBHELPER# + +exit 0 --- python3.4-3.4~b1.orig/debian/PVER-dbg.prerm.in +++ python3.4-3.4~b1/debian/PVER-dbg.prerm.in @@ -0,0 +1,35 @@ +#! /bin/sh + +set -e + +remove_bytecode() +{ + pkg=$1 + max=$(LANG=C LC_ALL=C xargs --show-limits < /dev/null 2>&1 | awk '/Maximum/ {print int($NF / 4)}') + dpkg -L $pkg \ + | awk -F/ 'BEGIN {OFS="/"} /\.py$/ {$NF=sprintf("__pycache__/%s.*.py[co]", substr($NF,1,length($NF)-3)); print}' \ + | xargs --max-chars=$max echo \ + | while read files; do rm -f $files; done + if [ -d /usr/bin/__pycache__ ]; then + rmdir --ignore-fail-on-non-empty /usr/bin/__pycache__ + fi +} + +case "$1" in + remove) + remove_bytecode lib@PVER@-dbg + ;; + upgrade) + remove_bytecode lib@PVER@-dbg + ;; + deconfigure) + ;; + failed-upgrade) + ;; + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# --- python3.4-3.4~b1.orig/debian/PVER-dev.postinst.in +++ python3.4-3.4~b1/debian/PVER-dev.postinst.in @@ -0,0 +1,26 @@ +#! /bin/sh + +set -e + +if [ "$1" = configure ]; then + if [ -d /usr/include/@PVER@ ] && [ ! -h /usr/include/@PVER@ ]; then + if rmdir /usr/include/@PVER@ 2> /dev/null; then + ln -sf @PVER@mu /usr/include/@PVER@ + else + echo >&2 "WARNING: non-empty directory on upgrade: /usr/include/@PVER@" + ls -l /usr/include/@PVER@ + fi + fi + if [ -d /usr/lib/@PVER@/config ] && [ ! -h /usr/lib/@PVER@/config ]; then + if rmdir /usr/lib/@PVER@/config 2> /dev/null; then + ln -sf config-@VER@mu /usr/lib/@PVER@/config + else + echo >&2 "WARNING: non-empty directory on upgrade: /usr/lib/@PVER@/config" + ls -l /usr/lib/@PVER@/config + fi + fi +fi + +#DEBHELPER# + +exit 0 --- python3.4-3.4~b1.orig/debian/PVER-doc.doc-base.PVER-api.in +++ python3.4-3.4~b1/debian/PVER-doc.doc-base.PVER-api.in @@ -0,0 +1,13 @@ +Document: @PVER@-api +Title: Python/C API Reference Manual (v@VER@) +Author: Guido van Rossum +Abstract: This manual documents the API used by C (or C++) programmers who + want to write extension modules or embed Python. It is a + companion to *Extending and Embedding the Python Interpreter*, + which describes the general principles of extension writing but + does not document the API functions in detail. +Section: Programming/Python + +Format: HTML +Index: /usr/share/doc/@PVER@/html/c-api/index.html +Files: /usr/share/doc/@PVER@/html/c-api/*.html --- python3.4-3.4~b1.orig/debian/PVER-doc.doc-base.PVER-dist.in +++ python3.4-3.4~b1/debian/PVER-doc.doc-base.PVER-dist.in @@ -0,0 +1,13 @@ +Document: @PVER@-dist +Title: Distributing Python Modules (v@VER@) +Author: Greg Ward +Abstract: This document describes the Python Distribution Utilities + (``Distutils'') from the module developer's point-of-view, describing + how to use the Distutils to make Python modules and extensions easily + available to a wider audience with very little overhead for + build/release/install mechanics. +Section: Programming/Python + +Format: HTML +Index: /usr/share/doc/@PVER@/html/distutils/index.html +Files: /usr/share/doc/@PVER@/html/distutils/*.html --- python3.4-3.4~b1.orig/debian/PVER-doc.doc-base.PVER-ext.in +++ python3.4-3.4~b1/debian/PVER-doc.doc-base.PVER-ext.in @@ -0,0 +1,16 @@ +Document: @PVER@-ext +Title: Extending and Embedding the Python Interpreter (v@VER@) +Author: Guido van Rossum +Abstract: This document describes how to write modules in C or C++ to extend + the Python interpreter with new modules. Those modules can define + new functions but also new object types and their methods. The + document also describes how to embed the Python interpreter in + another application, for use as an extension language. Finally, + it shows how to compile and link extension modules so that they + can be loaded dynamically (at run time) into the interpreter, if + the underlying operating system supports this feature. +Section: Programming/Python + +Format: HTML +Index: /usr/share/doc/@PVER@/html/extending/index.html +Files: /usr/share/doc/@PVER@/html/extending/*.html --- python3.4-3.4~b1.orig/debian/PVER-doc.doc-base.PVER-inst.in +++ python3.4-3.4~b1/debian/PVER-doc.doc-base.PVER-inst.in @@ -0,0 +1,12 @@ +Document: @PVER@-inst +Title: Installing Python Modules (v@VER@) +Author: Greg Ward +Abstract: This document describes the Python Distribution Utilities + (``Distutils'') from the end-user's point-of-view, describing how to + extend the capabilities of a standard Python installation by building + and installing third-party Python modules and extensions. +Section: Programming/Python + +Format: HTML +Index: /usr/share/doc/@PVER@/html/install/index.html +Files: /usr/share/doc/@PVER@/html/install/*.html --- python3.4-3.4~b1.orig/debian/PVER-doc.doc-base.PVER-lib.in +++ python3.4-3.4~b1/debian/PVER-doc.doc-base.PVER-lib.in @@ -0,0 +1,15 @@ +Document: @PVER@-lib +Title: Python Library Reference (v@VER@) +Author: Guido van Rossum +Abstract: This library reference manual documents Python's standard library, + as well as many optional library modules (which may or may not be + available, depending on whether the underlying platform supports + them and on the configuration choices made at compile time). It + also documents the standard types of the language and its built-in + functions and exceptions, many of which are not or incompletely + documented in the Reference Manual. +Section: Programming/Python + +Format: HTML +Index: /usr/share/doc/@PVER@/html/library/index.html +Files: /usr/share/doc/@PVER@/html/library/*.html --- python3.4-3.4~b1.orig/debian/PVER-doc.doc-base.PVER-new.in +++ python3.4-3.4~b1/debian/PVER-doc.doc-base.PVER-new.in @@ -0,0 +1,10 @@ +Document: @PVER@-new +Title: What's new in Python @VER@ +Author: A.M. Kuchling +Abstract: This documents lists new features and changes worth mentioning + in Python @VER@. +Section: Programming/Python + +Format: HTML +Index: /usr/share/doc/@PVER@/html/whatsnew/@VER@.html +Files: /usr/share/doc/@PVER@/html/whatsnew/@VER@.html --- python3.4-3.4~b1.orig/debian/PVER-doc.doc-base.PVER-ref.in +++ python3.4-3.4~b1/debian/PVER-doc.doc-base.PVER-ref.in @@ -0,0 +1,18 @@ +Document: @PVER@-ref +Title: Python Reference Manual (v@VER@) +Author: Guido van Rossum +Abstract: This reference manual describes the syntax and "core semantics" of + the language. It is terse, but attempts to be exact and complete. + The semantics of non-essential built-in object types and of the + built-in functions and modules are described in the *Python + Library Reference*. For an informal introduction to the language, + see the *Python Tutorial*. For C or C++ programmers, two + additional manuals exist: *Extending and Embedding the Python + Interpreter* describes the high-level picture of how to write a + Python extension module, and the *Python/C API Reference Manual* + describes the interfaces available to C/C++ programmers in detail. +Section: Programming/Python + +Format: HTML +Index: /usr/share/doc/@PVER@/html/reference/index.html +Files: /usr/share/doc/@PVER@/html/reference/*.html --- python3.4-3.4~b1.orig/debian/PVER-doc.doc-base.PVER-tut.in +++ python3.4-3.4~b1/debian/PVER-doc.doc-base.PVER-tut.in @@ -0,0 +1,13 @@ +Document: @PVER@-tut +Title: Python Tutorial (v@VER@) +Author: Guido van Rossum, Fred L. Drake, Jr., editor +Abstract: This tutorial introduces the reader informally to the basic + concepts and features of the Python language and system. It helps + to have a Python interpreter handy for hands-on experience, but + all examples are self-contained, so the tutorial can be read + off-line as well. +Section: Programming/Python + +Format: HTML +Index: /usr/share/doc/@PVER@/html/tutorial/index.html +Files: /usr/share/doc/@PVER@/html/tutorial/*.html --- python3.4-3.4~b1.orig/debian/PVER-doc.overrides.in +++ python3.4-3.4~b1/debian/PVER-doc.overrides.in @@ -0,0 +1,2 @@ +# this is referenced by the html docs +@PVER@-doc binary: extra-license-file --- python3.4-3.4~b1.orig/debian/PVER-examples.overrides.in +++ python3.4-3.4~b1/debian/PVER-examples.overrides.in @@ -0,0 +1,2 @@ +# don't care about permissions of the example files +@PVER@-examples binary: executable-not-elf-or-script --- python3.4-3.4~b1.orig/debian/PVER-minimal.README.Debian.in +++ python3.4-3.4~b1/debian/PVER-minimal.README.Debian.in @@ -0,0 +1,167 @@ +Contents of the @PVER@-minimal package +----------------------------------------- + +@PVER@-minimal consists of a minimum set of modules which may be needed +for python scripts used during the boot process. If other packages +are needed in these scripts, don't work around the missing module, but +file a bug report against this package. The modules in this package +are: + + __builtin__ builtin + __future__ module + _ast extension + _bisect extension + _bootlocale module + _bytesio builtin + _codecs builtin + _collections extension + _collections_abc module + _compat_pickle module + _datetime extension + _elementtree extension + _fileio builtin + _functools extension + _hashlib extensionx + _heapq extension + _imp builtin + _io builtin + _locale extension + _md5 extension + _opcode extension + _operator extension + _pickle extension + _posixsubprocess extension + _random extension + _sha1 extension + _sha3 extension + _sha256 extension + _sha512 extension + _sitebuiltins module + _socket extension + _sre builtin + _ssl extensionx + _stat extension + _stringio extension + _struct extension + _string builtin + _stringio builtin + _symtable builtin + _sysconfigdata module + _thread builtin + _types builtin + _weakref builtin + _weakrefset module + _warnings builtin + configparser module + abc module + argparse module + array extension + ast module + atexit extension + base64 module + binascii extension + bisect module + builtins builtin + codecs module + collections package + compileall module + contextlib module + copy module + copyreg module + dis module + encodings package + enum module + errno builtin + exceptions builtin + fcntl extension + fnmatch module + functools module + gc builtin + genericpath module + getopt module + glob module + grp extension + hashlib module + heapq module + imp module + importlib package + inspect module + io module + itertools extension + keyword module + linecache module + locale module + logging package + marshal builtin + math extension + opcode module + operator module + optparse module + os module + pickle module + pkgutil module + platform module + posix builtin + posixpath module + pwd builtin + pyexpat extension + py_compile module + random module + re module + reprlib module + runpy module + select extension + selectors module + signal builtin + socket module + spwd extension + sre_compile module + sre_constants module + sre_parse module + ssl module + stat module + string module + struct module + subprocess module + sys builtin + sysconfig module + syslog extension + tempfile module + textwrap module + time extension + token module + tokenize module + traceback module + types module + unicodedata extension + warnings module + weakref module + zipimport extension + zlib extension + +Included are as well the codecs and stringprep modules, and the encodings +modules for all encodings except the multibyte encodings and the bz2 codec. + +The following modules are excluded, their import is guarded from the +importing module: + + Used in Excluded + ------------ ------------------------------------ + io _dummy_thread + os nt ntpath os2 os2emxpath mac macpath + riscos riscospath riscosenviron + optparse gettext + pickle doctest + subprocess threading + +This list was derived by looking at the modules in the perl-base package, +then adding python specific "core modules". + +TODO's +------ + +- time.strptime cannot be used. The required _strptime module is not + included in the -minimal package yet. _strptime, locale, _locale and + calendar have to be added. + +- modules used very often in the testsuite: copy, cPickle, operator. --- python3.4-3.4~b1.orig/debian/PVER-minimal.postinst.in +++ python3.4-3.4~b1/debian/PVER-minimal.postinst.in @@ -0,0 +1,82 @@ +#! /bin/sh + +set -e + +if [ ! -f /etc/@PVER@/sitecustomize.py ]; then + cat <<-EOF + # Empty sitecustomize.py to avoid a dangling symlink +EOF +fi + +case "$1" in + configure) + # Create empty directories in /usr/local + if [ ! -e /usr/local/lib/@PVER@ ]; then + mkdir -p /usr/local/lib/@PVER@ 2> /dev/null || true + chmod 2775 /usr/local/lib/@PVER@ 2> /dev/null || true + chown root:staff /usr/local/lib/@PVER@ 2> /dev/null || true + fi + localsite=/usr/local/lib/@PVER@/dist-packages + if [ ! -e $localsite ]; then + mkdir -p $localsite 2> /dev/null || true + chmod 2775 $localsite 2> /dev/null || true + chown root:staff $localsite 2> /dev/null || true + fi + + if which update-binfmts >/dev/null; then + update-binfmts --import @PVER@ + fi + + ;; +esac + +if [ "$1" = configure ]; then + + # only available before removal of the packaging package + rm -f /etc/@PVER@/sysconfig.cfg + + if ls -L /usr/lib/@PVER@/sitecustomize.py >/dev/null 2>&1; then + filt='cat' + else + filt='fgrep -v sitecustomize.py' + fi + files=$(dpkg -L lib@PVER@-minimal \ + | sed -n '/^\/usr\/lib\/@PVER@\/.*\.py$/p' | $filt) + if [ -n "$files" ]; then + @PVER@ -E -S /usr/lib/@PVER@/py_compile.py $files + if grep -sq '^byte-compile[^#]*optimize' /etc/python/debian_config; then + @PVER@ -E -S -O /usr/lib/@PVER@/py_compile.py $files + fi + else + echo >&2 "@PVER@-minimal: can't get files for byte-compilation" + fi + bc=no + #if [ -z "$2" ] || dpkg --compare-versions "$2" lt 2.5-3 \ + # || [ -f /var/lib/python/@PVER@_installed ]; then + # bc=yes + #fi + if ! grep -sq '^supported-versions[^#]*@PVER@' /usr/share/python/debian_defaults + then + # FIXME: byte compile anyway? + bc=no + fi + if [ "$bc" = yes ]; then + # new installation or installation of first version with hook support + if [ "$DEBIAN_FRONTEND" != noninteractive ]; then + echo "Linking and byte-compiling packages for runtime @PVER@..." + fi + version=$(dpkg -s @PVER@-minimal | awk '/^Version:/ {print $2}') + for hook in /usr/share/python3/runtime.d/*.rtinstall; do + [ -x $hook ] || continue + $hook rtinstall @PVER@ "$2" "$version" + done + if [ -f /var/lib/python/@PVER@_installed ]; then + rm -f /var/lib/python/@PVER@_installed + rmdir --ignore-fail-on-non-empty /var/lib/python 2>/dev/null + fi + fi +fi + +#DEBHELPER# + +exit 0 --- python3.4-3.4~b1.orig/debian/PVER-minimal.postrm.in +++ python3.4-3.4~b1/debian/PVER-minimal.postrm.in @@ -0,0 +1,13 @@ +#! /bin/sh + +set -e + +if [ "$1" = "remove" ]; then + + if [ -f /var/lib/python/@PVER@_installed ]; then + rm -f /var/lib/python/@PVER@_installed + rmdir --ignore-fail-on-non-empty /var/lib/python 2>/dev/null + fi + + rmdir --parents /usr/local/lib/@PVER@ 2>/dev/null || true +fi --- python3.4-3.4~b1.orig/debian/PVER-minimal.preinst.in +++ python3.4-3.4~b1/debian/PVER-minimal.preinst.in @@ -0,0 +1,26 @@ +#!/bin/sh + +set -e + +case "$1" in + install) + # remember newly installed runtime + mkdir -p /var/lib/python + touch /var/lib/python/@PVER@_installed + ;; + upgrade) + : + ;; + + abort-upgrade) + ;; + + *) + echo "preinst called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 --- python3.4-3.4~b1.orig/debian/PVER-minimal.prerm.in +++ python3.4-3.4~b1/debian/PVER-minimal.prerm.in @@ -0,0 +1,36 @@ +#! /bin/sh + +set -e + +case "$1" in + remove) + if [ "$DEBIAN_FRONTEND" != noninteractive ]; then + echo "Unlinking and removing bytecode for runtime @PVER@" + fi + for hook in /usr/share/python3/runtime.d/*.rtremove; do + [ -x $hook ] || continue + $hook rtremove @PVER@ || continue + done + + if which update-binfmts >/dev/null; then + update-binfmts --package @PVER@ --remove @PVER@ /usr/bin/@PVER@ + fi + + localsite=/usr/local/lib/@PVER@/dist-packages + [ -d $localsite ] && rmdir $localsite 2>/dev/null || true + [ -d $(dirname $localsite) ] \ + && rmdir $(dirname $localsite) 2>/dev/null || true + ;; + upgrade) + ;; + deconfigure) + ;; + failed-upgrade) + ;; + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# --- python3.4-3.4~b1.orig/debian/PVER.desktop.in +++ python3.4-3.4~b1/debian/PVER.desktop.in @@ -0,0 +1,10 @@ +[Desktop Entry] +Name=Python (v@VER@) +Comment=Python Interpreter (v@VER@) +Exec=/usr/bin/@PVER@ +Icon=/usr/share/pixmaps/@PVER@.xpm +Terminal=true +Type=Application +Categories=Development; +StartupNotify=true +NoDisplay=true --- python3.4-3.4~b1.orig/debian/PVER.menu.in +++ python3.4-3.4~b1/debian/PVER.menu.in @@ -0,0 +1,4 @@ +?package(@PVER@):needs="text" section="Applications/Programming"\ + title="Python (v@VER@)"\ + icon="/usr/share/pixmaps/@PVER@.xpm"\ + command="/usr/bin/python@VER@" --- python3.4-3.4~b1.orig/debian/PVER.overrides.in +++ python3.4-3.4~b1/debian/PVER.overrides.in @@ -0,0 +1,8 @@ +# yes, we have to +@PVER@ binary: depends-on-python-minimal + +@PVER@ binary: desktop-command-not-in-package +@PVER@ binary: menu-command-not-in-package + +# no, not useless +@PVER@ binary: manpage-has-useless-whatis-entry --- python3.4-3.4~b1.orig/debian/PVER.postinst.in +++ python3.4-3.4~b1/debian/PVER.postinst.in @@ -0,0 +1,20 @@ +#! /bin/sh + +set -e + +case "$1" in + configure) + files=$(dpkg -L lib@PVER@-stdlib | sed -n '/^\/usr\/lib\/@PVER@\/.*\.py$/p') + if [ -n "$files" ]; then + @PVER@ -E -S /usr/lib/@PVER@/py_compile.py $files + if grep -sq '^byte-compile[^#]*optimize' /etc/python/debian_config; then + @PVER@ -E -S -O /usr/lib/@PVER@/py_compile.py $files + fi + else + echo >&2 "@PVER@: can't get files for byte-compilation" + fi +esac + +#DEBHELPER# + +exit 0 --- python3.4-3.4~b1.orig/debian/PVER.prerm.in +++ python3.4-3.4~b1/debian/PVER.prerm.in @@ -0,0 +1,31 @@ +#! /bin/sh + +set -e + +remove_bytecode() +{ + pkg=$1 + max=$(LANG=C LC_ALL=C xargs --show-limits < /dev/null 2>&1 | awk '/Maximum/ {print int($NF / 4)}') + dpkg -L $pkg \ + | awk -F/ 'BEGIN {OFS="/"} /\.py$/ {$NF=sprintf("__pycache__/%s.*.py[co]", substr($NF,1,length($NF)-3)); print}' \ + | xargs --max-chars="$max" echo \ + | while read files; do rm -f $files; done + find /usr/lib/python3 /usr/lib/@PVER@ -name dist-packages -prune -o -name __pycache__ -empty -print \ + | xargs -r rm -rf +} + +case "$1" in + remove|upgrade) + remove_bytecode lib@PVER@-stdlib + ;; + deconfigure) + ;; + failed-upgrade) + ;; + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# --- python3.4-3.4~b1.orig/debian/README.Debian.in +++ python3.4-3.4~b1/debian/README.Debian.in @@ -0,0 +1,8 @@ +The documentation for this package is in /usr/share/doc/@PVER@/. + +A draft of the "Debian Python Policy" can be found in + + /usr/share/doc/python + +Sometime it will be moved to /usr/share/doc/debian-policy in the +debian-policy package. --- python3.4-3.4~b1.orig/debian/README.PVER.in +++ python3.4-3.4~b1/debian/README.PVER.in @@ -0,0 +1,95 @@ + + Python @VER@ for Debian + --------------------- + +This is Python @VER@ packaged for Debian. + +This document contains information specific to the Debian packages of +Python @VER@. + + + + [TODO: This document is not yet up-to-date with the packages.] + +Currently, it features those two main topics: + + 1. Release notes for the Debian packages: + 2. Notes for developers using the Debian Python packages: + +Release notes and documentation from the upstream package are installed +in /usr/share/doc/@PVER@/. + +There's a mailing list for discussion of issues related to Python on Debian +systems: debian-python@lists.debian.org. The list is not intended for +general Python problems, but as a forum for maintainers of Python-related +packages and interested third parties. + + + +1. Release notes for the Debian packages: + + +Results of the regression test: +------------------------------ + +The package does successfully run the regression tests for all included +modules. Seven packages are skipped since they are platform-dependent and +can't be used with Linux. + + +2. Notes for developers using the Debian python packages: + +See the draft of the Debian Python policy in /usr/share/doc/python. + +distutils can be found in the @PVER@-dev package. Development files +like the python library or Makefiles can be found in the @PVER@-dev +package in /usr/lib/@PVER@/config. Therefore, if you need to install +a pure python extension, you only need @PVER@. On the other hand, to +install a C extension, you need @PVER@-dev. + +a) Locally installed Python add-ons + + /usr/local/lib/@PVER@/site-packages/ + /usr/local/lib/site-python/ (version-independent modules) + +b) Python add-ons packaged for Debian + + /usr/lib/@PVER@/site-packages/ + /usr/lib/site-python/ (version-independent modules) + +Note that no package must install files directly into /usr/lib/@PVER@/ +or /usr/local/lib/@PVER@/. Only the site-packages directory is allowed +for third-party extensions. + +Use of the new `package' scheme is strongly encouraged. The `ni' interface +is obsolete in python 1.5. + +Header files for extensions go into /usr/include/@PVER@/. + + +Installing extensions for local use only: +---------------------------------------- + +Consider using distutils ... + +Most extensions use Python's Makefile.pre.in. Note that Makefile.pre.in +by default will install files into /usr/lib/, not into /usr/local/lib/, +which is not allowed for local extensions. You'll have to change the +Makefile accordingly. Most times, "make prefix=/usr/local install" will +work. + + +Packaging python extensions for Debian: +-------------------------------------- + +Maintainers of Python extension packages should read + + /usr/share/doc/python/python-policy.txt.gz + + + + + 03/09/98 + Gregor Hoffleit + +Last change: 2001-12-14 --- python3.4-3.4~b1.orig/debian/README.Tk +++ python3.4-3.4~b1/debian/README.Tk @@ -0,0 +1,8 @@ +Tkinter documentation can be found at + + http://www.pythonware.com/library/index.htm + +more specific: + + http://www.pythonware.com/library/tkinter/introduction/index.htm + http://www.pythonware.com/library/tkinter/an-introduction-to-tkinter.pdf --- python3.4-3.4~b1.orig/debian/README.dbm +++ python3.4-3.4~b1/debian/README.dbm @@ -0,0 +1,72 @@ + + Python and dbm modules on Debian + -------------------------------- + +This file documents the configuration of the dbm modules for Debian. It +gives hints at the preferred use of the dbm modules. + + +The preferred way to access dbm databases in Python is the anydbm module. +dbm databases behave like mappings (dictionaries). + +Since there exist several dbm database formats, we choose the following +layout for Python on Debian: + + * creating a new database with anydbm will create a Berkeley DB 2.X Hash + database file. This is the standard format used by libdb starting + with glibc 2.1. + + * opening an existing database with anydbm will try to guess the format + of the file (using whichdb) and then load it using one of the bsddb, + bsddb1, gdbm or dbm (only if the python-gdbm package is installed) + or dumbdbm modules. + + * The modules use the following database formats: + + - bsddb: Berkeley DB 2.X Hash (as in libc6 >=2.1 or libdb2) + - bsddb1: Berkeley DB 1.85 Hash (as in libc6 >=2.1 or libdb2) + - gdbm: GNU dbm 1.x or ndbm + - dbm: " (nearly the same as the gdbm module for us) + - dumbdbm: a hand-crafted format only used in this module + + That means that all usual formats should be readable with anydbm. + + * If you want to create a database in a format different from DB 2.X, + you can still directly use the specified module. + + * I.e. bsddb is the preferred module, and DB 2.X is the preferred format. + + * Note that the db1hash and bsddb1 modules are Debian specific. anydbm + and whichdb have been modified to support DB 2.X Hash files (see + below for details). + + + +For experts only: +---------------- + +Although bsddb employs the new DB 2.X format and uses the new Sleepycat +DB 2 library as included with glibc >= 2.1, it's still using the old +DB 1.85 API (which is still supported by DB 2). + +A more recent version 1.1 of the BSD DB module (available from +http://starship.skyport.net/robind/python/) directly uses the DB 2.X API. +It has a richer set of features. + + +On a glibc 2.1 system, bsddb is linked with -ldb, bsddb1 is linked with +-ldb1 and gdbm as well as dbm are linked with -lgdbm. + +On a glibc 2.0 system (e.g. potato for m68k or slink), bsddb will be +linked with -ldb2 while bsddb1 will be linked with -ldb (therefore +python-base here depends on libdb2). + + +db1hash and bsddb1 nearly completely identical to dbhash and bsddb. The +only difference is that bsddb is linked with the real DB 2 library, while +bsddb1 is linked with an library which provides compatibility with legacy +DB 1.85 databases. + + + July 16, 1999 + Gregor Hoffleit --- python3.4-3.4~b1.orig/debian/README.idle-PVER.in +++ python3.4-3.4~b1/debian/README.idle-PVER.in @@ -0,0 +1,14 @@ + + The Python IDLE package for Debian + ---------------------------------- + +This package contains Python @VER@'s Integrated DeveLopment Environment, IDLE. + +IDLE is included in the Python @VER@ upstream distribution (Tools/idle) and +depends on Tkinter (available as @PVER@-tk package). + +I have written a simple man page. + + + 06/16/1999 + Gregor Hoffleit --- python3.4-3.4~b1.orig/debian/README.maintainers.in +++ python3.4-3.4~b1/debian/README.maintainers.in @@ -0,0 +1,88 @@ + +Hints for maintainers of Debian packages of Python extensions +------------------------------------------------------------- + +Most of the content of this README can be found in the Debian Python policy. +See /usr/share/doc/python/python-policy.txt.gz. + +Documentation Tools +------------------- + +If your package ships documentation produced in the Python +documentation format, you can generate it at build-time by +build-depending on @PVER@-dev, and you will find the +templates, tools and scripts in /usr/lib/@PVER@/doc/tools -- +adjust your build scripts accordingly. + + +Makefile.pre.in issues +---------------------- + +Python comes with a `universal Unix Makefile for Python extensions' in +/usr/lib/@PVER@/config/Makefile.pre.in (with Debian, this is included +in the python-dev package), which is used by most Python extensions. + +In general, packages using the Makefile.pre.in approach can be packaged +simply by running dh_make or by using one of debhelper's rules' templates +(see /usr/doc/debhelper/examples/). Makefile.pre.in works fine with e.g. +"make prefix=debian/tmp/usr install". + +One glitch: You may be running into the problem that Makefile.pre.in +doesn't try to create all the directories when they don't exist. Therefore, +you may have to create them manually before "make install". In most cases, +the following should work: + + ... + dh_installdirs /usr/lib/@PVER@ + $(MAKE) prefix=debian/tmp/usr install + ... + + +Byte-compilation +---------------- + +For speed reasons, Python internally compiles source files into a byte-code. +To speed up subsequent imports, it tries to save the byte-code along with +the source with an extension .pyc (resp. pyo). This will fail if the +libraries are installed in a non-writable directory, which may be the +case for /usr/lib/@PVER@/. + +Not that .pyc and .pyo files should not be relocated, since for debugging +purposes the path of the source for is hard-coded into them. + +To precompile files in batches after installation, Python has a script +compileall.py, which compiles all files in a given directory tree. The +Debian version of compileall has been enhanced to support incremental +compilation and to feature a ddir (destination dir) option. ddir is +used to compile files in debian/usr/lib/python/ when they will be +installed into /usr/lib/python/. + + +Currently, there are two ways to use compileall for Debian packages. The +first has a speed penalty, the second has a space penalty in the package. + +1.) Compiling and removing .pyc files in postinst/prerm: + + Use dh_python(1) from the debhelper packages to add commands to byte- + compile on installation and to remove the byte-compiled files on removal. + Your package has to build-depend on: debhelper (>= 4.1.67), python. + + In /usr/share/doc/@PVER@, you'll find sample.postinst and sample.prerm. + If you set the directory where the .py files are installed, these + scripts will install and remove the .pyc and .pyo files for your + package after unpacking resp. before removing the package. + +2.) Compiling the .pyc files `out of place' during installation: + + As of 1.5.1, compileall.py allows you to specify a faked installation + directory using the "-d destdir" option, so that you can precompile + the files in their temporary directory + (e.g. debian/tmp/usr/lib/python2.1/site-packages/PACKAGE). + + + + 11/02/98 + Gregor Hoffleit + + +Last modified: 2007-10-14 --- python3.4-3.4~b1.orig/debian/README.python +++ python3.4-3.4~b1/debian/README.python @@ -0,0 +1,153 @@ + + Python 2.x for Debian + --------------------- + +This is Python 2.x packaged for Debian. + +This document contains information specific to the Debian packages of +Python 2.x. + + + + [TODO: This document is not yet up-to-date with the packages.] + + + + + + +Currently, it features those two main topics: + + 1. Release notes for the Debian packages: + 2. Notes for developers using the Debian Python packages: + +Release notes and documentation from the upstream package are installed +in /usr/share/doc/python/. + +Up-to-date information regarding Python on Debian systems is also +available as http://www.debian.org/~flight/python/. + +There's a mailing list for discussion of issues related to Python on Debian +systems: debian-python@lists.debian.org. The list is not intended for +general Python problems, but as a forum for maintainers of Python-related +packages and interested third parties. + + + +1. Release notes for the Debian packages: + + +Results of the regression test: +------------------------------ + +The package does successfully run the regression tests for all included +modules. Seven packages are skipped since they are platform-dependent and +can't be used with Linux. + + +Noteworthy changes since the 1.4 packages: +----------------------------------------- + +- Threading support enabled. +- Tkinter for Tcl/Tk 8.x. +- New package python-zlib. +- The dbmmodule was dropped. Use bsddb instead. gdbmmodule is provided + for compatibility's sake. +- python-elisp adheres to the new emacs add-on policy; it now depends + on emacsen. python-elisp probably won't work correctly with emacs19. + Refer to /usr/doc/python-elisp/ for more information. +- Remember that 1.5 has dropped the `ni' interface in favor of a generic + `packages' concept. +- Python 1.5 regression test as additional package python-regrtest. You + don't need to install this package unless you don't trust the + maintainer ;-). +- once again, modified upstream's compileall.py and py_compile.py. + Now they support compilation of optimized byte-code (.pyo) for use + with "python -O", removal of .pyc and .pyo files where the .py source + files are missing (-d) and finally the fake of a installation directory + when .py files have to be compiled out of place for later installation + in a different directory (-i destdir, used in ./debian/rules). +- The Debian packages for python 1.4 do call + /usr/lib/python1.4/compileall.py in their postrm script. Therefore + I had to provide a link from /usr/lib/python1.5/compileall.py, otherwise + the old packages won't be removed completely. THIS IS A SILLY HACK! + + + +2. Notes for developers using the Debian python packages: + + +Embedding python: +---------------- + +The files for embedding python resp. extending the python interpreter +are included in the python-dev package. With the configuration in the +Debian GNU/Linux packages of python 1.5, you will want to use something +like + + -I/usr/include/python1.5 (e.g. for config.h) + -L/usr/lib/python1.5/config -lpython1.5 (... -lpthread) + (also for Makefile.pre.in, Setup etc.) + +Makefile.pre.in automatically gets that right. Note that unlike 1.4, +python 1.5 has only one library, libpython1.5.a. + +Currently, there's no shared version of libpython. Future version of +the Debian python packages will support this. + + +Python extension packages: +------------------------- + +According to www.python.org/doc/essays/packages.html, extension packages +should only install into /usr/lib/python1.5/site-packages/ (resp. +/usr/lib/site-python/ for packages that are definitely version independent). +No extension package should install files directly into /usr/lib/python1.5/. + +But according to the FSSTND, only Debian packages are allowed to use +/usr/lib/python1.5/. Therefore Debian Python additionally by default +searches a second hierarchy in /usr/local/lib/. These directories take +precedence over their equivalents in /usr/lib/. + +a) Locally installed Python add-ons + + /usr/local/lib/python1.5/site-packages/ + /usr/local/lib/site-python/ (version-independent modules) + +b) Python add-ons packaged for Debian + + /usr/lib/python1.5/site-packages/ + /usr/lib/site-python/ (version-independent modules) + +Note that no package must install files directly into /usr/lib/python1.5/ +or /usr/local/lib/python1.5/. Only the site-packages directory is allowed +for third-party extensions. + +Use of the new `package' scheme is strongly encouraged. The `ni' interface +is obsolete in python 1.5. + +Header files for extensions go into /usr/include/python1.5/. + + +Installing extensions for local use only: +---------------------------------------- + +Most extensions use Python's Makefile.pre.in. Note that Makefile.pre.in +by default will install files into /usr/lib/, not into /usr/local/lib/, +which is not allowed for local extensions. You'll have to change the +Makefile accordingly. Most times, "make prefix=/usr/local install" will +work. + + +Packaging python extensions for Debian: +-------------------------------------- + +Maintainers of Python extension packages should read README.maintainers. + + + + + 03/09/98 + Gregor Hoffleit + +Last change: 07/16/1999 --- python3.4-3.4~b1.orig/debian/README.source +++ python3.4-3.4~b1/debian/README.source @@ -0,0 +1,7 @@ +The source tarball is lacking the files Lib/profile.py and Lib/pstats.py, +which Debian considers to have a license non-suitable for main (the use +of these modules limited to python). + +The package uses quilt to apply / unapply patches. +See /usr/share/doc/quilt/README.source. The series file is generated +during the build. --- python3.4-3.4~b1.orig/debian/_sysconfigdata.py +++ python3.4-3.4~b1/debian/_sysconfigdata.py @@ -0,0 +1,6 @@ +import sys + +if hasattr(sys, 'gettotalrefcount'): + from _sysconfigdata_dm import * +else: + from _sysconfigdata_m import * --- python3.4-3.4~b1.orig/debian/changelog +++ python3.4-3.4~b1/debian/changelog @@ -0,0 +1,2779 @@ +python3.4 (3.4~b1-5ubuntu2) trusty; urgency=medium + + * Disable the test_dbm autopkg test, failing from time to time ... + + -- Matthias Klose Fri, 03 Jan 2014 02:25:31 +0100 + +python3.4 (3.4~b1-5ubuntu1) trusty; urgency=medium + + * Build for Tcl/Tk 8.6. + + -- Matthias Klose Thu, 02 Jan 2014 18:05:27 +0100 + +python3.4 (3.4~b1-5) unstable; urgency=medium + + * Update to 20131231 from the trunk. + - Fix issue #20070, don't run test_urllib2net when network resources + are not enabled. + * Move the _sitebuiltins module into libpython3.4-minimal. + * distutils: On installation with --install-layout=deb, rename extensions + to include the multiarch tag. + Renaming of extensions for python3.4 is currently not done by dh-python. + See Debian #733128. + * autopkg tests: + - Update debian/tests/control to refer to python3.4. + - Generate locales for running the autopkg tests. + - Disable some currently failing autopkg tests. LP: #1264554. + - Disable test_compileall for the autopkg tests, fails only there. + * Don't run test_faulthandler on Aarch64, hangs on the buildds. + See LP: #1264354. + + -- Matthias Klose Tue, 31 Dec 2013 13:29:08 +0100 + +python3.4 (3.4~b1-4) unstable; urgency=medium + + * Update to 20131225 from the trunk. + * Fix python3.4--config --configdir. Closes: #733050. + + -- Matthias Klose Wed, 25 Dec 2013 21:56:04 +0100 + +python3.4 (3.4~b1-3) experimental; urgency=medium + + * Update to 20131221 from the trunk. + + -- Matthias Klose Sat, 21 Dec 2013 15:20:38 +0100 + +python3.4 (3.4~b1-2) experimental; urgency=low + + * Update to 20131202 from the trunk. + * Fix dbg symbols file for i386. + * Don't provide python3.4-dbm, available in a separate package. + * (Build-)depend on net-tools, test_uuid requires ifconfig. + * Fix distutils.sysconfig.get_makefile_filename(). + * Move operator module to the -minimal package. Closes: #731100. + + -- Matthias Klose Mon, 02 Dec 2013 14:36:44 +0100 + +python3.4 (3.4~b1-1) experimental; urgency=low + + * Python 3.4 beta 1. + + -- Matthias Klose Sun, 24 Nov 2013 23:21:49 +0100 + +python3.3 (3.3.3-2) unstable; urgency=low + + * Update to 20131123 from the 3.3 branch. + * Update hurd-path_max.diff. + + -- Matthias Klose Sat, 23 Nov 2013 08:57:21 +0100 + +python3.3 (3.3.3-1) unstable; urgency=low + + * Python 3.3.3 release. + * Update to 20131119 from the 3.3 branch. + * Regenerate the patches. + * Update the symbols files. + * Fix test support when the running kernel doesn't handle port reuse. + * libpython3.3-minimal replaces libpython3.3-stdlib (<< 3.2.3-7). + Closes: #725240. + + -- Matthias Klose Tue, 19 Nov 2013 08:46:55 +0100 + +python3.3 (3.3.2-7) unstable; urgency=low + + * Update to 20130918 from the 3.3 branch. + * Update symbols file. + * Fail the build if extensions for the minimal package are not in + the libpython-minimal package. Closes: #723624. + * Fix indentation in regenerated platform-lsbrelease.diff (Dmitry Shachnev). + LP: #1220508. + * Point to the python3-tk (instead of the python-tk) package when missing. + LP: #1184082. + + -- Matthias Klose Wed, 18 Sep 2013 12:19:47 +0200 + +python3.3 (3.3.2-6) unstable; urgency=medium + + * Update to 20130917 from the 3.3 branch. + - Fix SSL module to handle NULL bytes inside subjectAltNames general + names (CVE-2013-4238). Closes: #719567. + * Don't run the curses autopkg test. + * Set Multi-Arch attributes for binary packages. + * Fix multiarch include header for sparc64. Closes: #714802. + + -- Matthias Klose Tue, 17 Sep 2013 15:12:00 +0200 + +python3.3 (3.3.2-5) unstable; urgency=low + + * Update to 20130803 from the 3.3 branch. + - Fix fcntl test case on KFreeBSD (Petr Salinger). + * Disable some socket tests on KFreeBSD (Petr Salinger). + * Fix multiarch include header for sparc64. Closes: #714802. + * Update package descriptions (Filipus Klutiero). Closes: #715801. + + -- Matthias Klose Sun, 04 Aug 2013 17:38:35 +0200 + +python3.3 (3.3.2-4) unstable; urgency=low + + * Update to 20130612 from the 3.3 branch. + * Refresh patches. + * Don't run consistency check for cross builds. + * Really skip byte compile of non-existing sitecustomize.py. + * Fix the multiarch header file for mips64 (YunQiang Su). Closes: #710374. + + -- Matthias Klose Wed, 12 Jun 2013 22:55:02 +0200 + +python3.3 (3.3.2-3) unstable; urgency=low + + * Update to 20130527 from the 3.3 branch. + - Fix #17980, possible abuse of ssl.match_hostname() for denial of service + using certificates with many wildcards (CVE-2013-2099). Closes: #708530. + * Disable the test_io test on armel, armhf, mips, mipsel. Hangs the + buildds. + * Don't try to byte-compile sitecustomize.py if the target of the + symlink doesn't exist anymore. Addresses: #709157. + * Fix directory removal in maintainer scripts. Closes: #709963. + * Handle byte compilation in python3.3{-minimal,}, byte removal in + libpython3.3{-minimal,-stdlib}. + * Backport patch to fix issue #13146, possible race conditions when writing + .pyc/.pyo files in py_compile.py (Barry Warsaw). LP: #1058884. + * Mark all _Py_dg_* symbols as optional on m68k. Closes: #709888. + + -- Matthias Klose Mon, 27 May 2013 20:44:03 +0200 + +python3.3 (3.3.2-2) unstable; urgency=high + + * Fix the multiarch header file for ppc64. Closes: #708646. + * Disable running the tests on kfreebsd and the hurd. Please + follow-up in #708652 and #708653. + + -- Matthias Klose Fri, 17 May 2013 23:16:04 +0200 + +python3.3 (3.3.2-1) unstable; urgency=low + + * Python 3.3.2 release. + * Fix sysconfig.get_makefile_name() for the multiarch location. + * Set the platinclude dir back to the non-multiarch include path, + where the multiarch pyconfig.h compatibility header is found. + * Remove obsolete profile-doc patch. + * Run the pgo profile task in batches to avoid crashes during the + pgo profile run. + * Don't set yet any Multi-Arch: attributes in Debian. + * Build a libpython3.3-testsuite package. + * Add autopkg tests to run the installed testsuite in normal and debug + mode. + * Re-enable running the tests during the build. + * Add pyconfig.h compatibility headers. + + -- Matthias Klose Wed, 15 May 2013 19:41:15 +0200 + +python3.3 (3.3.1-1ubuntu5) raring; urgency=low + + * Remove obsolete profile-doc patch. + * Run the pgo profile task in batches to avoid crashes during the + pgo profile run. + * Disable the lto build on armhf for now. + * Final (?) set of autopkg test fixes. + * Issue #17012: shutil.which() no longer fallbacks to the PATH environment. + variable if empty path argument is specified. + * Issue #17782: Fix undefined behaviour on platforms where + ``struct timespec``'s "tv_nsec" member is not a C long. + + -- Matthias Klose Wed, 17 Apr 2013 23:35:49 +0200 + +python3.3 (3.3.1-1ubuntu4) raring; urgency=low + + * Don't run the test suite in random order. + * More autopkg test fixes. + + -- Matthias Klose Wed, 17 Apr 2013 13:33:00 +0200 + +python3.3 (3.3.1-1ubuntu3) raring; urgency=low + + * Fix sysconfig.get_makefile_name() for the multiarch location. + * Set the platinclude dir back to the non-multiarch include path, + where the multiarch pyconfig.h compatibility header is found. + * Fix autopkg tests. + * More autopkgtest fixes (Jean-Baptiste Lallement): + - redirect stderr of command 'stop apport' to /dev/null. output to stderr + is an error for adt. + - script.py waits for child to exit and exit with child's return code. + - xpickle is not a valid value for option -u of regrtest.py. Removed it + LP: #1169150. + * Issue #17754, setting LANG and LC_ALL for the compiler call in ctypes/util. + * Issue #17761, platform._parse_release_file doesn't close the + /etc/lsb-release file, and doesn't know about 'Ubuntu'. + + -- Matthias Klose Tue, 16 Apr 2013 17:33:35 +0200 + +python3.3 (3.3.1-1ubuntu2) raring; urgency=low + + * Idle updates: + - Issue #17657: Show full Tk version in IDLE's about dialog. + - Issue #17613: Prevent traceback when removing syntax colorizer. + - Issue #1207589: Backwards-compatibility patch for right-click menu. + - Issue #16887: Now accepts Cancel in tabify/untabify dialog box. + - Issue #17625: Close the replace dialog after it is used. + - Issue #14254: Now handles readline correctly across shell restarts. + - Issue #17614: No longer raises exception when quickly closing a file. + - Issue #6698: Now opens just an editor window when configured to do so. + - Issue #8900: Using keyboard shortcuts in IDLE to open a file no longer + raises an exception. + - Issue #6649: Fixed missing exit status. + * Build a libpython3.3-testsuite package. LP: #301629. + * Add autopkg tests to run the installed testsuite in normal and debug + mode. + * Re-enable running the tests during the build. + * Add pyconfig.h compatibility headers. LP: #1094246. + + -- Matthias Klose Wed, 10 Apr 2013 23:05:23 +0200 + +python3.3 (3.3.1-1ubuntu1) raring; urgency=low + + * Merge with Debian; remaining changes: + - Build-depend on python3:any instead of python3. + + -- Matthias Klose Sat, 06 Apr 2013 16:21:34 +0200 + +python3.3 (3.3.1-1) unstable; urgency=low + + * Python 3.3.1 release. + * Call python with -E -S for the byte compilation. + + -- Matthias Klose Sat, 06 Apr 2013 15:12:07 +0200 + +python3.3 (3.3.1~rc1-2) experimental; urgency=low + + * Fix byte-compiliation/-removal for the split-out library packages. + LP: #1160944. + + -- Matthias Klose Sat, 30 Mar 2013 13:36:40 +0100 + +python3.3 (3.3.1~rc1-1) experimental; urgency=low + + * Python 3.3.1 release candidate 1. + + -- Matthias Klose Tue, 26 Mar 2013 10:45:37 +0100 + +python3.3 (3.3.0-12) experimental; urgency=low + + * Update to 20130306 from the 3.3 branch. + * Remove the HAVE_FSYNC configure workaround, not needed for 3.3. + * Remove the python3 manual symlink (now shipped upstream by default). + Closes: #701051. + + -- Matthias Klose Wed, 06 Mar 2013 16:38:41 +0800 + +python3.3 (3.3.0-11) experimental; urgency=low + + * Update to 20130220 from the 3.3 branch. + + -- Matthias Klose Wed, 20 Feb 2013 15:40:05 +0100 + +python3.3 (3.3.0-10) experimental; urgency=low + + * Update to 20130126 from the 3.3 branch. + * Update hurd patches. + * python3.3-dbg, libpython3.3-dbg: Drop dependency on python. + * python3.3-dbg: Make gdb (not gdb-minimal) a recommendation. + * Git rid of build-dependency on python. + * Add site-packages in virtual environments created by pyvenv. + Closes: #698777. + + -- Matthias Klose Sat, 26 Jan 2013 12:17:05 +0100 + +python3.3 (3.3.0-9) experimental; urgency=low + + * Update to 20130125 from the 3.3 branch. + * Update cross build patches, and allow the package to cross build. + + -- Matthias Klose Fri, 25 Jan 2013 17:06:25 +0100 + +python3.3 (3.3.0-8) experimental; urgency=low + + * Update to 20130105 from the 3.3 branch. + * python-config --help returns with an exit value 0. LP: #1093860. + * Update package description for the -dbg packages. Closes: #696616. + + -- Matthias Klose Sat, 05 Jan 2013 18:39:32 +0100 + +python3.3 (3.3.0-7) experimental; urgency=low + + * Update to 20121220 from the 3.3 branch. + * debian/patches/sys-multiarch.diff: Expose multiarch triplet value + as sys.implementation._multiarch (Barry Warsaw). Closes: #695959. + Note: Usage of sysconfig.get_config_var('MULTIARCH') is preferred. + * Set the install schema to `unix_prefix', if a virtual environment + is detected (VIRTUAL_ENV env var present). Closes: #695758. + * python3.3-dev, libpython3.3-dev: Drop the dependency on libssl-dev. + + -- Matthias Klose Fri, 21 Dec 2012 07:24:41 +0100 + +python3.3 (3.3.0-6) experimental; urgency=low + + * Don't use xattrs on kfreebsd and the Hurd. + + -- Matthias Klose Tue, 04 Dec 2012 04:36:42 +0100 + +python3.3 (3.3.0-5) experimental; urgency=low + + * Update to 20121203 from the 3.3 branch. + * Make python3.3, python3.3-{minimal,dev,dbg} Multi-Arch: allowed. + * Use a shell implementation for the python-config script. + + -- Matthias Klose Mon, 03 Dec 2012 21:52:33 +0100 + +python3.3 (3.3.0-4) experimental; urgency=low + + * Update to 20121128 from the 3.3 branch. + * Don't link extensions with the shared libpython library. + * Override pointless lintian warning `hardening-no-fortify-functions' + for binaries built without optimization. + + -- Matthias Klose Wed, 28 Nov 2012 13:47:16 +0100 + +python3.3 (3.3.0-3) experimental; urgency=low + + * Update to 20121106 from the 3.3 branch. + * Filter-out cflags for profiled builds from _sysconfigdata. + * Fix multiarch plat-linux installation. LP: #1075891. + * Install _sysconfigdata.py from the shared builds. LP: #1075903. + + -- Matthias Klose Wed, 07 Nov 2012 14:31:02 +0100 + +python3.3 (3.3.0-2) experimental; urgency=low + + * Update to 20121021 from the 3.3 branch. + * Fix the interpreter name for the python3.3-dbg-config script. + + -- Matthias Klose Sun, 21 Oct 2012 09:51:05 +0200 + +python3.3 (3.3.0-1) experimental; urgency=low + + * Python 3.3.0 release. + + -- Matthias Klose Sat, 29 Sep 2012 12:59:24 +0200 + +python3.3 (3.3.0~rc3-1) experimental; urgency=low + + * Python 3.3.0 release candidate 3. + * Don't try to write lib2to3's pickled grammar files. Closes: #687200. + * Fix python-config manpage symlink. Closes: #687201. + + -- Matthias Klose Mon, 24 Sep 2012 16:22:17 +0200 + +python3.3 (3.3.0~rc2-2ubuntu1) quantal; urgency=low + + * Encode the version in the devhelp documentation name. LP: #787039. + + -- Matthias Klose Mon, 10 Sep 2012 12:56:13 +0200 + +python3.3 (3.3.0~rc2-2) experimental; urgency=low + + * Fix typo fixing the pkgconfig file. + + -- Matthias Klose Mon, 10 Sep 2012 11:13:51 +0200 + +python3.3 (3.3.0~rc2-1) experimental; urgency=low + + * Python 3.3.0 release candidate 2. + * Add the platform include dir to pkgconfig's CFlags. + * Hint on installing the python-gdbm package on failing _gdbm import. + LP: #995616. + * libpython3.3: Fix libpython3.3.so symlink. Closes: #686377. + * Don't use `-n' anymore to start idle in the desktop/menu files. + + -- Matthias Klose Sun, 09 Sep 2012 13:38:55 +0200 + +python3.3 (3.3.0~rc1-2) experimental; urgency=low + + * distutils: Add the multiarch python path to the include directories. + Closes: #685041. + * Remove /etc/python3.3 in libpython3.3-minimal instead of python3.3-minimal. + Closes: #681979. + * Remove /etc/python/sysconfig.cfg, not available anymore in python3.3. + Closes: #685016. + * Don't ship the _gdbm and _tkinter extensions in the -dbg package. + Closes: #685261. + * Fix verbose parallel builds for the sharedmods target. + * Don't install the pickled lib2to3 grammar files. Closes: #685214. + * Build extensions with fortify flags. + * Overwrite arch-dependent-file-not-in-arch-specific-directory warnings. + + -- Matthias Klose Tue, 28 Aug 2012 19:47:58 +0200 + +python3.3 (3.3.0~rc1-1) experimental; urgency=low + + * Python 3.3.0 release candidate 1. + + -- Matthias Klose Sun, 26 Aug 2012 23:15:00 +0200 + +python3.3 (3.3.0~b2-1) experimental; urgency=low + + * Python 3.3.0 beta2 release. + * Fix removal of the _tkinter and dbm extensions for multiarch builds. + Closes: #684461. + * Use _sysconfigdata.py in distutils to initialize distutils. + Closes: #682475. + * Fix symlink for static libpython. Closes: #684608. + + -- Matthias Klose Mon, 13 Aug 2012 11:05:00 +0200 + +python3.3 (3.3.0~b1-3) experimental; urgency=low + + * Update to 20120712 from the trunk. + * Install separate _sysconfigdata.py for normal and debug builds. + * Install into multiarch locations. + * Split out multiarch packages libpython3.3-{minimal,stdlib,dev,dbg}. + + -- Matthias Klose Fri, 13 Jul 2012 00:43:42 +0200 + +python3.3 (3.3.0~b1-2) experimental; urgency=low + + * Update to 20120701 from the trunk. + + -- Matthias Klose Sun, 01 Jul 2012 11:45:12 +0200 + +python3.3 (3.3.0~b1-1) experimental; urgency=low + + * Python 3.3.0 beta1 release. + * Fix symlink for the -gdb.py file. + * debian/copyright: Add libmpdec license. + * Enable fortified build. + + -- Matthias Klose Wed, 27 Jun 2012 08:44:56 +0200 + +python3.3 (3.3.0~a4-1) experimental; urgency=low + + * Python 3.3.0 alpha4 release. + * Update to 20120620 from the trunk. + * Build _ctypes as an extension, not a builtin. + * Mark symbols defined in the _ctypes extension as optional. + * Remove references to the removed pyton3.3-documenting file. + * The wininst-* files cannot be built within Debian from the included + sources, needing a zlib mingw build, which the zlib maintainer isn't + going to provide. + * Use the underscore.js file provided by the libjs-underscore package. + * Let pydoc handle dist-packages the same as site-packages. + * Avoid runtime path for the sqlite extension. + + -- Matthias Klose Wed, 20 Jun 2012 13:09:19 +0200 + +python3.3 (3.3.0~a3-1) experimental; urgency=low + + * Python 3.3.0 alpha3 release. + * Build the dbm extension using db5.3. + * Update symbols file for a3. + + -- Matthias Klose Wed, 02 May 2012 23:28:46 +0200 + +python3.3 (3.3.0~a2-1) experimental; urgency=low + + * Python 3.3.0 alpha2 release. + * Update to 20120404 from the trunk. + * Build-depend on expat (>= 2.1). + + -- Matthias Klose Wed, 04 Apr 2012 16:31:34 +0200 + +python3.3 (3.3.0~a1-1) experimental; urgency=low + + * Python 3.3.0 alpha1 release. + * Update to 20120321 from the trunk. + * Update debian/copyright. + * Build-depend on expat (>= 2.1~). + + -- Matthias Klose Thu, 22 Mar 2012 06:14:01 +0100 + +python3.3 (3.3~20120109-1) experimental; urgency=low + + * 3.3 20120109 snapshot from the trunk. + * Merge packaging from python3.2 3.2.2-4. + + -- Matthias Klose Sun, 08 Jan 2012 09:44:33 +0100 + +python3.3 (3.3~20110523-1) experimental; urgency=low + + * Initial Python 3.3 packaging. + + -- Matthias Klose Mon, 23 May 2011 09:20:52 +0200 + +python3.2 (3.2.2-4) unstable; urgency=low + + * The static library belongs into the -dev package. + * Remove obsolete attributes in the control file. + + -- Matthias Klose Sat, 07 Jan 2012 20:46:39 +0100 + +python3.2 (3.2.2-3) unstable; urgency=low + + * Update to 20120106 from the 3.2 branch. + * Install manual pages for 2to3 and python-config. + * Fix file permission of token.py module. + * Add the ability to build an python3.x udeb, as copy of the + python3.x-minimal package (Colin Watson). + * Overwrite some lintian warnings: + - The -dbg interpreters are not unusual. + - The -gdb.py files don't need a python dependency. + - lintian can't handle a whatis entry starting with one word on the line. + * Fix test failures related to distutils debian installation layout. + * Update symbols files. + * Add build-arch/build-indep targets. + * Regenerate Setup and Makefiles after correcting Setup.local. + * profiled-build.diff: Pass PY_CFLAGS instead of CFLAGS for the profiled + build. + * Pass dpkg-buildflags to the build process, and build third party + extensions with these flags. + * Add support to build using -flto (and -g1) on some architectures. + * Disable pgo builds for some architectures (for now, keep just + amd64 armel armhf i386 powerpc ppc64). + * Build-depend on libgdbm-dev to build and run the gdbm tests. + * Build-depend on xvfb to run the tkinter tests. + + -- Matthias Klose Fri, 06 Jan 2012 20:10:13 +0100 + +python3.2 (3.2.2-2) unstable; urgency=low + + * Update platform patches (alpha, hppa, mips, sparc). + + -- Matthias Klose Fri, 02 Dec 2011 10:24:05 +0100 + +python3.2 (3.2.2-1) unstable; urgency=low + + * Python 3.2.2 release. + * Update to 20111201 from the 3.2 branch. + * Search headers in /usr/include/ncursesw for the curses/panel extensions. + * New patch, ctypes-arm, allow for ",hard-float" after libc6 in ldconfig -p + output (Loic Minier). LP: #898172. + + -- Matthias Klose Thu, 01 Dec 2011 13:19:16 +0100 + +python3.2 (3.2.2~rc1-1) unstable; urgency=low + + * Python 3.2.2 release candidate 1. + + -- Matthias Klose Sun, 14 Aug 2011 20:25:35 +0200 + +python3.2 (3.2.1-2) unstable; urgency=low + + * Update to 20110803 from the 3.2 branch. + * Revert previous change to treat Linux 3.x as Linux 2. Use the + plat-linux3 directory instead. + * Use linux-any for some build dependencies. Closes: #634310. + + -- Matthias Klose Wed, 03 Aug 2011 15:16:05 +0200 + +python3.2 (3.2.1-1) unstable; urgency=medium + + * Python 3.2.1 release. + * Update lib-argparse patch (Pino Toscano). Closes: #631635. + * Treat Linux 3.x as Linux 2. Closes: #633015. + + -- Matthias Klose Sun, 10 Jul 2011 21:46:36 +0200 + +python3.2 (3.2.1~rc2-1) unstable; urgency=low + + * Python 3.2.1 release candidate 2. + * Add profile/pstats to the python3.2 package, update debian copyright. + * Don't run the benchmark on hurd-i386. + * Disable threading tests on hurd-i386. Closes: #631634. + * Don't add the bsddb multilib path, if already in the standard lib path. + + -- Matthias Klose Mon, 04 Jul 2011 20:27:52 +0200 + +python3.2 (3.2.1~rc1-1) unstable; urgency=low + + * Python 3.2.1 release candidate 1. + * Only enable sphinx-0.x patches when building with sphinx-0.x. + + -- Matthias Klose Wed, 18 May 2011 12:15:47 +0200 + +python3.2 (3.2-4) unstable; urgency=low + + * Update to 20110504 from the 3.2 branch. + * Disable the profiled build on ia64 and m68k. + * Update symbols file for m68k (Thorsten Glaser). + + -- Matthias Klose Wed, 04 May 2011 21:32:08 +0200 + +python3.2 (3.2-3) unstable; urgency=low + + * Update to 20110427 from the 3.2 branch. + - Fix argparse import. Closes: #624277. + * Keep the ssl.PROTOCOL_SSLv2 module constant , just raise an exception + when trying to create a PySSL object. #624127. + * Don't depend on the locale and specific awk implementations in prerm. + Closes: #623466, #620836. + * Remove the old local site directory. Closes: #623057. + + -- Matthias Klose Wed, 27 Apr 2011 20:40:29 +0200 + +python3.2 (3.2-2) unstable; urgency=low + + * Update to 20110419 from the 3.2 branch. + * Re-enable profile-guided builds. + * Build without OpenSSL v2 support. Closes: #622004. + * Force linking the curses module against libncursesw. Closes: #622064. + * Re-enable running the testsuite during the build. + + -- Matthias Klose Tue, 19 Apr 2011 17:54:36 +0200 + +python3.2 (3.2-1) unstable; urgency=low + + * Python 3.2 final release. + + -- Matthias Klose Sun, 20 Feb 2011 19:22:24 +0100 + +python3.2 (3.2~rc3-1) experimental; urgency=low + + * Python 3.2 release candidate 3. + + -- Matthias Klose Mon, 14 Feb 2011 16:12:14 +0100 + +python3.2 (3.2~rc1-2) experimental; urgency=low + + * Fix upgrade of the python3.2-dev package. Closes: #610370. + + -- Matthias Klose Wed, 19 Jan 2011 02:21:19 +0100 + +python3.2 (3.2~rc1-1) experimental; urgency=low + + * Python 3.2 release candidate 1. + + -- Matthias Klose Sun, 16 Jan 2011 22:17:09 +0100 + +python3.2 (3.2~b2-1) experimental; urgency=low + + * Python 3.2 beta2 release. + * Fix FTBFS on hurd-i386 (Pino Toscano). Closes: #606152). + + -- Matthias Klose Tue, 21 Dec 2010 21:23:21 +0100 + +python3.2 (3.2~b1-1) experimental; urgency=low + + * Python 3.2 beta1 release. + * Configure with --enable-loadable-sqlite-extensions. + + -- Matthias Klose Mon, 06 Dec 2010 12:19:09 +0100 + +python3.2 (3.2~a4-2) experimental; urgency=low + + * Fix build failure on the hurd. + + -- Matthias Klose Fri, 26 Nov 2010 06:38:41 +0100 + +python3.2 (3.2~a4-1) experimental; urgency=low + + * Python 3.2 alpha4 release. + * Update to the py3k branch (20101124). + * Move the Makefile into the -min package, required by sysconfig. + Addresses: #603237. + + -- Matthias Klose Wed, 24 Nov 2010 22:20:32 +0100 + +python3.2 (3.2~a3-2) experimental; urgency=low + + * Update to the py3k branch (20101018). + - Issue #10094: Use versioned .so files on GNU/kfreeBSD and the GNU Hurd. + Closes: #600183. + + -- Matthias Klose Mon, 18 Oct 2010 19:34:39 +0200 + +python3.2 (3.2~a3-1) experimental; urgency=low + + * Python 3.2 alpha3 release. + * Make Lib/plat-gnukfreebsd[78] ready for python3. Closes: #597874. + + -- Matthias Klose Tue, 12 Oct 2010 16:13:15 +0200 + +python3.2 (3.2~a2-7) experimental; urgency=low + + * Update to the py3k branch (20100926). + + -- Matthias Klose Sun, 26 Sep 2010 14:41:18 +0200 + +python3.2 (3.2~a2-6) experimental; urgency=low + + * Update to the py3k branch (20100919). + * Update GNU/Hurd patches (Pino Toscano). Closes: #597320. + + -- Matthias Klose Sun, 19 Sep 2010 12:45:14 +0200 + +python3.2 (3.2~a2-5) experimental; urgency=low + + * Update to the py3k branch (20100916). + * Provide Lib/plat-gnukfreebsd[78] (Jakub Wilk). Addresses: #593818. + * Assume working semaphores, don't rely on running kernel for the check. + LP: #630511. + + -- Matthias Klose Thu, 16 Sep 2010 14:41:58 +0200 + +python3.2 (3.2~a2-4) experimental; urgency=low + + * Update to the py3k branch (20100911). + * Add the sysconfig module to python3.2-minimal. + * Remove dist-packages/README. + * Make xargs --show-limits in the maintainer scripts independent from + the locale. + + -- Matthias Klose Sat, 11 Sep 2010 20:59:47 +0200 + +python3.2 (3.2~a2-3) experimental; urgency=low + + * Update to the py3k branch (20100910). + * Disable profile feedback based optimization on armel. + * Add copyright information for expat, libffi and zlib. Sources + for the wininst-* files are in PC/bdist_wininst. Closes: #596276. + * Run the testsuite in parallel, when parallel= is set in DEB_BUILD_OPTIONS. + + -- Matthias Klose Fri, 10 Sep 2010 20:28:16 +0200 + +python3.2 (3.2~a2-2) experimental; urgency=low + + * Fix distutils.sysconfig.get_makefile_name for debug builds. + + -- Matthias Klose Thu, 09 Sep 2010 02:40:11 +0200 + +python3.2 (3.2~a2-1) experimental; urgency=low + + * Python 3.2 alpha2 release. + * Update to the py3k branch (20100908). + * Provide /usr/lib/python3/dist-packages as location for public python + packages. + + -- Matthias Klose Wed, 08 Sep 2010 17:36:06 +0200 + +python3.2 (3.2~a1-1) experimental; urgency=low + + * Python 3.2 alpha1 release. + - Files removed: Lib/profile.py, Lib/pstats.py, PC/icons/source.xar. + * Update to the py3k branch (20100827). + * Fix detection of ffi.h header file. Closes: #591408. + * python3.1-dev: Depend on libssl-dev. LP: #611845. + + -- Matthias Klose Fri, 27 Aug 2010 21:40:31 +0200 + +python3.2 (3.2~~20100707-0ubuntu1) maverick; urgency=low + + * Move the pkgconfig file into the -dev package. + * Update preremoval scripts for __pycache__ layout. + * Run hooks from /usr/share/python3/runtime.d/ + * Update distutils-install-layout and debug-build patches. + + -- Matthias Klose Wed, 07 Jul 2010 12:38:52 +0200 + +python3.2 (3.2~~20100706-0ubuntu1) maverick; urgency=low + + * Test build, taken from the py3k branch (20100706). + * Merge with the python3.1 packaging. + + -- Matthias Klose Tue, 06 Jul 2010 17:10:51 +0200 + +python3.2 (3.2~~20100704-0ubuntu1) maverick; urgency=low + + * Test build, taken from the py3k branch (20100704). + + -- Matthias Klose Sun, 04 Jul 2010 16:04:45 +0200 + +python3.2 (3.2~~20100421-0ubuntu1) lucid; urgency=low + + * Test build, taken from the py3k branch (20100421). + + -- Matthias Klose Wed, 21 Apr 2010 22:04:14 +0200 + +python3.1 (3.1.2+20100703-1) unstable; urgency=low + + * Update to the 3.1 release branch, 20100703. + * Convert internal dpatch system to quilt. + * Update module list for python3-minimal. + + -- Matthias Klose Sat, 03 Jul 2010 14:18:18 +0200 + +python3.1 (3.1.2-3) unstable; urgency=low + + * Update to the 3.1 release branch, 20100508. + * Fix backport of issue #8140. Closes: #578896. + + -- Matthias Klose Sat, 08 May 2010 15:37:35 +0200 + +python3.1 (3.1.2-2) unstable; urgency=low + + * Update to the 3.1 release branch, 20100421. + * Update patch for issue #8032, gdb7 hooks for debugging. + * Fix issue #8233: When run as a script, py_compile.py optionally + takes a single argument `-`. + * Don't build-depend on locales on avr32. + + -- Matthias Klose Wed, 21 Apr 2010 21:12:37 +0200 + +python3.1 (3.1.2-1) unstable; urgency=low + + * Python 3.1.2 release. + * Fix issue #4961: Inconsistent/wrong result of askyesno function in + tkMessageBox with Tcl8.5. LP: #462950. + * Don't complain when /usr/local is not writable on installation. + * Apply proposed patch for issue #8032, gdb7 hooks for debugging. + + -- Matthias Klose Sun, 21 Mar 2010 17:59:49 +0100 + +python3.1 (3.1.2~rc1-2) unstable; urgency=low + + * Update to the 3.1 release branch, 20100316. + * Backport issue #8140: Extend compileall to compile single files. + Add -i option. + + -- Matthias Klose Tue, 16 Mar 2010 02:38:45 +0100 + +python3.1 (3.1.2~rc1-1) unstable; urgency=low + + * Python 3.1.2 release candidate 1. + - Replace the Monty Python audio test file. Closes: #568676. + * Build using libdb4.8-dev. Only used for the dbm extension; the bsddb3 + extension isn't built from the core packages anymore. + + -- Matthias Klose Thu, 11 Mar 2010 17:26:17 +0100 + +python3.1 (3.1.1-3) unstable; urgency=low + + * Update to the 3.1 release branch, 20100119. + * Hurd fixes (Pino Toscano): + - hurd-broken-poll.dpatch: ported from 2.5. + - hurd-disable-nonworking-constants.dpatch: disable a few constants from + the public API whose C counterparts are not implemented, so using them + either always blocks or always fails (caused issues in the test suite). + - hurd-path_max.dpatch (hurd only): change few PATH_MAX occurrences to + MAXPATHLEN (which is defined by the python lib if not defined by the OS). + - cthreads.dpatch: Refresh. + - Exclude the profiled build for hurd. + - Disable six blocking tests from the test suite. + * Don't run the testsuite on armel and hppa until someone figures out + the blocking tests. + + -- Matthias Klose Tue, 19 Jan 2010 22:02:14 +0100 + +python3.1 (3.1.1-2) unstable; urgency=low + + * Update to the 3.1 release branch, 20100116. + * Fix bashism in makesetup shell script. Closes: #530170, #530171. + * Fix build issues on avr (Bradley Smith). Closes: #528439. + - Configure --without-ffi. + - Don't run lengthly tests. + + -- Matthias Klose Sat, 16 Jan 2010 23:28:05 +0100 + +python3.1 (3.1.1-1) experimental; urgency=low + + * Python 3.1.1 final release. + * Update to the 3.1 release branch, 20091011. + * Remove /usr/local/lib/python3.1 on package removal, if empty. + * Build _hashlib as a builtin. LP: #445530. + * python3.1-doc: Don't compress the sphinx inventory. + * python3.1-doc: Fix jquery.js symlink. LP: #447370. + * Run the benchmark with -C 2 -n 5 -w 4 on all architectures. + * python3.1-dbg: Don't create debug subdirectory in /usr/local. No + separate debug directory needed anymore. + * Fix title of devhelp document. LP: #423551. + + -- Matthias Klose Sun, 11 Oct 2009 22:01:57 +0200 + +python3.1 (3.1-1) experimental; urgency=low + + * Python 3.1 final release. + * Update to the 3.1 release branch, 20090723. + * Add explicit build dependency on tk8.5-dev. + + -- Matthias Klose Thu, 23 Jul 2009 15:20:35 +0200 + +python3.1 (3.1-0ubuntu2) karmic; urgency=low + + * Disable profile feedback based optimization on amd64 (GCC + PR gcov-profile/38292). + + -- Matthias Klose Fri, 24 Jul 2009 16:27:22 +0200 + +python3.1 (3.1-0ubuntu1) karmic; urgency=low + + * Python 3.1 final release. + * Update to the 3.1 release branch, 20090723. + * Add explicit build dependency on tk8.5-dev. + + -- Matthias Klose Thu, 23 Jul 2009 18:52:17 +0200 + +python3.1 (3.1~rc2+20090622-1) experimental; urgency=low + + [Matthias Klose] + * Python 3.1 rc2 release. Closes: #529320. + * Update to the trunk, 20090622, remove patches integrated upstream. + * Configure with --with-fpectl --with-dbmliborder=bdb --with-wide-unicode. + NOTE: The --with-wide-unicode configuration will break most extensions + built with 3.1~a1, but is consistent with python2.x configurations. + * Add symbols files for libpython3.1 and python3.1-dbg, don't include symbols + from builtins, which can either be built as builtins or extensions. + * Keep an empty lib-dynload in python3.1-minimal to avoid a warning on + startup. + * python3.1-doc: Depend on libjs-jquery, use jquery.js from this package. + Closes: #523485. + * Do not add /usr/lib/pythonXY.zip on sys.path. + * Add symbols files for libpython3.1 and python3.1-dbg, don't include symbols + from builtins, which can either be built as builtins or extensions. + * Keep an empty lib-dynload in python3.1-minimal to avoid a warning on + startup. + * Fix some lintian warnings. + * Use the information in /etc/lsb-release for platform.dist(). LP: #196526. + * Move the bdist_wininst files into the -dev package (only needed to build + windows installers). + * Document changes to the site directory name in the installation manual. + * Don't build a profiled binary. Closes: #521811. + + * Address issues when working with PYTHONUSERBASE and non standard prefix + (pointed out by Larry Hastings): + - distutils.sysconfig.get_python_lib(): Only return ".../dist-packages" if + prefix is the default prefix and if PYTHONUSERBASE is not set in the + environment. + - site.addusersitepackages(): Add USER_BASE/.../dist-packages to sys.path. + * Always use the `unix_prefix' scheme for setup.py install in a virtualenv + setup. LP: #339904. + * Don't make the setup.py install options --install-layout=deb and --prefix + conflict with each other. + * distutils: Always install into `/usr/local/lib/python3.1/dist-packages' + if an option `--prefix=/usr/local' is present (except for virtualenv + and PYTHONUSERBASE installations). LP: #362570. + * Always use `site-packages' as site directory name in virtualenv. + + [Marc Deslauriers] + * debian/pyhtml2devhelp.py: update for sphinx generated documentation. + * debian/rules: re-enable documentation files for devhelp. + + -- Matthias Klose Mon, 22 Jun 2009 16:18:39 +0200 + +python3.1 (3.1~a1+20090322-1) experimental; urgency=low + + * Python 3.1 alpha1 release. + * Update to the trunk, 20090322. + * Update installation schemes: LP: #338395. + - When the --prefix option is used for setup.py install, Use the + `unix_prefix' scheme. + - Use the `deb_system' scheme if --install-layout=deb is specified. + - Use the the `unix_local' scheme if neither --install-layout=deb + nor --prefix is specified. + * Use the information in /etc/lsb-release for platform.dist(). LP: #196526. + * pydoc: Fix detection of local documentation files. + * Build a shared library configured --with-pydebug. LP: #322580. + * Fix some lintian warnings. + + -- Matthias Klose Mon, 23 Mar 2009 00:01:27 +0100 + +python3.1 (3.1~~20090226-1) experimental; urgency=low + + * Python-3.1 snapshot (20090226), upload to experimental. + + -- Matthias Klose Thu, 26 Feb 2009 16:18:41 +0100 + +python3.1 (3.1~~20090222-0ubuntu1) jaunty; urgency=low + + * Python-3.1 snapshot (20090222). + * Build the _dbm extension using the Berkeley DB backend. + + -- Matthias Klose Sun, 22 Feb 2009 12:58:58 +0100 + +python3.0 (3.0.1-0ubuntu4) jaunty; urgency=low + + * Don't build-depend on locales on sparc. Currently not installable. + + -- Matthias Klose Sun, 22 Feb 2009 12:48:38 +0100 + +python3.0 (3.0.1-0ubuntu3) jaunty; urgency=low + + * Update to 20090222 from the release30-maint branch. + + -- Matthias Klose Sun, 22 Feb 2009 11:09:58 +0100 + +python3.0 (3.0.1-0ubuntu2) jaunty; urgency=low + + * Allow docs to be built with Sphinx 0.5.x. + + -- Matthias Klose Tue, 17 Feb 2009 12:58:02 +0100 + +python3.0 (3.0.1-0ubuntu1) jaunty; urgency=low + + * New upstream version. + + -- Matthias Klose Mon, 16 Feb 2009 17:18:23 +0100 + +python3.0 (3.0-0ubuntu2) jaunty; urgency=low + + * Update to 20090213 from the release30-maint branch. + + -- Matthias Klose Fri, 13 Feb 2009 15:49:12 +0100 + +python3.0 (3.0-0ubuntu1) jaunty; urgency=low + + * Final Python-3.0 release. + + -- Matthias Klose Thu, 04 Dec 2008 09:00:09 +0100 + +python3.0 (3.0~rc3-0ubuntu4) jaunty; urgency=low + + * Update to 20081127 from the py3k branch. + * Ensure that all extensions from the -minimal package are statically + linked into the interpreter. LP: #301597. + * Include expat, _elementtree, datetime in -minimal to link + these extensions statically. + + -- Matthias Klose Thu, 27 Nov 2008 08:49:02 +0100 + +python3.0 (3.0~rc3-0ubuntu3) jaunty; urgency=low + + * Ignore errors when running the profile task. + + -- Matthias Klose Sun, 23 Nov 2008 15:50:17 +0100 + +python3.0 (3.0~rc3-0ubuntu2) jaunty; urgency=low + + * Don't run test_ioctl on the buildd, before the buildd chroot is fixed: + Unable to open /dev/tty. + + -- Matthias Klose Sun, 23 Nov 2008 15:28:02 +0100 + +python3.0 (3.0~rc3-0ubuntu1) jaunty; urgency=low + + * Update to the python-3.0 release candidate 3. + + -- Matthias Klose Sun, 23 Nov 2008 13:14:20 +0100 + +python3.0 (3.0~rc1+20081027-0ubuntu1) intrepid; urgency=low + + * Update to 20081027 from the py3k branch. LP: #279227. + * Fix typos and section names in doc-base files. LP: #273344. + * Build a new package libpython3.0. + * For locally installed packages, create a directory + /usr/local/lib/python3.0/dist-packages. This is the default for + installations done with distutils and setuptools. Third party stuff + packaged within the distribution goes to /usr/lib/python3.0/dist-packages. + There is no /usr/lib/python3.0/site-packages in the file system and + on sys.path. No package within the distribution must not install + anything in this location. + * distutils: Add an option --install-layout=deb, which + - installs into $prefix/dist-packages instead of $prefix/site-packages. + - doesn't encode the python version into the egg name. + + -- Matthias Klose Mon, 27 Oct 2008 23:38:42 +0100 + +python3.0 (3.0~b3+20080915-0ubuntu1) intrepid; urgency=low + + * Update to 20080915 from the py3k branch. + * Build gdbm + + -- Matthias Klose Mon, 15 Sep 2008 23:56:44 +0200 + +python3.0 (3.0~b3-0ubuntu1~ppa1) intrepid; urgency=low + + * Python 3.0 beta3 release. + + -- Matthias Klose Sun, 24 Aug 2008 03:49:26 +0200 + +python3.0 (3.0~b2-0ubuntu1~ppa1) intrepid; urgency=low + + * Python 3.0 beta2 release. + + -- Matthias Klose Thu, 07 Aug 2008 14:57:02 +0000 + +python3.0 (3.0~b1-0ubuntu1~ppa1) intrepid; urgency=low + + * Python 3.0 beta1 release. + + -- Matthias Klose Tue, 15 Jul 2008 16:10:52 +0200 + +python3.0 (3.0~a5+0530-0ubuntu1) intrepid; urgency=low + + * Update to snapshot taken from the py3k branch. + + -- Matthias Klose Thu, 29 May 2008 15:50:55 +0200 + +python3.0 (3.0~a1-0ubuntu2) gutsy; urgency=low + + * Disable running the benchmark. + + -- Matthias Klose Fri, 31 Aug 2007 23:22:34 +0000 + +python3.0 (3.0~a1-0ubuntu1) gutsy; urgency=low + + * First Python-3.0 alpha release. + + -- Matthias Klose Fri, 31 Aug 2007 21:26:21 +0200 + +python2.6 (2.6~alpha~pre1-~0ubuntu1~ppa1) gutsy; urgency=low + + * Snapshot build, an "how to use tilde in version numbers" upload. + * SVN 20070831. + + -- Matthias Klose Fri, 31 Aug 2007 15:56:09 +0200 + +python2.5 (2.5.2-4) unstable; urgency=low + + * Update to 20080427, taken from the 2.5 release branch. + - Fix issues #2670, #2682. + * Disable running pybench on the hppa buildd (ftbfs). + * Allow setting BASECFLAGS, OPT and EXTRA_LDFLAGS (like, CC, CXX, CPP, + CFLAGS, CPPFLAGS, CCSHARED, LDSHARED) from the environment. + * Support parallel= in DEB_BUILD_OPTIONS (see #209008). + + -- Matthias Klose Sun, 27 Apr 2008 10:40:51 +0200 + +python2.5 (2.5.2-3) unstable; urgency=medium + + * Update to 20080416, taken from the 2.5 release branch. + - Fix CVE-2008-1721, integer signedness error in the zlib extension module. + - Fix urllib2 file descriptor happens byte-at-a-time, reverting + a fix for excessively large memory allocations when calling .read() + on a socket object wrapped with makefile(). + * Disable some regression tests on some architectures: + - arm: test_compiler, test_ctypes. + - armel: test_compiler. + - hppa: test_fork1, test_wait3. + - m68k: test_bsddb3, test_compiler. + * Build-depend on libffi-dev instead of libffi4-dev. + * Fix CVE-2008-1679, integer overflows in the imageop module. + + -- Matthias Klose Wed, 16 Apr 2008 23:37:46 +0200 + +python2.5 (2.5.2-2) unstable; urgency=low + + * Use site.addsitedir() to add directories in /usr/local to sys.path. + Addresses: #469157, #469818. + + -- Matthias Klose Sat, 08 Mar 2008 16:11:23 +0100 + +python2.5 (2.5.2-1) unstable; urgency=low + + * Python 2.5.2 release. + * Merge from Ubuntu: + - Move site customization into sitecustomize.py, don't make site.py + a config file. Addresses: #309719, #413172, #457361. + - Move site.py to python2.4-minimal, remove `addbuilddir' from site.py, + which is unnecessary for installed builds. + - python2.5-dev: Recommend libc-dev instead of suggesting it. LP: #164909. + - Fix issue 961805, Tk Text.edit_modified() fails. LP: #84720. + + -- Matthias Klose Thu, 28 Feb 2008 23:18:52 +0100 + +python2.5 (2.5.1-7) unstable; urgency=low + + * Update to 20080209, taken from the 2.5 release branch. + * Build the _bsddb extension with db-4.5 again; 4.6 is seriously + broken when used with the _bsddb extension. + * Do not run pybench on arm and armel. + * python2.5: Provide python2.5-wsgiref. + * Fix a pseudo RC report with duplicated attributes in the control + file. Closes: #464307. + + -- Matthias Klose Sun, 10 Feb 2008 00:22:57 +0100 + +python2.5 (2.5.1-6) unstable; urgency=low + + * Update to 20080102, taken from the 2.5 release branch. + - Only define _BSD_SOURCE on OpenBSD systems. Closes: #455400. + * Fix handling of packages in linecache.py (Kevin Goodsell). LP: #70902. + * Bump debhelper to v5. + * Register binfmt for .py[co] files. + * Use absolute paths when byte-compiling files. Addresses: #453346. + Closes: #413566, LP: #177722. + * CVE-2007-4965, http://bugs.python.org/issue1179: + Multiple integer overflows in the imageop module in Python 2.5.1 and + earlier allow context-dependent attackers to cause a denial of service + (application crash) and possibly obtain sensitive information (memory + contents) via crafted arguments to (1) the tovideo method, and unspecified + other vectors related to (2) imageop.c, (3) rbgimgmodule.c, and other + files, which trigger heap-based buffer overflows. + Patch prepared by Stephan Herrmann. Closes: #443333, LP: #163845. + * Register info docs when doing source only uploads. LP: #174786. + * Remove deprecated value from categories in desktop file. LP: #172874. + * python2.5-dbg: Don't include the gdbm and _tkinter extensions, now provided + in separate packages. + * Provide a symlink changelog -> NEWS. Closes: #439271. + * Fix build failure on hurd, working around poll() on systems on which it + returns an error on invalid FDs. Closes: #438914. + * Configure --with-system-ffi on all architectures. Closes: #448520. + * Fix version numbers in copyright and README files (Dan O'Huiginn). + Closes: #446682. + * Move some documents from python2.5 to python2.5-dev. + + -- Matthias Klose Wed, 02 Jan 2008 22:22:19 +0100 + +python2.5 (2.5.1-5) unstable; urgency=low + + * Build the _bsddb extension with db-4.6. + + -- Matthias Klose Fri, 17 Aug 2007 00:39:35 +0200 + +python2.5 (2.5.1-4) unstable; urgency=low + + * Update to 20070813, taken from the 2.5 release branch. + * Include plat-mac/plistlib.py (plat-mac is not in sys.path by default. + Closes: #435826. + * Use emacs22 to build the documentation in info format. Closes: #434969. + * Build-depend on db-dev (>= 4.6). Closes: #434965. + + -- Matthias Klose Mon, 13 Aug 2007 22:22:44 +0200 + +python2.5 (2.5.1-3) unstable; urgency=high + + * Support mixed-endian IEEE floating point, as found in the ARM old-ABI + (Aurelien Jarno). Closes: #434905. + + -- Matthias Klose Fri, 27 Jul 2007 20:01:35 +0200 + +python2.5 (2.5.1-2) unstable; urgency=low + + * Update to 20070717, taken from the 2.5 release branch. + * Fix reference count for sys.pydebug variable. Addresses: #431393. + * Build depend on libbluetooth-dev instead of libbluetooth2-dev. + + -- Matthias Klose Tue, 17 Jul 2007 14:09:47 +0200 + +python2.5 (2.5.1-1) unstable; urgency=low + + * Python-2.5.1 release. + * Build-depend on gcc-4.1 (>= 4.1.2-4) on alpha, powerpc, s390, sparc. + * Merge from Ubuntu: + - Add debian/patches/subprocess-eintr-safety.dpatch (LP: #87292): + - Create and use wrappers around read(), write(), and os.waitpid() in the + subprocess module which retry the operation on an EINTR (which happens + if e. g. an alarm was raised while the system call was in progress). + It is incredibly hard and inconvenient to sensibly handle this in + applications, so let's fix this at the right level. + - Patch based on original proposal of Peter <85>strand + in http://python.org/sf/1068268. + - Add two test cases. + - Change the interpreter to build and install python extensions + built with the python-dbg interpreter with a different name into + the same path (by appending `_d' to the extension name). The debug build + of the interpreter tries to first load a foo_d.so or foomodule_d.so + extension, then tries again with the normal name. + - When trying to import the profile and pstats modules, don't + exit, add a hint to the exception pointing to the python-profiler + package, don't exit. + - Keep the module version in the .egg-info name, only remove the + python version. + - python2.5-dbg: Install Misc/SpecialBuilds.txt, document the + debug changes in README.debug. + * Update to 20070425, taken from the 2.5 release branch. + + -- Matthias Klose Wed, 25 Apr 2007 22:12:50 +0200 + +python2.5 (2.5-6) unstable; urgency=medium + + * webbrowser.py: Recognize other browsers: www-browser, x-www-browser, + iceweasel, iceape. + * Move pyconfig.h from the python2.5-dev into the python2.5 package; + required by builds for pure python modules without having python2.5-dev + installed (matching the functionality in python2.4). + * Move the unicodedata module into python2.5-minimal; allows byte compilation + of UTF8 encoded files. + * Do not install anymore outdated debhelper sample scripts. + * Install Misc/SpecialBuilds.txt as python2.5-dbg document. + + -- Matthias Klose Wed, 21 Feb 2007 01:17:12 +0100 + +python2.5 (2.5-5) unstable; urgency=high + + * Do not run the python benchmark on m68k. Timer problems. + Fixes FTBFS on m68k. + * Update to 20061209, taken from the 2.5 release branch. + - Fixes building the library reference in info format. + + -- Matthias Klose Sat, 9 Dec 2006 13:40:48 +0100 + +python2.5 (2.5-4) unstable; urgency=medium + + * Update to 20061203, taken from the 2.5 release branch. + - Fixes build failures on knetfreebsd and the hurd. Closes: #397000. + * Clarify README about distutils. Closes: #396394. + * Move python2.5-config to python2.5-dev. Closes: #401451. + * Cleanup build-conflicts. Addresses: #394512. + + -- Matthias Klose Sun, 3 Dec 2006 18:22:49 +0100 + +python2.5 (2.5-3.1) unstable; urgency=low + + * Non-maintainer upload. + * python2.5-minimal depends on python-minimal (>= 2.4.4-1) because it's the + first version which lists python2.5 as an unsupported runtime (ie a + runtime that is available but for which modules are not auto-compiled). + And being listed there is required for python-central to accept the + installation of python2.5-minimal. Closes: #397006 + + -- Raphael Hertzog Wed, 22 Nov 2006 15:41:06 +0100 + +python2.5 (2.5-3) unstable; urgency=medium + + * Update to 20061029 (2.4.4 was released on 20061019), taken from + the 2.5 release branch. We do not want to have regressions in + 2.5 compared to the 2.4.4 release. + * Don't run pybench on m68k, fails in the calibration loop. Closes: #391030. + * Run the installation/removal hooks. Closes: #383292, #391036. + + -- Matthias Klose Sun, 29 Oct 2006 11:35:19 +0100 + +python2.5 (2.5-2) unstable; urgency=medium + + * Update to 20061003, taken from the 2.5 release branch. + * On arm and m68k, don't run the pybench in debug mode. + * Fix building the source within exec_prefix (Alexander Wirt). + Closes: #385336. + + -- Matthias Klose Tue, 3 Oct 2006 10:08:36 +0200 + +python2.5 (2.5-1) unstable; urgency=low + + * Python 2.5 release. + * Update to 20060926, taken from the 2.5 release branch. + * Run the Python benchmark during the build, compare the results + of the static and shared builds. + * Fix invalid html in python2.5.devhelp.gz. + * Add a python2.5 console entry to the menu (hidden by default). + * python2.5: Suggest python-profiler. + + -- Matthias Klose Tue, 26 Sep 2006 02:36:11 +0200 + +python2.5 (2.5~c1-1) unstable; urgency=low + + * Python 2.5 release candidate 1. + * Update to trunk 20060818. + + -- Matthias Klose Sat, 19 Aug 2006 19:21:05 +0200 + +python2.5 (2.5~b3-1) unstable; urgency=low + + * Build the _ctypes module for m68k-linux. + + -- Matthias Klose Fri, 11 Aug 2006 18:19:19 +0000 + +python2.5 (2.5~b3-0ubuntu1) edgy; urgency=low + + * Python 2.5 beta3 release. + * Update to trunk 20060811. + * Rebuild the documentation. + * Fix value of sys.exec_prefix in the debug build. + * Do not build the library reference in info format; fails to build. + * Link the interpreter against the shared runtime library. With + gcc-4.1 the difference in the pystones benchmark dropped from about + 12% to about 6%. + * Install the statically linked version of the interpreter as + python2.5-static for now. + * Link the shared libpython with -O1. + + -- Matthias Klose Thu, 10 Aug 2006 14:04:48 +0000 + +python2.5 (2.4.3+2.5b2-3) unstable; urgency=low + + * Disable the testsuite on s390; don't care about "minimally configured" + buildd's. + + -- Matthias Klose Sun, 23 Jul 2006 11:45:03 +0200 + +python2.5 (2.4.3+2.5b2-2) unstable; urgency=low + + * Update to trunk 20060722. + * Merge idle-lib from idle-python2.5 into python2.5. + * Merge lib-tk from python-tk into python2.5. + * Tkinter.py: Suggest installation of python-tk package on failed + import of the _tkinter extension. + * Don't run the testsuite for the debug build on alpha. + * Don't run the test_compiler test on m68k. Just takes too long. + * Disable building ctypes on m68k (requires support for closures). + + -- Matthias Klose Sat, 22 Jul 2006 22:26:42 +0200 + +python2.5 (2.4.3+2.5b2-1) unstable; urgency=low + + * Python 2.5 beta2 release. + * Update to trunk 20060716. + * When built on a buildd, do not run the following test which try to + access the network: test_codecmaps_cn, test_codecmaps_hk, test_codecmaps_jp, + test_codecmaps_kr, test_codecmaps_tw, test_normalization. + * When built on a buildd, do not run tests requiring missing write permissions: + test_ossaudiodev. + + -- Matthias Klose Sun, 16 Jul 2006 02:53:50 +0000 + +python2.5 (2.4.3+2.5b2-0ubuntu1) edgy; urgency=low + + * Python 2.5 beta2 release. + + -- Matthias Klose Thu, 13 Jul 2006 17:16:52 +0000 + +python2.5 (2.4.3+2.5b1-1ubuntu2) edgy; urgency=low + + * Fix python-dev dependencies. + * Update to trunk 20060709. + + -- Matthias Klose Sun, 9 Jul 2006 18:50:32 +0200 + +python2.5 (2.4.3+2.5b1-1ubuntu1) edgy; urgency=low + + * Python 2.5 beta1 release. + * Update to trunk 20060623. + * Merge changes from the python2.4 packages. + * python2.5-minimal: Add _struct. + + -- Matthias Klose Fri, 23 Jun 2006 16:04:46 +0200 + +python2.5 (2.4.3+2.5a1-1) experimental; urgency=low + + * Update to trunk 20060409. + * Run testsuite for debug build as well. + * Build-depend on gcc-4.1. + + -- Matthias Klose Sun, 9 Apr 2006 22:27:05 +0200 + +python2.5 (2.4.3+2.5a1-0ubuntu1) dapper; urgency=low + + * Python 2.5 alpha1 release. + * Drop integrated patches. + * Add build dependencies on libsqlite3-dev and libffi4-dev. + * Add (build-)dependency on mime-support, libgpmg1 (test suite). + * Build using the system FFI. + * python2.5 provides python2.5-ctypes and python2.5-pysqlite2, + python2.5-elementtree. + * Move hashlib.py to python-minimal. + * Lib/hotshot/pstats.py: Error out on missing profile/pstats modules. + + -- Matthias Klose Wed, 5 Apr 2006 14:56:15 +0200 + +python2.4 (2.4.3-8ubuntu1) edgy; urgency=low + + * Resynchronize with Debian unstable. Remaining changes: + - Apply langpack-gettext patch. + - diff.gz contains pregenerated html and info docs. + - Build the -doc package from this source. + + -- Matthias Klose Thu, 22 Jun 2006 18:39:57 +0200 + +python2.4 (2.4.3-8) unstable; urgency=low + + * Remove python2.4's dependency on python-central. On installation of + the runtime, call hooks /usr/share/python/runtime.d/*.rtinstall. + On removal, call hooks /usr/share/python/runtime.d/*.rtremove. + Addresses: #372658. + * Call the rtinstall hooks only, if it's a new installation, or the first + installation using the hooks. Adresses: #373677. + + -- Matthias Klose Sun, 18 Jun 2006 00:56:13 +0200 + +python2.4 (2.4.3-7) unstable; urgency=medium + + * Reupload, depend on python-central (>= 0.4.15). + * Add build-conflict on python-xml. + + -- Matthias Klose Wed, 14 Jun 2006 18:56:57 +0200 + +python2.4 (2.4.3-6) medium; urgency=low + + * idle-python2.4: Remove the old postinst and prerm scripts. + * Name the runtime correctly in python2.4-minimal's installation + scripts. + + -- Matthias Klose Mon, 12 Jun 2006 17:39:56 +0000 + +python2.4 (2.4.3-5) unstable; urgency=low + + * python2.4-prerm: Handle the case, when python-central is not installed. + * idle-python2.4: Depend on python-tk instead of python2.4-tk. + + -- Matthias Klose Fri, 9 Jun 2006 05:17:17 +0200 + +python2.4 (2.4.3-4) unstable; urgency=low + + * SVN update up to 2006-06-07 + * Use python-central. + * Don't build the -tk and -gdbm packages from this source; now built + from the python-stdlib-extensions source. + * Remove leftover build dependency on libgmp3-dev. + * Do not build-depend on libbluetooth1-dev and libgpmg1-dev on + hurd-i386, kfreebsd-i386, kfreebsd-amd64. Closes: #365830. + * Do not run the test_tcl test; hangs for unknown reasons on at least + the following buildds: vivaldi(m68k), goedel (alpha), mayer (mipsel). + And no virtual package to file bug reports for the buildds ... + Closes: #364419. + * Move the Makefile from python2.4-dev to python2.4. Closes: #366473. + * Fix typo in pdb(1). Closes: #365772. + * New autoconf likes the mandir in /usr/share instead of /usr; work + with both locations. Closes: #367618. + + -- Matthias Klose Wed, 7 Jun 2006 21:37:20 +0200 + +python2.4 (2.4.3-3) unstable; urgency=low + + * SVN update up to 2006-04-21 + * Update locale aliases from /usr/share/X11/locale/locale.alias. + * Start idle with option -n from the desktop menu, so that the program + can be started in parallel. + * Testsuite related changes only: + - Add build dependencies mime-support, libgpmg1 (needed by test cases). + - Run the testsuite with bsddb, audio and curses resources enabled. + - Re-run the failed tests in verbose mode. + - Run the test suite for the debug build as well. + - Build depend on netbase, needed by test_socketmodule. + - Build depend on libgpmg1, needed by test_curses. + - On the buildds do not run the tests needing the network resource. + * Update python logo. + * Check for the availability of the profile and pstats modules when + importing hotshot.pstats. Closes: #334067. + * Don't build the -doc package from the python2.4 source. + * Set OPT in the installed Makefile to -O2. + + -- Matthias Klose Fri, 21 Apr 2006 19:58:43 +0200 + +python2.4 (2.4.3-2) unstable; urgency=low + + * Add (build-)dependency on mime-support. + + -- Matthias Klose Tue, 4 Apr 2006 22:21:41 +0200 + +python2.4 (2.4.3-1) unstable; urgency=low + + * Python 2.4.3 release. + + -- Matthias Klose Thu, 30 Mar 2006 23:42:37 +0200 + +python2.4 (2.4.3-0ubuntu1) dapper; urgency=low + + * Python 2.4.3 release. + - Fixed a bug that the gb18030 codec raises RuntimeError on encoding + surrogate pair area on UCS4 build. Ubuntu: #29289. + + -- Matthias Klose Thu, 30 Mar 2006 10:57:32 +0200 + +python2.4 (2.4.2+2.4.3c1-0ubuntu1) dapper; urgency=low + + * SVN update up to 2006-03-25 (2.4.3 candidate 1). + - Regenerate the documentation. + + -- Matthias Klose Mon, 27 Mar 2006 12:03:05 +0000 + +python2.4 (2.4.2-1ubuntu3) dapper; urgency=low + + * SVN update up to 2006-03-04 + - Regenerate the documentation. + - map.mmap(-1, size, ...) can return anonymous memory again on Unix. + Ubuntu #26201. + * Build-depend on libncursesw5-dev, ncursesw5 is preferred for linking. + Provides UTF-8 compliant curses bindings. + * Fix difflib where certain patterns of differences were making difflib + touch the recursion limit. + + -- Matthias Klose Sat, 4 Mar 2006 21:38:24 +0000 + +python2.4 (2.4.2-1ubuntu2) dapper; urgency=low + + * SVN update up to 2006-01-17 + - pwd is now a builtin module, remove it from python-minimal. + - Regenerate the documentation. + * python2.4-tk: Suggest tix instead of tix8.1. + * Move config/Makefile from the -dev package into the runtime package + to be able to use the bdist_wininst distutils command. Closes: #348335. + + -- Matthias Klose Tue, 17 Jan 2006 11:02:24 +0000 + +python2.4 (2.4.2-1ubuntu1) dapper; urgency=low + + * Temporarily remove build dependency on lsb-release. + + -- Matthias Klose Sun, 20 Nov 2005 17:40:18 +0100 + +python2.4 (2.4.2-1build1) dapper; urgency=low + + * Rebuild (openssl-0.9.8). + + -- Matthias Klose Sun, 20 Nov 2005 15:27:24 +0000 + +python2.4 (2.4.2-1) unstable; urgency=low + + * Python 2.4.2 release. + + -- Matthias Klose Thu, 29 Sep 2005 01:49:28 +0200 + +python2.4 (2.4.1+2.4.2rc1-1) unstable; urgency=low + + * Python 2.4.2 release candidate 1. + * Fix "Fatal Python error" from cStringIO's writelines. + Patch by Andrew Bennetts. + + -- Matthias Klose Thu, 22 Sep 2005 10:33:22 +0200 + +python2.4 (2.4.1-5) unstable; urgency=low + + * CVS update up to 2005-09-14 + - Regenerate the html and info docs. + * Add some more locale aliases. + * Fix substitution pf python version in README.python2.4-minimal. + Closes: #327487. + * On m68k, build using -O2 (closes: #326903). + * On Debian, don't configure --with-fpectl, which stopped working with + glibc-2.3.5. + + -- Matthias Klose Wed, 14 Sep 2005 17:32:56 +0200 + +python2.4 (2.4.1-4) unstable; urgency=low + + * CVS update up to 2005-09-04 + - teTeX 3.0 related fixes (closes: #322407). + - Regenerate the html and info docs. + * Add entry for IDLE in the Gnome menus. + * Don't build-depend on libbluetooth-dev on the Hurd (closes: #307037). + * Reenable the cthreads patch for the Hurd (closes: #307052). + + -- Matthias Klose Sun, 4 Sep 2005 18:31:42 +0200 + +python2.4 (2.4.1-3) unstable; urgency=low + + * Synchronise with Ubuntu: + - Build a python2.4-minimal package. + + -- Matthias Klose Tue, 12 Jul 2005 00:23:10 +0000 + +python2.4 (2.4.1-2ubuntu3) breezy; urgency=low + + * CVS update up to 2005-07-07 + * Regenerate the documentation. + + -- Matthias Klose Thu, 7 Jul 2005 09:21:28 +0200 + +python2.4 (2.4.1-2ubuntu2) breezy; urgency=low + + * CVS update up to 2005-06-15 + * Regenerate the documentation. + * Synchronize with Debian. Ubuntu 10485. + * idle-python2.4 enhances python2.4. Ubuntu 11562. + * README.Debian: Fix reference to the doc directory (closes: #311677). + + -- Matthias Klose Wed, 15 Jun 2005 08:56:57 +0200 + +python2.4 (2.4.1-2ubuntu1) breezy; urgency=low + + * Update build dependencies: + db4.2-dev -> db4.3-dev, + libreadline4-dev -> libreadline5-dev. + * python2.4-dev: Add missing templates to generate HTML docs. Ubuntu 11531. + + -- Matthias Klose Sun, 29 May 2005 00:01:05 +0200 + +python2.4 (2.4.1-2) unstable; urgency=low + + * Add the debug symbols for the python2.4, python2.4-gdbm + and python2.4-tk packages to the python2.4-dbg package. + * Add gdbinit example to doc directory. + + -- Matthias Klose Thu, 5 May 2005 11:12:32 +0200 + +python2.4 (2.4.1-1ubuntu2) breezy; urgency=low + + * Add the debug symbols for the python2.4, python2.4-minimal, python2.4-gdbm + and python2.4-tk packages to the python2.4-dbg package. Ubuntu 10261, + * Add gdbinit example to doc directory. + * For os.utime, use utimes(2), correctly working with glibc-2.3.5. + Ubuntu 10294. + + -- Matthias Klose Thu, 5 May 2005 09:06:07 +0200 + +python2.4 (2.4.1-1ubuntu1) breezy; urgency=low + + * Reupload as 2.4.1-1ubuntu1. + + -- Matthias Klose Thu, 14 Apr 2005 10:46:32 +0200 + +python2.4 (2.4.1-1) unstable; urgency=low + + * Python 2.4.1 release. + * Fix noise in python-doc installation/removal. + * New Python section for the info docs. + + -- Matthias Klose Wed, 30 Mar 2005 19:42:03 +0200 + +python2.4 (2.4.1-0) hoary; urgency=low + + * Python 2.4.1 release. + * Fix noise in python-doc installation/removal. + * New Python section for the info docs. + + -- Matthias Klose Wed, 30 Mar 2005 16:35:34 +0200 + +python2.4 (2.4+2.4.1rc2-2) unstable; urgency=low + + * Add the valgrind support file to /etc/python2.4 + * Build the -dbg package with -DPy_USING_MEMORY_DEBUGGER. + * Lib/locale.py: + - correctly parse LANGUAGE as a colon separated list of languages. + - prefer LC_ALL, LC_CTYPE and LANG over LANGUAGE to get the correct + encoding. + - Don't map 'utf8', 'utf-8' to 'utf', which is not a known encoding + for glibc. + * Fix two typos in python(1). Addresses: #300124. + + -- Matthias Klose Sat, 19 Mar 2005 21:50:14 +0100 + +python2.4 (2.4+2.4.1rc2-1) unstable; urgency=low + + * Python 2.4.1 release candidate 2. + * Build-depend on libbluetooth1-dev. + + -- Matthias Klose Sat, 19 Mar 2005 00:57:14 +0100 + +python2.4 (2.4dfsg-2) unstable; urgency=low + + * CVS update up to 2005-03-03 + + -- Matthias Klose Thu, 3 Mar 2005 22:22:16 +0100 + +python2.4 (2.4dfsg-1ubuntu4) hoary; urgency=medium + + * Move exception finalisation later in the shutdown process - this + fixes the crash seen in bug #1165761, taken from CVS. + * codecs.StreamReader: Reset codec when seeking. Ubuntu #6972. + * Apply fix for SF1124295, fixing an obscure bit of Zope's security machinery. + * distutils: Don't add standard library dirs to library_dirs + and runtime_library_dirs. On amd64, runtime paths pointing to /usr/lib64 + aren't recognized by dpkg-shlibdeps, and the packages containing these + libraries aren't added to ${shlibs:Depends}. + * Lib/locale.py: + - correctly parse LANGUAGE as a colon separated list of languages. + - prefer LC_ALL, LC_CTYPE and LANG over LANGUAGE to get the correct + encoding. + - Don't map 'utf8', 'utf-8' to 'utf', which is not a known encoding + for glibc. + * os.py: Avoid using items() in environ.update(). Fixes #1124513. + * Python/pythonrun.c: + * Build depend on locales, generate the locales needed for the + testsuite. + * Add build dependency on libbluetooth1-dev, adding some bluetooth + functionality to the socket module. + * Lib/test/test_sundry.py: Don't fail on import of profile & pstats, + which are separated out to the python-profiler package. + * Fix typos in manpage. + + -- Matthias Klose Tue, 29 Mar 2005 13:35:53 +0200 + + +python2.4 (2.4dfsg-1ubuntu3) hoary; urgency=low + + * debian/patches/langpack-gettext.dpatch: + - langpack support for python-gettext added + + -- Michael Vogt Tue, 1 Mar 2005 13:13:36 +0100 + +python2.4 (2.4dfsg-1ubuntu2) hoary; urgency=low + + * Revert 'essential' status on python2.4-minimal. This status on + on python-minimal is sufficient (Ubuntu #6392). + + -- Matthias Klose Wed, 9 Feb 2005 23:09:42 +0100 + +python2.4 (2.4dfsg-1ubuntu1) hoary; urgency=low + + * Resyncronise with Debian. + * Mark the python2.4-minimal package as 'essential'. + + -- Matthias Klose Wed, 9 Feb 2005 13:31:09 +0100 + +python2.4 (2.4dfsg-1) unstable; urgency=medium + + * Add licenses and acknowledgements for incorporated software in the + debian/copyright file (addresses: #293932). + * Replace md5 implementation with one having a DFSG conforming license. + * Remove the profile.py and pstats.py modules from the source package, + not having a DFSG conforming license. The modules can be found in + the python2.x-profile package in the non-free section. + Addresses: #293932. + * Add missing norwegian locales (Tollef Fog Heen). + * CVS updates of the release24-maint branch upto 2005-02-08 (date of + the Python 2.3.5 release). + + -- Matthias Klose Tue, 8 Feb 2005 19:13:10 +0100 + +python2.4 (2.4-7ubuntu1) hoary; urgency=low + + * Fix the name of the python-dbg man page. + * Resyncronise with Debian. + * Move more modules to -minimal (new code in copy.py requires these): + dis, inspect, opcode, token, tokenize. + + -- Matthias Klose Tue, 8 Feb 2005 19:13:10 +0100 + +python2.4 (2.4-7) unstable; urgency=medium + + * Add licenses and acknowledgements for incorporated software in the + debian/copyright file (addresses: #293932). + * Replace md5 implementation with one having a DFSG conforming license. + * Add missing norwegian locales (Tollef Fog Heen). + * CVS updates of the release24-maint branch upto 2005-02-08 (date of + the Python 2.3.5 release). + + -- Matthias Klose Tue, 8 Feb 2005 19:13:10 +0100 + +python2.4 (2.4-6) unstable; urgency=low + + * Build a python2.4-dbg package using --with-pydebug. Add a debug + directory /lib-dynload/debug to sys.path instead of + /lib-dynload und install the extension modules of the + debug build in this directory. + Change the module load path to load extension modules from other + site-packages/debug directories (for further details see the + README in the python2.4-dbg package). Closes: #5415. + * Apply the pydebug-path patch. The package was already built in -5. + + -- Matthias Klose Fri, 4 Feb 2005 22:15:13 +0100 + +python2.4 (2.4-5) unstable; urgency=high + + * Fix a flaw in SimpleXMLRPCServerthat can affect any XML-RPC servers. + This affects any programs have been written that allow remote + untrusted users to do unrestricted traversal and can allow them to + access or change function internals using the im_* and func_* attributes. + References: CAN-2005-0089. + * CVS updates of the release24-maint branch upto 2005-02-04. + + -- Matthias Klose Fri, 4 Feb 2005 08:12:10 +0100 + +python2.4 (2.4-4) unstable; urgency=medium + + * Update debian/copyright to the 2.4 license text (closes: #290898). + * Remove /usr/bin/smtpd.py (closes: #291049). + + -- Matthias Klose Mon, 17 Jan 2005 23:54:37 +0100 + +python2.4 (2.4-3ubuntu6) hoary; urgency=low + + * Use old-style dpatches instead of dpatch-run. + + -- Tollef Fog Heen Mon, 7 Feb 2005 15:58:05 +0100 + +python2.4 (2.4-3ubuntu5) hoary; urgency=low + + * Actually apply the patch as well (add to list of patches in + debian/rules) + + -- Tollef Fog Heen Sun, 6 Feb 2005 15:12:58 +0100 + +python2.4 (2.4-3ubuntu4) hoary; urgency=low + + * Add nb_NO and nn_NO locales to Lib/locale.py + + -- Tollef Fog Heen Sun, 6 Feb 2005 14:33:05 +0100 + +python2.4 (2.4-3ubuntu3) hoary; urgency=low + + * Fix a flaw in SimpleXMLRPCServerthat can affect any XML-RPC servers. + This affects any programs have been written that allow remote + untrusted users to do unrestricted traversal and can allow them to + access or change function internals using the im_* and func_* attributes. + References: CAN-2005-0089. + + -- Matthias Klose Wed, 2 Feb 2005 09:08:20 +0000 + +python2.4 (2.4-3ubuntu2) hoary; urgency=low + + * Build a python2.4-dbg package using --with-pydebug. Add a debug + directory /lib-dynload/debug to sys.path instead of + /lib-dynload und install the extension modules of the + debug build in this directory. + Change the module load path to load extension modules from other + site-packages/debug directories (for further details see the + README in the python2.4-dbg package). Closes: #5415. + * Update debian/copyright to the 2.4 license text (closes: #290898). + * Add operator and copy to the -minimal package. + + -- Matthias Klose Mon, 17 Jan 2005 23:19:47 +0100 + +python2.4 (2.4-3ubuntu1) hoary; urgency=low + + * Resynchronise with Debian. + * python2.4: Depend on the very same version of python2.4-minimal. + * Docment, that time.strptime currently cannot be used, if the + python-minimal package is installed without the python package. + + -- Matthias Klose Sun, 9 Jan 2005 19:35:48 +0100 + +python2.4 (2.4-3) unstable; urgency=medium + + * Build the fpectl module. + * Updated to CVS release24-maint 20050107. + + -- Matthias Klose Sat, 8 Jan 2005 19:05:21 +0100 + +python2.4 (2.4-2ubuntu5) hoary; urgency=low + + * Updated to CVS release24-maint 20050102. + * python-minimal: + - os.py: Use dict instead of UserDict, remove UserDict from -minimal. + - add pickle, threading, needed for subprocess module. + - optparse.py: conditionally import gettext, if not available, + define _ as the identity function. Patch taken from the trunk. + Avoids import of _locale, locale, gettext, copy, repr, itertools, + collections, token, tokenize. + - Add a build check to make sure that the minimal module list is + closed under dependency. + * Fix lintian warnings. + + -- Matthias Klose Sun, 2 Jan 2005 22:00:14 +0100 + +python2.4 (2.4-2ubuntu4) hoary; urgency=low + + * Add UserDict.py to the -minimal package, since os.py needs it. + + -- Colin Watson Thu, 30 Dec 2004 20:41:28 +0000 + +python2.4 (2.4-2ubuntu3) hoary; urgency=low + + * Add os.py and traceback.py to the -minimal package, get the list + of modules from the README. + + -- Matthias Klose Mon, 27 Dec 2004 08:20:45 +0100 + +python2.4 (2.4-2ubuntu2) hoary; urgency=low + + * Add compileall.py and py_compile.py to the -minimal package, not + just to the README ... + + -- Matthias Klose Sat, 25 Dec 2004 22:24:56 +0100 + +python2.4 (2.4-2ubuntu1) hoary; urgency=low + + * Separate the interpreter and a minimal subset of modules into + a python2.4-minimal package. See the README.Debian.gz in this + package. + * Move site.py to python2.4-minimal as well. + * Add documentation files for devhelp. + + -- Matthias Klose Sun, 19 Dec 2004 22:47:32 +0100 + +python2.4 (2.4-2) unstable; urgency=medium + + * Updated patch for #283108. Thanks to Jim Meyering. + + -- Matthias Klose Fri, 3 Dec 2004 17:00:16 +0100 + +python2.4 (2.4-1) unstable; urgency=low + + * Final 2.4 release. + * Flush stdout/stderr if closed (SF #1074011). + + -- Matthias Klose Wed, 1 Dec 2004 07:54:34 +0100 + +python2.4 (2.3.97-2) unstable; urgency=low + + * Don't run test_tcl, hanging on the buildds. + + -- Matthias Klose Fri, 19 Nov 2004 23:48:42 +0100 + +python2.4 (2.3.97-1) unstable; urgency=low + + * Python 2.4 Release Candidate 1. + + -- Matthias Klose Fri, 19 Nov 2004 21:27:02 +0100 + +python2.4 (2.3.96-1) experimental; urgency=low + + * Updated to CVS release24-maint 20041113. + * Build the docs in info format again. + + -- Matthias Klose Sat, 13 Nov 2004 21:21:10 +0100 + +python2.4 (2.3.95-2) experimental; urgency=low + + * Move distutils package from the python2.4-dev into the python2.4 + package. + + -- Matthias Klose Thu, 11 Nov 2004 22:56:14 +0100 + +python2.4 (2.3.95-1) experimental; urgency=low + + * Python 2.4 beta2 release. + + -- Matthias Klose Thu, 4 Nov 2004 23:43:47 +0100 + +python2.4 (2.3.94-1) experimental; urgency=low + + * Python 2.4 beta1 release. + + -- Matthias Klose Sat, 16 Oct 2004 08:33:57 +0200 + +python2.4 (2.3.93-1) experimental; urgency=low + + * Python 2.4 alpha3 release. + + -- Matthias Klose Fri, 3 Sep 2004 21:53:47 +0200 + +python2.4 (2.3.92-1) experimental; urgency=low + + * Python 2.4 alpha2 release. + + -- Matthias Klose Thu, 5 Aug 2004 23:53:18 +0200 + +python2.4 (2.3.91-1) experimental; urgency=low + + * Python 2.4 alpha1 release. + Highlights: http://www.python.org/2.4/highlights.html + + -- Matthias Klose Fri, 9 Jul 2004 17:38:54 +0200 + +python2.4 (2.3.90-1) experimental; urgency=low + + * Package HEAD branch (pre alpha ..). + + -- Matthias Klose Mon, 14 Jun 2004 23:19:57 +0200 + +python2.3 (2.3.4-1) unstable; urgency=medium + + * Final Python 2.3.4 Release. + * In the API docs, fix signature of PyModule_AddIntConstant (closes: #250826). + * locale.getdefaultlocale: don't fail with empty environment variables. + Closes: #249816. + * Include distutils/command/wininst.exe in -dev package (closes: #249006). + * Disable cthreads on the Hurd (Michael Banck). Closes: #247211. + * Add a note to pygettext(1), that this program is deprecated in favour + of xgettext, which now includes support for Python as well. + Closes: #246332. + + -- Matthias Klose Fri, 28 May 2004 22:59:42 +0200 + +python2.3 (2.3.3.91-1) unstable; urgency=low + + * Python 2.3.4 Release Candidate 1. + * Do not use the default namespace for attributes. Patch taken from the + 2.3 maintenance branch. + The xmllib module is obsolete. Use xml.sax instead. + * http://python.org/sf/945642 - fix nonblocking i/o with ssl socket. + + -- Matthias Klose Thu, 13 May 2004 21:24:52 +0200 + +python2.3 (2.3.3-7) unstable; urgency=low + + * Add a workaround for GNU libc nl_langinfo()'s returning NULL. + Closes: #239237. + Patch taken from 2.3 maintenance branch. + * threading.py: Remove calls to currentThread() in _Condition methods that + were side-effect. Side-effects were deemed unnecessary and were causing + problems at shutdown time when threads were catching exceptions at start + time and then triggering exceptions trying to call currentThread() after + gc'ed. Masked the initial exception which was deemed bad. + Closes: #195812. + * Properly support normalization of empty unicode strings. Closes: #239986. + Patch taken from 2.3 maintenance branch. + * README.maintainers: Add section where to find the documentation tools. + * Fix crash in pyexpat module (closes: #229281). + * For the Hurd, set the interpreters recursion limit to 930. + * Do not try to byte-compile the test files on installation; this + currently breaks the Hurd install. + + -- Matthias Klose Sat, 1 May 2004 07:50:46 +0200 + +python2.3 (2.3.3-6) unstable; urgency=low + + * Don't build the unversioned python{,-*} packages anymore. Now + built from the python-defaults package. + * Update to the proposed python-policy: byte-compile using -E. + * Remove python-elisp's dependency on emacs20 (closes: #232785). + * Don't build python-elisp from the python2.3 source anymore, + get it from python-mode.sf.net as a separate source package. + * python2.3-dev suggests libc-dev (closes: #231091). + * get LDSHARED and CCSHARED (like, CC, CXX, CPP, CFLAGS) from + the environment + * Set CXX in installed config/Makefile (closes: #230273). + + -- Matthias Klose Tue, 24 Feb 2004 07:07:51 +0100 + +python2.3 (2.3.3-5) unstable; urgency=low + + * Build-depend on libdb4.2-dev, instead of libdb4.1-dev. According + to the docs the file format is compatible. + + -- Matthias Klose Mon, 12 Jan 2004 10:37:45 +0100 + +python2.3 (2.3.3-4) unstable; urgency=low + + * Fix broken _bsddb module. setup.py picked up the wrong library. + + -- Matthias Klose Sun, 4 Jan 2004 11:30:00 +0100 + +python2.3 (2.3.3-3) unstable; urgency=low + + * Fix typo in patch (closes: #224797, #226064). + + -- Matthias Klose Sun, 4 Jan 2004 09:23:21 +0100 + +python2.3 (2.3.3-2) unstable; urgency=medium + + * Lib/email/Charset: use locale unaware function to lower case of locale + name (closes: #224797). + * Update python-mode to version from python-mode.sf.net. Fixes highlighting + problems (closes: #223520). + * Backport from mainline: Add IPV6_ socket options from RFCs 3493 and 3542. + + -- Matthias Klose Fri, 2 Jan 2004 14:03:26 +0100 + +python2.3 (2.3.3-1) unstable; urgency=low + + * New upstream release. + * Copy the templates, tools and scripts from the Doc dir in the source + to /usr/share/lib/python2.3/doc in the python2.3-dev package. Needed + for packages building documentation like python does (closes: #207337). + + -- Matthias Klose Fri, 19 Dec 2003 10:57:39 +0100 + +python2.3 (2.3.2.91-1) unstable; urgency=low + + * New upstream version (2.3.3 release candidate). + * Update python-mode.el (closes: #158811, #159630). + Closing unreproducible report (closes: #159628). + + -- Matthias Klose Sat, 6 Dec 2003 14:41:14 +0100 + +python2.3 (2.3.2-7) unstable; urgency=low + + * Put the conflict in the correct direction. python2.3 (2.3.2-6) doesn't + conflict with python (<= 2.3.2-5) but python (2.3.2-6) conflicts with + python2.3 (<= 2.3.2-5) (thanks to Brian May). Really closes #221791. + + -- Matthias Klose Fri, 21 Nov 2003 00:20:02 +0100 + +python2.3 (2.3.2-6) unstable; urgency=low + + * Add conflicts with older python{,2.3} packages to fix overwrite + errors (closes: #221791). + + -- Matthias Klose Thu, 20 Nov 2003 07:24:36 +0100 + +python2.3 (2.3.2-5) unstable; urgency=low + + * Updated to CVS release23-maint 20031119. + * Re-upgrade the dependency of python2.3 on python (>= 2.3) to + a dependency (closes: #221523). + + -- Matthias Klose Wed, 19 Nov 2003 00:30:27 +0100 + +python2.3 (2.3.2-4) unstable; urgency=low + + * Don't build-depend on latex2html (moved to non-free), but keep + the prebuilt docs in debian/patches (closes: #221347). + * Fix typos in the library reference (closes: #220510, #220954). + * Fix typo in python-elisp's autoloading code (closes: #220308). + * Update proposed python policy: private modules can be installed + into /usr/lib/ (arch dependent) and into /usr/share/ + (arch independent). + + -- Matthias Klose Tue, 18 Nov 2003 00:41:39 +0100 + +python2.3 (2.3.2-3) unstable; urgency=low + + * Downgrade the dependency of python2.3 on python (>= 2.3) to + a recommendation. + * Fix path to interpreter in binfmt file. + * Fix segfault in unicodedata module (closes: #218697). + * Adjust python-elisp autoload code (closes: #219821). + + -- Matthias Klose Sun, 9 Nov 2003 19:43:37 +0100 + +python2.3 (2.3.2-2) unstable; urgency=medium + + * Fix broken doc link (closes: #214217). + * Disable wrongly detected large file support for GNU/Hurd. + * Really fix the FTBFS for the binary-indep target (closes: #214303). + + -- Matthias Klose Mon, 6 Oct 2003 07:54:58 +0200 + +python2.3 (2.3.2-1) unstable; urgency=low + + * New upstream version. + * Fix a FTBFS for the binary-indep target. + + -- Matthias Klose Sat, 4 Oct 2003 10:20:15 +0200 + +python2.3 (2.3.1-3) unstable; urgency=low + + * Fix names of codec packages in recommends. + * On alpha compile using -mieee (see #212912). + + -- Matthias Klose Sun, 28 Sep 2003 10:48:12 +0200 + +python2.3 (2.3.1-2) unstable; urgency=low + + * Update python policy draft (closes: #128911, #163785). + * Re-add os.fsync function (closes: #212672). + * Let python2.3-doc conflict with older python2.3 versions (closes: #211882). + * Add recommends for pythonX.Y-japanese-codecs, pythonX.Y-iconvcodec, + pythonX.Y-cjkcodecs, pythonX.Y-korean-codecs (closes: #207161). + * Generate binfmt file (closes: #208005). + * Add IPPROTO_IPV6 option to the socketmodule (closes: #206569). + * Bugs reported against python2.2 and fixed in python2.3: + - Crashes in idle (closes: #186887, #200084). + + -- Matthias Klose Sat, 27 Sep 2003 11:21:47 +0200 + +python2.3 (2.3.1-1) unstable; urgency=low + + * New upstream version (bug fix release). + + -- Matthias Klose Wed, 24 Sep 2003 11:27:43 +0200 + +python2.3 (2.3-4) unstable; urgency=high + + * Disable check for utimes function, which is broken in glibc-2.3.2. + Packages using distutils had '1970/01/01-01:00:01' timestamps in files. + * Bugs fixed by making python2.3 the default python version: + - Canvas.scan_dragto() takes a 3rd optional parmeter "gain". + Closes: #158168. + - New command line parsing module (closes: #38628). + - compileall.py allows compiling single files (closes: #139971). + * Bugs reported for 2.2 and fixed in 2.3: + - Idle does save files with ASCII characters (closes: #179313). + - imaplib support for prefix-quoted strings (closes: #150485). + - posixpath includes getctime (closes: #173827). + - pydoc has support for keywords (closes: #186775). + * Bugs reported for 2.1 and fixed in 2.3: + - Fix handling of "#anchor" URLs in urlparse (closes: #147844). + - Fix readline if C stdin is not a tty, even if sys.stdin is. + Closes: #131810. + * Updated to CVS release23-maint 20030810 (fixing memory leaks in + array and socket modules). + * pydoc's usage output uses the basename of the script. + * Don't explicitely remove /etc/python2.3 on purge (closes: #202864). + * python conflicts with python-xmlbase (closes: #204773). + * Add dependency python (>= 2.3) to python2.3, so make sure the + unversioned names can be used. + + -- Matthias Klose Sun, 10 Aug 2003 09:27:52 +0200 + +python2.3 (2.3-3) unstable; urgency=medium + + * Fix shlibs file. + + -- Matthias Klose Fri, 8 Aug 2003 08:45:12 +0200 + +python2.3 (2.3-2) unstable; urgency=medium + + * Make python2.3 the default python version. + + -- Matthias Klose Tue, 5 Aug 2003 22:13:22 +0200 + +python2.3 (2.3-1) unstable; urgency=low + + * Python 2.3 final release. + + -- Matthias Klose Wed, 30 Jul 2003 08:12:28 +0200 + +python2.3 (2.2.107-1rc2) unstable; urgency=medium + + * Python 2.3 release candidate 2. + * Don't compress .txt files referenced by the html docs (closes: #200298). + * Include the email/_compat* files (closes: #200349). + + -- Matthias Klose Fri, 25 Jul 2003 07:08:09 +0200 + +python2.3 (2.2.106-2beta2) unstable; urgency=medium + + * Python 2.3 beta2 release, updated to CVS 20030704. + - Fixes AssertionError in httplib (closed: #192452). + - Fixes uncaught division by zero in difflib.py (closed: #199287). + * Detect presence of setgroups(2) at configure time (closes: #199839). + * Use default gcc on arm as well. + + -- Matthias Klose Sat, 5 Jul 2003 10:21:33 +0200 + +python2.3 (2.2.105-1beta2) unstable; urgency=low + + * Python 2.3 beta2 release. + - Includes merged idle fork. + - Fixed socket.setdefaulttimeout(). Closes: #189380. + - socket.ssl works with _socketobj. Closes: #196082. + * Do not link libtix to the _tkinter module. It's loaded via + 'package require tix' at runtime. python2.3-tkinter now + suggests tix8.1 instead. + * On arm, use gcc-3.2 to build. + * Add -fno-strict-aliasing rules to OPT to avoid warnings + "dereferencing type-punned pointer will break strict-aliasing rules", + when building with gcc-3.3. + + -- Matthias Klose Mon, 30 Jun 2003 00:19:32 +0200 + +python2.3 (2.2.104-1beta1.1) unstable; urgency=low + + * Non-maintainer upload with maintainer consent. + * debian/control (Build-Depends): s/libgdbmg1-dev/libgdbm-dev/. + + -- James Troup Wed, 4 Jun 2003 02:24:27 +0100 + +python2.3 (2.2.104-1beta1) unstable; urgency=low + + * Python 2.3 beta1 release, updated to CVS 20030514. + - build the current documentation. + * Reenable Tix support. + + -- Matthias Klose Wed, 14 May 2003 07:38:57 +0200 + +python2.3 (2.2.103-1beta1) unstable; urgency=low + + * Python 2.3 beta1 release, updated to CVS 20030506. + - updated due to build problems on mips/mipsel. + - keep the 2.3b1 documentation (doc build problems with cvs). + + -- Matthias Klose Wed, 7 May 2003 06:26:39 +0200 + +python2.3 (2.2.102-1beta1) unstable; urgency=low + + * Python 2.3 beta1 release. + + -- Matthias Klose Sat, 3 May 2003 22:45:16 +0200 + +python2.3 (2.2.101-1exp1) unstable; urgency=medium + + * Python 2.3 alpha2 release, updated to CVS 20030321. + * Tkinter: Catch exceptions thrown for undefined substitutions in + events (needed for tk 8.4.2). + + -- Matthias Klose Fri, 21 Mar 2003 21:32:14 +0100 + +python2.3 (2.2.100-1exp1) unstable; urgency=low + + * Python 2.3 alpha2 release, updated to CVS 20030221. + + -- Matthias Klose Fri, 21 Feb 2003 19:37:17 +0100 + +python2.3 (2.2.99-1exp1) unstable; urgency=low + + * Python 2.3 alpha1 release updated to CVS 20030123. + - should fix the testsuite (and package build) failure on alpha. + * Remove build dependency on libexpat1-dev. Merge the python2.3-xmlbase + package into python2.3 (closes: #177739). + + -- Matthias Klose Thu, 23 Jan 2003 22:48:12 +0100 + +python2.3 (2.2.98-1exp1) unstable; urgency=low + + * Python 2.3 alpha1 release updated to CVS 20030117. + * Build using libdb4.1. + + -- Matthias Klose Sat, 18 Jan 2003 00:14:01 +0100 + +python2.3 (2.2.97-1exp1) unstable; urgency=low + + * Python 2.3 alpha1 release updated to CVS 20030109. + * Build-Depend on g++ (>= 3:3.2). + * Python package maintainers: please wait uploading python dependent + packages until python2.2 and python2.1 are compiled using gcc-3.2. + + -- Matthias Klose Thu, 9 Jan 2003 23:56:42 +0100 + +python2.3 (2.2.96-1exp1) unstable; urgency=low + + * Python 2.3 alpha1 release (not exactly the tarball, but taken from + CVS 20030101). + - Includes support for linking with threaded tk8.4 (closes: #172714). + * Install and register whatsnew document (closes: #173859). + * Properly unregister info documentation. + + -- Matthias Klose Wed, 1 Jan 2003 17:38:54 +0100 + +python2.3 (2.2.95-1exp1) unstable; urgency=low + + * Experimental packages from CVS 021212. + - data in unicodedate module is up to date (closes: #171061). + * Fix idle packaging (closes: #170394). + * Configure using unicode UCS-4 (closes: #171062). + This change breaks compatibility with binary modules, but what do you + expect from experimental packages ... Please recompile dependent packages. + * Don't strip binaries for now. + + -- Matthias Klose Thu, 12 Dec 2002 21:42:27 +0100 + +python2.3 (2.2.94-1exp1) unstable; urgency=low + + * Experimental packages from CVS 021120. + * Remove outdated README.dbm. + * Depend on tk8.4. + * python-elisp: Install emacsen install file with mode 644 (closes: #167718). + + -- Matthias Klose Thu, 21 Nov 2002 01:04:51 +0100 + +python2.3 (2.2.93-1exp1) unstable; urgency=medium + + * Experimental packages from CVS 021015. + * Build a static library libpython2.3-pic.a. + * Enable large file support for the Hurd (closes: #164602). + + -- Matthias Klose Tue, 15 Oct 2002 21:06:27 +0200 + +python2.3 (2.2.92-1exp1) unstable; urgency=low + + * Experimental packages from CVS 020922. + * Fix build error on ia64 (closes: #161234). + * Build depend on gcc-3.2-3.2.1-0pre2 to fix build error on arm. + + -- Matthias Klose Sun, 22 Sep 2002 18:30:28 +0200 + +python2.3 (2.2.91-1exp1) unstable; urgency=low + + * Experimental packages from CVS 020906. + * idle-python2.3: Fix conflict (closes: #159267). + * Fix location of python-mode.el (closes: #159564, #159619). + * Use tix8.1. + * Apply fix for distutils/ccompiler problem (closes: #159288). + + -- Matthias Klose Sat, 7 Sep 2002 09:55:07 +0200 + +python2.3 (2.2.90-1exp1) unstable; urgency=low + + * Experimental packages from CVS 020820. + * Don't build python2.3-elisp, but put the latest version into + python-elisp. + + -- Matthias Klose Thu, 22 Aug 2002 21:52:04 +0200 + +python2.2 (2.2.1-6) unstable; urgency=low + + * CVS updates of the release22-maint branch upto 2002-07-23. + * Enable IPv6 support (closes: #152543). + * Add python2.2-tk suggestion for python2.2 (pydoc -g). + * Fix from SF patch #527518: proxy config with user+pass authentication. + * Point pydoc to the correct location of the docs (closes: #147579). + * Remove '*.py[co]' files, when removing the python package, + not when purging (closes: #147130). + * Update to new py2texi.el version (Milan Zamazal). + + -- Matthias Klose Mon, 29 Jul 2002 23:11:32 +0200 + +python2.2 (2.2.1-5) unstable; urgency=low + + * CVS updates of the release22-maint branch upto 2002-05-03. + * Build the info docs (closes: #145653). + + -- Matthias Klose Fri, 3 May 2002 22:35:46 +0200 + +python2.2 (2.2.1-4) unstable; urgency=high + + * Fix indentation errors introduced in last upload (closes: #143809). + + -- Matthias Klose Sun, 21 Apr 2002 01:00:14 +0200 + +python2.2 (2.2.1-3) unstable; urgency=high + + * Add Build-Conflicts: tcl8.0-dev, tk8.0-dev, tcl8.2-dev, tk8.2-dev. + Closes: #143534 (build a working _tkinter module, on machines, where + 8.0's tk.h gets included). + * CVS updates of the release22-maint branch upto 2002-04-20. + + -- Matthias Klose Sat, 20 Apr 2002 09:22:37 +0200 + +python2.2 (2.2.1-2) unstable; urgency=low + + * Forgot to copy the dlmodule patch from the 2.1.3 package. Really + closes: #141681. + + -- Matthias Klose Sat, 13 Apr 2002 01:28:05 +0200 + +python2.2 (2.2.1-1) unstable; urgency=high + + * Final 2.2.1 release. + * According to report #131813, the python interpreter is much faster on some + architectures, when beeing linked statically with the python library (25%). + Gregor and me tested on i386, m68k and alpha, but we could not reproduce + such a speedup (generally between 5% and 10%). But we are linking the + python executable now statically ... + * Build info docs from the tex source, merge the python-doc-info + package into the python-doc package. + * Always build the dl module. Failure in case of + sizeof(int)!=sizeof(long)!=sizeof(void*) + is delayed until dl.open is called. Closes: #141681. + + -- Matthias Klose Thu, 11 Apr 2002 00:19:19 +0200 + +python2.2 (2.2.0.92-0) unstable; urgency=low + + * Package CVS sources, omit cvs-updates.dpatch (closes: #140977). + + -- Matthias Klose Wed, 3 Apr 2002 08:20:52 +0200 + +python2.2 (2.2-6) unstable; urgency=medium + + * Update to python-2.2.1 release candidate 2 (final release scheduled + for April 10). + * Enable dl module (closes: #138992). + * Build doc files with python binary from package (closes: #139657). + * Build _tkinter module with BLT and Tix support. + * python2.2-elisp: Conflict with python2-elisp (closes: #138970). + * string.split docs updated in python-2.2.1 (closes: #129272). + + -- Matthias Klose Mon, 1 Apr 2002 13:52:36 +0200 + +python2.2 (2.2-5) unstable; urgency=low + + * CVS updates of the release22-maint branch upto 20020310 (aproaching + the first 2.2.1 release candidate). + * Stolen from HEAD: check argument of locale.nl_langinfo (closes: #137371). + + -- Matthias Klose Fri, 15 Mar 2002 01:05:59 +0100 + +python2.2 (2.2-4) unstable; urgency=medium + + * Include test/{__init__.py,README,pystone.py} in package (closes: #129013). + * Fix python-elisp conflict (closes: #129046). + * Don't compress stylesheets (closes: #133179). + * CVS updates of the release22-maint branch upto 20020310. + + -- Matthias Klose Sun, 10 Mar 2002 23:32:28 +0100 + +python2.2 (2.2-3) unstable; urgency=medium + + * Updates from the CVS python22-maint branch up to 20020107. + webbrowser.py: properly escape url's. + * The Hurd does not have large file support: disabled. + + -- Matthias Klose Mon, 7 Jan 2002 21:55:57 +0100 + +python2.2 (2.2-2) unstable; urgency=medium + + * CVS updates of the release22-maint branch upto 20011229. Fixes: + - Include TCP_CORK flag in plat-linux2 headers (fixes: #84340). + - Update CDROM.py module (fixes: #125785). + * Add missing chunk of the GNU/Hurd patch (therefore urgency medium). + * Send anonymous password when using anonftp (closes: #126814). + + -- Matthias Klose Sat, 29 Dec 2001 20:18:26 +0100 + +python2.2 (2.2-1) unstable; urgency=low + + * New upstream version: 2.2. + * Bugs fixed upstream: + - Docs for os.kill reference the signal module for constants. + - Documentation strings in the tutorial end with a period (closes: #94770). + - Tk: grid_location method moved from Grid to Misc (closes: #98338). + - mhlib.SubMessage.getbodytext takes decode parameter (closes: #31876). + - Strings in modules are locale aware (closes: #51444). + - Printable 8-bit characters in strings are correctly printed + (closes: #64354). + - Dictionary can be updated with abstract mapping object (closes: #46566). + * Make site.py a config files. + + -- Matthias Klose Sat, 22 Dec 2001 00:51:46 +0100 + +python2.2 (2.1.99c1-1) unstable; urgency=low + + * New upstream version: 2.2c1 (release candidate). + * Do not provide python2.2-base anymore. + * Install correct README.Debian for python2.2 package. Include hint + where to find Makefile.pre.in. + * Suggest installation of python-ssl. + * Remove idle config files on purge. + * Remove empty /usr/lib/python2.2 directory on purge. + + -- Matthias Klose Sat, 15 Dec 2001 17:56:27 +0100 + +python2.2 (2.1.99beta2-1) unstable; urgency=high + + * debian/rules: Reflect removal of regrtest package (closes: #122278). + Resulted in build failures on all architectures. + * Build -doc package from source. + + -- Matthias Klose Sat, 8 Dec 2001 00:38:41 +0100 + +python2.2 (2.1.99beta2-0.1) unstable; urgency=low + + * Non maintainer upload. + * New upstream version (this is 2.2beta2). + * Do not build the python-regrtest package anymore; keep the test framework + components test/regrtest.py and test/test_support.py in the python + package (closes: #119408). + + -- Gregor Hoffleit Tue, 27 Nov 2001 09:53:26 +0100 + +python2.2 (2.1.99beta1-4) unstable; urgency=low + + * Configure with --with-fpectl (closes: #118125). + * setup.py: Remove broken check for _curses_panel module (#116081). + * idle: Move config-* files to /etc and mark as conffiles (#106390). + * Move idle packages to section `devel'. + + -- Matthias Klose Wed, 31 Oct 2001 10:56:45 +0100 + +python2.2 (2.1.99beta1-3) unstable; urgency=low + + * Fix shlibs file (was still referring to 2.1). Closes: #116810. + * README.Debian: point to draft of python-policy in the python package. + + -- Matthias Klose Wed, 31 Oct 2001 10:56:45 +0100 + +python2.2 (2.1.99beta1-2) unstable; urgency=medium + + * Fix shlibs file (was still referring to 2.1). Closes: #116810. + * Rename package python2.2-base to python2.2. + + -- Matthias Klose Wed, 24 Oct 2001 23:00:50 +0200 + +python2.2 (2.1.99beta1-1) unstable; urgency=low + + * New upstream version (beta). Call the package version 2.1.99beta1-1. + * New maintainer until the final 2.2 release. + * Updated the debian patches. + + -- Matthias Klose Sat, 20 Oct 2001 18:56:26 +0200 + +python2.1 (2.1.1-1.2) unstable; urgency=low + + * Really remove the python alternative. + + -- Matthias Klose Sat, 20 Oct 2001 15:16:56 +0200 + +python2.1 (2.1.1-1.1) unstable; urgency=low + + * README FOR PACKAGE MAINTAINERS: It is planned to remove the python2-XXX + packages from unstable and move on to python2.1. + If you repackage/adapt your modules for python2.1, don't build + python2-XXX and python2.1-XXX packages from the same source package, + so that the python2-XXX package can be removed without influencing the + python2.1-XXX package. + + See the debian-python mailing list at http://lists.debian.org/devel.html + for details and the current discussion and a draft for a debian-python + policy (August to October 2001). + + * Remove alternative for /usr/bin/python. The python-base package now + provides the default python version. + + * Regenerate control file to fix build dependencies (closes: #116190). + * Remove alternative for /usr/bin/{python,pydoc}. + * Provide a libpython2.1.so symlink in /usr/lib/python2.1/config, + so that the shared library is found when -L/usr/lib/python2.1/config + is specified. + * Conflict with old package versions, where /usr/bin/python is a real + program (closes: #115943). + * python2.1-elisp conflicts with python-elisp (closes: #115895). + * We now have 2.1 (closes: #96851, #107849, #110243). + + -- Matthias Klose Fri, 19 Oct 2001 17:34:41 +0200 + +python2.1 (2.1.1-1) unstable; urgency=low + + * Incorporated Matthias' modifications. + + -- Gregor Hoffleit Thu, 11 Oct 2001 00:16:42 +0200 + +python2.1 (2.1.1-0.2) unstable; urgency=low + + * New upstream 2.1.1. + * GPL compatible licence (fixes #84080, #102949, #110643). + * Fixed upstream (closes: #99692, #111340). + * Build in separate build directory. + * Split Debian patches into debian/patches directory. + * Build dependencies: Add libgmp3-dev, libexpat1-dev, tighten + debhelper dependency. + * debian/rules: Updated a "bit". + * python-elisp: Remove custom dependency (closes: #87783), + fix emacs path (closes: #89712), remove emacs19 dependency (#82694). + * Mention distutils in python-dev package description (closes: #108170). + * Update README.Debian (closes: #85430). + * Run versioned python in postinsts (closes: #113349). + * debian/sample.{postinst,prerm}: Change to version independent scripts. + * Use '/usr/bin/env python2.1' as interpreter for all python scripts. + * Add libssl-dev to Build-Conflicts. + * python-elisp: Add support for emacs21 (closes: #98635). + * Do not compress .py files in doc directories. + * Don't link explicitely with libc. + + -- Matthias Klose Wed, 3 Oct 2001 09:53:08 +0200 + +python2.1 (2.1.1-0.1) unstable; urgency=low + + * New upstream version (CVS branch release21-maint, will become 2.1.1): + This CVS branch will be released as 2.1.1 under a GPL compatible + license. + + -- Gregor Hoffleit Wed, 27 Jun 2001 22:47:58 +0200 + +python2 (2.1-0.1) unstable; urgency=low + + * Fixed Makefile.pre.in. + * Fixed the postinst files in order to use 2.1 (instead of 2.0). + * Mention the immanent release of 2.0.1 and 2.1.1, with a GPL + compatible license. + + -- Gregor Hoffleit Sun, 17 Jun 2001 21:05:25 +0200 + +python2 (2.1-0) unstable; urgency=low + + * New upstream version. + * Experimental packages. + + -- Gregor Hoffleit Thu, 10 May 2001 00:20:04 +0200 + +python2 (2.0-7) unstable; urgency=low + + * Rebuilt with recent tcl8.3-dev/tk8.3-dev in order to fix a + dependency problem with python2-tk (closes: #87793, #92962). + * Change postinst to create and update /usr/local/lib/python2.0 and + site-python with permissions and owner as mandated by policy: + 2775 and root:staff (closes: #89047). + * Fix to compileall.py: A superfluous argument made compileall without + options fail (cf. #92990 for python). + * Move the distutils module into python2-dev. It needs Makefile.pre.in + in order to work (closes: #89900). + * Remove build-dependency on libgdbm2-dev (which isn't built anyway). + * Add a build-dependency on libdb2-dev (cf. #90220 for python). + + -- Gregor Hoffleit Sat, 14 Apr 2001 21:07:51 +0200 + +python2 (2.0-6) unstable; urgency=low + + * Remove python-zlib package; merge it into python-base. + * Mark that README.python2 is not yet updated. + + -- Gregor Hoffleit Wed, 21 Feb 2001 12:34:18 +0100 + +python2 (2.0-5) unstable; urgency=low + + * Recompile with tcl/tk8.3 (closes: #82088). + * Modifications to README.why-python2 (closes: #82116). + * Add menu hint to idle2 menu entry. + * idle2 is renamed idle-python2 and now build correctly (closes: #82218). + * Add build-dependency on autoconf (closes: #85339). + * Build bsddbmodule as shared module (Modules/Setup.config.in), + and link libpython2.so with -lm in Makefile (closes: #86027). + * various cleanups in debian/rules, e.g. removing dh_suidregister. + * Make pdb available as /usr/bin/pdb-python2 in python2-dev + (cf. #79870 in python-base). + * Remove libgmp3 from build-dependencies, since we currently can't + build the mpzmodule for Python2 due to license problems. + + -- Gregor Hoffleit Sun, 18 Feb 2001 00:12:17 +0100 + +python2 (2.0-4) unstable; urgency=low + + * control: make python2-elisp conflict with python-elisp (it doesn't + make sense to have both of them installed, does it ?) + * include build-depend on libxmltok1-dev. + * again, build with tcl/tk8.0. + + -- Gregor Hoffleit Wed, 10 Jan 2001 23:37:01 +0100 + +python2 (2.0-3) unstable; urgency=low + + * Modules/Setup.in: Added a missing \ that made _tkinter be built + incorrectly. + * rules: on the fly, change all '#!' python scripts to use python2. + + -- Gregor Hoffleit Wed, 13 Dec 2000 20:07:24 +0100 + +python2 (2.0-2) unstable; urgency=low + + * Aaargh. Remove conflicts/provides/replaces on python-base to make + parallel installation of python-base and python2-base possible. + * Install examples into /usr/share/doc/python2 (not python) and fix + symlink to python2.0 (thanks to Rick Younie for + pointing out this). + * Rename man page to python2.1. + + -- Gregor Hoffleit Wed, 13 Dec 2000 09:31:05 +0100 + +python2 (2.0-1) unstable; urgency=low + + * New upstream version. Initial release for python2. + + -- Gregor Hoffleit Mon, 11 Dec 2000 22:39:46 +0100 --- python3.4-3.4~b1.orig/debian/changelog.shared +++ python3.4-3.4~b1/debian/changelog.shared @@ -0,0 +1,3 @@ + * Link the interpreter against the shared runtime library. With + gcc-4.1 the difference in the pystones benchmark dropped from about + 12% to about 5%. --- python3.4-3.4~b1.orig/debian/compat +++ python3.4-3.4~b1/debian/compat @@ -0,0 +1 @@ +5 --- python3.4-3.4~b1.orig/debian/control +++ python3.4-3.4~b1/debian/control @@ -0,0 +1,201 @@ +Source: python3.4 +Section: python +Priority: optional +Maintainer: Ubuntu Core Developers +XSBC-Original-Maintainer: Matthias Klose +Build-Depends: debhelper (>= 5.0.51~), quilt, autoconf, lsb-release, sharutils, + libreadline6-dev, libncursesw5-dev (>= 5.3), + zlib1g-dev, libbz2-dev, liblzma-dev, + libgdbm-dev, libdb-dev, + tk-dev, blt-dev (>= 2.4z), libssl-dev, + libexpat1-dev, + libbluetooth-dev [!hurd-i386 !kfreebsd-i386 !kfreebsd-amd64], + locales [!armel !avr32 !hppa !ia64 !mipsel], + libsqlite3-dev, libffi-dev (>= 3.0.5), + libgpm2 [!hurd-i386 !kfreebsd-i386 !kfreebsd-amd64], + mime-support, netbase, bzip2, python3:any, + gcc (>= 4:4.8) [amd64 armel armhf i386 x32 kfreebsd-any hurd-any], + net-tools, xvfb, xauth +Build-Depends-Indep: python-sphinx +Standards-Version: 3.9.5 +Vcs-Browser: https://code.launchpad.net/~doko/python/pkg3.4-debian +Vcs-Bzr: http://bazaar.launchpad.net/~doko/python/pkg3.4-debian +XS-Testsuite: autopkgtest + +Package: python3.4 +Architecture: any +Multi-Arch: allowed +Priority: optional +Depends: python3.4-minimal (= ${binary:Version}), libpython3.4-stdlib (= ${binary:Version}), mime-support, ${shlibs:Depends}, ${misc:Depends} +Suggests: python3.4-doc, binutils +Description: Interactive high-level object-oriented language (version 3.4) + Python is a high-level, interactive, object-oriented language. Its 3.4 version + includes an extensive class library with lots of goodies for + network programming, system administration, sounds and graphics. + +Package: libpython3.4-stdlib +Architecture: any +Multi-Arch: same +Priority: optional +Pre-Depends: multiarch-support +Depends: libpython3.4-minimal (= ${binary:Version}), mime-support, ${shlibs:Depends}, ${misc:Depends} +Description: Interactive high-level object-oriented language (standard library, version 3.4) + Python is a high-level, interactive, object-oriented language. Its 3.4 version + includes an extensive class library with lots of goodies for + network programming, system administration, sounds and graphics. + . + This package contains Python 3.4's standard library. It is normally not + used on its own, but as a dependency of python3.4. + +Package: python3.4-minimal +Architecture: any +Multi-Arch: allowed +Priority: optional +Pre-Depends: ${shlibs:Pre-Depends} +Depends: libpython3.4-minimal (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} +Recommends: python3.4 +Suggests: binfmt-support +Conflicts: binfmt-support (<< 1.1.2) +Description: Minimal subset of the Python language (version 3.4) + This package contains the interpreter and some essential modules. It can + be used in the boot process for some basic tasks. + See /usr/share/doc/python3.4-minimal/README.Debian for a list of the modules + contained in this package. + +Package: libpython3.4-minimal +Architecture: any +Multi-Arch: same +Priority: optional +Pre-Depends: multiarch-support +Depends: ${shlibs:Depends}, ${misc:Depends} +Recommends: libpython3.4-stdlib +Conflicts: binfmt-support (<< 1.1.2) +Replaces: libpython3.4-stdlib (<< 3.4~b1-5) +Description: Minimal subset of the Python language (version 3.4) + This package contains some essential modules. It is normally not + used on it's own, but as a dependency of python3.4-minimal. + +Package: libpython3.4 +Architecture: any +Multi-Arch: same +Section: libs +Priority: optional +Pre-Depends: multiarch-support +Depends: libpython3.4-stdlib (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} +Description: Shared Python runtime library (version 3.4) + Python is a high-level, interactive, object-oriented language. Its 3.4 version + includes an extensive class library with lots of goodies for + network programming, system administration, sounds and graphics. + . + This package contains the shared runtime library, normally not needed + for programs using the statically linked interpreter. + +Package: python3.4-examples +Architecture: all +Depends: python3.4 (>= ${source:Version}), ${misc:Depends} +Description: Examples for the Python language (v3.4) + Examples, Demos and Tools for Python (v3.4). These are files included in + the upstream Python distribution (v3.4). + +Package: python3.4-dev +Architecture: any +Multi-Arch: allowed +Depends: python3.4 (= ${binary:Version}), libpython3.4-dev (= ${binary:Version}), libpython3.4 (= ${binary:Version}), libexpat1-dev, ${shlibs:Depends}, ${misc:Depends} +Recommends: libc6-dev | libc-dev +Description: Header files and a static library for Python (v3.4) + Header files, a static library and development tools for building + Python (v3.4) modules, extending the Python interpreter or embedding + Python (v3.4) in applications. + . + Maintainers of Python packages should read README.maintainers. + +Package: libpython3.4-dev +Section: libdevel +Architecture: any +Multi-Arch: same +Pre-Depends: multiarch-support +Depends: libpython3.4-stdlib (= ${binary:Version}), libpython3.4 (= ${binary:Version}), libexpat1-dev, ${shlibs:Depends}, ${misc:Depends} +Recommends: libc6-dev | libc-dev +Description: Header files and a static library for Python (v3.4) + Header files, a static library and development tools for building + Python (v3.4) modules, extending the Python interpreter or embedding + Python (v3.4) in applications. + . + Maintainers of Python packages should read README.maintainers. + . + This package contains development files. It is normally not + used on it's own, but as a dependency of python3.4-dev. + +Package: libpython3.4-testsuite +Section: libdevel +Architecture: all +Depends: libpython3.4-stdlib (>= ${binary:Version}), ${misc:Depends}, net-tools +Suggests: python3-gdbm, python3-tk +Description: Testsuite for the Python standard library (v3.4) + The complete testsuite for the Python standard library. Note that + a subset is found in the libpython3.4-stdlib package, which should + be enough for other packages to use (please do not build-depend + on this package, but file a bug report to include additional + testsuite files in the libpython3.4-stdlib package). + +Package: idle-python3.4 +Architecture: all +Depends: python3.4, python3-tk, python3.4-tk, ${misc:Depends} +Enhances: python3.4 +Description: IDE for Python (v3.4) using Tkinter + IDLE is an Integrated Development Environment for Python (v3.4). + IDLE is written using Tkinter and therefore quite platform-independent. + +Package: python3.4-doc +Section: doc +Architecture: all +Depends: libjs-jquery, libjs-underscore, ${misc:Depends} +Suggests: python3.4 +Description: Documentation for the high-level object-oriented language Python (v3.4) + These is the official set of documentation for the interactive high-level + object-oriented language Python (v3.4). All documents are provided + in HTML format. The package consists of ten documents: + . + * What's New in Python3.4 + * Tutorial + * Python Library Reference + * Macintosh Module Reference + * Python Language Reference + * Extending and Embedding Python + * Python/C API Reference + * Installing Python Modules + * Documenting Python + * Distributing Python Modules + +Package: python3.4-dbg +Section: debug +Architecture: any +Multi-Arch: allowed +Priority: extra +Depends: python3.4 (= ${binary:Version}), libpython3.4-dbg (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} +Recommends: gdb +Suggests: python3-gdbm-dbg, python3-tk-dbg +Description: Debug Build of the Python Interpreter (version 3.4) + The package holds two things: + . + - A Python interpreter configured with --pydebug. Dynamically loaded modules + are searched as _d.so first. Third party extensions need a separate + build to be used by this interpreter. + - Debug information for standard python interpreter and extensions. + . + See the README.debug for more information. + +Package: libpython3.4-dbg +Section: debug +Architecture: any +Multi-Arch: same +Priority: extra +Pre-Depends: multiarch-support +Depends: libpython3.4-stdlib (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} +Description: Debug Build of the Python Interpreter (version 3.4) + The package holds two things: + . + - Extensions for a Python interpreter configured with --pydebug. + - Debug information for standard python extensions. + . + See the README.debug for more information. --- python3.4-3.4~b1.orig/debian/control.in +++ python3.4-3.4~b1/debian/control.in @@ -0,0 +1,200 @@ +Source: @PVER@ +Section: python +Priority: optional +Maintainer: Matthias Klose +Build-Depends: debhelper (>= 5.0.51~), quilt, autoconf, lsb-release, sharutils, + libreadline6-dev, libncursesw5-dev (>= 5.3), + zlib1g-dev, libbz2-dev, liblzma-dev, + libgdbm-dev, libdb-dev, + tk-dev, blt-dev (>= 2.4z), libssl-dev, + libexpat1-dev, + libbluetooth-dev [!hurd-i386 !kfreebsd-i386 !kfreebsd-amd64], + locales [!armel !avr32 !hppa !ia64 !mipsel], + libsqlite3-dev, libffi-dev (>= 3.0.5), + libgpm2 [!hurd-i386 !kfreebsd-i386 !kfreebsd-amd64], + mime-support, netbase, bzip2, python3@bd_qual@, + gcc (>= 4:4.8) [amd64 armel armhf i386 x32 kfreebsd-any hurd-any], + net-tools, xvfb, xauth +Build-Depends-Indep: python-sphinx +Standards-Version: 3.9.5 +Vcs-Browser: https://code.launchpad.net/~doko/python/pkg@VER@-debian +Vcs-Bzr: http://bazaar.launchpad.net/~doko/python/pkg@VER@-debian +XS-Testsuite: autopkgtest + +Package: @PVER@ +Architecture: any +Multi-Arch: allowed +Priority: @PRIO@ +Depends: @PVER@-minimal (= ${binary:Version}), lib@PVER@-stdlib (= ${binary:Version}), mime-support, ${shlibs:Depends}, ${misc:Depends} +Suggests: @PVER@-doc, binutils +Description: Interactive high-level object-oriented language (version @VER@) + Python is a high-level, interactive, object-oriented language. Its @VER@ version + includes an extensive class library with lots of goodies for + network programming, system administration, sounds and graphics. + +Package: lib@PVER@-stdlib +Architecture: any +Multi-Arch: same +Priority: @PRIO@ +Pre-Depends: multiarch-support +Depends: lib@PVER@-minimal (= ${binary:Version}), mime-support, ${shlibs:Depends}, ${misc:Depends} +Description: Interactive high-level object-oriented language (standard library, version @VER@) + Python is a high-level, interactive, object-oriented language. Its @VER@ version + includes an extensive class library with lots of goodies for + network programming, system administration, sounds and graphics. + . + This package contains Python @VER@'s standard library. It is normally not + used on its own, but as a dependency of python@VER@. + +Package: @PVER@-minimal +Architecture: any +Multi-Arch: allowed +Priority: @MINPRIO@ +Pre-Depends: ${shlibs:Pre-Depends} +Depends: lib@PVER@-minimal (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} +Recommends: @PVER@ +Suggests: binfmt-support +Conflicts: binfmt-support (<< 1.1.2) +Description: Minimal subset of the Python language (version @VER@) + This package contains the interpreter and some essential modules. It can + be used in the boot process for some basic tasks. + See /usr/share/doc/@PVER@-minimal/README.Debian for a list of the modules + contained in this package. + +Package: lib@PVER@-minimal +Architecture: any +Multi-Arch: same +Priority: @MINPRIO@ +Pre-Depends: multiarch-support +Depends: ${shlibs:Depends}, ${misc:Depends} +Recommends: lib@PVER@-stdlib +Conflicts: binfmt-support (<< 1.1.2) +Replaces: libpython3.4-stdlib (<< 3.4~b1-5) +Description: Minimal subset of the Python language (version @VER@) + This package contains some essential modules. It is normally not + used on it's own, but as a dependency of @PVER@-minimal. + +Package: lib@PVER@ +Architecture: any +Multi-Arch: same +Section: libs +Priority: @PRIO@ +Pre-Depends: multiarch-support +Depends: lib@PVER@-stdlib (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} +Description: Shared Python runtime library (version @VER@) + Python is a high-level, interactive, object-oriented language. Its @VER@ version + includes an extensive class library with lots of goodies for + network programming, system administration, sounds and graphics. + . + This package contains the shared runtime library, normally not needed + for programs using the statically linked interpreter. + +Package: @PVER@-examples +Architecture: all +Depends: @PVER@ (>= ${source:Version}), ${misc:Depends} +Description: Examples for the Python language (v@VER@) + Examples, Demos and Tools for Python (v@VER@). These are files included in + the upstream Python distribution (v@VER@). + +Package: @PVER@-dev +Architecture: any +Multi-Arch: allowed +Depends: @PVER@ (= ${binary:Version}), lib@PVER@-dev (= ${binary:Version}), lib@PVER@ (= ${binary:Version}), libexpat1-dev, ${shlibs:Depends}, ${misc:Depends} +Recommends: libc6-dev | libc-dev +Description: Header files and a static library for Python (v@VER@) + Header files, a static library and development tools for building + Python (v@VER@) modules, extending the Python interpreter or embedding + Python (v@VER@) in applications. + . + Maintainers of Python packages should read README.maintainers. + +Package: lib@PVER@-dev +Section: libdevel +Architecture: any +Multi-Arch: same +Pre-Depends: multiarch-support +Depends: lib@PVER@-stdlib (= ${binary:Version}), lib@PVER@ (= ${binary:Version}), libexpat1-dev, ${shlibs:Depends}, ${misc:Depends} +Recommends: libc6-dev | libc-dev +Description: Header files and a static library for Python (v@VER@) + Header files, a static library and development tools for building + Python (v@VER@) modules, extending the Python interpreter or embedding + Python (v@VER@) in applications. + . + Maintainers of Python packages should read README.maintainers. + . + This package contains development files. It is normally not + used on it's own, but as a dependency of @PVER@-dev. + +Package: lib@PVER@-testsuite +Section: libdevel +Architecture: all +Depends: lib@PVER@-stdlib (>= ${binary:Version}), ${misc:Depends}, net-tools +Suggests: python3-gdbm, python3-tk +Description: Testsuite for the Python standard library (v@VER@) + The complete testsuite for the Python standard library. Note that + a subset is found in the lib@PVER@-stdlib package, which should + be enough for other packages to use (please do not build-depend + on this package, but file a bug report to include additional + testsuite files in the lib@PVER@-stdlib package). + +Package: idle-@PVER@ +Architecture: all +Depends: @PVER@, python3-tk, @PVER@-tk, ${misc:Depends} +Enhances: @PVER@ +Description: IDE for Python (v@VER@) using Tkinter + IDLE is an Integrated Development Environment for Python (v@VER@). + IDLE is written using Tkinter and therefore quite platform-independent. + +Package: @PVER@-doc +Section: doc +Architecture: all +Depends: libjs-jquery, libjs-underscore, ${misc:Depends} +Suggests: @PVER@ +Description: Documentation for the high-level object-oriented language Python (v@VER@) + These is the official set of documentation for the interactive high-level + object-oriented language Python (v@VER@). All documents are provided + in HTML format. The package consists of ten documents: + . + * What's New in Python@VER@ + * Tutorial + * Python Library Reference + * Macintosh Module Reference + * Python Language Reference + * Extending and Embedding Python + * Python/C API Reference + * Installing Python Modules + * Documenting Python + * Distributing Python Modules + +Package: @PVER@-dbg +Section: debug +Architecture: any +Multi-Arch: allowed +Priority: extra +Depends: @PVER@ (= ${binary:Version}), lib@PVER@-dbg (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} +Recommends: gdb +Suggests: python3-gdbm-dbg, python3-tk-dbg +Description: Debug Build of the Python Interpreter (version @VER@) + The package holds two things: + . + - A Python interpreter configured with --pydebug. Dynamically loaded modules + are searched as _d.so first. Third party extensions need a separate + build to be used by this interpreter. + - Debug information for standard python interpreter and extensions. + . + See the README.debug for more information. + +Package: lib@PVER@-dbg +Section: debug +Architecture: any +Multi-Arch: same +Priority: extra +Pre-Depends: multiarch-support +Depends: lib@PVER@-stdlib (= ${binary:Version}), ${shlibs:Depends}, ${misc:Depends} +Description: Debug Build of the Python Interpreter (version @VER@) + The package holds two things: + . + - Extensions for a Python interpreter configured with --pydebug. + - Debug information for standard python extensions. + . + See the README.debug for more information. --- python3.4-3.4~b1.orig/debian/control.stdlib +++ python3.4-3.4~b1/debian/control.stdlib @@ -0,0 +1,16 @@ +Package: @PVER@-tk +Architecture: any +Depends: @PVER@ (= ${Source-Version}), ${shlibs:Depends} +Suggests: tix +XB-Python-Version: @VER@ +Description: Tkinter - Writing Tk applications with Python (v@VER@) + A module for writing portable GUI applications with Python (v@VER@) using Tk. + Also known as Tkinter. + +Package: @PVER@-gdbm +Architecture: any +Depends: @PVER@ (= ${Source-Version}), ${shlibs:Depends} +Description: GNU dbm database support for Python (v@VER@) + GNU dbm database module for Python. Install this if you want to + create or read GNU dbm database files with Python. + --- python3.4-3.4~b1.orig/debian/control.udeb +++ python3.4-3.4~b1/debian/control.udeb @@ -0,0 +1,11 @@ + +Package: @PVER@-udeb +XC-Package-Type: udeb +Section: debian-installer +Architecture: any +Depends: ${shlibs:Depends}, ${misc:Depends} +XB-Python-Runtime: @PVER@ +XB-Python-Version: @VER@ +Description: A minimal subset of the Python language (version @VER@) + This package contains the interpreter and some essential modules, packaged + for use in the installer. --- python3.4-3.4~b1.orig/debian/copyright +++ python3.4-3.4~b1/debian/copyright @@ -0,0 +1,1027 @@ +This package was put together by Klee Dienes from +sources from ftp.python.org:/pub/python, based on the Debianization by +the previous maintainers Bernd S. Brentrup and +Bruce Perens. Current maintainer is Matthias Klose . + +It was downloaded from http://python.org/ + +Copyright: + +Upstream Author: Guido van Rossum and others. + +License: + +The following text includes the Python license and licenses and +acknowledgements for incorporated software. The licenses can be read +in the HTML and texinfo versions of the documentation as well, after +installing the pythonx.y-doc package. Licenses for files not licensed +under the Python Licenses are found at the end of this file. + + +Python License +============== + +A. HISTORY OF THE SOFTWARE +========================== + +Python was created in the early 1990s by Guido van Rossum at Stichting +Mathematisch Centrum (CWI, see http://www.cwi.nl) in the Netherlands +as a successor of a language called ABC. Guido remains Python's +principal author, although it includes many contributions from others. + +In 1995, Guido continued his work on Python at the Corporation for +National Research Initiatives (CNRI, see http://www.cnri.reston.va.us) +in Reston, Virginia where he released several versions of the +software. + +In May 2000, Guido and the Python core development team moved to +BeOpen.com to form the BeOpen PythonLabs team. In October of the same +year, the PythonLabs team moved to Digital Creations (now Zope +Corporation, see http://www.zope.com). In 2001, the Python Software +Foundation (PSF, see http://www.python.org/psf/) was formed, a +non-profit organization created specifically to own Python-related +Intellectual Property. Zope Corporation is a sponsoring member of +the PSF. + +All Python releases are Open Source (see http://www.opensource.org for +the Open Source Definition). Historically, most, but not all, Python +releases have also been GPL-compatible; the table below summarizes +the various releases. + + Release Derived Year Owner GPL- + from compatible? (1) + + 0.9.0 thru 1.2 1991-1995 CWI yes + 1.3 thru 1.5.2 1.2 1995-1999 CNRI yes + 1.6 1.5.2 2000 CNRI no + 2.0 1.6 2000 BeOpen.com no + 1.6.1 1.6 2001 CNRI yes (2) + 2.1 2.0+1.6.1 2001 PSF no + 2.0.1 2.0+1.6.1 2001 PSF yes + 2.1.1 2.1+2.0.1 2001 PSF yes + 2.2 2.1.1 2001 PSF yes + 2.1.2 2.1.1 2002 PSF yes + 2.1.3 2.1.2 2002 PSF yes + 2.2.1 2.2 2002 PSF yes + 2.2.2 2.2.1 2002 PSF yes + 2.2.3 2.2.2 2003 PSF yes + 2.3 2.2.2 2002-2003 PSF yes + 2.3.1 2.3 2002-2003 PSF yes + 2.3.2 2.3.1 2002-2003 PSF yes + 2.3.3 2.3.2 2002-2003 PSF yes + 2.3.4 2.3.3 2004 PSF yes + 2.3.5 2.3.4 2005 PSF yes + 2.4 2.3 2004 PSF yes + 2.4.1 2.4 2005 PSF yes + 2.4.2 2.4.1 2005 PSF yes + 2.4.3 2.4.2 2006 PSF yes + 2.5 2.4 2006 PSF yes + 2.5.1 2.5 2007 PSF yes + 2.5.2 2.5.1 2008 PSF yes + 2.5.3 2.5.2 2008 PSF yes + 2.6 2.5 2008 PSF yes + 2.6.1 2.6 2008 PSF yes + 2.6.2 2.6.1 2009 PSF yes + 2.6.3 2.6.2 2009 PSF yes + 2.6.4 2.6.3 2009 PSF yes + 2.6.5 2.6.4 2010 PSF yes + 3.0 2.6 2008 PSF yes + 3.0.1 3.0 2009 PSF yes + 3.1 3.0.1 2009 PSF yes + 3.1.1 3.1 2009 PSF yes + 3.1.2 3.1.1 2010 PSF yes + 3.1.3 3.1.2 2010 PSF yes + 3.1.4 3.1.3 2011 PSF yes + 3.2 3.1 2011 PSF yes + 3.2.1 3.2 2011 PSF yes + 3.2.2 3.2.1 2011 PSF yes + 3.3 3.2 2012 PSF yes + +Footnotes: + +(1) GPL-compatible doesn't mean that we're distributing Python under + the GPL. All Python licenses, unlike the GPL, let you distribute + a modified version without making your changes open source. The + GPL-compatible licenses make it possible to combine Python with + other software that is released under the GPL; the others don't. + +(2) According to Richard Stallman, 1.6.1 is not GPL-compatible, + because its license has a choice of law clause. According to + CNRI, however, Stallman's lawyer has told CNRI's lawyer that 1.6.1 + is "not incompatible" with the GPL. + +Thanks to the many outside volunteers who have worked under Guido's +direction to make these releases possible. + + +B. TERMS AND CONDITIONS FOR ACCESSING OR OTHERWISE USING PYTHON +=============================================================== + +PYTHON SOFTWARE FOUNDATION LICENSE VERSION 2 +-------------------------------------------- + +1. This LICENSE AGREEMENT is between the Python Software Foundation +("PSF"), and the Individual or Organization ("Licensee") accessing and +otherwise using this software ("Python") in source or binary form and +its associated documentation. + +2. Subject to the terms and conditions of this License Agreement, PSF +hereby grants Licensee a nonexclusive, royalty-free, world-wide +license to reproduce, analyze, test, perform and/or display publicly, +prepare derivative works, distribute, and otherwise use Python +alone or in any derivative version, provided, however, that PSF's +License Agreement and PSF's notice of copyright, i.e., "Copyright (c) +2001, 2002, 2003, 2004, 2005, 2006, 2007 Python Software Foundation; +All Rights Reserved" are retained in Python alone or in any derivative +version prepared by Licensee. + +3. In the event Licensee prepares a derivative work that is based on +or incorporates Python or any part thereof, and wants to make +the derivative work available to others as provided herein, then +Licensee hereby agrees to include in any such work a brief summary of +the changes made to Python. + +4. PSF is making Python available to Licensee on an "AS IS" +basis. PSF MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, PSF MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +5. PSF SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON +FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS +A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON, +OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +6. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +7. Nothing in this License Agreement shall be deemed to create any +relationship of agency, partnership, or joint venture between PSF and +Licensee. This License Agreement does not grant permission to use PSF +trademarks or trade name in a trademark sense to endorse or promote +products or services of Licensee, or any third party. + +8. By copying, installing or otherwise using Python, Licensee +agrees to be bound by the terms and conditions of this License +Agreement. + + +BEOPEN.COM LICENSE AGREEMENT FOR PYTHON 2.0 +------------------------------------------- + +BEOPEN PYTHON OPEN SOURCE LICENSE AGREEMENT VERSION 1 + +1. This LICENSE AGREEMENT is between BeOpen.com ("BeOpen"), having an +office at 160 Saratoga Avenue, Santa Clara, CA 95051, and the +Individual or Organization ("Licensee") accessing and otherwise using +this software in source or binary form and its associated +documentation ("the Software"). + +2. Subject to the terms and conditions of this BeOpen Python License +Agreement, BeOpen hereby grants Licensee a non-exclusive, +royalty-free, world-wide license to reproduce, analyze, test, perform +and/or display publicly, prepare derivative works, distribute, and +otherwise use the Software alone or in any derivative version, +provided, however, that the BeOpen Python License is retained in the +Software, alone or in any derivative version prepared by Licensee. + +3. BeOpen is making the Software available to Licensee on an "AS IS" +basis. BEOPEN MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, BEOPEN MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +4. BEOPEN SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF THE +SOFTWARE FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS +AS A RESULT OF USING, MODIFYING OR DISTRIBUTING THE SOFTWARE, OR ANY +DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +5. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +6. This License Agreement shall be governed by and interpreted in all +respects by the law of the State of California, excluding conflict of +law provisions. Nothing in this License Agreement shall be deemed to +create any relationship of agency, partnership, or joint venture +between BeOpen and Licensee. This License Agreement does not grant +permission to use BeOpen trademarks or trade names in a trademark +sense to endorse or promote products or services of Licensee, or any +third party. As an exception, the "BeOpen Python" logos available at +http://www.pythonlabs.com/logos.html may be used according to the +permissions granted on that web page. + +7. By copying, installing or otherwise using the software, Licensee +agrees to be bound by the terms and conditions of this License +Agreement. + + +CNRI LICENSE AGREEMENT FOR PYTHON 1.6.1 +--------------------------------------- + +1. This LICENSE AGREEMENT is between the Corporation for National +Research Initiatives, having an office at 1895 Preston White Drive, +Reston, VA 20191 ("CNRI"), and the Individual or Organization +("Licensee") accessing and otherwise using Python 1.6.1 software in +source or binary form and its associated documentation. + +2. Subject to the terms and conditions of this License Agreement, CNRI +hereby grants Licensee a nonexclusive, royalty-free, world-wide +license to reproduce, analyze, test, perform and/or display publicly, +prepare derivative works, distribute, and otherwise use Python 1.6.1 +alone or in any derivative version, provided, however, that CNRI's +License Agreement and CNRI's notice of copyright, i.e., "Copyright (c) +1995-2001 Corporation for National Research Initiatives; All Rights +Reserved" are retained in Python 1.6.1 alone or in any derivative +version prepared by Licensee. Alternately, in lieu of CNRI's License +Agreement, Licensee may substitute the following text (omitting the +quotes): "Python 1.6.1 is made available subject to the terms and +conditions in CNRI's License Agreement. This Agreement together with +Python 1.6.1 may be located on the Internet using the following +unique, persistent identifier (known as a handle): 1895.22/1013. This +Agreement may also be obtained from a proxy server on the Internet +using the following URL: http://hdl.handle.net/1895.22/1013". + +3. In the event Licensee prepares a derivative work that is based on +or incorporates Python 1.6.1 or any part thereof, and wants to make +the derivative work available to others as provided herein, then +Licensee hereby agrees to include in any such work a brief summary of +the changes made to Python 1.6.1. + +4. CNRI is making Python 1.6.1 available to Licensee on an "AS IS" +basis. CNRI MAKES NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR +IMPLIED. BY WAY OF EXAMPLE, BUT NOT LIMITATION, CNRI MAKES NO AND +DISCLAIMS ANY REPRESENTATION OR WARRANTY OF MERCHANTABILITY OR FITNESS +FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF PYTHON 1.6.1 WILL NOT +INFRINGE ANY THIRD PARTY RIGHTS. + +5. CNRI SHALL NOT BE LIABLE TO LICENSEE OR ANY OTHER USERS OF PYTHON +1.6.1 FOR ANY INCIDENTAL, SPECIAL, OR CONSEQUENTIAL DAMAGES OR LOSS AS +A RESULT OF MODIFYING, DISTRIBUTING, OR OTHERWISE USING PYTHON 1.6.1, +OR ANY DERIVATIVE THEREOF, EVEN IF ADVISED OF THE POSSIBILITY THEREOF. + +6. This License Agreement will automatically terminate upon a material +breach of its terms and conditions. + +7. This License Agreement shall be governed by the federal +intellectual property law of the United States, including without +limitation the federal copyright law, and, to the extent such +U.S. federal law does not apply, by the law of the Commonwealth of +Virginia, excluding Virginia's conflict of law provisions. +Notwithstanding the foregoing, with regard to derivative works based +on Python 1.6.1 that incorporate non-separable material that was +previously distributed under the GNU General Public License (GPL), the +law of the Commonwealth of Virginia shall govern this License +Agreement only as to issues arising under or with respect to +Paragraphs 4, 5, and 7 of this License Agreement. Nothing in this +License Agreement shall be deemed to create any relationship of +agency, partnership, or joint venture between CNRI and Licensee. This +License Agreement does not grant permission to use CNRI trademarks or +trade name in a trademark sense to endorse or promote products or +services of Licensee, or any third party. + +8. By clicking on the "ACCEPT" button where indicated, or by copying, +installing or otherwise using Python 1.6.1, Licensee agrees to be +bound by the terms and conditions of this License Agreement. + + ACCEPT + + +CWI LICENSE AGREEMENT FOR PYTHON 0.9.0 THROUGH 1.2 +-------------------------------------------------- + +Copyright (c) 1991 - 1995, Stichting Mathematisch Centrum Amsterdam, +The Netherlands. All rights reserved. + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Stichting Mathematisch +Centrum or CWI not be used in advertising or publicity pertaining to +distribution of the software without specific, written prior +permission. + +STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO +THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE +FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES +WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN +ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT +OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + +Licenses and Acknowledgements for Incorporated Software +======================================================= + +Mersenne Twister +---------------- + +The `_random' module includes code based on a download from +`http://www.math.keio.ac.jp/~matumoto/MT2002/emt19937ar.html'. The +following are the verbatim comments from the original code: + + A C-program for MT19937, with initialization improved 2002/1/26. + Coded by Takuji Nishimura and Makoto Matsumoto. + + Before using, initialize the state by using init_genrand(seed) + or init_by_array(init_key, key_length). + + Copyright (C) 1997 - 2002, Makoto Matsumoto and Takuji Nishimura, + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + 3. The names of its contributors may not be used to endorse or promote + products derived from this software without specific prior written + permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + Any feedback is very welcome. + http://www.math.keio.ac.jp/matumoto/emt.html + email: matumoto@math.keio.ac.jp + + +Sockets +------- + +The `socket' module uses the functions, `getaddrinfo', and +`getnameinfo', which are coded in separate source files from the WIDE +Project, `http://www.wide.ad.jp/about/index.html'. + + Copyright (C) 1995, 1996, 1997, and 1998 WIDE Project. + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. Neither the name of the project nor the names of its contributors + may be used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND + GAI_ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE + FOR GAI_ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS + INTERRUPTION) HOWEVER CAUSED AND ON GAI_ANY THEORY OF LIABILITY, WHETHER + IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + ARISING IN GAI_ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + OF THE POSSIBILITY OF SUCH DAMAGE. + + +Floating point exception control +-------------------------------- + +The source for the `fpectl' module includes the following notice: + + --------------------------------------------------------------------- + / Copyright (c) 1996. \ + | The Regents of the University of California. | + | All rights reserved. | + | | + | Permission to use, copy, modify, and distribute this software for | + | any purpose without fee is hereby granted, provided that this en- | + | tire notice is included in all copies of any software which is or | + | includes a copy or modification of this software and in all | + | copies of the supporting documentation for such software. | + | | + | This work was produced at the University of California, Lawrence | + | Livermore National Laboratory under contract no. W-7405-ENG-48 | + | between the U.S. Department of Energy and The Regents of the | + | University of California for the operation of UC LLNL. | + | | + | DISCLAIMER | + | | + | This software was prepared as an account of work sponsored by an | + | agency of the United States Government. Neither the United States | + | Government nor the University of California nor any of their em- | + | ployees, makes any warranty, express or implied, or assumes any | + | liability or responsibility for the accuracy, completeness, or | + | usefulness of any information, apparatus, product, or process | + | disclosed, or represents that its use would not infringe | + | privately-owned rights. Reference herein to any specific commer- | + | cial products, process, or service by trade name, trademark, | + | manufacturer, or otherwise, does not necessarily constitute or | + | imply its endorsement, recommendation, or favoring by the United | + | States Government or the University of California. The views and | + | opinions of authors expressed herein do not necessarily state or | + | reflect those of the United States Government or the University | + | of California, and shall not be used for advertising or product | + \ endorsement purposes. / + --------------------------------------------------------------------- + + +Cookie management +----------------- + +The `Cookie' module contains the following notice: + + Copyright 2000 by Timothy O'Malley + + All Rights Reserved + + Permission to use, copy, modify, and distribute this software + and its documentation for any purpose and without fee is hereby + granted, provided that the above copyright notice appear in all + copies and that both that copyright notice and this permission + notice appear in supporting documentation, and that the name of + Timothy O'Malley not be used in advertising or publicity + pertaining to distribution of the software without specific, written + prior permission. + + Timothy O'Malley DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS + SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY + AND FITNESS, IN NO EVENT SHALL Timothy O'Malley BE LIABLE FOR + ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + PERFORMANCE OF THIS SOFTWARE. + + +Execution tracing +----------------- + +The `trace' module contains the following notice: + + portions copyright 2001, Autonomous Zones Industries, Inc., all rights... + err... reserved and offered to the public under the terms of the + Python 2.2 license. + Author: Zooko O'Whielacronx + http://zooko.com/ + mailto:zooko@zooko.com + + Copyright 2000, Mojam Media, Inc., all rights reserved. + Author: Skip Montanaro + + Copyright 1999, Bioreason, Inc., all rights reserved. + Author: Andrew Dalke + + Copyright 1995-1997, Automatrix, Inc., all rights reserved. + Author: Skip Montanaro + + Copyright 1991-1995, Stichting Mathematisch Centrum, all rights reserved. + + Permission to use, copy, modify, and distribute this Python software and + its associated documentation for any purpose without fee is hereby + granted, provided that the above copyright notice appears in all copies, + and that both that copyright notice and this permission notice appear in + supporting documentation, and that the name of neither Automatrix, + Bioreason or Mojam Media be used in advertising or publicity pertaining + to distribution of the software without specific, written prior + permission. + + +UUencode and UUdecode functions +------------------------------- + +The `uu' module contains the following notice: + + Copyright 1994 by Lance Ellinghouse + Cathedral City, California Republic, United States of America. + All Rights Reserved + Permission to use, copy, modify, and distribute this software and its + documentation for any purpose and without fee is hereby granted, + provided that the above copyright notice appear in all copies and that + both that copyright notice and this permission notice appear in + supporting documentation, and that the name of Lance Ellinghouse + not be used in advertising or publicity pertaining to distribution + of the software without specific, written prior permission. + LANCE ELLINGHOUSE DISCLAIMS ALL WARRANTIES WITH REGARD TO + THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + FITNESS, IN NO EVENT SHALL LANCE ELLINGHOUSE CENTRUM BE LIABLE + FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + + Modified by Jack Jansen, CWI, July 1995: + - Use binascii module to do the actual line-by-line conversion + between ascii and binary. This results in a 1000-fold speedup. The C + version is still 5 times faster, though. + - Arguments more compliant with python standard + + +XML Remote Procedure Calls +-------------------------- + +The `xmlrpclib' module contains the following notice: + + The XML-RPC client interface is + + Copyright (c) 1999-2002 by Secret Labs AB + Copyright (c) 1999-2002 by Fredrik Lundh + + By obtaining, using, and/or copying this software and/or its + associated documentation, you agree that you have read, understood, + and will comply with the following terms and conditions: + + Permission to use, copy, modify, and distribute this software and + its associated documentation for any purpose and without fee is + hereby granted, provided that the above copyright notice appears in + all copies, and that both that copyright notice and this permission + notice appear in supporting documentation, and that the name of + Secret Labs AB or the author not be used in advertising or publicity + pertaining to distribution of the software without specific, written + prior permission. + + SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD + TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANT- + ABILITY AND FITNESS. IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR + BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY + DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, + WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS + ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE + OF THIS SOFTWARE. + +Licenses for Software linked to +=============================== + +Note that the choice of GPL compatibility outlined above doesn't extend +to modules linked to particular libraries, since they change the +effective License of the module binary. + + +GNU Readline +------------ + +The 'readline' module makes use of GNU Readline. + + The GNU Readline Library is free software; you can redistribute it + and/or modify it under the terms of the GNU General Public License as + published by the Free Software Foundation; either version 2, or (at + your option) any later version. + + On Debian systems, you can find the complete statement in + /usr/share/doc/readline-common/copyright'. A copy of the GNU General + Public License is available in /usr/share/common-licenses/GPL-2'. + + +OpenSSL +------- + +The '_ssl' module makes use of OpenSSL. + + The OpenSSL toolkit stays under a dual license, i.e. both the + conditions of the OpenSSL License and the original SSLeay license + apply to the toolkit. Actually both licenses are BSD-style Open + Source licenses. Note that both licenses are incompatible with + the GPL. + + On Debian systems, you can find the complete license text in + /usr/share/doc/openssl/copyright'. + + +Files with other licenses than the Python License +------------------------------------------------- + +Files: Include/dynamic_annotations.h +Files: Python/dynamic_annotations.c +Copyright: (c) 2008-2009, Google Inc. +License: Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR + A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY + THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE + OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +Files: Include/unicodeobject.h +Copyright: (c) Corporation for National Research Initiatives. +Copyright: (c) 1999 by Secret Labs AB. +Copyright: (c) 1999 by Fredrik Lundh. +License: By obtaining, using, and/or copying this software and/or its + associated documentation, you agree that you have read, understood, + and will comply with the following terms and conditions: + + Permission to use, copy, modify, and distribute this software and its + associated documentation for any purpose and without fee is hereby + granted, provided that the above copyright notice appears in all + copies, and that both that copyright notice and this permission notice + appear in supporting documentation, and that the name of Secret Labs + AB or the author not be used in advertising or publicity pertaining to + distribution of the software without specific, written prior + permission. + + SECRET LABS AB AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO + THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + FITNESS. IN NO EVENT SHALL SECRET LABS AB OR THE AUTHOR BE LIABLE FOR + ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +Files: Lib/logging/* +Copyright: 2001-2010 by Vinay Sajip. All Rights Reserved. +License: Permission to use, copy, modify, and distribute this software and + its documentation for any purpose and without fee is hereby granted, + provided that the above copyright notice appear in all copies and that + both that copyright notice and this permission notice appear in + supporting documentation, and that the name of Vinay Sajip + not be used in advertising or publicity pertaining to distribution + of the software without specific, written prior permission. + VINAY SAJIP DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING + ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL + VINAY SAJIP BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR + ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER + IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +Files: Lib/multiprocessing/* +Files: Modules/_multiprocessing/* +Copyright: (c) 2006-2008, R Oudkerk. All rights reserved. +License: Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + 3. Neither the name of author nor the names of any contributors may be + used to endorse or promote products derived from this software + without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + +Files: Lib/sqlite3/* +Files: Modules/_sqlite/* +Copyright: (C) 2004-2005 Gerhard Häring +License: This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + +Files: Lib/async* +Copyright: Copyright 1996 by Sam Rushing +License: Permission to use, copy, modify, and distribute this software and + its documentation for any purpose and without fee is hereby + granted, provided that the above copyright notice appear in all + copies and that both that copyright notice and this permission + notice appear in supporting documentation, and that the name of Sam + Rushing not be used in advertising or publicity pertaining to + distribution of the software without specific, written prior + permission. + + SAM RUSHING DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN + NO EVENT SHALL SAM RUSHING BE LIABLE FOR ANY SPECIAL, INDIRECT OR + CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, + NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +Files: Lib/tarfile.py +Copyright: (C) 2002 Lars Gustaebel +License: Permission is hereby granted, free of charge, to any person + obtaining a copy of this software and associated documentation + files (the "Software"), to deal in the Software without + restriction, including without limitation the rights to use, + copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the + Software is furnished to do so, subject to the following + conditions: + + The above copyright notice and this permission notice shall be + included in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES + OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + OTHER DEALINGS IN THE SOFTWARE. + +Files: Lib/turtle.py +Copyright: (C) 2006 - 2010 Gregor Lingl +License: This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + is copyright Gregor Lingl and licensed under a BSD-like license + +Files: Modules/_ctypes/libffi/* +Copyright: Copyright (C) 1996-2011 Red Hat, Inc and others. + Copyright (C) 1996-2011 Anthony Green + Copyright (C) 1996-2010 Free Software Foundation, Inc + Copyright (c) 2003, 2004, 2006, 2007, 2008 Kaz Kojima + Copyright (c) 2010, 2011, Plausible Labs Cooperative , Inc. + Copyright (c) 2010 CodeSourcery + Copyright (c) 1998 Andreas Schwab + Copyright (c) 2000 Hewlett Packard Company + Copyright (c) 2009 Bradley Smith + Copyright (c) 2008 David Daney + Copyright (c) 2004 Simon Posnjak + Copyright (c) 2005 Axis Communications AB + Copyright (c) 1998 Cygnus Solutions + Copyright (c) 2004 Renesas Technology + Copyright (c) 2002, 2007 Bo Thorsen + Copyright (c) 2002 Ranjit Mathew + Copyright (c) 2002 Roger Sayle + Copyright (c) 2000, 2007 Software AG + Copyright (c) 2003 Jakub Jelinek + Copyright (c) 2000, 2001 John Hornkvist + Copyright (c) 1998 Geoffrey Keating + Copyright (c) 2008 Björn König + +License: Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT + HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, + WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + DEALINGS IN THE SOFTWARE. + + Documentation: + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. A copy of the license is included in the + section entitled ``GNU General Public License''. + +Files: Modules/_gestalt.c +Copyright: 1991-1997 by Stichting Mathematisch Centrum, Amsterdam. +License: Permission to use, copy, modify, and distribute this software and its + documentation for any purpose and without fee is hereby granted, + provided that the above copyright notice appear in all copies and that + both that copyright notice and this permission notice appear in + supporting documentation, and that the names of Stichting Mathematisch + Centrum or CWI not be used in advertising or publicity pertaining to + distribution of the software without specific, written prior permission. + + STICHTING MATHEMATISCH CENTRUM DISCLAIMS ALL WARRANTIES WITH REGARD TO + THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + FITNESS, IN NO EVENT SHALL STICHTING MATHEMATISCH CENTRUM BE LIABLE + FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN + ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +Files: Modules/syslogmodule.c +Copyright: 1994 by Lance Ellinghouse +License: Permission to use, copy, modify, and distribute this software and its + documentation for any purpose and without fee is hereby granted, + provided that the above copyright notice appear in all copies and that + both that copyright notice and this permission notice appear in + supporting documentation, and that the name of Lance Ellinghouse + not be used in advertising or publicity pertaining to distribution + of the software without specific, written prior permission. + + LANCE ELLINGHOUSE DISCLAIMS ALL WARRANTIES WITH REGARD TO + THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + FITNESS, IN NO EVENT SHALL LANCE ELLINGHOUSE BE LIABLE FOR ANY SPECIAL, + INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING + FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, + NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION + WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +Files: Modules/zlib/* +Copyright: (C) 1995-2010 Jean-loup Gailly and Mark Adler +License: This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu + + If you use the zlib library in a product, we would appreciate *not* receiving + lengthy legal documents to sign. The sources are provided for free but without + warranty of any kind. The library has been entirely written by Jean-loup + Gailly and Mark Adler; it does not include third-party code. + +Files: Modules/expat/* +Copyright: Copyright (c) 1998, 1999, 2000 Thai Open Source Software Center Ltd + and Clark Cooper + Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006 Expat maintainers +License: Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + "Software"), to deal in the Software without restriction, including + without limitation the rights to use, copy, modify, merge, publish, + distribute, sublicense, and/or sell copies of the Software, and to + permit persons to whom the Software is furnished to do so, subject to + the following conditions: + + The above copyright notice and this permission notice shall be included + in all copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY + CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Files: Modules/_decimal/libmpdec/* +Copyright: Copyright (c) 2008-2012 Stefan Krah. All rights reserved. +License: Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + . + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + . + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + , + THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND + ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + SUCH DAMAGE. + +Files: Misc/python-mode.el +Copyright: Copyright (C) 1992,1993,1994 Tim Peters +License: This software is provided as-is, without express or implied + warranty. Permission to use, copy, modify, distribute or sell this + software, without fee, for any purpose and by any individual or + organization, is hereby granted, provided that the above copyright + notice and this paragraph appear in all copies. + +Files: Python/dtoa.c +Copyright: (c) 1991, 2000, 2001 by Lucent Technologies. +License: Permission to use, copy, modify, and distribute this software for any + purpose without fee is hereby granted, provided that this entire notice + is included in all copies of any software which is or includes a copy + or modification of this software and in all copies of the supporting + documentation for such software. + + THIS SOFTWARE IS BEING PROVIDED "AS IS", WITHOUT ANY EXPRESS OR IMPLIED + WARRANTY. IN PARTICULAR, NEITHER THE AUTHOR NOR LUCENT MAKES ANY + REPRESENTATION OR WARRANTY OF ANY KIND CONCERNING THE MERCHANTABILITY + OF THIS SOFTWARE OR ITS FITNESS FOR ANY PARTICULAR PURPOSE. + +Files: Python/getopt.c +Copyright: 1992-1994, David Gottner +License: Permission to use, copy, modify, and distribute this software and its + documentation for any purpose and without fee is hereby granted, + provided that the above copyright notice, this permission notice and + the following disclaimer notice appear unmodified in all copies. + + I DISCLAIM ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL + IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL I + BE LIABLE FOR ANY SPECIAL, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY + DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA, OR PROFITS, WHETHER + IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT + OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +Files: PC/_subprocess.c +Copyright: Copyright (c) 2004 by Fredrik Lundh + Copyright (c) 2004 by Secret Labs AB, http://www.pythonware.com + Copyright (c) 2004 by Peter Astrand +License: + * Permission to use, copy, modify, and distribute this software and + * its associated documentation for any purpose and without fee is + * hereby granted, provided that the above copyright notice appears in + * all copies, and that both that copyright notice and this permission + * notice appear in supporting documentation, and that the name of the + * authors not be used in advertising or publicity pertaining to + * distribution of the software without specific, written prior + * permission. + * + * THE AUTHORS DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. + * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS + * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, + * NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION + * WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +Files: PC/winsound.c +Copyright: Copyright (c) 1999 Toby Dickenson +License: * Permission to use this software in any way is granted without + * fee, provided that the copyright notice above appears in all + * copies. This software is provided "as is" without any warranty. + */ + +/* Modified by Guido van Rossum */ +/* Beep added by Mark Hammond */ +/* Win9X Beep and platform identification added by Uncle Timmy */ + +Files: Tools/pybench/* +Copyright: (c), 1997-2006, Marc-Andre Lemburg (mal@lemburg.com) + (c), 2000-2006, eGenix.com Software GmbH (info@egenix.com) +License: Permission to use, copy, modify, and distribute this software and its + documentation for any purpose and without fee or royalty is hereby + granted, provided that the above copyright notice appear in all copies + and that both that copyright notice and this permission notice appear + in supporting documentation or portions thereof, including + modifications, that you make. + + THE AUTHOR MARC-ANDRE LEMBURG DISCLAIMS ALL WARRANTIES WITH REGARD TO + THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND + FITNESS, IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, + INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING + FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, + NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION + WITH THE USE OR PERFORMANCE OF THIS SOFTWARE ! --- python3.4-3.4~b1.orig/debian/depgraph.py +++ python3.4-3.4~b1/debian/depgraph.py @@ -0,0 +1,199 @@ +#! /usr/bin/python3 + +# Copyright 2004 Toby Dickenson +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject +# to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + + +import sys, getopt, colorsys, imp, md5 + +class pydepgraphdot: + + def main(self,argv): + opts,args = getopt.getopt(argv,'',['mono']) + self.colored = 1 + for o,v in opts: + if o=='--mono': + self.colored = 0 + self.render() + + def fix(self,s): + # Convert a module name to a syntactically correct node name + return s.replace('.','_') + + def render(self): + p,t = self.get_data() + + # normalise our input data + for k,d in list(p.items()): + for v in list(d.keys()): + if v not in p: + p[v] = {} + + f = self.get_output_file() + + f.write('digraph G {\n') + #f.write('concentrate = true;\n') + #f.write('ordering = out;\n') + f.write('ranksep=1.0;\n') + f.write('node [style=filled,fontname=Helvetica,fontsize=10];\n') + allkd = list(p.items()) + allkd.sort() + for k,d in allkd: + tk = t.get(k) + if self.use(k,tk): + allv = list(d.keys()) + allv.sort() + for v in allv: + tv = t.get(v) + if self.use(v,tv) and not self.toocommon(v,tv): + f.write('%s -> %s' % ( self.fix(k),self.fix(v) ) ) + self.write_attributes(f,self.edge_attributes(k,v)) + f.write(';\n') + f.write(self.fix(k)) + self.write_attributes(f,self.node_attributes(k,tk)) + f.write(';\n') + f.write('}\n') + + def write_attributes(self,f,a): + if a: + f.write(' [') + f.write(','.join(a)) + f.write(']') + + def node_attributes(self,k,type): + a = [] + a.append('label="%s"' % self.label(k)) + if self.colored: + a.append('fillcolor="%s"' % self.color(k,type)) + else: + a.append('fillcolor=white') + if self.toocommon(k,type): + a.append('peripheries=2') + return a + + def edge_attributes(self,k,v): + a = [] + weight = self.weight(k,v) + if weight!=1: + a.append('weight=%d' % weight) + length = self.alien(k,v) + if length: + a.append('minlen=%d' % length) + return a + + def get_data(self): + t = eval(sys.stdin.read()) + return t['depgraph'],t['types'] + + def get_output_file(self): + return sys.stdout + + def use(self,s,type): + # Return true if this module is interesting and should be drawn. Return false + # if it should be completely omitted. This is a default policy - please override. + if s=='__main__': + return 0 + #if s in ('os','sys','time','__future__','types','re','string'): + if s in ('sys'): + # nearly all modules use all of these... more or less. They add nothing to + # our diagram. + return 0 + if s.startswith('encodings.'): + return 0 + if self.toocommon(s,type): + # A module where we dont want to draw references _to_. Dot doesnt handle these + # well, so it is probably best to not draw them at all. + return 0 + return 1 + + def toocommon(self,s,type): + # Return true if references to this module are uninteresting. Such references + # do not get drawn. This is a default policy - please override. + # + if s=='__main__': + # references *to* __main__ are never interesting. omitting them means + # that main floats to the top of the page + return 1 + #if type==imp.PKG_DIRECTORY: + # # dont draw references to packages. + # return 1 + return 0 + + def weight(self,a,b): + # Return the weight of the dependency from a to b. Higher weights + # usually have shorter straighter edges. Return 1 if it has normal weight. + # A value of 4 is usually good for ensuring that a related pair of modules + # are drawn next to each other. This is a default policy - please override. + # + if b.split('.')[-1].startswith('_'): + # A module that starts with an underscore. You need a special reason to + # import these (for example random imports _random), so draw them close + # together + return 4 + return 1 + + def alien(self,a,b): + # Return non-zero if references to this module are strange, and should be drawn + # extra-long. the value defines the length, in rank. This is also good for putting some + # vertical space between seperate subsystems. This is a default policy - please override. + # + return 0 + + def label(self,s): + # Convert a module name to a formatted node label. This is a default policy - please override. + # + return '\\.\\n'.join(s.split('.')) + + def color(self,s,type): + # Return the node color for this module name. This is a default policy - please override. + # + # Calculate a color systematically based on the hash of the module name. Modules in the + # same package have the same color. Unpackaged modules are grey + t = self.normalise_module_name_for_hash_coloring(s,type) + return self.color_from_name(t) + + def normalise_module_name_for_hash_coloring(self,s,type): + if type==imp.PKG_DIRECTORY: + return s + else: + i = s.rfind('.') + if i<0: + return '' + else: + return s[:i] + + def color_from_name(self,name): + n = md5.md5(name).digest() + hf = float(ord(n[0])+ord(n[1])*0xff)/0xffff + sf = float(ord(n[2]))/0xff + vf = float(ord(n[3]))/0xff + r,g,b = colorsys.hsv_to_rgb(hf, 0.3+0.6*sf, 0.8+0.2*vf) + return '#%02x%02x%02x' % (r*256,g*256,b*256) + + +def main(): + pydepgraphdot().main(sys.argv[1:]) + +if __name__=='__main__': + main() + + + --- python3.4-3.4~b1.orig/debian/dh_doclink +++ python3.4-3.4~b1/debian/dh_doclink @@ -0,0 +1,28 @@ +#! /bin/sh + +pkg=`echo $1 | sed 's/^-p//'` +target=$2 + +ln -sf $target debian/$pkg/usr/share/doc/$pkg + +f=debian/$pkg.postinst.debhelper +if [ ! -e $f ] || [ "`grep -c '^# dh_doclink' $f`" -eq 0 ]; then +cat >> $f <> $f <. +# + +set -e + +DIRLIST="/usr/lib/python@VER@/idlelib" + +case "$1" in + configure|abort-upgrade|abort-remove|abort-deconfigure) + + for i in $DIRLIST ; do + @PVER@ /usr/lib/@PVER@/compileall.py -q $i + if grep -sq '^byte-compile[^#]*optimize' /etc/python/debian_config + then + @PVER@ -O /usr/lib/@PVER@/compileall.py -q $i + fi + done + ;; + + *) + echo "postinst called with unknown argument \`$1'" >&2 + exit 1 + ;; + +esac + +#DEBHELPER# + +exit 0 --- python3.4-3.4~b1.orig/debian/idle-PVER.postrm.in +++ python3.4-3.4~b1/debian/idle-PVER.postrm.in @@ -0,0 +1,11 @@ +#! /bin/sh + +set -e + +if [ "$1" = "purge" ]; then + rm -rf /etc/idle-@PVER@ +fi + +#DEBHELPER# + +exit 0 --- python3.4-3.4~b1.orig/debian/idle-PVER.prerm.in +++ python3.4-3.4~b1/debian/idle-PVER.prerm.in @@ -0,0 +1,33 @@ +#! /bin/sh + +set -e + +remove_bytecode() +{ + pkg=$1 + max=$(LANG=C LC_ALL=C xargs --show-limits < /dev/null 2>&1 | awk '/Maximum/ {print int($NF / 4)}') + dpkg -L $pkg \ + | awk -F/ 'BEGIN {OFS="/"} /\.py$/ {$NF=sprintf("__pycache__/%s.*.py[co]", substr($NF,1,length($NF)-3)); print}' \ + | xargs --max-chars=$max echo \ + | while read files; do rm -f $files; done + find /usr/lib/@PVER@ -name dist-packages -prune -o -name __pycache__ -empty -print \ + | xargs -r rm -rf +} + +case "$1" in + remove|upgrade) + remove_bytecode idle-@PVER@ + ;; + deconfigure) + ;; + failed-upgrade) + ;; + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# + +exit 0 --- python3.4-3.4~b1.orig/debian/idle.desktop.in +++ python3.4-3.4~b1/debian/idle.desktop.in @@ -0,0 +1,9 @@ +[Desktop Entry] +Name=IDLE (using Python-@VER@) +Comment=Integrated Development Environment for Python (using Python-@VER@) +Exec=/usr/bin/idle-@PVER@ +Icon=/usr/share/pixmaps/@PVER@.xpm +Terminal=false +Type=Application +Categories=Application;Development; +StartupNotify=true --- python3.4-3.4~b1.orig/debian/libPVER-dbg.overrides.in +++ python3.4-3.4~b1/debian/libPVER-dbg.overrides.in @@ -0,0 +1,13 @@ +lib@PVER@-dbg binary: package-name-doesnt-match-sonames +lib@PVER@-dbg binary: non-dev-pkg-with-shlib-symlink + +# no, it's not unusual +lib@PVER@-dbg binary: unusual-interpreter + +# just the gdb debug file +lib@PVER@-dbg binary: python-script-but-no-python-dep + +# pointless lintian ... +lib@PVER@-dbg binary: hardening-no-fortify-functions + +lib@PVER@-dbg binary: arch-dependent-file-not-in-arch-specific-directory --- python3.4-3.4~b1.orig/debian/libPVER-dbg.prerm.in +++ python3.4-3.4~b1/debian/libPVER-dbg.prerm.in @@ -0,0 +1,23 @@ +#! /bin/sh + +set -e + +case "$1" in + remove) + dpkg -L lib@PVER@-dbg \ + | awk '/\.py$/ {print $0"c\n" $0"o"}' \ + | xargs -r rm -f >&2 + ;; + upgrade) + ;; + deconfigure) + ;; + failed-upgrade) + ;; + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# --- python3.4-3.4~b1.orig/debian/libPVER-dbg.symbols.i386.in +++ python3.4-3.4~b1/debian/libPVER-dbg.symbols.i386.in @@ -0,0 +1,30 @@ +libpython@VER@dm.so.1.0 libpython@VER@-dbg #MINVER# +#include "libpython.symbols" + _Py_force_double@Base @SVER@ + _Py_get_387controlword@Base @SVER@ + _Py_set_387controlword@Base @SVER@ + _PyDict_Dummy@Base @SVER@ + _PyObject_DebugMallocStats@Base @SVER@ + _PySet_Dummy@Base @SVER@ + _PyUnicode_CheckConsistency@Base @SVER@ + _PyUnicode_Dump@Base @SVER@ + _PyUnicode_compact_data@Base @SVER@ + _PyUnicode_data@Base @SVER@ + _PyUnicode_utf8@Base @SVER@ + _Py_AddToAllObjects@Base @SVER@ + _Py_Dealloc@Base @SVER@ + _Py_ForgetReference@Base @SVER@ + _Py_GetObjects@Base @SVER@ + _Py_GetRefTotal@Base @SVER@ + _Py_HashSecret_Initialized@Base @SVER@ + _Py_NegativeRefcount@Base @SVER@ + _Py_NewReference@Base @SVER@ + _Py_PrintReferenceAddresses@Base @SVER@ + _Py_PrintReferences@Base @SVER@ + _Py_RefTotal@Base @SVER@ + _Py_dumptree@Base @SVER@ + _Py_hashtable_print_stats@Base @SVER@ + _Py_printtree@Base @SVER@ + _Py_showtree@Base @SVER@ + _Py_tok_dump@Base @SVER@ + PyModule_Create2TraceRefs@Base @SVER@ --- python3.4-3.4~b1.orig/debian/libPVER-dbg.symbols.in +++ python3.4-3.4~b1/debian/libPVER-dbg.symbols.in @@ -0,0 +1,27 @@ +libpython@VER@dm.so.1.0 libpython@VER@-dbg #MINVER# +#include "libpython.symbols" + _PyDict_Dummy@Base @SVER@ + _PyObject_DebugMallocStats@Base @SVER@ + _PySet_Dummy@Base @SVER@ + _PyUnicode_CheckConsistency@Base @SVER@ + _PyUnicode_Dump@Base @SVER@ + _PyUnicode_compact_data@Base @SVER@ + _PyUnicode_data@Base @SVER@ + _PyUnicode_utf8@Base @SVER@ + _Py_AddToAllObjects@Base @SVER@ + _Py_Dealloc@Base @SVER@ + _Py_ForgetReference@Base @SVER@ + _Py_GetObjects@Base @SVER@ + _Py_GetRefTotal@Base @SVER@ + _Py_HashSecret_Initialized@Base @SVER@ + _Py_NegativeRefcount@Base @SVER@ + _Py_NewReference@Base @SVER@ + _Py_PrintReferenceAddresses@Base @SVER@ + _Py_PrintReferences@Base @SVER@ + _Py_RefTotal@Base @SVER@ + _Py_dumptree@Base @SVER@ + _Py_hashtable_print_stats@Base @SVER@ + _Py_printtree@Base @SVER@ + _Py_showtree@Base @SVER@ + _Py_tok_dump@Base @SVER@ + PyModule_Create2TraceRefs@Base @SVER@ --- python3.4-3.4~b1.orig/debian/libPVER-dev.overrides.in +++ python3.4-3.4~b1/debian/libPVER-dev.overrides.in @@ -0,0 +1,3 @@ +lib@PVER@-dev binary: python-script-but-no-python-dep + +lib@PVER@-dev binary: arch-dependent-file-not-in-arch-specific-directory --- python3.4-3.4~b1.orig/debian/libPVER-minimal.overrides.in +++ python3.4-3.4~b1/debian/libPVER-minimal.overrides.in @@ -0,0 +1,5 @@ +# intentional +lib@PVER@-minimal binary: python-script-but-no-python-dep + +# lintian omission, multiarch string is encoded in the filename +lib@PVER@-minimal binary: arch-dependent-file-not-in-arch-specific-directory --- python3.4-3.4~b1.orig/debian/libPVER-minimal.postinst.in +++ python3.4-3.4~b1/debian/libPVER-minimal.postinst.in @@ -0,0 +1,13 @@ +#! /bin/sh + +set -e + +if [ ! -f /etc/@PVER@/sitecustomize.py ]; then + cat <<-EOF + # Empty sitecustomize.py to avoid a dangling symlink +EOF +fi + +#DEBHELPER# + +exit 0 --- python3.4-3.4~b1.orig/debian/libPVER-minimal.postrm.in +++ python3.4-3.4~b1/debian/libPVER-minimal.postrm.in @@ -0,0 +1,21 @@ +#! /bin/sh + +set -e + +if [ "$1" = "purge" ]; then + pc=$(dpkg-query -f '${db:Status-Abbrev} ${binary:Package}\n' -W pkgname \ + | grep -v '^.n' | wc -l) + if [ "$pc" -lt 1 ]; then + find /usr/lib/@PVER@ -depth -type d -name __pycache__ \ + | xargs -r rm -rf + rm -f /etc/@PVER@/sitecustomize.py + rm -rf /etc/@PVER@/__pycache__ + if [ -d /etc/@PVER@ ]; then + rmdir --ignore-fail-on-non-empty /etc/@PVER@ + fi + fi +fi + +#DEBHELPER# + +exit 0 --- python3.4-3.4~b1.orig/debian/libPVER-minimal.prerm.in +++ python3.4-3.4~b1/debian/libPVER-minimal.prerm.in @@ -0,0 +1,41 @@ +#! /bin/sh + +set -e + +remove_bytecode() +{ + pkg=$1 + max=$(LANG=C LC_ALL=C xargs --show-limits < /dev/null 2>&1 | awk '/Maximum/ {print int($NF / 4)}') + dpkg -L $pkg \ + | awk -F/ 'BEGIN {OFS="/"} /\.py$/ {$NF=sprintf("__pycache__/%s.*.py[co]", substr($NF,1,length($NF)-3)); print}' \ + | xargs --max-chars="$max" echo \ + | while read files; do rm -f $files; done + find /usr/lib/python3 /usr/lib/@PVER@ \ + \( -name dist-packages -prune \) -o \ + \( -name __pycache__ -type d -empty -print \) \ + | xargs -r rm -rf +} + +case "$1" in + remove) + pc=$(dpkg-query -f '${db:Status-Abbrev} ${binary:Package}\n' -W pkgname \ + | grep -v '^.n' | wc -l) + if [ "$pc" -le 1 ]; then + remove_bytecode lib@PVER@-minimal + fi + ;; + upgrade) + remove_bytecode lib@PVER@-minimal + # byte compilation in @PVER@-minimal postinst, strict dependency + ;; + deconfigure) + ;; + failed-upgrade) + ;; + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# --- python3.4-3.4~b1.orig/debian/libPVER-stdlib.overrides.in +++ python3.4-3.4~b1/debian/libPVER-stdlib.overrides.in @@ -0,0 +1,15 @@ +# idlelib images +lib@PVER@-stdlib binary: image-file-in-usr-lib + +# license file referred by the standard library +lib@PVER@-stdlib binary: extra-license-file + +# template files +lib@PVER@-stdlib binary: interpreter-not-absolute usr/lib/@PVER@/venv/scripts/posix/pydoc #!__VENV_PYTHON__ +lib@PVER@-stdlib binary: unusual-interpreter usr/lib/@PVER@/venv/scripts/posix/pydoc #!__VENV_PYTHON__ + +# the split is the reason for that +lib@PVER@-stdlib binary: python-script-but-no-python-dep + +# lintian omission, multiarch string is encoded in the filename +lib@PVER@-stdlib binary: arch-dependent-file-not-in-arch-specific-directory --- python3.4-3.4~b1.orig/debian/libPVER-stdlib.prerm.in +++ python3.4-3.4~b1/debian/libPVER-stdlib.prerm.in @@ -0,0 +1,41 @@ +#! /bin/sh + +set -e + +remove_bytecode() +{ + pkg=$1 + max=$(LANG=C LC_ALL=C xargs --show-limits < /dev/null 2>&1 | awk '/Maximum/ {print int($NF / 4)}') + dpkg -L $pkg \ + | awk -F/ 'BEGIN {OFS="/"} /\.py$/ {$NF=sprintf("__pycache__/%s.*.py[co]", substr($NF,1,length($NF)-3)); print}' \ + | xargs --max-chars="$max" echo \ + | while read files; do rm -f $files; done + find /usr/lib/python3 /usr/lib/@PVER@ \ + \( -name dist-packages -prune \) -o \ + \( -name __pycache__ -type d -empty -print \) \ + | xargs -r rm -rf +} + +case "$1" in + remove) + pc=$(dpkg-query -f '${db:Status-Abbrev} ${binary:Package}\n' -W pkgname \ + | grep -v '^.n' | wc -l) + if [ "$pc" -le 1 ]; then + remove_bytecode lib@PVER@-stdlib + fi + ;; + upgrade) + remove_bytecode lib@PVER@-stdlib + # byte compilation in @PVER@ postinst, strict dependency + ;; + deconfigure) + ;; + failed-upgrade) + ;; + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# --- python3.4-3.4~b1.orig/debian/libPVER-testsuite.overrides.in +++ python3.4-3.4~b1/debian/libPVER-testsuite.overrides.in @@ -0,0 +1,2 @@ +lib@PVER@-testsuite binary: python-script-but-no-python-dep +lib@PVER@-testsuite binary: image-file-in-usr-lib --- python3.4-3.4~b1.orig/debian/libPVER-testsuite.prerm.in +++ python3.4-3.4~b1/debian/libPVER-testsuite.prerm.in @@ -0,0 +1,31 @@ +#! /bin/sh + +set -e + +remove_bytecode() +{ + pkg=$1 + max=$(LANG=C LC_ALL=C xargs --show-limits < /dev/null 2>&1 | awk '/Maximum/ {print int($NF / 4)}') + dpkg -L $pkg \ + | awk -F/ 'BEGIN {OFS="/"} /\.py$/ {$NF=sprintf("__pycache__/%s.*.py[co]", substr($NF,1,length($NF)-3)); print}' \ + | xargs --max-chars="$max" echo \ + | while read files; do rm -f $files; done +} + +case "$1" in + remove) + remove_bytecode lib@PVER@-testsuite + ;; + upgrade) + ;; + deconfigure) + ;; + failed-upgrade) + ;; + *) + echo "prerm called with unknown argument \`$1'" >&2 + exit 1 + ;; +esac + +#DEBHELPER# --- python3.4-3.4~b1.orig/debian/libPVER.overrides.in +++ python3.4-3.4~b1/debian/libPVER.overrides.in @@ -0,0 +1 @@ +lib@PVER@ binary: package-name-doesnt-match-sonames --- python3.4-3.4~b1.orig/debian/libPVER.symbols.i386.in +++ python3.4-3.4~b1/debian/libPVER.symbols.i386.in @@ -0,0 +1,8 @@ +libpython@VER@m.so.1.0 libpython@VER@ #MINVER# +#include "libpython.symbols" + PyModule_Create2@Base @SVER@ + _Py_force_double@Base @SVER@ + _Py_get_387controlword@Base @SVER@ + _Py_set_387controlword@Base @SVER@ + + (optional)__gnu_lto_v1@Base @SVER@ --- python3.4-3.4~b1.orig/debian/libPVER.symbols.in +++ python3.4-3.4~b1/debian/libPVER.symbols.in @@ -0,0 +1,5 @@ +libpython@VER@m.so.1.0 libpython@VER@ #MINVER# +#include "libpython.symbols" + PyModule_Create2@Base @SVER@ + + (optional)__gnu_lto_v1@Base @SVER@ --- python3.4-3.4~b1.orig/debian/libPVER.symbols.lpia.in +++ python3.4-3.4~b1/debian/libPVER.symbols.lpia.in @@ -0,0 +1,6 @@ +libpython@VER@m.so.1.0 libpython@VER@ #MINVER# +#include "libpython.symbols" + PyModule_Create2@Base @SVER@ + _Py_force_double@Base @SVER@ + _Py_get_387controlword@Base @SVER@ + _Py_set_387controlword@Base @SVER@ --- python3.4-3.4~b1.orig/debian/libpython.symbols.in +++ python3.4-3.4~b1/debian/libpython.symbols.in @@ -0,0 +1,1558 @@ + PyAST_Check@Base @SVER@ + PyAST_Compile@Base @SVER@ + PyAST_CompileEx@Base @SVER@ + PyAST_CompileObject@Base @SVER@ + PyAST_FromNode@Base @SVER@ + PyAST_FromNodeObject@Base @SVER@ + PyAST_Validate@Base @SVER@ + PyAST_mod2obj@Base @SVER@ + PyAST_obj2mod@Base @SVER@ + PyArena_AddPyObject@Base @SVER@ + PyArena_Free@Base @SVER@ + PyArena_Malloc@Base @SVER@ + PyArena_New@Base @SVER@ + PyArg_Parse@Base @SVER@ + PyArg_ParseTuple@Base @SVER@ + PyArg_ParseTupleAndKeywords@Base @SVER@ + PyArg_UnpackTuple@Base @SVER@ + PyArg_VaParse@Base @SVER@ + PyArg_VaParseTupleAndKeywords@Base @SVER@ + PyArg_ValidateKeywordArguments@Base @SVER@ + PyBaseObject_Type@Base @SVER@ + PyBool_FromLong@Base @SVER@ + PyBool_Type@Base @SVER@ + PyBuffer_FillContiguousStrides@Base @SVER@ + PyBuffer_FillInfo@Base @SVER@ + PyBuffer_FromContiguous@Base @SVER@ + PyBuffer_GetPointer@Base @SVER@ + PyBuffer_IsContiguous@Base @SVER@ + PyBuffer_Release@Base @SVER@ + PyBuffer_ToContiguous@Base @SVER@ + PyBufferedIOBase_Type@Base @SVER@ + PyBufferedRWPair_Type@Base @SVER@ + PyBufferedRandom_Type@Base @SVER@ + PyBufferedReader_Type@Base @SVER@ + PyBufferedWriter_Type@Base @SVER@ + PyByteArrayIter_Type@Base @SVER@ + PyByteArray_AsString@Base @SVER@ + PyByteArray_Concat@Base @SVER@ + PyByteArray_Fini@Base @SVER@ + PyByteArray_FromObject@Base @SVER@ + PyByteArray_FromStringAndSize@Base @SVER@ + PyByteArray_Init@Base @SVER@ + PyByteArray_Resize@Base @SVER@ + PyByteArray_Size@Base @SVER@ + PyByteArray_Type@Base @SVER@ + PyBytesIO_Type@Base @SVER@ + PyBytesIter_Type@Base @SVER@ + PyBytes_AsString@Base @SVER@ + PyBytes_AsStringAndSize@Base @SVER@ + PyBytes_Concat@Base @SVER@ + PyBytes_ConcatAndDel@Base @SVER@ + PyBytes_DecodeEscape@Base @SVER@ + PyBytes_Fini@Base @SVER@ + PyBytes_FromFormat@Base @SVER@ + PyBytes_FromFormatV@Base @SVER@ + PyBytes_FromObject@Base @SVER@ + PyBytes_FromString@Base @SVER@ + PyBytes_FromStringAndSize@Base @SVER@ + PyBytes_Repr@Base @SVER@ + PyBytes_Size@Base @SVER@ + PyBytes_Type@Base @SVER@ + (optional)PyCArgObject_new@Base @SVER@ + (optional)PyCArg_Type@Base @SVER@ + (optional)PyCArrayType_Type@Base @SVER@ + (optional)PyCArrayType_from_ctype@Base @SVER@ + (optional)PyCArray_Type@Base @SVER@ + (optional)PyCData_AtAddress@Base @SVER@ + (optional)PyCData_FromBaseObj@Base @SVER@ + (optional)PyCData_Type@Base @SVER@ + (optional)PyCData_get@Base @SVER@ + (optional)PyCData_set@Base @SVER@ + (optional)PyCField_FromDesc@Base @SVER@ + (optional)PyCField_Type@Base @SVER@ + (optional)PyCFuncPtrType_Type@Base @SVER@ + (optional)PyCFuncPtr_Type@Base @SVER@ + PyCFunction_Call@Base @SVER@ + PyCFunction_ClearFreeList@Base @SVER@ + PyCFunction_Fini@Base @SVER@ + PyCFunction_GetFlags@Base @SVER@ + PyCFunction_GetFunction@Base @SVER@ + PyCFunction_GetSelf@Base @SVER@ + PyCFunction_New@Base @SVER@ + PyCFunction_NewEx@Base @SVER@ + PyCFunction_Type@Base @SVER@ + (optional)PyCPointerType_Type@Base @SVER@ + (optional)PyCPointer_Type@Base @SVER@ + (optional)PyCSimpleType_Type@Base @SVER@ + (optional)PyCStgDict_Type@Base @SVER@ + (optional)PyCStgDict_clone@Base @SVER@ + (optional)PyCStructType_Type@Base @SVER@ + (optional)PyCStructUnionType_update_stgdict@Base @SVER@ + (optional)PyCThunk_Type@Base @SVER@ + PyCallIter_New@Base @SVER@ + PyCallIter_Type@Base @SVER@ + PyCallable_Check@Base @SVER@ + PyCapsule_GetContext@Base @SVER@ + PyCapsule_GetDestructor@Base @SVER@ + PyCapsule_GetName@Base @SVER@ + PyCapsule_GetPointer@Base @SVER@ + PyCapsule_Import@Base @SVER@ + PyCapsule_IsValid@Base @SVER@ + PyCapsule_New@Base @SVER@ + PyCapsule_SetContext@Base @SVER@ + PyCapsule_SetDestructor@Base @SVER@ + PyCapsule_SetName@Base @SVER@ + PyCapsule_SetPointer@Base @SVER@ + PyCapsule_Type@Base @SVER@ + PyCell_Get@Base @SVER@ + PyCell_New@Base @SVER@ + PyCell_Set@Base @SVER@ + PyCell_Type@Base @SVER@ + PyClassMethodDescr_Type@Base @SVER@ + PyClassMethod_New@Base @SVER@ + PyClassMethod_Type@Base @SVER@ + PyCode_Addr2Line@Base @SVER@ + PyCode_New@Base @SVER@ + PyCode_NewEmpty@Base @SVER@ + PyCode_Optimize@Base @SVER@ + PyCode_Type@Base @SVER@ + PyCodec_BackslashReplaceErrors@Base @SVER@ + PyCodec_Decode@Base @SVER@ + PyCodec_Decoder@Base @SVER@ + PyCodec_Encode@Base @SVER@ + PyCodec_Encoder@Base @SVER@ + PyCodec_IgnoreErrors@Base @SVER@ + PyCodec_IncrementalDecoder@Base @SVER@ + PyCodec_IncrementalEncoder@Base @SVER@ + PyCodec_KnownEncoding@Base @SVER@ + PyCodec_LookupError@Base @SVER@ + PyCodec_Register@Base @SVER@ + PyCodec_RegisterError@Base @SVER@ + PyCodec_ReplaceErrors@Base @SVER@ + PyCodec_StreamReader@Base @SVER@ + PyCodec_StreamWriter@Base @SVER@ + PyCodec_StrictErrors@Base @SVER@ + PyCodec_XMLCharRefReplaceErrors@Base @SVER@ + PyCompileString@Base @SVER@ + PyCompile_OpcodeStackEffect@Base @SVER@ + PyComplex_AsCComplex@Base @SVER@ + PyComplex_FromCComplex@Base @SVER@ + PyComplex_FromDoubles@Base @SVER@ + PyComplex_ImagAsDouble@Base @SVER@ + PyComplex_RealAsDouble@Base @SVER@ + PyComplex_Type@Base @SVER@ + PyDescr_NewClassMethod@Base @SVER@ + PyDescr_NewGetSet@Base @SVER@ + PyDescr_NewMember@Base @SVER@ + PyDescr_NewMethod@Base @SVER@ + PyDescr_NewWrapper@Base @SVER@ + PyDictItems_Type@Base @SVER@ + PyDictIterItem_Type@Base @SVER@ + PyDictIterKey_Type@Base @SVER@ + PyDictIterValue_Type@Base @SVER@ + PyDictKeys_Type@Base @SVER@ + PyDictProxy_New@Base @SVER@ + PyDictProxy_Type@Base @SVER@ + PyDictValues_Type@Base @SVER@ + PyDict_Clear@Base @SVER@ + PyDict_ClearFreeList@Base @SVER@ + PyDict_Contains@Base @SVER@ + PyDict_Copy@Base @SVER@ + PyDict_DelItem@Base @SVER@ + PyDict_DelItemString@Base @SVER@ + PyDict_Fini@Base @SVER@ + PyDict_GetItem@Base @SVER@ + (optional)PyDict_GetItemProxy@Base @SVER@ + PyDict_GetItemString@Base @SVER@ + PyDict_GetItemWithError@Base @SVER@ + PyDict_Items@Base @SVER@ + PyDict_Keys@Base @SVER@ + PyDict_Merge@Base @SVER@ + PyDict_MergeFromSeq2@Base @SVER@ + PyDict_New@Base @SVER@ + PyDict_Next@Base @SVER@ + PyDict_SetDefault@Base @SVER@ + PyDict_SetItem@Base @SVER@ + (optional)PyDict_SetItemProxy@Base @SVER@ + PyDict_SetItemString@Base @SVER@ + PyDict_Size@Base @SVER@ + PyDict_Type@Base @SVER@ + PyDict_Update@Base @SVER@ + PyDict_Values@Base @SVER@ + PyEllipsis_Type@Base @SVER@ + PyEnum_Type@Base @SVER@ + PyErr_BadArgument@Base @SVER@ + PyErr_BadInternalCall@Base @SVER@ + PyErr_CheckSignals@Base @SVER@ + PyErr_Clear@Base @SVER@ + PyErr_Display@Base @SVER@ + PyErr_ExceptionMatches@Base @SVER@ + PyErr_Fetch@Base @SVER@ + PyErr_Format@Base @SVER@ + PyErr_GetExcInfo@Base @SVER@ + PyErr_GivenExceptionMatches@Base @SVER@ + PyErr_NewException@Base @SVER@ + PyErr_NewExceptionWithDoc@Base @SVER@ + PyErr_NoMemory@Base @SVER@ + PyErr_NormalizeException@Base @SVER@ + PyErr_Occurred@Base @SVER@ + PyErr_Print@Base @SVER@ + PyErr_PrintEx@Base @SVER@ + PyErr_ProgramText@Base @SVER@ + PyErr_ProgramTextObject@Base @SVER@ + PyErr_Restore@Base @SVER@ + PyErr_SetExcInfo@Base @SVER@ + PyErr_SetFromErrno@Base @SVER@ + PyErr_SetFromErrnoWithFilename@Base @SVER@ + PyErr_SetFromErrnoWithFilenameObject@Base @SVER@ + PyErr_SetImportError@Base @SVER@ + PyErr_SetInterrupt@Base @SVER@ + PyErr_SetNone@Base @SVER@ + PyErr_SetObject@Base @SVER@ + PyErr_SetString@Base @SVER@ + PyErr_SyntaxLocation@Base @SVER@ + PyErr_SyntaxLocationEx@Base @SVER@ + PyErr_SyntaxLocationObject@Base @SVER@ + PyErr_Warn@Base @SVER@ + PyErr_WarnEx@Base @SVER@ + PyErr_WarnExplicit@Base @SVER@ + PyErr_WarnExplicitFormat@Base @SVER@ + PyErr_WarnExplicitObject@Base @SVER@ + PyErr_WarnFormat@Base @SVER@ + PyErr_WriteUnraisable@Base @SVER@ + PyEval_AcquireLock@Base @SVER@ + PyEval_AcquireThread@Base @SVER@ + PyEval_CallFunction@Base @SVER@ + PyEval_CallMethod@Base @SVER@ + PyEval_CallObjectWithKeywords@Base @SVER@ + PyEval_EvalCode@Base @SVER@ + PyEval_EvalCodeEx@Base @SVER@ + PyEval_EvalFrame@Base @SVER@ + PyEval_EvalFrameEx@Base @SVER@ + PyEval_GetBuiltins@Base @SVER@ + PyEval_GetCallStats@Base @SVER@ + PyEval_GetFrame@Base @SVER@ + PyEval_GetFuncDesc@Base @SVER@ + PyEval_GetFuncName@Base @SVER@ + PyEval_GetGlobals@Base @SVER@ + PyEval_GetLocals@Base @SVER@ + PyEval_InitThreads@Base @SVER@ + PyEval_MergeCompilerFlags@Base @SVER@ + PyEval_ReInitThreads@Base @SVER@ + PyEval_ReleaseLock@Base @SVER@ + PyEval_ReleaseThread@Base @SVER@ + PyEval_RestoreThread@Base @SVER@ + PyEval_SaveThread@Base @SVER@ + PyEval_SetProfile@Base @SVER@ + PyEval_SetTrace@Base @SVER@ + PyEval_ThreadsInitialized@Base @SVER@ + (optional)PyExc_ArgError@Base @SVER@ + PyExc_ArithmeticError@Base @SVER@ + PyExc_AssertionError@Base @SVER@ + PyExc_AttributeError@Base @SVER@ + PyExc_BaseException@Base @SVER@ + PyExc_BlockingIOError@Base @SVER@ + PyExc_BrokenPipeError@Base @SVER@ + PyExc_BufferError@Base @SVER@ + PyExc_BytesWarning@Base @SVER@ + PyExc_ChildProcessError@Base @SVER@ + PyExc_ConnectionAbortedError@Base @SVER@ + PyExc_ConnectionError@Base @SVER@ + PyExc_ConnectionRefusedError@Base @SVER@ + PyExc_ConnectionResetError@Base @SVER@ + PyExc_DeprecationWarning@Base @SVER@ + PyExc_EOFError@Base @SVER@ + PyExc_EnvironmentError@Base @SVER@ + PyExc_Exception@Base @SVER@ + PyExc_FileExistsError@Base @SVER@ + PyExc_FileNotFoundError@Base @SVER@ + PyExc_FloatingPointError@Base @SVER@ + PyExc_FutureWarning@Base @SVER@ + PyExc_GeneratorExit@Base @SVER@ + PyExc_IOError@Base @SVER@ + PyExc_ImportError@Base @SVER@ + PyExc_ImportWarning@Base @SVER@ + PyExc_IndentationError@Base @SVER@ + PyExc_IndexError@Base @SVER@ + PyExc_InterruptedError@Base @SVER@ + PyExc_IsADirectoryError@Base @SVER@ + PyExc_KeyError@Base @SVER@ + PyExc_KeyboardInterrupt@Base @SVER@ + PyExc_LookupError@Base @SVER@ + PyExc_MemoryError@Base @SVER@ + PyExc_NameError@Base @SVER@ + PyExc_NotADirectoryError@Base @SVER@ + PyExc_NotImplementedError@Base @SVER@ + PyExc_OSError@Base @SVER@ + PyExc_OverflowError@Base @SVER@ + PyExc_PendingDeprecationWarning@Base @SVER@ + PyExc_PermissionError@Base @SVER@ + PyExc_ProcessLookupError@Base @SVER@ + PyExc_RecursionErrorInst@Base @SVER@ + PyExc_ReferenceError@Base @SVER@ + PyExc_ResourceWarning@Base @SVER@ + PyExc_RuntimeError@Base @SVER@ + PyExc_RuntimeWarning@Base @SVER@ + PyExc_StopIteration@Base @SVER@ + PyExc_SyntaxError@Base @SVER@ + PyExc_SyntaxWarning@Base @SVER@ + PyExc_SystemError@Base @SVER@ + PyExc_SystemExit@Base @SVER@ + PyExc_TabError@Base @SVER@ + PyExc_TimeoutError@Base @SVER@ + PyExc_TypeError@Base @SVER@ + PyExc_UnboundLocalError@Base @SVER@ + PyExc_UnicodeDecodeError@Base @SVER@ + PyExc_UnicodeEncodeError@Base @SVER@ + PyExc_UnicodeError@Base @SVER@ + PyExc_UnicodeTranslateError@Base @SVER@ + PyExc_UnicodeWarning@Base @SVER@ + PyExc_UserWarning@Base @SVER@ + PyExc_ValueError@Base @SVER@ + PyExc_Warning@Base @SVER@ + PyExc_ZeroDivisionError@Base @SVER@ + PyException_GetCause@Base @SVER@ + PyException_GetContext@Base @SVER@ + PyException_GetTraceback@Base @SVER@ + PyException_SetCause@Base @SVER@ + PyException_SetContext@Base @SVER@ + PyException_SetTraceback@Base @SVER@ + PyFPE_counter@Base @SVER@ + PyFPE_dummy@Base @SVER@ + PyFPE_jbuf@Base @SVER@ + PyFileIO_Type@Base @SVER@ + PyFile_FromFd@Base @SVER@ + PyFile_GetLine@Base @SVER@ + PyFile_NewStdPrinter@Base @SVER@ + PyFile_WriteObject@Base @SVER@ + PyFile_WriteString@Base @SVER@ + PyFilter_Type@Base @SVER@ + PyFloat_AsDouble@Base @SVER@ + PyFloat_ClearFreeList@Base @SVER@ + PyFloat_Fini@Base @SVER@ + PyFloat_FromDouble@Base @SVER@ + PyFloat_FromString@Base @SVER@ + PyFloat_GetInfo@Base @SVER@ + PyFloat_GetMax@Base @SVER@ + PyFloat_GetMin@Base @SVER@ + PyFloat_Type@Base @SVER@ + PyFrame_BlockPop@Base @SVER@ + PyFrame_BlockSetup@Base @SVER@ + PyFrame_ClearFreeList@Base @SVER@ + PyFrame_FastToLocals@Base @SVER@ + PyFrame_FastToLocalsWithError@Base @SVER@ + PyFrame_Fini@Base @SVER@ + PyFrame_GetLineNumber@Base @SVER@ + PyFrame_LocalsToFast@Base @SVER@ + PyFrame_New@Base @SVER@ + PyFrame_Type@Base @SVER@ + PyFrozenSet_New@Base @SVER@ + PyFrozenSet_Type@Base @SVER@ + PyFunction_GetAnnotations@Base @SVER@ + PyFunction_GetClosure@Base @SVER@ + PyFunction_GetCode@Base @SVER@ + PyFunction_GetDefaults@Base @SVER@ + PyFunction_GetGlobals@Base @SVER@ + PyFunction_GetKwDefaults@Base @SVER@ + PyFunction_GetModule@Base @SVER@ + PyFunction_New@Base @SVER@ + PyFunction_NewWithQualName@Base @SVER@ + PyFunction_SetAnnotations@Base @SVER@ + PyFunction_SetClosure@Base @SVER@ + PyFunction_SetDefaults@Base @SVER@ + PyFunction_SetKwDefaults@Base @SVER@ + PyFunction_Type@Base @SVER@ + PyFuture_FromAST@Base @SVER@ + PyFuture_FromASTObject@Base @SVER@ + PyGC_Collect@Base @SVER@ + PyGILState_Check@Base @SVER@ + PyGILState_Ensure@Base @SVER@ + PyGILState_GetThisThreadState@Base @SVER@ + PyGILState_Release@Base @SVER@ + PyGen_NeedsFinalizing@Base @SVER@ + PyGen_New@Base @SVER@ + PyGen_Type@Base @SVER@ + PyGetSetDescr_Type@Base @SVER@ + PyGrammar_AddAccelerators@Base @SVER@ + PyGrammar_FindDFA@Base @SVER@ + PyGrammar_LabelRepr@Base @SVER@ + PyGrammar_RemoveAccelerators@Base @SVER@ + PyHash_GetFuncDef@Base @SVER@ + PyIOBase_Type@Base @SVER@ + PyImport_AddModule@Base @SVER@ + PyImport_AddModuleObject@Base @SVER@ + PyImport_AppendInittab@Base @SVER@ + PyImport_Cleanup@Base @SVER@ + PyImport_ExecCodeModule@Base @SVER@ + PyImport_ExecCodeModuleEx@Base @SVER@ + PyImport_ExecCodeModuleObject@Base @SVER@ + PyImport_ExecCodeModuleWithPathnames@Base @SVER@ + PyImport_ExtendInittab@Base @SVER@ + PyImport_FrozenModules@Base @SVER@ + PyImport_GetImporter@Base @SVER@ + PyImport_GetMagicNumber@Base @SVER@ + PyImport_GetMagicTag@Base @SVER@ + PyImport_GetModuleDict@Base @SVER@ + PyImport_Import@Base @SVER@ + PyImport_ImportFrozenModule@Base @SVER@ + PyImport_ImportFrozenModuleObject@Base @SVER@ + PyImport_ImportModule@Base @SVER@ + PyImport_ImportModuleLevel@Base @SVER@ + PyImport_ImportModuleLevelObject@Base @SVER@ + PyImport_ImportModuleNoBlock@Base @SVER@ + PyImport_Inittab@Base @SVER@ + PyImport_ReloadModule@Base @SVER@ + PyIncrementalNewlineDecoder_Type@Base @SVER@ + PyInstanceMethod_Function@Base @SVER@ + PyInstanceMethod_New@Base @SVER@ + PyInstanceMethod_Type@Base @SVER@ + PyInterpreterState_Clear@Base @SVER@ + PyInterpreterState_Delete@Base @SVER@ + PyInterpreterState_Head@Base @SVER@ + PyInterpreterState_New@Base @SVER@ + PyInterpreterState_Next@Base @SVER@ + PyInterpreterState_ThreadHead@Base @SVER@ + PyIter_Next@Base @SVER@ + PyListIter_Type@Base @SVER@ + PyListRevIter_Type@Base @SVER@ + PyList_Append@Base @SVER@ + PyList_AsTuple@Base @SVER@ + PyList_ClearFreeList@Base @SVER@ + PyList_Fini@Base @SVER@ + PyList_GetItem@Base @SVER@ + PyList_GetSlice@Base @SVER@ + PyList_Insert@Base @SVER@ + PyList_New@Base @SVER@ + PyList_Reverse@Base @SVER@ + PyList_SetItem@Base @SVER@ + PyList_SetSlice@Base @SVER@ + PyList_Size@Base @SVER@ + PyList_Sort@Base @SVER@ + PyList_Type@Base @SVER@ + PyLongRangeIter_Type@Base @SVER@ + PyLong_AsDouble@Base @SVER@ + PyLong_AsLong@Base @SVER@ + PyLong_AsLongAndOverflow@Base @SVER@ + PyLong_AsLongLong@Base @SVER@ + PyLong_AsLongLongAndOverflow@Base @SVER@ + PyLong_AsSize_t@Base @SVER@ + PyLong_AsSsize_t@Base @SVER@ + PyLong_AsUnsignedLong@Base @SVER@ + PyLong_AsUnsignedLongLong@Base @SVER@ + PyLong_AsUnsignedLongLongMask@Base @SVER@ + PyLong_AsUnsignedLongMask@Base @SVER@ + PyLong_AsVoidPtr@Base @SVER@ + PyLong_Fini@Base @SVER@ + PyLong_FromDouble@Base @SVER@ + PyLong_FromLong@Base @SVER@ + PyLong_FromLongLong@Base @SVER@ + PyLong_FromSize_t@Base @SVER@ + PyLong_FromSsize_t@Base @SVER@ + PyLong_FromString@Base @SVER@ + PyLong_FromUnicode@Base @SVER@ + PyLong_FromUnicodeObject@Base @SVER@ + PyLong_FromUnsignedLong@Base @SVER@ + PyLong_FromUnsignedLongLong@Base @SVER@ + PyLong_FromVoidPtr@Base @SVER@ + PyLong_GetInfo@Base @SVER@ + PyLong_Type@Base @SVER@ + PyMap_Type@Base @SVER@ + PyMapping_Check@Base @SVER@ + PyMapping_GetItemString@Base @SVER@ + PyMapping_HasKey@Base @SVER@ + PyMapping_HasKeyString@Base @SVER@ + PyMapping_Items@Base @SVER@ + PyMapping_Keys@Base @SVER@ + PyMapping_Length@Base @SVER@ + PyMapping_SetItemString@Base @SVER@ + PyMapping_Size@Base @SVER@ + PyMapping_Values@Base @SVER@ + PyMarshal_Init@Base @SVER@ + PyMarshal_ReadLastObjectFromFile@Base @SVER@ + PyMarshal_ReadLongFromFile@Base @SVER@ + PyMarshal_ReadObjectFromFile@Base @SVER@ + PyMarshal_ReadObjectFromString@Base @SVER@ + PyMarshal_ReadShortFromFile@Base @SVER@ + PyMarshal_WriteLongToFile@Base @SVER@ + PyMarshal_WriteObjectToFile@Base @SVER@ + PyMarshal_WriteObjectToString@Base @SVER@ + PyMem_Free@Base @SVER@ + PyMem_GetAllocator@Base @SVER@ + PyMem_Malloc@Base @SVER@ + PyMem_RawFree@Base @SVER@ + PyMem_RawMalloc@Base @SVER@ + PyMem_RawRealloc@Base @SVER@ + PyMem_Realloc@Base @SVER@ + PyMem_SetAllocator@Base @SVER@ + PyMem_SetupDebugHooks@Base @SVER@ + PyMemberDescr_Type@Base @SVER@ + PyMember_GetOne@Base @SVER@ + PyMember_SetOne@Base @SVER@ + PyMemoryView_FromBuffer@Base @SVER@ + PyMemoryView_FromMemory@Base @SVER@ + PyMemoryView_FromObject@Base @SVER@ + PyMemoryView_GetContiguous@Base @SVER@ + PyMemoryView_Type@Base @SVER@ + PyMethodDescr_Type@Base @SVER@ + PyMethod_ClearFreeList@Base @SVER@ + PyMethod_Fini@Base @SVER@ + PyMethod_Function@Base @SVER@ + PyMethod_New@Base @SVER@ + PyMethod_Self@Base @SVER@ + PyMethod_Type@Base @SVER@ + PyModule_AddIntConstant@Base @SVER@ + PyModule_AddObject@Base @SVER@ + PyModule_AddStringConstant@Base @SVER@ + PyModule_GetDef@Base @SVER@ + PyModule_GetDict@Base @SVER@ + PyModule_GetFilename@Base @SVER@ + PyModule_GetFilenameObject@Base @SVER@ + PyModule_GetName@Base @SVER@ + PyModule_GetNameObject@Base @SVER@ + PyModule_GetState@Base @SVER@ + PyModule_GetWarningsModule@Base @SVER@ + PyModule_New@Base @SVER@ + PyModule_NewObject@Base @SVER@ + PyModule_Type@Base @SVER@ + PyNode_AddChild@Base @SVER@ + PyNode_Compile@Base @SVER@ + PyNode_Free@Base @SVER@ + PyNode_ListTree@Base @SVER@ + PyNode_New@Base @SVER@ + PyNumber_Absolute@Base @SVER@ + PyNumber_Add@Base @SVER@ + PyNumber_And@Base @SVER@ + PyNumber_AsOff_t@Base @SVER@ + PyNumber_AsSsize_t@Base @SVER@ + PyNumber_Check@Base @SVER@ + PyNumber_Divmod@Base @SVER@ + PyNumber_Float@Base @SVER@ + PyNumber_FloorDivide@Base @SVER@ + PyNumber_InPlaceAdd@Base @SVER@ + PyNumber_InPlaceAnd@Base @SVER@ + PyNumber_InPlaceFloorDivide@Base @SVER@ + PyNumber_InPlaceLshift@Base @SVER@ + PyNumber_InPlaceMultiply@Base @SVER@ + PyNumber_InPlaceOr@Base @SVER@ + PyNumber_InPlacePower@Base @SVER@ + PyNumber_InPlaceRemainder@Base @SVER@ + PyNumber_InPlaceRshift@Base @SVER@ + PyNumber_InPlaceSubtract@Base @SVER@ + PyNumber_InPlaceTrueDivide@Base @SVER@ + PyNumber_InPlaceXor@Base @SVER@ + PyNumber_Index@Base @SVER@ + PyNumber_Invert@Base @SVER@ + PyNumber_Long@Base @SVER@ + PyNumber_Lshift@Base @SVER@ + PyNumber_Multiply@Base @SVER@ + PyNumber_Negative@Base @SVER@ + PyNumber_Or@Base @SVER@ + PyNumber_Positive@Base @SVER@ + PyNumber_Power@Base @SVER@ + PyNumber_Remainder@Base @SVER@ + PyNumber_Rshift@Base @SVER@ + PyNumber_Subtract@Base @SVER@ + PyNumber_ToBase@Base @SVER@ + PyNumber_TrueDivide@Base @SVER@ + PyNumber_Xor@Base @SVER@ + PyOS_AfterFork@Base @SVER@ + PyOS_FiniInterrupts@Base @SVER@ + PyOS_InitInterrupts@Base @SVER@ + PyOS_InputHook@Base @SVER@ + PyOS_InterruptOccurred@Base @SVER@ + PyOS_Readline@Base @SVER@ + PyOS_ReadlineFunctionPointer@Base @SVER@ + PyOS_StdioReadline@Base @SVER@ + PyOS_double_to_string@Base @SVER@ + PyOS_getsig@Base @SVER@ + PyOS_mystricmp@Base @SVER@ + PyOS_mystrnicmp@Base @SVER@ + PyOS_setsig@Base @SVER@ + PyOS_snprintf@Base @SVER@ + PyOS_string_to_double@Base @SVER@ + PyOS_strtol@Base @SVER@ + PyOS_strtoul@Base @SVER@ + PyOS_vsnprintf@Base @SVER@ + PyObject_ASCII@Base @SVER@ + PyObject_AsCharBuffer@Base @SVER@ + PyObject_AsFileDescriptor@Base @SVER@ + PyObject_AsReadBuffer@Base @SVER@ + PyObject_AsWriteBuffer@Base @SVER@ + PyObject_Bytes@Base @SVER@ + PyObject_Call@Base @SVER@ + PyObject_CallFinalizer@Base @SVER@ + PyObject_CallFinalizerFromDealloc@Base @SVER@ + PyObject_CallFunction@Base @SVER@ + PyObject_CallFunctionObjArgs@Base @SVER@ + PyObject_CallMethod@Base @SVER@ + PyObject_CallMethodObjArgs@Base @SVER@ + PyObject_CallObject@Base @SVER@ + PyObject_CheckReadBuffer@Base @SVER@ + PyObject_ClearWeakRefs@Base @SVER@ + PyObject_CopyData@Base @SVER@ + PyObject_DelItem@Base @SVER@ + PyObject_DelItemString@Base @SVER@ + PyObject_Dir@Base @SVER@ + PyObject_Format@Base @SVER@ + PyObject_Free@Base @SVER@ + PyObject_GC_Del@Base @SVER@ + PyObject_GC_Track@Base @SVER@ + PyObject_GC_UnTrack@Base @SVER@ + PyObject_GenericGetAttr@Base @SVER@ + PyObject_GenericGetDict@Base @SVER@ + PyObject_GenericSetAttr@Base @SVER@ + PyObject_GenericSetDict@Base @SVER@ + PyObject_GetArenaAllocator@Base @SVER@ + PyObject_GetAttr@Base @SVER@ + PyObject_GetAttrString@Base @SVER@ + PyObject_GetBuffer@Base @SVER@ + PyObject_GetItem@Base @SVER@ + PyObject_GetIter@Base @SVER@ + PyObject_HasAttr@Base @SVER@ + PyObject_HasAttrString@Base @SVER@ + PyObject_Hash@Base @SVER@ + PyObject_HashNotImplemented@Base @SVER@ + PyObject_Init@Base @SVER@ + PyObject_InitVar@Base @SVER@ + PyObject_IsInstance@Base @SVER@ + PyObject_IsSubclass@Base @SVER@ + PyObject_IsTrue@Base @SVER@ + PyObject_Length@Base @SVER@ + PyObject_LengthHint@Base @SVER@ + PyObject_Malloc@Base @SVER@ + PyObject_Not@Base @SVER@ + PyObject_Print@Base @SVER@ + PyObject_Realloc@Base @SVER@ + PyObject_Repr@Base @SVER@ + PyObject_RichCompare@Base @SVER@ + PyObject_RichCompareBool@Base @SVER@ + PyObject_SelfIter@Base @SVER@ + PyObject_SetArenaAllocator@Base @SVER@ + PyObject_SetAttr@Base @SVER@ + PyObject_SetAttrString@Base @SVER@ + PyObject_SetItem@Base @SVER@ + PyObject_Size@Base @SVER@ + PyObject_Str@Base @SVER@ + PyObject_Type@Base @SVER@ + (optional)PyObject_stgdict@Base @SVER@ + PyParser_ASTFromFile@Base @SVER@ + PyParser_ASTFromFileObject@Base @SVER@ + PyParser_ASTFromString@Base @SVER@ + PyParser_ASTFromStringObject@Base @SVER@ + PyParser_AddToken@Base @SVER@ + PyParser_ClearError@Base @SVER@ + PyParser_Delete@Base @SVER@ + PyParser_New@Base @SVER@ + PyParser_ParseFile@Base @SVER@ + PyParser_ParseFileFlags@Base @SVER@ + PyParser_ParseFileFlagsEx@Base @SVER@ + PyParser_ParseFileObject@Base @SVER@ + PyParser_ParseString@Base @SVER@ + PyParser_ParseStringFlags@Base @SVER@ + PyParser_ParseStringFlagsFilename@Base @SVER@ + PyParser_ParseStringFlagsFilenameEx@Base @SVER@ + PyParser_ParseStringObject@Base @SVER@ + PyParser_SetError@Base @SVER@ + PyParser_SimpleParseFile@Base @SVER@ + PyParser_SimpleParseFileFlags@Base @SVER@ + PyParser_SimpleParseString@Base @SVER@ + PyParser_SimpleParseStringFilename@Base @SVER@ + PyParser_SimpleParseStringFlags@Base @SVER@ + PyParser_SimpleParseStringFlagsFilename@Base @SVER@ + PyProperty_Type@Base @SVER@ + PyRangeIter_Type@Base @SVER@ + PyRange_Type@Base @SVER@ + PyRawIOBase_Type@Base @SVER@ + PyReversed_Type@Base @SVER@ + PyRun_AnyFile@Base @SVER@ + PyRun_AnyFileEx@Base @SVER@ + PyRun_AnyFileExFlags@Base @SVER@ + PyRun_AnyFileFlags@Base @SVER@ + PyRun_File@Base @SVER@ + PyRun_FileEx@Base @SVER@ + PyRun_FileExFlags@Base @SVER@ + PyRun_FileFlags@Base @SVER@ + PyRun_InteractiveLoop@Base @SVER@ + PyRun_InteractiveLoopFlags@Base @SVER@ + PyRun_InteractiveOne@Base @SVER@ + PyRun_InteractiveOneFlags@Base @SVER@ + PyRun_InteractiveOneObject@Base @SVER@ + PyRun_SimpleFile@Base @SVER@ + PyRun_SimpleFileEx@Base @SVER@ + PyRun_SimpleFileExFlags@Base @SVER@ + PyRun_SimpleString@Base @SVER@ + PyRun_SimpleStringFlags@Base @SVER@ + PyRun_String@Base @SVER@ + PyRun_StringFlags@Base @SVER@ + PySTEntry_Type@Base @SVER@ + PyST_GetScope@Base @SVER@ + PySeqIter_New@Base @SVER@ + PySeqIter_Type@Base @SVER@ + PySequence_Check@Base @SVER@ + PySequence_Concat@Base @SVER@ + PySequence_Contains@Base @SVER@ + PySequence_Count@Base @SVER@ + PySequence_DelItem@Base @SVER@ + PySequence_DelSlice@Base @SVER@ + PySequence_Fast@Base @SVER@ + PySequence_GetItem@Base @SVER@ + PySequence_GetSlice@Base @SVER@ + PySequence_In@Base @SVER@ + PySequence_InPlaceConcat@Base @SVER@ + PySequence_InPlaceRepeat@Base @SVER@ + PySequence_Index@Base @SVER@ + PySequence_Length@Base @SVER@ + PySequence_List@Base @SVER@ + PySequence_Repeat@Base @SVER@ + PySequence_SetItem@Base @SVER@ + PySequence_SetSlice@Base @SVER@ + PySequence_Size@Base @SVER@ + PySequence_Tuple@Base @SVER@ + PySetIter_Type@Base @SVER@ + PySet_Add@Base @SVER@ + PySet_Clear@Base @SVER@ + PySet_ClearFreeList@Base @SVER@ + PySet_Contains@Base @SVER@ + PySet_Discard@Base @SVER@ + PySet_Fini@Base @SVER@ + PySet_New@Base @SVER@ + PySet_Pop@Base @SVER@ + PySet_Size@Base @SVER@ + PySet_Type@Base @SVER@ + PySignal_SetWakeupFd@Base @SVER@ + PySlice_Fini@Base @SVER@ + PySlice_GetIndices@Base @SVER@ + PySlice_GetIndicesEx@Base @SVER@ + PySlice_New@Base @SVER@ + PySlice_Type@Base @SVER@ + PyState_AddModule@Base @SVER@ + PyState_FindModule@Base @SVER@ + PyState_RemoveModule@Base @SVER@ + PyStaticMethod_New@Base @SVER@ + PyStaticMethod_Type@Base @SVER@ + PyStdPrinter_Type@Base @SVER@ + PyStringIO_Type@Base @SVER@ + PyStructSequence_GetItem@Base @SVER@ + PyStructSequence_InitType2@Base @SVER@ + PyStructSequence_InitType@Base @SVER@ + PyStructSequence_New@Base @SVER@ + PyStructSequence_NewType@Base @SVER@ + PyStructSequence_SetItem@Base @SVER@ + PyStructSequence_UnnamedField@Base @SVER@ + PySuper_Type@Base @SVER@ + PySymtable_Build@Base @SVER@ + PySymtable_BuildObject@Base @SVER@ + PySymtable_Free@Base @SVER@ + PySymtable_Lookup@Base @SVER@ + PySys_AddWarnOption@Base @SVER@ + PySys_AddWarnOptionUnicode@Base @SVER@ + PySys_AddXOption@Base @SVER@ + PySys_FormatStderr@Base @SVER@ + PySys_FormatStdout@Base @SVER@ + PySys_GetObject@Base @SVER@ + PySys_GetXOptions@Base @SVER@ + PySys_HasWarnOptions@Base @SVER@ + PySys_ResetWarnOptions@Base @SVER@ + PySys_SetArgv@Base @SVER@ + PySys_SetArgvEx@Base @SVER@ + PySys_SetObject@Base @SVER@ + PySys_SetPath@Base @SVER@ + PySys_WriteStderr@Base @SVER@ + PySys_WriteStdout@Base @SVER@ + PyTextIOBase_Type@Base @SVER@ + PyTextIOWrapper_Type@Base @SVER@ + PyThreadState_Clear@Base @SVER@ + PyThreadState_Delete@Base @SVER@ + PyThreadState_DeleteCurrent@Base @SVER@ + PyThreadState_Get@Base @SVER@ + PyThreadState_GetDict@Base @SVER@ + PyThreadState_New@Base @SVER@ + PyThreadState_Next@Base @SVER@ + PyThreadState_SetAsyncExc@Base @SVER@ + PyThreadState_Swap@Base @SVER@ + PyThread_GetInfo@Base @SVER@ + PyThread_ReInitTLS@Base @SVER@ + PyThread_acquire_lock@Base @SVER@ + PyThread_acquire_lock_timed@Base @SVER@ + PyThread_allocate_lock@Base @SVER@ + PyThread_create_key@Base @SVER@ + PyThread_delete_key@Base @SVER@ + PyThread_delete_key_value@Base @SVER@ + PyThread_exit_thread@Base @SVER@ + PyThread_free_lock@Base @SVER@ + PyThread_get_key_value@Base @SVER@ + PyThread_get_stacksize@Base @SVER@ + PyThread_get_thread_ident@Base @SVER@ + PyThread_init_thread@Base @SVER@ + PyThread_release_lock@Base @SVER@ + PyThread_set_key_value@Base @SVER@ + PyThread_set_stacksize@Base @SVER@ + PyThread_start_new_thread@Base @SVER@ + PyToken_OneChar@Base @SVER@ + PyToken_ThreeChars@Base @SVER@ + PyToken_TwoChars@Base @SVER@ + PyTokenizer_FindEncoding@Base @SVER@ + PyTokenizer_FindEncodingFilename@Base @SVER@ + PyTokenizer_Free@Base @SVER@ + PyTokenizer_FromFile@Base @SVER@ + PyTokenizer_FromString@Base @SVER@ + PyTokenizer_FromUTF8@Base @SVER@ + PyTokenizer_Get@Base @SVER@ + PyTraceBack_Here@Base @SVER@ + PyTraceBack_Print@Base @SVER@ + PyTraceBack_Type@Base @SVER@ + PyTupleIter_Type@Base @SVER@ + PyTuple_ClearFreeList@Base @SVER@ + PyTuple_Fini@Base @SVER@ + PyTuple_GetItem@Base @SVER@ + PyTuple_GetSlice@Base @SVER@ + PyTuple_New@Base @SVER@ + PyTuple_Pack@Base @SVER@ + PyTuple_SetItem@Base @SVER@ + PyTuple_Size@Base @SVER@ + PyTuple_Type@Base @SVER@ + PyType_ClearCache@Base @SVER@ + PyType_FromSpec@Base @SVER@ + PyType_FromSpecWithBases@Base @SVER@ + PyType_GenericAlloc@Base @SVER@ + PyType_GenericNew@Base @SVER@ + PyType_GetFlags@Base @SVER@ + PyType_IsSubtype@Base @SVER@ + PyType_Modified@Base @SVER@ + PyType_Ready@Base @SVER@ + PyType_Type@Base @SVER@ + (optional)PyType_stgdict@Base @SVER@ + PyUnicodeDecodeError_Create@Base @SVER@ + PyUnicodeDecodeError_GetEncoding@Base @SVER@ + PyUnicodeDecodeError_GetEnd@Base @SVER@ + PyUnicodeDecodeError_GetObject@Base @SVER@ + PyUnicodeDecodeError_GetReason@Base @SVER@ + PyUnicodeDecodeError_GetStart@Base @SVER@ + PyUnicodeDecodeError_SetEnd@Base @SVER@ + PyUnicodeDecodeError_SetReason@Base @SVER@ + PyUnicodeDecodeError_SetStart@Base @SVER@ + PyUnicodeEncodeError_Create@Base @SVER@ + PyUnicodeEncodeError_GetEncoding@Base @SVER@ + PyUnicodeEncodeError_GetEnd@Base @SVER@ + PyUnicodeEncodeError_GetObject@Base @SVER@ + PyUnicodeEncodeError_GetReason@Base @SVER@ + PyUnicodeEncodeError_GetStart@Base @SVER@ + PyUnicodeEncodeError_SetEnd@Base @SVER@ + PyUnicodeEncodeError_SetReason@Base @SVER@ + PyUnicodeEncodeError_SetStart@Base @SVER@ + PyUnicodeIter_Type@Base @SVER@ + PyUnicodeTranslateError_Create@Base @SVER@ + PyUnicodeTranslateError_GetEnd@Base @SVER@ + PyUnicodeTranslateError_GetObject@Base @SVER@ + PyUnicodeTranslateError_GetReason@Base @SVER@ + PyUnicodeTranslateError_GetStart@Base @SVER@ + PyUnicodeTranslateError_SetEnd@Base @SVER@ + PyUnicodeTranslateError_SetReason@Base @SVER@ + PyUnicodeTranslateError_SetStart@Base @SVER@ + PyUnicode_Append@Base @SVER@ + PyUnicode_AppendAndDel@Base @SVER@ + PyUnicode_AsASCIIString@Base @SVER@ + PyUnicode_AsCharmapString@Base @SVER@ + PyUnicode_AsDecodedObject@Base @SVER@ + PyUnicode_AsDecodedUnicode@Base @SVER@ + PyUnicode_AsEncodedObject@Base @SVER@ + PyUnicode_AsEncodedString@Base @SVER@ + PyUnicode_AsEncodedUnicode@Base @SVER@ + PyUnicode_AsLatin1String@Base @SVER@ + PyUnicode_AsRawUnicodeEscapeString@Base @SVER@ + PyUnicode_AsUCS4@Base @SVER@ + PyUnicode_AsUCS4Copy@Base @SVER@ + PyUnicode_AsUTF16String@Base @SVER@ + PyUnicode_AsUTF32String@Base @SVER@ + PyUnicode_AsUTF8@Base @SVER@ + PyUnicode_AsUTF8AndSize@Base @SVER@ + PyUnicode_AsUTF8String@Base @SVER@ + PyUnicode_AsUnicode@Base @SVER@ + PyUnicode_AsUnicodeAndSize@Base @SVER@ + PyUnicode_AsUnicodeCopy@Base @SVER@ + PyUnicode_AsUnicodeEscapeString@Base @SVER@ + PyUnicode_AsWideChar@Base @SVER@ + PyUnicode_AsWideCharString@Base @SVER@ + PyUnicode_BuildEncodingMap@Base @SVER@ + PyUnicode_ClearFreeList@Base @SVER@ + PyUnicode_Compare@Base @SVER@ + PyUnicode_CompareWithASCIIString@Base @SVER@ + PyUnicode_Concat@Base @SVER@ + PyUnicode_Contains@Base @SVER@ + PyUnicode_CopyCharacters@Base @SVER@ + PyUnicode_Count@Base @SVER@ + PyUnicode_Decode@Base @SVER@ + PyUnicode_DecodeASCII@Base @SVER@ + PyUnicode_DecodeCharmap@Base @SVER@ + PyUnicode_DecodeFSDefault@Base @SVER@ + PyUnicode_DecodeFSDefaultAndSize@Base @SVER@ + PyUnicode_DecodeLatin1@Base @SVER@ + PyUnicode_DecodeLocale@Base @SVER@ + PyUnicode_DecodeLocaleAndSize@Base @SVER@ + PyUnicode_DecodeRawUnicodeEscape@Base @SVER@ + PyUnicode_DecodeUTF16@Base @SVER@ + PyUnicode_DecodeUTF16Stateful@Base @SVER@ + PyUnicode_DecodeUTF32@Base @SVER@ + PyUnicode_DecodeUTF32Stateful@Base @SVER@ + PyUnicode_DecodeUTF7@Base @SVER@ + PyUnicode_DecodeUTF7Stateful@Base @SVER@ + PyUnicode_DecodeUTF8@Base @SVER@ + PyUnicode_DecodeUTF8Stateful@Base @SVER@ + PyUnicode_DecodeUnicodeEscape@Base @SVER@ + PyUnicode_Encode@Base @SVER@ + PyUnicode_EncodeASCII@Base @SVER@ + PyUnicode_EncodeCharmap@Base @SVER@ + PyUnicode_EncodeDecimal@Base @SVER@ + PyUnicode_EncodeFSDefault@Base @SVER@ + PyUnicode_EncodeUTF8@Base @SVER@ + PyUnicode_EncodeUnicodeEscape@Base @SVER@ + PyUnicode_FSConverter@Base @SVER@ + PyUnicode_FSDecoder@Base @SVER@ + PyUnicode_Fill@Base @SVER@ + PyUnicode_Find@Base @SVER@ + PyUnicode_FindChar@Base @SVER@ + PyUnicode_Format@Base @SVER@ + PyUnicode_FromEncodedObject@Base @SVER@ + PyUnicode_FromFormat@Base @SVER@ + PyUnicode_FromFormatV@Base @SVER@ + PyUnicode_FromKindAndData@Base @SVER@ + PyUnicode_FromObject@Base @SVER@ + PyUnicode_FromOrdinal@Base @SVER@ + PyUnicode_FromString@Base @SVER@ + PyUnicode_FromStringAndSize@Base @SVER@ + PyUnicode_FromUnicode@Base @SVER@ + PyUnicode_FromWideChar@Base @SVER@ + PyUnicode_GetDefaultEncoding@Base @SVER@ + PyUnicode_GetLength@Base @SVER@ + PyUnicode_GetMax@Base @SVER@ + PyUnicode_GetSize@Base @SVER@ + PyUnicode_EncodeLatin1@Base @SVER@ + PyUnicode_EncodeLocale@Base @SVER@ + PyUnicode_EncodeRawUnicodeEscape@Base @SVER@ + PyUnicode_EncodeUTF16@Base @SVER@ + PyUnicode_EncodeUTF32@Base @SVER@ + PyUnicode_EncodeUTF7@Base @SVER@ + PyUnicode_InternFromString@Base @SVER@ + PyUnicode_InternImmortal@Base @SVER@ + PyUnicode_InternInPlace@Base @SVER@ + PyUnicode_IsIdentifier@Base @SVER@ + PyUnicode_Join@Base @SVER@ + PyUnicode_New@Base @SVER@ + PyUnicode_Partition@Base @SVER@ + PyUnicode_RPartition@Base @SVER@ + PyUnicode_RSplit@Base @SVER@ + PyUnicode_ReadChar@Base @SVER@ + PyUnicode_Replace@Base @SVER@ + PyUnicode_Resize@Base @SVER@ + PyUnicode_RichCompare@Base @SVER@ + PyUnicode_Split@Base @SVER@ + PyUnicode_Splitlines@Base @SVER@ + PyUnicode_Substring@Base @SVER@ + PyUnicode_Tailmatch@Base @SVER@ + PyUnicode_TransformDecimalToASCII@Base @SVER@ + PyUnicode_Translate@Base @SVER@ + PyUnicode_TranslateCharmap@Base @SVER@ + PyUnicode_Type@Base @SVER@ + PyUnicode_WriteChar@Base @SVER@ + PyWeakref_GetObject@Base @SVER@ + PyWeakref_NewProxy@Base @SVER@ + PyWeakref_NewRef@Base @SVER@ + PyWrapperDescr_Type@Base @SVER@ + PyWrapper_New@Base @SVER@ + PyZip_Type@Base @SVER@ + Py_AddPendingCall@Base @SVER@ + Py_AtExit@Base @SVER@ + Py_BuildValue@Base @SVER@ + Py_BytesWarningFlag@Base @SVER@ + Py_CompileString@Base @SVER@ + Py_CompileStringExFlags@Base @SVER@ + Py_CompileStringFlags@Base @SVER@ + Py_CompileStringObject@Base @SVER@ + Py_DebugFlag@Base @SVER@ + Py_DecRef@Base @SVER@ + Py_DontWriteBytecodeFlag@Base @SVER@ + Py_EndInterpreter@Base @SVER@ + Py_Exit@Base @SVER@ + Py_FatalError@Base @SVER@ + Py_FdIsInteractive@Base @SVER@ + Py_FileSystemDefaultEncoding@Base @SVER@ + Py_Finalize@Base @SVER@ + Py_FrozenFlag@Base @SVER@ + Py_FrozenMain@Base @SVER@ + Py_GetArgcArgv@Base @SVER@ + Py_GetBuildInfo@Base @SVER@ + Py_GetCompiler@Base @SVER@ + Py_GetCopyright@Base @SVER@ + Py_GetExecPrefix@Base @SVER@ + Py_GetPath@Base @SVER@ + Py_GetPlatform@Base @SVER@ + Py_GetPrefix@Base @SVER@ + Py_GetProgramFullPath@Base @SVER@ + Py_GetProgramName@Base @SVER@ + Py_GetPythonHome@Base @SVER@ + Py_GetRecursionLimit@Base @SVER@ + Py_GetVersion@Base @SVER@ + Py_HasFileSystemDefaultEncoding@Base @SVER@ + Py_HashRandomizationFlag@Base @SVER@ + Py_IgnoreEnvironmentFlag@Base @SVER@ + Py_IncRef@Base @SVER@ + Py_Initialize@Base @SVER@ + Py_InitializeEx@Base @SVER@ + Py_InspectFlag@Base @SVER@ + Py_InteractiveFlag@Base @SVER@ + Py_IsInitialized@Base @SVER@ + Py_IsolatedFlag@Base @SVER@ + Py_Main@Base @SVER@ + Py_MakePendingCalls@Base @SVER@ + Py_NewInterpreter@Base @SVER@ + Py_NoSiteFlag@Base @SVER@ + Py_NoUserSiteDirectory@Base @SVER@ + Py_OptimizeFlag@Base @SVER@ + Py_QuietFlag@Base @SVER@ + Py_ReprEnter@Base @SVER@ + Py_ReprLeave@Base @SVER@ + Py_SetPath@Base @SVER@ + Py_SetProgramName@Base @SVER@ + Py_SetPythonHome@Base @SVER@ + Py_SetRecursionLimit@Base @SVER@ + Py_SetStandardStreamEncoding@Base @SVER@ + Py_SymtableString@Base @SVER@ + Py_SymtableStringObject@Base @SVER@ + Py_UNICODE_strcat@Base @SVER@ + Py_UNICODE_strchr@Base @SVER@ + Py_UNICODE_strcmp@Base @SVER@ + Py_UNICODE_strcpy@Base @SVER@ + Py_UNICODE_strlen@Base @SVER@ + Py_UNICODE_strncmp@Base @SVER@ + Py_UNICODE_strncpy@Base @SVER@ + Py_UNICODE_strrchr@Base @SVER@ + Py_UnbufferedStdioFlag@Base @SVER@ + Py_UniversalNewlineFgets@Base @SVER@ + Py_UseClassExceptionsFlag@Base @SVER@ + Py_VaBuildValue@Base @SVER@ + Py_VerboseFlag@Base @SVER@ + Py_hexdigits@Base @SVER@ + Py_meta_grammar@Base @SVER@ + Py_pgen@Base @SVER@ + _PyAccu_Accumulate@Base @SVER@ + _PyAccu_Destroy@Base @SVER@ + _PyAccu_Finish@Base @SVER@ + _PyAccu_FinishAsList@Base @SVER@ + _PyAccu_Init@Base @SVER@ + _PyArg_NoKeywords@Base @SVER@ + _PyArg_ParseTupleAndKeywords_SizeT@Base @SVER@ + _PyArg_ParseTuple_SizeT@Base @SVER@ + _PyArg_Parse_SizeT@Base @SVER@ + _PyArg_VaParseTupleAndKeywords_SizeT@Base @SVER@ + _PyArg_VaParse_SizeT@Base @SVER@ + _PyBuiltin_Init@Base @SVER@ + _PyByteArray_empty_string@Base @SVER@ + _PyBytesIOBuffer_Type@Base @SVER@ + _PyBytes_Join@Base @SVER@ + _PyBytes_Resize@Base @SVER@ + _PyCFunction_DebugMallocStats@Base @SVER@ + _PyCapsule_hack@Base @SVER@ + _PyCode_CheckLineNumber@Base @SVER@ + _PyCodec_DecodeText@Base @SVER@ + _PyCodec_EncodeText@Base @SVER@ + _PyCodec_Lookup@Base @SVER@ + _PyComplex_FormatAdvancedWriter@Base @SVER@ + _PyDebugAllocatorStats@Base @SVER@ + _PyDictKeys_DecRef@Base @SVER@ + _PyDict_Contains@Base @SVER@ + _PyDict_DebugMallocStats@Base @SVER@ + _PyDict_DelItemId@Base @SVER@ + _PyDict_GetItemId@Base @SVER@ + _PyDict_GetItemIdWithError@Base @SVER@ + _PyDict_HasOnlyStringKeys@Base @SVER@ + _PyDict_KeysSize@Base @SVER@ + _PyDict_LoadGlobal@Base @SVER@ + _PyDict_MaybeUntrack@Base @SVER@ + _PyDict_NewKeysForClass@Base @SVER@ + _PyDict_NewPresized@Base @SVER@ + _PyDict_Next@Base @SVER@ + _PyErr_BadInternalCall@Base @SVER@ + _PyErr_SetKeyError@Base @SVER@ + _PyErr_TrySetFromCause@Base @SVER@ + _PyDict_SetItemId@Base @SVER@ + _PyEval_CallTracing@Base @SVER@ + _PyEval_FiniThreads@Base @SVER@ + _PyEval_GetSwitchInterval@Base @SVER@ + _PyEval_SetSwitchInterval@Base @SVER@ + _PyEval_SignalAsyncExc@Base @SVER@ + _PyEval_SliceIndex@Base @SVER@ + _PyExc_Fini@Base @SVER@ + _PyExc_Init@Base @SVER@ + _PyFaulthandler_Fini@Base @SVER@ + _PyFaulthandler_Init@Base @SVER@ + _PyFileIO_closed@Base @SVER@ + _PyFloat_DebugMallocStats@Base @SVER@ + _PyFloat_FormatAdvancedWriter@Base @SVER@ + _PyFloat_Init@Base @SVER@ + _PyFloat_Pack4@Base @SVER@ + _PyFloat_Pack8@Base @SVER@ + _PyFloat_Unpack4@Base @SVER@ + _PyFloat_Unpack8@Base @SVER@ + _PyFrame_DebugMallocStats@Base @SVER@ + _PyFrame_Init@Base @SVER@ + _PyGC_CollectNoFail@Base @SVER@ + _PyGC_Dump@Base @SVER@ + _PyGC_DumpShutdownStats@Base @SVER@ + _PyGC_Fini@Base @SVER@ + _PyGC_generation0@Base @SVER@ + _PyGILState_Fini@Base @SVER@ + _PyGILState_Init@Base @SVER@ + _PyGILState_Reinit@Base @SVER@ + _PyGen_FetchStopIterationValue@Base @SVER@ + _PyGen_Finalize@Base @SVER@ + _PyGen_Send@Base @SVER@ + _PyHash_Fini@Base @SVER@ + _PyIOBase_check_closed@Base @SVER@ + _PyIOBase_check_readable@Base @SVER@ + _PyIOBase_check_seekable@Base @SVER@ + _PyIOBase_check_writable@Base @SVER@ + _PyIOBase_finalize@Base @SVER@ + _PyIO_ConvertSsize_t@Base @SVER@ + _PyIO_Module@Base @SVER@ + _PyIO_empty_bytes@Base @SVER@ + _PyIO_empty_str@Base @SVER@ + _PyIO_find_line_ending@Base @SVER@ + _PyIO_get_locale_module@Base @SVER@ + _PyIO_get_module_state@Base @SVER@ + _PyIO_str_close@Base @SVER@ + _PyIO_str_closed@Base @SVER@ + _PyIO_str_decode@Base @SVER@ + _PyIO_str_encode@Base @SVER@ + _PyIO_str_fileno@Base @SVER@ + _PyIO_str_flush@Base @SVER@ + _PyIO_str_getstate@Base @SVER@ + _PyIO_str_isatty@Base @SVER@ + _PyIO_str_newlines@Base @SVER@ + _PyIO_str_nl@Base @SVER@ + _PyIO_str_read1@Base @SVER@ + _PyIO_str_read@Base @SVER@ + _PyIO_str_readable@Base @SVER@ + _PyIO_str_readall@Base @SVER@ + _PyIO_str_readinto@Base @SVER@ + _PyIO_str_readline@Base @SVER@ + _PyIO_str_reset@Base @SVER@ + _PyIO_str_seek@Base @SVER@ + _PyIO_str_seekable@Base @SVER@ + _PyIO_str_setstate@Base @SVER@ + _PyIO_str_tell@Base @SVER@ + _PyIO_str_truncate@Base @SVER@ + _PyIO_str_writable@Base @SVER@ + _PyIO_str_write@Base @SVER@ + _PyIO_trap_eintr@Base @SVER@ + _PyIO_zero@Base @SVER@ + _PyImportHooks_Init@Base @SVER@ + _PyImportZip_Init@Base @SVER@ + _PyImport_AcquireLock@Base @SVER@ + _PyImport_DynLoadFiletab@Base @SVER@ + _PyImport_FindBuiltin@Base @SVER@ + _PyImport_FindExtensionObject@Base @SVER@ + _PyImport_Fini@Base @SVER@ + _PyImport_FixupBuiltin@Base @SVER@ + _PyImport_FixupExtensionObject@Base @SVER@ + _PyImport_GetDynLoadFunc@Base @SVER@ + _PyImport_Init@Base @SVER@ + _PyImport_Inittab@Base @SVER@ + _PyImport_LoadDynamicModule@Base @SVER@ + _PyImport_ReInitLock@Base @SVER@ + _PyImport_ReleaseLock@Base @SVER@ + _PyIncrementalNewlineDecoder_decode@Base @SVER@ + _PyList_DebugMallocStats@Base @SVER@ + _PyList_Extend@Base @SVER@ + _PyLong_AsByteArray@Base @SVER@ + _PyLong_AsInt@Base @SVER@ + _PyLong_AsTime_t@Base @SVER@ + _PyLong_Copy@Base @SVER@ + _PyLong_DigitValue@Base @SVER@ + _PyLong_DivmodNear@Base @SVER@ + _PyLong_Format@Base @SVER@ + _PyLong_FormatAdvancedWriter@Base @SVER@ + _PyLong_FormatWriter@Base @SVER@ + _PyLong_Frexp@Base @SVER@ + _PyLong_FromByteArray@Base @SVER@ + _PyLong_FromBytes@Base @SVER@ + _PyLong_FromGid@Base @SVER@ + _PyLong_FromNbInt@Base @SVER@ + _PyLong_FromTime_t@Base @SVER@ + _PyLong_FromUid@Base @SVER@ + _PyLong_Init@Base @SVER@ + _PyLong_New@Base @SVER@ + _PyLong_NumBits@Base @SVER@ + _PyLong_Sign@Base @SVER@ + _PyManagedBuffer_Type@Base @SVER@ + _PyMem_RawStrdup@Base @SVER@ + _PyMem_Strdup@Base @SVER@ + _PyMethodWrapper_Type@Base @SVER@ + _PyMethod_DebugMallocStats@Base @SVER@ + _PyModule_Clear@Base @SVER@ + _PyNamespace_New@Base @SVER@ + _PyNamespace_Type@Base @SVER@ + _PyNode_SizeOf@Base @SVER@ + _PyNone_Type@Base @SVER@ + _PyNotImplemented_Type@Base @SVER@ + _PyOS_GetOpt@Base @SVER@ + _PyOS_IsMainThread@Base @SVER@ + _PyOS_ReadlineTState@Base @SVER@ + _PyOS_ResetGetOpt@Base @SVER@ + _PyOS_URandom@Base @SVER@ + _PyOS_mystrnicmp_hack@Base @SVER@ + _PyOS_optarg@Base @SVER@ + _PyOS_opterr@Base @SVER@ + _PyOS_optind@Base @SVER@ + _PyObjectDict_SetItem@Base @SVER@ + _PyObject_CallFunction_SizeT@Base @SVER@ + _PyObject_CallMethodId@Base @SVER@ + _PyObject_CallMethodIdObjArgs@Base @SVER@ + _PyObject_CallMethodId_SizeT@Base @SVER@ + _PyObject_CallMethod_SizeT@Base @SVER@ + _PyObject_DebugMallocStats@Base @SVER@ + _PyObject_DebugTypeStats@Base @SVER@ + _PyObject_Dump@Base @SVER@ + _PyObject_GC_Malloc@Base @SVER@ + _PyObject_GC_New@Base @SVER@ + _PyObject_GC_NewVar@Base @SVER@ + _PyObject_GC_Resize@Base @SVER@ + _PyObject_GC_Track@Base @SVER@ + _PyObject_GC_UnTrack@Base @SVER@ + _PyObject_GenericGetAttrWithDict@Base @SVER@ + _PyObject_GenericSetAttrWithDict@Base @SVER@ + _PyObject_GetAttrId@Base @SVER@ + _PyObject_GetBuiltin@Base @SVER@ + _PyObject_GetDictPtr@Base @SVER@ + _PyObject_HasAttrId@Base @SVER@ + _PyObject_HasLen@Base @SVER@ + _PyObject_IsAbstract@Base @SVER@ + _PyObject_LookupSpecial@Base @SVER@ + _PyObject_New@Base @SVER@ + _PyObject_NewVar@Base @SVER@ + _PyObject_NextNotImplemented@Base @SVER@ + _PyObject_RealIsInstance@Base @SVER@ + _PyObject_RealIsSubclass@Base @SVER@ + _PyObject_SetAttrId@Base @SVER@ + _PyParser_Grammar@Base @SVER@ + _PyParser_TokenNames@Base @SVER@ + _PyRandom_Fini@Base @SVER@ + _PyRandom_Init@Base @SVER@ + _PySequence_BytesToCharpArray@Base @SVER@ + _PySequence_IterSearch@Base @SVER@ + _PySet_Dummy@Base @SVER@ + _PySet_NextEntry@Base @SVER@ + _PySet_Update@Base @SVER@ + _PySlice_FromIndices@Base @SVER@ + _PySlice_GetLongIndices@Base @SVER@ + _PyState_AddModule@Base @SVER@ + _PyState_ClearModules@Base @SVER@ + _PyStructSequence_Init@Base @SVER@ + _PySys_GetObjectId@Base @SVER@ + _PySys_ImplCacheTag@Base @SVER@ + _PySys_ImplName@Base @SVER@ + _PySys_Init@Base @SVER@ + _PySys_SetObjectId@Base @SVER@ + _PyThreadState_Current@Base @SVER@ + _PyThreadState_DeleteExcept@Base @SVER@ + _PyThreadState_GetFrame@Base @SVER@ + _PyThreadState_Init@Base @SVER@ + _PyThreadState_Prealloc@Base @SVER@ + _PyThread_CurrentFrames@Base @SVER@ + _PyTime_Init@Base @SVER@ + _PyTime_ObjectToTime_t@Base @SVER@ + _PyTime_ObjectToTimespec@Base @SVER@ + _PyTime_ObjectToTimeval@Base @SVER@ + _PyTime_gettimeofday@Base @SVER@ + _PyTime_gettimeofday_info@Base @SVER@ + _PyTraceMalloc_Init@Base @SVER@ + _PyTraceMalloc_Fini@Base @SVER@ + _PyTrash_delete_later@Base @SVER@ + _PyTrash_delete_nesting@Base @SVER@ + _PyTrash_deposit_object@Base @SVER@ + _PyTrash_destroy_chain@Base @SVER@ + _PyTrash_thread_deposit_object@Base @SVER@ + _PyTrash_thread_destroy_chain@Base @SVER@ + _PyTuple_DebugMallocStats@Base @SVER@ + _PyTuple_MaybeUntrack@Base @SVER@ + _PyTuple_Resize@Base @SVER@ + _PyType_CalculateMetaclass@Base @SVER@ + _PyType_Fini@Base @SVER@ + _PyType_Lookup@Base @SVER@ + _PyType_LookupId@Base @SVER@ + _PyUnicodeTranslateError_Create@Base @SVER@ + _PyUnicodeWriter_Dealloc@Base @SVER@ + _PyUnicodeWriter_Finish@Base @SVER@ + _PyUnicodeWriter_Init@Base @SVER@ + _PyUnicodeWriter_PrepareInternal@Base @SVER@ + _PyUnicodeWriter_WriteASCIIString@Base @SVER@ + _PyUnicodeWriter_WriteChar@Base @SVER@ + _PyUnicodeWriter_WriteLatin1String@Base @SVER@ + _PyUnicodeWriter_WriteStr@Base @SVER@ + _PyUnicodeWriter_WriteSubstring@Base @SVER@ + _PyUnicode_AsASCIIString@Base @SVER@ + _PyUnicode_AsKind@Base @SVER@ + _PyUnicode_AsLatin1String@Base @SVER@ + _PyUnicode_AsUTF8String@Base @SVER@ + _PyUnicode_BidirectionalNames@Base @SVER@ + _PyUnicode_CategoryNames@Base @SVER@ + _PyUnicode_ClearStaticStrings@Base @SVER@ + _PyUnicode_CompareWithId@Base @SVER@ + _PyUnicode_Copy@Base @SVER@ + _PyUnicode_Database_Records@Base @SVER@ + _PyUnicode_DecodeUnicodeInternal@Base @SVER@ + _PyUnicode_EastAsianWidthNames@Base @SVER@ + _PyUnicode_EncodeCharmap@Base @SVER@ + _PyUnicode_EncodeUTF16@Base @SVER@ + _PyUnicode_EncodeUTF32@Base @SVER@ + _PyUnicode_EncodeUTF7@Base @SVER@ + _PyUnicode_ExtendedCase@Base @SVER@ + _PyUnicode_FastCopyCharacters@Base @SVER@ + _PyUnicode_FastFill@Base @SVER@ + _PyUnicode_FindMaxChar@Base @SVER@ + _PyUnicode_Fini@Base @SVER@ + _PyUnicode_FormatAdvancedWriter@Base @SVER@ + _PyUnicode_FromASCII@Base @SVER@ + _PyUnicode_FromId@Base @SVER@ + _PyUnicode_Init@Base @SVER@ + _PyUnicode_HasNULChars@Base @SVER@ + _PyUnicode_InsertThousandsGrouping@Base @SVER@ + _PyUnicode_IsAlpha@Base @SVER@ + _PyUnicode_IsCaseIgnorable@Base @SVER@ + _PyUnicode_IsCased@Base @SVER@ + _PyUnicode_IsDecimalDigit@Base @SVER@ + _PyUnicode_IsDigit@Base @SVER@ + _PyUnicode_IsLinebreak@Base @SVER@ + _PyUnicode_IsLowercase@Base @SVER@ + _PyUnicode_IsNumeric@Base @SVER@ + _PyUnicode_IsPrintable@Base @SVER@ + _PyUnicode_IsTitlecase@Base @SVER@ + _PyUnicode_IsUppercase@Base @SVER@ + _PyUnicode_IsWhitespace@Base @SVER@ + _PyUnicode_IsXidContinue@Base @SVER@ + _PyUnicode_IsXidStart@Base @SVER@ + _PyUnicode_Ready@Base @SVER@ + _PyUnicode_ToDecimalDigit@Base @SVER@ + _PyUnicode_ToDigit@Base @SVER@ + _PyUnicode_ToFoldedFull@Base @SVER@ + _PyUnicode_ToLowerFull@Base @SVER@ + _PyUnicode_ToLowercase@Base @SVER@ + _PyUnicode_ToNumeric@Base @SVER@ + _PyUnicode_ToTitleFull@Base @SVER@ + _PyUnicode_ToTitlecase@Base @SVER@ + _PyUnicode_ToUpperFull@Base @SVER@ + _PyUnicode_ToUppercase@Base @SVER@ + _PyUnicode_TransformDecimalAndSpaceToASCII@Base @SVER@ + _PyUnicode_TranslateCharmap@Base @SVER@ + _PyUnicode_TypeRecords@Base @SVER@ + _PyUnicode_XStrip@Base @SVER@ + _PyWarnings_Init@Base @SVER@ + _PyWeakref_CallableProxyType@Base @SVER@ + _PyWeakref_ClearRef@Base @SVER@ + _PyWeakref_GetWeakrefCount@Base @SVER@ + _PyWeakref_ProxyType@Base @SVER@ + _PyWeakref_RefType@Base @SVER@ + _Py_Assert@Base @SVER@ + _Py_Assign@Base @SVER@ + _Py_Attribute@Base @SVER@ + _Py_AugAssign@Base @SVER@ + _Py_BinOp@Base @SVER@ + _Py_BoolOp@Base @SVER@ + _Py_Break@Base @SVER@ + _Py_BreakPoint@Base @SVER@ + _Py_BuildValue_SizeT@Base @SVER@ + _Py_Bytes@Base @SVER@ + _Py_Call@Base @SVER@ + _Py_CheckRecursionLimit@Base @SVER@ + _Py_CheckRecursiveCall@Base @SVER@ + _Py_ClassDef@Base @SVER@ + _Py_Compare@Base @SVER@ + _Py_Continue@Base @SVER@ + _Py_Dealloc@Base @SVER@ + _Py_Delete@Base @SVER@ + _Py_Dict@Base @SVER@ + _Py_DictComp@Base @SVER@ + _Py_DisplaySourceLine@Base @SVER@ + _Py_DumpTraceback@Base @SVER@ + _Py_DumpTracebackThreads@Base @SVER@ + _Py_Ellipsis@Base @SVER@ + _Py_EllipsisObject@Base @SVER@ + _Py_ExceptHandler@Base @SVER@ + _Py_Expr@Base @SVER@ + _Py_Expression@Base @SVER@ + _Py_ExtSlice@Base @SVER@ + _Py_FalseStruct@Base @SVER@ + _Py_Finalizing@Base @SVER@ + _Py_For@Base @SVER@ + _Py_FreeCharPArray@Base @SVER@ + _Py_FunctionDef@Base @SVER@ + _Py_GeneratorExp@Base @SVER@ + _Py_GetAllocatedBlocks@Base @SVER@ + _Py_Global@Base @SVER@ + _Py_Gid_Converter@Base @SVER@ + _Py_HashBytes@Base @SVER@ + _Py_HashDouble@Base @SVER@ + _Py_HashPointer@Base @SVER@ + _Py_HashSecret@Base @SVER@ + _Py_If@Base @SVER@ + _Py_IfExp@Base @SVER@ + _Py_Import@Base @SVER@ + _Py_ImportFrom@Base @SVER@ + _Py_Index@Base @SVER@ + _Py_InitializeEx_Private@Base @SVER@ + _Py_Interactive@Base @SVER@ + _Py_Lambda@Base @SVER@ + _Py_List@Base @SVER@ + _Py_ListComp@Base @SVER@ + _Py_M__importlib@Base @SVER@ + _Py_Mangle@Base @SVER@ + _Py_Module@Base @SVER@ + _Py_Name@Base @SVER@ + _Py_NameConstant@Base @SVER@ + _Py_NoneStruct@Base @SVER@ + _Py_Nonlocal@Base @SVER@ + _Py_NotImplementedStruct@Base @SVER@ + _Py_Num@Base @SVER@ + _Py_PackageContext@Base @SVER@ + _Py_Pass@Base @SVER@ + _Py_PyAtExit@Base @SVER@ + _Py_Raise@Base @SVER@ + _Py_ReadyTypes@Base @SVER@ + _Py_ReleaseInternedUnicodeStrings@Base @SVER@ + _Py_RestoreSignals@Base @SVER@ + _Py_Return@Base @SVER@ + _Py_Set@Base @SVER@ + _Py_SetComp@Base @SVER@ + _Py_Slice@Base @SVER@ + _Py_Starred@Base @SVER@ + _Py_Str@Base @SVER@ + _Py_Subscript@Base @SVER@ + _Py_Suite@Base @SVER@ + _Py_SwappedOp@Base @SVER@ + _Py_TrueStruct@Base @SVER@ + _Py_Try@Base @SVER@ + _Py_Tuple@Base @SVER@ + _Py_Uid_Converter@Base @SVER@ + _Py_UnaryOp@Base @SVER@ + _Py_VaBuildValue_SizeT@Base @SVER@ + _Py_While@Base @SVER@ + _Py_With@Base @SVER@ + _Py_Yield@Base @SVER@ + _Py_YieldFrom@Base @SVER@ + _Py_abstract_hack@Base @SVER@ + _Py_acosh@Base @SVER@ + _Py_add_one_to_index_C@Base @SVER@ + _Py_add_one_to_index_F@Base @SVER@ + _Py_addarc@Base @SVER@ + _Py_addbit@Base @SVER@ + _Py_adddfa@Base @SVER@ + _Py_addfirstsets@Base @SVER@ + _Py_addlabel@Base @SVER@ + _Py_addstate@Base @SVER@ + _Py_alias@Base @SVER@ + _Py_arg@Base @SVER@ + _Py_arguments@Base @SVER@ + _Py_ascii_whitespace@Base @SVER@ + _Py_asdl_int_seq_new@Base @SVER@ + _Py_asdl_seq_new@Base @SVER@ + _Py_asinh@Base @SVER@ + _Py_atanh@Base @SVER@ + _Py_bytes_capitalize@Base @SVER@ + _Py_bytes_isalnum@Base @SVER@ + _Py_bytes_isalpha@Base @SVER@ + _Py_bytes_isdigit@Base @SVER@ + _Py_bytes_islower@Base @SVER@ + _Py_bytes_isspace@Base @SVER@ + _Py_bytes_istitle@Base @SVER@ + _Py_bytes_isupper@Base @SVER@ + _Py_bytes_lower@Base @SVER@ + _Py_bytes_maketrans@Base @SVER@ + _Py_bytes_swapcase@Base @SVER@ + _Py_bytes_title@Base @SVER@ + _Py_bytes_upper@Base @SVER@ + _Py_c_abs@Base @SVER@ + _Py_c_diff@Base @SVER@ + _Py_c_neg@Base @SVER@ + _Py_c_pow@Base @SVER@ + _Py_c_prod@Base @SVER@ + _Py_c_quot@Base @SVER@ + _Py_c_sum@Base @SVER@ + _Py_capitalize__doc__@Base @SVER@ + _Py_char2wchar@Base @SVER@ + _Py_comprehension@Base @SVER@ + _Py_ctype_table@Base @SVER@ + _Py_ctype_tolower@Base @SVER@ + _Py_ctype_toupper@Base @SVER@ + _Py_delbitset@Base @SVER@ + _Py_device_encoding@Base @SVER@ + (arch=!m68k)_Py_dg_dtoa@Base @SVER@ + (arch=!m68k)_Py_dg_freedtoa@Base @SVER@ + (arch=!m68k)_Py_dg_infinity@Base @SVER@ + (arch=!m68k)_Py_dg_stdnan@Base @SVER@ + (arch=!m68k)_Py_dg_strtod@Base @SVER@ + _Py_dup@Base @SVER@ + _Py_expm1@Base @SVER@ + _Py_findlabel@Base @SVER@ + _Py_fopen@Base @SVER@ + _Py_fopen_obj@Base @SVER@ + (arch=i386 lpia m68k)_Py_force_double@Base @SVER@ + (arch=amd64 i386 lpia)_Py_get_387controlword@Base @SVER@ + _Py_get_inheritable@Base @SVER@ + _Py_hashtable_clear@Base @SVER@ + _Py_hashtable_compare_direct@Base @SVER@ + _Py_hashtable_copy@Base @SVER@ + _Py_hashtable_delete@Base @SVER@ + _Py_hashtable_destroy@Base @SVER@ + _Py_hashtable_foreach@Base @SVER@ + _Py_hashtable_get@Base @SVER@ + _Py_hashtable_get_entry@Base @SVER@ + _Py_hashtable_hash_int@Base @SVER@ + _Py_hashtable_hash_ptr@Base @SVER@ + _Py_hashtable_new@Base @SVER@ + _Py_hashtable_new_full@Base @SVER@ + _Py_hashtable_pop@Base @SVER@ + _Py_hashtable_set@Base @SVER@ + _Py_hashtable_size@Base @SVER@ + _Py_hgidentifier@Base @SVER@ + _Py_hgversion@Base @SVER@ + _Py_isalnum__doc__@Base @SVER@ + _Py_isalpha__doc__@Base @SVER@ + _Py_isdigit__doc__@Base @SVER@ + _Py_islower__doc__@Base @SVER@ + _Py_isspace__doc__@Base @SVER@ + _Py_istitle__doc__@Base @SVER@ + _Py_isupper__doc__@Base @SVER@ + _Py_keyword@Base @SVER@ + _Py_log1p@Base @SVER@ + _Py_lower__doc__@Base @SVER@ + _Py_maketrans__doc__@Base @SVER@ + _Py_mergebitset@Base @SVER@ + _Py_meta_grammar@Base @SVER@ + _Py_newbitset@Base @SVER@ + _Py_newgrammar@Base @SVER@ + _Py_normalize_encoding@Base @SVER@ + _Py_open@Base @SVER@ + _Py_open_cloexec_works@Base @SVER@ + _Py_parse_inf_or_nan@Base @SVER@ + _Py_pgen@Base @SVER@ + _Py_samebitset@Base @SVER@ + (arch=amd64 i386 lpia)_Py_set_387controlword@Base @SVER@ + _Py_set_inheritable@Base @SVER@ + _Py_stat@Base @SVER@ + _Py_swapcase__doc__@Base @SVER@ + _Py_title__doc__@Base @SVER@ + _Py_translatelabels@Base @SVER@ + _Py_upper__doc__@Base @SVER@ + _Py_wchar2char@Base @SVER@ + _Py_wfopen@Base @SVER@ + _Py_wgetcwd@Base @SVER@ + _Py_withitem@Base @SVER@ + _Py_wreadlink@Base @SVER@ + _Py_wrealpath@Base @SVER@ + _Py_wstat@Base @SVER@ + + (optional|regex)"^_ctypes_.*@Base$" @SVER@ + (optional|regex)"^ffi_type_.*@Base$" @SVER@ + (optional|regex)"^ffi_closure_.*@Base$" @SVER@ + + (optional|regex)"^PyInit_.*@Base$" @SVER@ --- python3.4-3.4~b1.orig/debian/locale-gen +++ python3.4-3.4~b1/debian/locale-gen @@ -0,0 +1,31 @@ +#!/bin/sh + +LOCPATH=`pwd`/locales +export LOCPATH + +[ -d $LOCPATH ] || mkdir -p $LOCPATH + +umask 022 + +echo "Generating locales..." +while read locale charset; do + case $locale in \#*) continue;; esac + [ -n "$locale" -a -n "$charset" ] || continue + echo -n " `echo $locale | sed 's/\([^.\@]*\).*/\1/'`" + echo -n ".$charset" + echo -n `echo $locale | sed 's/\([^\@]*\)\(\@.*\)*/\2/'` + echo -n '...' + if [ -f $LOCPATH/$locale ]; then + input=$locale + else + input=`echo $locale | sed 's/\([^.]*\)[^@]*\(.*\)/\1\2/'` + fi + localedef -i $input -c -f $charset $LOCPATH/$locale #-A /etc/locale.alias + echo ' done'; \ +done < +# elif defined(__x86_64__) && defined(__ILP32__) +# include +# elif defined(__i386__) +# include +# elif defined(__aarch64__) && defined(__AARCH64EL__) +# include +# elif defined(__alpha__) +# include +# elif defined(__ARM_EABI__) && defined(__ARM_PCS_VFP) +# include +# elif defined(__ARM_EABI__) && !defined(__ARM_PCS_VFP) +# include +# elif defined(__hppa__) +# include +# elif defined(__ia64__) +# include +# elif defined(__m68k__) && !defined(__mcoldfire__) +# include +# elif defined(__mips_hard_float) && defined(_MIPSEL) +# if _MIPS_SIM == _ABIO32 +# include +# elif _MIPS_SIM == _ABIN32 +# include +# elif _MIPS_SIM == _ABI64 +# include +# else +# error unknown multiarch location for @header@ +# endif +# elif defined(__mips_hard_float) +# if _MIPS_SIM == _ABIO32 +# include +# elif _MIPS_SIM == _ABIN32 +# include +# elif _MIPS_SIM == _ABI64 +# include +# else +# error unknown multiarch location for @header@ +# endif +# elif defined(__powerpc__) && defined(__SPE__) +# include +# elif defined(__powerpc64__) +# if defined(__LITTLE_ENDIAN__) +# include +# else +# include +# endif +# elif defined(__powerpc__) +# include +# elif defined(__s390x__) +# include +# elif defined(__s390__) +# include +# elif defined(__sh__) && defined(__LITTLE_ENDIAN__) +# include +# elif defined(__sparc__) && defined(__arch64__) +# include +# elif defined(__sparc__) +# include +# else +# error unknown multiarch location for @header@ +# endif +#elif defined(__FreeBSD_kernel__) +# if defined(__LP64__) +# include +# elif defined(__i386__) +# include +# else +# error unknown multiarch location for @header@ +# endif +#elif defined(__gnu_hurd__) +# include +#else +# error unknown multiarch location for @header@ +#endif --- python3.4-3.4~b1.orig/debian/patches/apport-support.dpatch +++ python3.4-3.4~b1/debian/patches/apport-support.dpatch @@ -0,0 +1,40 @@ +#! /bin/sh -e + +dir= +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" + dir="$3/" +elif [ $# -ne 1 ]; then + echo >&2 "usage: `basename $0`: -patch|-unpatch [-d ]" + exit 1 +fi +case "$1" in + -patch) + patch $pdir -f --no-backup-if-mismatch -p0 < $0 + ;; + -unpatch) + patch $pdir -f --no-backup-if-mismatch -R -p0 < $0 + ;; + *) + echo >&2 "usage: `basename $0`: -patch|-unpatch [-d ]" + exit 1 +esac +exit 0 + +--- Lib/site.py 2004-07-20 12:28:28.000000000 +1000 ++++ Lib/site.py 2006-11-09 09:28:32.000000000 +1100 +@@ -393,6 +393,14 @@ + # this module is run as a script, because this code is executed twice. + if hasattr(sys, "setdefaultencoding"): + del sys.setdefaultencoding ++ # install the apport exception handler if available ++ try: ++ import apport_python_hook ++ except ImportError: ++ pass ++ else: ++ apport_python_hook.install() ++ + + main() + --- python3.4-3.4~b1.orig/debian/patches/avoid-rpath.diff +++ python3.4-3.4~b1/debian/patches/avoid-rpath.diff @@ -0,0 +1,32 @@ +# DP: avoid runtime library path for some extension modules. + +Index: b/setup.py +=================================================================== +--- a/setup.py ++++ b/setup.py +@@ -1026,6 +1026,15 @@ + print("bsddb lib dir:", dblib_dir, " inc dir:", db_incdir) + db_incs = [db_incdir] + dblibs = [dblib] ++ # only add db_incdir/dblib_dir if not in the standard paths ++ # avoids a runtime library path for a system library dir ++ if db_incdir in inc_dirs: ++ db_incs = [] ++ else: ++ db_incs = [db_incdir] ++ if dblib_dir[0] in lib_dirs: ++ dblib_dir = [] ++ dblibs = [dblib] + else: + if db_setup_debug: print("db: no appropriate library found") + db_incs = None +@@ -1136,6 +1145,9 @@ + # can end up with a bad search path order. + if sqlite_incdir not in self.compiler.include_dirs: + include_dirs.append(sqlite_incdir) ++ # avoid a runtime library path for a system library dir ++ if sqlite_libdir and sqlite_libdir[0] in lib_dirs: ++ sqlite_libdir = None + exts.append(Extension('_sqlite3', sqlite_srcs, + define_macros=sqlite_defines, + include_dirs=include_dirs, --- python3.4-3.4~b1.orig/debian/patches/bdist-wininst-notfound.diff +++ python3.4-3.4~b1/debian/patches/bdist-wininst-notfound.diff @@ -0,0 +1,17 @@ +# DP: suggest installation of the pythonX.Y-dev package, if bdist_wininst +# DP: cannot find the wininst-* files. + +--- a/Lib/distutils/command/bdist_wininst.py ++++ b/Lib/distutils/command/bdist_wininst.py +@@ -342,7 +342,10 @@ + sfix = '' + + filename = os.path.join(directory, "wininst-%.1f%s.exe" % (bv, sfix)) +- f = open(filename, "rb") ++ try: ++ f = open(filename, "rb") ++ except IOError as e: ++ raise DistutilsFileError(str(e) + ', %s not included in the Debian packages.' % filename) + try: + return f.read() + finally: --- python3.4-3.4~b1.orig/debian/patches/ctypes-arm.diff +++ python3.4-3.4~b1/debian/patches/ctypes-arm.diff @@ -0,0 +1,34 @@ +Index: b/Lib/ctypes/util.py +=================================================================== +--- a/Lib/ctypes/util.py ++++ b/Lib/ctypes/util.py +@@ -198,16 +198,27 @@ + + def _findSoname_ldconfig(name): + import struct ++ # XXX this code assumes that we know all unames and that a single ++ # ABI is supported per uname; instead we should find what the ++ # ABI is (e.g. check ABI of current process) or simply ask libc ++ # to load the library for us ++ uname = os.uname() ++ # ARM has a variety of unames, e.g. armv7l ++ if uname.machine.startswith("arm"): ++ machine = "arm" + if struct.calcsize('l') == 4: +- machine = os.uname().machine + '-32' ++ machine = uname.machine + '-32' + else: +- machine = os.uname().machine + '-64' ++ machine = uname.machine + '-64' + mach_map = { + 'x86_64-64': 'libc6,x86-64', + 'ppc64-64': 'libc6,64bit', + 'sparc64-64': 'libc6,64bit', + 's390x-64': 'libc6,64bit', + 'ia64-64': 'libc6,IA-64', ++ # this actually breaks on biarch or multiarch as the first ++ # library wins; uname doesn't tell us which ABI we're using ++ 'arm-32': 'libc6(,hard-float)?', + } + abi_type = mach_map.get(machine, 'libc6') + --- python3.4-3.4~b1.orig/debian/patches/deb-locations.diff +++ python3.4-3.4~b1/debian/patches/deb-locations.diff @@ -0,0 +1,30 @@ +# DP: adjust locations of directories to debian policy + +Index: b/Lib/pydoc.py +=================================================================== +--- a/Lib/pydoc.py ++++ b/Lib/pydoc.py +@@ -27,6 +27,10 @@ + + Module docs for core modules are assumed to be in + ++ /usr/share/doc/pythonX.Y/html/library ++ ++if the pythonX.Y-doc package is installed or in ++ + http://docs.python.org/X.Y/library/ + + This can be overridden by setting the PYTHONDOCS environment variable +Index: b/Misc/python.man +=================================================================== +--- a/Misc/python.man ++++ b/Misc/python.man +@@ -330,7 +330,7 @@ + These are subject to difference depending on local installation + conventions; ${prefix} and ${exec_prefix} are installation-dependent + and should be interpreted as for GNU software; they may be the same. +-The default for both is \fI/usr/local\fP. ++On Debian GNU/{Hurd,Linux} the default for both is \fI/usr\fP. + .IP \fI${exec_prefix}/bin/python\fP + Recommended location of the interpreter. + .PP --- python3.4-3.4~b1.orig/debian/patches/deb-setup.diff +++ python3.4-3.4~b1/debian/patches/deb-setup.diff @@ -0,0 +1,33 @@ +# DP: Don't include /usr/local/include and /usr/local/lib as gcc search paths + +Index: b/setup.py +=================================================================== +--- a/setup.py ++++ b/setup.py +@@ -238,8 +238,10 @@ + # unfortunately, distutils doesn't let us provide separate C and C++ + # compilers + if compiler is not None: +- (ccshared,cflags) = sysconfig.get_config_vars('CCSHARED','CFLAGS') +- args['compiler_so'] = compiler + ' ' + ccshared + ' ' + cflags ++ (ccshared, cppflags, cflags) = \ ++ sysconfig.get_config_vars('CCSHARED', 'CPPFLAGS', 'CFLAGS') ++ cppflags = ' '.join([f for f in cppflags.split() if not f.startswith('-I')]) ++ args['compiler_so'] = compiler + ' ' + ccshared + ' ' + cppflags + ' ' + cflags + self.compiler.set_executables(**args) + + build_ext.build_extensions(self) +@@ -437,12 +439,7 @@ + os.unlink(tmpfile) + + def detect_modules(self): +- # Ensure that /usr/local is always used, but the local build +- # directories (i.e. '.' and 'Include') must be first. See issue +- # 10520. +- if not cross_compiling: +- add_dir_to_list(self.compiler.library_dirs, '/usr/local/lib') +- add_dir_to_list(self.compiler.include_dirs, '/usr/local/include') ++ # On Debian /usr/local is always used, so we don't include it twice + # only change this for cross builds for 3.3, issues on Mageia + if cross_compiling: + self.add_gcc_paths() --- python3.4-3.4~b1.orig/debian/patches/disable-sem-check.diff +++ python3.4-3.4~b1/debian/patches/disable-sem-check.diff @@ -0,0 +1,38 @@ +# DP: Assume working semaphores, don't rely on running kernel for the check. + +Index: b/configure.ac +=================================================================== +--- a/configure.ac ++++ b/configure.ac +@@ -3928,8 +3928,13 @@ + AC_MSG_RESULT($ac_cv_posix_semaphores_enabled) + if test $ac_cv_posix_semaphores_enabled = no + then +- AC_DEFINE(POSIX_SEMAPHORES_NOT_ENABLED, 1, +- [Define if POSIX semaphores aren't enabled on your system]) ++ case $ac_sys_system in ++ Linux*) # assume yes, see https://launchpad.net/bugs/630511 ++ ;; ++ *) ++ AC_DEFINE(POSIX_SEMAPHORES_NOT_ENABLED, 1, ++ [Define if POSIX semaphores aren't enabled on your system]) ++ esac + fi + + # Multiprocessing check for broken sem_getvalue +@@ -3964,8 +3969,13 @@ + AC_MSG_RESULT($ac_cv_broken_sem_getvalue) + if test $ac_cv_broken_sem_getvalue = yes + then +- AC_DEFINE(HAVE_BROKEN_SEM_GETVALUE, 1, +- [define to 1 if your sem_getvalue is broken.]) ++ case $ac_sys_system in ++ Linux*) # assume yes, see https://launchpad.net/bugs/630511 ++ ;; ++ *) ++ AC_DEFINE(HAVE_BROKEN_SEM_GETVALUE, 1, ++ [define to 1 if your sem_getvalue is broken.]) ++ esac + fi + + # determine what size digit to use for Python's longs --- python3.4-3.4~b1.orig/debian/patches/disable-utimes.diff +++ python3.4-3.4~b1/debian/patches/disable-utimes.diff @@ -0,0 +1,13 @@ +# DP: disable check for utimes function, which is broken in glibc-2.3.2 + +--- a/configure.ac ++++ b/configure.ac +@@ -2588,7 +2588,7 @@ + setlocale setregid setreuid setresuid setresgid setsid setpgid setpgrp setuid setvbuf \ + sigaction siginterrupt sigrelse snprintf strftime strlcpy \ + sysconf tcgetpgrp tcsetpgrp tempnam timegm times tmpfile tmpnam tmpnam_r \ +- truncate uname unsetenv utimes waitpid wait3 wait4 \ ++ truncate uname unsetenv waitpid wait3 wait4 \ + wcscoll wcsftime wcsxfrm _getpty) + + # For some functions, having a definition is not sufficient, since --- python3.4-3.4~b1.orig/debian/patches/distutils-init.diff +++ python3.4-3.4~b1/debian/patches/distutils-init.diff @@ -0,0 +1,60 @@ +# DP: Use _sysconfigdata.py in distutils to initialize distutils + +Index: b/Lib/distutils/sysconfig.py +=================================================================== +--- a/Lib/distutils/sysconfig.py ++++ b/Lib/distutils/sysconfig.py +@@ -447,49 +447,11 @@ + + def _init_posix(): + """Initialize the module as appropriate for POSIX systems.""" +- g = {} +- # load the installed Makefile: +- try: +- filename = get_makefile_filename() +- parse_makefile(filename, g) +- except OSError as msg: +- my_msg = "invalid Python installation: unable to open %s" % filename +- if hasattr(msg, "strerror"): +- my_msg = my_msg + " (%s)" % msg.strerror +- +- raise DistutilsPlatformError(my_msg) +- +- # load the installed pyconfig.h: +- try: +- filename = get_config_h_filename() +- with open(filename) as file: +- parse_config_h(file, g) +- except OSError as msg: +- my_msg = "invalid Python installation: unable to open %s" % filename +- if hasattr(msg, "strerror"): +- my_msg = my_msg + " (%s)" % msg.strerror +- +- raise DistutilsPlatformError(my_msg) +- +- # On AIX, there are wrong paths to the linker scripts in the Makefile +- # -- these paths are relative to the Python source, but when installed +- # the scripts are in another directory. +- if python_build: +- g['LDSHARED'] = g['BLDSHARED'] +- +- elif get_python_version() < '2.1': +- # The following two branches are for 1.5.2 compatibility. +- if sys.platform == 'aix4': # what about AIX 3.x ? +- # Linker script is in the config directory, not in Modules as the +- # Makefile says. +- python_lib = get_python_lib(standard_lib=1) +- ld_so_aix = os.path.join(python_lib, 'config', 'ld_so_aix') +- python_exp = os.path.join(python_lib, 'config', 'python.exp') +- +- g['LDSHARED'] = "%s %s -bI:%s" % (ld_so_aix, g['CC'], python_exp) +- ++ # _sysconfigdata is generated at build time, see the sysconfig module ++ from _sysconfigdata import build_time_vars + global _config_vars +- _config_vars = g ++ _config_vars = {} ++ _config_vars.update(build_time_vars) + + + def _init_nt(): --- python3.4-3.4~b1.orig/debian/patches/distutils-install-layout.diff +++ python3.4-3.4~b1/debian/patches/distutils-install-layout.diff @@ -0,0 +1,254 @@ +# DP: distutils: Add an option --install-layout=deb, which +# DP: - installs into $prefix/dist-packages instead of $prefix/site-packages. +# DP: - doesn't encode the python version into the egg name. + +Index: b/Lib/distutils/command/install_egg_info.py +=================================================================== +--- a/Lib/distutils/command/install_egg_info.py ++++ b/Lib/distutils/command/install_egg_info.py +@@ -14,18 +14,38 @@ + description = "Install package's PKG-INFO metadata as an .egg-info file" + user_options = [ + ('install-dir=', 'd', "directory to install to"), ++ ('install-layout', None, "custom installation layout"), + ] + + def initialize_options(self): + self.install_dir = None ++ self.install_layout = None ++ self.prefix_option = None + + def finalize_options(self): + self.set_undefined_options('install_lib',('install_dir','install_dir')) +- basename = "%s-%s-py%s.egg-info" % ( +- to_filename(safe_name(self.distribution.get_name())), +- to_filename(safe_version(self.distribution.get_version())), +- sys.version[:3] +- ) ++ self.set_undefined_options('install',('install_layout','install_layout')) ++ self.set_undefined_options('install',('prefix_option','prefix_option')) ++ if self.install_layout: ++ if not self.install_layout.lower() in ['deb', 'unix']: ++ raise DistutilsOptionError( ++ "unknown value for --install-layout") ++ no_pyver = (self.install_layout.lower() == 'deb') ++ elif self.prefix_option: ++ no_pyver = False ++ else: ++ no_pyver = True ++ if no_pyver: ++ basename = "%s-%s.egg-info" % ( ++ to_filename(safe_name(self.distribution.get_name())), ++ to_filename(safe_version(self.distribution.get_version())) ++ ) ++ else: ++ basename = "%s-%s-py%s.egg-info" % ( ++ to_filename(safe_name(self.distribution.get_name())), ++ to_filename(safe_version(self.distribution.get_version())), ++ sys.version[:3] ++ ) + self.target = os.path.join(self.install_dir, basename) + self.outputs = [self.target] + +Index: b/Lib/distutils/command/install.py +=================================================================== +--- a/Lib/distutils/command/install.py ++++ b/Lib/distutils/command/install.py +@@ -50,6 +50,20 @@ + 'scripts': '$base/bin', + 'data' : '$base', + }, ++ 'unix_local': { ++ 'purelib': '$base/local/lib/python$py_version_short/dist-packages', ++ 'platlib': '$platbase/local/lib/python$py_version_short/dist-packages', ++ 'headers': '$base/local/include/python$py_version_short/$dist_name', ++ 'scripts': '$base/local/bin', ++ 'data' : '$base/local', ++ }, ++ 'deb_system': { ++ 'purelib': '$base/lib/python3/dist-packages', ++ 'platlib': '$platbase/lib/python3/dist-packages', ++ 'headers': '$base/include/python$py_version_short/$dist_name', ++ 'scripts': '$base/bin', ++ 'data' : '$base', ++ }, + 'unix_home': { + 'purelib': '$base/lib/python', + 'platlib': '$base/lib/python', +@@ -146,6 +160,9 @@ + + ('record=', None, + "filename in which to record list of installed files"), ++ ++ ('install-layout=', None, ++ "installation layout to choose (known values: deb, unix)"), + ] + + boolean_options = ['compile', 'force', 'skip-build'] +@@ -166,6 +183,7 @@ + self.exec_prefix = None + self.home = None + self.user = 0 ++ self.prefix_option = None + + # These select only the installation base; it's up to the user to + # specify the installation scheme (currently, that means supplying +@@ -187,6 +205,9 @@ + self.install_userbase = USER_BASE + self.install_usersite = USER_SITE + ++ # enable custom installation, known values: deb ++ self.install_layout = None ++ + self.compile = None + self.optimize = None + +@@ -426,6 +447,7 @@ + self.install_base = self.install_platbase = self.home + self.select_scheme("unix_home") + else: ++ self.prefix_option = self.prefix + if self.prefix is None: + if self.exec_prefix is not None: + raise DistutilsOptionError( +@@ -440,7 +462,24 @@ + + self.install_base = self.prefix + self.install_platbase = self.exec_prefix +- self.select_scheme("unix_prefix") ++ if self.install_layout: ++ if self.install_layout.lower() in ['deb']: ++ self.select_scheme("deb_system") ++ elif self.install_layout.lower() in ['unix']: ++ self.select_scheme("unix_prefix") ++ else: ++ raise DistutilsOptionError( ++ "unknown value for --install-layout") ++ elif (self.prefix_option and os.path.normpath(self.prefix) != '/usr/local') \ ++ or 'PYTHONUSERBASE' in os.environ \ ++ or 'VIRTUAL_ENV' in os.environ \ ++ or 'real_prefix' in sys.__dict__: ++ self.select_scheme("unix_prefix") ++ else: ++ if os.path.normpath(self.prefix) == '/usr/local': ++ self.prefix = self.exec_prefix = '/usr' ++ self.install_base = self.install_platbase = '/usr' ++ self.select_scheme("unix_local") + + def finalize_other(self): + """Finalizes options for non-posix platforms""" +Index: b/Lib/distutils/sysconfig.py +=================================================================== +--- a/Lib/distutils/sysconfig.py ++++ b/Lib/distutils/sysconfig.py +@@ -134,6 +134,7 @@ + If 'prefix' is supplied, use it instead of sys.base_prefix or + sys.base_exec_prefix -- i.e., ignore 'plat_specific'. + """ ++ is_default_prefix = not prefix or os.path.normpath(prefix) in ('/usr', '/usr/local') + if prefix is None: + if standard_lib: + prefix = plat_specific and BASE_EXEC_PREFIX or BASE_PREFIX +@@ -145,6 +146,8 @@ + "lib", "python" + get_python_version()) + if standard_lib: + return libpython ++ elif is_default_prefix and 'PYTHONUSERBASE' not in os.environ and 'VIRTUAL_ENV' not in os.environ and 'real_prefix' not in sys.__dict__: ++ return os.path.join(prefix, "lib", "python3", "dist-packages") + else: + return os.path.join(libpython, "site-packages") + elif os.name == "nt": +Index: b/Lib/site.py +=================================================================== +--- a/Lib/site.py ++++ b/Lib/site.py +@@ -288,6 +288,13 @@ + + if ENABLE_USER_SITE and os.path.isdir(user_site): + addsitedir(user_site, known_paths) ++ if ENABLE_USER_SITE: ++ for dist_libdir in ("lib", "local/lib"): ++ user_site = os.path.join(USER_BASE, dist_libdir, ++ "python" + sys.version[:3], ++ "dist-packages") ++ if os.path.isdir(user_site): ++ addsitedir(user_site, known_paths) + return known_paths + + def getsitepackages(prefixes=None): +Index: b/Lib/test/test_site.py +=================================================================== +--- a/Lib/test/test_site.py ++++ b/Lib/test/test_site.py +@@ -244,12 +244,20 @@ + self.assertEqual(dirs[2], wanted) + elif os.sep == '/': + # OS X non-framwework builds, Linux, FreeBSD, etc +- self.assertEqual(len(dirs), 2) +- wanted = os.path.join('xoxo', 'lib', 'python' + sys.version[:3], +- 'site-packages') ++ self.assertEqual(len(dirs), 4) ++ wanted = os.path.join('xoxo', 'local', 'lib', ++ 'python' + sys.version[:3], ++ 'dist-packages') + self.assertEqual(dirs[0], wanted) +- wanted = os.path.join('xoxo', 'lib', 'site-python') ++ wanted = os.path.join('xoxo', 'lib', ++ 'python3', 'dist-packages') + self.assertEqual(dirs[1], wanted) ++ wanted = os.path.join('xoxo', 'lib', ++ 'python' + sys.version[:3], ++ 'dist-packages') ++ self.assertEqual(dirs[2], wanted) ++ wanted = os.path.join('xoxo', 'lib', 'dist-python') ++ self.assertEqual(dirs[3], wanted) + else: + # other platforms + self.assertEqual(len(dirs), 2) +Index: b/Lib/distutils/tests/test_bdist_dumb.py +=================================================================== +--- a/Lib/distutils/tests/test_bdist_dumb.py ++++ b/Lib/distutils/tests/test_bdist_dumb.py +@@ -85,7 +85,7 @@ + fp.close() + + contents = sorted(os.path.basename(fn) for fn in contents) +- wanted = ['foo-0.1-py%s.%s.egg-info' % sys.version_info[:2], 'foo.py'] ++ wanted = ['foo-0.1.egg-info', 'foo.py'] + if not sys.dont_write_bytecode: + wanted.append('foo.%s.pyc' % sys.implementation.cache_tag) + self.assertEqual(contents, sorted(wanted)) +Index: b/Lib/distutils/tests/test_install.py +=================================================================== +--- a/Lib/distutils/tests/test_install.py ++++ b/Lib/distutils/tests/test_install.py +@@ -194,7 +194,7 @@ + found = [os.path.basename(line) for line in content.splitlines()] + expected = ['hello.py', 'hello.%s.pyc' % sys.implementation.cache_tag, + 'sayhi', +- 'UNKNOWN-0.0.0-py%s.%s.egg-info' % sys.version_info[:2]] ++ 'UNKNOWN-0.0.0-py.egg-info'] + self.assertEqual(found, expected) + + def test_record_extensions(self): +@@ -224,7 +224,7 @@ + + found = [os.path.basename(line) for line in content.splitlines()] + expected = [_make_ext_name('xx'), +- 'UNKNOWN-0.0.0-py%s.%s.egg-info' % sys.version_info[:2]] ++ 'UNKNOWN-0.0.0.egg-info'] + self.assertEqual(found, expected) + + def test_debug_mode(self): +Index: b/Lib/pydoc.py +=================================================================== +--- a/Lib/pydoc.py ++++ b/Lib/pydoc.py +@@ -383,6 +383,7 @@ + 'marshal', 'posix', 'signal', 'sys', + '_thread', 'zipimport') or + (file.startswith(basedir) and ++ not file.startswith(os.path.join(basedir, 'dist-packages')) and + not file.startswith(os.path.join(basedir, 'site-packages')))) and + object.__name__ not in ('xml.etree', 'test.pydoc_mod')): + if docloc.startswith("http://"): --- python3.4-3.4~b1.orig/debian/patches/distutils-link.diff +++ python3.4-3.4~b1/debian/patches/distutils-link.diff @@ -0,0 +1,18 @@ +# DP: Don't add standard library dirs to library_dirs and runtime_library_dirs. + +--- a/Lib/distutils/unixccompiler.py ++++ b/Lib/distutils/unixccompiler.py +@@ -153,6 +153,13 @@ + runtime_library_dirs) + libraries, library_dirs, runtime_library_dirs = fixed_args + ++ # filter out standard library paths, which are not explicitely needed ++ # for linking ++ library_dirs = [dir for dir in library_dirs ++ if not dir in ('/lib', '/lib64', '/usr/lib', '/usr/lib64')] ++ runtime_library_dirs = [dir for dir in runtime_library_dirs ++ if not dir in ('/lib', '/lib64', '/usr/lib', '/usr/lib64')] ++ + lib_opts = gen_lib_options(self, library_dirs, runtime_library_dirs, + libraries) + if not isinstance(output_dir, (str, type(None))): --- python3.4-3.4~b1.orig/debian/patches/distutils-sysconfig.diff +++ python3.4-3.4~b1/debian/patches/distutils-sysconfig.diff @@ -0,0 +1,45 @@ +# DP: Get CONFIGURE_CFLAGS, CONFIGURE_CPPFLAGS, CONFIGURE_LDFLAGS from +# DP: the python build, when CFLAGS, CPPFLAGS, LDSHARED) are not set +# DP: in the environment. + +Index: b/Lib/distutils/sysconfig.py +=================================================================== +--- a/Lib/distutils/sysconfig.py ++++ b/Lib/distutils/sysconfig.py +@@ -187,9 +187,11 @@ + _osx_support.customize_compiler(_config_vars) + _config_vars['CUSTOMIZED_OSX_COMPILER'] = 'True' + +- (cc, cxx, opt, cflags, ccshared, ldshared, shlib_suffix, ar, ar_flags) = \ ++ (cc, cxx, opt, cflags, ccshared, ldshared, shlib_suffix, ar, ar_flags, ++ configure_cppflags, configure_cflags, configure_ldflags) = \ + get_config_vars('CC', 'CXX', 'OPT', 'CFLAGS', +- 'CCSHARED', 'LDSHARED', 'SHLIB_SUFFIX', 'AR', 'ARFLAGS') ++ 'CCSHARED', 'LDSHARED', 'SHLIB_SUFFIX', 'AR', 'ARFLAGS', ++ 'CONFIGURE_CPPFLAGS', 'CONFIGURE_CFLAGS', 'CONFIGURE_LDFLAGS') + + if 'CC' in os.environ: + newcc = os.environ['CC'] +@@ -210,13 +212,22 @@ + cpp = cc + " -E" # not always + if 'LDFLAGS' in os.environ: + ldshared = ldshared + ' ' + os.environ['LDFLAGS'] ++ elif configure_ldflags: ++ ldshared = ldshared + ' ' + configure_ldflags + if 'CFLAGS' in os.environ: + cflags = opt + ' ' + os.environ['CFLAGS'] + ldshared = ldshared + ' ' + os.environ['CFLAGS'] ++ elif configure_cflags: ++ cflags = opt + ' ' + configure_cflags ++ ldshared = ldshared + ' ' + configure_cflags + if 'CPPFLAGS' in os.environ: + cpp = cpp + ' ' + os.environ['CPPFLAGS'] + cflags = cflags + ' ' + os.environ['CPPFLAGS'] + ldshared = ldshared + ' ' + os.environ['CPPFLAGS'] ++ elif configure_cppflags: ++ cpp = cpp + ' ' + configure_cppflags ++ cflags = cflags + ' ' + configure_cppflags ++ ldshared = ldshared + ' ' + configure_cppflags + if 'AR' in os.environ: + ar = os.environ['AR'] + if 'ARFLAGS' in os.environ: --- python3.4-3.4~b1.orig/debian/patches/doc-build.diff +++ python3.4-3.4~b1/debian/patches/doc-build.diff @@ -0,0 +1,38 @@ +# DP: Allow docs to be built with Sphinx 0.5.x. + +--- a/Doc/tools/sphinxext/pyspecific.py ++++ b/Doc/tools/sphinxext/pyspecific.py +@@ -171,8 +171,15 @@ + from docutils.io import StringOutput + from docutils.utils import new_document + +-from sphinx.builders import Builder +-from sphinx.writers.text import TextWriter ++try: ++ from sphinx.builders import Builder ++except ImportError: ++ from sphinx.builder import Builder ++ ++try: ++ from sphinx.writers.text import TextWriter ++except ImportError: ++ from sphinx.textwriter import TextWriter + + + class PydocTopicsBuilder(Builder): +--- a/Doc/tools/sphinxext/suspicious.py ++++ b/Doc/tools/sphinxext/suspicious.py +@@ -47,7 +47,12 @@ + import sys + + from docutils import nodes +-from sphinx.builders import Builder ++ ++try: ++ from sphinx.builders import Builder ++except ImportError: ++ from sphinx.builder import Builder ++ + + detect_all = re.compile(r''' + ::(?=[^=])| # two :: (but NOT ::=) --- python3.4-3.4~b1.orig/debian/patches/doc-faq.dpatch +++ python3.4-3.4~b1/debian/patches/doc-faq.dpatch @@ -0,0 +1,52 @@ +#! /bin/sh -e + +# DP: Mention the FAQ on the documentation index page. + +dir= +if [ $# -eq 3 -a "$2" = '-d' ]; then + pdir="-d $3" + dir="$3/" +elif [ $# -ne 1 ]; then + echo >&2 "usage: `basename $0`: -patch|-unpatch [-d ]" + exit 1 +fi +case "$1" in + -patch) + patch $pdir -f --no-backup-if-mismatch -p0 < $0 + ;; + -unpatch) + patch $pdir -f --no-backup-if-mismatch -R -p0 < $0 + ;; + *) + echo >&2 "usage: `basename $0`: -patch|-unpatch [-d ]" + exit 1 +esac +exit 0 + +--- Doc/html/index.html.in~ 2002-04-01 18:11:27.000000000 +0200 ++++ Doc/html/index.html.in 2003-04-05 13:33:35.000000000 +0200 +@@ -123,6 +123,24 @@ + + + ++ ++ ++   ++

++ ++ ++   ++ ++ ++ + + +

--- python3.4-3.4~b1.orig/debian/patches/doc-nodownload.diff +++ python3.4-3.4~b1/debian/patches/doc-nodownload.diff @@ -0,0 +1,13 @@ +# DP: Don't try to download documentation tools + +--- a/Doc/Makefile ++++ b/Doc/Makefile +@@ -58,7 +58,7 @@ + + update: clean checkout + +-build: checkout ++build: + mkdir -p build/$(BUILDER) build/doctrees + $(PYTHON) tools/sphinx-build.py $(ALLSPHINXOPTS) + @echo --- python3.4-3.4~b1.orig/debian/patches/enable-fpectl.diff +++ python3.4-3.4~b1/debian/patches/enable-fpectl.diff @@ -0,0 +1,16 @@ +# DP: Enable the build of the fpectl module. + +Index: b/setup.py +=================================================================== +--- a/setup.py ++++ b/setup.py +@@ -1305,6 +1305,9 @@ + else: + missing.append('_curses_panel') + ++ #fpectl fpectlmodule.c ... ++ exts.append( Extension('fpectl', ['fpectlmodule.c']) ) ++ + # Andrew Kuchling's zlib module. Note that some versions of zlib + # 1.1.3 have security problems. See CERT Advisory CA-2002-07: + # http://www.cert.org/advisories/CA-2002-07.html --- python3.4-3.4~b1.orig/debian/patches/ext-no-libpython-link.diff +++ python3.4-3.4~b1/debian/patches/ext-no-libpython-link.diff @@ -0,0 +1,24 @@ +# DP: Don't link extensions with the shared libpython library. + +Index: b/Lib/distutils/command/build_ext.py +=================================================================== +--- a/Lib/distutils/command/build_ext.py ++++ b/Lib/distutils/command/build_ext.py +@@ -245,7 +245,7 @@ + # For building extensions with a shared Python library, + # Python's library directory must be appended to library_dirs + # See Issues: #1600860, #4366 +- if (sysconfig.get_config_var('Py_ENABLE_SHARED')): ++ if False and (sysconfig.get_config_var('Py_ENABLE_SHARED')): + if sys.executable.startswith(os.path.join(sys.exec_prefix, "bin")): + # building third party extensions + self.library_dirs.append(sysconfig.get_config_var('LIBDIR')) +@@ -735,7 +735,7 @@ + return ext.libraries + else: + from distutils import sysconfig +- if sysconfig.get_config_var('Py_ENABLE_SHARED'): ++ if False and sysconfig.get_config_var('Py_ENABLE_SHARED'): + pythonlib = 'python{}.{}{}'.format( + sys.hexversion >> 24, (sys.hexversion >> 16) & 0xff, + sys.abiflags) --- python3.4-3.4~b1.orig/debian/patches/gdbm-import.diff +++ python3.4-3.4~b1/debian/patches/gdbm-import.diff @@ -0,0 +1,12 @@ +# DP: suggest installation of python3-gdbm package on failing _gdbm import + +--- a/Lib/dbm/gnu.py ++++ b/Lib/dbm/gnu.py +@@ -1,3 +1,6 @@ + """Provide the _gdbm module as a dbm submodule.""" + +-from _gdbm import * ++try: ++ from _gdbm import * ++except ImportError as msg: ++ raise ImportError(str(msg) + ', please install the python3-gdbm package') --- python3.4-3.4~b1.orig/debian/patches/hg-updates.diff +++ python3.4-3.4~b1/debian/patches/hg-updates.diff @@ -0,0 +1,41459 @@ +# DP: hg updates from the trunk (until 2013-12-31, 88229:e5fa13aae1cc). +## DP: hg updates of the 3.4 release branch (until 2014-xx-xx, ). + +# hg diff -r v3.4.0b1 | filterdiff --exclude=.hgignore --exclude=.hgeol --exclude=.hgtags --remove-timestamps + +diff -r 3405dc9a6afa Doc/Makefile +--- a/Doc/Makefile ++++ b/Doc/Makefile +@@ -186,6 +186,7 @@ + autobuild-dev: + make update + make dist SPHINXOPTS='-A daily=1 -A versionswitcher=1' ++ -make suspicious + + # for quick rebuilds (HTML only) + autobuild-html: +diff -r 3405dc9a6afa Doc/distutils/index.rst +--- a/Doc/distutils/index.rst ++++ b/Doc/distutils/index.rst +@@ -12,6 +12,16 @@ + make Python modules and extensions easily available to a wider audience with + very little overhead for build/release/install mechanics. + ++.. note:: ++ ++ This guide only covers the basic tools for building and distributing ++ extensions that are provided as part of this version of Python. Third ++ party tools offer easier to use and more secure alternatives. Refer to the ++ `quick recommendations section ++ `__ ++ in the Python Packaging User Guide for more information. ++ ++ + .. toctree:: + :maxdepth: 2 + :numbered: +diff -r 3405dc9a6afa Doc/extending/index.rst +--- a/Doc/extending/index.rst ++++ b/Doc/extending/index.rst +@@ -21,6 +21,15 @@ + For a detailed description of the whole Python/C API, see the separate + :ref:`c-api-index`. + ++.. note:: ++ ++ This guide only covers the basic tools for creating extensions provided ++ as part of this version of CPython. Third party tools may offer simpler ++ alternatives. Refer to the `binary extensions section ++ `__ ++ in the Python Packaging User Guide for more information. ++ ++ + .. toctree:: + :maxdepth: 2 + :numbered: +diff -r 3405dc9a6afa Doc/faq/library.rst +--- a/Doc/faq/library.rst ++++ b/Doc/faq/library.rst +@@ -662,7 +662,7 @@ + .. XXX check if wiki page is still up to date + + A summary of available frameworks is maintained by Paul Boddie at +-http://wiki.python.org/moin/WebProgramming . ++http://wiki.python.org/moin/WebProgramming\ . + + Cameron Laird maintains a useful set of pages about Python web technologies at + http://phaseit.net/claird/comp.lang.python/web_python. +diff -r 3405dc9a6afa Doc/faq/programming.rst +--- a/Doc/faq/programming.rst ++++ b/Doc/faq/programming.rst +@@ -1193,34 +1193,10 @@ + Dictionaries + ============ + +-How can I get a dictionary to display its keys in a consistent order? +---------------------------------------------------------------------- ++How can I get a dictionary to store and display its keys in a consistent order? ++------------------------------------------------------------------------------- + +-You can't. Dictionaries store their keys in an unpredictable order, so the +-display order of a dictionary's elements will be similarly unpredictable. +- +-This can be frustrating if you want to save a printable version to a file, make +-some changes and then compare it with some other printed dictionary. In this +-case, use the ``pprint`` module to pretty-print the dictionary; the items will +-be presented in order sorted by the key. +- +-A more complicated solution is to subclass ``dict`` to create a +-``SortedDict`` class that prints itself in a predictable order. Here's one +-simpleminded implementation of such a class:: +- +- class SortedDict(dict): +- def __repr__(self): +- keys = sorted(self.keys()) +- result = ("{!r}: {!r}".format(k, self[k]) for k in keys) +- return "{{{}}}".format(", ".join(result)) +- +- __str__ = __repr__ +- +-This will work for many common situations you might encounter, though it's far +-from a perfect solution. The largest flaw is that if some values in the +-dictionary are also dictionaries, their values won't be presented in any +-particular order. +- ++Use :class:`collections.OrderedDict`. + + I want to do a complicated sort: can you do a Schwartzian Transform in Python? + ------------------------------------------------------------------------------ +@@ -1631,26 +1607,34 @@ + How do I create a .pyc file? + ---------------------------- + +-When a module is imported for the first time (or when the source is more recent +-than the current compiled file) a ``.pyc`` file containing the compiled code +-should be created in the same directory as the ``.py`` file. ++When a module is imported for the first time (or when the source file has ++changed since the current compiled file was created) a ``.pyc`` file containing ++the compiled code should be created in a ``__pycache__`` subdirectory of the ++directory containing the ``.py`` file. The ``.pyc`` file will have a ++filename that starts with the same name as the ``.py`` file, and ends with ++``.pyc``, with a middle component that depends on the particular ``python`` ++binary that created it. (See :pep:`3147` for details.) + +-One reason that a ``.pyc`` file may not be created is permissions problems with +-the directory. This can happen, for example, if you develop as one user but run +-as another, such as if you are testing with a web server. Creation of a .pyc +-file is automatic if you're importing a module and Python has the ability +-(permissions, free space, etc...) to write the compiled module back to the +-directory. ++One reason that a ``.pyc`` file may not be created is a permissions problem ++with the directory containing the source file, meaning that the ``__pycache__`` ++subdirectory cannot be created. This can happen, for example, if you develop as ++one user but run as another, such as if you are testing with a web server. ++ ++Unless the :envvar:`PYTHONDONTWRITEBYTECODE` environment variable is set, ++creation of a .pyc file is automatic if you're importing a module and Python ++has the ability (permissions, free space, etc...) to create a ``__pycache__`` ++subdirectory and write the compiled module to that subdirectory. + + Running Python on a top level script is not considered an import and no + ``.pyc`` will be created. For example, if you have a top-level module +-``foo.py`` that imports another module ``xyz.py``, when you run ``foo``, +-``xyz.pyc`` will be created since ``xyz`` is imported, but no ``foo.pyc`` file +-will be created since ``foo.py`` isn't being imported. ++``foo.py`` that imports another module ``xyz.py``, when you run ``foo`` (by ++typing ``python foo.py`` as a shell command), a ``.pyc`` will be created for ++``xyz`` because ``xyz`` is imported, but no ``.pyc`` file will be created for ++``foo`` since ``foo.py`` isn't being imported. + +-If you need to create ``foo.pyc`` -- that is, to create a ``.pyc`` file for a module +-that is not imported -- you can, using the :mod:`py_compile` and +-:mod:`compileall` modules. ++If you need to create a ``.pyc`` file for ``foo`` -- that is, to create a ++``.pyc`` file for a module that is not imported -- you can, using the ++:mod:`py_compile` and :mod:`compileall` modules. + + The :mod:`py_compile` module can manually compile any module. One way is to use + the ``compile()`` function in that module interactively:: +@@ -1658,8 +1642,9 @@ + >>> import py_compile + >>> py_compile.compile('foo.py') # doctest: +SKIP + +-This will write the ``.pyc`` to the same location as ``foo.py`` (or you can +-override that with the optional parameter ``cfile``). ++This will write the ``.pyc`` to a ``__pycache__`` subdirectory in the same ++location as ``foo.py`` (or you can override that with the optional parameter ++``cfile``). + + You can also automatically compile all files in a directory or directories using + the :mod:`compileall` module. You can do it from the shell prompt by running +diff -r 3405dc9a6afa Doc/faq/windows.rst +--- a/Doc/faq/windows.rst ++++ b/Doc/faq/windows.rst +@@ -247,7 +247,7 @@ + ... + Py_Initialize(); // Initialize Python. + initmyAppc(); // Initialize (import) the helper class. +- PyRun_SimpleString("import myApp") ; // Import the shadow class. ++ PyRun_SimpleString("import myApp"); // Import the shadow class. + + 5. There are two problems with Python's C API which will become apparent if you + use a compiler other than MSVC, the compiler used to build pythonNN.dll. +diff -r 3405dc9a6afa Doc/glossary.rst +--- a/Doc/glossary.rst ++++ b/Doc/glossary.rst +@@ -78,6 +78,13 @@ + Benevolent Dictator For Life, a.k.a. `Guido van Rossum + `_, Python's creator. + ++ binary file ++ A :term:`file object` able to read and write ++ :term:`bytes-like objects `. ++ ++ .. seealso:: ++ A :term:`text file` reads and writes :class:`str` objects. ++ + bytes-like object + An object that supports the :ref:`bufferobjects`, like :class:`bytes`, + :class:`bytearray` or :class:`memoryview`. Bytes-like objects can +@@ -225,10 +232,11 @@ + etc.). File objects are also called :dfn:`file-like objects` or + :dfn:`streams`. + +- There are actually three categories of file objects: raw binary files, +- buffered binary files and text files. Their interfaces are defined in the +- :mod:`io` module. The canonical way to create a file object is by using +- the :func:`open` function. ++ There are actually three categories of file objects: raw ++ :term:`binary files `, buffered ++ :term:`binary files ` and :term:`text files `. ++ Their interfaces are defined in the :mod:`io` module. The canonical ++ way to create a file object is by using the :func:`open` function. + + file-like object + A synonym for :term:`file object`. +@@ -531,6 +539,10 @@ + + See also :term:`package`. + ++ module spec ++ A namespace containing the import-related information used to load a ++ module. ++ + MRO + See :term:`method resolution order`. + +@@ -800,6 +812,14 @@ + :meth:`~collections.somenamedtuple._asdict`. Examples of struct sequences + include :data:`sys.float_info` and the return value of :func:`os.stat`. + ++ text file ++ A :term:`file object` able to read and write :class:`str` objects. ++ Often, a text file actually accesses a byte-oriented datastream ++ and handles the text encoding automatically. ++ ++ .. seealso:: ++ A :term:`binary file` reads and write :class:`bytes` objects. ++ + triple-quoted string + A string which is bound by three instances of either a quotation mark + (") or an apostrophe ('). While they don't provide any functionality +diff -r 3405dc9a6afa Doc/howto/curses.rst +--- a/Doc/howto/curses.rst ++++ b/Doc/howto/curses.rst +@@ -422,7 +422,7 @@ + blue or any other color you like. Unfortunately, the Linux console doesn't + support this, so I'm unable to try it out, and can't provide any examples. You + can check if your terminal can do this by calling +-:func:`~curses.can_change_color`, which returns True if the capability is ++:func:`~curses.can_change_color`, which returns ``True`` if the capability is + there. If you're lucky enough to have such a talented terminal, consult your + system's man pages for more information. + +diff -r 3405dc9a6afa Doc/howto/functional.rst +--- a/Doc/howto/functional.rst ++++ b/Doc/howto/functional.rst +@@ -689,8 +689,8 @@ + + + The :func:`any(iter) ` and :func:`all(iter) ` built-ins look at the +-truth values of an iterable's contents. :func:`any` returns True if any element +-in the iterable is a true value, and :func:`all` returns True if all of the ++truth values of an iterable's contents. :func:`any` returns ``True`` if any element ++in the iterable is a true value, and :func:`all` returns ``True`` if all of the + elements are true values: + + >>> any([0,1,0]) +diff -r 3405dc9a6afa Doc/howto/logging-cookbook.rst +--- a/Doc/howto/logging-cookbook.rst ++++ b/Doc/howto/logging-cookbook.rst +@@ -839,7 +839,7 @@ + }, + 'loggers': { + 'foo': { +- 'handlers' : ['foofile'] ++ 'handlers': ['foofile'] + } + }, + 'root': { +@@ -1527,7 +1527,7 @@ + }, + 'loggers': { + 'foo': { +- 'handlers' : ['foofile'] ++ 'handlers': ['foofile'] + } + }, + 'root': { +diff -r 3405dc9a6afa Doc/howto/logging.rst +--- a/Doc/howto/logging.rst ++++ b/Doc/howto/logging.rst +@@ -122,7 +122,8 @@ + ^^^^^^^^^^^^^^^^^ + + A very common situation is that of recording logging events in a file, so let's +-look at that next:: ++look at that next. Be sure to try the following in a newly-started Python ++interpreter, and don't just continue from the session described above:: + + import logging + logging.basicConfig(filename='example.log',level=logging.DEBUG) +diff -r 3405dc9a6afa Doc/howto/pyporting.rst +--- a/Doc/howto/pyporting.rst ++++ b/Doc/howto/pyporting.rst +@@ -640,7 +640,7 @@ + + To get a complete idea of what issues you will need to deal with, see the + `What's New in Python 3.0`_. Others have reorganized the data in other formats +-such as http://docs.pythonsprints.com/python3_porting/py-porting.html . ++such as http://docs.pythonsprints.com/python3_porting/py-porting.html\ . + + The following are some steps to take to try to support both Python 2 & 3 from + the same source code. +diff -r 3405dc9a6afa Doc/howto/regex.rst +--- a/Doc/howto/regex.rst ++++ b/Doc/howto/regex.rst +@@ -271,8 +271,8 @@ + + >>> import re + >>> p = re.compile('ab*') +- >>> p #doctest: +ELLIPSIS +- <_sre.SRE_Pattern object at 0x...> ++ >>> p ++ re.compile('ab*') + + :func:`re.compile` also accepts an optional *flags* argument, used to enable + various special features and syntax variations. We'll go over the available +@@ -383,8 +383,8 @@ + + >>> import re + >>> p = re.compile('[a-z]+') +- >>> p #doctest: +ELLIPSIS +- <_sre.SRE_Pattern object at 0x...> ++ >>> p ++ re.compile('[a-z]+') + + Now, you can try matching various strings against the RE ``[a-z]+``. An empty + string shouldn't match at all, since ``+`` means 'one or more repetitions'. +diff -r 3405dc9a6afa Doc/howto/urllib2.rst +--- a/Doc/howto/urllib2.rst ++++ b/Doc/howto/urllib2.rst +@@ -160,7 +160,7 @@ + to your HTTP request. + + Some websites [#]_ dislike being browsed by programs, or send different versions +-to different browsers [#]_ . By default urllib identifies itself as ++to different browsers [#]_. By default urllib identifies itself as + ``Python-urllib/x.y`` (where ``x`` and ``y`` are the major and minor version + numbers of the Python release, + e.g. ``Python-urllib/2.5``), which may confuse the site, or just plain +@@ -454,7 +454,7 @@ + + When authentication is required, the server sends a header (as well as the 401 + error code) requesting authentication. This specifies the authentication scheme +-and a 'realm'. The header looks like : ``WWW-Authenticate: SCHEME ++and a 'realm'. The header looks like: ``WWW-Authenticate: SCHEME + realm="REALM"``. + + e.g. :: +@@ -526,7 +526,7 @@ + setting is detected. Normally that's a good thing, but there are occasions + when it may not be helpful [#]_. One way to do this is to setup our own + ``ProxyHandler``, with no proxies defined. This is done using similar steps to +-setting up a `Basic Authentication`_ handler : :: ++setting up a `Basic Authentication`_ handler: :: + + >>> proxy_support = urllib.request.ProxyHandler({}) + >>> opener = urllib.request.build_opener(proxy_support) +diff -r 3405dc9a6afa Doc/install/index.rst +--- a/Doc/install/index.rst ++++ b/Doc/install/index.rst +@@ -20,12 +20,20 @@ + Finally, it might be useful to include all the material from my "Care + and Feeding of a Python Installation" talk in here somewhere. Yow! + +-.. topic:: Abstract ++This document describes the Python Distribution Utilities ("Distutils") from the ++end-user's point-of-view, describing how to extend the capabilities of a ++standard Python installation by building and installing third-party Python ++modules and extensions. + +- This document describes the Python Distribution Utilities ("Distutils") from the +- end-user's point-of-view, describing how to extend the capabilities of a +- standard Python installation by building and installing third-party Python +- modules and extensions. ++ ++.. note:: ++ ++ This guide only covers the basic tools for installing extensions that are ++ provided as part of this version of Python. Third party tools offer easier ++ to use and more secure alternatives. Refer to the ++ `quick recommendations section ++ `__ ++ in the Python Packaging User Guide for more information. + + + .. _inst-intro: +diff -r 3405dc9a6afa Doc/library/abc.rst +--- a/Doc/library/abc.rst ++++ b/Doc/library/abc.rst +@@ -318,9 +318,9 @@ + + Returns the current abstract base class cache token. + +- The token is an opaque integer identifying the current version of the +- abstract base class cache for virtual subclasses. This number changes +- with every call to :meth:`ABCMeta.register` on any ABC. ++ The token is an opaque object (that supports equality testing) identifying ++ the current version of the abstract base class cache for virtual subclasses. ++ The token changes with every call to :meth:`ABCMeta.register` on any ABC. + + .. versionadded:: 3.4 + +diff -r 3405dc9a6afa Doc/library/argparse.rst +--- a/Doc/library/argparse.rst ++++ b/Doc/library/argparse.rst +@@ -1371,12 +1371,14 @@ + >>> parser.parse_args(['--', '-f']) + Namespace(foo='-f', one=None) + ++.. _prefix-matching: + +-Argument abbreviations +-^^^^^^^^^^^^^^^^^^^^^^ ++Argument abbreviations (prefix matching) ++^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + The :meth:`~ArgumentParser.parse_args` method allows long options to be +-abbreviated if the abbreviation is unambiguous:: ++abbreviated to a prefix, if the abbreviation is unambiguous (the prefix matches ++a unique option):: + + >>> parser = argparse.ArgumentParser(prog='PROG') + >>> parser.add_argument('-bacon') +@@ -1854,6 +1856,12 @@ + >>> parser.parse_known_args(['--foo', '--badger', 'BAR', 'spam']) + (Namespace(bar='BAR', foo=True), ['--badger', 'spam']) + ++.. warning:: ++ :ref:`Prefix matching ` rules apply to ++ :meth:`parse_known_args`. The parser may consume an option even if it's just ++ a prefix of one of its known options, instead of leaving it in the remaining ++ arguments list. ++ + + Customizing file parsing + ^^^^^^^^^^^^^^^^^^^^^^^^ +diff -r 3405dc9a6afa Doc/library/ast.rst +--- a/Doc/library/ast.rst ++++ b/Doc/library/ast.rst +@@ -244,6 +244,6 @@ + Return a formatted dump of the tree in *node*. This is mainly useful for + debugging purposes. The returned string will show the names and the values + for fields. This makes the code impossible to evaluate, so if evaluation is +- wanted *annotate_fields* must be set to False. Attributes such as line ++ wanted *annotate_fields* must be set to ``False``. Attributes such as line + numbers and column offsets are not dumped by default. If this is wanted, + *include_attributes* can be set to ``True``. +diff -r 3405dc9a6afa Doc/library/asyncio-eventloop.rst +--- /dev/null ++++ b/Doc/library/asyncio-eventloop.rst +@@ -0,0 +1,357 @@ ++.. currentmodule:: asyncio ++ ++.. _event-loop: ++ ++Event loops ++=========== ++ ++The event loop is the central execution device provided by :mod:`asyncio`. ++It provides multiple facilities, amongst which: ++ ++* Registering, executing and cancelling delayed calls (timeouts) ++ ++* Creating client and server :ref:`transports ` for various ++ kinds of communication ++ ++* Launching subprocesses and the associated :ref:`transports ` ++ for communication with an external program ++ ++* Delegating costly function calls to a pool of threads ++ ++Event loop functions ++-------------------- ++ ++The easiest way to get an event loop is to call the :func:`get_event_loop` ++function. ++ ++.. function:: get_event_loop() ++ ++ Get the event loop for current context. Returns an event loop object ++ implementing :class:`BaseEventLoop` interface, or raises an exception in case no ++ event loop has been set for the current context and the current policy does ++ not specify to create one. It should never return ``None``. ++ ++.. function:: set_event_loop(loop) ++ ++ XXX ++ ++.. function:: new_event_loop() ++ ++ XXX ++ ++ ++Event loop policy ++----------------- ++ ++.. function:: get_event_loop_policy() ++ ++ XXX ++ ++.. function:: set_event_loop_policy(policy) ++ ++ XXX ++ ++ ++Run an event loop ++----------------- ++ ++.. method:: BaseEventLoop.run_forever() ++ ++ Run until :meth:`stop` is called. ++ ++.. method:: BaseEventLoop.run_until_complete(future) ++ ++ Run until the :class:`Future` is done. ++ ++ If the argument is a coroutine, it is wrapped in a :class:`Task`. ++ ++ Return the Future's result, or raise its exception. ++ ++.. method:: BaseEventLoop.is_running() ++ ++ Returns running status of event loop. ++ ++.. method:: BaseEventLoop.stop() ++ ++ Stop running the event loop. ++ ++ Every callback scheduled before :meth:`stop` is called will run. ++ Callback scheduled after :meth:`stop` is called won't. However, those ++ callbacks will run if :meth:`run_forever` is called again later. ++ ++.. method:: BaseEventLoop.close() ++ ++ Close the event loop. The loop should not be running. ++ ++ This clears the queues and shuts down the executor, but does not wait for ++ the executor to finish. ++ ++ This is idempotent and irreversible. No other methods should be called after ++ this one. ++ ++ ++Calls ++----- ++ ++.. method:: BaseEventLoop.call_soon(callback, \*args) ++ ++ Arrange for a callback to be called as soon as possible. ++ ++ This operates as a FIFO queue, callbacks are called in the order in ++ which they are registered. Each callback will be called exactly once. ++ ++ Any positional arguments after the callback will be passed to the ++ callback when it is called. ++ ++.. method:: BaseEventLoop.call_soon_threadsafe(callback, \*args) ++ ++ Like :meth:`call_soon`, but thread safe. ++ ++ ++Delayed calls ++------------- ++ ++The event loop has its own internal clock for computing timeouts. ++Which clock is used depends on the (platform-specific) event loop ++implementation; ideally it is a monotonic clock. This will generally be ++a different clock than :func:`time.time`. ++ ++.. method:: BaseEventLoop.call_later(delay, callback, *args) ++ ++ Arrange for the *callback* to be called after the given *delay* ++ seconds (either an int or float). ++ ++ A "handle" is returned: an opaque object with a :meth:`cancel` method ++ that can be used to cancel the call. ++ ++ *callback* will be called exactly once per call to :meth:`call_later`. ++ If two callbacks are scheduled for exactly the same time, it is ++ undefined which will be called first. ++ ++ The optional positional *args* will be passed to the callback when it ++ is called. If you want the callback to be called with some named ++ arguments, use a closure or :func:`functools.partial`. ++ ++.. method:: BaseEventLoop.call_at(when, callback, *args) ++ ++ Arrange for the *callback* to be called at the given absolute timestamp ++ *when* (an int or float), using the same time reference as :meth:`time`. ++ ++ This method's behavior is the same as :meth:`call_later`. ++ ++.. method:: BaseEventLoop.time() ++ ++ Return the current time, as a :class:`float` value, according to the ++ event loop's internal clock. ++ ++.. seealso:: ++ ++ The :func:`asyncio.sleep` function. ++ ++ ++Creating connections ++-------------------- ++ ++.. method:: BaseEventLoop.create_connection(protocol_factory, host=None, port=None, \*, ssl=None, family=0, proto=0, flags=0, sock=None, local_addr=None, server_hostname=None) ++ ++ Create a streaming transport connection to a given Internet *host* and ++ *port*. *protocol_factory* must be a callable returning a ++ :ref:`protocol ` instance. ++ ++ This method returns a :ref:`coroutine ` which will try to ++ establish the connection in the background. When successful, the ++ coroutine returns a ``(transport, protocol)`` pair. ++ ++ The chronological synopsis of the underlying operation is as follows: ++ ++ #. The connection is established, and a :ref:`transport ` ++ is created to represent it. ++ ++ #. *protocol_factory* is called without arguments and must return a ++ :ref:`protocol ` instance. ++ ++ #. The protocol instance is tied to the transport, and its ++ :meth:`connection_made` method is called. ++ ++ #. The coroutine returns successfully with the ``(transport, protocol)`` ++ pair. ++ ++ The created transport is an implementation-dependent bidirectional stream. ++ ++ .. note:: ++ *protocol_factory* can be any kind of callable, not necessarily ++ a class. For example, if you want to use a pre-created ++ protocol instance, you can pass ``lambda: my_protocol``. ++ ++ Options allowing to change how the connection is created: ++ ++ * *ssl*: if given and not false, a SSL/TLS transport is created ++ (by default a plain TCP transport is created). If *ssl* is ++ a :class:`ssl.SSLContext` object, this context is used to create ++ the transport; if *ssl* is :const:`True`, a context with some ++ unspecified default settings is used. ++ ++ * *server_hostname*, is only for use together with *ssl*, ++ and sets or overrides the hostname that the target server's certificate ++ will be matched against. By default the value of the *host* argument ++ is used. If *host* is empty, there is no default and you must pass a ++ value for *server_hostname*. If *server_hostname* is an empty ++ string, hostname matching is disabled (which is a serious security ++ risk, allowing for man-in-the-middle-attacks). ++ ++ * *family*, *proto*, *flags* are the optional address family, protocol ++ and flags to be passed through to getaddrinfo() for *host* resolution. ++ If given, these should all be integers from the corresponding ++ :mod:`socket` module constants. ++ ++ * *sock*, if given, should be an existing, already connected ++ :class:`socket.socket` object to be used by the transport. ++ If *sock* is given, none of *host*, *port*, *family*, *proto*, *flags* ++ and *local_addr* should be specified. ++ ++ * *local_addr*, if given, is a ``(local_host, local_port)`` tuple used ++ to bind the socket to locally. The *local_host* and *local_port* ++ are looked up using getaddrinfo(), similarly to *host* and *port*. ++ ++ ++Creating listening connections ++------------------------------ ++ ++.. method:: BaseEventLoop.create_server(protocol_factory, host=None, port=None, \*, family=socket.AF_UNSPEC, flags=socket.AI_PASSIVE, sock=None, backlog=100, ssl=None, reuse_address=None) ++ ++ A :ref:`coroutine ` which creates a TCP server bound to host and ++ port. ++ ++ The return value is a :class:`AbstractServer` object which can be used to stop ++ the service. ++ ++ If *host* is an empty string or None all interfaces are assumed ++ and a list of multiple sockets will be returned (most likely ++ one for IPv4 and another one for IPv6). ++ ++ *family* can be set to either :data:`~socket.AF_INET` or ++ :data:`~socket.AF_INET6` to force the socket to use IPv4 or IPv6. If not set ++ it will be determined from host (defaults to :data:`~socket.AF_UNSPEC`). ++ ++ *flags* is a bitmask for :meth:`getaddrinfo`. ++ ++ *sock* can optionally be specified in order to use a preexisting ++ socket object. ++ ++ *backlog* is the maximum number of queued connections passed to ++ :meth:`~socket.socket.listen` (defaults to 100). ++ ++ ssl can be set to an :class:`~ssl.SSLContext` to enable SSL over the ++ accepted connections. ++ ++ *reuse_address* tells the kernel to reuse a local socket in ++ TIME_WAIT state, without waiting for its natural timeout to ++ expire. If not specified will automatically be set to True on ++ UNIX. ++ ++ This method returns a :ref:`coroutine `. ++ ++.. method:: BaseEventLoop.create_datagram_endpoint(protocol_factory, local_addr=None, remote_addr=None, \*, family=0, proto=0, flags=0) ++ ++ Create datagram connection. ++ ++ This method returns a :ref:`coroutine `. ++ ++ ++ ++Resolve name ++------------ ++ ++.. method:: BaseEventLoop.getaddrinfo(host, port, \*, family=0, type=0, proto=0, flags=0) ++ ++ XXX ++ ++.. method:: BaseEventLoop.getnameinfo(sockaddr, flags=0) ++ ++ XXX ++ ++ ++Running subprocesses ++-------------------- ++ ++Run subprocesses asynchronously using the :mod:`subprocess` module. ++ ++.. method:: BaseEventLoop.subprocess_exec(protocol_factory, \*args, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=False, shell=False, bufsize=0, \*\*kwargs) ++ ++ XXX ++ ++ This method returns a :ref:`coroutine `. ++ ++ See the constructor of the :class:`subprocess.Popen` class for parameters. ++ ++.. method:: BaseEventLoop.subprocess_shell(protocol_factory, cmd, \*, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE, universal_newlines=False, shell=True, bufsize=0, \*\*kwargs) ++ ++ XXX ++ ++ This method returns a :ref:`coroutine `. ++ ++ See the constructor of the :class:`subprocess.Popen` class for parameters. ++ ++.. method:: BaseEventLoop.connect_read_pipe(protocol_factory, pipe) ++ ++ Register read pipe in eventloop. ++ ++ *protocol_factory* should instantiate object with :class:`Protocol` ++ interface. pipe is file-like object already switched to nonblocking. ++ Return pair (transport, protocol), where transport support ++ :class:`ReadTransport` interface. ++ ++ This method returns a :ref:`coroutine `. ++ ++.. method:: BaseEventLoop.connect_write_pipe(protocol_factory, pipe) ++ ++ Register write pipe in eventloop. ++ ++ *protocol_factory* should instantiate object with :class:`BaseProtocol` ++ interface. Pipe is file-like object already switched to nonblocking. ++ Return pair (transport, protocol), where transport support ++ :class:`WriteTransport` interface. ++ ++ This method returns a :ref:`coroutine `. ++ ++ ++Executor ++-------- ++ ++Call a function in an :class:`~concurrent.futures.Executor` (pool of threads or ++pool of processes). By default, an event loop uses a thread pool executor ++(:class:`~concurrent.futures.ThreadPoolExecutor`). ++ ++.. method:: BaseEventLoop.run_in_executor(executor, callback, \*args) ++ ++ Arrange for a callback to be called in the specified executor. ++ ++ *executor* is a :class:`~concurrent.futures.Executor` instance, ++ the default executor is used if *executor* is ``None``. ++ ++.. method:: BaseEventLoop.set_default_executor(executor) ++ ++ Set the default executor used by :meth:`run_in_executor`. ++ ++ ++.. _asyncio-hello-world-callback: ++ ++Example: Hello World (callback) ++------------------------------- ++ ++Print ``Hello World`` every two seconds, using a callback:: ++ ++ import asyncio ++ ++ def print_and_repeat(loop): ++ print('Hello World') ++ loop.call_later(2, print_and_repeat, loop) ++ ++ loop = asyncio.get_event_loop() ++ loop.call_soon(print_and_repeat, loop) ++ loop.run_forever() ++ ++.. seealso:: ++ ++ :ref:`Hello World example using a coroutine `. ++ +diff -r 3405dc9a6afa Doc/library/asyncio-protocol.rst +--- /dev/null ++++ b/Doc/library/asyncio-protocol.rst +@@ -0,0 +1,657 @@ ++.. currentmodule:: asyncio ++ ++++++++++++++++++++++++++ ++Transports and protocols ++++++++++++++++++++++++++ ++ ++.. _transport: ++ ++Transports ++========== ++ ++Transports are classed provided by :mod:`asyncio` in order to abstract ++various kinds of communication channels. You generally won't instantiate ++a transport yourself; instead, you will call a :class:`BaseEventLoop` method ++which will create the transport and try to initiate the underlying ++communication channel, calling you back when it succeeds. ++ ++Once the communication channel is established, a transport is always ++paired with a :ref:`protocol ` instance. The protocol can ++then call the transport's methods for various purposes. ++ ++:mod:`asyncio` currently implements transports for TCP, UDP, SSL, and ++subprocess pipes. The methods available on a transport depend on ++the transport's kind. ++ ++ ++BaseTransport ++------------- ++ ++.. class:: BaseTransport ++ ++ Base class for transports. ++ ++ .. method:: close(self) ++ ++ Close the transport. If the transport has a buffer for outgoing ++ data, buffered data will be flushed asynchronously. No more data ++ will be received. After all buffered data is flushed, the ++ protocol's :meth:`connection_lost` method will be called with ++ :const:`None` as its argument. ++ ++ ++ .. method:: get_extra_info(name, default=None) ++ ++ Return optional transport information. *name* is a string representing ++ the piece of transport-specific information to get, *default* is the ++ value to return if the information doesn't exist. ++ ++ This method allows transport implementations to easily expose ++ channel-specific information. ++ ++ * socket: ++ ++ - ``'peername'``: the remote address to which the socket is connected, ++ result of :meth:`socket.socket.getpeername` (``None`` on error) ++ - ``'socket'``: :class:`socket.socket` instance ++ - ``'sockname'``: the socket's own address, ++ result of :meth:`socket.socket.getsockname` ++ ++ * SSL socket: ++ ++ - ``'compression'``: the compression algorithm being used as a string, ++ or ``None`` if the connection isn't compressed; result of ++ :meth:`ssl.SSLSocket.compression` ++ - ``'cipher'``: a three-value tuple containing the name of the cipher ++ being used, the version of the SSL protocol that defines its use, and ++ the number of secret bits being used; result of ++ :meth:`ssl.SSLSocket.cipher` ++ - ``'peercert'``: peer certificate; result of ++ :meth:`ssl.SSLSocket.getpeercert` ++ - ``'sslcontext'``: :class:`ssl.SSLContext` instance ++ ++ * pipe: ++ ++ - ``'pipe'``: pipe object ++ ++ * subprocess: ++ ++ - ``'subprocess'``: :class:`subprocess.Popen` instance ++ ++ ++ReadTransport ++------------- ++ ++.. class:: ReadTransport ++ ++ Interface for read-only transports. ++ ++ .. method:: pause_reading() ++ ++ Pause the receiving end of the transport. No data will be passed to ++ the protocol's :meth:`data_received` method until meth:`resume_reading` ++ is called. ++ ++ .. method:: resume_reading() ++ ++ Resume the receiving end. The protocol's :meth:`data_received` method ++ will be called once again if some data is available for reading. ++ ++ ++WriteTransport ++-------------- ++ ++.. class:: WriteTransport ++ ++ Interface for write-only transports. ++ ++ .. method:: abort() ++ ++ Close the transport immediately, without waiting for pending operations ++ to complete. Buffered data will be lost. No more data will be received. ++ The protocol's :meth:`connection_lost` method will eventually be ++ called with :const:`None` as its argument. ++ ++ .. method:: can_write_eof() ++ ++ Return :const:`True` if the transport supports :meth:`write_eof`, ++ :const:`False` if not. ++ ++ .. method:: get_write_buffer_size() ++ ++ Return the current size of the output buffer used by the transport. ++ ++ .. method:: set_write_buffer_limits(high=None, low=None) ++ ++ Set the *high*- and *low*-water limits for write flow control. ++ ++ These two values control when call the protocol's ++ :meth:`pause_writing` and :meth:`resume_writing` methods are called. ++ If specified, the low-water limit must be less than or equal to the ++ high-water limit. Neither *high* nor *low* can be negative. ++ ++ The defaults are implementation-specific. If only the ++ high-water limit is given, the low-water limit defaults to a ++ implementation-specific value less than or equal to the ++ high-water limit. Setting *high* to zero forces *low* to zero as ++ well, and causes :meth:`pause_writing` to be called whenever the ++ buffer becomes non-empty. Setting *low* to zero causes ++ :meth:`resume_writing` to be called only once the buffer is empty. ++ Use of zero for either limit is generally sub-optimal as it ++ reduces opportunities for doing I/O and computation ++ concurrently. ++ ++ .. method:: write(data) ++ ++ Write some *data* bytes to the transport. ++ ++ This method does not block; it buffers the data and arranges for it ++ to be sent out asynchronously. ++ ++ .. method:: writelines(list_of_data) ++ ++ Write a list (or any iterable) of data bytes to the transport. ++ This is functionally equivalent to calling :meth:`write` on each ++ element yielded by the iterable, but may be implemented more efficiently. ++ ++ .. method:: write_eof() ++ ++ Close the write end of the transport after flushing buffered data. ++ Data may still be received. ++ ++ This method can raise :exc:`NotImplementedError` if the transport ++ (e.g. SSL) doesn't support half-closes. ++ ++ ++DatagramTransport ++----------------- ++ ++.. method:: DatagramTransport.sendto(data, addr=None) ++ ++ Send the *data* bytes to the remote peer given by *addr* (a ++ transport-dependent target address). If *addr* is :const:`None`, the ++ data is sent to the target address given on transport creation. ++ ++ This method does not block; it buffers the data and arranges for it ++ to be sent out asynchronously. ++ ++.. method:: DatagramTransport.abort() ++ ++ Close the transport immediately, without waiting for pending operations ++ to complete. Buffered data will be lost. No more data will be received. ++ The protocol's :meth:`connection_lost` method will eventually be ++ called with :const:`None` as its argument. ++ ++ ++BaseSubprocessTransport ++----------------------- ++ ++.. class:: BaseSubprocessTransport ++ ++ .. method:: get_pid() ++ ++ Return the subprocess process id as an integer. ++ ++ .. method:: get_pipe_transport(fd) ++ ++ Return the transport for the communication pipe correspondong to the ++ integer file descriptor *fd*. The return value can be a readable or ++ writable streaming transport, depending on the *fd*. If *fd* doesn't ++ correspond to a pipe belonging to this transport, :const:`None` is ++ returned. ++ ++ .. method:: get_returncode() ++ ++ Return the subprocess returncode as an integer or :const:`None` ++ if it hasn't returned, similarly to the ++ :attr:`subprocess.Popen.returncode` attribute. ++ ++ .. method:: kill(self) ++ ++ Kill the subprocess, as in :meth:`subprocess.Popen.kill` ++ ++ On POSIX systems, the function sends SIGKILL to the subprocess. ++ On Windows, this method is an alias for :meth:`terminate`. ++ ++ .. method:: send_signal(signal) ++ ++ Send the *signal* number to the subprocess, as in ++ :meth:`subprocess.Popen.send_signal`. ++ ++ .. method:: terminate() ++ ++ Ask the subprocess to stop, as in :meth:`subprocess.Popen.terminate`. ++ This method is an alias for the :meth:`close` method. ++ ++ On POSIX systems, this method sends SIGTERM to the subprocess. ++ On Windows, the Windows API function TerminateProcess() is called to ++ stop the subprocess. ++ ++ ++StreamWriter ++------------ ++ ++.. class:: StreamWriter(transport, protocol, reader, loop) ++ ++ Wraps a Transport. ++ ++ This exposes :meth:`write`, :meth:`writelines`, :meth:`can_write_eof()`, ++ :meth:`write_eof`, :meth:`get_extra_info` and :meth:`close`. It adds ++ :meth:`drain` which returns an optional :class:`Future` on which you can ++ wait for flow control. It also adds a transport attribute which references ++ the :class:`Transport` directly. ++ ++ .. attribute:: transport ++ ++ Transport. ++ ++ .. method:: close() ++ ++ Close the transport: see :meth:`BaseTransport.close`. ++ ++ .. method:: drain() ++ ++ This method has an unusual return value. ++ ++ The intended use is to write:: ++ ++ w.write(data) ++ yield from w.drain() ++ ++ When there's nothing to wait for, :meth:`drain()` returns ``()``, and the ++ yield-from continues immediately. When the transport buffer is full (the ++ protocol is paused), :meth:`drain` creates and returns a ++ :class:`Future` and the yield-from will block until ++ that Future is completed, which will happen when the buffer is ++ (partially) drained and the protocol is resumed. ++ ++ .. method:: get_extra_info(name, default=None) ++ ++ Return optional transport information: see ++ :meth:`BaseTransport.get_extra_info`. ++ ++ .. method:: write(data) ++ ++ Write some *data* bytes to the transport: see ++ :meth:`WriteTransport.write`. ++ ++ .. method:: writelines(data) ++ ++ Write a list (or any iterable) of data bytes to the transport: ++ see :meth:`WriteTransport.writelines`. ++ ++ .. method:: can_write_eof() ++ ++ Return :const:`True` if the transport supports :meth:`write_eof`, ++ :const:`False` if not. See :meth:`WriteTransport.can_write_eof`. ++ ++ .. method:: write_eof() ++ ++ Close the write end of the transport after flushing buffered data: ++ see :meth:`WriteTransport.write_eof`. ++ ++ ++StreamReader ++------------ ++ ++.. class:: StreamReader(limit=_DEFAULT_LIMIT, loop=None) ++ ++ .. method:: exception() ++ ++ Get the exception. ++ ++ .. method:: feed_eof() ++ ++ XXX ++ ++ .. method:: feed_data(data) ++ ++ XXX ++ ++ .. method:: set_exception(exc) ++ ++ Set the exception. ++ ++ .. method:: set_transport(transport) ++ ++ Set the transport. ++ ++ .. method:: read(n=-1) ++ ++ XXX ++ ++ This method returns a :ref:`coroutine `. ++ ++ .. method:: readline() ++ ++ XXX ++ ++ This method returns a :ref:`coroutine `. ++ ++ .. method:: readexactly(n) ++ ++ XXX ++ ++ This method returns a :ref:`coroutine `. ++ ++ ++ ++.. _protocol: ++ ++Protocols ++========= ++ ++:mod:`asyncio` provides base classes that you can subclass to implement ++your network protocols. Those classes are used in conjunction with ++:ref:`transports ` (see below): the protocol parses incoming ++data and asks for the writing of outgoing data, while the transport is ++responsible for the actual I/O and buffering. ++ ++When subclassing a protocol class, it is recommended you override certain ++methods. Those methods are callbacks: they will be called by the transport ++on certain events (for example when some data is received); you shouldn't ++call them yourself, unless you are implementing a transport. ++ ++.. note:: ++ All callbacks have default implementations, which are empty. Therefore, ++ you only need to implement the callbacks for the events in which you ++ are interested. ++ ++ ++Protocol classes ++---------------- ++ ++.. class:: Protocol ++ ++ The base class for implementing streaming protocols (for use with ++ e.g. TCP and SSL transports). ++ ++.. class:: DatagramProtocol ++ ++ The base class for implementing datagram protocols (for use with ++ e.g. UDP transports). ++ ++.. class:: SubprocessProtocol ++ ++ The base class for implementing protocols communicating with child ++ processes (through a set of unidirectional pipes). ++ ++ ++Connection callbacks ++-------------------- ++ ++These callbacks may be called on :class:`Protocol` and ++:class:`SubprocessProtocol` instances: ++ ++.. method:: BaseProtocol.connection_made(transport) ++ ++ Called when a connection is made. ++ ++ The *transport* argument is the transport representing the ++ connection. You are responsible for storing it somewhere ++ (e.g. as an attribute) if you need to. ++ ++.. method:: BaseProtocol.connection_lost(exc) ++ ++ Called when the connection is lost or closed. ++ ++ The argument is either an exception object or :const:`None`. ++ The latter means a regular EOF is received, or the connection was ++ aborted or closed by this side of the connection. ++ ++:meth:`connection_made` and :meth:`connection_lost` are called exactly once ++per successful connection. All other callbacks will be called between those ++two methods, which allows for easier resource management in your protocol ++implementation. ++ ++The following callbacks may be called only on :class:`SubprocessProtocol` ++instances: ++ ++.. method:: SubprocessProtocol.pipe_data_received(fd, data) ++ ++ Called when the child process writes data into its stdout or stderr pipe. ++ *fd* is the integer file descriptor of the pipe. *data* is a non-empty ++ bytes object containing the data. ++ ++.. method:: SubprocessProtocol.pipe_connection_lost(fd, exc) ++ ++ Called when one of the pipes communicating with the child process ++ is closed. *fd* is the integer file descriptor that was closed. ++ ++.. method:: SubprocessProtocol.process_exited() ++ ++ Called when the child process has exited. ++ ++ ++Streaming protocols ++------------------- ++ ++The following callbacks are called on :class:`Protocol` instances: ++ ++.. method:: Protocol.data_received(data) ++ ++ Called when some data is received. *data* is a non-empty bytes object ++ containing the incoming data. ++ ++ .. note:: ++ Whether the data is buffered, chunked or reassembled depends on ++ the transport. In general, you shouldn't rely on specific semantics ++ and instead make your parsing generic and flexible enough. However, ++ data is always received in the correct order. ++ ++.. method:: Protocol.eof_received() ++ ++ Calls when the other end signals it won't send any more data ++ (for example by calling :meth:`write_eof`, if the other end also uses ++ asyncio). ++ ++ This method may return a false value (including None), in which case ++ the transport will close itself. Conversely, if this method returns a ++ true value, closing the transport is up to the protocol. Since the ++ default implementation returns None, it implicitly closes the connection. ++ ++ .. note:: ++ Some transports such as SSL don't support half-closed connections, ++ in which case returning true from this method will not prevent closing ++ the connection. ++ ++:meth:`data_received` can be called an arbitrary number of times during ++a connection. However, :meth:`eof_received` is called at most once ++and, if called, :meth:`data_received` won't be called after it. ++ ++Datagram protocols ++------------------ ++ ++The following callbacks are called on :class:`DatagramProtocol` instances. ++ ++.. method:: DatagramProtocol.datagram_received(data, addr) ++ ++ Called when a datagram is received. *data* is a bytes object containing ++ the incoming data. *addr* is the address of the peer sending the data; ++ the exact format depends on the transport. ++ ++.. method:: DatagramProtocol.error_received(exc) ++ ++ Called when a previous send or receive operation raises an ++ :class:`OSError`. *exc* is the :class:`OSError` instance. ++ ++ This method is called in rare conditions, when the transport (e.g. UDP) ++ detects that a datagram couldn't be delivered to its recipient. ++ In many conditions though, undeliverable datagrams will be silently ++ dropped. ++ ++ ++Flow control callbacks ++---------------------- ++ ++These callbacks may be called on :class:`Protocol` and ++:class:`SubprocessProtocol` instances: ++ ++.. method:: BaseProtocol.pause_writing() ++ ++ Called when the transport's buffer goes over the high-water mark. ++ ++.. method:: BaseProtocol.resume_writing() ++ ++ Called when the transport's buffer drains below the low-water mark. ++ ++ ++:meth:`pause_writing` and :meth:`resume_writing` calls are paired -- ++:meth:`pause_writing` is called once when the buffer goes strictly over ++the high-water mark (even if subsequent writes increases the buffer size ++even more), and eventually :meth:`resume_writing` is called once when the ++buffer size reaches the low-water mark. ++ ++.. note:: ++ If the buffer size equals the high-water mark, ++ :meth:`pause_writing` is not called -- it must go strictly over. ++ Conversely, :meth:`resume_writing` is called when the buffer size is ++ equal or lower than the low-water mark. These end conditions ++ are important to ensure that things go as expected when either ++ mark is zero. ++ ++ ++Server ++------ ++ ++.. class:: AbstractServer ++ ++ Abstract server returned by :func:`BaseEventLoop.create_server`. ++ ++ .. method:: close() ++ ++ Stop serving. This leaves existing connections open. ++ ++ .. method:: wait_closed() ++ ++ Coroutine to wait until service is closed. ++ ++ ++Network functions ++================= ++ ++.. function:: open_connection(host=None, port=None, *, loop=None, limit=_DEFAULT_LIMIT, **kwds) ++ ++ A wrapper for create_connection() returning a (reader, writer) pair. ++ ++ The reader returned is a StreamReader instance; the writer is a ++ :class:`Transport`. ++ ++ The arguments are all the usual arguments to ++ :meth:`BaseEventLoop.create_connection` except *protocol_factory*; most ++ common are positional host and port, with various optional keyword arguments ++ following. ++ ++ Additional optional keyword arguments are *loop* (to set the event loop ++ instance to use) and *limit* (to set the buffer limit passed to the ++ StreamReader). ++ ++ (If you want to customize the :class:`StreamReader` and/or ++ :class:`StreamReaderProtocol` classes, just copy the code -- there's really ++ nothing special here except some convenience.) ++ ++ This function returns a :ref:`coroutine `. ++ ++.. function:: start_server(client_connected_cb, host=None, port=None, *, loop=None, limit=_DEFAULT_LIMIT, **kwds) ++ ++ Start a socket server, call back for each client connected. ++ ++ The first parameter, *client_connected_cb*, takes two parameters: ++ *client_reader*, *client_writer*. *client_reader* is a ++ :class:`StreamReader` object, while *client_writer* is a ++ :class:`StreamWriter` object. This parameter can either be a plain callback ++ function or a :ref:`coroutine `; if it is a coroutine, it will be ++ automatically converted into a :class:`Task`. ++ ++ The rest of the arguments are all the usual arguments to ++ :meth:`~BaseEventLoop.create_server()` except *protocol_factory*; most ++ common are positional host and port, with various optional keyword arguments ++ following. The return value is the same as ++ :meth:`~BaseEventLoop.create_server()`. ++ ++ Additional optional keyword arguments are *loop* (to set the event loop ++ instance to use) and *limit* (to set the buffer limit passed to the ++ :class:`StreamReader`). ++ ++ The return value is the same as :meth:`~BaseEventLoop.create_server()`, i.e. ++ a :class:`AbstractServer` object which can be used to stop the service. ++ ++ This function returns a :ref:`coroutine `. ++ ++ ++Protocol example: TCP echo server and client ++============================================ ++ ++Echo client ++----------- ++ ++TCP echo client example, send data and wait until the connection is closed:: ++ ++ import asyncio ++ ++ class EchoClient(asyncio.Protocol): ++ message = 'This is the message. It will be echoed.' ++ ++ def connection_made(self, transport): ++ transport.write(self.message.encode()) ++ print('data sent: {}'.format(self.message)) ++ ++ def data_received(self, data): ++ print('data received: {}'.format(data.decode())) ++ ++ def connection_lost(self, exc): ++ print('server closed the connection') ++ asyncio.get_event_loop().stop() ++ ++ loop = asyncio.get_event_loop() ++ coro = loop.create_connection(EchoClient, '127.0.0.1', 8888) ++ loop.run_until_complete(coro) ++ loop.run_forever() ++ loop.close() ++ ++The event loop is running twice. The ++:meth:`~BaseEventLoop.run_until_complete` method is preferred in this short ++example to raise an exception if the server is not listening, instead of ++having to write a short coroutine to handle the exception and stop the ++running loop. At :meth:`~BaseEventLoop.run_until_complete` exit, the loop is ++no more running, so there is no need to stop the loop in case of an error. ++ ++Echo server ++----------- ++ ++TCP echo server example, send back received data and close the connection:: ++ ++ import asyncio ++ ++ class EchoServer(asyncio.Protocol): ++ def connection_made(self, transport): ++ peername = transport.get_extra_info('peername') ++ print('connection from {}'.format(peername)) ++ self.transport = transport ++ ++ def data_received(self, data): ++ print('data received: {}'.format(data.decode())) ++ self.transport.write(data) ++ ++ # close the socket ++ self.transport.close() ++ ++ loop = asyncio.get_event_loop() ++ coro = loop.create_server(EchoServer, '127.0.0.1', 8888) ++ server = loop.run_until_complete(coro) ++ print('serving on {}'.format(server.sockets[0].getsockname())) ++ ++ try: ++ loop.run_forever() ++ except KeyboardInterrupt: ++ print("exit") ++ finally: ++ server.close() ++ loop.close() ++ ++:meth:`Transport.close` can be called immediately after ++:meth:`WriteTransport.write` even if data are not sent yet on the socket: both ++methods are asynchronous. ``yield from`` is not needed because these transport ++methods don't return coroutines. ++ ++ +diff -r 3405dc9a6afa Doc/library/asyncio-sync.rst +--- /dev/null ++++ b/Doc/library/asyncio-sync.rst +@@ -0,0 +1,342 @@ ++.. currentmodule:: asyncio ++.. _sync: ++ ++Synchronization primitives ++========================== ++ ++Locks ++----- ++ ++.. class:: Lock(\*, loop=None) ++ ++ Primitive lock objects. ++ ++ A primitive lock is a synchronization primitive that is not owned by a ++ particular coroutine when locked. A primitive lock is in one of two states, ++ 'locked' or 'unlocked'. ++ ++ It is created in the unlocked state. It has two basic methods, :meth:`acquire` ++ and :meth:`release`. When the state is unlocked, acquire() changes the state to ++ locked and returns immediately. When the state is locked, acquire() blocks ++ until a call to release() in another coroutine changes it to unlocked, then ++ the acquire() call resets it to locked and returns. The release() method ++ should only be called in the locked state; it changes the state to unlocked ++ and returns immediately. If an attempt is made to release an unlocked lock, ++ a :exc:`RuntimeError` will be raised. ++ ++ When more than one coroutine is blocked in acquire() waiting for the state ++ to turn to unlocked, only one coroutine proceeds when a release() call ++ resets the state to unlocked; first coroutine which is blocked in acquire() ++ is being processed. ++ ++ :meth:`acquire` is a coroutine and should be called with ``yield from``. ++ ++ Locks also support the context manager protocol. ``(yield from lock)`` ++ should be used as context manager expression. ++ ++ Usage:: ++ ++ lock = Lock() ++ ... ++ yield from lock ++ try: ++ ... ++ finally: ++ lock.release() ++ ++ Context manager usage:: ++ ++ lock = Lock() ++ ... ++ with (yield from lock): ++ ... ++ ++ Lock objects can be tested for locking state:: ++ ++ if not lock.locked(): ++ yield from lock ++ else: ++ # lock is acquired ++ ... ++ ++ .. method:: locked() ++ ++ Return ``True`` if lock is acquired. ++ ++ .. method:: acquire() ++ ++ Acquire a lock. ++ ++ This method blocks until the lock is unlocked, then sets it to locked and ++ returns ``True``. ++ ++ This method returns a :ref:`coroutine `. ++ ++ .. method:: release() ++ ++ Release a lock. ++ ++ When the lock is locked, reset it to unlocked, and return. If any other ++ coroutines are blocked waiting for the lock to become unlocked, allow ++ exactly one of them to proceed. ++ ++ When invoked on an unlocked lock, a :exc:`RuntimeError` is raised. ++ ++ There is no return value. ++ ++ ++.. class:: Event(\*, loop=None) ++ ++ An Event implementation, asynchronous equivalent to :class:`threading.Event`. ++ ++ Class implementing event objects. An event manages a flag that can be set to ++ true with the :meth:`set` method and reset to false with the :meth:`clear` ++ method. The :meth:`wait` method blocks until the flag is true. The flag is ++ initially false. ++ ++ .. method:: clear() ++ ++ Reset the internal flag to false. Subsequently, coroutines calling ++ :meth:`wait` will block until :meth:`set` is called to set the internal ++ flag to true again. ++ ++ .. method:: is_set() ++ ++ Return ``True`` if and only if the internal flag is true. ++ ++ .. method:: set() ++ ++ Set the internal flag to true. All coroutines waiting for it to become ++ true are awakened. Coroutine that call :meth:`wait` once the flag is true ++ will not block at all. ++ ++ .. method:: wait() ++ ++ Block until the internal flag is true. ++ ++ If the internal flag is true on entry, return ``True`` immediately. ++ Otherwise, block until another coroutine calls :meth:`set` to set the ++ flag to true, then return ``True``. ++ ++ This method returns a :ref:`coroutine `. ++ ++ ++.. class:: Condition(\*, loop=None) ++ ++ A Condition implementation, asynchronous equivalent to ++ :class:`threading.Condition`. ++ ++ This class implements condition variable objects. A condition variable ++ allows one or more coroutines to wait until they are notified by another ++ coroutine. ++ ++ A new :class:`Lock` object is created and used as the underlying lock. ++ ++ .. method:: notify(n=1) ++ ++ By default, wake up one coroutine waiting on this condition, if any. ++ If the calling coroutine has not acquired the lock when this method is ++ called, a :exc:`RuntimeError` is raised. ++ ++ This method wakes up at most *n* of the coroutines waiting for the ++ condition variable; it is a no-op if no coroutines are waiting. ++ ++ .. note:: ++ ++ An awakened coroutine does not actually return from its :meth:`wait` ++ call until it can reacquire the lock. Since :meth:`notify` does not ++ release the lock, its caller should. ++ ++ .. method:: notify_all() ++ ++ Wake up all threads waiting on this condition. This method acts like ++ :meth:`notify`, but wakes up all waiting threads instead of one. If the ++ calling thread has not acquired the lock when this method is called, a ++ :exc:`RuntimeError` is raised. ++ ++ .. method:: wait() ++ ++ Wait until notified. ++ ++ If the calling coroutine has not acquired the lock when this method is ++ called, a :exc:`RuntimeError` is raised. ++ ++ This method releases the underlying lock, and then blocks until it is ++ awakened by a :meth:`notify` or :meth:`notify_all` call for the same ++ condition variable in another coroutine. Once awakened, it re-acquires ++ the lock and returns ``True``. ++ ++ This method returns a :ref:`coroutine `. ++ ++ .. method:: wait_for(predicate) ++ ++ Wait until a predicate becomes true. ++ ++ The predicate should be a callable which result will be interpreted as a ++ boolean value. The final predicate value is the return value. ++ ++ This method returns a :ref:`coroutine `. ++ ++ ++Semaphores ++---------- ++ ++.. class:: Semaphore(value=1, \*, loop=None) ++ ++ A Semaphore implementation. ++ ++ A semaphore manages an internal counter which is decremented by each ++ :meth:`acquire` call and incremented by each :meth:`release` call. The ++ counter can never go below zero; when :meth:`acquire` finds that it is zero, ++ it blocks, waiting until some other thread calls :meth:`release`. ++ ++ Semaphores also support the context manager protocol. ++ ++ The optional argument gives the initial value for the internal counter; it ++ defaults to ``1``. If the value given is less than ``0``, :exc:`ValueError` ++ is raised. ++ ++ .. method:: acquire() ++ ++ Acquire a semaphore. ++ ++ If the internal counter is larger than zero on entry, decrement it by one ++ and return ``True`` immediately. If it is zero on entry, block, waiting ++ until some other coroutine has called :meth:`release` to make it larger ++ than ``0``, and then return ``True``. ++ ++ This method returns a :ref:`coroutine `. ++ ++ .. method:: locked() ++ ++ Returns ``True`` if semaphore can not be acquired immediately. ++ ++ .. method:: release() ++ ++ Release a semaphore, incrementing the internal counter by one. When it ++ was zero on entry and another coroutine is waiting for it to become ++ larger than zero again, wake up that coroutine. ++ ++ ++.. class:: BoundedSemaphore(value=1, \*, loop=None) ++ ++ A bounded semaphore implementation. Inherit from :class:`Semaphore`. ++ ++ This raises :exc:`ValueError` in :meth:`~Semaphore.release` if it would ++ increase the value above the initial value. ++ ++ ++Queues ++------ ++ ++.. class:: Queue(maxsize=0, \*, loop=None) ++ ++ A queue, useful for coordinating producer and consumer coroutines. ++ ++ If *maxsize* is less than or equal to zero, the queue size is infinite. If ++ it is an integer greater than ``0``, then ``yield from put()`` will block ++ when the queue reaches *maxsize*, until an item is removed by :meth:`get`. ++ ++ Unlike the standard library :mod:`queue`, you can reliably know this Queue's ++ size with :meth:`qsize`, since your single-threaded asyncio application won't ++ be interrupted between calling :meth:`qsize` and doing an operation on the ++ Queue. ++ ++ .. method:: empty() ++ ++ Return ``True`` if the queue is empty, ``False`` otherwise. ++ ++ .. method:: full() ++ ++ Return ``True`` if there are maxsize items in the queue. ++ ++ .. note:: ++ ++ If the Queue was initialized with ``maxsize=0`` (the default), then ++ :meth:`full()` is never ``True``. ++ ++ .. method:: get() ++ ++ Remove and return an item from the queue. ++ ++ If you yield from :meth:`get()`, wait until a item is available. ++ ++ This method returns a :ref:`coroutine `. ++ ++ .. method:: get_nowait() ++ ++ Remove and return an item from the queue. ++ ++ Return an item if one is immediately available, else raise ++ :exc:`~queue.Empty`. ++ ++ .. method:: put(item) ++ ++ Put an item into the queue. ++ ++ If you yield from ``put()``, wait until a free slot is available before ++ adding item. ++ ++ This method returns a :ref:`coroutine `. ++ ++ .. method:: put_nowait(item) ++ ++ Put an item into the queue without blocking. ++ ++ If no free slot is immediately available, raise :exc:`~queue.Full`. ++ ++ .. method:: qsize() ++ ++ Number of items in the queue. ++ ++ .. attribute:: maxsize ++ ++ Number of items allowed in the queue. ++ ++ ++.. class:: PriorityQueue ++ ++ A subclass of :class:`Queue`; retrieves entries in priority order (lowest ++ first). ++ ++ Entries are typically tuples of the form: (priority number, data). ++ ++ ++.. class:: LifoQueue ++ ++ A subclass of :class:`Queue` that retrieves most recently added entries ++ first. ++ ++ ++.. class:: JoinableQueue ++ ++ A subclass of :class:`Queue` with :meth:`task_done` and :meth:`join` ++ methods. ++ ++ .. method:: join() ++ ++ Block until all items in the queue have been gotten and processed. ++ ++ The count of unfinished tasks goes up whenever an item is added to the ++ queue. The count goes down whenever a consumer thread calls ++ :meth:`task_done` to indicate that the item was retrieved and all work on ++ it is complete. When the count of unfinished tasks drops to zero, ++ :meth:`join` unblocks. ++ ++ This method returns a :ref:`coroutine `. ++ ++ .. method:: task_done() ++ ++ Indicate that a formerly enqueued task is complete. ++ ++ Used by queue consumers. For each :meth:`~Queue.get` used to fetch a task, a ++ subsequent call to :meth:`task_done` tells the queue that the processing ++ on the task is complete. ++ ++ If a :meth:`join` is currently blocking, it will resume when all items ++ have been processed (meaning that a :meth:`task_done` call was received ++ for every item that had been :meth:`~Queue.put` into the queue). ++ ++ Raises :exc:`ValueError` if called more times than there were items ++ placed in the queue. ++ +diff -r 3405dc9a6afa Doc/library/asyncio-task.rst +--- /dev/null ++++ b/Doc/library/asyncio-task.rst +@@ -0,0 +1,483 @@ ++.. currentmodule:: asyncio ++ ++Tasks and coroutines ++==================== ++ ++.. _coroutine: ++ ++Coroutines ++---------- ++ ++A coroutine is a generator that follows certain conventions. For ++documentation purposes, all coroutines should be decorated with ++``@asyncio.coroutine``, but this cannot be strictly enforced. ++ ++Coroutines use the ``yield from`` syntax introduced in :pep:`380`, ++instead of the original ``yield`` syntax. ++ ++The word "coroutine", like the word "generator", is used for two ++different (though related) concepts: ++ ++- The function that defines a coroutine (a function definition ++ decorated with ``asyncio.coroutine``). If disambiguation is needed ++ we will call this a *coroutine function*. ++ ++- The object obtained by calling a coroutine function. This object ++ represents a computation or an I/O operation (usually a combination) ++ that will complete eventually. If disambiguation is needed we will ++ call it a *coroutine object*. ++ ++Things a coroutine can do: ++ ++- ``result = yield from future`` -- suspends the coroutine until the ++ future is done, then returns the future's result, or raises an ++ exception, which will be propagated. (If the future is cancelled, ++ it will raise a ``CancelledError`` exception.) Note that tasks are ++ futures, and everything said about futures also applies to tasks. ++ ++- ``result = yield from coroutine`` -- wait for another coroutine to ++ produce a result (or raise an exception, which will be propagated). ++ The ``coroutine`` expression must be a *call* to another coroutine. ++ ++- ``return expression`` -- produce a result to the coroutine that is ++ waiting for this one using ``yield from``. ++ ++- ``raise exception`` -- raise an exception in the coroutine that is ++ waiting for this one using ``yield from``. ++ ++Calling a coroutine does not start its code running -- it is just a ++generator, and the coroutine object returned by the call is really a ++generator object, which doesn't do anything until you iterate over it. ++In the case of a coroutine object, there are two basic ways to start ++it running: call ``yield from coroutine`` from another coroutine ++(assuming the other coroutine is already running!), or convert it to a ++:class:`Task`. ++ ++Coroutines (and tasks) can only run when the event loop is running. ++ ++ ++.. _asyncio-hello-world-coroutine: ++ ++Example: "Hello World" coroutine ++^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ++ ++Print ``"Hello World"`` every two seconds using a coroutine:: ++ ++ import asyncio ++ ++ @asyncio.coroutine ++ def greet_every_two_seconds(): ++ while True: ++ print('Hello World') ++ yield from asyncio.sleep(2) ++ ++ loop = asyncio.get_event_loop() ++ loop.run_until_complete(greet_every_two_seconds()) ++ ++.. seealso:: ++ ++ :ref:`Hello World example using a callback `. ++ ++ ++Example: Chain coroutines ++^^^^^^^^^^^^^^^^^^^^^^^^^ ++ ++Example chaining coroutines:: ++ ++ import asyncio ++ ++ @asyncio.coroutine ++ def compute(x, y): ++ print("Compute %s + %s ..." % (x, y)) ++ yield from asyncio.sleep(1.0) ++ return x + y ++ ++ @asyncio.coroutine ++ def print_sum(x, y): ++ result = yield from compute(x, y) ++ print("%s + %s = %s" % (x, y, result)) ++ ++ loop = asyncio.get_event_loop() ++ loop.run_until_complete(print_sum(1, 2)) ++ ++``compute()`` is chained to ``print_sum()``: ``print_sum()`` coroutine waits ++until ``compute()`` is completed before returing its result. ++ ++Sequence diagram of the example: ++ ++.. image:: tulip_coro.png ++ :align: center ++ ++The "Task" is created by the :meth:`BaseEventLoop.run_until_complete` method ++when it gets a coroutine instead of a task. ++ ++The diagram shows the control flow, it does not describe exactly how things ++work internally. For example, the sleep coroutine creates an internal future ++which uses :meth:`BaseEventLoop.call_later` to wake up the task in 1 second. ++ ++ ++InvalidStateError ++----------------- ++ ++.. exception:: InvalidStateError ++ ++ The operation is not allowed in this state. ++ ++ ++Future ++------ ++ ++.. class:: Future(\*, loop=None) ++ ++ This class is *almost* compatible with :class:`concurrent.futures.Future`. ++ ++ Differences: ++ ++ - :meth:`result` and :meth:`exception` do not take a timeout argument and ++ raise an exception when the future isn't done yet. ++ ++ - Callbacks registered with :meth:`add_done_callback` are always called ++ via the event loop's :meth:`~BaseEventLoop.call_soon_threadsafe`. ++ ++ - This class is not compatible with the :func:`~concurrent.futures.wait` and ++ :func:`~concurrent.futures.as_completed` functions in the ++ :mod:`concurrent.futures` package. ++ ++ .. method:: cancel() ++ ++ Cancel the future and schedule callbacks. ++ ++ If the future is already done or cancelled, return ``False``. Otherwise, ++ change the future's state to cancelled, schedule the callbacks and return ++ ``True``. ++ ++ .. method:: cancelled() ++ ++ Return ``True`` if the future was cancelled. ++ ++ .. method:: done() ++ ++ Return True if the future is done. ++ ++ Done means either that a result / exception are available, or that the ++ future was cancelled. ++ ++ .. method:: result() ++ ++ Return the result this future represents. ++ ++ If the future has been cancelled, raises :exc:`CancelledError`. If the ++ future's result isn't yet available, raises :exc:`InvalidStateError`. If ++ the future is done and has an exception set, this exception is raised. ++ ++ .. method:: exception() ++ ++ Return the exception that was set on this future. ++ ++ The exception (or ``None`` if no exception was set) is returned only if ++ the future is done. If the future has been cancelled, raises ++ :exc:`CancelledError`. If the future isn't done yet, raises ++ :exc:`InvalidStateError`. ++ ++ .. method:: add_done_callback(fn) ++ ++ Add a callback to be run when the future becomes done. ++ ++ The callback is called with a single argument - the future object. If the ++ future is already done when this is called, the callback is scheduled ++ with :meth:`~BaseEventLoop.call_soon`. ++ ++ .. method:: remove_done_callback(fn) ++ ++ Remove all instances of a callback from the "call when done" list. ++ ++ Returns the number of callbacks removed. ++ ++ .. method:: set_result(result) ++ ++ Mark the future done and set its result. ++ ++ If the future is already done when this method is called, raises ++ :exc:`InvalidStateError`. ++ ++ .. method:: set_exception(exception) ++ ++ Mark the future done and set an exception. ++ ++ If the future is already done when this method is called, raises ++ :exc:`InvalidStateError`. ++ ++ ++Example: Future with run_until_complete() ++^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ++ ++Example combining a :class:`Future` and a :ref:`coroutine `:: ++ ++ import asyncio ++ ++ @asyncio.coroutine ++ def slow_operation(future): ++ yield from asyncio.sleep(1) ++ future.set_result('Future in done!') ++ ++ loop = asyncio.get_event_loop() ++ future = asyncio.Future() ++ asyncio.Task(slow_operation(future)) ++ loop.run_until_complete(future) ++ print(future.result()) ++ ++The coroutine is responsible of the computation (which takes 1 second) and ++it stores the result into the future. The ++:meth:`~BaseEventLoop.run_until_complete` method waits for the completion of ++the future. ++ ++.. note:: ++ The :meth:`~BaseEventLoop.run_until_complete` method uses internally the ++ :meth:`~Future.add_done_callback` method to be notified when the future is ++ done. ++ ++ ++Example: Future with run_forever() ++^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ++ ++The previous example can be written differently using the ++:meth:`Future.add_done_callback` method to describe explicitly the control ++flow:: ++ ++ import asyncio ++ ++ @asyncio.coroutine ++ def slow_operation(future): ++ yield from asyncio.sleep(1) ++ future.set_result('Future in done!') ++ ++ def got_result(future): ++ print(future.result()) ++ loop.stop() ++ ++ loop = asyncio.get_event_loop() ++ future = asyncio.Future() ++ asyncio.Task(slow_operation(future)) ++ future.add_done_callback(got_result) ++ loop.run_forever() ++ ++In this example, the future is responsible to display the result and to stop ++the loop. ++ ++.. note:: ++ The coroutine is only executed when the event loop starts running, so it is ++ possible to add a "done callback" to the future after creating the task ++ scheduling the coroutine. ++ ++ ++ ++Task ++---- ++ ++.. class:: Task(coro, \*, loop=None) ++ ++ A coroutine wrapped in a :class:`Future`. Subclass of :class:`Future`. ++ ++ .. classmethod:: all_tasks(loop=None) ++ ++ Return a set of all tasks for an event loop. ++ ++ By default all tasks for the current event loop are returned. ++ ++ .. classmethod:: current_task(loop=None) ++ ++ Return the currently running task in an event loop or ``None``. ++ ++ By default the current task for the current event loop is returned. ++ ++ ``None`` is returned when called not in the context of a :class:`Task`. ++ ++ .. method:: get_stack(self, \*, limit=None) ++ ++ Return the list of stack frames for this task's coroutine. ++ ++ If the coroutine is active, this returns the stack where it is suspended. ++ If the coroutine has completed successfully or was cancelled, this ++ returns an empty list. If the coroutine was terminated by an exception, ++ this returns the list of traceback frames. ++ ++ The frames are always ordered from oldest to newest. ++ ++ The optional limit gives the maximum nummber of frames to return; by ++ default all available frames are returned. Its meaning differs depending ++ on whether a stack or a traceback is returned: the newest frames of a ++ stack are returned, but the oldest frames of a traceback are returned. ++ (This matches the behavior of the traceback module.) ++ ++ For reasons beyond our control, only one stack frame is returned for a ++ suspended coroutine. ++ ++ .. method:: print_stack(\*, limit=None, file=None) ++ ++ Print the stack or traceback for this task's coroutine. ++ ++ This produces output similar to that of the traceback module, for the ++ frames retrieved by get_stack(). The limit argument is passed to ++ get_stack(). The file argument is an I/O stream to which the output ++ goes; by default it goes to sys.stderr. ++ ++ ++Example: Parallel execution of tasks ++^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ++ ++Example executing 3 tasks (A, B, C) in parallel:: ++ ++ import asyncio ++ ++ @asyncio.coroutine ++ def factorial(name, number): ++ f = 1 ++ for i in range(2, number+1): ++ print("Task %s: Compute factorial(%s)..." % (name, i)) ++ yield from asyncio.sleep(1) ++ f *= i ++ print("Task %s: factorial(%s) = %s" % (name, number, f)) ++ ++ tasks = [ ++ asyncio.Task(factorial("A", 2)), ++ asyncio.Task(factorial("B", 3)), ++ asyncio.Task(factorial("C", 4))] ++ ++ loop = asyncio.get_event_loop() ++ loop.run_until_complete(asyncio.wait(tasks)) ++ ++Output:: ++ ++ Task A: Compute factorial(2)... ++ Task B: Compute factorial(2)... ++ Task C: Compute factorial(2)... ++ Task A: factorial(2) = 2 ++ Task B: Compute factorial(3)... ++ Task C: Compute factorial(3)... ++ Task B: factorial(3) = 6 ++ Task C: Compute factorial(4)... ++ Task C: factorial(4) = 24 ++ ++A task is automatically scheduled for execution when it is created. The event ++loop stops when all tasks are done. ++ ++ ++Task functions ++-------------- ++ ++.. function:: as_completed(fs, \*, loop=None, timeout=None) ++ ++ Return an iterator whose values, when waited for, are :class:`Future` ++ instances. ++ ++ Raises :exc:`TimeoutError` if the timeout occurs before all Futures are done. ++ ++ Example:: ++ ++ for f in as_completed(fs): ++ result = yield from f # The 'yield from' may raise ++ # Use result ++ ++ .. note:: ++ ++ The futures ``f`` are not necessarily members of fs. ++ ++.. function:: async(coro_or_future, \*, loop=None) ++ ++ Wrap a :ref:`coroutine ` in a future. ++ ++ If the argument is a :class:`Future`, it is returned directly. ++ ++.. function:: gather(\*coros_or_futures, loop=None, return_exceptions=False) ++ ++ Return a future aggregating results from the given coroutines or futures. ++ ++ All futures must share the same event loop. If all the tasks are done ++ successfully, the returned future's result is the list of results (in the ++ order of the original sequence, not necessarily the order of results ++ arrival). If *result_exception* is True, exceptions in the tasks are ++ treated the same as successful results, and gathered in the result list; ++ otherwise, the first raised exception will be immediately propagated to the ++ returned future. ++ ++ Cancellation: if the outer Future is cancelled, all children (that have not ++ completed yet) are also cancelled. If any child is cancelled, this is ++ treated as if it raised :exc:`~concurrent.futures.CancelledError` -- the ++ outer Future is *not* cancelled in this case. (This is to prevent the ++ cancellation of one child to cause other children to be cancelled.) ++ ++.. function:: sleep(delay, result=None, \*, loop=None) ++ ++ Create a :ref:`coroutine ` that completes after a given time ++ (in seconds). ++ ++.. function:: shield(arg, \*, loop=None) ++ ++ Wait for a future, shielding it from cancellation. ++ ++ The statement:: ++ ++ res = yield from shield(something()) ++ ++ is exactly equivalent to the statement:: ++ ++ res = yield from something() ++ ++ *except* that if the coroutine containing it is cancelled, the task running ++ in ``something()`` is not cancelled. From the point of view of ++ ``something()``, the cancellation did not happen. But its caller is still ++ cancelled, so the yield-from expression still raises ++ :exc:`~concurrent.futures.CancelledError`. Note: If ``something()`` is ++ cancelled by other means this will still cancel ``shield()``. ++ ++ If you want to completely ignore cancellation (not recommended) you can ++ combine ``shield()`` with a try/except clause, as follows:: ++ ++ try: ++ res = yield from shield(something()) ++ except CancelledError: ++ res = None ++ ++.. function:: wait(futures, \*, loop=None, timeout=None, return_when=ALL_COMPLETED) ++ ++ Wait for the Futures and coroutines given by the sequence *futures* to ++ complete. Coroutines will be wrapped in Tasks. Returns two sets of ++ :class:`Future`: (done, pending). ++ ++ *timeout* can be used to control the maximum number of seconds to wait before ++ returning. *timeout* can be an int or float. If *timeout* is not specified ++ or ``None``, there is no limit to the wait time. ++ ++ *return_when* indicates when this function should return. It must be one of ++ the following constants of the :mod:`concurrent.futures` module: ++ ++ .. tabularcolumns:: |l|L| ++ ++ +-----------------------------+----------------------------------------+ ++ | Constant | Description | ++ +=============================+========================================+ ++ | :const:`FIRST_COMPLETED` | The function will return when any | ++ | | future finishes or is cancelled. | ++ +-----------------------------+----------------------------------------+ ++ | :const:`FIRST_EXCEPTION` | The function will return when any | ++ | | future finishes by raising an | ++ | | exception. If no future raises an | ++ | | exception then it is equivalent to | ++ | | :const:`ALL_COMPLETED`. | ++ +-----------------------------+----------------------------------------+ ++ | :const:`ALL_COMPLETED` | The function will return when all | ++ | | futures finish or are cancelled. | ++ +-----------------------------+----------------------------------------+ ++ ++ This function returns a :ref:`coroutine `. ++ ++ Usage:: ++ ++ done, pending = yield from asyncio.wait(fs) ++ ++ .. note:: ++ ++ This does not raise :exc:`TimeoutError`! Futures that aren't done when ++ the timeout occurs are returned in the second set. ++ ++ +diff -r 3405dc9a6afa Doc/library/asyncio.rst +--- a/Doc/library/asyncio.rst ++++ b/Doc/library/asyncio.rst +@@ -13,7 +13,6 @@ + This module provides infrastructure for writing single-threaded concurrent + code using coroutines, multiplexing I/O access over sockets and other + resources, running network clients and servers, and other related primitives. +- + Here is a more detailed list of the package contents: + + * a pluggable :ref:`event loop ` with various system-specific +@@ -25,8 +24,8 @@ + * concrete support for TCP, UDP, SSL, subprocess pipes, delayed calls, and + others (some may be system-dependent); + +-* a Future class that mimicks the one in the :mod:`concurrent.futures` module, +- but adapted for use with the event loop; ++* a :class:`Future` class that mimicks the one in the :mod:`concurrent.futures` ++ module, but adapted for use with the event loop; + + * coroutines and tasks based on ``yield from`` (:PEP:`380`), to help write + concurrent code in a sequential fashion; +@@ -40,547 +39,19 @@ + you absolutely, positively have to use a library that makes blocking + I/O calls. + ++Table of content: + +-Disclaimer +----------- ++.. toctree:: ++ :maxdepth: 3 ++ :numbered: + +-Full documentation is not yet ready; we hope to have it written +-before Python 3.4 leaves beta. Until then, the best reference is +-:PEP:`3156`. For a motivational primer on transports and protocols, +-see :PEP:`3153`. ++ asyncio-eventloop.rst ++ asyncio-task.rst ++ asyncio-protocol.rst ++ asyncio-sync.rst + ++.. seealso:: + +-.. XXX should the asyncio documentation come in several pages, as for logging? ++ The :mod:`asyncio` module was designed in the :PEP:`3156`. For a ++ motivational primer on transports and protocols, see :PEP:`3153`. + +- +-.. _event-loop: +- +-Event loops +------------ +- +-The event loop is the central execution device provided by :mod:`asyncio`. +-It provides multiple facilities, amongst which: +- +-* Registering, executing and cancelling delayed calls (timeouts) +- +-* Creating client and server :ref:`transports ` for various +- kinds of communication +- +-* Launching subprocesses and the associated :ref:`transports ` +- for communication with an external program +- +-* Delegating costly function calls to a pool of threads +- +-Getting an event loop +-^^^^^^^^^^^^^^^^^^^^^ +- +-The easiest way to get an event loop is to call the :func:`get_event_loop` +-function. +- +-.. XXX more docs +- +-Delayed calls +-^^^^^^^^^^^^^ +- +-The event loop has its own internal clock for computing timeouts. +-Which clock is used depends on the (platform-specific) event loop +-implementation; ideally it is a monotonic clock. This will generally be +-a different clock than :func:`time.time`. +- +-.. method:: time() +- +- Return the current time, as a :class:`float` value, according to the +- event loop's internal clock. +- +-.. method:: call_later(delay, callback, *args) +- +- Arrange for the *callback* to be called after the given *delay* +- seconds (either an int or float). +- +- A "handle" is returned: an opaque object with a :meth:`cancel` method +- that can be used to cancel the call. +- +- *callback* will be called exactly once per call to :meth:`call_later`. +- If two callbacks are scheduled for exactly the same time, it is +- undefined which will be called first. +- +- The optional positional *args* will be passed to the callback when it +- is called. If you want the callback to be called with some named +- arguments, use a closure or :func:`functools.partial`. +- +-.. method:: call_at(when, callback, *args) +- +- Arrange for the *callback* to be called at the given absolute timestamp +- *when* (an int or float), using the same time reference as :meth:`time`. +- +- This method's behavior is the same as :meth:`call_later`. +- +-Creating connections +-^^^^^^^^^^^^^^^^^^^^ +- +-.. method:: create_connection(protocol_factory, host=None, port=None, **options) +- +- Create a streaming transport connection to a given Internet *host* and +- *port*. *protocol_factory* must be a callable returning a +- :ref:`protocol ` instance. +- +- This method returns a :ref:`coroutine ` which will try to +- establish the connection in the background. When successful, the +- coroutine returns a ``(transport, protocol)`` pair. +- +- The chronological synopsis of the underlying operation is as follows: +- +- #. The connection is established, and a :ref:`transport ` +- is created to represent it. +- +- #. *protocol_factory* is called without arguments and must return a +- :ref:`protocol ` instance. +- +- #. The protocol instance is tied to the transport, and its +- :meth:`connection_made` method is called. +- +- #. The coroutine returns successfully with the ``(transport, protocol)`` +- pair. +- +- The created transport is an implementation-dependent bidirectional stream. +- +- .. note:: +- *protocol_factory* can be any kind of callable, not necessarily +- a class. For example, if you want to use a pre-created +- protocol instance, you can pass ``lambda: my_protocol``. +- +- *options* are optional named arguments allowing to change how the +- connection is created: +- +- * *ssl*: if given and not false, a SSL/TLS transport is created +- (by default a plain TCP transport is created). If *ssl* is +- a :class:`ssl.SSLContext` object, this context is used to create +- the transport; if *ssl* is :const:`True`, a context with some +- unspecified default settings is used. +- +- * *server_hostname*, is only for use together with *ssl*, +- and sets or overrides the hostname that the target server's certificate +- will be matched against. By default the value of the *host* argument +- is used. If *host* is empty, there is no default and you must pass a +- value for *server_hostname*. If *server_hostname* is an empty +- string, hostname matching is disabled (which is a serious security +- risk, allowing for man-in-the-middle-attacks). +- +- * *family*, *proto*, *flags* are the optional address family, protocol +- and flags to be passed through to getaddrinfo() for *host* resolution. +- If given, these should all be integers from the corresponding +- :mod:`socket` module constants. +- +- * *sock*, if given, should be an existing, already connected +- :class:`socket.socket` object to be used by the transport. +- If *sock* is given, none of *host*, *port*, *family*, *proto*, *flags* +- and *local_addr* should be specified. +- +- * *local_addr*, if given, is a ``(local_host, local_port)`` tuple used +- to bind the socket to locally. The *local_host* and *local_port* +- are looked up using getaddrinfo(), similarly to *host* and *port*. +- +- +-.. _protocol: +- +-Protocols +---------- +- +-:mod:`asyncio` provides base classes that you can subclass to implement +-your network protocols. Those classes are used in conjunction with +-:ref:`transports ` (see below): the protocol parses incoming +-data and asks for the writing of outgoing data, while the transport is +-responsible for the actual I/O and buffering. +- +-When subclassing a protocol class, it is recommended you override certain +-methods. Those methods are callbacks: they will be called by the transport +-on certain events (for example when some data is received); you shouldn't +-call them yourself, unless you are implementing a transport. +- +-.. note:: +- All callbacks have default implementations, which are empty. Therefore, +- you only need to implement the callbacks for the events in which you +- are interested. +- +- +-Protocol classes +-^^^^^^^^^^^^^^^^ +- +-.. class:: Protocol +- +- The base class for implementing streaming protocols (for use with +- e.g. TCP and SSL transports). +- +-.. class:: DatagramProtocol +- +- The base class for implementing datagram protocols (for use with +- e.g. UDP transports). +- +-.. class:: SubprocessProtocol +- +- The base class for implementing protocols communicating with child +- processes (through a set of unidirectional pipes). +- +- +-Connection callbacks +-^^^^^^^^^^^^^^^^^^^^ +- +-These callbacks may be called on :class:`Protocol` and +-:class:`SubprocessProtocol` instances: +- +-.. method:: connection_made(transport) +- +- Called when a connection is made. +- +- The *transport* argument is the transport representing the +- connection. You are responsible for storing it somewhere +- (e.g. as an attribute) if you need to. +- +-.. method:: connection_lost(exc) +- +- Called when the connection is lost or closed. +- +- The argument is either an exception object or :const:`None`. +- The latter means a regular EOF is received, or the connection was +- aborted or closed by this side of the connection. +- +-:meth:`connection_made` and :meth:`connection_lost` are called exactly once +-per successful connection. All other callbacks will be called between those +-two methods, which allows for easier resource management in your protocol +-implementation. +- +-The following callbacks may be called only on :class:`SubprocessProtocol` +-instances: +- +-.. method:: pipe_data_received(fd, data) +- +- Called when the child process writes data into its stdout or stderr pipe. +- *fd* is the integer file descriptor of the pipe. *data* is a non-empty +- bytes object containing the data. +- +-.. method:: pipe_connection_lost(fd, exc) +- +- Called when one of the pipes communicating with the child process +- is closed. *fd* is the integer file descriptor that was closed. +- +-.. method:: process_exited() +- +- Called when the child process has exited. +- +- +-Data reception callbacks +-^^^^^^^^^^^^^^^^^^^^^^^^ +- +-Streaming protocols +-""""""""""""""""""" +- +-The following callbacks are called on :class:`Protocol` instances: +- +-.. method:: data_received(data) +- +- Called when some data is received. *data* is a non-empty bytes object +- containing the incoming data. +- +- .. note:: +- Whether the data is buffered, chunked or reassembled depends on +- the transport. In general, you shouldn't rely on specific semantics +- and instead make your parsing generic and flexible enough. However, +- data is always received in the correct order. +- +-.. method:: eof_received() +- +- Calls when the other end signals it won't send any more data +- (for example by calling :meth:`write_eof`, if the other end also uses +- asyncio). +- +- This method may return a false value (including None), in which case +- the transport will close itself. Conversely, if this method returns a +- true value, closing the transport is up to the protocol. Since the +- default implementation returns None, it implicitly closes the connection. +- +- .. note:: +- Some transports such as SSL don't support half-closed connections, +- in which case returning true from this method will not prevent closing +- the connection. +- +-:meth:`data_received` can be called an arbitrary number of times during +-a connection. However, :meth:`eof_received` is called at most once +-and, if called, :meth:`data_received` won't be called after it. +- +-Datagram protocols +-"""""""""""""""""" +- +-The following callbacks are called on :class:`DatagramProtocol` instances. +- +-.. method:: datagram_received(data, addr) +- +- Called when a datagram is received. *data* is a bytes object containing +- the incoming data. *addr* is the address of the peer sending the data; +- the exact format depends on the transport. +- +-.. method:: error_received(exc) +- +- Called when a previous send or receive operation raises an +- :class:`OSError`. *exc* is the :class:`OSError` instance. +- +- This method is called in rare conditions, when the transport (e.g. UDP) +- detects that a datagram couldn't be delivered to its recipient. +- In many conditions though, undeliverable datagrams will be silently +- dropped. +- +- +-Flow control callbacks +-^^^^^^^^^^^^^^^^^^^^^^ +- +-These callbacks may be called on :class:`Protocol` and +-:class:`SubprocessProtocol` instances: +- +-.. method:: pause_writing() +- +- Called when the transport's buffer goes over the high-water mark. +- +-.. method:: resume_writing() +- +- Called when the transport's buffer drains below the low-water mark. +- +- +-:meth:`pause_writing` and :meth:`resume_writing` calls are paired -- +-:meth:`pause_writing` is called once when the buffer goes strictly over +-the high-water mark (even if subsequent writes increases the buffer size +-even more), and eventually :meth:`resume_writing` is called once when the +-buffer size reaches the low-water mark. +- +-.. note:: +- If the buffer size equals the high-water mark, +- :meth:`pause_writing` is not called -- it must go strictly over. +- Conversely, :meth:`resume_writing` is called when the buffer size is +- equal or lower than the low-water mark. These end conditions +- are important to ensure that things go as expected when either +- mark is zero. +- +- +-.. _transport: +- +-Transports +----------- +- +-Transports are classed provided by :mod:`asyncio` in order to abstract +-various kinds of communication channels. You generally won't instantiate +-a transport yourself; instead, you will call a :class:`EventLoop` method +-which will create the transport and try to initiate the underlying +-communication channel, calling you back when it succeeds. +- +-Once the communication channel is established, a transport is always +-paired with a :ref:`protocol ` instance. The protocol can +-then call the transport's methods for various purposes. +- +-:mod:`asyncio` currently implements transports for TCP, UDP, SSL, and +-subprocess pipes. The methods available on a transport depend on +-the transport's kind. +- +-Methods common to all transports +-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +- +-.. method:: close(self) +- +- Close the transport. If the transport has a buffer for outgoing +- data, buffered data will be flushed asynchronously. No more data +- will be received. After all buffered data is flushed, the +- protocol's :meth:`connection_lost` method will be called with +- :const:`None` as its argument. +- +- +-.. method:: get_extra_info(name, default=None) +- +- Return optional transport information. *name* is a string representing +- the piece of transport-specific information to get, *default* is the +- value to return if the information doesn't exist. +- +- This method allows transport implementations to easily expose +- channel-specific information. +- +-Methods of readable streaming transports +-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +- +-.. method:: pause_reading() +- +- Pause the receiving end of the transport. No data will be passed to +- the protocol's :meth:`data_received` method until meth:`resume_reading` +- is called. +- +-.. method:: resume_reading() +- +- Resume the receiving end. The protocol's :meth:`data_received` method +- will be called once again if some data is available for reading. +- +-Methods of writable streaming transports +-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +- +-.. method:: write(data) +- +- Write some *data* bytes to the transport. +- +- This method does not block; it buffers the data and arranges for it +- to be sent out asynchronously. +- +-.. method:: writelines(list_of_data) +- +- Write a list (or any iterable) of data bytes to the transport. +- This is functionally equivalent to calling :meth:`write` on each +- element yielded by the iterable, but may be implemented more efficiently. +- +-.. method:: write_eof() +- +- Close the write end of the transport after flushing buffered data. +- Data may still be received. +- +- This method can raise :exc:`NotImplementedError` if the transport +- (e.g. SSL) doesn't support half-closes. +- +-.. method:: can_write_eof() +- +- Return :const:`True` if the transport supports :meth:`write_eof`, +- :const:`False` if not. +- +-.. method:: abort() +- +- Close the transport immediately, without waiting for pending operations +- to complete. Buffered data will be lost. No more data will be received. +- The protocol's :meth:`connection_lost` method will eventually be +- called with :const:`None` as its argument. +- +-.. method:: set_write_buffer_limits(high=None, low=None) +- +- Set the *high*- and *low*-water limits for write flow control. +- +- These two values control when call the protocol's +- :meth:`pause_writing` and :meth:`resume_writing` methods are called. +- If specified, the low-water limit must be less than or equal to the +- high-water limit. Neither *high* nor *low* can be negative. +- +- The defaults are implementation-specific. If only the +- high-water limit is given, the low-water limit defaults to a +- implementation-specific value less than or equal to the +- high-water limit. Setting *high* to zero forces *low* to zero as +- well, and causes :meth:`pause_writing` to be called whenever the +- buffer becomes non-empty. Setting *low* to zero causes +- :meth:`resume_writing` to be called only once the buffer is empty. +- Use of zero for either limit is generally sub-optimal as it +- reduces opportunities for doing I/O and computation +- concurrently. +- +-.. method:: get_write_buffer_size() +- +- Return the current size of the output buffer used by the transport. +- +-Methods of datagram transports +-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +- +-.. method:: sendto(data, addr=None) +- +- Send the *data* bytes to the remote peer given by *addr* (a +- transport-dependent target address). If *addr* is :const:`None`, the +- data is sent to the target address given on transport creation. +- +- This method does not block; it buffers the data and arranges for it +- to be sent out asynchronously. +- +-.. method:: abort() +- +- Close the transport immediately, without waiting for pending operations +- to complete. Buffered data will be lost. No more data will be received. +- The protocol's :meth:`connection_lost` method will eventually be +- called with :const:`None` as its argument. +- +-Methods of subprocess transports +-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ +- +-.. method:: get_pid() +- +- Return the subprocess process id as an integer. +- +-.. method:: get_returncode() +- +- Return the subprocess returncode as an integer or :const:`None` +- if it hasn't returned, similarly to the +- :attr:`subprocess.Popen.returncode` attribute. +- +-.. method:: get_pipe_transport(fd) +- +- Return the transport for the communication pipe correspondong to the +- integer file descriptor *fd*. The return value can be a readable or +- writable streaming transport, depending on the *fd*. If *fd* doesn't +- correspond to a pipe belonging to this transport, :const:`None` is +- returned. +- +-.. method:: send_signal(signal) +- +- Send the *signal* number to the subprocess, as in +- :meth:`subprocess.Popen.send_signal`. +- +-.. method:: terminate() +- +- Ask the subprocess to stop, as in :meth:`subprocess.Popen.terminate`. +- This method is an alias for the :meth:`close` method. +- +- On POSIX systems, this method sends SIGTERM to the subprocess. +- On Windows, the Windows API function TerminateProcess() is called to +- stop the subprocess. +- +-.. method:: kill(self) +- +- Kill the subprocess, as in :meth:`subprocess.Popen.kill` +- +- On POSIX systems, the function sends SIGKILL to the subprocess. +- On Windows, this method is an alias for :meth:`terminate`. +- +- +-.. _coroutine: +- +-Coroutines +----------- +- +- +-.. _sync: +- +-Synchronization primitives +--------------------------- +- +- +-Examples +--------- +- +-A :class:`Protocol` implementing an echo server:: +- +- class EchoServer(asyncio.Protocol): +- +- TIMEOUT = 5.0 +- +- def timeout(self): +- print('connection timeout, closing.') +- self.transport.close() +- +- def connection_made(self, transport): +- print('connection made') +- self.transport = transport +- +- # start 5 seconds timeout timer +- self.h_timeout = asyncio.get_event_loop().call_later( +- self.TIMEOUT, self.timeout) +- +- def data_received(self, data): +- print('data received: ', data.decode()) +- self.transport.write(b'Re: ' + data) +- +- # restart timeout timer +- self.h_timeout.cancel() +- self.h_timeout = asyncio.get_event_loop().call_later( +- self.TIMEOUT, self.timeout) +- +- def eof_received(self): +- pass +- +- def connection_lost(self, exc): +- print('connection lost:', exc) +- self.h_timeout.cancel() +- +diff -r 3405dc9a6afa Doc/library/bdb.rst +--- a/Doc/library/bdb.rst ++++ b/Doc/library/bdb.rst +@@ -194,17 +194,17 @@ + .. method:: user_line(frame) + + This method is called from :meth:`dispatch_line` when either +- :meth:`stop_here` or :meth:`break_here` yields True. ++ :meth:`stop_here` or :meth:`break_here` yields ``True``. + + .. method:: user_return(frame, return_value) + + This method is called from :meth:`dispatch_return` when :meth:`stop_here` +- yields True. ++ yields ``True``. + + .. method:: user_exception(frame, exc_info) + + This method is called from :meth:`dispatch_exception` when +- :meth:`stop_here` yields True. ++ :meth:`stop_here` yields ``True``. + + .. method:: do_clear(arg) + +@@ -245,7 +245,7 @@ + + .. method:: set_quit() + +- Set the :attr:`quitting` attribute to True. This raises :exc:`BdbQuit` in ++ Set the :attr:`quitting` attribute to ``True``. This raises :exc:`BdbQuit` in + the next call to one of the :meth:`dispatch_\*` methods. + + +diff -r 3405dc9a6afa Doc/library/bz2.rst +--- a/Doc/library/bz2.rst ++++ b/Doc/library/bz2.rst +@@ -95,6 +95,11 @@ + byte of data will be returned (unless at EOF). The exact number of bytes + returned is unspecified. + ++ .. note:: While calling :meth:`peek` does not change the file position of ++ the :class:`BZ2File`, it may change the position of the underlying file ++ object (e.g. if the :class:`BZ2File` was constructed by passing a file ++ object for *filename*). ++ + .. versionadded:: 3.3 + + .. versionchanged:: 3.1 +@@ -169,7 +174,7 @@ + + .. attribute:: eof + +- True if the end-of-stream marker has been reached. ++ ``True`` if the end-of-stream marker has been reached. + + .. versionadded:: 3.3 + +diff -r 3405dc9a6afa Doc/library/collections.rst +--- a/Doc/library/collections.rst ++++ b/Doc/library/collections.rst +@@ -193,7 +193,7 @@ + return + raise KeyError(key) + +- >>> d = DeepChainMap({'zebra': 'black'}, {'elephant' : 'blue'}, {'lion' : 'yellow'}) ++ >>> d = DeepChainMap({'zebra': 'black'}, {'elephant': 'blue'}, {'lion': 'yellow'}) + >>> d['lion'] = 'orange' # update an existing key two levels down + >>> d['snake'] = 'red' # new keys get added to the topmost dict + >>> del d['elephant'] # remove an existing key one level down +diff -r 3405dc9a6afa Doc/library/ctypes.rst +--- a/Doc/library/ctypes.rst ++++ b/Doc/library/ctypes.rst +@@ -218,7 +218,7 @@ + Fundamental data types + ^^^^^^^^^^^^^^^^^^^^^^ + +-:mod:`ctypes` defines a number of primitive C compatible data types : ++:mod:`ctypes` defines a number of primitive C compatible data types: + + +----------------------+------------------------------------------+----------------------------+ + | ctypes type | C type | Python type | +@@ -1651,7 +1651,7 @@ + + WINUSERAPI int WINAPI + MessageBoxA( +- HWND hWnd , ++ HWND hWnd, + LPCSTR lpText, + LPCSTR lpCaption, + UINT uType); +@@ -2242,7 +2242,7 @@ + .. class:: c_bool + + Represent the C :c:type:`bool` datatype (more accurately, :c:type:`_Bool` from +- C99). Its value can be True or False, and the constructor accepts any object ++ C99). Its value can be ``True`` or ``False``, and the constructor accepts any object + that has a truth value. + + +diff -r 3405dc9a6afa Doc/library/decimal.rst +--- a/Doc/library/decimal.rst ++++ b/Doc/library/decimal.rst +@@ -1183,52 +1183,52 @@ + + .. method:: is_canonical(x) + +- Returns True if *x* is canonical; otherwise returns False. ++ Returns ``True`` if *x* is canonical; otherwise returns ``False``. + + + .. method:: is_finite(x) + +- Returns True if *x* is finite; otherwise returns False. ++ Returns ``True`` if *x* is finite; otherwise returns ``False``. + + + .. method:: is_infinite(x) + +- Returns True if *x* is infinite; otherwise returns False. ++ Returns ``True`` if *x* is infinite; otherwise returns ``False``. + + + .. method:: is_nan(x) + +- Returns True if *x* is a qNaN or sNaN; otherwise returns False. ++ Returns ``True`` if *x* is a qNaN or sNaN; otherwise returns ``False``. + + + .. method:: is_normal(x) + +- Returns True if *x* is a normal number; otherwise returns False. ++ Returns ``True`` if *x* is a normal number; otherwise returns ``False``. + + + .. method:: is_qnan(x) + +- Returns True if *x* is a quiet NaN; otherwise returns False. ++ Returns ``True`` if *x* is a quiet NaN; otherwise returns ``False``. + + + .. method:: is_signed(x) + +- Returns True if *x* is negative; otherwise returns False. ++ Returns ``True`` if *x* is negative; otherwise returns ``False``. + + + .. method:: is_snan(x) + +- Returns True if *x* is a signaling NaN; otherwise returns False. ++ Returns ``True`` if *x* is a signaling NaN; otherwise returns ``False``. + + + .. method:: is_subnormal(x) + +- Returns True if *x* is subnormal; otherwise returns False. ++ Returns ``True`` if *x* is subnormal; otherwise returns ``False``. + + + .. method:: is_zero(x) + +- Returns True if *x* is a zero; otherwise returns False. ++ Returns ``True`` if *x* is a zero; otherwise returns ``False``. + + + .. method:: ln(x) +@@ -1390,7 +1390,7 @@ + + .. method:: same_quantum(x, y) + +- Returns True if the two operands have the same exponent. ++ Returns ``True`` if the two operands have the same exponent. + + + .. method:: scaleb (x, y) +@@ -1452,9 +1452,9 @@ + + .. data:: HAVE_THREADS + +- The default value is True. If Python is compiled without threads, the ++ The default value is ``True``. If Python is compiled without threads, the + C version automatically disables the expensive thread local context +- machinery. In this case, the value is False. ++ machinery. In this case, the value is ``False``. + + Rounding modes + -------------- +diff -r 3405dc9a6afa Doc/library/difflib.rst +--- a/Doc/library/difflib.rst ++++ b/Doc/library/difflib.rst +@@ -359,7 +359,7 @@ + The *autojunk* parameter. + + SequenceMatcher objects get three data attributes: *bjunk* is the +- set of elements of *b* for which *isjunk* is True; *bpopular* is the set of ++ set of elements of *b* for which *isjunk* is ``True``; *bpopular* is the set of + non-junk elements considered popular by the heuristic (if it is not + disabled); *b2j* is a dict mapping the remaining elements of *b* to a list + of positions where they occur. All three are reset whenever *b* is reset +diff -r 3405dc9a6afa Doc/library/dis.rst +--- a/Doc/library/dis.rst ++++ b/Doc/library/dis.rst +@@ -274,7 +274,7 @@ + + .. data:: is_jump_target + +- True if other code jumps to here, otherwise False ++ ``True`` if other code jumps to here, otherwise ``False`` + + .. versionadded:: 3.4 + +diff -r 3405dc9a6afa Doc/library/email.contentmanager.rst +--- a/Doc/library/email.contentmanager.rst ++++ b/Doc/library/email.contentmanager.rst +@@ -96,7 +96,7 @@ + only it when looking for candidate matches. Otherwise consider only the + first (default root) part of the ``multipart/related``. + +- If a part has a :mailheader:``Content-Disposition`` header, only consider ++ If a part has a :mailheader:`Content-Disposition` header, only consider + the part a candidate match if the value of the header is ``inline``. + + If none of the candidates matches any of the preferences in +@@ -134,7 +134,7 @@ + + Return an iterator over all of the immediate sub-parts of the message, + which will be empty for a non-``multipart``. (See also +- :meth:``~email.message.walk``.) ++ :meth:`~email.message.walk`.) + + + .. method:: get_content(*args, content_manager=None, **kw) +diff -r 3405dc9a6afa Doc/library/email.message.rst +--- a/Doc/library/email.message.rst ++++ b/Doc/library/email.message.rst +@@ -35,7 +35,7 @@ + + If *policy* is specified (it must be an instance of a :mod:`~email.policy` + class) use the rules it specifies to udpate and serialize the representation +- of the message. If *policy* is not set, use the :class`compat32 ++ of the message. If *policy* is not set, use the :class:`compat32 + ` policy, which maintains backward compatibility with + the Python 3.2 version of the email package. For more information see the + :mod:`~email.policy` documentation. +@@ -131,7 +131,7 @@ + + Return ``True`` if the message's payload is a list of sub-\ + :class:`Message` objects, otherwise return ``False``. When +- :meth:`is_multipart` returns False, the payload should be a string object. ++ :meth:`is_multipart` returns ``False``, the payload should be a string object. + + + .. method:: set_unixfrom(unixfrom) +@@ -196,7 +196,13 @@ + + Set the entire message object's payload to *payload*. It is the client's + responsibility to ensure the payload invariants. Optional *charset* sets +- the message's default character set; see :meth:`set_charset` for details. ++ the message's character set; see :meth:`set_charset` for details. If ++ *payload* is a string containing non-ASCII characters, *charset* is ++ required. ++ ++ .. versionchanged:: 3.4 ++ Previous to 3.4 *charset* was not required when *payload* was a ++ non-ASCII string, but omitting it produced nonsense results. + + .. method:: set_charset(charset) + +diff -r 3405dc9a6afa Doc/library/ensurepip.rst +--- a/Doc/library/ensurepip.rst ++++ b/Doc/library/ensurepip.rst +@@ -5,6 +5,8 @@ + :synopsis: Bootstrapping the ``pip`` installer into an existing Python + installation or virtual environment. + ++.. versionadded:: 3.4 ++ + The :mod:`ensurepip` package provides support for bootstrapping the ``pip`` + installer into an existing Python installation or virtual environment. This + bootstrapping approach reflects the fact that ``pip`` is an independent +@@ -18,8 +20,6 @@ + when creating a virtual environment) or after explicitly uninstalling + ``pip``. + +-.. versionadded:: 3.4 +- + .. note:: + + This module *does not* access the internet. All of the components +@@ -119,6 +119,12 @@ + + .. note:: + ++ The bootstrapping process has side effects on both ``sys.path`` and ++ ``os.environ``. Invoking the command line interface in a subprocess ++ instead allows these side effects to be avoided. ++ ++ .. note:: ++ + The bootstrapping process may install additional modules required by + ``pip``, but other software should not assume those dependencies will + always be present by default (as the dependencies may be removed in a +diff -r 3405dc9a6afa Doc/library/enum.rst +--- a/Doc/library/enum.rst ++++ b/Doc/library/enum.rst +@@ -9,6 +9,8 @@ + .. :sectionauthor:: Eli Bendersky , + .. :sectionauthor:: Ethan Furman + ++.. versionadded:: 3.4 ++ + **Source code:** :source:`Lib/enum.py` + + ---------------- +diff -r 3405dc9a6afa Doc/library/exceptions.rst +--- a/Doc/library/exceptions.rst ++++ b/Doc/library/exceptions.rst +@@ -287,8 +287,7 @@ + + Raised when an error is detected that doesn't fall in any of the other + categories. The associated value is a string indicating what precisely went +- wrong. (This exception is mostly a relic from a previous version of the +- interpreter; it is not used very much any more.) ++ wrong. + + + .. exception:: StopIteration +diff -r 3405dc9a6afa Doc/library/ftplib.rst +--- a/Doc/library/ftplib.rst ++++ b/Doc/library/ftplib.rst +@@ -94,6 +94,11 @@ + .. versionchanged:: 3.3 + *source_address* parameter was added. + ++ .. versionchanged:: 3.4 ++ The class now supports hostname check with ++ :attr:`SSLContext.check_hostname` and *Server Name Indicator* (see ++ :data:`~ssl.HAS_SNI`). ++ + Here's a sample session using the :class:`FTP_TLS` class: + + >>> from ftplib import FTP_TLS +@@ -427,6 +432,11 @@ + Set up secure control connection by using TLS or SSL, depending on what + specified in :meth:`ssl_version` attribute. + ++ .. versionchanged:: 3.4 ++ The method now supports hostname check with ++ :attr:`SSLContext.check_hostname` and *Server Name Indicator* (see ++ :data:`~ssl.HAS_SNI`). ++ + .. method:: FTP_TLS.ccc() + + Revert control channel back to plaintext. This can be useful to take +diff -r 3405dc9a6afa Doc/library/functions.rst +--- a/Doc/library/functions.rst ++++ b/Doc/library/functions.rst +@@ -48,7 +48,7 @@ + + .. function:: all(iterable) + +- Return True if all elements of the *iterable* are true (or if the iterable ++ Return ``True`` if all elements of the *iterable* are true (or if the iterable + is empty). Equivalent to:: + + def all(iterable): +@@ -60,8 +60,8 @@ + + .. function:: any(iterable) + +- Return True if any element of the *iterable* is true. If the iterable +- is empty, return False. Equivalent to:: ++ Return ``True`` if any element of the *iterable* is true. If the iterable ++ is empty, return ``False``. Equivalent to:: + + def any(iterable): + for element in iterable: +@@ -193,9 +193,9 @@ + .. function:: compile(source, filename, mode, flags=0, dont_inherit=False, optimize=-1) + + Compile the *source* into a code or AST object. Code objects can be executed +- by :func:`exec` or :func:`eval`. *source* can either be a string or an AST +- object. Refer to the :mod:`ast` module documentation for information on how +- to work with AST objects. ++ by :func:`exec` or :func:`eval`. *source* can either be a normal string, a ++ byte string, or an AST object. Refer to the :mod:`ast` module documentation ++ for information on how to work with AST objects. + + The *filename* argument should give the file from which the code was read; + pass some recognizable value if it wasn't read from a file (``''`` is +@@ -905,7 +905,7 @@ + the buffer will typically be 4096 or 8192 bytes long. + + * "Interactive" text files (files for which :meth:`~io.IOBase.isatty` +- returns True) use line buffering. Other text files use the policy ++ returns ``True``) use line buffering. Other text files use the policy + described above for binary files. + + *encoding* is the name of the encoding used to decode or encode the file. +diff -r 3405dc9a6afa Doc/library/gc.rst +--- a/Doc/library/gc.rst ++++ b/Doc/library/gc.rst +@@ -69,9 +69,10 @@ + + .. function:: get_stats() + +- Return a list of 3 per-generation dictionaries containing collection +- statistics since interpreter start. At this moment, each dictionary will +- contain the following items: ++ Return a list of three per-generation dictionaries containing collection ++ statistics since interpreter start. The number of keys may change ++ in the future, but currently each dictionary will contain the following ++ items: + + * ``collections`` is the number of times this generation was collected; + +@@ -148,8 +149,8 @@ + + .. function:: is_tracked(obj) + +- Returns True if the object is currently tracked by the garbage collector, +- False otherwise. As a general rule, instances of atomic types aren't ++ Returns ``True`` if the object is currently tracked by the garbage collector, ++ ``False`` otherwise. As a general rule, instances of atomic types aren't + tracked and instances of non-atomic types (containers, user-defined + objects...) are. However, some type-specific optimizations can be present + in order to suppress the garbage collector footprint of simple instances +diff -r 3405dc9a6afa Doc/library/gettext.rst +--- a/Doc/library/gettext.rst ++++ b/Doc/library/gettext.rst +@@ -476,9 +476,9 @@ + + :program:`xgettext`, :program:`pygettext`, and similar tools generate + :file:`.po` files that are message catalogs. They are structured +-:human-readable files that contain every marked string in the source +-:code, along with a placeholder for the translated versions of these +-:strings. ++human-readable files that contain every marked string in the source ++code, along with a placeholder for the translated versions of these ++strings. + + Copies of these :file:`.po` files are then handed over to the + individual human translators who write translations for every +diff -r 3405dc9a6afa Doc/library/gzip.rst +--- a/Doc/library/gzip.rst ++++ b/Doc/library/gzip.rst +@@ -117,6 +117,11 @@ + the call. The number of bytes returned may be more or less than + requested. + ++ .. note:: While calling :meth:`peek` does not change the file position of ++ the :class:`GzipFile`, it may change the position of the underlying ++ file object (e.g. if the :class:`GzipFile` was constructed with the ++ *fileobj* parameter). ++ + .. versionadded:: 3.2 + + .. versionchanged:: 3.1 +diff -r 3405dc9a6afa Doc/library/hashlib.rst +--- a/Doc/library/hashlib.rst ++++ b/Doc/library/hashlib.rst +@@ -33,6 +33,8 @@ + also" section at the end. + + ++.. _hash-algorithms: ++ + Hash algorithms + --------------- + +@@ -63,7 +65,7 @@ + the OpenSSL library that Python uses on your platform. + + .. versionchanged:: 3.4 +- Add sha3 family of hash algorithms. ++ Added sha3 family of hash algorithms. + + For example, to obtain the digest of the byte string ``b'Nobody inspects the + spammish repetition'``:: +diff -r 3405dc9a6afa Doc/library/html.entities.rst +--- a/Doc/library/html.entities.rst ++++ b/Doc/library/html.entities.rst +@@ -43,4 +43,4 @@ + + .. rubric:: Footnotes + +-.. [#] See http://www.w3.org/TR/html5/named-character-references.html ++.. [#] See http://www.w3.org/TR/html5/syntax.html#named-character-references +diff -r 3405dc9a6afa Doc/library/http.client.rst +--- a/Doc/library/http.client.rst ++++ b/Doc/library/http.client.rst +@@ -573,7 +573,7 @@ + + .. attribute:: HTTPResponse.closed + +- Is True if the stream is closed. ++ Is ``True`` if the stream is closed. + + Examples + -------- +diff -r 3405dc9a6afa Doc/library/http.cookiejar.rst +--- a/Doc/library/http.cookiejar.rst ++++ b/Doc/library/http.cookiejar.rst +@@ -90,7 +90,7 @@ + Netscape and RFC 2965 cookies. By default, RFC 2109 cookies (ie. cookies + received in a :mailheader:`Set-Cookie` header with a version cookie-attribute of + 1) are treated according to the RFC 2965 rules. However, if RFC 2965 handling +- is turned off or :attr:`rfc2109_as_netscape` is True, RFC 2109 cookies are ++ is turned off or :attr:`rfc2109_as_netscape` is ``True``, RFC 2109 cookies are + 'downgraded' by the :class:`CookieJar` instance to Netscape cookies, by + setting the :attr:`version` attribute of the :class:`Cookie` instance to 0. + :class:`DefaultCookiePolicy` also provides some parameters to allow some +@@ -309,7 +309,7 @@ + ----------------------------------------------------------- + + The following :class:`CookieJar` subclasses are provided for reading and +-writing . ++writing. + + .. class:: MozillaCookieJar(filename, delayload=None, policy=None) + +@@ -644,7 +644,7 @@ + + .. attribute:: Cookie.secure + +- True if cookie should only be returned over a secure connection. ++ ``True`` if cookie should only be returned over a secure connection. + + + .. attribute:: Cookie.expires +@@ -655,7 +655,7 @@ + + .. attribute:: Cookie.discard + +- True if this is a session cookie. ++ ``True`` if this is a session cookie. + + + .. attribute:: Cookie.comment +@@ -672,7 +672,7 @@ + + .. attribute:: Cookie.rfc2109 + +- True if this cookie was received as an RFC 2109 cookie (ie. the cookie ++ ``True`` if this cookie was received as an RFC 2109 cookie (ie. the cookie + arrived in a :mailheader:`Set-Cookie` header, and the value of the Version + cookie-attribute in that header was 1). This attribute is provided because + :mod:`http.cookiejar` may 'downgrade' RFC 2109 cookies to Netscape cookies, in +@@ -681,18 +681,18 @@ + + .. attribute:: Cookie.port_specified + +- True if a port or set of ports was explicitly specified by the server (in the ++ ``True`` if a port or set of ports was explicitly specified by the server (in the + :mailheader:`Set-Cookie` / :mailheader:`Set-Cookie2` header). + + + .. attribute:: Cookie.domain_specified + +- True if a domain was explicitly specified by the server. ++ ``True`` if a domain was explicitly specified by the server. + + + .. attribute:: Cookie.domain_initial_dot + +- True if the domain explicitly specified by the server began with a dot ++ ``True`` if the domain explicitly specified by the server began with a dot + (``'.'``). + + Cookies may have additional non-standard cookie-attributes. These may be +@@ -719,7 +719,7 @@ + + .. method:: Cookie.is_expired(now=None) + +- True if cookie has passed the time at which the server requested it should ++ ``True`` if cookie has passed the time at which the server requested it should + expire. If *now* is given (in seconds since the epoch), return whether the + cookie has expired at the specified time. + +diff -r 3405dc9a6afa Doc/library/imaplib.rst +--- a/Doc/library/imaplib.rst ++++ b/Doc/library/imaplib.rst +@@ -80,6 +80,10 @@ + .. versionchanged:: 3.3 + *ssl_context* parameter added. + ++ .. versionchanged:: 3.4 ++ The class now supports hostname check with ++ :attr:`SSLContext.check_hostname` and *Server Name Indicator* (see ++ :data:`~ssl.HAS_SNI`). + + The second subclass allows for connections created by a child process: + +@@ -437,6 +441,10 @@ + + .. versionadded:: 3.2 + ++ .. versionchanged:: 3.4 ++ The method now supports hostname check with ++ :attr:`SSLContext.check_hostname` and *Server Name Indicator* (see ++ :data:`~ssl.HAS_SNI`). + + .. method:: IMAP4.status(mailbox, names) + +diff -r 3405dc9a6afa Doc/library/imp.rst +--- a/Doc/library/imp.rst ++++ b/Doc/library/imp.rst +@@ -200,8 +200,8 @@ + The ``cpython-32`` string comes from the current magic tag (see + :func:`get_tag`; if :attr:`sys.implementation.cache_tag` is not defined then + :exc:`NotImplementedError` will be raised). The returned path will end in +- ``.pyc`` when ``__debug__`` is True or ``.pyo`` for an optimized Python +- (i.e. ``__debug__`` is False). By passing in True or False for ++ ``.pyc`` when ``__debug__`` is ``True`` or ``.pyo`` for an optimized Python ++ (i.e. ``__debug__`` is ``False``). By passing in ``True`` or ``False`` for + *debug_override* you can override the system's value for ``__debug__`` for + extension selection. + +diff -r 3405dc9a6afa Doc/library/importlib.rst +--- a/Doc/library/importlib.rst ++++ b/Doc/library/importlib.rst +@@ -82,10 +82,29 @@ + derived from :func:`importlib.__import__`, including requiring the package + from which an import is occurring to have been previously imported + (i.e., *package* must already be imported). The most important difference +- is that :func:`import_module` returns the most nested package or module +- that was imported (e.g. ``pkg.mod``), while :func:`__import__` returns the ++ is that :func:`import_module` returns the specified package or module ++ (e.g. ``pkg.mod``), while :func:`__import__` returns the + top-level package or module (e.g. ``pkg``). + ++ .. versionchanged:: 3.3 ++ Parent packages are automatically imported. ++ ++.. function:: find_spec(name, path=None) ++ ++ Find the :term:`spec ` for a module, optionally within the ++ specified *path*. If the module is in :attr:`sys.modules`, then ++ ``sys.modules[name].__spec__`` is returned (unless the spec would be ++ ``None`` or is not set, in which case :exc:`ValueError` is raised). ++ Otherwise a search using :attr:`sys.meta_path` is done. ``None`` is ++ returned if no spec is found. ++ ++ A dotted name does not have its parent implicitly imported as that requires ++ loading them and that may not be desired. To properly import a submodule you ++ will need to import all parent packages of the submodule and use the correct ++ argument to *path*. ++ ++ .. versionadded:: 3.4 ++ + .. function:: find_loader(name, path=None) + + Find the loader for a module, optionally within the specified *path*. If the +@@ -105,6 +124,9 @@ + If ``__loader__`` is not set, raise :exc:`ValueError`, just like when the + attribute is set to ``None``. + ++ .. deprecated:: 3.4 ++ Use :func:`find_spec` instead. ++ + .. function:: invalidate_caches() + + Invalidate the internal caches of finders stored at +@@ -233,9 +255,21 @@ + + .. versionadded:: 3.3 + ++ .. method:: find_spec(fullname, path, target=None) ++ ++ An abstract method for finding a :term:`spec ` for ++ the specified module. If this is a top-level import, *path* will ++ be ``None``. Otherwise, this is a search for a subpackage or ++ module and *path* will be the value of :attr:`__path__` from the ++ parent package. If a spec cannot be found, ``None`` is returned. ++ When passed in, ``target`` is a module object that the finder may ++ use to make a more educated about what spec to return. ++ ++ .. versionadded:: 3.4 ++ + .. method:: find_module(fullname, path) + +- An abstract method for finding a :term:`loader` for the specified ++ A legacy method for finding a :term:`loader` for the specified + module. If this is a top-level import, *path* will be ``None``. + Otherwise, this is a search for a subpackage or module and *path* + will be the value of :attr:`__path__` from the parent +@@ -245,6 +279,9 @@ + Returns ``None`` when called instead of raising + :exc:`NotImplementedError`. + ++ .. deprecated:: 3.4 ++ Use :meth:`find_spec` instead. ++ + .. method:: invalidate_caches() + + An optional method which, when called, should invalidate any internal +@@ -265,9 +302,20 @@ + + .. versionadded:: 3.3 + ++ .. method:: find_spec(fullname, target=None) ++ ++ An abstract method for finding a :term:`spec ` for ++ the specified module. The finder will search for the module only ++ within the :term:`path entry` to which it is assigned. If a spec ++ cannot be found, ``None`` is returned. When passed in, ``target`` ++ is a module object that the finder may use to make a more educated ++ about what spec to return. ++ ++ .. versionadded:: 3.4 ++ + .. method:: find_loader(fullname) + +- An abstract method for finding a :term:`loader` for the specified ++ A legacy method for finding a :term:`loader` for the specified + module. Returns a 2-tuple of ``(loader, portion)`` where ``portion`` + is a sequence of file system locations contributing to part of a namespace + package. The loader may be ``None`` while specifying ``portion`` to +@@ -280,11 +328,17 @@ + .. versionchanged:: 3.4 + Returns ``(None, [])`` instead of raising :exc:`NotImplementedError`. + ++ .. deprecated:: 3.4 ++ Use :meth:`find_spec` instead. ++ + .. method:: find_module(fullname) + + A concrete implementation of :meth:`Finder.find_module` which is + equivalent to ``self.find_loader(fullname)[0]``. + ++ .. deprecated:: 3.4 ++ Use :meth:`find_spec` instead. ++ + .. method:: invalidate_caches() + + An optional method which, when called, should invalidate any internal +@@ -297,9 +351,26 @@ + An abstract base class for a :term:`loader`. + See :pep:`302` for the exact definition for a loader. + ++ .. method:: create_module(spec) ++ ++ An optional method that returns the module object to use when ++ importing a module. create_module() may also return ``None``, ++ indicating that the default module creation should take place ++ instead. ++ ++ .. versionadded:: 3.4 ++ ++ .. method:: exec_module(module) ++ ++ An abstract method that executes the module in its own namespace ++ when a module is imported or reloaded. The module should already ++ be initialized when exec_module() is called. ++ ++ .. versionadded:: 3.4 ++ + .. method:: load_module(fullname) + +- An abstract method for loading a module. If the module cannot be ++ A legacy method for loading a module. If the module cannot be + loaded, :exc:`ImportError` is raised, otherwise the loaded module is + returned. + +@@ -346,9 +417,16 @@ + Raise :exc:`ImportError` when called instead of + :exc:`NotImplementedError`. + ++ .. deprecated:: 3.4 ++ The recommended API for loading a module is :meth:`exec_module` ++ (and optionally :meth:`create_module`). Loaders should implement ++ it instead of load_module(). The import machinery takes care of ++ all the other responsibilities of load_module() when exec_module() ++ is implemented. ++ + .. method:: module_repr(module) + +- An optional method which when implemented calculates and returns the ++ A legacy method which when implemented calculates and returns the + given module's repr, as a string. The module type's default repr() will + use the result of this method as appropriate. + +@@ -357,6 +435,9 @@ + .. versionchanged:: 3.4 + Made optional instead of an abstractmethod. + ++ .. deprecated:: 3.4 ++ The import machinery now takes care of this automatically. ++ + + .. class:: ResourceLoader + +@@ -431,9 +512,18 @@ + + .. versionadded:: 3.4 + ++ .. method:: exec_module(module) ++ ++ Implementation of :meth:`Loader.exec_module`. ++ ++ .. versionadded:: 3.4 ++ + .. method:: load_module(fullname) + +- Implementation of :meth:`Loader.load_module`. ++ Implementation of :meth:`Loader.load_module`. ++ ++ .. deprecated:: 3.4 ++ use :meth:`exec_module` instead. + + + .. class:: ExecutionLoader +@@ -479,6 +569,9 @@ + + Calls super's ``load_module()``. + ++ .. deprecated:: 3.4 ++ Use :meth:`Loader.exec_module` instead. ++ + .. method:: get_filename(fullname) + + Returns :attr:`path`. +@@ -555,9 +648,18 @@ + + Concrete implementation of :meth:`InspectLoader.get_code`. + ++ .. method:: exec_module(module) ++ ++ Concrete implementation of :meth:`Loader.exec_module`. ++ ++ .. versionadded:: 3.4 ++ + .. method:: load_module(fullname) + +- Concrete implementation of :meth:`Loader.load_module`. ++ Concrete implementation of :meth:`Loader.load_module`. ++ ++ .. deprecated:: 3.4 ++ Use :meth:`exec_module` instead. + + .. method:: get_source(fullname) + +@@ -638,6 +740,10 @@ + Only class methods are defined by this class to alleviate the need for + instantiation. + ++ .. note:: ++ Due to limitations in the extension module C-API, for now ++ BuiltinImporter does not implement :meth:`Loader.exec_module`. ++ + + .. class:: FrozenImporter + +@@ -668,28 +774,37 @@ + Only class methods are defined by this class to alleviate the need for + instantiation. + ++ .. classmethod:: find_spec(fullname, path=None, target=None) ++ ++ Class method that attempts to find a :term:`spec ` ++ for the module specified by *fullname* on :data:`sys.path` or, if ++ defined, on *path*. For each path entry that is searched, ++ :data:`sys.path_importer_cache` is checked. If a non-false object ++ is found then it is used as the :term:`path entry finder` to look ++ for the module being searched for. If no entry is found in ++ :data:`sys.path_importer_cache`, then :data:`sys.path_hooks` is ++ searched for a finder for the path entry and, if found, is stored ++ in :data:`sys.path_importer_cache` along with being queried about ++ the module. If no finder is ever found then ``None`` is both ++ stored in the cache and returned. ++ ++ .. versionadded:: 3.4 ++ + .. classmethod:: find_module(fullname, path=None) + +- Class method that attempts to find a :term:`loader` for the module +- specified by *fullname* on :data:`sys.path` or, if defined, on +- *path*. For each path entry that is searched, +- :data:`sys.path_importer_cache` is checked. If a non-false object is +- found then it is used as the :term:`path entry finder` to look for the +- module being searched for. If no entry is found in +- :data:`sys.path_importer_cache`, then :data:`sys.path_hooks` is +- searched for a finder for the path entry and, if found, is stored in +- :data:`sys.path_importer_cache` along with being queried about the +- module. If no finder is ever found then ``None`` is both stored in +- the cache and returned. ++ A legacy wrapper around :meth:`find_spec`. ++ ++ .. deprecated:: 3.4 ++ Use :meth:`find_spec` instead. + + .. classmethod:: invalidate_caches() + +- Calls :meth:`importlib.abc.PathEntryFinder.invalidate_caches` on all +- finders stored in :attr:`sys.path_importer_cache`. ++ Calls :meth:`importlib.abc.PathEntryFinder.invalidate_caches` on all ++ finders stored in :attr:`sys.path_importer_cache`. + +- .. versionchanged:: 3.4 +- Calls objects in :data:`sys.path_hooks` with the current working directory +- for ``''`` (i.e. the empty string). ++ .. versionchanged:: 3.4 ++ Calls objects in :data:`sys.path_hooks` with the current working ++ directory for ``''`` (i.e. the empty string). + + + .. class:: FileFinder(path, \*loader_details) +@@ -721,6 +836,12 @@ + + The path the finder will search in. + ++ .. method:: find_spec(fullname, target=None) ++ ++ Attempt to find the spec to handle *fullname* within :attr:`path`. ++ ++ .. versionadded:: 3.4 ++ + .. method:: find_loader(fullname) + + Attempt to find the loader to handle *fullname* within :attr:`path`. +@@ -826,6 +947,10 @@ + Loads the extension module if and only if *fullname* is the same as + :attr:`name` or is ``None``. + ++ .. note:: ++ Due to limitations in the extension module C-API, for now ++ ExtensionFileLoader does not implement :meth:`Loader.exec_module`. ++ + .. method:: is_package(fullname) + + Returns ``True`` if the file path points to a package's ``__init__`` +@@ -901,7 +1026,7 @@ + + .. attribute:: has_location + +- (Read-only) Boolean indicating whether or not the module's "origin" ++ Boolean indicating whether or not the module's "origin" + attribute refers to a loadable location. + + :mod:`importlib.util` -- Utility code for importers +@@ -928,8 +1053,8 @@ + The ``cpython-32`` string comes from the current magic tag (see + :func:`get_tag`; if :attr:`sys.implementation.cache_tag` is not defined then + :exc:`NotImplementedError` will be raised). The returned path will end in +- ``.pyc`` when ``__debug__`` is True or ``.pyo`` for an optimized Python +- (i.e. ``__debug__`` is False). By passing in True or False for ++ ``.pyc`` when ``__debug__`` is ``True`` or ``.pyo`` for an optimized Python ++ (i.e. ``__debug__`` is ``False``). By passing in ``True`` or ``False`` for + *debug_override* you can override the system's value for ``__debug__`` for + extension selection. + +@@ -1023,11 +1148,17 @@ + Set ``__loader__`` if set to ``None``, as if the attribute does not + exist. + ++ .. deprecated:: 3.4 ++ The import machinery takes care of this automatically. ++ + .. decorator:: set_package + + A :term:`decorator` for :meth:`importlib.abc.Loader.load_module` to set the :attr:`__package__` attribute on the returned module. If :attr:`__package__` + is set and has a value other than ``None`` it will not be changed. + ++ .. deprecated:: 3.4 ++ The import machinery takes care of this automatically. ++ + .. function:: spec_from_loader(name, loader, *, origin=None, is_package=None) + + A factory function for creating a :class:`ModuleSpec` instance based +diff -r 3405dc9a6afa Doc/library/io.rst +--- a/Doc/library/io.rst ++++ b/Doc/library/io.rst +@@ -280,7 +280,7 @@ + + .. method:: readable() + +- Return ``True`` if the stream can be read from. If False, :meth:`read` ++ Return ``True`` if the stream can be read from. If ``False``, :meth:`read` + will raise :exc:`OSError`. + + .. method:: readline(size=-1) +diff -r 3405dc9a6afa Doc/library/itertools.rst +--- a/Doc/library/itertools.rst ++++ b/Doc/library/itertools.rst +@@ -51,12 +51,12 @@ + chain.from_iterable iterable p0, p1, ... plast, q0, q1, ... ``chain.from_iterable(['ABC', 'DEF']) --> A B C D E F`` + :func:`compress` data, selectors (d[0] if s[0]), (d[1] if s[1]), ... ``compress('ABCDEF', [1,0,1,0,1,1]) --> A C E F`` + :func:`dropwhile` pred, seq seq[n], seq[n+1], starting when pred fails ``dropwhile(lambda x: x<5, [1,4,6,4,1]) --> 6 4 1`` +-:func:`filterfalse` pred, seq elements of seq where pred(elem) is False ``filterfalse(lambda x: x%2, range(10)) --> 0 2 4 6 8`` ++:func:`filterfalse` pred, seq elements of seq where pred(elem) is false ``filterfalse(lambda x: x%2, range(10)) --> 0 2 4 6 8`` + :func:`groupby` iterable[, keyfunc] sub-iterators grouped by value of keyfunc(v) + :func:`islice` seq, [start,] stop [, step] elements from seq[start:stop:step] ``islice('ABCDEFG', 2, None) --> C D E F G`` + :func:`starmap` func, seq func(\*seq[0]), func(\*seq[1]), ... ``starmap(pow, [(2,5), (3,2), (10,3)]) --> 32 9 1000`` + :func:`takewhile` pred, seq seq[0], seq[1], until pred fails ``takewhile(lambda x: x<5, [1,4,6,4,1]) --> 1 4`` +-:func:`tee` it, n it1, it2 , ... itn splits one iterator into n ++:func:`tee` it, n it1, it2, ... itn splits one iterator into n + :func:`zip_longest` p, q, ... (p[0], q[0]), (p[1], q[1]), ... ``zip_longest('ABCD', 'xy', fillvalue='-') --> Ax By C- D-`` + ==================== ============================ ================================================= ============================================================= + +@@ -131,7 +131,7 @@ + >>> inputs = repeat(x0, 36) # only the initial value is used + >>> [format(x, '.2f') for x in accumulate(inputs, logistic_map)] + ['0.40', '0.91', '0.30', '0.81', '0.60', '0.92', '0.29', '0.79', '0.63', +- '0.88' ,'0.39', '0.90', '0.33', '0.84', '0.52', '0.95', '0.18', '0.57', ++ '0.88', '0.39', '0.90', '0.33', '0.84', '0.52', '0.95', '0.18', '0.57', + '0.93', '0.25', '0.71', '0.79', '0.63', '0.88', '0.39', '0.91', '0.32', + '0.83', '0.54', '0.95', '0.20', '0.60', '0.91', '0.30', '0.80', '0.60'] + +diff -r 3405dc9a6afa Doc/library/logging.handlers.rst +--- a/Doc/library/logging.handlers.rst ++++ b/Doc/library/logging.handlers.rst +@@ -843,7 +843,7 @@ + + Returns a new instance of the :class:`HTTPHandler` class. The *host* can be + of the form ``host:port``, should you need to use a specific port number. +- If no *method* is specified, ``GET`` is used. If *secure* is True, an HTTPS ++ If no *method* is specified, ``GET`` is used. If *secure* is true, an HTTPS + connection will be used. If *credentials* is specified, it should be a + 2-tuple consisting of userid and password, which will be placed in an HTTP + 'Authorization' header using Basic authentication. If you specify +diff -r 3405dc9a6afa Doc/library/logging.rst +--- a/Doc/library/logging.rst ++++ b/Doc/library/logging.rst +@@ -113,6 +113,8 @@ + If the root is reached, and it has a level of NOTSET, then all messages will be + processed. Otherwise, the root's level will be used as the effective level. + ++ See :ref:`levels` for a list of levels. ++ + .. versionchanged:: 3.2 + The *lvl* parameter now accepts a string representation of the + level such as 'INFO' as an alternative to the integer constants +@@ -160,7 +162,7 @@ + is called to get the exception information. + + The second optional keyword argument is *stack_info*, which defaults to +- False. If specified as True, stack information is added to the logging ++ ``False``. If true, stack information is added to the logging + message, including the actual logging call. Note that this is not the same + stack information as that displayed through specifying *exc_info*: The + former is stack frames from the bottom of the stack up to the logging call +@@ -308,7 +310,7 @@ + + Checks to see if this logger has any handlers configured. This is done by + looking for handlers in this logger and its parents in the logger hierarchy. +- Returns True if a handler was found, else False. The method stops searching ++ Returns ``True`` if a handler was found, else ``False``. The method stops searching + up the hierarchy whenever a logger with the 'propagate' attribute set to + False is found - that will be the last logger which is checked for the + existence of handlers. +@@ -316,6 +318,34 @@ + .. versionadded:: 3.2 + + ++.. _levels: ++ ++Logging Levels ++-------------- ++ ++The numeric values of logging levels are given in the following table. These are ++primarily of interest if you want to define your own levels, and need them to ++have specific values relative to the predefined levels. If you define a level ++with the same numeric value, it overwrites the predefined value; the predefined ++name is lost. ++ +++--------------+---------------+ ++| Level | Numeric value | +++==============+===============+ ++| ``CRITICAL`` | 50 | +++--------------+---------------+ ++| ``ERROR`` | 40 | +++--------------+---------------+ ++| ``WARNING`` | 30 | +++--------------+---------------+ ++| ``INFO`` | 20 | +++--------------+---------------+ ++| ``DEBUG`` | 10 | +++--------------+---------------+ ++| ``NOTSET`` | 0 | +++--------------+---------------+ ++ ++ + .. _handler: + + Handler Objects +@@ -356,6 +386,8 @@ + severe than *lvl* will be ignored. When a handler is created, the level is set + to :const:`NOTSET` (which causes all messages to be processed). + ++ See :ref:`levels` for a list of levels. ++ + .. versionchanged:: 3.2 + The *lvl* parameter now accepts a string representation of the + level such as 'INFO' as an alternative to the integer constants +@@ -777,7 +809,7 @@ + --------------------- + + :class:`LoggerAdapter` instances are used to conveniently pass contextual +-information into logging calls. For a usage example , see the section on ++information into logging calls. For a usage example, see the section on + :ref:`adding contextual information to your logging output `. + + .. class:: LoggerAdapter(logger, extra) +@@ -878,7 +910,7 @@ + is called to get the exception information. + + The second optional keyword argument is *stack_info*, which defaults to +- False. If specified as True, stack information is added to the logging ++ ``False``. If true, stack information is added to the logging + message, including the actual logging call. Note that this is not the same + stack information as that displayed through specifying *exc_info*: The + former is stack frames from the bottom of the stack up to the logging call +@@ -987,8 +1019,10 @@ + effect is to disable all logging calls of severity *lvl* and below, so that + if you call it with a value of INFO, then all INFO and DEBUG events would be + discarded, whereas those of severity WARNING and above would be processed +- according to the logger's effective level. To undo the effect of a call to +- ``logging.disable(lvl)``, call ``logging.disable(logging.NOTSET)``. ++ according to the logger's effective level. If ++ ``logging.disable(logging.NOTSET)`` is called, it effectively removes this ++ overriding level, so that logging output again depends on the effective ++ levels of individual loggers. + + + .. function:: addLevelName(lvl, levelName) +diff -r 3405dc9a6afa Doc/library/lzma.rst +--- a/Doc/library/lzma.rst ++++ b/Doc/library/lzma.rst +@@ -102,6 +102,11 @@ + byte of data will be returned, unless EOF has been reached. The exact + number of bytes returned is unspecified (the *size* argument is ignored). + ++ .. note:: While calling :meth:`peek` does not change the file position of ++ the :class:`LZMAFile`, it may change the position of the underlying ++ file object (e.g. if the :class:`LZMAFile` was constructed by passing a ++ file object for *filename*). ++ + .. versionchanged:: 3.4 + Added support for the ``"x"`` and ``"xb"`` modes. + +@@ -232,7 +237,7 @@ + + .. attribute:: eof + +- True if the end-of-stream marker has been reached. ++ ``True`` if the end-of-stream marker has been reached. + + .. attribute:: unused_data + +diff -r 3405dc9a6afa Doc/library/mailbox.rst +--- a/Doc/library/mailbox.rst ++++ b/Doc/library/mailbox.rst +@@ -1550,7 +1550,7 @@ + due to malformed messages in the mailbox:: + + import mailbox +- import email.Errors ++ import email.errors + + list_names = ('python-list', 'python-dev', 'python-bugs') + +@@ -1560,7 +1560,7 @@ + for key in inbox.iterkeys(): + try: + message = inbox[key] +- except email.Errors.MessageParseError: ++ except email.errors.MessageParseError: + continue # The message is malformed. Just leave it. + + for name in list_names: +diff -r 3405dc9a6afa Doc/library/mmap.rst +--- a/Doc/library/mmap.rst ++++ b/Doc/library/mmap.rst +@@ -162,7 +162,7 @@ + + .. attribute:: closed + +- True if the file is closed. ++ ``True`` if the file is closed. + + .. versionadded:: 3.2 + +diff -r 3405dc9a6afa Doc/library/multiprocessing.rst +--- a/Doc/library/multiprocessing.rst ++++ b/Doc/library/multiprocessing.rst +@@ -101,6 +101,8 @@ + Contexts and start methods + ~~~~~~~~~~~~~~~~~~~~~~~~~~ + ++.. _multiprocessing-start-methods: ++ + Depending on the platform, :mod:`multiprocessing` supports three ways + to start a process. These *start methods* are + +@@ -147,7 +149,7 @@ + is a serious matter since the system allows only a limited number, and + they will not be automatically unlinked until the next reboot.) + +-To select the a start method you use the :func:`set_start_method` in ++To select a start method you use the :func:`set_start_method` in + the ``if __name__ == '__main__'`` clause of the main module. For + example:: + +diff -r 3405dc9a6afa Doc/library/nntplib.rst +--- a/Doc/library/nntplib.rst ++++ b/Doc/library/nntplib.rst +@@ -82,7 +82,7 @@ + + + .. versionchanged:: 3.2 +- *usenetrc* is now False by default. ++ *usenetrc* is now ``False`` by default. + + .. versionchanged:: 3.3 + Support for the :keyword:`with` statement was added. +@@ -102,6 +102,10 @@ + + .. versionadded:: 3.2 + ++ .. versionchanged:: 3.4 ++ The class now supports hostname check with ++ :attr:`SSLContext.check_hostname` and *Server Name Indicator* (see ++ :data:`~ssl.HAS_SNI`). + + .. exception:: NNTPError + +@@ -216,7 +220,7 @@ + .. method:: NNTP.login(user=None, password=None, usenetrc=True) + + Send ``AUTHINFO`` commands with the user name and password. If *user* +- and *password* are None and *usenetrc* is True, credentials from ++ and *password* are None and *usenetrc* is true, credentials from + ``~/.netrc`` will be used if possible. + + Unless intentionally delayed, login is normally performed during the +@@ -241,6 +245,10 @@ + + .. versionadded:: 3.2 + ++ .. versionchanged:: 3.4 ++ The method now supports hostname check with ++ :attr:`SSLContext.check_hostname` and *Server Name Indicator* (see ++ :data:`~ssl.HAS_SNI`). + + .. method:: NNTP.newgroups(date, *, file=None) + +diff -r 3405dc9a6afa Doc/library/operator.rst +--- a/Doc/library/operator.rst ++++ b/Doc/library/operator.rst +@@ -265,7 +265,7 @@ + ``(b.name, b.date)``. + + * After ``f = attrgetter('name.first', 'name.last')``, the call ``f(b)`` +- returns ``(r.name.first, r.name.last)``. ++ returns ``(b.name.first, b.name.last)``. + + Equivalent to:: + +diff -r 3405dc9a6afa Doc/library/os.path.rst +--- a/Doc/library/os.path.rst ++++ b/Doc/library/os.path.rst +@@ -137,7 +137,7 @@ + the number of seconds since the epoch (see the :mod:`time` module). Raise + :exc:`OSError` if the file does not exist or is inaccessible. + +- If :func:`os.stat_float_times` returns True, the result is a floating point ++ If :func:`os.stat_float_times` returns ``True``, the result is a floating point + number. + + +@@ -147,7 +147,7 @@ + giving the number of seconds since the epoch (see the :mod:`time` module). + Raise :exc:`OSError` if the file does not exist or is inaccessible. + +- If :func:`os.stat_float_times` returns True, the result is a floating point ++ If :func:`os.stat_float_times` returns ``True``, the result is a floating point + number. + + +@@ -340,5 +340,5 @@ + + .. data:: supports_unicode_filenames + +- True if arbitrary Unicode strings can be used as file names (within limitations ++ ``True`` if arbitrary Unicode strings can be used as file names (within limitations + imposed by the file system). +diff -r 3405dc9a6afa Doc/library/os.rst +--- a/Doc/library/os.rst ++++ b/Doc/library/os.rst +@@ -551,7 +551,7 @@ + + .. data:: supports_bytes_environ + +- True if the native OS type of the environment is bytes (eg. False on ++ ``True`` if the native OS type of the environment is bytes (eg. ``False`` on + Windows). + + .. versionadded:: 3.2 +@@ -1980,11 +1980,26 @@ + read-only, and if :const:`ST_NOSUID` is set, the semantics of + setuid/setgid bits are disabled or not supported. + ++ Additional module-level constants are defined for GNU/glibc based systems. ++ These are :const:`ST_NODEV` (disallow access to device special files), ++ :const:`ST_NOEXEC` (disallow program execution), :const:`ST_SYNCHRONOUS` ++ (writes are synced at once), :const:`ST_MANDLOCK` (allow mandatory locks on an FS), ++ :const:`ST_WRITE` (write on file/directory/symlink), :const:`ST_APPEND` ++ (append-only file), :const:`ST_IMMUTABLE` (immutable file), :const:`ST_NOATIME` ++ (do not update access times), :const:`ST_NODIRATIME` (do not update directory access ++ times), :const:`ST_RELATIME` (update atime relative to mtime/ctime). ++ + This function can support :ref:`specifying a file descriptor `. + + .. versionchanged:: 3.2 + The :const:`ST_RDONLY` and :const:`ST_NOSUID` constants were added. + ++ .. versionchanged:: 3.4 ++ The :const:`ST_NODEV`, :const:`ST_NOEXEC`, :const:`ST_SYNCHRONOUS`, ++ :const:`ST_MANDLOCK`, :const:`ST_WRITE`, :const:`ST_APPEND`, ++ :const:`ST_IMMUTABLE`, :const:`ST_NOATIME`, :const:`ST_NODIRATIME`, ++ and :const:`ST_RELATIME` constants were added. ++ + Availability: Unix. + + .. versionadded:: 3.3 +diff -r 3405dc9a6afa Doc/library/ossaudiodev.rst +--- a/Doc/library/ossaudiodev.rst ++++ b/Doc/library/ossaudiodev.rst +@@ -49,7 +49,7 @@ + the official documentation for the OSS C API + + The module defines a large number of constants supplied by the OSS device +- driver; see ```` on either Linux or FreeBSD for a listing . ++ driver; see ```` on either Linux or FreeBSD for a listing. + + :mod:`ossaudiodev` defines the following variables and functions: + +diff -r 3405dc9a6afa Doc/library/pathlib-inheritance.png +Binary file Doc/library/pathlib-inheritance.png has changed +diff -r 3405dc9a6afa Doc/library/pathlib-inheritance.svg +--- /dev/null ++++ b/Doc/library/pathlib-inheritance.svg +@@ -0,0 +1,4 @@ ++ ++ ++ ++ +diff -r 3405dc9a6afa Doc/library/pathlib.rst +--- a/Doc/library/pathlib.rst ++++ b/Doc/library/pathlib.rst +@@ -9,15 +9,27 @@ + + .. versionadded:: 3.4 + +- + This module offers classes representing filesystem paths with semantics + appropriate for different operating systems. Path classes are divided + between :ref:`pure paths `, which provide purely computational + operations without I/O, and :ref:`concrete paths `, which + inherit from pure paths but also provide I/O operations. + +-The main point of entry is the :class:`Path` class, which will instantiate +-a :ref:`concrete path ` for the current platform. ++.. image:: pathlib-inheritance.png ++ :align: center ++ ++If you've never used this module before or just aren't sure which class is ++right for your task, :class:`Path` is most likely what you need. It instantiates ++a :ref:`concrete path ` for the platform the code is running on. ++ ++Pure paths are useful in some special cases; for example: ++ ++#. If you want to manipulate Windows paths on a Unix machine (or vice versa). ++ You cannot instantiate a :class:`WindowsPath` when running on Unix, but you ++ can instantiate :class:`PureWindowsPath`. ++#. You want to make sure that your code only manipulates paths without actually ++ accessing the OS. In this case, instantiating one of the pure classes may be ++ useful since those simply don't have any OS-accessing operations. + + .. note:: + This module has been included in the standard library on a +@@ -86,8 +98,57 @@ + access a filesystem. There are three ways to access these classes, which + we also call *flavours*: + ++.. class:: PurePath(*pathsegments) + +-.. class:: PurePosixPath ++ A generic class that represents the system's path flavour (instantiating ++ it creates either a :class:`PurePosixPath` or a :class:`PureWindowsPath`):: ++ ++ >>> PurePath('setup.py') # Running on a Unix machine ++ PurePosixPath('setup.py') ++ ++ Each element of *pathsegments* can be either a string or bytes object ++ representing a path segment; it can also be another path object:: ++ ++ >>> PurePath('foo', 'some/path', 'bar') ++ PurePosixPath('foo/some/path/bar') ++ >>> PurePath(Path('foo'), Path('bar')) ++ PurePosixPath('foo/bar') ++ ++ When *pathsegments* is empty, the current directory is assumed:: ++ ++ >>> PurePath() ++ PurePosixPath('.') ++ ++ When several absolute paths are given, the last is taken as an anchor ++ (mimicking :func:`os.path.join`'s behaviour):: ++ ++ >>> PurePath('/etc', '/usr', 'lib64') ++ PurePosixPath('/usr/lib64') ++ >>> PureWindowsPath('c:/Windows', 'd:bar') ++ PureWindowsPath('d:bar') ++ ++ However, in a Windows path, changing the local root doesn't discard the ++ previous drive setting:: ++ ++ >>> PureWindowsPath('c:/Windows', '/Program Files') ++ PureWindowsPath('c:/Program Files') ++ ++ Spurious slashes and single dots are collapsed, but double dots (``'..'``) ++ are not, since this would change the meaning of a path in the face of ++ symbolic links:: ++ ++ >>> PurePath('foo//bar') ++ PurePosixPath('foo/bar') ++ >>> PurePath('foo/./bar') ++ PurePosixPath('foo/bar') ++ >>> PurePath('foo/../bar') ++ PurePosixPath('foo/../bar') ++ ++ (a naïve approach would make ``PurePosixPath('foo/../bar')`` equivalent ++ to ``PurePosixPath('bar')``, which is wrong if ``foo`` is a symbolic link ++ to another directory) ++ ++.. class:: PurePosixPath(*pathsegments) + + A subclass of :class:`PurePath`, this path flavour represents non-Windows + filesystem paths:: +@@ -95,7 +156,9 @@ + >>> PurePosixPath('/etc') + PurePosixPath('/etc') + +-.. class:: PureWindowsPath ++ *pathsegments* is specified similarly to :class:`PurePath`. ++ ++.. class:: PureWindowsPath(*pathsegments) + + A subclass of :class:`PurePath`, this path flavour represents Windows + filesystem paths:: +@@ -103,67 +166,12 @@ + >>> PureWindowsPath('c:/Program Files/') + PureWindowsPath('c:/Program Files') + +-.. class:: PurePath +- +- A generic class that represents the system's path flavour (instantiating +- it creates either a :class:`PurePosixPath` or a :class:`PureWindowsPath`):: +- +- >>> PurePath('setup.py') +- PurePosixPath('setup.py') +- ++ *pathsegments* is specified similarly to :class:`PurePath`. + + Regardless of the system you're running on, you can instantiate all of + these classes, since they don't provide any operation that does system calls. + + +-Constructing paths +-^^^^^^^^^^^^^^^^^^ +- +-Path constructors accept an arbitrary number of positional arguments. +-When called without any argument, a path object points to the current +-directory:: +- +- >>> PurePath() +- PurePosixPath('.') +- +-Any argument can be a string or bytes object representing an arbitrary number +-of path segments, but it can also be another path object:: +- +- >>> PurePath('foo', 'some/path', 'bar') +- PurePosixPath('foo/some/path/bar') +- >>> PurePath(Path('foo'), Path('bar')) +- PurePosixPath('foo/bar') +- +-When several absolute paths are given, the last is taken as an anchor +-(mimicking :func:`os.path.join`'s behaviour):: +- +- >>> PurePath('/etc', '/usr', 'lib64') +- PurePosixPath('/usr/lib64') +- >>> PureWindowsPath('c:/Windows', 'd:bar') +- PureWindowsPath('d:bar') +- +-However, in a Windows path, changing the local root doesn't discard the +-previous drive setting:: +- +- >>> PureWindowsPath('c:/Windows', '/Program Files') +- PureWindowsPath('c:/Program Files') +- +-Spurious slashes and single dots are collapsed, but double dots (``'..'``) +-are not, since this would change the meaning of a path in the face of +-symbolic links:: +- +- >>> PurePath('foo//bar') +- PurePosixPath('foo/bar') +- >>> PurePath('foo/./bar') +- PurePosixPath('foo/bar') +- >>> PurePath('foo/../bar') +- PurePosixPath('foo/../bar') +- +-(a naïve approach would make ``PurePosixPath('foo/../bar')`` equivalent +-to ``PurePosixPath('bar')``, which is wrong if ``foo`` is a symbolic link +-to another directory) +- +- + General properties + ^^^^^^^^^^^^^^^^^^ + +@@ -439,9 +447,9 @@ + + .. method:: PurePath.is_reserved() + +- With :class:`PureWindowsPath`, return True if the path is considered +- reserved under Windows, False otherwise. With :class:`PurePosixPath`, +- False is always returned. ++ With :class:`PureWindowsPath`, return ``True`` if the path is considered ++ reserved under Windows, ``False`` otherwise. With :class:`PurePosixPath`, ++ ``False`` is always returned. + + >>> PureWindowsPath('nul').is_reserved() + True +@@ -469,8 +477,8 @@ + + .. method:: PurePath.match(pattern) + +- Match this path against the provided glob-style pattern. Return True +- if matching is successful, False otherwise. ++ Match this path against the provided glob-style pattern. Return ``True`` ++ if matching is successful, ``False`` otherwise. + + If *pattern* is relative, the path can be either relative or absolute, + and matching is done from the right:: +@@ -524,24 +532,7 @@ + operations provided by the latter, they also provide methods to do system + calls on path objects. There are three ways to instantiate concrete paths: + +- +-.. class:: PosixPath +- +- A subclass of :class:`Path` and :class:`PurePosixPath`, this class +- represents concrete non-Windows filesystem paths:: +- +- >>> PosixPath('/etc') +- PosixPath('/etc') +- +-.. class:: WindowsPath +- +- A subclass of :class:`Path` and :class:`PureWindowsPath`, this class +- represents concrete Windows filesystem paths:: +- +- >>> WindowsPath('c:/Program Files/') +- WindowsPath('c:/Program Files') +- +-.. class:: Path ++.. class:: Path(*pathsegments) + + A subclass of :class:`PurePath`, this class represents concrete paths of + the system's path flavour (instantiating it creates either a +@@ -550,6 +541,27 @@ + >>> Path('setup.py') + PosixPath('setup.py') + ++ *pathsegments* is specified similarly to :class:`PurePath`. ++ ++.. class:: PosixPath(*pathsegments) ++ ++ A subclass of :class:`Path` and :class:`PurePosixPath`, this class ++ represents concrete non-Windows filesystem paths:: ++ ++ >>> PosixPath('/etc') ++ PosixPath('/etc') ++ ++ *pathsegments* is specified similarly to :class:`PurePath`. ++ ++.. class:: WindowsPath(*pathsegments) ++ ++ A subclass of :class:`Path` and :class:`PureWindowsPath`, this class ++ represents concrete Windows filesystem paths:: ++ ++ >>> WindowsPath('c:/Program Files/') ++ WindowsPath('c:/Program Files') ++ ++ *pathsegments* is specified similarly to :class:`PurePath`. + + You can only instantiate the class flavour that corresponds to your system + (allowing system calls on non-compatible path flavours could lead to +@@ -655,69 +667,69 @@ + + .. method:: Path.group() + +- Return the name of the group owning the file. :exc:`KeyError` is thrown ++ Return the name of the group owning the file. :exc:`KeyError` is raised + if the file's gid isn't found in the system database. + + + .. method:: Path.is_dir() + +- Return True if the path points to a directory (or a symbolic link +- pointing to a directory), False if it points to another kind of file. ++ Return ``True`` if the path points to a directory (or a symbolic link ++ pointing to a directory), ``False`` if it points to another kind of file. + +- False is also returned if the path doesn't exist or is a broken symlink; ++ ``False`` is also returned if the path doesn't exist or is a broken symlink; + other errors (such as permission errors) are propagated. + + + .. method:: Path.is_file() + +- Return True if the path points to a regular file (or a symbolic link +- pointing to a regular file), False if it points to another kind of file. ++ Return ``True`` if the path points to a regular file (or a symbolic link ++ pointing to a regular file), ``False`` if it points to another kind of file. + +- False is also returned if the path doesn't exist or is a broken symlink; ++ ``False`` is also returned if the path doesn't exist or is a broken symlink; + other errors (such as permission errors) are propagated. + + + .. method:: Path.is_symlink() + +- Return True if the path points to a symbolic link, False otherwise. ++ Return ``True`` if the path points to a symbolic link, ``False`` otherwise. + +- False is also returned if the path doesn't exist; other errors (such ++ ``False`` is also returned if the path doesn't exist; other errors (such + as permission errors) are propagated. + + + .. method:: Path.is_socket() + +- Return True if the path points to a Unix socket (or a symbolic link +- pointing to a Unix socket), False if it points to another kind of file. ++ Return ``True`` if the path points to a Unix socket (or a symbolic link ++ pointing to a Unix socket), ``False`` if it points to another kind of file. + +- False is also returned if the path doesn't exist or is a broken symlink; ++ ``False`` is also returned if the path doesn't exist or is a broken symlink; + other errors (such as permission errors) are propagated. + + + .. method:: Path.is_fifo() + +- Return True if the path points to a FIFO (or a symbolic link +- pointing to a FIFO), False if it points to another kind of file. ++ Return ``True`` if the path points to a FIFO (or a symbolic link ++ pointing to a FIFO), ``False`` if it points to another kind of file. + +- False is also returned if the path doesn't exist or is a broken symlink; ++ ``False`` is also returned if the path doesn't exist or is a broken symlink; + other errors (such as permission errors) are propagated. + + + .. method:: Path.is_block_device() + +- Return True if the path points to a block device (or a symbolic link +- pointing to a block device), False if it points to another kind of file. ++ Return ``True`` if the path points to a block device (or a symbolic link ++ pointing to a block device), ``False`` if it points to another kind of file. + +- False is also returned if the path doesn't exist or is a broken symlink; ++ ``False`` is also returned if the path doesn't exist or is a broken symlink; + other errors (such as permission errors) are propagated. + + + .. method:: Path.is_char_device() + +- Return True if the path points to a character device (or a symbolic link +- pointing to a character device), False if it points to another kind of file. ++ Return ``True`` if the path points to a character device (or a symbolic link ++ pointing to a character device), ``False`` if it points to another kind of file. + +- False is also returned if the path doesn't exist or is a broken symlink; ++ ``False`` is also returned if the path doesn't exist or is a broken symlink; + other errors (such as permission errors) are propagated. + + +@@ -753,11 +765,15 @@ + + Create a new directory at this given path. If *mode* is given, it is + combined with the process' ``umask`` value to determine the file mode +- and access flags. If the path already exists, :exc:`OSError` is raised. ++ and access flags. If the path already exists, :exc:`FileExistsError` ++ is raised. + +- If *parents* is True, any missing parents of this path are created +- as needed. If *parents* is False (the default), a missing parent raises +- :exc:`OSError`. ++ If *parents* is true, any missing parents of this path are created ++ as needed; they are created with the default permissions without taking ++ *mode* into account (mimicking the POSIX ``mkdir -p`` command). ++ ++ If *parents* is false (the default), a missing parent raises ++ :exc:`FileNotFoundError`. + + + .. method:: Path.open(mode='r', buffering=-1, encoding=None, errors=None, newline=None) +@@ -774,7 +790,7 @@ + + .. method:: Path.owner() + +- Return the name of the user owning the file. :exc:`KeyError` is thrown ++ Return the name of the user owning the file. :exc:`KeyError` is raised + if the file's uid isn't found in the system database. + + +@@ -841,7 +857,7 @@ + .. method:: Path.symlink_to(target, target_is_directory=False) + + Make this path a symbolic link to *target*. Under Windows, +- *target_is_directory* must be True (default False) if the link's target ++ *target_is_directory* must be true (default ``False``) if the link's target + is a directory. Under POSIX, *target_is_directory*'s value is ignored. + + >>> p = Path('mylink') +@@ -864,7 +880,7 @@ + with the process' ``umask`` value to determine the file mode and access + flags. If the file already exists, the function succeeds if *exist_ok* + is true (and its modification time is updated to the current time), +- otherwise :exc:`OSError` is raised. ++ otherwise :exc:`FileExistsError` is raised. + + + .. method:: Path.unlink() +diff -r 3405dc9a6afa Doc/library/pickle.rst +--- a/Doc/library/pickle.rst ++++ b/Doc/library/pickle.rst +@@ -15,13 +15,14 @@ + .. sectionauthor:: Barry Warsaw + + +-The :mod:`pickle` module implements a fundamental, but powerful algorithm for +-serializing and de-serializing a Python object structure. "Pickling" is the +-process whereby a Python object hierarchy is converted into a byte stream, and +-"unpickling" is the inverse operation, whereby a byte stream is converted back +-into an object hierarchy. Pickling (and unpickling) is alternatively known as +-"serialization", "marshalling," [#]_ or "flattening", however, to avoid +-confusion, the terms used here are "pickling" and "unpickling".. ++The :mod:`pickle` module implements binary protocols for serializing and ++de-serializing a Python object structure. *"Pickling"* is the process ++whereby a Python object hierarchy is converted into a byte stream, and ++*"unpickling"* is the inverse operation, whereby a byte stream ++(from a :term:`binary file` or :term:`bytes-like object`) is converted ++back into an object hierarchy. Pickling (and unpickling) is alternatively ++known as "serialization", "marshalling," [#]_ or "flattening"; however, to ++avoid confusion, the terms used here are "pickling" and "unpickling". + + .. warning:: + +@@ -33,9 +34,8 @@ + Relationship to other Python modules + ------------------------------------ + +-The :mod:`pickle` module has an transparent optimizer (:mod:`_pickle`) written +-in C. It is used whenever available. Otherwise the pure Python implementation is +-used. ++Comparison with ``marshal`` ++^^^^^^^^^^^^^^^^^^^^^^^^^^^ + + Python has a more primitive serialization module called :mod:`marshal`, but in + general :mod:`pickle` should always be the preferred way to serialize Python +@@ -69,17 +69,33 @@ + The :mod:`pickle` serialization format is guaranteed to be backwards compatible + across Python releases. + +-Note that serialization is a more primitive notion than persistence; although +-:mod:`pickle` reads and writes file objects, it does not handle the issue of +-naming persistent objects, nor the (even more complicated) issue of concurrent +-access to persistent objects. The :mod:`pickle` module can transform a complex +-object into a byte stream and it can transform the byte stream into an object +-with the same internal structure. Perhaps the most obvious thing to do with +-these byte streams is to write them onto a file, but it is also conceivable to +-send them across a network or store them in a database. The module +-:mod:`shelve` provides a simple interface to pickle and unpickle objects on +-DBM-style database files. ++Comparison with ``json`` ++^^^^^^^^^^^^^^^^^^^^^^^^ + ++There are fundamental differences between the pickle protocols and ++`JSON (JavaScript Object Notation) `_: ++ ++* JSON is a text serialization format (it outputs unicode text, although ++ most of the time it is then encoded to ``utf-8``), while pickle is ++ a binary serialization format; ++ ++* JSON is human-readable, while pickle is not; ++ ++* JSON is interoperable and widely used outside of the Python ecosystem, ++ while pickle is Python-specific; ++ ++* JSON, by default, can only represent a subset of the Python built-in ++ types, and no custom classes; pickle can represent an extremely large ++ number of Python types (many of them automatically, by clever usage ++ of Python's introspection facilities; complex cases can be tackled by ++ implementing :ref:`specific object APIs `). ++ ++.. seealso:: ++ The :mod:`json` module: a standard library module allowing JSON ++ serialization and deserialization. ++ ++ ++.. _pickle-protocols: + + Data stream format + ------------------ +@@ -112,10 +128,27 @@ + efficient pickling of :term:`new-style class`\es. Refer to :pep:`307` for + information about improvements brought by protocol 2. + +-* Protocol version 3 was added in Python 3. It has explicit support for ++* Protocol version 3 was added in Python 3.0. It has explicit support for + :class:`bytes` objects and cannot be unpickled by Python 2.x. This is +- the default as well as the current recommended protocol; use it whenever +- possible. ++ the default protocol, and the recommended protocol when compatibility with ++ other Python 3 versions is required. ++ ++* Protocol version 4 was added in Python 3.4. It adds support for very large ++ objects, pickling more kinds of objects, and some data format ++ optimizations. Refer to :pep:`3154` for information about improvements ++ brought by protocol 4. ++ ++.. note:: ++ Serialization is a more primitive notion than persistence; although ++ :mod:`pickle` reads and writes file objects, it does not handle the issue of ++ naming persistent objects, nor the (even more complicated) issue of concurrent ++ access to persistent objects. The :mod:`pickle` module can transform a complex ++ object into a byte stream and it can transform the byte stream into an object ++ with the same internal structure. Perhaps the most obvious thing to do with ++ these byte streams is to write them onto a file, but it is also conceivable to ++ send them across a network or store them in a database. The :mod:`shelve` ++ module provides a simple interface to pickle and unpickle objects on ++ DBM-style database files. + + + Module Interface +@@ -131,13 +164,16 @@ + + .. data:: HIGHEST_PROTOCOL + +- The highest protocol version available. This value can be passed as a +- *protocol* value. ++ An integer, the highest :ref:`protocol version ` ++ available. This value can be passed as a *protocol* value to functions ++ :func:`dump` and :func:`dumps` as well as the :class:`Pickler` ++ constructor. + + .. data:: DEFAULT_PROTOCOL + +- The default protocol used for pickling. May be less than HIGHEST_PROTOCOL. +- Currently the default protocol is 3, a new protocol designed for Python 3.0. ++ An integer, the default :ref:`protocol version ` used ++ for pickling. May be less than :data:`HIGHEST_PROTOCOL`. Currently the ++ default protocol is 3, a new protocol designed for Python 3. + + + The :mod:`pickle` module provides the following functions to make the pickling +@@ -148,9 +184,9 @@ + Write a pickled representation of *obj* to the open :term:`file object` *file*. + This is equivalent to ``Pickler(file, protocol).dump(obj)``. + +- The optional *protocol* argument tells the pickler to use the given protocol; +- supported protocols are 0, 1, 2, 3. The default protocol is 3; a +- backward-incompatible protocol designed for Python 3.0. ++ The optional *protocol* argument tells the pickler to use the given ++ protocol; supported protocols are 0, 1, 2, 3. The default protocol is 3; a ++ backward-incompatible protocol designed for Python 3. + + Specifying a negative protocol version selects the highest protocol version + supported. The higher the protocol used, the more recent the version of +@@ -161,65 +197,67 @@ + :class:`io.BytesIO` instance, or any other custom object that meets this + interface. + +- If *fix_imports* is True and *protocol* is less than 3, pickle will try to +- map the new Python 3.x names to the old module names used in Python 2.x, +- so that the pickle data stream is readable with Python 2.x. ++ If *fix_imports* is true and *protocol* is less than 3, pickle will try to ++ map the new Python 3 names to the old module names used in Python 2, so ++ that the pickle data stream is readable with Python 2. + + .. function:: dumps(obj, protocol=None, \*, fix_imports=True) + +- Return the pickled representation of the object as a :class:`bytes` +- object, instead of writing it to a file. ++ Return the pickled representation of the object as a :class:`bytes` object, ++ instead of writing it to a file. + +- The optional *protocol* argument tells the pickler to use the given protocol; +- supported protocols are 0, 1, 2, 3. The default protocol is 3; a +- backward-incompatible protocol designed for Python 3.0. ++ The optional *protocol* argument tells the pickler to use the given ++ protocol; supported protocols are 0, 1, 2, 3 and 4. The default protocol ++ is 3; a backward-incompatible protocol designed for Python 3. + + Specifying a negative protocol version selects the highest protocol version + supported. The higher the protocol used, the more recent the version of + Python needed to read the pickle produced. + +- If *fix_imports* is True and *protocol* is less than 3, pickle will try to +- map the new Python 3.x names to the old module names used in Python 2.x, +- so that the pickle data stream is readable with Python 2.x. ++ If *fix_imports* is true and *protocol* is less than 3, pickle will try to ++ map the new Python 3 names to the old module names used in Python 2, so ++ that the pickle data stream is readable with Python 2. + + .. function:: load(file, \*, fix_imports=True, encoding="ASCII", errors="strict") + +- Read a pickled object representation from the open :term:`file object` *file* +- and return the reconstituted object hierarchy specified therein. This is +- equivalent to ``Unpickler(file).load()``. ++ Read a pickled object representation from the open :term:`file object` ++ *file* and return the reconstituted object hierarchy specified therein. ++ This is equivalent to ``Unpickler(file).load()``. + +- The protocol version of the pickle is detected automatically, so no protocol +- argument is needed. Bytes past the pickled object's representation are +- ignored. ++ The protocol version of the pickle is detected automatically, so no ++ protocol argument is needed. Bytes past the pickled object's ++ representation are ignored. + + The argument *file* must have two methods, a read() method that takes an + integer argument, and a readline() method that requires no arguments. Both +- methods should return bytes. Thus *file* can be an on-disk file opened +- for binary reading, a :class:`io.BytesIO` object, or any other custom object ++ methods should return bytes. Thus *file* can be an on-disk file opened for ++ binary reading, a :class:`io.BytesIO` object, or any other custom object + that meets this interface. + + Optional keyword arguments are *fix_imports*, *encoding* and *errors*, + which are used to control compatibility support for pickle stream generated +- by Python 2.x. If *fix_imports* is True, pickle will try to map the old +- Python 2.x names to the new names used in Python 3.x. The *encoding* and ++ by Python 2. If *fix_imports* is true, pickle will try to map the old ++ Python 2 names to the new names used in Python 3. The *encoding* and + *errors* tell pickle how to decode 8-bit string instances pickled by Python +- 2.x; these default to 'ASCII' and 'strict', respectively. ++ 2; these default to 'ASCII' and 'strict', respectively. The *encoding* can ++ be 'bytes' to read these 8-bit string instances as bytes objects. + + .. function:: loads(bytes_object, \*, fix_imports=True, encoding="ASCII", errors="strict") + + Read a pickled object hierarchy from a :class:`bytes` object and return the + reconstituted object hierarchy specified therein + +- The protocol version of the pickle is detected automatically, so no protocol +- argument is needed. Bytes past the pickled object's representation are +- ignored. ++ The protocol version of the pickle is detected automatically, so no ++ protocol argument is needed. Bytes past the pickled object's ++ representation are ignored. + + Optional keyword arguments are *fix_imports*, *encoding* and *errors*, + which are used to control compatibility support for pickle stream generated +- by Python 2.x. If *fix_imports* is True, pickle will try to map the old +- Python 2.x names to the new names used in Python 3.x. The *encoding* and ++ by Python 2. If *fix_imports* is true, pickle will try to map the old ++ Python 2 names to the new names used in Python 3. The *encoding* and + *errors* tell pickle how to decode 8-bit string instances pickled by Python +- 2.x; these default to 'ASCII' and 'strict', respectively. ++ 2; these default to 'ASCII' and 'strict', respectively. The *encoding* can ++ be 'bytes' to read these 8-bit string instances as bytes objects. + + + The :mod:`pickle` module defines three exceptions: +@@ -254,9 +292,9 @@ + + This takes a binary file for writing a pickle data stream. + +- The optional *protocol* argument tells the pickler to use the given protocol; +- supported protocols are 0, 1, 2, 3. The default protocol is 3; a +- backward-incompatible protocol designed for Python 3.0. ++ The optional *protocol* argument tells the pickler to use the given ++ protocol; supported protocols are 0, 1, 2, 3 and 4. The default protocol ++ is 3; a backward-incompatible protocol designed for Python 3. + + Specifying a negative protocol version selects the highest protocol version + supported. The higher the protocol used, the more recent the version of +@@ -264,11 +302,12 @@ + + The *file* argument must have a write() method that accepts a single bytes + argument. It can thus be an on-disk file opened for binary writing, a +- :class:`io.BytesIO` instance, or any other custom object that meets this interface. ++ :class:`io.BytesIO` instance, or any other custom object that meets this ++ interface. + +- If *fix_imports* is True and *protocol* is less than 3, pickle will try to +- map the new Python 3.x names to the old module names used in Python 2.x, +- so that the pickle data stream is readable with Python 2.x. ++ If *fix_imports* is true and *protocol* is less than 3, pickle will try to ++ map the new Python 3 names to the old module names used in Python 2, so ++ that the pickle data stream is readable with Python 2. + + .. method:: dump(obj) + +@@ -330,16 +369,17 @@ + + The argument *file* must have two methods, a read() method that takes an + integer argument, and a readline() method that requires no arguments. Both +- methods should return bytes. Thus *file* can be an on-disk file object opened +- for binary reading, a :class:`io.BytesIO` object, or any other custom object +- that meets this interface. ++ methods should return bytes. Thus *file* can be an on-disk file object ++ opened for binary reading, a :class:`io.BytesIO` object, or any other ++ custom object that meets this interface. + + Optional keyword arguments are *fix_imports*, *encoding* and *errors*, + which are used to control compatibility support for pickle stream generated +- by Python 2.x. If *fix_imports* is True, pickle will try to map the old +- Python 2.x names to the new names used in Python 3.x. The *encoding* and ++ by Python 2. If *fix_imports* is true, pickle will try to map the old ++ Python 2 names to the new names used in Python 3. The *encoding* and + *errors* tell pickle how to decode 8-bit string instances pickled by Python +- 2.x; these default to 'ASCII' and 'strict', respectively. ++ 2; these default to 'ASCII' and 'strict', respectively. The *encoding* can ++ be 'bytes' to read these ß8-bit string instances as bytes objects. + + .. method:: load() + +@@ -811,6 +851,14 @@ + third-party solutions. + + ++Performance ++----------- ++ ++Recent versions of the pickle protocol (from protocol 2 and upwards) feature ++efficient binary encodings for several common features and built-in types. ++Also, the :mod:`pickle` module has a transparent optimizer written in C. ++ ++ + .. _pickle-example: + + Examples +diff -r 3405dc9a6afa Doc/library/plistlib.rst +--- a/Doc/library/plistlib.rst ++++ b/Doc/library/plistlib.rst +@@ -54,7 +54,7 @@ + + * :data:`FMT_BINARY`: Binary plist format + +- If *use_builtin_types* is True (the default) binary data will be returned ++ If *use_builtin_types* is true (the default) binary data will be returned + as instances of :class:`bytes`, otherwise it is returned as instances of + :class:`Data`. + +diff -r 3405dc9a6afa Doc/library/poplib.rst +--- a/Doc/library/poplib.rst ++++ b/Doc/library/poplib.rst +@@ -53,6 +53,10 @@ + .. versionchanged:: 3.2 + *context* parameter added. + ++ .. versionchanged:: 3.4 ++ The class now supports hostname check with ++ :attr:`SSLContext.check_hostname` and *Server Name Indicator* (see ++ :data:`~ssl.HAS_SNI`). + + One exception is defined as an attribute of the :mod:`poplib` module: + +@@ -194,7 +198,10 @@ + + *context* parameter is a :class:`ssl.SSLContext` object which allows + bundling SSL configuration options, certificates and private keys into +- a single (potentially long-lived) structure. ++ a single (potentially long-lived) structure. This method supports ++ hostname checking via :attr:`SSLContext.check_hostname` ++ :attr:`SSLContext.check_hostname` and *Server Name Indicator* (see ++ :data:`~ssl.HAS_SNI`). + + .. versionadded:: 3.4 + +diff -r 3405dc9a6afa Doc/library/pyexpat.rst +--- a/Doc/library/pyexpat.rst ++++ b/Doc/library/pyexpat.rst +@@ -861,5 +861,5 @@ + .. [#] The encoding string included in XML output should conform to the + appropriate standards. For example, "UTF-8" is valid, but "UTF8" is + not. See http://www.w3.org/TR/2006/REC-xml11-20060816/#NT-EncodingDecl +- and http://www.iana.org/assignments/character-sets . ++ and http://www.iana.org/assignments/character-sets\ . + +diff -r 3405dc9a6afa Doc/library/re.rst +--- a/Doc/library/re.rst ++++ b/Doc/library/re.rst +@@ -317,7 +317,7 @@ + optional and can be omitted. For example, + ``(<)?(\w+@\w+(?:\.\w+)+)(?(1)>|$)`` is a poor email matching pattern, which + will match with ``''`` as well as ``'user@host.com'``, but +- not with ``''`` . ++ not with ``''``. + + + The special sequences consist of ``'\'`` and a character from the list below. +@@ -801,7 +801,7 @@ + >>> pattern.fullmatch("dog") # No match as "o" is not at the start of "dog". + >>> pattern.fullmatch("ogre") # No match as not the full string matches. + >>> pattern.fullmatch("doggie", 1, 3) # Matches within given limits. +- <_sre.SRE_Match object at ...> ++ <_sre.SRE_Match object; span=(1, 3), match='og'> + + .. versionadded:: 3.4 + +diff -r 3405dc9a6afa Doc/library/resource.rst +--- a/Doc/library/resource.rst ++++ b/Doc/library/resource.rst +@@ -217,6 +217,34 @@ + + .. versionadded:: 3.4 + ++.. data:: RLIMIT_SBSIZE ++ ++ The maximum size (in bytes) of socket buffer usage for this user. ++ This limits the amount of network memory, and hence the amount of mbufs, ++ that this user may hold at any time. ++ ++ Availability: FreeBSD 9 or later. ++ ++ .. versionadded:: 3.4 ++ ++.. data:: RLIMIT_SWAP ++ ++ The maximum size (in bytes) of the swap space that may be reserved or ++ used by all of this user id's processes. ++ This limit is enforced only if bit 1 of the vm.overcommit sysctl is set. ++ Please see :manpage:`tuning(7)` for a complete description of this sysctl. ++ ++ Availability: FreeBSD 9 or later. ++ ++ .. versionadded:: 3.4 ++ ++.. data:: RLIMIT_NPTS ++ ++ The maximum number of pseudo-terminals created by this user id. ++ ++ Availability: FreeBSD 9 or later. ++ ++ .. versionadded:: 3.4 + + Resource Usage + -------------- +diff -r 3405dc9a6afa Doc/library/runpy.rst +--- a/Doc/library/runpy.rst ++++ b/Doc/library/runpy.rst +@@ -44,28 +44,22 @@ + below are defined in the supplied dictionary, those definitions are + overridden by :func:`run_module`. + +- The special global variables ``__name__``, ``__file__``, ``__cached__``, +- ``__loader__`` +- and ``__package__`` are set in the globals dictionary before the module +- code is executed (Note that this is a minimal set of variables - other +- variables may be set implicitly as an interpreter implementation detail). ++ The special global variables ``__name__``, ``__spec__``, ``__file__``, ++ ``__cached__``, ``__loader__`` and ``__package__`` are set in the globals ++ dictionary before the module code is executed (Note that this is a ++ minimal set of variables - other variables may be set implicitly as an ++ interpreter implementation detail). + + ``__name__`` is set to *run_name* if this optional argument is not + :const:`None`, to ``mod_name + '.__main__'`` if the named module is a + package and to the *mod_name* argument otherwise. + +- ``__file__`` is set to the name provided by the module loader. If the +- loader does not make filename information available, this variable is set +- to :const:`None`. ++ ``__spec__`` will be set appropriately for the *actually* imported ++ module (that is, ``__spec__.name`` will always be *mod_name* or ++ ``mod_name + '.__main__``, never *run_name*). + +- ``__cached__`` will be set to ``None``. +- +- ``__loader__`` is set to the :pep:`302` module loader used to retrieve the +- code for the module (This loader may be a wrapper around the standard +- import mechanism). +- +- ``__package__`` is set to *mod_name* if the named module is a package and +- to ``mod_name.rpartition('.')[0]`` otherwise. ++ ``__file__``, ``__cached__``, ``__loader__`` and ``__package__`` are ++ :ref:`set as normal ` based on the module spec. + + If the argument *alter_sys* is supplied and evaluates to :const:`True`, + then ``sys.argv[0]`` is updated with the value of ``__file__`` and +@@ -83,8 +77,13 @@ + Added ability to execute packages by looking for a ``__main__`` submodule. + + .. versionchanged:: 3.2 +- Added ``__cached__`` global variable (see :PEP:`3147`). ++ Added ``__cached__`` global variable (see :pep:`3147`). + ++ .. versionchanged:: 3.4 ++ Updated to take advantage of the module spec feature added by ++ :pep:`451`. This allows ``__cached__`` to be set correctly for modules ++ run this way, as well as ensuring the real module name is always ++ accessible as ``__spec__.name``. + + .. function:: run_path(file_path, init_globals=None, run_name=None) + +@@ -108,23 +107,28 @@ + below are defined in the supplied dictionary, those definitions are + overridden by :func:`run_path`. + +- The special global variables ``__name__``, ``__file__``, ``__loader__`` +- and ``__package__`` are set in the globals dictionary before the module +- code is executed (Note that this is a minimal set of variables - other +- variables may be set implicitly as an interpreter implementation detail). ++ The special global variables ``__name__``, ``__spec__``, ``__file__``, ++ ``__cached__``, ``__loader__`` and ``__package__`` are set in the globals ++ dictionary before the module code is executed (Note that this is a ++ minimal set of variables - other variables may be set implicitly as an ++ interpreter implementation detail). + + ``__name__`` is set to *run_name* if this optional argument is not + :const:`None` and to ``''`` otherwise. + +- ``__file__`` is set to the name provided by the module loader. If the +- loader does not make filename information available, this variable is set +- to :const:`None`. For a simple script, this will be set to ``file_path``. ++ If the supplied path directly references a script file (whether as source ++ or as precompiled byte code), then ``__file__`` will be set to the ++ supplied path, and ``__spec__``, ``__cached__``, ``__loader__`` and ++ ``__package__`` will all be set to :const:`None`. + +- ``__loader__`` is set to the :pep:`302` module loader used to retrieve the +- code for the module (This loader may be a wrapper around the standard +- import mechanism). For a simple script, this will be set to :const:`None`. ++ ``__spec__`` will be set to :const:`None` if the supplied path is a ++ direct path to a script (as source or as precompiled bytecode). + +- ``__package__`` is set to ``__name__.rpartition('.')[0]``. ++ If the supplied path is a reference to a valid sys.path entry, then ++ ``__spec__`` will be set appropriately for the imported ``__main__`` ++ module (that is, ``__spec__.name`` will always be ``__main__``). ++ ``__file__``, ``__cached__``, ``__loader__`` and ``__package__`` will be ++ :ref:`set as normal ` based on the module spec. + + A number of alterations are also made to the :mod:`sys` module. Firstly, + ``sys.path`` may be altered as described above. ``sys.argv[0]`` is updated +@@ -141,6 +145,12 @@ + + .. versionadded:: 3.2 + ++ .. versionchanged:: 3.4 ++ Updated to take advantage of the module spec feature added by ++ :pep:`451`. This allows ``__cached__`` to be set correctly in the ++ case where ``__main__`` is imported from a valid sys.path entry rather ++ than being executed directly. ++ + .. seealso:: + + :pep:`338` - Executing modules as scripts +@@ -149,6 +159,9 @@ + :pep:`366` - Main module explicit relative imports + PEP written and implemented by Nick Coghlan. + ++ :pep:`451` - A ModuleSpec Type for the Import System ++ PEP written and implemented by Eric Snow ++ + :ref:`using-on-general` - CPython command line details + + The :func:`importlib.import_module` function +diff -r 3405dc9a6afa Doc/library/sched.rst +--- a/Doc/library/sched.rst ++++ b/Doc/library/sched.rst +@@ -113,7 +113,7 @@ + function passed to the constructor) for the next event, then execute it and so + on until there are no more scheduled events. + +- If *blocking* is False executes the scheduled events due to expire soonest ++ If *blocking* is false executes the scheduled events due to expire soonest + (if any) and then return the deadline of the next scheduled call in the + scheduler (if any). + +diff -r 3405dc9a6afa Doc/library/selectors.rst +--- a/Doc/library/selectors.rst ++++ b/Doc/library/selectors.rst +@@ -102,7 +102,8 @@ + + Register a file object for selection, monitoring it for I/O events. + +- *fileobj* is the file object to monitor. ++ *fileobj* is the file object to monitor. It may either be an integer ++ file descriptor or an object with a ``fileno()`` method. + *events* is a bitwise mask of events to monitor. + *data* is an opaque object. + +@@ -118,7 +119,9 @@ + *fileobj* must be a file object previously registered. + + This returns the associated :class:`SelectorKey` instance, or raises a +- :exc:`KeyError` if the file object is not registered. ++ :exc:`KeyError` if *fileobj* is not registered. It will raise ++ :exc:`ValueError` if *fileobj* is invalid (e.g. it has no ``fileno()`` ++ method or its ``fileno()`` method has an invalid return value). + + .. method:: modify(fileobj, events, data=None) + +@@ -150,6 +153,11 @@ + object. + *events* is a bitmask of events ready on this file object. + ++ .. note:: ++ This method can return before any file object becomes ready or the ++ timeout has elapsed if the current process receives a signal: in this ++ case, an empty list will be returned. ++ + .. method:: close() + + Close the selector. +@@ -210,30 +218,40 @@ + :func:`select.kqueue` object. + + +-Examples of selector usage:: ++Examples ++-------- + +- >>> import selectors +- >>> import socket +- >>> +- >>> s = selectors.DefaultSelector() +- >>> r, w = socket.socketpair() +- >>> +- >>> s.register(r, selectors.EVENT_READ) +- SelectorKey(fileobj=, fd=4, events=1, data=None) +- >>> s.register(w, selectors.EVENT_WRITE) +- SelectorKey(fileobj=, fd=5, events=2, data=None) +- >>> +- >>> print(s.select()) +- [(SelectorKey(fileobj=, fd=5, events=2, data=None), 2)] +- >>> +- >>> for key, events in s.select(): +- ... if events & selectors.EVENT_WRITE: +- ... key.fileobj.send(b'spam') +- ... +- 4 +- >>> for key, events in s.select(): +- ... if events & selectors.EVENT_READ: +- ... print(key.fileobj.recv(1024)) +- ... +- b'spam' +- >>> s.close() ++Here is a simple echo server implementation:: ++ ++ import selectors ++ import socket ++ ++ sel = selectors.DefaultSelector() ++ ++ def accept(sock, mask): ++ conn, addr = sock.accept() # Should be ready ++ print('accepted', conn, 'from', addr) ++ conn.setblocking(False) ++ sel.register(conn, selectors.EVENT_READ, read) ++ ++ def read(conn, mask): ++ data = conn.recv(1000) # Should be ready ++ if data: ++ print('echoing', repr(data), 'to', conn) ++ conn.send(data) # Hope it won't block ++ else: ++ print('closing', conn) ++ sel.unregister(conn) ++ conn.close() ++ ++ sock = socket.socket() ++ sock.bind(('localhost', 1234)) ++ sock.listen(100) ++ sock.setblocking(False) ++ sel.register(sock, selectors.EVENT_READ, accept) ++ ++ while True: ++ events = sel.select() ++ for key, mask in events: ++ callback = key.data ++ callback(key.fileobj, mask) +diff -r 3405dc9a6afa Doc/library/shelve.rst +--- a/Doc/library/shelve.rst ++++ b/Doc/library/shelve.rst +@@ -121,7 +121,8 @@ + The *keyencoding* parameter is the encoding used to encode keys before they + are used with the underlying dict. + +- :class:`Shelf` objects can also be used as context managers. ++ A :class:`Shelf` object can also be used as a context manager, in which ++ case it will be automatically closed when the :keyword:`with` block ends. + + .. versionchanged:: 3.2 + Added the *keyencoding* parameter; previously, keys were always encoded in +diff -r 3405dc9a6afa Doc/library/smtplib.rst +--- a/Doc/library/smtplib.rst ++++ b/Doc/library/smtplib.rst +@@ -90,6 +90,10 @@ + .. versionchanged:: 3.3 + source_address argument was added. + ++ .. versionchanged:: 3.4 ++ The class now supports hostname check with ++ :attr:`SSLContext.check_hostname` and *Server Name Indicator* (see ++ :data:`~ssl.HAS_SNI`). + + .. class:: LMTP(host='', port=LMTP_PORT, local_hostname=None, source_address=None) + +@@ -316,6 +320,11 @@ + .. versionchanged:: 3.3 + *context* was added. + ++ .. versionchanged:: 3.4 ++ The method now supports hostname check with ++ :attr:`SSLContext.check_hostname` and *Server Name Indicator* (see ++ :data:`~ssl.HAS_SNI`). ++ + + .. method:: SMTP.sendmail(from_addr, to_addrs, msg, mail_options=[], rcpt_options=[]) + +diff -r 3405dc9a6afa Doc/library/socket.rst +--- a/Doc/library/socket.rst ++++ b/Doc/library/socket.rst +@@ -138,9 +138,12 @@ + Module contents + --------------- + +-The module :mod:`socket` exports the following constants and functions: ++The module :mod:`socket` exports the following elements. + + ++Exceptions ++^^^^^^^^^^ ++ + .. exception:: error + + A deprecated alias of :exc:`OSError`. +@@ -186,6 +189,10 @@ + .. versionchanged:: 3.3 + This class was made a subclass of :exc:`OSError`. + ++ ++Constants ++^^^^^^^^^ ++ + .. data:: AF_UNIX + AF_INET + AF_INET6 +@@ -305,6 +312,57 @@ + this platform. + + ++Functions ++^^^^^^^^^ ++ ++Creating sockets ++'''''''''''''''' ++ ++The following functions all create :ref:`socket objects `. ++ ++ ++.. function:: socket(family=AF_INET, type=SOCK_STREAM, proto=0, fileno=None) ++ ++ Create a new socket using the given address family, socket type and protocol ++ number. The address family should be :const:`AF_INET` (the default), ++ :const:`AF_INET6`, :const:`AF_UNIX`, :const:`AF_CAN` or :const:`AF_RDS`. The ++ socket type should be :const:`SOCK_STREAM` (the default), ++ :const:`SOCK_DGRAM`, :const:`SOCK_RAW` or perhaps one of the other ``SOCK_`` ++ constants. The protocol number is usually zero and may be omitted or in the ++ case where the address family is :const:`AF_CAN` the protocol should be one ++ of :const:`CAN_RAW` or :const:`CAN_BCM`. ++ ++ The newly created socket is :ref:`non-inheritable `. ++ ++ .. versionchanged:: 3.3 ++ The AF_CAN family was added. ++ The AF_RDS family was added. ++ ++ .. versionchanged:: 3.4 ++ The CAN_BCM protocol was added. ++ ++ .. versionchanged:: 3.4 ++ The returned socket is now non-inheritable. ++ ++ ++.. function:: socketpair([family[, type[, proto]]]) ++ ++ Build a pair of connected socket objects using the given address family, socket ++ type, and protocol number. Address family, socket type, and protocol number are ++ as for the :func:`.socket` function above. The default family is :const:`AF_UNIX` ++ if defined on the platform; otherwise, the default is :const:`AF_INET`. ++ Availability: Unix. ++ ++ The newly created sockets are :ref:`non-inheritable `. ++ ++ .. versionchanged:: 3.2 ++ The returned socket objects now support the whole socket API, rather ++ than a subset. ++ ++ .. versionchanged:: 3.4 ++ The returned sockets are now non-inheritable. ++ ++ + .. function:: create_connection(address[, timeout[, source_address]]) + + Connect to a TCP service listening on the Internet *address* (a 2-tuple +@@ -331,6 +389,45 @@ + support for the :keyword:`with` statement was added. + + ++.. function:: fromfd(fd, family, type, proto=0) ++ ++ Duplicate the file descriptor *fd* (an integer as returned by a file object's ++ :meth:`fileno` method) and build a socket object from the result. Address ++ family, socket type and protocol number are as for the :func:`.socket` function ++ above. The file descriptor should refer to a socket, but this is not checked --- ++ subsequent operations on the object may fail if the file descriptor is invalid. ++ This function is rarely needed, but can be used to get or set socket options on ++ a socket passed to a program as standard input or output (such as a server ++ started by the Unix inet daemon). The socket is assumed to be in blocking mode. ++ ++ The newly created socket is :ref:`non-inheritable `. ++ ++ .. versionchanged:: 3.4 ++ The returned socket is now non-inheritable. ++ ++ ++.. function:: fromshare(data) ++ ++ Instantiate a socket from data obtained from the :meth:`socket.share` ++ method. The socket is assumed to be in blocking mode. ++ ++ Availability: Windows. ++ ++ .. versionadded:: 3.3 ++ ++ ++.. data:: SocketType ++ ++ This is a Python type object that represents the socket object type. It is the ++ same as ``type(socket(...))``. ++ ++ ++Other functions ++''''''''''''''' ++ ++The :mod:`socket` module also offers various network-related services: ++ ++ + .. function:: getaddrinfo(host, port, family=0, type=0, proto=0, flags=0) + + Translate the *host*/*port* argument into a sequence of 5-tuples that contain +@@ -460,65 +557,6 @@ + ``'udp'``, otherwise any protocol will match. + + +-.. function:: socket(family=AF_INET, type=SOCK_STREAM, proto=0, fileno=None) +- +- Create a new socket using the given address family, socket type and protocol +- number. The address family should be :const:`AF_INET` (the default), +- :const:`AF_INET6`, :const:`AF_UNIX`, :const:`AF_CAN` or :const:`AF_RDS`. The +- socket type should be :const:`SOCK_STREAM` (the default), +- :const:`SOCK_DGRAM`, :const:`SOCK_RAW` or perhaps one of the other ``SOCK_`` +- constants. The protocol number is usually zero and may be omitted or in the +- case where the address family is :const:`AF_CAN` the protocol should be one +- of :const:`CAN_RAW` or :const:`CAN_BCM`. +- +- The newly created socket is :ref:`non-inheritable `. +- +- .. versionchanged:: 3.3 +- The AF_CAN family was added. +- The AF_RDS family was added. +- +- .. versionchanged:: 3.4 +- The CAN_BCM protocol was added. +- +- .. versionchanged:: 3.4 +- The socket is now non-inheritable. +- +- +-.. function:: socketpair([family[, type[, proto]]]) +- +- Build a pair of connected socket objects using the given address family, socket +- type, and protocol number. Address family, socket type, and protocol number are +- as for the :func:`.socket` function above. The default family is :const:`AF_UNIX` +- if defined on the platform; otherwise, the default is :const:`AF_INET`. +- Availability: Unix. +- +- The newly created sockets are :ref:`non-inheritable `. +- +- .. versionchanged:: 3.2 +- The returned socket objects now support the whole socket API, rather +- than a subset. +- +- .. versionchanged:: 3.4 +- The sockets are now non-inheritable. +- +- +-.. function:: fromfd(fd, family, type, proto=0) +- +- Duplicate the file descriptor *fd* (an integer as returned by a file object's +- :meth:`fileno` method) and build a socket object from the result. Address +- family, socket type and protocol number are as for the :func:`.socket` function +- above. The file descriptor should refer to a socket, but this is not checked --- +- subsequent operations on the object may fail if the file descriptor is invalid. +- This function is rarely needed, but can be used to get or set socket options on +- a socket passed to a program as standard input or output (such as a server +- started by the Unix inet daemon). The socket is assumed to be in blocking mode. +- +- The newly created socket is :ref:`non-inheritable `. +- +- .. versionchanged:: 3.4 +- The socket is now non-inheritable. +- +- + .. function:: ntohl(x) + + Convert 32-bit positive integers from network to host byte order. On machines +@@ -714,29 +752,14 @@ + .. versionadded:: 3.3 + + +-.. function:: fromshare(data) +- +- Instantiate a socket from data obtained from :meth:`~socket.share`. +- The socket is assumed to be in blocking mode. +- +- Availability: Windows. +- +- .. versionadded:: 3.3 +- +- +-.. data:: SocketType +- +- This is a Python type object that represents the socket object type. It is the +- same as ``type(socket(...))``. +- +- + .. _socket-objects: + + Socket Objects + -------------- + +-Socket objects have the following methods. Except for :meth:`makefile` these +-correspond to Unix system calls applicable to sockets. ++Socket objects have the following methods. Except for ++:meth:`~socket.makefile`, these correspond to Unix system calls applicable ++to sockets. + + + .. method:: socket.accept() +@@ -760,9 +783,15 @@ + + .. method:: socket.close() + +- Close the socket. All future operations on the socket object will fail. The +- remote end will receive no more data (after queued data is flushed). Sockets are +- automatically closed when they are garbage-collected. ++ Mark the socket closed. The underlying system resource (e.g. a file ++ descriptor) is also closed when all file objects from :meth:`makefile()` ++ are closed. Once that happens, all future operations on the socket ++ object will fail. The remote end will receive no more data (after ++ queued data is flushed). ++ ++ Sockets are automatically closed when they are garbage-collected, but ++ it is recommended to :meth:`close` them explicitly, or to use a ++ :keyword:`with` statement around them. + + .. note:: + :meth:`close()` releases the resource associated with a connection but +@@ -887,10 +916,13 @@ + type depends on the arguments given to :meth:`makefile`. These arguments are + interpreted the same way as by the built-in :func:`open` function. + +- Closing the file object won't close the socket unless there are no remaining +- references to the socket. The socket must be in blocking mode; it can have +- a timeout, but the file object's internal buffer may end up in a inconsistent +- state if a timeout occurs. ++ The socket must be in blocking mode; it can have a timeout, but the file ++ object's internal buffer may end up in a inconsistent state if a timeout ++ occurs. ++ ++ Closing the file object returned by :meth:`makefile` won't close the ++ original socket unless all other file objects have been closed and ++ :meth:`socket.close` has been called on the socket object. + + .. note:: + +@@ -1162,14 +1194,14 @@ + + .. method:: socket.share(process_id) + +- :platform: Windows ++ Duplicate a socket and prepare it for sharing with a target process. The ++ target process must be provided with *process_id*. The resulting bytes object ++ can then be passed to the target process using some form of interprocess ++ communication and the socket can be recreated there using :func:`fromshare`. ++ Once this method has been called, it is safe to close the socket since ++ the operating system has already duplicated it for the target process. + +- Duplacet a socket and prepare it for sharing with a target process. The +- target process must be provided with *process_id*. The resulting bytes object +- can then be passed to the target process using some form of interprocess +- communication and the socket can be recreated there using :func:`fromshare`. +- Once this method has been called, it is safe to close the socket since +- the operating system has already duplicated it for the target process. ++ Availability: Windows. + + .. versionadded:: 3.3 + +diff -r 3405dc9a6afa Doc/library/sqlite3.rst +--- a/Doc/library/sqlite3.rst ++++ b/Doc/library/sqlite3.rst +@@ -241,10 +241,10 @@ + .. function:: enable_callback_tracebacks(flag) + + By default you will not get any tracebacks in user-defined functions, +- aggregates, converters, authorizer callbacks etc. If you want to debug them, you +- can call this function with *flag* as True. Afterwards, you will get tracebacks +- from callbacks on ``sys.stderr``. Use :const:`False` to disable the feature +- again. ++ aggregates, converters, authorizer callbacks etc. If you want to debug them, ++ you can call this function with *flag* set to ``True``. Afterwards, you will ++ get tracebacks from callbacks on ``sys.stderr``. Use :const:`False` to ++ disable the feature again. + + + .. _sqlite3-connection-objects: +diff -r 3405dc9a6afa Doc/library/ssl.rst +--- a/Doc/library/ssl.rst ++++ b/Doc/library/ssl.rst +@@ -142,13 +142,16 @@ + + Takes an instance ``sock`` of :class:`socket.socket`, and returns an instance + of :class:`ssl.SSLSocket`, a subtype of :class:`socket.socket`, which wraps +- the underlying socket in an SSL context. For client-side sockets, the +- context construction is lazy; if the underlying socket isn't connected yet, +- the context construction will be performed after :meth:`connect` is called on +- the socket. For server-side sockets, if the socket has no remote peer, it is +- assumed to be a listening socket, and the server-side SSL wrapping is +- automatically performed on client connections accepted via the :meth:`accept` +- method. :func:`wrap_socket` may raise :exc:`SSLError`. ++ the underlying socket in an SSL context. ``sock`` must be a ++ :data:`~socket.SOCK_STREAM` socket; other socket types are unsupported. ++ ++ For client-side sockets, the context construction is lazy; if the ++ underlying socket isn't connected yet, the context construction will be ++ performed after :meth:`connect` is called on the socket. For ++ server-side sockets, if the socket has no remote peer, it is assumed ++ to be a listening socket, and the server-side SSL wrapping is ++ automatically performed on client connections accepted via the ++ :meth:`accept` method. :func:`wrap_socket` may raise :exc:`SSLError`. + + The ``keyfile`` and ``certfile`` parameters specify optional files which + contain a certificate to be used to identify the local side of the +@@ -287,7 +290,7 @@ + .. function:: RAND_pseudo_bytes(num) + + Returns (bytes, is_cryptographic): bytes are *num* pseudo-random bytes, +- is_cryptographic is True if the bytes generated are cryptographically ++ is_cryptographic is ``True`` if the bytes generated are cryptographically + strong. Raises an :class:`SSLError` if the operation is not supported by the + current RAND method. + +@@ -300,8 +303,8 @@ + + .. function:: RAND_status() + +- Returns True if the SSL pseudo-random number generator has been seeded with +- 'enough' randomness, and False otherwise. You can use :func:`ssl.RAND_egd` ++ Returns ``True`` if the SSL pseudo-random number generator has been seeded with ++ 'enough' randomness, and ``False`` otherwise. You can use :func:`ssl.RAND_egd` + and :func:`ssl.RAND_add` to increase the randomness of the pseudo-random + number generator. + +@@ -547,7 +550,6 @@ + + .. data:: PROTOCOL_TLSv1_1 + +- + Selects TLS version 1.1 as the channel encryption protocol. + Available only with openssl version 1.0.1+. + +@@ -555,11 +557,9 @@ + + .. data:: PROTOCOL_TLSv1_2 + +- + Selects TLS version 1.2 as the channel encryption protocol. This is the most + modern version, and probably the best choice for maximum protection, if both +- sides can speak it. +- Available only with openssl version 1.0.1+. ++ sides can speak it. Available only with openssl version 1.0.1+. + + .. versionadded:: 3.4 + +@@ -773,6 +773,11 @@ + + Perform the SSL setup handshake. + ++ .. versionchanged:: 3.4 ++ The handshake method also performce :func:`match_hostname` when the ++ :attr:`~SSLContext.check_hostname` attribute of the socket's ++ :attr:`~SSLSocket.context` is true. ++ + .. method:: SSLSocket.getpeercert(binary_form=False) + + If there is no certificate for the peer on the other end of the connection, +@@ -1144,7 +1149,10 @@ + server_hostname=None) + + Wrap an existing Python socket *sock* and return an :class:`SSLSocket` +- object. The SSL socket is tied to the context, its settings and ++ object. *sock* must be a :data:`~socket.SOCK_STREAM` socket; other socket ++ types are unsupported. ++ ++ The returned SSL socket is tied to the context, its settings and + certificates. The parameters *server_side*, *do_handshake_on_connect* + and *suppress_ragged_eofs* have the same meaning as in the top-level + :func:`wrap_socket` function. +@@ -1173,7 +1181,7 @@ + .. method:: SSLContext.get_ca_certs(binary_form=False) + + Returns a list of dicts with information of loaded CA certs. If the +- optional argument is True, returns a DER-encoded copy of the CA ++ optional argument is true, returns a DER-encoded copy of the CA + certificate. + + .. note:: +@@ -1182,6 +1190,33 @@ + + .. versionadded:: 3.4 + ++.. attribute:: SSLContext.check_hostname ++ ++ Wether to match the peer cert's hostname with :func:`match_hostname` in ++ :meth:`SSLSocket.do_handshake`. The context's ++ :attr:`~SSLContext.verify_mode` must be set to :data:`CERT_OPTIONAL` or ++ :data:`CERT_REQUIRED`, and you must pass *server_hostname* to ++ :meth:`~SSLContext.wrap_socket` in order to match the hostname. ++ ++ Example:: ++ ++ import socket, ssl ++ ++ context = ssl.SSLContext(ssl.PROTOCOL_TLSv1) ++ context.verify_mode = ssl.CERT_REQUIRED ++ context.check_hostname = True ++ context.load_default_certs() ++ ++ s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) ++ ssl_sock = context.wrap_socket(s, server_hostname='www.verisign.com'): ++ ssl_sock.connect(('www.verisign.com', 443)) ++ ++ .. versionadded:: 3.4 ++ ++ .. note:: ++ ++ This features requires OpenSSL 0.9.8f or newer. ++ + .. attribute:: SSLContext.options + + An integer representing the set of SSL options enabled on this context. +@@ -1596,7 +1631,9 @@ + have to check that the server certificate, which can be obtained by calling + :meth:`SSLSocket.getpeercert`, matches the desired service. For many + protocols and applications, the service can be identified by the hostname; +-in this case, the :func:`match_hostname` function can be used. ++in this case, the :func:`match_hostname` function can be used. This common ++check is automatically performed when :attr:`SSLContext.check_hostname` is ++enabled. + + In server mode, if you want to authenticate your clients using the SSL layer + (rather than using a higher-level authentication mechanism), you'll also have +diff -r 3405dc9a6afa Doc/library/stdtypes.rst +--- a/Doc/library/stdtypes.rst ++++ b/Doc/library/stdtypes.rst +@@ -1583,7 +1583,7 @@ + .. method:: str.format_map(mapping) + + Similar to ``str.format(**mapping)``, except that ``mapping`` is +- used directly and not copied to a :class:`dict` . This is useful ++ used directly and not copied to a :class:`dict`. This is useful + if for example ``mapping`` is a dict subclass: + + >>> class Default(dict): +@@ -2851,7 +2851,7 @@ + + .. method:: isdisjoint(other) + +- Return True if the set has no elements in common with *other*. Sets are ++ Return ``True`` if the set has no elements in common with *other*. Sets are + disjoint if and only if their intersection is the empty set. + + .. method:: issubset(other) +diff -r 3405dc9a6afa Doc/library/struct.rst +--- a/Doc/library/struct.rst ++++ b/Doc/library/struct.rst +@@ -295,7 +295,7 @@ + For the ``'?'`` format character, the return value is either :const:`True` or + :const:`False`. When packing, the truth value of the argument object is used. + Either 0 or 1 in the native or standard bool representation will be packed, and +-any non-zero value will be True when unpacking. ++any non-zero value will be ``True`` when unpacking. + + + +diff -r 3405dc9a6afa Doc/library/subprocess.rst +--- a/Doc/library/subprocess.rst ++++ b/Doc/library/subprocess.rst +@@ -451,13 +451,12 @@ + approximately that size. A negative bufsize (the default) means + the system default of io.DEFAULT_BUFFER_SIZE will be used. + +- .. versionchanged:: 3.2.4, 3.3.1 +- ++ .. versionchanged:: 3.3.1 + *bufsize* now defaults to -1 to enable buffering by default to match the +- behavior that most code expects. In 3.2.0 through 3.2.3 and 3.3.0 it +- incorrectly defaulted to :const:`0` which was unbuffered and allowed +- short reads. This was unintentional and did not match the behavior of +- Python 2 as most code expected. ++ behavior that most code expects. In versions prior to Python 3.2.4 and ++ 3.3.1 it incorrectly defaulted to :const:`0` which was unbuffered ++ and allowed short reads. This was unintentional and did not match the ++ behavior of Python 2 as most code expected. + + The *executable* argument specifies a replacement program to execute. It + is very seldom needed. When ``shell=False``, *executable* replaces the +@@ -523,7 +522,7 @@ + *executable* (or for the first item in *args*) relative to *cwd* if the + executable path is a relative path. + +- If *restore_signals* is True (the default) all signals that Python has set to ++ If *restore_signals* is true (the default) all signals that Python has set to + SIG_IGN are restored to SIG_DFL in the child process before the exec. + Currently this includes the SIGPIPE, SIGXFZ and SIGXFSZ signals. + (Unix only) +@@ -531,7 +530,7 @@ + .. versionchanged:: 3.2 + *restore_signals* was added. + +- If *start_new_session* is True the setsid() system call will be made in the ++ If *start_new_session* is true the setsid() system call will be made in the + child process prior to the execution of the subprocess. (Unix only) + + .. versionchanged:: 3.2 +diff -r 3405dc9a6afa Doc/library/sys.rst +--- a/Doc/library/sys.rst ++++ b/Doc/library/sys.rst +@@ -425,7 +425,7 @@ + * On Mac OS X, the encoding is ``'utf-8'``. + + * On Unix, the encoding is the user's preference according to the result of +- nl_langinfo(CODESET), or ``'utf-8'`` if ``nl_langinfo(CODESET)`` failed. ++ nl_langinfo(CODESET). + + * On Windows NT+, file names are Unicode natively, so no conversion is + performed. :func:`getfilesystemencoding` still returns ``'mbcs'``, as +@@ -436,8 +436,7 @@ + * On Windows 9x, the encoding is ``'mbcs'``. + + .. versionchanged:: 3.2 +- On Unix, use ``'utf-8'`` instead of ``None`` if ``nl_langinfo(CODESET)`` +- failed. :func:`getfilesystemencoding` result cannot be ``None``. ++ :func:`getfilesystemencoding` result cannot be ``None`` anymore. + + + .. function:: getrefcount(object) +@@ -1067,7 +1066,7 @@ + :func:`open` function. Their parameters are chosen as follows: + + * The character encoding is platform-dependent. Under Windows, if the stream +- is interactive (that is, if its :meth:`isatty` method returns True), the ++ is interactive (that is, if its :meth:`isatty` method returns ``True``), the + console codepage is used, otherwise the ANSI code page. Under other + platforms, the locale encoding is used (see :meth:`locale.getpreferredencoding`). + +@@ -1222,5 +1221,5 @@ + + .. rubric:: Citations + +-.. [C99] ISO/IEC 9899:1999. "Programming languages -- C." A public draft of this standard is available at http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf . ++.. [C99] ISO/IEC 9899:1999. "Programming languages -- C." A public draft of this standard is available at http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1256.pdf\ . + +diff -r 3405dc9a6afa Doc/library/tarfile.rst +--- a/Doc/library/tarfile.rst ++++ b/Doc/library/tarfile.rst +@@ -359,7 +359,7 @@ + full name. Its file information is extracted as accurately as possible. *member* + may be a filename or a :class:`TarInfo` object. You can specify a different + directory using *path*. File attributes (owner, mtime, mode) are set unless +- *set_attrs* is False. ++ *set_attrs* is false. + + .. note:: + +diff -r 3405dc9a6afa Doc/library/telnetlib.rst +--- a/Doc/library/telnetlib.rst ++++ b/Doc/library/telnetlib.rst +@@ -205,7 +205,7 @@ + .. method:: Telnet.set_option_negotiation_callback(callback) + + Each time a telnet option is read on the input flow, this *callback* (if set) is +- called with the following parameters : callback(telnet socket, command ++ called with the following parameters: callback(telnet socket, command + (DO/DONT/WILL/WONT), option). No other action is done afterwards by telnetlib. + + +diff -r 3405dc9a6afa Doc/library/tkinter.rst +--- a/Doc/library/tkinter.rst ++++ b/Doc/library/tkinter.rst +@@ -180,7 +180,7 @@ + The Tk/Tcl development is largely taking place at ActiveState. + + `Tcl and the Tk Toolkit `_ +- The book by John Ousterhout, the inventor of Tcl . ++ The book by John Ousterhout, the inventor of Tcl. + + `Practical Programming in Tcl and Tk `_ + Brent Welch's encyclopedic book. +@@ -440,7 +440,7 @@ + Example:: + + >>> print(fred.config()) +- {'relief' : ('relief', 'relief', 'Relief', 'raised', 'groove')} ++ {'relief': ('relief', 'relief', 'Relief', 'raised', 'groove')} + + Of course, the dictionary printed will include all the options available and + their values. This is meant only as an example. +@@ -613,7 +613,7 @@ + preceded with an ``@``, as in ``"@/usr/contrib/bitmap/gumby.bit"``. + + boolean +- You can pass integers 0 or 1 or the strings ``"yes"`` or ``"no"`` . ++ You can pass integers 0 or 1 or the strings ``"yes"`` or ``"no"``. + + callback + This is any Python function that takes no arguments. For example:: +diff -r 3405dc9a6afa Doc/library/tkinter.ttk.rst +--- a/Doc/library/tkinter.ttk.rst ++++ b/Doc/library/tkinter.ttk.rst +@@ -272,8 +272,8 @@ + + .. method:: instate(statespec, callback=None, *args, **kw) + +- Test the widget's state. If a callback is not specified, returns True +- if the widget state matches *statespec* and False otherwise. If callback ++ Test the widget's state. If a callback is not specified, returns ``True`` ++ if the widget state matches *statespec* and ``False`` otherwise. If callback + is specified then it is called with args if widget state matches + *statespec*. + +@@ -938,7 +938,7 @@ + + .. method:: exists(item) + +- Returns True if the specified *item* is present in the tree. ++ Returns ``True`` if the specified *item* is present in the tree. + + + .. method:: focus(item=None) +@@ -1084,7 +1084,7 @@ + + Ensure that *item* is visible. + +- Sets all of *item*'s ancestors open option to True, and scrolls the ++ Sets all of *item*'s ancestors open option to ``True``, and scrolls the + widget if necessary so that *item* is within the visible portion of + the tree. + +diff -r 3405dc9a6afa Doc/library/trace.rst +--- a/Doc/library/trace.rst ++++ b/Doc/library/trace.rst +@@ -41,7 +41,7 @@ + + At least one of the following options must be specified when invoking + :mod:`trace`. The :option:`--listfuncs <-l>` option is mutually exclusive with +-the :option:`--trace <-t>` and :option:`--counts <-c>` options . When ++the :option:`--trace <-t>` and :option:`--counts <-c>` options. When + :option:`--listfuncs <-l>` is provided, neither :option:`--counts <-c>` nor + :option:`--trace <-t>` are accepted, and vice versa. + +diff -r 3405dc9a6afa Doc/library/tracemalloc.rst +--- a/Doc/library/tracemalloc.rst ++++ b/Doc/library/tracemalloc.rst +@@ -4,6 +4,8 @@ + .. module:: tracemalloc + :synopsis: Trace memory allocations. + ++.. versionadded:: 3.4 ++ + The tracemalloc module is a debug tool to trace memory blocks allocated by + Python. It provides the following information: + +@@ -23,8 +25,6 @@ + :envvar:`PYTHONTRACEMALLOC` environment variable to ``25``, or use the + :option:`-X` ``tracemalloc=25`` command line option. + +-.. versionadded:: 3.4 +- + + Examples + ======== +@@ -102,9 +102,11 @@ + /usr/lib/python3.4/urllib/parse.py:476: size=71.8 KiB (+71.8 KiB), count=969 (+969), average=76 B + /usr/lib/python3.4/contextlib.py:38: size=67.2 KiB (+67.2 KiB), count=126 (+126), average=546 B + +-We can see that Python loaded ``4.4 MiB`` of new data (bytecode and constants) +-from modules (on of total of ``8.2 MiB``) and that the :mod:`linecache` module +-cached ``940 KiB`` of Python source code to format tracebacks. ++We can see that Python has loaded ``8.2 MiB`` of module data (bytecode and ++constants), and that this is ``4.4 MiB`` more than had been loaded before the ++tests, when the previous snapshot was taken. Similarly, the :mod:`linecache` ++module has cached ``940 KiB`` of Python source code to format tracebacks, all ++of it since the previous snapshot. + + If the system has little free memory, snapshots can be written on disk using + the :meth:`Snapshot.dump` method to analyze the snapshot offline. Then use the +@@ -174,11 +176,11 @@ + File "/usr/lib/python3.4/runpy.py", line 160 + "__main__", fname, loader, pkg_name) + +-We can see that most memory was allocated in the :mod:`importlib` module to ++We can see that the most memory was allocated in the :mod:`importlib` module to + load data (bytecode and constants) from modules: ``870 KiB``. The traceback is +-where the :mod:`importlib` loaded data for the the last time: on the ``import +-pdb`` line of the :mod:`doctest` module. The traceback may change if a new +-module is loaded. ++where the :mod:`importlib` loaded data most recently: on the ``import pdb`` ++line of the :mod:`doctest` module. The traceback may change if a new module is ++loaded. + + + Pretty top +@@ -274,8 +276,8 @@ + + .. function:: get_traced_memory() + +- Get the current size and maximum size of memory blocks traced by the +- :mod:`tracemalloc` module as a tuple: ``(size: int, max_size: int)``. ++ Get the current size and peak size of memory blocks traced by the ++ :mod:`tracemalloc` module as a tuple: ``(current: int, peak: int)``. + + + .. function:: get_tracemalloc_memory() +@@ -319,12 +321,14 @@ + .. function:: stop() + + Stop tracing Python memory allocations: uninstall hooks on Python memory +- allocators. Clear also traces of memory blocks allocated by Python ++ allocators. Also clears all previously collected traces of memory blocks ++ allocated by Python. + + Call :func:`take_snapshot` function to take a snapshot of traces before + clearing them. + +- See also :func:`start` and :func:`is_tracing` functions. ++ See also :func:`start`, :func:`is_tracing` and :func:`clear_traces` ++ functions. + + + .. function:: take_snapshot() +@@ -387,9 +391,9 @@ + If *all_frames* is ``True``, all frames of the traceback are checked. If + *all_frames* is ``False``, only the most recent frame is checked. + +- This attribute is ignored if the traceback limit is less than ``2``. See +- the :func:`get_traceback_limit` function and +- :attr:`Snapshot.traceback_limit` attribute. ++ This attribute has no effect if the traceback limit is ``1``. See the ++ :func:`get_traceback_limit` function and :attr:`Snapshot.traceback_limit` ++ attribute. + + + Frame +@@ -475,8 +479,7 @@ + If *cumulative* is ``True``, cumulate size and count of memory blocks of + all frames of the traceback of a trace, not only the most recent frame. + The cumulative mode can only be used with *group_by* equals to +- ``'filename'`` and ``'lineno'`` and :attr:`traceback_limit` greater than +- ``1``. ++ ``'filename'`` and ``'lineno'``. + + The result is sorted from the biggest to the smallest by: + :attr:`Statistic.size`, :attr:`Statistic.count` and then by +diff -r 3405dc9a6afa Doc/library/tulip_coro.dia +Binary file Doc/library/tulip_coro.dia has changed +diff -r 3405dc9a6afa Doc/library/tulip_coro.png +Binary file Doc/library/tulip_coro.png has changed +diff -r 3405dc9a6afa Doc/library/turtle.rst +--- a/Doc/library/turtle.rst ++++ b/Doc/library/turtle.rst +@@ -1055,8 +1055,8 @@ + + Write text - the string representation of *arg* - at the current turtle + position according to *align* ("left", "center" or right") and with the given +- font. If *move* is True, the pen is moved to the bottom-right corner of the +- text. By default, *move* is False. ++ font. If *move* is true, the pen is moved to the bottom-right corner of the ++ text. By default, *move* is ``False``. + + >>> turtle.write("Home = ", True, align="center") + >>> turtle.write((0,0), True) +@@ -1092,7 +1092,7 @@ + + .. function:: isvisible() + +- Return True if the Turtle is shown, False if it's hidden. ++ Return ``True`` if the Turtle is shown, ``False`` if it's hidden. + + >>> turtle.hideturtle() + >>> turtle.isvisible() +diff -r 3405dc9a6afa Doc/library/unittest.mock.rst +--- a/Doc/library/unittest.mock.rst ++++ b/Doc/library/unittest.mock.rst +@@ -298,11 +298,11 @@ + assert the mock has been called with the specified calls. + The `mock_calls` list is checked for the calls. + +- If `any_order` is False (the default) then the calls must be ++ If `any_order` is false (the default) then the calls must be + sequential. There can be extra calls before or after the + specified calls. + +- If `any_order` is True then the calls can be in any order, but ++ If `any_order` is true then the calls can be in any order, but + they must all appear in :attr:`mock_calls`. + + >>> mock = Mock(return_value=None) +@@ -1200,7 +1200,7 @@ + `values` can be a dictionary of values to set in the dictionary. `values` + can also be an iterable of `(key, value)` pairs. + +- If `clear` is True then the dictionary will be cleared before the new ++ If `clear` is true then the dictionary will be cleared before the new + values are set. + + `patch.dict` can also be called with arbitrary keyword arguments to set +@@ -1652,17 +1652,17 @@ + * ``__gt__``: NotImplemented + * ``__le__``: NotImplemented + * ``__ge__``: NotImplemented +-* ``__int__`` : 1 +-* ``__contains__`` : False +-* ``__len__`` : 1 +-* ``__iter__`` : iter([]) +-* ``__exit__`` : False +-* ``__complex__`` : 1j +-* ``__float__`` : 1.0 +-* ``__bool__`` : True +-* ``__index__`` : 1 +-* ``__hash__`` : default hash for the mock +-* ``__str__`` : default str for the mock ++* ``__int__``: 1 ++* ``__contains__``: False ++* ``__len__``: 1 ++* ``__iter__``: iter([]) ++* ``__exit__``: False ++* ``__complex__``: 1j ++* ``__float__``: 1.0 ++* ``__bool__``: True ++* ``__index__``: 1 ++* ``__hash__``: default hash for the mock ++* ``__str__``: default str for the mock + * ``__sizeof__``: default sizeof for the mock + + For example: +diff -r 3405dc9a6afa Doc/library/unittest.rst +--- a/Doc/library/unittest.rst ++++ b/Doc/library/unittest.rst +@@ -901,8 +901,8 @@ + | :meth:`assertWarnsRegex(warn, r, fun, *args, **kwds) | ``fun(*args, **kwds)`` raises *warn* | 3.2 | + | ` | and the message matches regex *r* | | + +---------------------------------------------------------+--------------------------------------+------------+ +- | :meth:`assertLogs(logger, level)` | The ``with`` block logs on *logger* | 3.4 | +- | ` | with minimum *level* | | ++ | :meth:`assertLogs(logger, level) | The ``with`` block logs on *logger* | 3.4 | ++ | ` | with minimum *level* | | + +---------------------------------------------------------+--------------------------------------+------------+ + + .. method:: assertRaises(exception, callable, *args, **kwds) +@@ -1939,6 +1939,14 @@ + + stream, descriptions, verbosity + ++ .. method:: run(test) ++ ++ This method is the main public interface to the `TextTestRunner`. This ++ method takes a :class:`TestSuite` or :class:`TestCase` instance. A ++ :class:`TestResult` is created by calling ++ :func:`_makeResult` and the test(s) are run and the ++ results printed to stdout. ++ + + .. function:: main(module='__main__', defaultTest=None, argv=None, testRunner=None, \ + testLoader=unittest.defaultTestLoader, exit=True, verbosity=1, \ +diff -r 3405dc9a6afa Doc/library/urllib.request.rst +--- a/Doc/library/urllib.request.rst ++++ b/Doc/library/urllib.request.rst +@@ -59,7 +59,7 @@ + some non-Windows platforms. + + .. warning:: +- If neither *cafile* nor *capath* is specified, and *cadefault* is False, ++ If neither *cafile* nor *capath* is specified, and *cadefault* is ``False``, + an HTTPS request will not do any verification of the server's + certificate. + +@@ -211,7 +211,7 @@ + containing the image. + + *unverifiable* should indicate whether the request is unverifiable, +- as defined by RFC 2965. It defaults to False. An unverifiable ++ as defined by RFC 2965. It defaults to ``False``. An unverifiable + request is one whose URL the user did not have the option to + approve. For example, if the request is for an image in an HTML + document, and the user had no option to approve the automatic +@@ -1055,7 +1055,7 @@ + the returned bytes object to string once it determines or guesses + the appropriate encoding. + +-The following W3C document, http://www.w3.org/International/O-charset , lists ++The following W3C document, http://www.w3.org/International/O-charset\ , lists + the various ways in which a (X)HTML or a XML document could have specified its + encoding information. + +diff -r 3405dc9a6afa Doc/library/venv.rst +--- a/Doc/library/venv.rst ++++ b/Doc/library/venv.rst +@@ -94,7 +94,7 @@ + * ``system_site_packages`` -- a Boolean value indicating that the system Python + site-packages should be available to the environment (defaults to ``False``). + +- * ``clear`` -- a Boolean value which, if True, will delete the contents of ++ * ``clear`` -- a Boolean value which, if true, will delete the contents of + any existing target directory, before creating the environment. + + * ``symlinks`` -- a Boolean value indicating whether to attempt to symlink the +@@ -102,11 +102,11 @@ + e.g. ``pythonw.exe``), rather than copying. Defaults to ``True`` on Linux and + Unix systems, but ``False`` on Windows. + +- * ``upgrade`` -- a Boolean value which, if True, will upgrade an existing ++ * ``upgrade`` -- a Boolean value which, if true, will upgrade an existing + environment with the running Python - for use when that Python has been + upgraded in-place (defaults to ``False``). + +- * ``with_pip`` -- a Boolean value which, if True, ensures pip is ++ * ``with_pip`` -- a Boolean value which, if true, ensures pip is + installed in the virtual environment + + .. versionchanged:: 3.4 +diff -r 3405dc9a6afa Doc/library/xml.dom.minidom.rst +--- a/Doc/library/xml.dom.minidom.rst ++++ b/Doc/library/xml.dom.minidom.rst +@@ -252,4 +252,4 @@ + "UTF8" is not valid in an XML document's declaration, even though + Python accepts it as an encoding name. + See http://www.w3.org/TR/2006/REC-xml11-20060816/#NT-EncodingDecl +- and http://www.iana.org/assignments/character-sets . ++ and http://www.iana.org/assignments/character-sets\ . +diff -r 3405dc9a6afa Doc/library/xml.etree.elementtree.rst +--- a/Doc/library/xml.etree.elementtree.rst ++++ b/Doc/library/xml.etree.elementtree.rst +@@ -831,8 +831,8 @@ + :term:`file object`; make sure you do not try to write a string to a + binary stream and vice versa. + +- .. versionadded:: 3.4 +- The *short_empty_elements* parameter. ++ .. versionadded:: 3.4 ++ The *short_empty_elements* parameter. + + + This is the XML file that is going to be manipulated:: +diff -r 3405dc9a6afa Doc/library/xml.rst +--- a/Doc/library/xml.rst ++++ b/Doc/library/xml.rst +@@ -33,7 +33,7 @@ + .. + + * :mod:`xml.dom`: the DOM API definition +-* :mod:`xml.dom.minidom`: a lightweight DOM implementation ++* :mod:`xml.dom.minidom`: a minimal DOM implementation + * :mod:`xml.dom.pulldom`: support for building partial DOM trees + + .. +diff -r 3405dc9a6afa Doc/library/zipfile.rst +--- a/Doc/library/zipfile.rst ++++ b/Doc/library/zipfile.rst +@@ -411,7 +411,7 @@ + name as a file path, and if any subdirectories are package directories, + all of these are added recursively. *basename* is intended for internal + use only. When *filterfunc(pathname)* is given, it will be called for every +- invocation. When it returns a False value, that path and its subpaths will ++ invocation. When it returns a false value, that path and its subpaths will + be ignored. + The :meth:`writepy` method makes archives with file names like + this:: +diff -r 3405dc9a6afa Doc/library/zipimport.rst +--- a/Doc/library/zipimport.rst ++++ b/Doc/library/zipimport.rst +@@ -111,7 +111,7 @@ + + .. method:: is_package(fullname) + +- Return True if the module specified by *fullname* is a package. Raise ++ Return ``True`` if the module specified by *fullname* is a package. Raise + :exc:`ZipImportError` if the module couldn't be found. + + +diff -r 3405dc9a6afa Doc/license.rst +--- a/Doc/license.rst ++++ b/Doc/license.rst +@@ -897,7 +897,7 @@ + cfuhash + ------- + +-The implementtation of the hash table used by the :mod:`tracemalloc` is based ++The implementation of the hash table used by the :mod:`tracemalloc` is based + on the cfuhash project:: + + Copyright (c) 2005 Don Owens +@@ -934,3 +934,36 @@ + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + OF THE POSSIBILITY OF SUCH DAMAGE. + ++ ++libmpdec ++-------- ++ ++The :mod:`_decimal` Module is built using an included copy of the libmpdec ++library unless the build is configured ``--with-system-libmpdec``:: ++ ++ Copyright (c) 2008-2016 Stefan Krah. All rights reserved. ++ ++ Redistribution and use in source and binary forms, with or without ++ modification, are permitted provided that the following conditions ++ are met: ++ ++ 1. Redistributions of source code must retain the above copyright ++ notice, this list of conditions and the following disclaimer. ++ ++ 2. Redistributions in binary form must reproduce the above copyright ++ notice, this list of conditions and the following disclaimer in the ++ documentation and/or other materials provided with the distribution. ++ ++ THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS "AS IS" AND ++ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE ++ IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ++ ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE ++ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL ++ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ++ OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) ++ HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT ++ LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY ++ OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF ++ SUCH DAMAGE. ++ ++ +diff -r 3405dc9a6afa Doc/reference/datamodel.rst +--- a/Doc/reference/datamodel.rst ++++ b/Doc/reference/datamodel.rst +@@ -201,7 +201,7 @@ + single: True + + These represent the truth values False and True. The two objects representing +- the values False and True are the only Boolean objects. The Boolean type is a ++ the values ``False`` and ``True`` are the only Boolean objects. The Boolean type is a + subtype of the integer type, and Boolean values behave like the values 0 and 1, + respectively, in almost all contexts, the exception being that when converted to + a string, the strings ``"False"`` or ``"True"`` are returned, respectively. +diff -r 3405dc9a6afa Doc/reference/import.rst +--- a/Doc/reference/import.rst ++++ b/Doc/reference/import.rst +@@ -281,9 +281,10 @@ + searches :data:`sys.meta_path`, which contains a list of meta path finder + objects. These finders are queried in order to see if they know how to handle + the named module. Meta path finders must implement a method called +-:meth:`find_spec()` which takes two arguments, a name and an import path. +-The meta path finder can use any strategy it wants to determine whether it can +-handle the named module or not. ++:meth:`~importlib.abc.MetaPathFinder.find_spec()` which takes three arguments: ++a name, an import path, and (optionally) a target module. The meta path ++finder can use any strategy it wants to determine whether it can handle ++the named module or not. + + If the meta path finder knows how to handle the named module, it returns a + spec object. If it cannot handle the named module, it returns ``None``. If +@@ -291,24 +292,26 @@ + a spec, then an :exc:`ImportError` is raised. Any other exceptions raised + are simply propagated up, aborting the import process. + +-The :meth:`find_spec()` method of meta path finders is called with two +-arguments. The first is the fully qualified name of the module being +-imported, for example ``foo.bar.baz``. The second argument is the path +-entries to use for the module search. For top-level modules, the second +-argument is ``None``, but for submodules or subpackages, the second +-argument is the value of the parent package's ``__path__`` attribute. If +-the appropriate ``__path__`` attribute cannot be accessed, an +-:exc:`ImportError` is raised. ++The :meth:`~importlib.abc.MetaPathFinder.find_spec()` method of meta path ++finders is called with two or three arguments. The first is the fully ++qualified name of the module being imported, for example ``foo.bar.baz``. ++The second argument is the path entries to use for the module search. For ++top-level modules, the second argument is ``None``, but for submodules or ++subpackages, the second argument is the value of the parent package's ++``__path__`` attribute. If the appropriate ``__path__`` attribute cannot ++be accessed, an :exc:`ImportError` is raised. The third argument is an ++existing module object that will be the target of loading later. The ++import system passes in a target module only during reload. + + The meta path may be traversed multiple times for a single import request. + For example, assuming none of the modules involved has already been cached, + importing ``foo.bar.baz`` will first perform a top level import, calling +-``mpf.find_spec("foo", None)`` on each meta path finder (``mpf``). After ++``mpf.find_spec("foo", None, None)`` on each meta path finder (``mpf``). After + ``foo`` has been imported, ``foo.bar`` will be imported by traversing the + meta path a second time, calling +-``mpf.find_spec("foo.bar", foo.__path__)``. Once ``foo.bar`` has been ++``mpf.find_spec("foo.bar", foo.__path__, None)``. Once ``foo.bar`` has been + imported, the final traversal will call +-``mpf.find_spec("foo.bar.baz", foo.bar.__path__)``. ++``mpf.find_spec("foo.bar.baz", foo.bar.__path__, None)``. + + Some meta path finders only support top level imports. These importers will + always return ``None`` when anything other than ``None`` is passed as the +@@ -320,10 +323,11 @@ + (i.e. the :term:`path based finder`). + + .. versionchanged:: 3.4 +- The find_spec() method of meta path finders replaced :meth:`find_module()`. +- which is now deprecated. While it will continue to work without change, +- the import machinery will try it only if the finder does not implement +- find_spec(). ++ The :meth:`~importlib.abc.MetaPathFinder.find_spec` method of meta path ++ finders replaced :meth:`~importlib.abc.MetaPathFinder.find_module`, which ++ is now deprecated. While it will continue to work without change, the ++ import machinery will try it only if the finder does not implement ++ ``find_spec()``. + + + Loading +@@ -350,6 +354,7 @@ + raise ImportError + elif not hasattr(spec.loader, 'exec_module'): + module = spec.loader.load_module(spec.name) ++ # Set __loader__ and __package__ if missing. + else: + sys.modules[spec.name] = module + try: +@@ -360,7 +365,7 @@ + except KeyError: + pass + raise +- module_to_return = sys.modules[spec.name] ++ return sys.modules[spec.name] + + Note the following details: + +@@ -380,8 +385,9 @@ + reloading where even the failing module is left in :data:`sys.modules`. + + * After the module is created but before execution, the import machinery +- sets the import-related module attributes ("init_module_attrs"), as +- summarized in a :ref:`later section `. ++ sets the import-related module attributes ("_init_module_attrs" in ++ the pseudo-code example above), as summarized in a ++ :ref:`later section `. + + * Module execution is the key moment of loading in which the module's + namespace gets populated. Execution is entirely delegated to the +@@ -392,16 +398,16 @@ + + .. versionchanged:: 3.4 + The import system has taken over the boilerplate responsibilities of +- loaders. These were previously performed by the :meth:`load_module()` +- method. ++ loaders. These were previously performed by the ++ :meth:`importlib.abc.Loader.load_module` method. + + Loaders + ------- + + Module loaders provide the critical function of loading: module execution. +-The import machinery calls the :meth:`~importlib.abc.Loader.exec_module()` ++The import machinery calls the :meth:`importlib.abc.Loader.exec_module` + method with a single argument, the module object to execute. Any value +-returned from exec_module() is ignored. ++returned from :meth:`~importlib.abc.Loader.exec_module` is ignored. + + Loaders must satisfy the following requirements: + +@@ -409,41 +415,41 @@ + dynamically loaded extension), the loader should execute the module's code + in the module's global name space (``module.__dict__``). + +- * If loader cannot execute the module, it should raise an ++ * If the loader cannot execute the module, it should raise an + :exc:`ImportError`, although any other exception raised during +- :meth:`exec_module()` will be propagated. ++ :meth:`~importlib.abc.Loader.exec_module` will be propagated. + + In many cases, the finder and loader can be the same object; in such cases the +-:meth:`finder.find_spec()` would just return a spec with the loader set +-to ``self``. ++:meth:`~importlib.abc.MetaPathFinder.find_spec` method would just return a ++spec with the loader set to ``self``. + + Module loaders may opt in to creating the module object during loading +-by implementing a :meth:`create_module()` method. It takes one argument, +-the module spec, and returns the new module object to use during loading. +-create_module() does not need to set any attributes on the module object. +-If the loader does not define create_module(), the import machinery will +-create the new module itself. ++by implementing a :meth:`~importlib.abc.Loader.create_module` method. ++It takes one argument, the module spec, and returns the new module object ++to use during loading. ``create_module()`` does not need to set any attributes ++on the module object. If the loader does not define ``create_module()``, the ++import machinery will create the new module itself. + + .. versionadded:: 3.4 + The create_module() method of loaders. + + .. versionchanged:: 3.4 +- The load_module() method was replaced by exec_module() and the import ++ The :meth:`~importlib.abc.Loader.load_module` method was replaced by ++ :meth:`~importlib.abc.Loader.exec_module` and the import + machinery assumed all the boilerplate responsibilities of loading. + + For compatibility with existing loaders, the import machinery will use +- the :meth:`~importlib.abc.Loader.load_module()` method of loaders if it +- exists and the loader does not also implement exec_module(). However, +- load_module() has been deprecated and loaders should implement +- exec_module() instead. ++ the ``load_module()`` method of loaders if it exists and the loader does ++ not also implement ``exec_module(). However, ``load_module()`` has been ++ deprecated and loaders should implement ``exec_module()`` instead. + +- The load_module() method must implement all the boilerplate loading ++ The ``load_module()`` method must implement all the boilerplate loading + functionality described above in addition to executing the module. All + the same constraints apply, with some additional clarification: + + * If there is an existing module object with the given name in + :data:`sys.modules`, the loader must use that existing module. +- (Otherwise, :func:`imp.reload` will not work correctly.) If the ++ (Otherwise, :func:`importlib.reload` will not work correctly.) If the + named module does not exist in :data:`sys.modules`, the loader + must create a new module object and add it to :data:`sys.modules`. + +@@ -515,6 +521,8 @@ + used when importing the module. This is used primarily for + introspection and during reloading. + ++ .. versionadded:: 3.4 ++ + .. attribute:: __path__ + + If the module is a package (either regular or namespace), the module +@@ -600,13 +608,14 @@ + * Otherwise, just use the module's ``__name__`` in the repr. + + .. versionchanged:: 3.4 +- Use of loader.module_repr() has been deprecated and the module spec +- is now used by the import machinery to generate a module repr. ++ Use of :meth:`loader.module_repr() ` ++ has been deprecated and the module spec is now used by the import ++ machinery to generate a module repr. + + For backward compatibility with Python 3.3, the module repr will be +- generated by calling the loader's :meth:`module_repr()` method, if +- defined, before trying either approach described above. However, the +- method is deprecated. ++ generated by calling the loader's ++ :meth:`~importlib.abc.Loader.module_repr` method, if defined, before ++ trying either approach described above. However, the method is deprecated. + + + The Path Based Finder +@@ -616,8 +625,9 @@ + single: path based finder + + As mentioned previously, Python comes with several default meta path finders. +-One of these, called the :term:`path based finder`, searches an :term:`import +-path`, which contains a list of :term:`path entries `. Each path ++One of these, called the :term:`path based finder` ++(:class:`~importlib.machinery.PathFinder`), searches an :term:`import path`, ++which contains a list of :term:`path entries `. Each path + entry names a location to search for modules. + + The path based finder itself doesn't know how to import anything. Instead, it +@@ -666,15 +676,15 @@ + single: sys.path_importer_cache + single: PYTHONPATH + +-The :term:`path based finder` is responsible for finding and loading Python +-modules and packages whose location is specified with a string :term:`path +-entry`. Most path entries name locations in the file system, but they need +-not be limited to this. ++The :term:`path based finder` is responsible for finding and loading ++Python modules and packages whose location is specified with a string ++:term:`path entry`. Most path entries name locations in the file system, ++but they need not be limited to this. + + As a meta path finder, the :term:`path based finder` implements the +-:meth:`find_spec()` protocol previously described, however it exposes +-additional hooks that can be used to customize how modules are found and +-loaded from the :term:`import path`. ++:meth:`~importlib.abc.MetaPathFinder.find_spec` protocol previously ++described, however it exposes additional hooks that can be used to ++customize how modules are found and loaded from the :term:`import path`. + + Three variables are used by the :term:`path based finder`, :data:`sys.path`, + :data:`sys.path_hooks` and :data:`sys.path_importer_cache`. The ``__path__`` +@@ -694,14 +704,16 @@ + + The :term:`path based finder` is a :term:`meta path finder`, so the import + machinery begins the :term:`import path` search by calling the path +-based finder's :meth:`find_spec()` method as described previously. When +-the ``path`` argument to :meth:`find_spec()` is given, it will be a ++based finder's :meth:`~importlib.machinery.PathFinder.find_spec` method as ++described previously. When the ``path`` argument to ++:meth:`~importlib.machinery.PathFinder.find_spec` is given, it will be a + list of string paths to traverse - typically a package's ``__path__`` +-attribute for an import within that package. If the ``path`` argument +-is ``None``, this indicates a top level import and :data:`sys.path` is used. ++attribute for an import within that package. If the ``path`` argument is ++``None``, this indicates a top level import and :data:`sys.path` is used. + + The path based finder iterates over every entry in the search path, and +-for each of these, looks for an appropriate :term:`path entry finder` for the ++for each of these, looks for an appropriate :term:`path entry finder` ++(:class:`~importlib.abc.PathEntryFinder`) for the + path entry. Because this can be an expensive operation (e.g. there may be + `stat()` call overheads for this search), the path based finder maintains + a cache mapping path entries to path entry finders. This cache is maintained +@@ -718,18 +730,20 @@ + path entry to be searched. This callable may either return a :term:`path + entry finder` that can handle the path entry, or it may raise + :exc:`ImportError`. An :exc:`ImportError` is used by the path based finder to +-signal that the hook cannot find a :term:`path entry finder` for that +-:term:`path entry`. The exception is ignored and :term:`import path` +-iteration continues. The hook should expect either a string or bytes object; +-the encoding of bytes objects is up to the hook (e.g. it may be a file system +-encoding, UTF-8, or something else), and if the hook cannot decode the +-argument, it should raise :exc:`ImportError`. ++signal that the hook cannot find a :term:`path entry finder`. ++for that :term:`path entry`. The ++exception is ignored and :term:`import path` iteration continues. The hook ++should expect either a string or bytes object; the encoding of bytes objects ++is up to the hook (e.g. it may be a file system encoding, UTF-8, or something ++else), and if the hook cannot decode the argument, it should raise ++:exc:`ImportError`. + + If :data:`sys.path_hooks` iteration ends with no :term:`path entry finder` +-being returned, then the path based finder's :meth:`find_spec()` method +-will store ``None`` in :data:`sys.path_importer_cache` (to indicate that +-there is no finder for this path entry) and return ``None``, indicating that +-this :term:`meta path finder` could not find the module. ++being returned, then the path based finder's ++:meth:`~importlib.machinery.PathFinder.find_spec` method will store ``None`` ++in :data:`sys.path_importer_cache` (to indicate that there is no finder for ++this path entry) and return ``None``, indicating that this ++:term:`meta path finder` could not find the module. + + If a :term:`path entry finder` *is* returned by one of the :term:`path entry + hook` callables on :data:`sys.path_hooks`, then the following protocol is used +@@ -741,12 +755,12 @@ + + In order to support imports of modules and initialized packages and also to + contribute portions to namespace packages, path entry finders must implement +-the :meth:`find_spec()` method. ++the :meth:`~importlib.abc.PathEntryFinder.find_spec` method. + +-:meth:`find_spec()` takes one argument, the fully qualified name of the +-module being imported. :meth:`find_spec()` returns a fully populated +-spec for the module. This spec will always have "loader" set (with one +-exception). ++:meth:`~importlib.abc.PathEntryFinder.find_spec` takes two argument, the ++fully qualified name of the module being imported, and the (optional) target ++module. ``find_spec()`` returns a fully populated spec for the module. ++This spec will always have "loader" set (with one exception). + + To indicate to the import machinery that the spec represents a namespace + :term:`portion`. the path entry finder sets "loader" on the spec to +@@ -754,42 +768,44 @@ + portion. + + .. versionchanged:: 3.4 +- find_spec() replaced find_loader() and find_module(), but of which +- are now deprecated, but will be used if find_spec() is not defined. ++ :meth:`~importlib.abc.PathEntryFinder.find_spec` replaced ++ :meth:`~importlib.abc.PathEntryFinder.find_loader` and ++ :meth:`~importlib.abc.PathEntryFinder.find_module`, both of which ++ are now deprecated, but will be used if ``find_spec()`` is not defined. + + Older path entry finders may implement one of these two deprecated methods +- instead of :meth:`find_spec()`. The methods are still respected for the +- sake of backward compatibility. Howevever, if find_spec() is implemented +- on the path entry finder, the legacy methods are ignored. ++ instead of ``find_spec()``. The methods are still respected for the ++ sake of backward compatibility. Howevever, if ``find_spec()`` is ++ implemented on the path entry finder, the legacy methods are ignored. + +- :meth:`find_loader()` takes one argument, the fully qualified name of the +- module being imported. :meth:`find_loader()` returns a 2-tuple where the +- first item is the loader and the second item is a namespace :term:`portion`. +- When the first item (i.e. the loader) is ``None``, this means that while the +- path entry finder does not have a loader for the named module, it knows that +- the path entry contributes to a namespace portion for the named module. +- This will almost always be the case where Python is asked to import a +- namespace package that has no physical presence on the file system. +- When a path entry finder returns ``None`` for the loader, the second +- item of the 2-tuple return value must be a sequence, although it can be +- empty. ++ :meth:`~importlib.abc.PathEntryFinder.find_loader` takes one argument, the ++ fully qualified name of the module being imported. ``find_loader()`` ++ returns a 2-tuple where the first item is the loader and the second item ++ is a namespace :term:`portion`. When the first item (i.e. the loader) is ++ ``None``, this means that while the path entry finder does not have a ++ loader for the named module, it knows that the path entry contributes to ++ a namespace portion for the named module. This will almost always be the ++ case where Python is asked to import a namespace package that has no ++ physical presence on the file system. When a path entry finder returns ++ ``None`` for the loader, the second item of the 2-tuple return value must ++ be a sequence, although it can be empty. + +- If :meth:`find_loader()` returns a non-``None`` loader value, the portion is ++ If ``find_loader()`` returns a non-``None`` loader value, the portion is + ignored and the loader is returned from the path based finder, terminating + the search through the path entries. + + For backwards compatibility with other implementations of the import + protocol, many path entry finders also support the same, +- traditional :meth:`find_module()` method that meta path finders support. +- However path entry finder :meth:`find_module()` methods are never called ++ traditional ``find_module()`` method that meta path finders support. ++ However path entry finder ``find_module()`` methods are never called + with a ``path`` argument (they are expected to record the appropriate + path information from the initial call to the path hook). + +- The :meth:`find_module()` method on path entry finders is deprecated, ++ The ``find_module()`` method on path entry finders is deprecated, + as it does not allow the path entry finder to contribute portions to +- namespace packages. If both :meth:`find_loader()` and :meth:`find_module()` ++ namespace packages. If both ``find_loader()`` and ``find_module()`` + exist on a path entry finder, the import system will always call +- :meth:`find_loader()` in preference to :meth:`find_module()`. ++ ``find_loader()`` in preference to ``find_module()``. + + + Replacing the standard import system +@@ -808,9 +824,9 @@ + To selectively prevent import of some modules from a hook early on the + meta path (rather than disabling the standard import system entirely), + it is sufficient to raise :exc:`ImportError` directly from +-:meth:`find_spec` instead of returning ``None``. The latter indicates +-that the meta path search should continue. while raising an exception +-terminates it immediately. ++:meth:`~importlib.abc.MetaPathFinder.find_spec` instead of returning ++``None``. The latter indicates that the meta path search should continue, ++while raising an exception terminates it immediately. + + + Open issues +diff -r 3405dc9a6afa Doc/tools/sphinxext/susp-ignored.csv +--- a/Doc/tools/sphinxext/susp-ignored.csv ++++ b/Doc/tools/sphinxext/susp-ignored.csv +@@ -141,15 +141,8 @@ + library/logging.handlers,,:port,host:port + library/mmap,,:i2,obj[i1:i2] + library/multiprocessing,,`,# Add more tasks using `put()` +-library/multiprocessing,,`,# A test file for the `multiprocessing` package +-library/multiprocessing,,`,# A test of `multiprocessing.Pool` class +-library/multiprocessing,,`,# `BaseManager`. +-library/multiprocessing,,`,# in the original order then consider using `Pool.map()` or + library/multiprocessing,,`,">>> l._callmethod('__getitem__', (20,)) # equiv to `l[20]`" + library/multiprocessing,,`,">>> l._callmethod('__getslice__', (2, 7)) # equiv to `l[2:7]`" +-library/multiprocessing,,`,# Not sure if we should synchronize access to `socket.accept()` method by +-library/multiprocessing,,`,# object. (We import `multiprocessing.reduction` to enable this pickling.) +-library/multiprocessing,,`,# `Pool.imap()` (which will save on the amount of code needed anyway). + library/multiprocessing,,:queue,">>> QueueManager.register('get_queue', callable=lambda:queue)" + library/multiprocessing,,`,# register the Foo class; make `f()` and `g()` accessible via proxy + library/multiprocessing,,`,# register the Foo class; make `g()` and `_h()` accessible via proxy +@@ -158,6 +151,10 @@ + library/nntplib,,:lines,:lines + library/optparse,,:len,"del parser.rargs[:len(value)]" + library/os.path,,:foo,c:foo ++library/pathlib,,:bar,">>> PureWindowsPath('c:/Windows', 'd:bar')" ++library/pathlib,,:bar,PureWindowsPath('d:bar') ++library/pathlib,,:Program,>>> PureWindowsPath('c:Program Files/').root ++library/pathlib,,:Program,>>> PureWindowsPath('c:Program Files/').anchor + library/pdb,,:lineno,filename:lineno + library/pickle,,:memory,"conn = sqlite3.connect("":memory:"")" + library/posix,,`,"CFLAGS=""`getconf LFS_CFLAGS`"" OPT=""-g -O2 $CFLAGS""" +@@ -200,7 +197,12 @@ + library/tarfile,,:xz,'w:xz' + library/time,,:mm, + library/time,,:ss, ++library/tracemalloc,,:limit,"for index, stat in enumerate(top_stats[:limit], 1):" + library/turtle,,::,Example:: ++library/unittest,1412,:foo,"self.assertEqual(cm.output, ['INFO:foo:first message'," ++library/unittest,1412,:first,"self.assertEqual(cm.output, ['INFO:foo:first message'," ++library/unittest,1412,:foo,'ERROR:foo.bar:second message']) ++library/unittest,1412,:second,'ERROR:foo.bar:second message']) + library/urllib.request,,:close,Connection:close + library/urllib.request,,:lang,"xmlns=""http://www.w3.org/1999/xhtml"" xml:lang=""en"" lang=""en"">\n\n\n" + library/urllib.request,,:password,"""joe:password@python.org""" +diff -r 3405dc9a6afa Doc/tutorial/inputoutput.rst +--- a/Doc/tutorial/inputoutput.rst ++++ b/Doc/tutorial/inputoutput.rst +@@ -377,47 +377,64 @@ + Reference for a complete guide to file objects. + + +-.. _tut-pickle: ++.. _tut-json: + +-The :mod:`pickle` Module +------------------------- ++Saving structured data with :mod:`json` ++--------------------------------------- + +-.. index:: module: pickle ++.. index:: module: json + +-Strings can easily be written to and read from a file. Numbers take a bit more ++Strings can easily be written to and read from a file. Numbers take a bit more + effort, since the :meth:`read` method only returns strings, which will have to + be passed to a function like :func:`int`, which takes a string like ``'123'`` +-and returns its numeric value 123. However, when you want to save more complex +-data types like lists, dictionaries, or class instances, things get a lot more +-complicated. ++and returns its numeric value 123. When you want to save more complex data ++types like nested lists and dictionaries, parsing and serializing by hand ++becomes complicated. + +-Rather than have users be constantly writing and debugging code to save +-complicated data types, Python provides a standard module called :mod:`pickle`. +-This is an amazing module that can take almost any Python object (even some +-forms of Python code!), and convert it to a string representation; this process +-is called :dfn:`pickling`. Reconstructing the object from the string +-representation is called :dfn:`unpickling`. Between pickling and unpickling, +-the string representing the object may have been stored in a file or data, or ++Rather than having users constantly writing and debugging code to save ++complicated data types to files, Python allows you to use the popular data ++interchange format called `JSON (JavaScript Object Notation) ++`_. The standard module called :mod:`json` can take Python ++data hierarchies, and convert them to string representations; this process is ++called :dfn:`serializing`. Reconstructing the data from the string representation ++is called :dfn:`deserializing`. Between serializing and deserializing, the ++string representing the object may have been stored in a file or data, or + sent over a network connection to some distant machine. + +-If you have an object ``x``, and a file object ``f`` that's been opened for +-writing, the simplest way to pickle the object takes only one line of code:: ++.. note:: ++ The JSON format is commonly used by modern applications to allow for data ++ exchange. Many programmers are already familiar with it, which makes ++ it a good choice for interoperability. + +- pickle.dump(x, f) ++If you have an object ``x``, you can view its JSON string representation with a ++simple line of code:: + +-To unpickle the object again, if ``f`` is a file object which has been opened +-for reading:: ++ >>> json.dumps([1, 'simple', 'list']) ++ '[1, "simple", "list"]' + +- x = pickle.load(f) ++Another variant of the :func:`~json.dumps` function, called :func:`~json.dump`, ++simply serializes the object to a :term:`text file`. So if ``f`` is a ++:term:`text file` object opened for writing, we can do this:: + +-(There are other variants of this, used when pickling many objects or when you +-don't want to write the pickled data to a file; consult the complete +-documentation for :mod:`pickle` in the Python Library Reference.) ++ json.dump(x, f) + +-:mod:`pickle` is the standard way to make Python objects which can be stored and +-reused by other programs or by a future invocation of the same program; the +-technical term for this is a :dfn:`persistent` object. Because :mod:`pickle` is +-so widely used, many authors who write Python extensions take care to ensure +-that new data types such as matrices can be properly pickled and unpickled. ++To decode the object again, if ``f`` is a :term:`text file` object which has ++been opened for reading:: + ++ x = json.load(f) + ++This simple serialization technique can handle lists and dictionaries, but ++serializing arbitrary class instances in JSON requires a bit of extra effort. ++The reference for the :mod:`json` module contains an explanation of this. ++ ++.. seealso:: ++ ++ :mod:`pickle` - the pickle module ++ ++ Contrary to :ref:`JSON `, *pickle* is a protocol which allows ++ the serialization of arbitrarily complex Python objects. As such, it is ++ specific to Python and cannot be used to communicate with applications ++ written in other languages. It is also insecure by default: ++ deserializing pickle data coming from an untrusted source can execute ++ arbitrary code, if the data was crafted by a skilled attacker. ++ +diff -r 3405dc9a6afa Doc/using/venv-create.inc +--- a/Doc/using/venv-create.inc ++++ b/Doc/using/venv-create.inc +@@ -92,3 +92,5 @@ + ``deactivate.bat`` and ``Deactivate.ps1`` which are installed when the venv is + created. + ++.. versionadded:: 3.4 ++ ``fish`` and ``csh`` activation scripts. +diff -r 3405dc9a6afa Doc/using/windows.rst +--- a/Doc/using/windows.rst ++++ b/Doc/using/windows.rst +@@ -556,27 +556,23 @@ + latest release's source or just grab a fresh `checkout + `_. + +-For Microsoft Visual C++, which is the compiler with which official Python +-releases are built, the source tree contains solutions/project files. View the +-:file:`readme.txt` in their respective directories: ++The source tree contains a build solution and project files for Microsoft ++Visual C++, which is the compiler used to build the official Python releases. ++View the :file:`readme.txt` in their respective directories: + + +--------------------+--------------+-----------------------+ + | Directory | MSVC version | Visual Studio version | + +====================+==============+=======================+ +-| :file:`PC/VC6/` | 6.0 | 97 | ++| :file:`PC/VS9.0/` | 9.0 | 2008 | + +--------------------+--------------+-----------------------+ +-| :file:`PC/VS7.1/` | 7.1 | 2003 | +-+--------------------+--------------+-----------------------+ +-| :file:`PC/VS8.0/` | 8.0 | 2005 | +-+--------------------+--------------+-----------------------+ +-| :file:`PCbuild/` | 9.0 | 2008 | ++| :file:`PCbuild/` | 10.0 | 2010 | + +--------------------+--------------+-----------------------+ + +-Note that not all of these build directories are fully supported. Read the +-release notes to see which compiler version the official releases for your +-version are built with. ++Note that any build directories within the :file:`PC` directory are not ++necessarily fully supported. The :file:`PCbuild` directory contains the files ++for the compiler used to build the official release. + +-Check :file:`PC/readme.txt` for general information on the build process. ++Check :file:`PCbuild/readme.txt` for general information on the build process. + + + For extension modules, consult :ref:`building-on-windows`. +diff -r 3405dc9a6afa Doc/whatsnew/2.4.rst +--- a/Doc/whatsnew/2.4.rst ++++ b/Doc/whatsnew/2.4.rst +@@ -846,7 +846,7 @@ + ['A', 'b', 'c', 'D'] + + Finally, the *reverse* parameter takes a Boolean value. If the value is true, +- the list will be sorted into reverse order. Instead of ``L.sort() ; ++ the list will be sorted into reverse order. Instead of ``L.sort(); + L.reverse()``, you can now write ``L.sort(reverse=True)``. + + The results of sorting are now guaranteed to be stable. This means that two +diff -r 3405dc9a6afa Doc/whatsnew/2.5.rst +--- a/Doc/whatsnew/2.5.rst ++++ b/Doc/whatsnew/2.5.rst +@@ -286,7 +286,7 @@ + :mod:`pkg.string` and look for the standard module; generally you had to look at + the contents of ``sys.modules``, which is slightly unclean. Holger Krekel's + :mod:`py.std` package provides a tidier way to perform imports from the standard +-library, ``import py ; py.std.string.join()``, but that package isn't available ++library, ``import py; py.std.string.join()``, but that package isn't available + on all Python installations. + + Reading code which relies on relative imports is also less clear, because a +diff -r 3405dc9a6afa Doc/whatsnew/2.6.rst +--- a/Doc/whatsnew/2.6.rst ++++ b/Doc/whatsnew/2.6.rst +@@ -1891,7 +1891,7 @@ + >>> dq=deque(maxlen=3) + >>> dq + deque([], maxlen=3) +- >>> dq.append(1) ; dq.append(2) ; dq.append(3) ++ >>> dq.append(1); dq.append(2); dq.append(3) + >>> dq + deque([1, 2, 3], maxlen=3) + >>> dq.append(4) +@@ -2783,12 +2783,12 @@ + types. The following example encodes and decodes a dictionary:: + + >>> import json +- >>> data = {"spam" : "foo", "parrot" : 42} ++ >>> data = {"spam": "foo", "parrot": 42} + >>> in_json = json.dumps(data) # Encode the data + >>> in_json + '{"parrot": 42, "spam": "foo"}' + >>> json.loads(in_json) # Decode into a Python object +- {"spam" : "foo", "parrot" : 42} ++ {"spam": "foo", "parrot": 42} + + It's also possible to write your own decoders and encoders to support + more types. Pretty-printing of the JSON strings is also supported. +diff -r 3405dc9a6afa Doc/whatsnew/3.2.rst +--- a/Doc/whatsnew/3.2.rst ++++ b/Doc/whatsnew/3.2.rst +@@ -2469,7 +2469,7 @@ + + In addition to the existing Subversion code repository at http://svn.python.org + there is now a `Mercurial `_ repository at +-http://hg.python.org/ . ++http://hg.python.org/\ . + + After the 3.2 release, there are plans to switch to Mercurial as the primary + repository. This distributed version control system should make it easier for +diff -r 3405dc9a6afa Doc/whatsnew/3.3.rst +--- a/Doc/whatsnew/3.3.rst ++++ b/Doc/whatsnew/3.3.rst +@@ -194,7 +194,7 @@ + are still permitted, but will always compare as unequal, regardless + of view contents. + +-* For further changes see `Build and C API Changes`_ and `Porting C code`_ . ++* For further changes see `Build and C API Changes`_ and `Porting C code`_. + + (Contributed by Stefan Krah in :issue:`10181`) + +@@ -1125,7 +1125,7 @@ + + * If Python is compiled without threads, the C version automatically + disables the expensive thread local context machinery. In this case, +- the variable :data:`~decimal.HAVE_THREADS` is set to False. ++ the variable :data:`~decimal.HAVE_THREADS` is set to ``False``. + + API changes + ~~~~~~~~~~~ +@@ -1823,12 +1823,12 @@ + * The :mod:`signal` module has new functions: + + * :func:`~signal.pthread_sigmask`: fetch and/or change the signal mask of the +- calling thread (Contributed by Jean-Paul Calderone in :issue:`8407`) ; +- * :func:`~signal.pthread_kill`: send a signal to a thread ; +- * :func:`~signal.sigpending`: examine pending functions ; +- * :func:`~signal.sigwait`: wait a signal. ++ calling thread (Contributed by Jean-Paul Calderone in :issue:`8407`); ++ * :func:`~signal.pthread_kill`: send a signal to a thread; ++ * :func:`~signal.sigpending`: examine pending functions; ++ * :func:`~signal.sigwait`: wait a signal; + * :func:`~signal.sigwaitinfo`: wait for a signal, returning detailed +- information about it. ++ information about it; + * :func:`~signal.sigtimedwait`: like :func:`~signal.sigwaitinfo` but with a + timeout. + +diff -r 3405dc9a6afa Doc/whatsnew/3.4.rst +--- a/Doc/whatsnew/3.4.rst ++++ b/Doc/whatsnew/3.4.rst +@@ -18,7 +18,7 @@ + time of the original release will remain largely unknown to the community + for years, even if they're added later. We also know from experience that + other priorities can arise, and the maintainer will run out of time to do +- updates - in such cases, end users will be much better served by partial ++ updates -- in such cases, end users will be much better served by partial + notifications that at least give a hint about new features to + investigate. + +@@ -75,10 +75,10 @@ + + .. seealso:: + +- :pep:`429` - Python 3.4 Release Schedule ++ :pep:`429` -- Python 3.4 Release Schedule + + +-Summary -- Release highlights ++Summary -- Release Highlights + ============================= + + .. This section singles out the most important changes in Python 3.4. +@@ -86,52 +86,78 @@ + + New syntax features: + +-* No new syntax features are planned for Python 3.4. ++* No new syntax features were added in Python 3.4. ++ ++New expected features for Python implementations: ++ ++* :ref:`pip should always be "available" ` (:pep:`453`). ++* :ref:`Make newly created file descriptors non-inheritable ` ++ (:pep:`446`). ++* command line option for :ref:`isolated mode `, ++ (:issue:`16499`). ++* :ref:`improvements in the handling of codecs ` ++ that are not text encodings (multiple issues). ++* :ref:`A ModuleSpec Type ` for the Import System ++ (:pep:`451`). (Affects importer authors.) + + New library modules: + +-* :mod:`asyncio`: New provisonal API for asynchronous IO (:pep:`3156`). +-* :mod:`enum`: Support for enumeration types (:pep:`435`). +-* :mod:`ensurepip`: Bootstrapping the pip installer (:pep:`453`). +-* :mod:`pathlib`: Object-oriented filesystem paths (:pep:`428`). +-* :mod:`selectors`: High-level and efficient I/O multiplexing, built upon the +- :mod:`select` module primitives. +-* :mod:`statistics`: A basic numerically stable statistics library (:pep:`450`). +- +-New expected features for Python implementations: +- +-* :ref:`PEP 446: Make newly created file descriptors non-inheritable `. +-* command line option for :ref:`isolated mode `, +- (:issue:`16499`). +-* :ref:`improvements ` in the handling of +- codecs that are not text encodings ++* :mod:`asyncio`: :ref:`New provisional API for asynchronous IO ++ ` (:pep:`3156`). ++* :mod:`ensurepip`: :ref:`Bootstrapping the pip installer ` ++ (:pep:`453`). ++* :mod:`enum`: :ref:`Support for enumeration types ` ++ (:pep:`435`). ++* :mod:`pathlib`: :ref:`Object-oriented filesystem paths ` ++ (:pep:`428`). ++* :mod:`selectors`: :ref:`High-level and efficient I/O multiplexing ++ `, built upon the :mod:`select` module primitives (part ++ of :pep:`3156`). ++* :mod:`statistics`: A basic :ref:`numerically stable statistics library ++ ` (:pep:`450`). ++* :mod:`tracemalloc`: :ref:`Trace Python memory allocations ++ ` (:pep:`454`). + + Significantly Improved Library Modules: + +-* Single-dispatch generic functions in :mod:`functoools` (:pep:`443`) +-* New :mod:`pickle` protocol 4 (:pep:`3154`) +-* SHA-3 (Keccak) support for :mod:`hashlib`. +-* TLSv1.1 and TLSv1.2 support for :mod:`ssl`. +-* :mod:`multiprocessing` now has option to avoid using :func:`os.fork` +- on Unix (:issue:`8713`). ++* :ref:`Single-dispatch generic functions ` in ++ :mod:`functools` (:pep:`443`). ++* New :mod:`pickle` :ref:`protocol 4 ` (:pep:`3154`). ++* :ref:`SHA-3 (Keccak) support ` for :mod:`hashlib` ++ (:issue:`16113`). ++* :ref:`TLSv1.1 and TLSv1.2 support ` for :mod:`ssl` ++ (:issue:`16692`). ++* :mod:`multiprocessing` now has :ref:`an option to avoid using os.fork ++ on Unix ` (:issue:`8713`). ++* :mod:`email` has a new submodule, :mod:`~email.contentmanager`, and ++ a new :mod:`~email.message.Message` subclass ++ (:class:`~email.contentmanager.EmailMessage`) that :ref:`simplify MIME ++ handling ` (:issue:`18891`). + + CPython implementation improvements: + +-* :ref:`PEP 442: Safe object finalization ` +-* :ref:`PEP 445: Configurable memory allocators ` +-* :pep:`456` Secure and interchangeable hash algorithm +-* Improve finalization of Python modules to avoid setting their globals +- to None, in most cases (:issue:`18214`). +-* A more efficient :mod:`marshal` format (:issue:`16475`). +-* "Argument Clinic", an initial step towards providing improved introspection +- support for builtin and standard library extension types implemented in C +- (:pep:`436`) ++* :ref:`Safe object finalization ` (:pep:`442`). ++* Leveraging :pep:`442`, :ref:`module globals are no longer set to None ++ during finalization `, in most cases (:issue:`18214`). ++* :ref:`Configurable memory allocators ` (:pep:`445`). ++* :ref:`Secure and interchangeable hash algorithm ` ++ (:pep:`456`). ++* :ref:`Argument Clinic ` (:pep:`436`). ++* The :mod:`marshal` format has been made :ref:`more compact and efficient ++ ` (:issue:`16475`). + +-Please read on for a comprehensive list of user-facing changes. ++Please read on for a comprehensive list of user-facing changes, including many ++other smaller improvements, CPython optimizations, deprecations, and potential ++porting issues. + + +-PEP 453: Explicit bootstrapping of pip in Python installations +-============================================================== ++New Expected Features for Python Implementations ++================================================ ++ ++.. _whatsnew-pep-453: ++ ++PEP 453: Explicit Bootstrapping of PIP in Python Installations ++-------------------------------------------------------------- + + The new :mod:`ensurepip` module (defined in :pep:`453`) provides a standard + cross-platform mechanism to boostrap the pip installer into Python +@@ -150,6 +176,12 @@ + On Windows and Mac OS X, the CPython installers now offer the option to + install ``pip`` along with CPython itself. + ++As `discussed in the PEP`__, platform packagers may choose not to install ++``pip`` by default, as long as the command ``pip``, when invoked, provides ++clear and simple directions on how to install ``pip`` on the platform. ++ ++__ http://www.python.org/dev/peps/pep-0453/#recommendations-for-downstream-distributors ++ + .. note:: + + The implementation of PEP 453 is still a work in progress. Refer to +@@ -161,15 +193,15 @@ + + .. seealso:: + +- :pep:`453` - Explicit bootstrapping of pip in Python installations ++ :pep:`453` -- Explicit bootstrapping of pip in Python installations + PEP written by Donald Stufft and Nick Coghlan, implemented by + Donald Stufft, Nick Coghlan, Martin von Löwis and Ned Deily. + + +-.. _pep-446: ++.. _whatsnew-pep-446: + +-PEP 446: Make newly created file descriptors non-inheritable +-============================================================ ++PEP 446: Make Newly Created File Descriptors Non-Inheritable ++------------------------------------------------------------ + + :pep:`446` makes newly created file descriptors :ref:`non-inheritable + `. New functions and methods: +@@ -180,14 +212,14 @@ + + .. seealso:: + +- :pep:`446` - Make newly created file descriptors non-inheritable ++ :pep:`446` -- Make newly created file descriptors non-inheritable + PEP written and implemented by Victor Stinner. + + + .. _codec-handling-improvements: + +-Improvements to codec handling +-============================== ++Improvements to Codec Handling ++------------------------------ + + Since it was first introduced, the :mod:`codecs` module has always been + intended to operate as a type-neutral dynamic encoding and decoding +@@ -265,43 +297,28 @@ + (Contributed by Nick Coghlan in :issue:`7475`, , :issue:`17827`, + :issue:`17828` and :issue:`19619`) + +-.. _pep-451: ++.. _whatsnew-pep-451: + + PEP 451: A ModuleSpec Type for the Import System +-================================================ ++------------------------------------------------ + +-:pep:`451` provides an encapsulation of the information about a module +-that the import machinery will use to load it, (i.e. a module spec). +-This helps simplify both the import implementation and several +-import-related APIs. The change is also a stepping stone for several +-future import-related improvements. ++:pep:`451` provides an encapsulation of the information about a module that the ++import machinery will use to load it (that is, a module specification). This ++helps simplify both the import implementation and several import-related APIs. ++The change is also a stepping stone for `several future import-related ++improvements`__. + +-https://mail.python.org/pipermail/python-dev/2013-November/130111.html ++__ https://mail.python.org/pipermail/python-dev/2013-November/130111.html + + The public-facing changes from the PEP are entirely backward-compatible. +-Furthermore, they should be transparent to everyone but importer +-authors. Key finder and loader methods have been deprecated, but they +-will continue working. New importers should use the new methods +-described in the PEP. Existing importers should be updated to implement +-the new methods. +- +- +-Pickle protocol 4 +-================= +- +-The new :mod:`pickle` protocol addresses a number of issues that were present +-in previous protocols, such as the serialization of nested classes, very +-large strings and containers, or classes whose :meth:`__new__` method takes +-keyword-only arguments. It also brings a couple efficiency improvements. +- +-.. seealso:: +- +- :pep:`3154` - Pickle protocol 4 +- PEP written by Antoine Pitrou and implemented by Alexandre Vassalotti. ++Furthermore, they should be transparent to everyone but importer authors. Key ++finder and loader methods have been deprecated, but they will continue working. ++New importers should use the new methods described in the PEP. Existing ++importers should be updated to implement the new methods. + + + Other Language Changes +-====================== ++---------------------- + + Some smaller changes made to the core Python language are: + +@@ -330,6 +347,8 @@ + =========== + + ++.. _whatsnew-asyncio: ++ + asyncio + ------- + +@@ -342,9 +361,36 @@ + + .. seealso:: + +- :pep:`3156` - Asynchronous IO Support Rebooted: the "asyncio" Module ++ :pep:`3156` -- Asynchronous IO Support Rebooted: the "asyncio" Module + PEP written and implementation led by Guido van Rossum. + ++ ++.. _whatsnew-ensurepip: ++ ++ensurepip ++--------- ++ ++The new :mod:`ensurepip` module is the primary infrastructure for the ++:pep:`453` implementation. In the normal course of events end users will not ++need to interact with this module, but it can be used to manually bootstrap ++``pip`` if the automated bootstrapping into an installation or virtual ++environment was declined. ++ ++:mod:`ensurepip` includes a bundled copy of ``pip``, up-to-date as of the first ++release candidate of the release of CPython with which it ships (this applies ++to both maintenance releases and feature releases). ``ensurepip`` does not ++access the internet. (If the installation has Internet access, it is of course ++possible to upgrade ``pip`` to a release more recent than the bundled ``pip`` ++by using the bundled ``pip`` command itself once it is installed.) ++ ++The module is named *ensure*\ pip because if called when ``pip`` is already ++installed, it does nothing. It also has an ``--upgrade`` option that will ++cause it to install the bundled copy of ``pip`` if the existing installed ++version of ``pip`` is older than the bundled copy. ++ ++ ++.. _whatsnew-enum: ++ + enum + ---- + +@@ -356,11 +402,13 @@ + + .. seealso:: + +- :pep:`435` - Adding an Enum type to the Python standard library ++ :pep:`435` -- Adding an Enum type to the Python standard library + PEP written by Barry Warsaw, Eli Bendersky and Ethan Furman, + implemented by Ethan Furman. + + ++.. _whatsnew-pathlib: ++ + pathlib + ------- + +@@ -374,10 +422,12 @@ + + .. seealso:: + +- :pep:`428` - The pathlib module -- object-oriented filesystem paths ++ :pep:`428` -- The pathlib module -- object-oriented filesystem paths + PEP written and implemented by Antoine Pitrou. + + ++.. _whatsnew-selectors: ++ + selectors + --------- + +@@ -386,6 +436,8 @@ + :mod:`select` module primitives. + + ++.. _whatsnew-statistics: ++ + statistics + ---------- + +@@ -396,13 +448,46 @@ + + .. seealso:: + +- :pep:`450` - Adding A Statistics Module To The Standard Library ++ :pep:`450` -- Adding A Statistics Module To The Standard Library + PEP written and implemented by Steven D'Aprano + ++.. _whatsnew-tracemalloc: ++ ++tracemalloc ++----------- ++ ++The new :mod:`tracemalloc` module (defined in :pep:`454`) is a debug tool to ++trace memory blocks allocated by Python. It provides the following information: ++ ++* Traceback where an object was allocated ++* Statistics on allocated memory blocks per filename and per line number: ++ total size, number and average size of allocated memory blocks ++* Compute the differences between two snapshots to detect memory leaks ++ ++.. seealso:: ++ ++ :pep:`454` -- Add a new tracemalloc module to trace Python memory allocations ++ PEP written and implemented by Victor Stinner ++ + + Improved Modules + ================ + ++ ++abc ++--- ++ ++New function :func:`abc.get_cache_token` can be used to know when to invalidate ++caches that are affected by changes in the object graph. (Contributed ++by Åukasz Langa in :issue:`16832`.) ++ ++New class :class:`~abc.ABC` has :class:`~abc.ABCMeta` as its meta class. ++Using ``ABC`` as a base class has essentially the same effect as specifying ++``metaclass=abc.ABCMeta``, but is simpler to type and easier to read. ++(Contributed by Bruno Dupuis in :issue:`16049`.) ++ ++ ++ + aifc + ---- + +@@ -424,7 +509,7 @@ + + The encoding and decoding functions in :mod:`base64` now accept any + :term:`bytes-like object` in cases where it previously required a +-:class:`bytes` or :class:`bytearray` instance (:issue`17839`) ++:class:`bytes` or :class:`bytearray` instance (:issue:`17839`). + + + colorsys +@@ -475,15 +560,15 @@ + doctest + ------- + +-Added :data:`~doctest.FAIL_FAST` flag to halt test running as soon as the first +-failure is detected. (Contributed by R. David Murray and Daniel Urban in +-:issue:`16522`.) ++A new :ref:`option flag `, :data:`~doctest.FAIL_FAST`, halts ++test running as soon as the first failure is detected. (Contributed by R. ++David Murray and Daniel Urban in :issue:`16522`.) + +-Updated the doctest command line interface to use :mod:`argparse`, and added +-``-o`` and ``-f`` options to the interface. ``-o`` allows doctest options to +-be specified on the command line, and ``-f`` is a shorthand for ``-o +-FAIL_FAST`` (to parallel the similar option supported by the :mod:`unittest` +-CLI). (Contributed by R. David Murray in :issue:`11390`.) ++The :mod:`doctest` command line interface now uses :mod:`argparse`, and has two ++new options, ``-o`` and ``-f``. ``-o`` allows :ref:`doctest options ++` to be specified on the command line, and ``-f`` is a ++shorthand for ``-o FAIL_FAST`` (to parallel the similar option supported by the ++:mod:`unittest` CLI). (Contributed by R. David Murray in :issue:`11390`.) + + + email +@@ -505,6 +590,8 @@ + + (Contributed by R. David Murray in :issue:`18600`.) + ++.. _whatsnew_email_contentmanager: ++ + A pair of new subclasses of :class:`~email.message.Message` have been added, + along with a new sub-module, :mod:`~email.contentmanager`. All documentation + is currently in the new module, which is being added as part of the new +@@ -532,6 +619,8 @@ + + (Contributed by Alon Horev and Nick Coghlan in :issue:`4331`) + ++.. _whatsnew-singledispatch: ++ + The new :func:`~functools.singledispatch` decorator brings support for + single-dispatch generic functions to the Python standard library. Where + object oriented programming focuses on grouping multiple operations on a +@@ -541,16 +630,62 @@ + + .. seealso:: + +- :pep:`443` - Single-dispatch generic functions ++ :pep:`443` -- Single-dispatch generic functions + PEP written and implemented by Åukasz Langa. + ++A pure-python version of the :func:`~functools.partial` function is now in the ++stdlib; in CPython it is overridden by the C accelerated version, but it is ++available for other implementations to use. (Contributed by Brian Thorne in ++:issue:`12428`.) ++ ++ ++gc ++-- ++ ++New :func:`~gc.get_stats` returns a list of three per-generation dictionaries ++containing the collections statistics since interpreter startup. (Contributed ++by Antoine Pitrou in :issue:`16351`.) ++ + + hashlib + ------- + + New :func:`hashlib.pbkdf2_hmac` function. ++(Contributed by Christian Heimes in :issue:`18582`) + +-(Contributed by Christian Heimes in :issue:`18582`) ++.. _whatsnew-sha3: ++ ++New :ref:`hash algorithms ` ``sha3_224()``, ``sha3_256()``, ++``sha3_384()``, and ``sha3_512()``. (Contributed by Christian Heimes in ++:issue:`16113`.) ++ ++ ++html ++---- ++ ++Added a new :func:`html.unescape` function that converts HTML5 character ++references to the corresponding Unicode characters. ++(Contributed by Ezio Melotti in :issue:`2927`) ++ ++Added a new *convert_charrefs* keyword argument to ++:class:`~html.parser.HTMLParser` that, when ``True``, automatically converts ++all character references. For backward-compatibility, its value defaults ++to ``False``, but it will change to ``True`` in future versions, so you ++are invited to set it explicitly and update your code to use this new feature. ++(Contributed by Ezio Melotti in :issue:`13633`) ++ ++The *strict* argument of :class:`~html.parser.HTMLParser` is now deprecated. ++(Contributed by Ezio Melotti in :issue:`15114`) ++ ++ ++importlib ++--------- ++ ++The :class:`~importlib.abc.InspectLoader` ABC defines a new method, ++:meth:`~importlib.abc.InspectLoader.source_to_code` that accepts source ++data and a path and returns a code object. The default implementation ++is equivalent to ``compile(data, path, 'exec', dont_inherit=True)``. ++(Contributed by Eric Snow and Brett Cannon in :issue:`15627`.) + + + inspect +@@ -574,23 +709,48 @@ + :issue:`19030`) + + ++.. _whatsnew-marshal-3: ++ ++marshal ++------- ++ ++The default :mod:`marshal` version has been bumped to 3. The code implementing ++the new version restores the Python2 behavior of recording only one copy of ++interned strings and preserving the interning on deserialization, and extends ++this "one copy" ability to any object type (including handling recursive ++references). This reduces both the size of ``.pyc`` files and the amount of ++memory a module occupies in memory when it is loaded from a ``.pyc`` (or ++``.pyo``) file. (Contributed by Kristján Valur Jónsson in :issue:`16475`.) ++ ++ + mmap + ---- + + mmap objects can now be weakref'ed. +- + (Contributed by Valerie Lambert in :issue:`4885`.) + + + multiprocessing + --------------- + +-On Unix two new *start methods* have been added for starting processes +-using :mod:`multiprocessing`. These make the mixing of processes with +-threads more robust. See :issue:`8713`. ++.. _whatsnew-multiprocessing-no-fork: ++ ++On Unix, two new :ref:`start methods ` ++(``spawn`` and ``forkserver``) have been added for starting processes using ++:mod:`multiprocessing`. These make the mixing of processes with threads more ++robust, and the ``spawn`` method matches the semantics that multiprocessing has ++always used on Windows. (Contributed by Richard Oudkerk in :issue:`8713`). + + Also, except when using the old *fork* start method, child processes +-will no longer inherit unneeded handles/file descriptors from their parents. ++will no longer inherit unneeded handles/file descriptors from their parents ++(part of :issue:`8713`). ++ ++:mod:`multiprocessing` now relies on :mod:`runpy` (which implements the ++``-m`` switch) to initialise ``__main__`` appropriately in child processes ++when using the ``spawn`` or ``forkserver`` start methods. This resolves some ++edge cases where combining multiprocessing, the ``-m`` command line switch ++and explicit relative imports could cause obscure failures in child ++processes. (Contributed by Nick Coghlan in :issue:`19946`) + + + os +@@ -619,16 +779,33 @@ + (Contributed by Connor Osborn in :issue:`18764`.) + + ++.. _whatsnew-protocol-4: ++ ++pickle ++------ ++ ++protocol 4 ++ ++:mod:`pickle` now supports (but does not use by default) a new pickle protocol, ++protocol 4. This new protocol addresses a number of issues that were present ++in previous protocols, such as the serialization of nested classes, very large ++strings and containers, or classes whose :meth:`__new__` method takes ++keyword-only arguments. It also provides some efficiency improvements. ++ ++.. seealso:: ++ ++ :pep:`3154` -- Pickle protocol 4 ++ PEP written by Antoine Pitrou and implemented by Alexandre Vassalotti. ++ ++ + poplib + ------ + +-New :meth:`~poplib.POP3.stls` method to switch a clear-text POP3 session into +-an encrypted POP3 session. +- +-New :meth:`~poplib.POP3.capa` method to query the capabilities advertised by the +-POP3 server. +- +-(Contributed by Lorenzo Catucci in :issue:`4473`.) ++Two new methods have been added to :mod:`poplib`: :meth:`~poplib.POP3.capa`, ++which returns the list of capabilities advertised by the POP server, and ++:meth:`~poplib.POP3.stls`, which switches a clear-text POP3 session into an ++encrypted POP3 session if the POP server supports it. (Contributed by Lorenzo ++Catucci in :issue:`4473`.) + + + pprint +@@ -638,6 +815,13 @@ + sequences (:issue:`19132`). + + ++pty ++--- ++ ++:func:`pty.spawn` now returns the status value from :func:`os.waitpid` on ++the child process, instead of ``None``. (Contributed by Gregory P. Smith.) ++ ++ + pydoc + ----- + +@@ -654,12 +838,27 @@ + which anchor the pattern at both ends of the string to match. + (Contributed by Matthew Barnett in :issue:`16203`.) + ++The repr of :ref:`regex objects ` now includes the pattern ++and the flags; the repr of :ref:`match objects ` now ++includes the start, end, and the part of the string that matched. ++(Contributed by Serhiy Storchaka in :issue:`13592` and :issue:`17087`.) ++ ++ + resource + -------- + + New :func:`resource.prlimit` function and Linux specific constants. + (Contributed by Christian Heimes in :issue:`16595` and :issue:`19324`.) + ++ ++shelve ++------ ++ ++:class:`~shelve.Shelf` instances may now be used in :keyword:`with` statements, ++and will be automatically closed at the end of the :keyword:`with` block. ++(Contributed by Filip GruszczyÅ„ski in :issue:`13896`.) ++ ++ + smtplib + ------- + +@@ -684,23 +883,23 @@ + ssl + --- + +-TLSv1.1 and TLSv1.2 support. ++.. _whatsnew-tls-11-12: + +-(Contributed by Michele Orrù and Antoine Pitrou in :issue:`16692`) ++:data:`~ssl.PROTOCOL_TLSv1_1` and :data:`~ssl.PROTOCOL_TLSv1_2` (TLSv1.1 and ++TLSv1.2 support) have been added; support for these protocols is only available if ++Python is linked with OpenSSL 1.0.1 or later. (Contributed by Michele Orrù and ++Antoine Pitrou in :issue:`16692`) + +-* New diagnostic functions :func:`~ssl.get_default_verify_paths`, +- :meth:`~ssl.SSLContext.cert_store_stats` and +- :meth:`~ssl.SSLContext.get_ca_certs` ++New diagnostic functions :func:`~ssl.get_default_verify_paths`, ++:meth:`~ssl.SSLContext.cert_store_stats` and ++:meth:`~ssl.SSLContext.get_ca_certs` (Contributed by Christian Heimes ++in :issue:`18143` and :issue:`18147`) + +-* Add :func:`ssl.enum_cert_store` to retrieve certificates and CRL from Windows' +- cert store. +- +-(Contributed by Christian Heimes in :issue:`18143`, :issue:`18147` and +- :issue:`17134`.) ++Add :func:`ssl.enum_cert_store` to retrieve certificates and CRL from Windows' ++cert store. (Contributed by Christian Heimes in :issue:`17134`.) + + Support for server-side SNI using the new + :meth:`ssl.SSLContext.set_servername_callback` method. +- + (Contributed by Daniel Black in :issue:`8109`.) + + +@@ -718,7 +917,6 @@ + ------ + + Streaming struct unpacking using :func:`struct.iter_unpack`. +- + (Contributed by Antoine Pitrou in :issue:`17804`.) + + +@@ -731,6 +929,17 @@ + :meth:`sunau.open` now supports the context manager protocol (:issue:`18878`). + + ++sys ++--- ++ ++New function :func:`sys.getallocatedblocks` returns the current number of ++blocks allocated by the interpreter (in CPython with the default ++``--with-pymalloc`` setting, this is allocations made through the ++:c:func:`PyObject_Malloc` API). This can be useful for tracking memory leaks, ++especially if automated via a test suite. (Contributed by Antoine Pitrou ++in :issue:`13390`.) ++ ++ + traceback + --------- + +@@ -742,9 +951,9 @@ + urllib + ------ + +-Add support.for ``data:`` URLs in :mod:`urllib.request`. +- +-(Contributed by Mathias Panzenböck in :issue:`16423`.) ++:mod:`urllib.request` now supports ``data:`` URLs via the ++:class:`~urllib.request.DataHandler` class. (Contributed by Mathias Panzenböck ++in :issue:`16423`.) + + + unittest +@@ -752,8 +961,14 @@ + + Support for easy dynamically-generated subtests using the + :meth:`~unittest.TestCase.subTest` context manager. ++(Contributed by Antoine Pitrou in :issue:`16997`.) + +-(Contributed by Antoine Pitrou in :issue:`16997`.) ++ ++venv ++---- ++ ++:mod:`venv` now includes activation scripts for the ``csh`` and ``fish`` ++shells (Contributed by Andrew Svetlov in :issue:`15417`.) + + + wave +@@ -783,8 +998,16 @@ + + Add an event-driven parser for non-blocking applications, + :class:`~xml.etree.ElementTree.XMLPullParser`. ++(Contributed by Antoine Pitrou in :issue:`17741`.) + +-(Contributed by Antoine Pitrou in :issue:`17741`.) ++The :mod:`xml.etree.ElementTree` :func:`~xml.etree.ElementTree.tostring` and ++:func:`~xml.etree.ElementTree.tostringlist` functions, and the ++:class:`~xml.etree.ElementTree.ElementTree` ++:meth:`~xml.etree.ElementTree.ElementTree.write` method, now have a ++*short_empty_elements* :ref:`keyword-only parameter ` ++providing control over whether elements with no content are written in ++abbreviated (````) or expanded (````) form. (Contributed by ++Ariel Poliak and Serhiy Storchaka in :issue:`14377`.) + + + zipfile.PyZipfile +@@ -792,30 +1015,138 @@ + + Add a filter function to ignore some packages (tests for instance), + :meth:`~zipfile.PyZipFile.writepy`. +- + (Contributed by Christian Tismer in :issue:`19274`.) + + +-Other improvements ++CPython Implementation Changes ++============================== ++ ++ ++.. _whatsnew-pep-445: ++ ++PEP 445: Customization of CPython Memory Allocators ++--------------------------------------------------- ++ ++:pep:`445` adds new C level interfaces to customize memory allocation in ++the CPython interpreter. ++ ++.. seealso:: ++ ++ :pep:`445` -- Add new APIs to customize Python memory allocators ++ PEP written and implemented by Victor Stinner. ++ ++ ++.. _whatsnew-pep-442: ++ ++PEP 442: Safe Object Finalization ++--------------------------------- ++ ++:pep:`442` removes the current limitations and quirks of object finalization ++in CPython. With it, objects with :meth:`__del__` methods, as well as ++generators with :keyword:`finally` clauses, can be finalized when they are ++part of a reference cycle. ++ ++As part of this change, module globals are no longer forcibly set to ++:const:`None` during interpreter shutdown in most cases, instead relying ++on the normal operation of the cyclic garbage collector. This avoids a ++whole class of interpreter-shutdown-time errors, usually involving ++``__del__`` methods, that have plagued Python since the cyclic GC ++was first introduced. ++ ++.. seealso:: ++ ++ :pep:`442` -- Safe object finalization ++ PEP written and implemented by Antoine Pitrou. ++ ++ ++.. _whatsnew-pep-456: ++ ++PEP 456: Secure and Interchangeable Hash Algorithm ++-------------------------------------------------- ++ ++:pep:`456` follows up on earlier security fix work done on Python's hash ++algorithm to address certain DOS attacks to which public facing APIs backed by ++dictionary lookups may be subject. (See :issue:`14621` for the start of the ++current round of improvements.) The PEP unifies CPython's hash code to make it ++easier for a packager to substitute a different hash algorithm, and switches ++Python's default implementation to a SipHash implementation on platforms that ++have a 64 bit data type. Any performance differences in comparison with the ++older FNV algorithm are trivial. ++ ++The PEP adds additional fields to the :func:`sys.hash_info` struct sequence to ++describe the hash algorithm in use by the currently executing binary. Otherwise, ++the PEP does not alter any existing CPython APIs. ++ ++ ++.. _whatsnew-pep-436: ++ ++PEP 436: Argument Clinic ++------------------------ ++ ++"Argument Clinic" (:pep:`436`) is now part of the CPython build process ++and can be used to simplify the process of defining and maintaining ++accurate signatures for builtins and standard library extension modules ++implemented in C. ++ ++.. note:: ++ The Argument Clinic PEP is not fully up to date with the state of the ++ implementation. This has been deemed acceptable by the release manager ++ and core development team in this case, as Argument Clinic will not ++ be made available as a public API for third party use in Python 3.4. ++ ++.. seealso:: ++ ++ :pep:`436` -- The Argument Clinic DSL ++ PEP written and implemented by Larry Hastings. ++ ++ ++Other Build and C API Changes ++----------------------------- ++ ++* The new :c:func:`Py_SetStandardStreamEncoding` pre-initialization API ++ allows applications embedding the CPython interpreter to reliably force ++ a particular encoding and error handler for the standard streams ++ (Contributed by Bastien Montagne and Nick Coghlan in :issue:`16129`) ++ ++* Most Python C APIs that don't mutate string arguments are now correctly ++ marked as accepting ``const char *`` rather than ``char *`` (Contributed ++ by Serhiy Storchaka in :issue:`1772673`). ++ ++* New shell version of ``python-config``; can be used even when a python ++ interpreter is not available (for example, in cross compilation scenarios). ++ ++ ++Other Improvements + ================== + +-Tab-completion is now enabled by default in the interactive interpreter. ++* Tab-completion is now enabled by default in the interactive interpreter. ++ (Contributed by Antoine Pitrou and Éric Araujo in :issue:`5845`.) + +-(Contributed by Antoine Pitrou and Éric Araujo in :issue:`5845`.) ++* Invoking the Python interpreter with ``--version`` now outputs the version to ++ standard output instead of standard error (:issue:`18338`). Similar changes ++ were made to :mod:`argparse` (:issue:`18920`) and other modules that have ++ script-like invocation capabilities (:issue:`18922`). + +-Python invocation changes ++* The CPython Windows installer now adds ``.py`` to the :envvar:`PATHEXT` ++ variable when extensions are registered, allowing users to run a python ++ script at the windows command prompt by just typing its name without the ++ ``.py`` extension. (Contributed by Paul Moore in :issue:`18569`.) ++ ++* A new ``make`` target `coverage-report ++ `_ ++ will build python, run the test suite, and generate an HTML coverage report ++ for the C codebase using ``gcov`` and `lcov ++ `_. ++ ++* The ``-R`` option to the :ref:`python regression test suite ` now ++ also checks for memory allocation leaks, using ++ :func:`sys.getallocatedblocks()`. (Contributed by Antoine Pitrou in ++ :issue:`13390`). ++ ++ ++Significant Optimizations + ========================= + +-Invoking the Python interpreter with ``--version`` now outputs the version to +-standard output instead of standard error (:issue:`18338`). Similar changes +-were made to :mod:`argparse` (:issue:`18920`) and other modules that have +-script-like invocation capabilities (:issue:`18922`). +- +-Optimizations +-============= +- +-Major performance enhancements have been added: +- + * The UTF-32 decoder is now 3x to 4x faster. + + * The cost of hash collisions for sets is now reduced. Each hash table +@@ -841,82 +1172,22 @@ + :issue:`19219`, :issue:`19218`, :issue:`19209`, :issue:`19205` and + :issue:`9548`) + +- +-CPython Implementation Changes +-============================== +- +- +-.. _pep-445: +- +-PEP 445: Customization of CPython memory allocators +---------------------------------------------------- +- +-:pep:`445` adds new C level interfaces to customize memory allocation in +-the CPython interpreter. +- +-.. seealso:: +- +- :pep:`445` - Add new APIs to customize Python memory allocators +- PEP written and implemented by Victor Stinner. +- +- +-.. _pep-442: +- +-PEP 442: Safe object finalization +---------------------------------- +- +-:pep:`442` removes the current limitations and quirks of object finalization +-in CPython. With it, objects with :meth:`__del__` methods, as well as +-generators with :keyword:`finally` clauses, can be finalized when they are +-part of a reference cycle. +- +-As part of this change, module globals are no longer forcibly set to +-:const:`None` during interpreter shutdown in most cases, instead relying +-on the normal operation of the cyclic garbage collector. +- +-.. seealso:: +- +- :pep:`442` - Safe object finalization +- PEP written and implemented by Antoine Pitrou. +- +- +-Other build and C API changes +------------------------------ +- +-Changes to Python's build process and to the C API include: +- +-* The new :c:func:`Py_SetStandardStreamEncoding` pre-initialization API +- allows applications embedding the CPython interpreter to reliably force +- a particular encoding and error handler for the standard streams +- (Contributed by Bastien Montagne and Nick Coghlan in :issue:`16129`) +- +-* Most Python C APIs that don't mutate string arguments are now correctly +- marked as accepting ``const char *`` rather than ``char *`` (Contributed +- by Serhiy Storchaka in :issue:`1772673`). +- +-* "Argument Clinic" (:pep:`436`) is now part of the CPython build process +- and can be used to simplify the process of defining and maintaining +- accurate signatures for builtins and standard library extension modules +- implemented in C. +- +- .. note:: +- The Argument Clinic PEP is not fully up to date with the state of the +- implementation. This has been deemed acceptable by the release manager +- and core development team in this case, as Argument Clinic will not +- be made available as a public API for third party use in Python 3.4. ++* :class:`bz2.BZ2File` is now as fast or faster than the Python2 version for ++ most cases. :class:`lzma.LZMAFile` has also been optimized. (Contributed by ++ Serhiy Storchaka and Nadeem Vawda in :issue:`16034`.) + + + Deprecated + ========== + +-Unsupported Operating Systems +------------------------------ ++This section covers various APIs and other features that have been deprecated ++in Python 3.4, and will be removed in Python 3.5 or later. In most (but not ++all) cases, using the deprecated APIs will produce a :exc:`DeprecationWarning` ++when the interpreter is run with deprecation warnings enabled (for example, by ++using ``-Wd``). + +-* OS/2 +-* Windows 2000 + +- +-Deprecated Python modules, functions and methods ++Deprecated Python Modules, Functions and Methods + ------------------------------------------------ + + * :meth:`difflib.SequenceMatcher.isbjunk` and +@@ -938,26 +1209,58 @@ + require an explicit digest name or constructor as *digestmod* argument. + + +-Deprecated functions and types of the C API ++Deprecated Functions and Types in the C API + ------------------------------------------- + +-* The ``PyThreadState.tick_counter`` field has been removed: its value was +- meaningless since Python 3.2 ("new GIL"). ++XXX: None so far + + +-Deprecated features ++Deprecated Features + ------------------- + ++* Running :ref:`idle` with the ``-n`` flag (no subprocess) is deprecated. ++ However, the feature will not be removed until :issue:`18823` is resolved. ++ + * The site module adding a "site-python" directory to sys.path, if it + exists, is deprecated (:issue:`19375`). + + ++Removed ++======= ++ ++The following obsolete and previously deprecated APIs and features have been ++removed in Python 3.4: ++ ++* Support for the following operating systems has been removed from the source ++ and build tools: ++ ++ * OS/2 (:issue:`16135`). ++ * Windows 2000 (changeset e52df05b496a). ++ * VMS (:issue:`16136`). ++ ++* The unmaintained ``Misc/TextMate`` and ``Misc/vim`` directories have been ++ removed (see the `devguide `_ ++ for what to use instead). ++ ++* The ``SO`` makefile macro is removed (it was replaced by the ++ ``SHLIB_SUFFIX`` and ``EXT_SUFFIX`` macros) (:issue:`16754`). ++ ++* The ``PyThreadState.tick_counter`` field has been removed; its value has ++ been meaningless since Python 3.2, when the "new GIL" was introduced. ++ ++* ``PyLoader`` and ``PyPycLoader`` have been removed from :mod:`importlib`. ++ (Contributed by Taras Lyapun in :issue:`15641`.) ++ ++ + Porting to Python 3.4 + ===================== + + This section lists previously described changes and other bugfixes + that may require changes to your code. + ++Changes in the Python API ++------------------------- ++ + * The ABCs defined in :mod:`importlib.abc` now either raise the appropriate + exception or return a default value instead of raising + :exc:`NotImplementedError` blindly. This will only affect code calling +@@ -981,10 +1284,6 @@ + name but an empty list instead. Determing if a module is a package should be + done using ``hasattr(module, '__path__')``. + +-* :c:func:`PyErr_SetImportError` now sets :exc:`TypeError` when its **msg** +- argument is not set. Previously only ``NULL`` was returned with no exception +- set. +- + * :func:`py_compile.compile` now raises :exc:`FileExistsError` if the file path + it would write to is a symlink or a non-regular file. This is to act as a + warning that import will overwrite those files with a regular file regardless +@@ -1009,11 +1308,6 @@ + :func:`inspect.unwrap` to access the first function in the chain that has + no ``__wrapped__`` attribute. + +-* (C API) The result of the :c:data:`PyOS_ReadlineFunctionPointer` callback must +- now be a string allocated by :c:func:`PyMem_RawMalloc` or +- :c:func:`PyMem_RawRealloc`, or *NULL* if an error occurred, instead of a +- string allocated by :c:func:`PyMem_Malloc` or :c:func:`PyMem_Realloc`. +- + * :class:`importlib.machinery.PathFinder` now passes on the current working + directory to objects in :data:`sys.path_hooks` for the empty string. This + results in :data:`sys.path_importer_cache` never containing ``''``, thus +@@ -1022,3 +1316,25 @@ + working directory will also now have an absolute path, including when using + ``-m`` with the interpreter (this does not influence when the path to a file + is specified on the command-line). ++ ++ ++Changes in the C API ++-------------------- ++ ++* :c:func:`PyErr_SetImportError` now sets :exc:`TypeError` when its **msg** ++ argument is not set. Previously only ``NULL`` was returned with no exception ++ set. ++ ++* The result of the :c:data:`PyOS_ReadlineFunctionPointer` callback must ++ now be a string allocated by :c:func:`PyMem_RawMalloc` or ++ :c:func:`PyMem_RawRealloc`, or *NULL* if an error occurred, instead of a ++ string allocated by :c:func:`PyMem_Malloc` or :c:func:`PyMem_Realloc`. ++ ++* :c:func:`PyThread_set_key_value` now always set the value. In Python ++ 3.3, the function did nothing if the key already exists (if the current ++ value is a non-NULL pointer). ++ ++* The ``f_tstate`` (thread state) field of the :c:type:`PyFrameObject` ++ structure has been removed to fix a bug: see :issue:`14432` for the ++ rationale. ++ +diff -r 3405dc9a6afa Include/frameobject.h +--- a/Include/frameobject.h ++++ b/Include/frameobject.h +@@ -39,7 +39,6 @@ + /* Borrowed reference to a generator, or NULL */ + PyObject *f_gen; + +- PyThreadState *f_tstate; + int f_lasti; /* Last instruction if called */ + /* Call PyFrame_GetLineNumber() instead of reading this field + directly. As of 2.3 f_lineno is only valid when tracing is +diff -r 3405dc9a6afa Include/import.h +--- a/Include/import.h ++++ b/Include/import.h +@@ -86,15 +86,15 @@ + + PyAPI_FUNC(void) _PyImport_ReInitLock(void); + +-PyAPI_FUNC(PyObject *)_PyImport_FindBuiltin( ++PyAPI_FUNC(PyObject *) _PyImport_FindBuiltin( + const char *name /* UTF-8 encoded string */ + ); +-PyAPI_FUNC(PyObject *)_PyImport_FindExtensionObject(PyObject *, PyObject *); +-PyAPI_FUNC(int)_PyImport_FixupBuiltin( ++PyAPI_FUNC(PyObject *) _PyImport_FindExtensionObject(PyObject *, PyObject *); ++PyAPI_FUNC(int) _PyImport_FixupBuiltin( + PyObject *mod, + const char *name /* UTF-8 encoded string */ + ); +-PyAPI_FUNC(int)_PyImport_FixupExtensionObject(PyObject*, PyObject *, PyObject *); ++PyAPI_FUNC(int) _PyImport_FixupExtensionObject(PyObject*, PyObject *, PyObject *); + + struct _inittab { + const char *name; /* ASCII encoded string */ +diff -r 3405dc9a6afa Include/longobject.h +--- a/Include/longobject.h ++++ b/Include/longobject.h +@@ -165,6 +165,12 @@ + unsigned char* bytes, size_t n, + int little_endian, int is_signed); + ++/* _PyLong_FromNbInt: Convert the given object to a PyLongObject ++ using the nb_int slot, if available. Raise TypeError if either the ++ nb_int slot is not available or the result of the call to nb_int ++ returns something not of type int. ++*/ ++PyAPI_FUNC(PyLongObject *)_PyLong_FromNbInt(PyObject *); + + /* _PyLong_Format: Convert the long to a string object with given base, + appending a base prefix of 0[box] if base is 2, 8 or 16. */ +diff -r 3405dc9a6afa Include/object.h +--- a/Include/object.h ++++ b/Include/object.h +@@ -829,6 +829,9 @@ + PyAPI_FUNC(void) Py_IncRef(PyObject *); + PyAPI_FUNC(void) Py_DecRef(PyObject *); + ++PyAPI_DATA(PyTypeObject) _PyNone_Type; ++PyAPI_DATA(PyTypeObject) _PyNotImplemented_Type; ++ + /* + _Py_NoneStruct is an object of undefined type which can be used in contexts + where NULL (nil) is not suitable (since NULL often means 'error'). +diff -r 3405dc9a6afa Include/pyerrors.h +--- a/Include/pyerrors.h ++++ b/Include/pyerrors.h +@@ -199,9 +199,6 @@ + #ifdef MS_WINDOWS + PyAPI_DATA(PyObject *) PyExc_WindowsError; + #endif +-#ifdef __VMS +-PyAPI_DATA(PyObject *) PyExc_VMSError; +-#endif + + PyAPI_DATA(PyObject *) PyExc_RecursionErrorInst; + +diff -r 3405dc9a6afa Lib/_compat_pickle.py +--- a/Lib/_compat_pickle.py ++++ b/Lib/_compat_pickle.py +@@ -76,6 +76,62 @@ + ('itertools', 'ifilterfalse'): ('itertools', 'filterfalse'), + } + ++PYTHON2_EXCEPTIONS = ( ++ "ArithmeticError", ++ "AssertionError", ++ "AttributeError", ++ "BaseException", ++ "BufferError", ++ "BytesWarning", ++ "DeprecationWarning", ++ "EOFError", ++ "EnvironmentError", ++ "Exception", ++ "FloatingPointError", ++ "FutureWarning", ++ "GeneratorExit", ++ "IOError", ++ "ImportError", ++ "ImportWarning", ++ "IndentationError", ++ "IndexError", ++ "KeyError", ++ "KeyboardInterrupt", ++ "LookupError", ++ "MemoryError", ++ "NameError", ++ "NotImplementedError", ++ "OSError", ++ "OverflowError", ++ "PendingDeprecationWarning", ++ "ReferenceError", ++ "RuntimeError", ++ "RuntimeWarning", ++ # StandardError is gone in Python 3, so we map it to Exception ++ "StopIteration", ++ "SyntaxError", ++ "SyntaxWarning", ++ "SystemError", ++ "SystemExit", ++ "TabError", ++ "TypeError", ++ "UnboundLocalError", ++ "UnicodeDecodeError", ++ "UnicodeEncodeError", ++ "UnicodeError", ++ "UnicodeTranslateError", ++ "UnicodeWarning", ++ "UserWarning", ++ "ValueError", ++ "Warning", ++ "ZeroDivisionError", ++) ++ ++for excname in PYTHON2_EXCEPTIONS: ++ NAME_MAPPING[("exceptions", excname)] = ("builtins", excname) ++ ++NAME_MAPPING[("exceptions", "StandardError")] = ("builtins", "Exception") ++ + # Same, but for 3.x to 2.x + REVERSE_IMPORT_MAPPING = dict((v, k) for (k, v) in IMPORT_MAPPING.items()) + REVERSE_NAME_MAPPING = dict((v, k) for (k, v) in NAME_MAPPING.items()) +diff -r 3405dc9a6afa Lib/_strptime.py +--- a/Lib/_strptime.py ++++ b/Lib/_strptime.py +@@ -329,7 +329,7 @@ + (bad_directive, format)) from None + # IndexError only occurs when the format string is "%" + except IndexError: +- raise ValueError("stray %% in format '%s'" % format) ++ raise ValueError("stray %% in format '%s'" % format) from None + _regex_cache[format] = format_regex + found = format_regex.match(data_string) + if not found: +diff -r 3405dc9a6afa Lib/_weakrefset.py +--- a/Lib/_weakrefset.py ++++ b/Lib/_weakrefset.py +@@ -60,6 +60,8 @@ + for itemref in self.data: + item = itemref() + if item is not None: ++ # Caveat: the iterator will keep a strong reference to ++ # `item` until it is resumed or closed. + yield item + + def __len__(self): +diff -r 3405dc9a6afa Lib/abc.py +--- a/Lib/abc.py ++++ b/Lib/abc.py +@@ -241,8 +241,8 @@ + def get_cache_token(): + """Returns the current ABC cache token. + +- The token is an opaque integer identifying the current version of +- the ABC cache for virtual subclasses. This number changes with +- every call to ``register()`` on any ABC. ++ The token is an opaque object (supporting equality testing) identifying the ++ current version of the ABC cache for virtual subclasses. The token changes ++ with every call to ``register()`` on any ABC. + """ + return ABCMeta._abc_invalidation_counter +diff -r 3405dc9a6afa Lib/aifc.py +--- a/Lib/aifc.py ++++ b/Lib/aifc.py +@@ -790,7 +790,10 @@ + self._datalength = (self._datalength + 3) // 4 + if self._datalength & 1: + self._datalength = self._datalength + 1 +- self._form_length_pos = self._file.tell() ++ try: ++ self._form_length_pos = self._file.tell() ++ except (AttributeError, OSError): ++ self._form_length_pos = None + commlength = self._write_form_length(self._datalength) + if self._aifc: + self._file.write(b'AIFC') +@@ -802,7 +805,8 @@ + self._file.write(b'COMM') + _write_ulong(self._file, commlength) + _write_short(self._file, self._nchannels) +- self._nframes_pos = self._file.tell() ++ if self._form_length_pos is not None: ++ self._nframes_pos = self._file.tell() + _write_ulong(self._file, self._nframes) + if self._comptype in (b'ULAW', b'ulaw', b'ALAW', b'alaw', b'G722'): + _write_short(self._file, 8) +@@ -813,7 +817,8 @@ + self._file.write(self._comptype) + _write_string(self._file, self._compname) + self._file.write(b'SSND') +- self._ssnd_length_pos = self._file.tell() ++ if self._form_length_pos is not None: ++ self._ssnd_length_pos = self._file.tell() + _write_ulong(self._file, self._datalength + 8) + _write_ulong(self._file, 0) + _write_ulong(self._file, 0) +diff -r 3405dc9a6afa Lib/asyncio/base_events.py +--- a/Lib/asyncio/base_events.py ++++ b/Lib/asyncio/base_events.py +@@ -613,7 +613,7 @@ + t0 = self.time() + event_list = self._selector.select(timeout) + t1 = self.time() +- argstr = '' if timeout is None else '{:.3f}'.format(timeout) ++ argstr = '' if timeout is None else ' {:.3f}'.format(timeout) + if t1-t0 >= 1: + level = logging.INFO + else: +diff -r 3405dc9a6afa Lib/asyncio/events.py +--- a/Lib/asyncio/events.py ++++ b/Lib/asyncio/events.py +@@ -99,7 +99,7 @@ + + + class AbstractServer: +- """Abstract server returned by create_service().""" ++ """Abstract server returned by create_server().""" + + def close(self): + """Stop serving. This leaves existing connections open.""" +@@ -234,7 +234,7 @@ + protocol_factory should instantiate object with Protocol interface. + pipe is file-like object already switched to nonblocking. + Return pair (transport, protocol), where transport support +- ReadTransport ABC""" ++ ReadTransport interface.""" + # The reason to accept file-like object instead of just file descriptor + # is: we need to own pipe and close it at transport finishing + # Can got complicated errors if pass f.fileno(), +@@ -247,7 +247,7 @@ + protocol_factory should instantiate object with BaseProtocol interface. + Pipe is file-like object already switched to nonblocking. + Return pair (transport, protocol), where transport support +- WriteTransport ABC""" ++ WriteTransport interface.""" + # The reason to accept file-like object instead of just file descriptor + # is: we need to own pipe and close it at transport finishing + # Can got complicated errors if pass f.fileno(), +@@ -360,7 +360,7 @@ + if (self._local._loop is None and + not self._local._set_called and + isinstance(threading.current_thread(), threading._MainThread)): +- self._local._loop = self.new_event_loop() ++ self.set_event_loop(self.new_event_loop()) + assert self._local._loop is not None, \ + ('There is no current event loop in thread %r.' % + threading.current_thread().name) +diff -r 3405dc9a6afa Lib/asyncio/futures.py +--- a/Lib/asyncio/futures.py ++++ b/Lib/asyncio/futures.py +@@ -7,6 +7,7 @@ + + import concurrent.futures._base + import logging ++import sys + import traceback + + from . import events +@@ -17,6 +18,8 @@ + _CANCELLED = 'CANCELLED' + _FINISHED = 'FINISHED' + ++_PY34 = sys.version_info >= (3, 4) ++ + # TODO: Do we really want to depend on concurrent.futures internals? + Error = concurrent.futures._base.Error + CancelledError = concurrent.futures.CancelledError +@@ -128,7 +131,8 @@ + + _blocking = False # proper use of future (yield vs yield from) + +- _tb_logger = None ++ _log_traceback = False # Used for Python 3.4 and later ++ _tb_logger = None # Used for Python 3.3 only + + def __init__(self, *, loop=None): + """Initialize the future. +@@ -162,6 +166,16 @@ + res += '<{}>'.format(self._state) + return res + ++ if _PY34: ++ def __del__(self): ++ if not self._log_traceback: ++ # set_exception() was not called, or result() or exception() ++ # has consumed the exception ++ return ++ exc = self._exception ++ logger.error('Future/Task exception was never retrieved:', ++ exc_info=(exc.__class__, exc, exc.__traceback__)) ++ + def cancel(self): + """Cancel the future and schedule callbacks. + +@@ -214,6 +228,7 @@ + raise CancelledError + if self._state != _FINISHED: + raise InvalidStateError('Result is not ready.') ++ self._log_traceback = False + if self._tb_logger is not None: + self._tb_logger.clear() + self._tb_logger = None +@@ -233,6 +248,7 @@ + raise CancelledError + if self._state != _FINISHED: + raise InvalidStateError('Exception is not set.') ++ self._log_traceback = False + if self._tb_logger is not None: + self._tb_logger.clear() + self._tb_logger = None +@@ -286,12 +302,15 @@ + if self._state != _PENDING: + raise InvalidStateError('{}: {!r}'.format(self._state, self)) + self._exception = exception +- self._tb_logger = _TracebackLogger(exception) + self._state = _FINISHED + self._schedule_callbacks() +- # Arrange for the logger to be activated after all callbacks +- # have had a chance to call result() or exception(). +- self._loop.call_soon(self._tb_logger.activate) ++ if _PY34: ++ self._log_traceback = True ++ else: ++ self._tb_logger = _TracebackLogger(exception) ++ # Arrange for the logger to be activated after all callbacks ++ # have had a chance to call result() or exception(). ++ self._loop.call_soon(self._tb_logger.activate) + + # Truly internal methods. + +diff -r 3405dc9a6afa Lib/asyncio/locks.py +--- a/Lib/asyncio/locks.py ++++ b/Lib/asyncio/locks.py +@@ -1,6 +1,6 @@ + """Synchronization primitives.""" + +-__all__ = ['Lock', 'Event', 'Condition', 'Semaphore'] ++__all__ = ['Lock', 'Event', 'Condition', 'Semaphore', 'BoundedSemaphore'] + + import collections + +@@ -79,7 +79,7 @@ + return '<{} [{}]>'.format(res[1:-1], extra) + + def locked(self): +- """Return true if lock is acquired.""" ++ """Return True if lock is acquired.""" + return self._locked + + @tasks.coroutine +@@ -138,7 +138,7 @@ + + + class Event: +- """An Event implementation, our equivalent to threading.Event. ++ """Asynchronous equivalent to threading.Event. + + Class implementing event objects. An event manages a flag that can be set + to true with the set() method and reset to false with the clear() method. +@@ -162,7 +162,7 @@ + return '<{} [{}]>'.format(res[1:-1], extra) + + def is_set(self): +- """Return true if and only if the internal flag is true.""" ++ """Return True if and only if the internal flag is true.""" + return self._value + + def set(self): +@@ -204,7 +204,7 @@ + + + class Condition: +- """A Condition implementation, our equivalent to threading.Condition. ++ """Asynchronous equivalent to threading.Condition. + + This class implements condition variable objects. A condition variable + allows one or more coroutines to wait until they are notified by another +diff -r 3405dc9a6afa Lib/asyncio/proactor_events.py +--- a/Lib/asyncio/proactor_events.py ++++ b/Lib/asyncio/proactor_events.py +@@ -24,12 +24,14 @@ + self._sock = sock + self._protocol = protocol + self._server = server +- self._buffer = [] ++ self._buffer = None # None or bytearray. + self._read_fut = None + self._write_fut = None + self._conn_lost = 0 + self._closing = False # Set when close() called. + self._eof_written = False ++ self._protocol_paused = False ++ self.set_write_buffer_limits() + if self._server is not None: + self._server.attach(self) + self._loop.call_soon(self._protocol.connection_made, self) +@@ -63,7 +65,7 @@ + if self._read_fut: + self._read_fut.cancel() + self._write_fut = self._read_fut = None +- self._buffer = [] ++ self._buffer = None + self._loop.call_soon(self._call_connection_lost, exc) + + def _call_connection_lost(self, exc): +@@ -82,6 +84,53 @@ + server.detach(self) + self._server = None + ++ # XXX The next four methods are nearly identical to corresponding ++ # ones in _SelectorTransport. Maybe refactor buffer management to ++ # share the implementations? (Also these are really only needed ++ # by _ProactorWritePipeTransport but since _buffer is defined on ++ # the base class I am putting it here for now.) ++ ++ def _maybe_pause_protocol(self): ++ size = self.get_write_buffer_size() ++ if size <= self._high_water: ++ return ++ if not self._protocol_paused: ++ self._protocol_paused = True ++ try: ++ self._protocol.pause_writing() ++ except Exception: ++ logger.exception('pause_writing() failed') ++ ++ def _maybe_resume_protocol(self): ++ if (self._protocol_paused and ++ self.get_write_buffer_size() <= self._low_water): ++ self._protocol_paused = False ++ try: ++ self._protocol.resume_writing() ++ except Exception: ++ logger.exception('resume_writing() failed') ++ ++ def set_write_buffer_limits(self, high=None, low=None): ++ if high is None: ++ if low is None: ++ high = 64*1024 ++ else: ++ high = 4*low ++ if low is None: ++ low = high // 4 ++ if not high >= low >= 0: ++ raise ValueError('high (%r) must be >= low (%r) must be >= 0' % ++ (high, low)) ++ self._high_water = high ++ self._low_water = low ++ ++ def get_write_buffer_size(self): ++ # NOTE: This doesn't take into account data already passed to ++ # send() even if send() hasn't finished yet. ++ if not self._buffer: ++ return 0 ++ return len(self._buffer) ++ + + class _ProactorReadPipeTransport(_ProactorBasePipeTransport, + transports.ReadTransport): +@@ -95,12 +144,15 @@ + self._loop.call_soon(self._loop_reading) + + def pause_reading(self): +- assert not self._closing, 'Cannot pause_reading() when closing' +- assert not self._paused, 'Already paused' ++ if self._closing: ++ raise RuntimeError('Cannot pause_reading() when closing') ++ if self._paused: ++ raise RuntimeError('Already paused') + self._paused = True + + def resume_reading(self): +- assert self._paused, 'Not paused' ++ if not self._paused: ++ raise RuntimeError('Not paused') + self._paused = False + if self._closing: + return +@@ -155,9 +207,11 @@ + """Transport for write pipes.""" + + def write(self, data): +- assert isinstance(data, bytes), repr(data) ++ if not isinstance(data, (bytes, bytearray, memoryview)): ++ raise TypeError('data argument must be byte-ish (%r)', ++ type(data)) + if self._eof_written: +- raise IOError('write_eof() already called') ++ raise RuntimeError('write_eof() already called') + + if not data: + return +@@ -167,26 +221,53 @@ + logger.warning('socket.send() raised exception.') + self._conn_lost += 1 + return +- self._buffer.append(data) +- if self._write_fut is None: +- self._loop_writing() + +- def _loop_writing(self, f=None): ++ # Observable states: ++ # 1. IDLE: _write_fut and _buffer both None ++ # 2. WRITING: _write_fut set; _buffer None ++ # 3. BACKED UP: _write_fut set; _buffer a bytearray ++ # We always copy the data, so the caller can't modify it ++ # while we're still waiting for the I/O to happen. ++ if self._write_fut is None: # IDLE -> WRITING ++ assert self._buffer is None ++ # Pass a copy, except if it's already immutable. ++ self._loop_writing(data=bytes(data)) ++ # XXX Should we pause the protocol at this point ++ # if len(data) > self._high_water? (That would ++ # require keeping track of the number of bytes passed ++ # to a send() that hasn't finished yet.) ++ elif not self._buffer: # WRITING -> BACKED UP ++ # Make a mutable copy which we can extend. ++ self._buffer = bytearray(data) ++ self._maybe_pause_protocol() ++ else: # BACKED UP ++ # Append to buffer (also copies). ++ self._buffer.extend(data) ++ self._maybe_pause_protocol() ++ ++ def _loop_writing(self, f=None, data=None): + try: + assert f is self._write_fut + self._write_fut = None + if f: + f.result() +- data = b''.join(self._buffer) +- self._buffer = [] ++ if data is None: ++ data = self._buffer ++ self._buffer = None + if not data: + if self._closing: + self._loop.call_soon(self._call_connection_lost, None) + if self._eof_written: + self._sock.shutdown(socket.SHUT_WR) +- return +- self._write_fut = self._loop._proactor.send(self._sock, data) +- self._write_fut.add_done_callback(self._loop_writing) ++ else: ++ self._write_fut = self._loop._proactor.send(self._sock, data) ++ self._write_fut.add_done_callback(self._loop_writing) ++ # Now that we've reduced the buffer size, tell the ++ # protocol to resume writing if it was paused. Note that ++ # we do this last since the callback is called immediately ++ # and it may add more data to the buffer (even causing the ++ # protocol to be paused again). ++ self._maybe_resume_protocol() + except ConnectionResetError as exc: + self._force_close(exc) + except OSError as exc: +@@ -330,7 +411,8 @@ + self._csock.send(b'x') + + def _start_serving(self, protocol_factory, sock, ssl=None, server=None): +- assert not ssl, 'IocpEventLoop is incompatible with SSL.' ++ if ssl: ++ raise ValueError('IocpEventLoop is incompatible with SSL.') + + def loop(f=None): + try: +diff -r 3405dc9a6afa Lib/asyncio/protocols.py +--- a/Lib/asyncio/protocols.py ++++ b/Lib/asyncio/protocols.py +@@ -1,10 +1,11 @@ + """Abstract Protocol class.""" + +-__all__ = ['Protocol', 'DatagramProtocol'] ++__all__ = ['BaseProtocol', 'Protocol', 'DatagramProtocol', ++ 'SubprocessProtocol'] + + + class BaseProtocol: +- """ABC for base protocol class. ++ """Common base class for protocol interfaces. + + Usually user implements protocols that derived from BaseProtocol + like Protocol or ProcessProtocol. +@@ -59,7 +60,7 @@ + + + class Protocol(BaseProtocol): +- """ABC representing a protocol. ++ """Interface for stream protocol. + + The user should implement this interface. They can inherit from + this class but don't need to. The implementations here do +@@ -95,7 +96,7 @@ + + + class DatagramProtocol(BaseProtocol): +- """ABC representing a datagram protocol.""" ++ """Interface for datagram protocol.""" + + def datagram_received(self, data, addr): + """Called when some datagram is received.""" +@@ -108,7 +109,7 @@ + + + class SubprocessProtocol(BaseProtocol): +- """ABC representing a protocol for subprocess calls.""" ++ """Interface for protocol for subprocess calls.""" + + def pipe_data_received(self, fd, data): + """Called when the subprocess writes data into stdout/stderr pipe. +diff -r 3405dc9a6afa Lib/asyncio/queues.py +--- a/Lib/asyncio/queues.py ++++ b/Lib/asyncio/queues.py +@@ -26,7 +26,7 @@ + queue reaches maxsize, until an item is removed by get(). + + Unlike the standard library Queue, you can reliably know this Queue's size +- with qsize(), since your single-threaded Tulip application won't be ++ with qsize(), since your single-threaded asyncio application won't be + interrupted between calling qsize() and doing an operation on the Queue. + """ + +@@ -184,7 +184,7 @@ + def get_nowait(self): + """Remove and return an item from the queue. + +- Return an item if one is immediately available, else raise Full. ++ Return an item if one is immediately available, else raise Empty. + """ + self._consume_done_putters() + if self._putters: +diff -r 3405dc9a6afa Lib/asyncio/selector_events.py +--- a/Lib/asyncio/selector_events.py ++++ b/Lib/asyncio/selector_events.py +@@ -340,6 +340,8 @@ + + max_size = 256 * 1024 # Buffer size passed to recv(). + ++ _buffer_factory = bytearray # Constructs initial value for self._buffer. ++ + def __init__(self, loop, sock, protocol, extra, server=None): + super().__init__(extra) + self._extra['socket'] = sock +@@ -354,7 +356,7 @@ + self._sock_fd = sock.fileno() + self._protocol = protocol + self._server = server +- self._buffer = collections.deque() ++ self._buffer = self._buffer_factory() + self._conn_lost = 0 # Set when call to connection_lost scheduled. + self._closing = False # Set when close() called. + self._protocol_paused = False +@@ -433,12 +435,14 @@ + high = 4*low + if low is None: + low = high // 4 +- assert 0 <= low <= high, repr((low, high)) ++ if not high >= low >= 0: ++ raise ValueError('high (%r) must be >= low (%r) must be >= 0' % ++ (high, low)) + self._high_water = high + self._low_water = low + + def get_write_buffer_size(self): +- return sum(len(data) for data in self._buffer) ++ return len(self._buffer) + + + class _SelectorSocketTransport(_SelectorTransport): +@@ -455,13 +459,16 @@ + self._loop.call_soon(waiter.set_result, None) + + def pause_reading(self): +- assert not self._closing, 'Cannot pause_reading() when closing' +- assert not self._paused, 'Already paused' ++ if self._closing: ++ raise RuntimeError('Cannot pause_reading() when closing') ++ if self._paused: ++ raise RuntimeError('Already paused') + self._paused = True + self._loop.remove_reader(self._sock_fd) + + def resume_reading(self): +- assert self._paused, 'Not paused' ++ if not self._paused: ++ raise RuntimeError('Not paused') + self._paused = False + if self._closing: + return +@@ -488,8 +495,11 @@ + self.close() + + def write(self, data): +- assert isinstance(data, bytes), repr(type(data)) +- assert not self._eof, 'Cannot call write() after write_eof()' ++ if not isinstance(data, (bytes, bytearray, memoryview)): ++ raise TypeError('data argument must be byte-ish (%r)', ++ type(data)) ++ if self._eof: ++ raise RuntimeError('Cannot call write() after write_eof()') + if not data: + return + +@@ -516,25 +526,23 @@ + self._loop.add_writer(self._sock_fd, self._write_ready) + + # Add it to the buffer. +- self._buffer.append(data) ++ self._buffer.extend(data) + self._maybe_pause_protocol() + + def _write_ready(self): +- data = b''.join(self._buffer) +- assert data, 'Data should not be empty' ++ assert self._buffer, 'Data should not be empty' + +- self._buffer.clear() # Optimistically; may have to put it back later. + try: +- n = self._sock.send(data) ++ n = self._sock.send(self._buffer) + except (BlockingIOError, InterruptedError): +- self._buffer.append(data) # Still need to write this. ++ pass + except Exception as exc: + self._loop.remove_writer(self._sock_fd) ++ self._buffer.clear() + self._fatal_error(exc) + else: +- data = data[n:] +- if data: +- self._buffer.append(data) # Still need to write this. ++ if n: ++ del self._buffer[:n] + self._maybe_resume_protocol() # May append to buffer. + if not self._buffer: + self._loop.remove_writer(self._sock_fd) +@@ -556,6 +564,8 @@ + + class _SelectorSslTransport(_SelectorTransport): + ++ _buffer_factory = bytearray ++ + def __init__(self, loop, rawsock, protocol, sslcontext, waiter=None, + server_side=False, server_hostname=None, + extra=None, server=None): +@@ -573,7 +583,8 @@ + # cadefault=True. + if hasattr(ssl, '_create_stdlib_context'): + sslcontext = ssl._create_stdlib_context( +- cert_reqs=ssl.CERT_REQUIRED) ++ cert_reqs=ssl.CERT_REQUIRED, ++ check_hostname=bool(server_hostname)) + else: + # Fallback for Python 3.3. + sslcontext = ssl.SSLContext(ssl.PROTOCOL_SSLv23) +@@ -629,17 +640,19 @@ + self._loop.remove_reader(self._sock_fd) + self._loop.remove_writer(self._sock_fd) + +- # Verify hostname if requested. + peercert = self._sock.getpeercert() +- if (self._server_hostname and +- self._sslcontext.verify_mode != ssl.CERT_NONE): +- try: +- ssl.match_hostname(peercert, self._server_hostname) +- except Exception as exc: +- self._sock.close() +- if self._waiter is not None: +- self._waiter.set_exception(exc) +- return ++ if not hasattr(self._sslcontext, 'check_hostname'): ++ # Verify hostname if requested, Python 3.4+ uses check_hostname ++ # and checks the hostname in do_handshake() ++ if (self._server_hostname and ++ self._sslcontext.verify_mode != ssl.CERT_NONE): ++ try: ++ ssl.match_hostname(peercert, self._server_hostname) ++ except Exception as exc: ++ self._sock.close() ++ if self._waiter is not None: ++ self._waiter.set_exception(exc) ++ return + + # Add extra info that becomes available after handshake. + self._extra.update(peercert=peercert, +@@ -661,13 +674,16 @@ + # accept more data for the buffer and eventually the app will + # call resume_reading() again, and things will flow again. + +- assert not self._closing, 'Cannot pause_reading() when closing' +- assert not self._paused, 'Already paused' ++ if self._closing: ++ raise RuntimeError('Cannot pause_reading() when closing') ++ if self._paused: ++ raise RuntimeError('Already paused') + self._paused = True + self._loop.remove_reader(self._sock_fd) + + def resume_reading(self): +- assert self._paused, 'Not paused' ++ if not self._paused: ++ raise ('Not paused') + self._paused = False + if self._closing: + return +@@ -712,10 +728,8 @@ + self._loop.add_reader(self._sock_fd, self._read_ready) + + if self._buffer: +- data = b''.join(self._buffer) +- self._buffer.clear() + try: +- n = self._sock.send(data) ++ n = self._sock.send(self._buffer) + except (BlockingIOError, InterruptedError, + ssl.SSLWantWriteError): + n = 0 +@@ -725,11 +739,12 @@ + self._write_wants_read = True + except Exception as exc: + self._loop.remove_writer(self._sock_fd) ++ self._buffer.clear() + self._fatal_error(exc) + return + +- if n < len(data): +- self._buffer.append(data[n:]) ++ if n: ++ del self._buffer[:n] + + self._maybe_resume_protocol() # May append to buffer. + +@@ -739,7 +754,9 @@ + self._call_connection_lost(None) + + def write(self, data): +- assert isinstance(data, bytes), repr(type(data)) ++ if not isinstance(data, (bytes, bytearray, memoryview)): ++ raise TypeError('data argument must be byte-ish (%r)', ++ type(data)) + if not data: + return + +@@ -753,7 +770,7 @@ + self._loop.add_writer(self._sock_fd, self._write_ready) + + # Add it to the buffer. +- self._buffer.append(data) ++ self._buffer.extend(data) + self._maybe_pause_protocol() + + def can_write_eof(self): +@@ -762,6 +779,8 @@ + + class _SelectorDatagramTransport(_SelectorTransport): + ++ _buffer_factory = collections.deque ++ + def __init__(self, loop, sock, protocol, address=None, extra=None): + super().__init__(loop, sock, protocol, extra) + self._address = address +@@ -784,12 +803,15 @@ + self._protocol.datagram_received(data, addr) + + def sendto(self, data, addr=None): +- assert isinstance(data, bytes), repr(type(data)) ++ if not isinstance(data, (bytes, bytearray, memoryview)): ++ raise TypeError('data argument must be byte-ish (%r)', ++ type(data)) + if not data: + return + +- if self._address: +- assert addr in (None, self._address) ++ if self._address and addr not in (None, self._address): ++ raise ValueError('Invalid address: must be None or %s' % ++ (self._address,)) + + if self._conn_lost and self._address: + if self._conn_lost >= constants.LOG_THRESHOLD_FOR_CONNLOST_WRITES: +@@ -814,7 +836,8 @@ + self._fatal_error(exc) + return + +- self._buffer.append((data, addr)) ++ # Ensure that what we buffer is immutable. ++ self._buffer.append((bytes(data), addr)) + self._maybe_pause_protocol() + + def _sendto_ready(self): +diff -r 3405dc9a6afa Lib/asyncio/streams.py +--- a/Lib/asyncio/streams.py ++++ b/Lib/asyncio/streams.py +@@ -1,6 +1,6 @@ + """Stream-related things.""" + +-__all__ = ['StreamReader', 'StreamReaderProtocol', ++__all__ = ['StreamReader', 'StreamWriter', 'StreamReaderProtocol', + 'open_connection', 'start_server', + ] + +diff -r 3405dc9a6afa Lib/asyncio/tasks.py +--- a/Lib/asyncio/tasks.py ++++ b/Lib/asyncio/tasks.py +@@ -1,9 +1,10 @@ + """Support for tasks, coroutines and the scheduler.""" + + __all__ = ['coroutine', 'Task', ++ 'iscoroutinefunction', 'iscoroutine', + 'FIRST_COMPLETED', 'FIRST_EXCEPTION', 'ALL_COMPLETED', + 'wait', 'wait_for', 'as_completed', 'sleep', 'async', +- 'gather', ++ 'gather', 'shield', + ] + + import collections +@@ -122,6 +123,22 @@ + # Weak set containing all tasks alive. + _all_tasks = weakref.WeakSet() + ++ # Dictionary containing tasks that are currently active in ++ # all running event loops. {EventLoop: Task} ++ _current_tasks = {} ++ ++ @classmethod ++ def current_task(cls, loop=None): ++ """Return the currently running task in an event loop or None. ++ ++ By default the current task for the current event loop is returned. ++ ++ None is returned when called not in the context of a Task. ++ """ ++ if loop is None: ++ loop = events.get_event_loop() ++ return cls._current_tasks.get(loop) ++ + @classmethod + def all_tasks(cls, loop=None): + """Return a set of all tasks for an event loop. +@@ -252,6 +269,8 @@ + self._must_cancel = False + coro = self._coro + self._fut_waiter = None ++ ++ self.__class__._current_tasks[self._loop] = self + # Call either coro.throw(exc) or coro.send(value). + try: + if exc is not None: +@@ -302,6 +321,8 @@ + self._step, None, + RuntimeError( + 'Task got bad yield: {!r}'.format(result))) ++ finally: ++ self.__class__._current_tasks.pop(self._loop) + self = None + + def _wakeup(self, future): +diff -r 3405dc9a6afa Lib/asyncio/test_utils.py +--- a/Lib/asyncio/test_utils.py ++++ b/Lib/asyncio/test_utils.py +@@ -3,7 +3,6 @@ + import collections + import contextlib + import io +-import unittest.mock + import os + import sys + import threading +@@ -88,15 +87,15 @@ + class SSLWSGIServer(SilentWSGIServer): + def finish_request(self, request, client_address): + # The relative location of our test directory (which +- # contains the sample key and certificate files) differs +- # between the stdlib and stand-alone Tulip/asyncio. ++ # contains the ssl key and certificate files) differs ++ # between the stdlib and stand-alone asyncio. + # Prefer our own if we can find it. + here = os.path.join(os.path.dirname(__file__), '..', 'tests') + if not os.path.isdir(here): + here = os.path.join(os.path.dirname(os.__file__), + 'test', 'test_asyncio') +- keyfile = os.path.join(here, 'sample.key') +- certfile = os.path.join(here, 'sample.crt') ++ keyfile = os.path.join(here, 'ssl_key.pem') ++ certfile = os.path.join(here, 'ssl_cert.pem') + ssock = ssl.wrap_socket(request, + keyfile=keyfile, + certfile=certfile, +@@ -142,9 +141,23 @@ + + class TestSelector(selectors.BaseSelector): + ++ def __init__(self): ++ self.keys = {} ++ ++ def register(self, fileobj, events, data=None): ++ key = selectors.SelectorKey(fileobj, 0, events, data) ++ self.keys[fileobj] = key ++ return key ++ ++ def unregister(self, fileobj): ++ return self.keys.pop(fileobj) ++ + def select(self, timeout): + return [] + ++ def get_map(self): ++ return self.keys ++ + + class TestLoop(base_events.BaseEventLoop): + """Loop for unittests. +diff -r 3405dc9a6afa Lib/asyncio/transports.py +--- a/Lib/asyncio/transports.py ++++ b/Lib/asyncio/transports.py +@@ -1,10 +1,16 @@ + """Abstract Transport class.""" + +-__all__ = ['ReadTransport', 'WriteTransport', 'Transport'] ++import sys ++ ++PY34 = sys.version_info >= (3, 4) ++ ++__all__ = ['BaseTransport', 'ReadTransport', 'WriteTransport', ++ 'Transport', 'DatagramTransport', 'SubprocessTransport', ++ ] + + + class BaseTransport: +- """Base ABC for transports.""" ++ """Base class for transports.""" + + def __init__(self, extra=None): + if extra is None: +@@ -27,7 +33,7 @@ + + + class ReadTransport(BaseTransport): +- """ABC for read-only transports.""" ++ """Interface for read-only transports.""" + + def pause_reading(self): + """Pause the receiving end. +@@ -47,7 +53,7 @@ + + + class WriteTransport(BaseTransport): +- """ABC for write-only transports.""" ++ """Interface for write-only transports.""" + + def set_write_buffer_limits(self, high=None, low=None): + """Set the high- and low-water limits for write flow control. +@@ -85,11 +91,15 @@ + def writelines(self, list_of_data): + """Write a list (or any iterable) of data bytes to the transport. + +- The default implementation just calls write() for each item in +- the list/iterable. ++ The default implementation concatenates the arguments and ++ calls write() on the result. + """ +- for data in list_of_data: +- self.write(data) ++ if not PY34: ++ # In Python 3.3, bytes.join() doesn't handle memoryview. ++ list_of_data = ( ++ bytes(data) if isinstance(data, memoryview) else data ++ for data in list_of_data) ++ self.write(b''.join(list_of_data)) + + def write_eof(self): + """Close the write end after flushing buffered data. +@@ -115,7 +125,7 @@ + + + class Transport(ReadTransport, WriteTransport): +- """ABC representing a bidirectional transport. ++ """Interface representing a bidirectional transport. + + There may be several implementations, but typically, the user does + not implement new transports; rather, the platform provides some +@@ -137,7 +147,7 @@ + + + class DatagramTransport(BaseTransport): +- """ABC for datagram (UDP) transports.""" ++ """Interface for datagram (UDP) transports.""" + + def sendto(self, data, addr=None): + """Send data to the transport. +diff -r 3405dc9a6afa Lib/asyncio/unix_events.py +--- a/Lib/asyncio/unix_events.py ++++ b/Lib/asyncio/unix_events.py +@@ -74,6 +74,8 @@ + + try: + signal.signal(sig, self._handle_signal) ++ # Set SA_RESTART to limit EINTR occurrences. ++ signal.siginterrupt(sig, False) + except OSError as exc: + del self._signal_handlers[sig] + if not self._signal_handlers: +diff -r 3405dc9a6afa Lib/asyncio/windows_events.py +--- a/Lib/asyncio/windows_events.py ++++ b/Lib/asyncio/windows_events.py +@@ -327,14 +327,21 @@ + handle, self._iocp, ov.address, ms) + f = _WaitHandleFuture(wh, loop=self._loop) + +- def finish(timed_out, _, ov): ++ def finish(trans, key, ov): + if not f.cancelled(): + try: + _overlapped.UnregisterWait(wh) + except OSError as e: + if e.winerror != _overlapped.ERROR_IO_PENDING: + raise +- return not timed_out ++ # Note that this second wait means that we should only use ++ # this with handles types where a successful wait has no ++ # effect. So events or processes are all right, but locks ++ # or semaphores are not. Also note if the handle is ++ # signalled and then quickly reset, then we may return ++ # False even though we have not timed out. ++ return (_winapi.WaitForSingleObject(handle, 0) == ++ _winapi.WAIT_OBJECT_0) + + self._cache[ov.address] = (f, ov, None, finish) + return f +diff -r 3405dc9a6afa Lib/bz2.py +--- a/Lib/bz2.py ++++ b/Lib/bz2.py +@@ -207,8 +207,15 @@ + if self._decompressor.eof: + # Continue to next stream. + self._decompressor = BZ2Decompressor() +- +- self._buffer = self._decompressor.decompress(rawblock) ++ try: ++ self._buffer = self._decompressor.decompress(rawblock) ++ except OSError: ++ # Trailing data isn't a valid bzip2 stream. We're done here. ++ self._mode = _MODE_READ_EOF ++ self._size = self._pos ++ return False ++ else: ++ self._buffer = self._decompressor.decompress(rawblock) + self._buffer_offset = 0 + return True + +@@ -496,17 +503,19 @@ + + For incremental decompression, use a BZ2Decompressor object instead. + """ +- if len(data) == 0: +- return b"" +- + results = [] +- while True: ++ while data: + decomp = BZ2Decompressor() +- results.append(decomp.decompress(data)) ++ try: ++ res = decomp.decompress(data) ++ except OSError: ++ if results: ++ break # Leftover data is not a valid bzip2 stream; ignore it. ++ else: ++ raise # Error on the first iteration; bail out. ++ results.append(res) + if not decomp.eof: + raise ValueError("Compressed data ended before the " + "end-of-stream marker was reached") +- if not decomp.unused_data: +- return b"".join(results) +- # There is unused data left over. Proceed to next stream. + data = decomp.unused_data ++ return b"".join(results) +diff -r 3405dc9a6afa Lib/compileall.py +--- a/Lib/compileall.py ++++ b/Lib/compileall.py +@@ -229,7 +229,8 @@ + success = False + return success + else: +- return compile_path(legacy=args.legacy) ++ return compile_path(legacy=args.legacy, force=args.force, ++ quiet=args.quiet) + except KeyboardInterrupt: + print("\n[interrupted]") + return False +diff -r 3405dc9a6afa Lib/copy.py +--- a/Lib/copy.py ++++ b/Lib/copy.py +@@ -76,6 +76,14 @@ + if copier: + return copier(x) + ++ try: ++ issc = issubclass(cls, type) ++ except TypeError: # cls is not a class ++ issc = False ++ if issc: ++ # treat it as a regular class: ++ return _copy_immutable(x) ++ + copier = getattr(cls, "__copy__", None) + if copier: + return copier(x) +diff -r 3405dc9a6afa Lib/decimal.py +--- a/Lib/decimal.py ++++ b/Lib/decimal.py +@@ -140,6 +140,7 @@ + + __version__ = '1.70' # Highest version of the spec this complies with + # See http://speleotrove.com/decimal/ ++__libmpdec_version__ = "2.4.0" # compatible libmpdec version + + import copy as _copy + import math as _math +diff -r 3405dc9a6afa Lib/distutils/command/build_ext.py +--- a/Lib/distutils/command/build_ext.py ++++ b/Lib/distutils/command/build_ext.py +@@ -538,7 +538,7 @@ + library_dirs=ext.library_dirs, + runtime_library_dirs=ext.runtime_library_dirs, + extra_postargs=extra_args, +- export_symbols=self.get_export_symbols(ext), ++ export_symbols=ext.export_symbols, + debug=self.debug, + build_temp=self.build_temp, + target_lang=language) +diff -r 3405dc9a6afa Lib/distutils/command/register.py +--- a/Lib/distutils/command/register.py ++++ b/Lib/distutils/command/register.py +@@ -87,7 +87,7 @@ + ''' + url = self.repository+'?:action=list_classifiers' + response = urllib.request.urlopen(url) +- log.info(response.read()) ++ log.info(self._read_pypi_response(response)) + + def verify_metadata(self): + ''' Send the metadata to the package index server to be checked. +diff -r 3405dc9a6afa Lib/distutils/command/upload.py +--- a/Lib/distutils/command/upload.py ++++ b/Lib/distutils/command/upload.py +@@ -196,5 +196,6 @@ + self.announce('Upload failed (%s): %s' % (status, reason), + log.ERROR) + if self.show_response: +- msg = '\n'.join(('-' * 75, result.read(), '-' * 75)) ++ text = self._read_pypi_response(result) ++ msg = '\n'.join(('-' * 75, text, '-' * 75)) + self.announce(msg, log.INFO) +diff -r 3405dc9a6afa Lib/distutils/config.py +--- a/Lib/distutils/config.py ++++ b/Lib/distutils/config.py +@@ -110,6 +110,13 @@ + + return {} + ++ def _read_pypi_response(self, response): ++ """Read and decode a PyPI HTTP response.""" ++ import cgi ++ content_type = response.getheader('content-type', 'text/plain') ++ encoding = cgi.parse_header(content_type)[1].get('charset', 'ascii') ++ return response.read().decode(encoding) ++ + def initialize_options(self): + """Initialize options.""" + self.repository = None +diff -r 3405dc9a6afa Lib/distutils/sysconfig.py +--- a/Lib/distutils/sysconfig.py ++++ b/Lib/distutils/sysconfig.py +@@ -575,5 +575,5 @@ + """ + if name == 'SO': + import warnings +- warnings.warn('SO is deprecated, use EXT_SUFFIX', DeprecationWarning) ++ warnings.warn('SO is deprecated, use EXT_SUFFIX', DeprecationWarning, 2) + return get_config_vars().get(name) +diff -r 3405dc9a6afa Lib/distutils/tests/support.py +--- a/Lib/distutils/tests/support.py ++++ b/Lib/distutils/tests/support.py +@@ -32,14 +32,15 @@ + def _log(self, level, msg, args): + if level not in (DEBUG, INFO, WARN, ERROR, FATAL): + raise ValueError('%s wrong log level' % str(level)) ++ if not isinstance(msg, str): ++ raise TypeError("msg should be str, not '%.200s'" ++ % (type(msg).__name__)) + self.logs.append((level, msg, args)) + + def get_logs(self, *levels): + def _format(msg, args): +- if len(args) == 0: +- return msg + return msg % args +- return [_format(msg, args) for level, msg, args ++ return [msg % args for level, msg, args + in self.logs if level in levels] + + def clear_logs(self): +diff -r 3405dc9a6afa Lib/distutils/tests/test_archive_util.py +--- a/Lib/distutils/tests/test_archive_util.py ++++ b/Lib/distutils/tests/test_archive_util.py +@@ -308,7 +308,7 @@ + owner='kjhkjhkjg', group='oihohoh') + self.assertTrue(os.path.exists(res)) + +- @unittest.skipUnless(zlib, "Requires zlib") ++ @unittest.skipUnless(ZLIB_SUPPORT, "Requires zlib") + @unittest.skipUnless(UID_GID_SUPPORT, "Requires grp and pwd support") + def test_tarfile_root_owner(self): + tmpdir, tmpdir2, base_name = self._create_files() +diff -r 3405dc9a6afa Lib/distutils/tests/test_bdist_rpm.py +--- a/Lib/distutils/tests/test_bdist_rpm.py ++++ b/Lib/distutils/tests/test_bdist_rpm.py +@@ -43,18 +43,15 @@ + sys.argv[:] = self.old_sys_argv[1] + super(BuildRpmTestCase, self).tearDown() + ++ # XXX I am unable yet to make this test work without ++ # spurious sdtout/stderr output under Mac OS X ++ @unittest.skipUnless(sys.platform.startswith('linux'), ++ 'spurious sdtout/stderr output under Mac OS X') ++ @unittest.skipIf(find_executable('rpm') is None, ++ 'the rpm command is not found') ++ @unittest.skipIf(find_executable('rpmbuild') is None, ++ 'the rpmbuild command is not found') + def test_quiet(self): +- +- # XXX I am unable yet to make this test work without +- # spurious sdtout/stderr output under Mac OS X +- if not sys.platform.startswith('linux'): +- return +- +- # this test will run only if the rpm commands are found +- if (find_executable('rpm') is None or +- find_executable('rpmbuild') is None): +- return +- + # let's create a package + tmp_dir = self.mkdtemp() + pkg_dir = os.path.join(tmp_dir, 'foo') +@@ -87,19 +84,16 @@ + self.assertIn(('bdist_rpm', 'any', 'dist/foo-0.1-1.src.rpm'), dist.dist_files) + self.assertIn(('bdist_rpm', 'any', 'dist/foo-0.1-1.noarch.rpm'), dist.dist_files) + ++ # XXX I am unable yet to make this test work without ++ # spurious sdtout/stderr output under Mac OS X ++ @unittest.skipUnless(sys.platform.startswith('linux'), ++ 'spurious sdtout/stderr output under Mac OS X') ++ # http://bugs.python.org/issue1533164 ++ @unittest.skipIf(find_executable('rpm') is None, ++ 'the rpm command is not found') ++ @unittest.skipIf(find_executable('rpmbuild') is None, ++ 'the rpmbuild command is not found') + def test_no_optimize_flag(self): +- +- # XXX I am unable yet to make this test work without +- # spurious sdtout/stderr output under Mac OS X +- if not sys.platform.startswith('linux'): +- return +- +- # http://bugs.python.org/issue1533164 +- # this test will run only if the rpm command is found +- if (find_executable('rpm') is None or +- find_executable('rpmbuild') is None): +- return +- + # let's create a package that brakes bdist_rpm + tmp_dir = self.mkdtemp() + pkg_dir = os.path.join(tmp_dir, 'foo') +diff -r 3405dc9a6afa Lib/distutils/tests/test_build_clib.py +--- a/Lib/distutils/tests/test_build_clib.py ++++ b/Lib/distutils/tests/test_build_clib.py +@@ -102,11 +102,8 @@ + cmd.distribution.libraries = 'WONTWORK' + self.assertRaises(DistutilsSetupError, cmd.finalize_options) + ++ @unittest.skipIf(sys.platform == 'win32', "can't test on Windows") + def test_run(self): +- # can't test on windows +- if sys.platform == 'win32': +- return +- + pkg_dir, dist = self.create_dist() + cmd = build_clib(dist) + +@@ -131,7 +128,7 @@ + if ccmd is None: + continue + if find_executable(ccmd[0]) is None: +- return # can't test ++ self.skipTest('The %r command is not found' % ccmd[0]) + + # this should work + cmd.run() +diff -r 3405dc9a6afa Lib/distutils/tests/test_build_ext.py +--- a/Lib/distutils/tests/test_build_ext.py ++++ b/Lib/distutils/tests/test_build_ext.py +@@ -61,9 +61,9 @@ + sys.stdout = old_stdout + + if ALREADY_TESTED: +- return ++ self.skipTest('Already tested in %s' % ALREADY_TESTED) + else: +- ALREADY_TESTED = True ++ ALREADY_TESTED = type(self).__name__ + + import xx + +@@ -113,10 +113,6 @@ + self.assertGreater(len(cmd.library_dirs), 0) + + def test_user_site(self): +- # site.USER_SITE was introduced in 2.6 +- if sys.version < '2.6': +- return +- + import site + dist = Distribution({'name': 'xx'}) + cmd = build_ext(dist) +diff -r 3405dc9a6afa Lib/distutils/tests/test_check.py +--- a/Lib/distutils/tests/test_check.py ++++ b/Lib/distutils/tests/test_check.py +@@ -55,9 +55,8 @@ + cmd = self._run(metadata) + self.assertEqual(cmd._warnings, 0) + ++ @unittest.skipUnless(HAS_DOCUTILS, "won't test without docutils") + def test_check_document(self): +- if not HAS_DOCUTILS: # won't test without docutils +- return + pkg_info, dist = self.create_dist() + cmd = check(dist) + +@@ -71,9 +70,8 @@ + msgs = cmd._check_rst_data(rest) + self.assertEqual(len(msgs), 0) + ++ @unittest.skipUnless(HAS_DOCUTILS, "won't test without docutils") + def test_check_restructuredtext(self): +- if not HAS_DOCUTILS: # won't test without docutils +- return + # let's see if it detects broken rest in long_description + broken_rest = 'title\n===\n\ntest' + pkg_info, dist = self.create_dist(long_description=broken_rest) +diff -r 3405dc9a6afa Lib/distutils/tests/test_config_cmd.py +--- a/Lib/distutils/tests/test_config_cmd.py ++++ b/Lib/distutils/tests/test_config_cmd.py +@@ -37,9 +37,8 @@ + dump_file(this_file, 'I am the header') + self.assertEqual(len(self._logs), numlines+1) + ++ @unittest.skipIf(sys.platform == 'win32', "can't test on Windows") + def test_search_cpp(self): +- if sys.platform == 'win32': +- return + pkg_dir, dist = self.create_dist() + cmd = config(dist) + +diff -r 3405dc9a6afa Lib/distutils/tests/test_register.py +--- a/Lib/distutils/tests/test_register.py ++++ b/Lib/distutils/tests/test_register.py +@@ -10,6 +10,7 @@ + from distutils.command import register as register_module + from distutils.command.register import register + from distutils.errors import DistutilsSetupError ++from distutils.log import INFO + + from distutils.tests.test_config import PyPIRCCommandTestCase + +@@ -58,12 +59,18 @@ + def __call__(self, *args): + return self + +- def open(self, req): ++ def open(self, req, data=None, timeout=None): + self.reqs.append(req) + return self + + def read(self): +- return 'xxx' ++ return b'xxx' ++ ++ def getheader(self, name, default=None): ++ return { ++ 'content-type': 'text/plain; charset=utf-8', ++ }.get(name.lower(), default) ++ + + class RegisterTestCase(PyPIRCCommandTestCase): + +@@ -74,11 +81,13 @@ + def _getpass(prompt): + return 'password' + getpass.getpass = _getpass ++ urllib.request._opener = None + self.old_opener = urllib.request.build_opener + self.conn = urllib.request.build_opener = FakeOpener() + + def tearDown(self): + getpass.getpass = self._old_getpass ++ urllib.request._opener = None + urllib.request.build_opener = self.old_opener + super(RegisterTestCase, self).tearDown() + +@@ -285,6 +294,14 @@ + cmd.check_metadata() + self.assertEqual(len(w.warnings), 1) + ++ def test_list_classifiers(self): ++ cmd = self._get_cmd() ++ cmd.list_classifiers = 1 ++ cmd.run() ++ results = self.get_logs(INFO) ++ self.assertEqual(results, ['running check', 'xxx']) ++ ++ + def test_suite(): + return unittest.makeSuite(RegisterTestCase) + +diff -r 3405dc9a6afa Lib/distutils/tests/test_sdist.py +--- a/Lib/distutils/tests/test_sdist.py ++++ b/Lib/distutils/tests/test_sdist.py +@@ -131,13 +131,11 @@ + self.assertEqual(len(content), 4) + + @unittest.skipUnless(ZLIB_SUPPORT, 'Need zlib support to run') ++ @unittest.skipIf(find_executable('tar') is None, ++ "The tar command is not found") ++ @unittest.skipIf(find_executable('gzip') is None, ++ "The gzip command is not found") + def test_make_distribution(self): +- +- # check if tar and gzip are installed +- if (find_executable('tar') is None or +- find_executable('gzip') is None): +- return +- + # now building a sdist + dist, cmd = self.get_cmd() + +@@ -431,15 +429,13 @@ + self.assertEqual(sorted(filenames), ['fake-1.0', 'fake-1.0/PKG-INFO', + 'fake-1.0/README.manual']) + +- @unittest.skipUnless(zlib, "requires zlib") ++ @unittest.skipUnless(ZLIB_SUPPORT, "requires zlib") + @unittest.skipUnless(UID_GID_SUPPORT, "Requires grp and pwd support") ++ @unittest.skipIf(find_executable('tar') is None, ++ "The tar command is not found") ++ @unittest.skipIf(find_executable('gzip') is None, ++ "The gzip command is not found") + def test_make_distribution_owner_group(self): +- +- # check if tar and gzip are installed +- if (find_executable('tar') is None or +- find_executable('gzip') is None): +- return +- + # now building a sdist + dist, cmd = self.get_cmd() + +diff -r 3405dc9a6afa Lib/distutils/tests/test_sysconfig.py +--- a/Lib/distutils/tests/test_sysconfig.py ++++ b/Lib/distutils/tests/test_sysconfig.py +@@ -6,7 +6,7 @@ + from distutils import sysconfig + from distutils.ccompiler import get_default_compiler + from distutils.tests import support +-from test.support import TESTFN, run_unittest ++from test.support import TESTFN, run_unittest, check_warnings + + class SysconfigTestCase(support.EnvironGuard, unittest.TestCase): + def setUp(self): +@@ -80,12 +80,9 @@ + os.chdir(cwd) + self.assertEqual(srcdir, srcdir2) + ++ @unittest.skipUnless(get_default_compiler() == 'unix', ++ 'not testing if default compiler is not unix') + def test_customize_compiler(self): +- +- # not testing if default compiler is not unix +- if get_default_compiler() != 'unix': +- return +- + os.environ['AR'] = 'my_ar' + os.environ['ARFLAGS'] = '-arflags' + +@@ -151,7 +148,7 @@ + + import sysconfig as global_sysconfig + if sysconfig.get_config_var('CUSTOMIZED_OSX_COMPILER'): +- return ++ self.skipTest('compiler flags customized') + self.assertEqual(global_sysconfig.get_config_var('LDSHARED'), + sysconfig.get_config_var('LDSHARED')) + self.assertEqual(global_sysconfig.get_config_var('CC'), +@@ -166,8 +163,9 @@ + @unittest.skipIf(sysconfig.get_config_var('EXT_SUFFIX') is None, + 'EXT_SUFFIX required for this test') + def test_SO_value(self): +- self.assertEqual(sysconfig.get_config_var('SO'), +- sysconfig.get_config_var('EXT_SUFFIX')) ++ with check_warnings(('', DeprecationWarning)): ++ self.assertEqual(sysconfig.get_config_var('SO'), ++ sysconfig.get_config_var('EXT_SUFFIX')) + + @unittest.skipIf(sysconfig.get_config_var('EXT_SUFFIX') is None, + 'EXT_SUFFIX required for this test') +diff -r 3405dc9a6afa Lib/distutils/tests/test_unixccompiler.py +--- a/Lib/distutils/tests/test_unixccompiler.py ++++ b/Lib/distutils/tests/test_unixccompiler.py +@@ -21,12 +21,8 @@ + sys.platform = self._backup_platform + sysconfig.get_config_var = self._backup_get_config_var + ++ @unittest.skipIf(sys.platform == 'win32', "can't test on Windows") + def test_runtime_libdir_option(self): +- +- # not tested under windows +- if sys.platform == 'win32': +- return +- + # Issue#5900 + # + # Ensure RUNPATH is added to extension modules with RPATH if +diff -r 3405dc9a6afa Lib/distutils/tests/test_upload.py +--- a/Lib/distutils/tests/test_upload.py ++++ b/Lib/distutils/tests/test_upload.py +@@ -6,6 +6,7 @@ + from distutils.command import upload as upload_mod + from distutils.command.upload import upload + from distutils.core import Distribution ++from distutils.log import INFO + + from distutils.tests.test_config import PYPIRC, PyPIRCCommandTestCase + +@@ -48,6 +49,14 @@ + self.req = None + self.msg = 'OK' + ++ def getheader(self, name, default=None): ++ return { ++ 'content-type': 'text/plain; charset=utf-8', ++ }.get(name.lower(), default) ++ ++ def read(self): ++ return b'xyzzy' ++ + def getcode(self): + return 200 + +@@ -108,10 +117,11 @@ + # lets run it + pkg_dir, dist = self.create_dist(dist_files=dist_files) + cmd = upload(dist) ++ cmd.show_response = 1 + cmd.ensure_finalized() + cmd.run() + +- # what did we send ? ++ # what did we send ? + headers = dict(self.last_open.req.headers) + self.assertEqual(headers['Content-length'], '2087') + content_type = headers['Content-type'] +@@ -121,6 +131,11 @@ + self.assertEqual(self.last_open.req.get_full_url(), expected_url) + self.assertTrue(b'xxx' in self.last_open.req.data) + ++ # The PyPI response body was echoed ++ results = self.get_logs(INFO) ++ self.assertIn('xyzzy\n', results[-1]) ++ ++ + def test_suite(): + return unittest.makeSuite(uploadTestCase) + +diff -r 3405dc9a6afa Lib/doctest.py +--- a/Lib/doctest.py ++++ b/Lib/doctest.py +@@ -318,6 +318,32 @@ + else: + return '#' + ++def _strip_exception_details(msg): ++ # Support for IGNORE_EXCEPTION_DETAIL. ++ # Get rid of everything except the exception name; in particular, drop ++ # the possibly dotted module path (if any) and the exception message (if ++ # any). We assume that a colon is never part of a dotted name, or of an ++ # exception name. ++ # E.g., given ++ # "foo.bar.MyError: la di da" ++ # return "MyError" ++ # Or for "abc.def" or "abc.def:\n" return "def". ++ ++ start, end = 0, len(msg) ++ # The exception name must appear on the first line. ++ i = msg.find("\n") ++ if i >= 0: ++ end = i ++ # retain up to the first colon (if any) ++ i = msg.find(':', 0, end) ++ if i >= 0: ++ end = i ++ # retain just the exception name ++ i = msg.rfind('.', 0, end) ++ if i >= 0: ++ start = i+1 ++ return msg[start: end] ++ + class _OutputRedirectingPdb(pdb.Pdb): + """ + A specialized version of the python debugger that redirects stdout +@@ -1325,10 +1351,9 @@ + + # Another chance if they didn't care about the detail. + elif self.optionflags & IGNORE_EXCEPTION_DETAIL: +- m1 = re.match(r'(?:[^:]*\.)?([^:]*:)', example.exc_msg) +- m2 = re.match(r'(?:[^:]*\.)?([^:]*:)', exc_msg) +- if m1 and m2 and check(m1.group(1), m2.group(1), +- self.optionflags): ++ if check(_strip_exception_details(example.exc_msg), ++ _strip_exception_details(exc_msg), ++ self.optionflags): + outcome = SUCCESS + + # Report the outcome. +diff -r 3405dc9a6afa Lib/email/charset.py +--- a/Lib/email/charset.py ++++ b/Lib/email/charset.py +@@ -378,18 +378,19 @@ + return None + + def body_encode(self, string): +- """Body-encode a string by converting it first to bytes. ++ """Body-encode a string, converting it first to bytes if needed. + + The type of encoding (base64 or quoted-printable) will be based on +- self.body_encoding. If body_encoding is None, we assume the +- output charset is a 7bit encoding, so re-encoding the decoded +- string using the ascii codec produces the correct string version +- of the content. ++ self.body_encoding. If body_encoding is None, we perform no CTE ++ encoding (the CTE will be either 7bit or 8bit), we just encode the ++ binary representation to ascii using the surrogateescape error handler, ++ which will enable the Generators to produce the correct output. + """ +- # 7bit/8bit encodings return the string unchanged (module conversions) ++ if not string: ++ return string ++ if isinstance(string, str): ++ string = string.encode(self.output_charset) + if self.body_encoding is BASE64: +- if isinstance(string, str): +- string = string.encode(self.output_charset) + return email.base64mime.body_encode(string) + elif self.body_encoding is QP: + # quopromime.body_encode takes a string, but operates on it as if +@@ -398,15 +399,7 @@ + # character set, then, we must turn it into pseudo bytes via the + # latin1 charset, which will encode any byte as a single code point + # between 0 and 255, which is what body_encode is expecting. +- # +- # Note that this clause doesn't handle the case of a _payload that +- # is already bytes. It never did, and the semantics of _payload +- # being bytes has never been nailed down, so fixing that is a +- # longer term TODO. +- if isinstance(string, str): +- string = string.encode(self.output_charset).decode('latin1') ++ string = string.decode('latin1') + return email.quoprimime.body_encode(string) + else: +- if isinstance(string, str): +- string = string.encode(self.output_charset).decode('ascii') +- return string ++ return string.decode('ascii', 'surrogateescape') +diff -r 3405dc9a6afa Lib/email/encoders.py +--- a/Lib/email/encoders.py ++++ b/Lib/email/encoders.py +@@ -54,21 +54,12 @@ + # There's no payload. For backwards compatibility we use 7bit + msg['Content-Transfer-Encoding'] = '7bit' + return +- # We play a trick to make this go fast. If encoding/decode to ASCII +- # succeeds, we know the data must be 7bit, otherwise treat it as 8bit. ++ # We play a trick to make this go fast. If decoding from ASCII succeeds, ++ # we know the data must be 7bit, otherwise treat it as 8bit. + try: +- if isinstance(orig, str): +- orig.encode('ascii') +- else: +- orig.decode('ascii') ++ orig.decode('ascii') + except UnicodeError: +- charset = msg.get_charset() +- output_cset = charset and charset.output_charset +- # iso-2022-* is non-ASCII but encodes to a 7-bit representation +- if output_cset and output_cset.lower().startswith('iso-2022-'): +- msg['Content-Transfer-Encoding'] = '7bit' +- else: +- msg['Content-Transfer-Encoding'] = '8bit' ++ msg['Content-Transfer-Encoding'] = '8bit' + else: + msg['Content-Transfer-Encoding'] = '7bit' + +diff -r 3405dc9a6afa Lib/email/message.py +--- a/Lib/email/message.py ++++ b/Lib/email/message.py +@@ -301,9 +301,23 @@ + Optional charset sets the message's default character set. See + set_charset() for details. + """ +- if isinstance(payload, bytes): +- payload = payload.decode('ascii', 'surrogateescape') +- self._payload = payload ++ if hasattr(payload, 'encode'): ++ if charset is None: ++ try: ++ payload.encode('ascii', 'surrogateescape') ++ except UnicodeError: ++ raise TypeError("charset argument must be specified" ++ " when non-ASCII characters are used in the" ++ " payload") from None ++ self._payload = payload ++ return ++ if not isinstance(charset, Charset): ++ charset = Charset(charset) ++ payload = payload.encode(charset.output_charset) ++ if hasattr(payload, 'decode'): ++ self._payload = payload.decode('ascii', 'surrogateescape') ++ else: ++ self._payload = payload + if charset is not None: + self.set_charset(charset) + +@@ -342,7 +356,7 @@ + try: + cte(self) + except TypeError: +- self._payload = charset.body_encode(self._payload) ++ self._payload = charset.body_encode(self.get_payload(decode=True)) + self.add_header('Content-Transfer-Encoding', cte) + + def get_charset(self): +diff -r 3405dc9a6afa Lib/ensurepip/__init__.py +--- a/Lib/ensurepip/__init__.py ++++ b/Lib/ensurepip/__init__.py +@@ -10,9 +10,22 @@ + __all__ = ["version", "bootstrap"] + + +-_SETUPTOOLS_VERSION = "1.3.2" ++_SETUPTOOLS_VERSION = "2.0.2" + +-_PIP_VERSION = "1.5.rc1" ++_PIP_VERSION = "1.5rc4" ++ ++# pip currently requires ssl support, so we try to provide a nicer ++# error message when that is missing (http://bugs.python.org/issue19744) ++_MISSING_SSL_MESSAGE = ("pip {} requires SSL/TLS".format(_PIP_VERSION)) ++try: ++ import ssl ++except ImportError: ++ ssl = None ++ def _require_ssl_for_pip(): ++ raise RuntimeError(_MISSING_SSL_MESSAGE) ++else: ++ def _require_ssl_for_pip(): ++ pass + + _PROJECTS = [ + ("setuptools", _SETUPTOOLS_VERSION), +@@ -20,9 +33,10 @@ + ] + + +-def _run_pip(args, additional_paths): ++def _run_pip(args, additional_paths=None): + # Add our bundled software to the sys.path so we can import it +- sys.path = additional_paths + sys.path ++ if additional_paths is not None: ++ sys.path = additional_paths + sys.path + + # Install the bundled software + import pip +@@ -35,6 +49,14 @@ + """ + return _PIP_VERSION + ++def _clear_pip_environment_variables(): ++ # We deliberately ignore all pip environment variables ++ # when invoking pip ++ # See http://bugs.python.org/issue19734 for details ++ keys_to_remove = [k for k in os.environ if k.startswith("PIP_")] ++ for k in keys_to_remove: ++ del os.environ[k] ++ + + def bootstrap(*, root=None, upgrade=False, user=False, + altinstall=False, default_pip=False, +@@ -42,10 +64,15 @@ + """ + Bootstrap pip into the current Python installation (or the given root + directory). ++ ++ Note that calling this function will alter both sys.path and os.environ. + """ + if altinstall and default_pip: + raise ValueError("Cannot use altinstall and default_pip together") + ++ _require_ssl_for_pip() ++ _clear_pip_environment_variables() ++ + # By default, installing pip and setuptools installs all of the + # following scripts (X.Y == running Python version): + # +@@ -90,3 +117,91 @@ + args += ["-" + "v" * verbosity] + + _run_pip(args + [p[0] for p in _PROJECTS], additional_paths) ++ ++def _uninstall_helper(*, verbosity=0): ++ """Helper to support a clean default uninstall process on Windows ++ ++ Note that calling this function may alter os.environ. ++ """ ++ # Nothing to do if pip was never installed, or has been removed ++ try: ++ import pip ++ except ImportError: ++ return ++ ++ # If the pip version doesn't match the bundled one, leave it alone ++ if pip.__version__ != _PIP_VERSION: ++ msg = ("ensurepip will only uninstall a matching pip " ++ "({!r} installed, {!r} bundled)") ++ raise RuntimeError(msg.format(pip.__version__, _PIP_VERSION)) ++ ++ _require_ssl_for_pip() ++ _clear_pip_environment_variables() ++ ++ # Construct the arguments to be passed to the pip command ++ args = ["uninstall", "-y"] ++ if verbosity: ++ args += ["-" + "v" * verbosity] ++ ++ _run_pip(args + [p[0] for p in reversed(_PROJECTS)]) ++ ++ ++def _main(argv=None): ++ import argparse ++ parser = argparse.ArgumentParser(prog="python -m ensurepip") ++ parser.add_argument( ++ "--version", ++ action="version", ++ version="pip {}".format(version()), ++ help="Show the version of pip that is bundled with this Python.", ++ ) ++ parser.add_argument( ++ "-v", "--verbose", ++ action="count", ++ default=0, ++ dest="verbosity", ++ help=("Give more output. Option is additive, and can be used up to 3 " ++ "times."), ++ ) ++ parser.add_argument( ++ "-U", "--upgrade", ++ action="store_true", ++ default=False, ++ help="Upgrade pip and dependencies, even if already installed.", ++ ) ++ parser.add_argument( ++ "--user", ++ action="store_true", ++ default=False, ++ help="Install using the user scheme.", ++ ) ++ parser.add_argument( ++ "--root", ++ default=None, ++ help="Install everything relative to this alternate root directory.", ++ ) ++ parser.add_argument( ++ "--altinstall", ++ action="store_true", ++ default=False, ++ help=("Make an alternate install, installing only the X.Y versioned" ++ "scripts (Default: pipX, pipX.Y, easy_install-X.Y)"), ++ ) ++ parser.add_argument( ++ "--default-pip", ++ action="store_true", ++ default=False, ++ help=("Make a default pip install, installing the unqualified pip " ++ "and easy_install in addition to the versioned scripts"), ++ ) ++ ++ args = parser.parse_args(argv) ++ ++ bootstrap( ++ root=args.root, ++ upgrade=args.upgrade, ++ user=args.user, ++ verbosity=args.verbosity, ++ altinstall=args.altinstall, ++ default_pip=args.default_pip, ++ ) +diff -r 3405dc9a6afa Lib/ensurepip/__main__.py +--- a/Lib/ensurepip/__main__.py ++++ b/Lib/ensurepip/__main__.py +@@ -1,66 +1,4 @@ +-import argparse + import ensurepip + +- +-def main(): +- parser = argparse.ArgumentParser(prog="python -m ensurepip") +- parser.add_argument( +- "--version", +- action="version", +- version="pip {}".format(ensurepip.version()), +- help="Show the version of pip that is bundled with this Python.", +- ) +- parser.add_argument( +- "-v", "--verbose", +- action="count", +- default=0, +- dest="verbosity", +- help=("Give more output. Option is additive, and can be used up to 3 " +- "times."), +- ) +- parser.add_argument( +- "-U", "--upgrade", +- action="store_true", +- default=False, +- help="Upgrade pip and dependencies, even if already installed.", +- ) +- parser.add_argument( +- "--user", +- action="store_true", +- default=False, +- help="Install using the user scheme.", +- ) +- parser.add_argument( +- "--root", +- default=None, +- help="Install everything relative to this alternate root directory.", +- ) +- parser.add_argument( +- "--altinstall", +- action="store_true", +- default=False, +- help=("Make an alternate install, installing only the X.Y versioned" +- "scripts (Default: pipX, pipX.Y, easy_install-X.Y)"), +- ) +- parser.add_argument( +- "--default-pip", +- action="store_true", +- default=False, +- help=("Make a default pip install, installing the unqualified pip " +- "and easy_install in addition to the versioned scripts"), +- ) +- +- args = parser.parse_args() +- +- ensurepip.bootstrap( +- root=args.root, +- upgrade=args.upgrade, +- user=args.user, +- verbosity=args.verbosity, +- altinstall=args.altinstall, +- default_pip=args.default_pip, +- ) +- +- + if __name__ == "__main__": +- main() ++ ensurepip._main() +diff -r 3405dc9a6afa Lib/ensurepip/_bundled/pip-1.5.rc1-py2.py3-none-any.whl +Binary file Lib/ensurepip/_bundled/pip-1.5.rc1-py2.py3-none-any.whl has changed +diff -r 3405dc9a6afa Lib/ensurepip/_bundled/pip-1.5rc4-py2.py3-none-any.whl +Binary file Lib/ensurepip/_bundled/pip-1.5rc4-py2.py3-none-any.whl has changed +diff -r 3405dc9a6afa Lib/ensurepip/_bundled/setuptools-1.3.2-py2.py3-none-any.whl +Binary file Lib/ensurepip/_bundled/setuptools-1.3.2-py2.py3-none-any.whl has changed +diff -r 3405dc9a6afa Lib/ensurepip/_bundled/setuptools-2.0.2-py2.py3-none-any.whl +Binary file Lib/ensurepip/_bundled/setuptools-2.0.2-py2.py3-none-any.whl has changed +diff -r 3405dc9a6afa Lib/ensurepip/_uninstall.py +--- /dev/null ++++ b/Lib/ensurepip/_uninstall.py +@@ -0,0 +1,30 @@ ++"""Basic pip uninstallation support, helper for the Windows uninstaller""" ++ ++import argparse ++import ensurepip ++ ++ ++def _main(argv=None): ++ parser = argparse.ArgumentParser(prog="python -m ensurepip._uninstall") ++ parser.add_argument( ++ "--version", ++ action="version", ++ version="pip {}".format(ensurepip.version()), ++ help="Show the version of pip this will attempt to uninstall.", ++ ) ++ parser.add_argument( ++ "-v", "--verbose", ++ action="count", ++ default=0, ++ dest="verbosity", ++ help=("Give more output. Option is additive, and can be used up to 3 " ++ "times."), ++ ) ++ ++ args = parser.parse_args(argv) ++ ++ ensurepip._uninstall_helper(verbosity=args.verbosity) ++ ++ ++if __name__ == "__main__": ++ _main() +diff -r 3405dc9a6afa Lib/fileinput.py +--- a/Lib/fileinput.py ++++ b/Lib/fileinput.py +@@ -224,7 +224,7 @@ + "'r', 'rU', 'U' and 'rb'") + if 'U' in mode: + import warnings +- warnings.warn("Use of 'U' mode is deprecated", ++ warnings.warn("'U' mode is deprecated", + DeprecationWarning, 2) + self._mode = mode + if openhook: +diff -r 3405dc9a6afa Lib/ftplib.py +--- a/Lib/ftplib.py ++++ b/Lib/ftplib.py +@@ -748,7 +748,9 @@ + resp = self.voidcmd('AUTH TLS') + else: + resp = self.voidcmd('AUTH SSL') +- self.sock = self.context.wrap_socket(self.sock) ++ server_hostname = self.host if ssl.HAS_SNI else None ++ self.sock = self.context.wrap_socket(self.sock, ++ server_hostname=server_hostname) + self.file = self.sock.makefile(mode='r', encoding=self.encoding) + return resp + +@@ -787,7 +789,9 @@ + def ntransfercmd(self, cmd, rest=None): + conn, size = FTP.ntransfercmd(self, cmd, rest) + if self._prot_p: +- conn = self.context.wrap_socket(conn) ++ server_hostname = self.host if ssl.HAS_SNI else None ++ conn = self.context.wrap_socket(conn, ++ server_hostname=server_hostname) + return conn, size + + def abort(self): +diff -r 3405dc9a6afa Lib/http/client.py +--- a/Lib/http/client.py ++++ b/Lib/http/client.py +@@ -538,7 +538,7 @@ + # connection, and the user is reading more bytes than will be provided + # (for example, reading in 1k chunks) + n = self.fp.readinto(b) +- if not n: ++ if not n and b: + # Ideally, we would raise IncompleteRead if the content-length + # wasn't satisfied, but it might break compatibility. + self._close_conn() +@@ -1204,13 +1204,13 @@ + server_hostname = self.host if ssl.HAS_SNI else None + self.sock = self._context.wrap_socket(sock, + server_hostname=server_hostname) +- try: +- if self._check_hostname: ++ if not self._context.check_hostname and self._check_hostname: ++ try: + ssl.match_hostname(self.sock.getpeercert(), self.host) +- except Exception: +- self.sock.shutdown(socket.SHUT_RDWR) +- self.sock.close() +- raise ++ except Exception: ++ self.sock.shutdown(socket.SHUT_RDWR) ++ self.sock.close() ++ raise + + __all__.append("HTTPSConnection") + +diff -r 3405dc9a6afa Lib/http/cookiejar.py +--- a/Lib/http/cookiejar.py ++++ b/Lib/http/cookiejar.py +@@ -1973,7 +1973,7 @@ + magic_re = re.compile("#( Netscape)? HTTP Cookie File") + header = """\ + # Netscape HTTP Cookie File +-# http://www.netscape.com/newsref/std/cookie_spec.html ++# http://curl.haxx.se/rfc/cookie_spec.html + # This is a generated file! Do not edit. + + """ +diff -r 3405dc9a6afa Lib/idlelib/PyShell.py +--- a/Lib/idlelib/PyShell.py ++++ b/Lib/idlelib/PyShell.py +@@ -1334,8 +1334,11 @@ + def write(self, s): + if self.closed: + raise ValueError("write to closed file") +- if not isinstance(s, str): +- raise TypeError('must be str, not ' + type(s).__name__) ++ if type(s) is not str: ++ if not isinstance(s, str): ++ raise TypeError('must be str, not ' + type(s).__name__) ++ # See issue #19481 ++ s = str.__str__(s) + return self.shell.write(s, self.tags) + + +@@ -1381,6 +1384,9 @@ + line = self._line_buffer or self.shell.readline() + if size < 0: + size = len(line) ++ eol = line.find('\n', 0, size) ++ if eol >= 0: ++ size = eol + 1 + self._line_buffer = line[size:] + return line[:size] + +@@ -1537,20 +1543,22 @@ + args.remove(filename) + if not args: + flist.new() ++ + if enable_shell: + shell = flist.open_shell() + if not shell: + return # couldn't open shell +- + if macosxSupport.runningAsOSXApp() and flist.dict: + # On OSX: when the user has double-clicked on a file that causes + # IDLE to be launched the shell window will open just in front of + # the file she wants to see. Lower the interpreter window when + # there are open files. + shell.top.lower() ++ else: ++ shell = flist.pyshell + +- shell = flist.pyshell +- # handle remaining options: ++ # Handle remaining options. If any of these are set, enable_shell ++ # was set also, so shell must be true to reach here. + if debug: + shell.open_debugger() + if startup: +@@ -1558,7 +1566,7 @@ + os.environ.get("PYTHONSTARTUP") + if filename and os.path.isfile(filename): + shell.interp.execfile(filename) +- if shell and cmd or script: ++ if cmd or script: + shell.interp.runcommand("""if 1: + import sys as _sys + _sys.argv = %r +@@ -1569,13 +1577,14 @@ + elif script: + shell.interp.prepend_syspath(script) + shell.interp.execfile(script) +- +- # Check for problematic OS X Tk versions and print a warning message +- # in the IDLE shell window; this is less intrusive than always opening +- # a separate window. +- tkversionwarning = macosxSupport.tkVersionWarning(root) +- if tkversionwarning: +- shell.interp.runcommand(''.join(("print('", tkversionwarning, "')"))) ++ elif shell: ++ # If there is a shell window and no cmd or script in progress, ++ # check for problematic OS X Tk versions and print a warning ++ # message in the IDLE shell window; this is less intrusive ++ # than always opening a separate window. ++ tkversionwarning = macosxSupport.tkVersionWarning(root) ++ if tkversionwarning: ++ shell.interp.runcommand("print('%s')" % tkversionwarning) + + while flist.inversedict: # keep IDLE running while files are open. + root.mainloop() +diff -r 3405dc9a6afa Lib/imaplib.py +--- a/Lib/imaplib.py ++++ b/Lib/imaplib.py +@@ -745,7 +745,9 @@ + ssl_context = ssl._create_stdlib_context() + typ, dat = self._simple_command(name) + if typ == 'OK': +- self.sock = ssl_context.wrap_socket(self.sock) ++ server_hostname = self.host if ssl.HAS_SNI else None ++ self.sock = ssl_context.wrap_socket(self.sock, ++ server_hostname=server_hostname) + self.file = self.sock.makefile('rb') + self._tls_established = True + self._get_capabilities() +@@ -1216,7 +1218,9 @@ + + def _create_socket(self): + sock = IMAP4._create_socket(self) +- return self.ssl_context.wrap_socket(sock) ++ server_hostname = self.host if ssl.HAS_SNI else None ++ return self.ssl_context.wrap_socket(sock, ++ server_hostname=server_hostname) + + def open(self, host='', port=IMAP4_SSL_PORT): + """Setup connection to remote server on "host:port". +diff -r 3405dc9a6afa Lib/importlib/__init__.py +--- a/Lib/importlib/__init__.py ++++ b/Lib/importlib/__init__.py +@@ -153,10 +153,17 @@ + _RELOADING[name] = module + try: + parent_name = name.rpartition('.')[0] +- if parent_name and parent_name not in sys.modules: +- msg = "parent {!r} not in sys.modules" +- raise ImportError(msg.format(parent_name), name=parent_name) +- spec = module.__spec__ = _bootstrap._find_spec(name, None, module) ++ if parent_name: ++ try: ++ parent = sys.modules[parent_name] ++ except KeyError: ++ msg = "parent {!r} not in sys.modules" ++ raise ImportError(msg.format(parent_name), name=parent_name) ++ else: ++ pkgpath = parent.__path__ ++ else: ++ pkgpath = None ++ spec = module.__spec__ = _bootstrap._find_spec(name, pkgpath, module) + methods = _bootstrap._SpecMethods(spec) + methods.exec(module) + # The module may have replaced itself in sys.modules! +diff -r 3405dc9a6afa Lib/importlib/_bootstrap.py +--- a/Lib/importlib/_bootstrap.py ++++ b/Lib/importlib/_bootstrap.py +@@ -133,6 +133,24 @@ + _code_type = type(_wrap.__code__) + + ++ ++class _ManageReload: ++ ++ """Manages the possible clean-up of sys.modules for load_module().""" ++ ++ def __init__(self, name): ++ self._name = name ++ ++ def __enter__(self): ++ self._is_reload = self._name in sys.modules ++ ++ def __exit__(self, *args): ++ if any(arg is not None for arg in args) and not self._is_reload: ++ try: ++ del sys.modules[self._name] ++ except KeyError: ++ pass ++ + # Module-level locking ######################################################## + + # A dict mapping module names to weakrefs of _ModuleLock instances +@@ -823,6 +841,10 @@ + def has_location(self): + return self._set_fileattr + ++ @has_location.setter ++ def has_location(self, value): ++ self._set_fileattr = bool(value) ++ + + def spec_from_loader(name, loader, *, origin=None, is_package=None): + """Return a module spec based on various loader methods.""" +@@ -1242,23 +1264,15 @@ + spec = cls.find_spec(fullname, path) + return spec.loader if spec is not None else None + +- @staticmethod +- def exec_module(module): +- spec = module.__spec__ +- name = spec.name +- if not _imp.is_builtin(name): +- raise ImportError('{!r} is not a built-in module'.format(name), +- name=name) +- _call_with_frames_removed(_imp.init_builtin, name) +- # Have to manually initialize attributes since init_builtin() is not +- # going to do it for us. +- # XXX: Create _imp.exec_builtin(module) +- _SpecMethods(spec).init_module_attrs(sys.modules[name]) +- + @classmethod ++ @_requires_builtin + def load_module(cls, fullname): + """Load a built-in module.""" +- return _load_module_shim(cls, fullname) ++ with _ManageReload(fullname): ++ module = _call_with_frames_removed(_imp.init_builtin, fullname) ++ module.__loader__ = cls ++ module.__package__ = '' ++ return module + + @classmethod + @_requires_builtin +@@ -1639,22 +1653,21 @@ + self.name = name + self.path = path + +- def exec_module(self, module): +- # XXX create _imp.exec_dynamic() +- spec = module.__spec__ +- fullname = spec.name +- module = _call_with_frames_removed(_imp.load_dynamic, +- fullname, self.path) +- _verbose_message('extension module loaded from {!r}', self.path) +- if self.is_package(fullname) and not hasattr(module, '__path__'): +- module.__path__ = [_path_split(self.path)[0]] +- _SpecMethods(spec).init_module_attrs(module) +- +- # XXX deprecate + @_check_name + def load_module(self, fullname): + """Load an extension module.""" +- return _load_module_shim(self, fullname) ++ with _ManageReload(fullname): ++ module = _call_with_frames_removed(_imp.load_dynamic, ++ fullname, self.path) ++ _verbose_message('extension module loaded from {!r}', self.path) ++ is_package = self.is_package(fullname) ++ if is_package and not hasattr(module, '__path__'): ++ module.__path__ = [_path_split(self.path)[0]] ++ module.__loader__ = self ++ module.__package__ = module.__name__ ++ if not is_package: ++ module.__package__ = module.__package__.rpartition('.')[0] ++ return module + + def is_package(self, fullname): + """Return True if the extension module is a package.""" +@@ -1921,15 +1934,10 @@ + return None, [] + return spec.loader, spec.submodule_search_locations or [] + +- def _get_spec(self, loader_class, fullname, path, submodule_search_locations, target): ++ def _get_spec(self, loader_class, fullname, path, smsl, target): + loader = loader_class(fullname, path) +- try: +- get_spec = loader._get_spec +- except AttributeError: +- return spec_from_file_location(fullname, path, loader=loader, +- submodule_search_locations=submodule_search_locations) +- else: +- return get_spec(fullname, path, submodule_search_locations, target) ++ return spec_from_file_location(fullname, path, loader=loader, ++ submodule_search_locations=smsl) + + def find_spec(self, fullname, target=None): + """Try to find a loader for the specified module, or the namespace +diff -r 3405dc9a6afa Lib/json/__init__.py +--- a/Lib/json/__init__.py ++++ b/Lib/json/__init__.py +@@ -3,11 +3,8 @@ + interchange format. + + :mod:`json` exposes an API familiar to users of the standard library +-:mod:`marshal` and :mod:`pickle` modules. It is the externally maintained +-version of the :mod:`json` library contained in Python 2.6, but maintains +-compatibility with Python 2.4 and Python 2.5 and (currently) has +-significant performance advantages, even without using the optional C +-extension for speedups. ++:mod:`marshal` and :mod:`pickle` modules. It is derived from a ++version of the externally maintained simplejson library. + + Encoding basic Python object hierarchies:: + +diff -r 3405dc9a6afa Lib/json/decoder.py +--- a/Lib/json/decoder.py ++++ b/Lib/json/decoder.py +@@ -58,6 +58,16 @@ + 'b': '\b', 'f': '\f', 'n': '\n', 'r': '\r', 't': '\t', + } + ++def _decode_uXXXX(s, pos): ++ esc = s[pos + 1:pos + 5] ++ if len(esc) == 4 and esc[1] not in 'xX': ++ try: ++ return int(esc, 16) ++ except ValueError: ++ pass ++ msg = "Invalid \\uXXXX escape" ++ raise ValueError(errmsg(msg, s, pos)) ++ + def py_scanstring(s, end, strict=True, + _b=BACKSLASH, _m=STRINGCHUNK.match): + """Scan the string s for a JSON string. End is the index of the +@@ -107,25 +117,14 @@ + raise ValueError(errmsg(msg, s, end)) + end += 1 + else: +- esc = s[end + 1:end + 5] +- next_end = end + 5 +- if len(esc) != 4: +- msg = "Invalid \\uXXXX escape" +- raise ValueError(errmsg(msg, s, end)) +- uni = int(esc, 16) +- if 0xd800 <= uni <= 0xdbff: +- msg = "Invalid \\uXXXX\\uXXXX surrogate pair" +- if not s[end + 5:end + 7] == '\\u': +- raise ValueError(errmsg(msg, s, end)) +- esc2 = s[end + 7:end + 11] +- if len(esc2) != 4: +- raise ValueError(errmsg(msg, s, end)) +- uni2 = int(esc2, 16) +- uni = 0x10000 + (((uni - 0xd800) << 10) | (uni2 - 0xdc00)) +- next_end += 6 ++ uni = _decode_uXXXX(s, end) ++ end += 5 ++ if 0xd800 <= uni <= 0xdbff and s[end:end + 2] == '\\u': ++ uni2 = _decode_uXXXX(s, end + 1) ++ if 0xdc00 <= uni2 <= 0xdfff: ++ uni = 0x10000 + (((uni - 0xd800) << 10) | (uni2 - 0xdc00)) ++ end += 6 + char = chr(uni) +- +- end = next_end + _append(char) + return ''.join(chunks), end + +diff -r 3405dc9a6afa Lib/lib2to3/fixes/fix_import.py +--- a/Lib/lib2to3/fixes/fix_import.py ++++ b/Lib/lib2to3/fixes/fix_import.py +@@ -32,7 +32,7 @@ + elif node.type == syms.dotted_as_names: + pending.extend(node.children[::-2]) + else: +- raise AssertionError("unkown node type") ++ raise AssertionError("unknown node type") + + + class FixImport(fixer_base.BaseFix): +diff -r 3405dc9a6afa Lib/lib2to3/pgen2/tokenize.py +--- a/Lib/lib2to3/pgen2/tokenize.py ++++ b/Lib/lib2to3/pgen2/tokenize.py +@@ -252,7 +252,7 @@ + def detect_encoding(readline): + """ + The detect_encoding() function is used to detect the encoding that should +- be used to decode a Python source file. It requires one argment, readline, ++ be used to decode a Python source file. It requires one argument, readline, + in the same way as the tokenize() generator. + + It will call readline a maximum of twice, and return the encoding used +@@ -343,7 +343,7 @@ + + def generate_tokens(readline): + """ +- The generate_tokens() generator requires one argment, readline, which ++ The generate_tokens() generator requires one argument, readline, which + must be a callable object which provides the same interface as the + readline() method of built-in file objects. Each call to the function + should return one line of input as a string. Alternately, readline +diff -r 3405dc9a6afa Lib/locale.py +--- a/Lib/locale.py ++++ b/Lib/locale.py +@@ -336,6 +336,40 @@ + # overridden below) + _setlocale = setlocale + ++def _replace_encoding(code, encoding): ++ if '.' in code: ++ langname = code[:code.index('.')] ++ else: ++ langname = code ++ # Convert the encoding to a C lib compatible encoding string ++ norm_encoding = encodings.normalize_encoding(encoding) ++ #print('norm encoding: %r' % norm_encoding) ++ norm_encoding = encodings.aliases.aliases.get(norm_encoding.lower(), ++ norm_encoding) ++ #print('aliased encoding: %r' % norm_encoding) ++ encoding = norm_encoding ++ norm_encoding = norm_encoding.lower() ++ if norm_encoding in locale_encoding_alias: ++ encoding = locale_encoding_alias[norm_encoding] ++ else: ++ norm_encoding = norm_encoding.replace('_', '') ++ norm_encoding = norm_encoding.replace('-', '') ++ if norm_encoding in locale_encoding_alias: ++ encoding = locale_encoding_alias[norm_encoding] ++ #print('found encoding %r' % encoding) ++ return langname + '.' + encoding ++ ++def _append_modifier(code, modifier): ++ if modifier == 'euro': ++ if '.' not in code: ++ return code + '.ISO8859-15' ++ _, _, encoding = code.partition('.') ++ if encoding in ('ISO8859-15', 'UTF-8'): ++ return code ++ if encoding == 'ISO8859-1': ++ return _replace_encoding(code, 'ISO8859-15') ++ return code + '@' + modifier ++ + def normalize(localename): + + """ Returns a normalized locale code for the given locale +@@ -352,55 +386,72 @@ + does. + + """ +- # Normalize the locale name and extract the encoding +- fullname = localename.lower() +- if ':' in fullname: ++ # Normalize the locale name and extract the encoding and modifier ++ code = localename.lower() ++ if ':' in code: + # ':' is sometimes used as encoding delimiter. +- fullname = fullname.replace(':', '.') +- if '.' in fullname: +- langname, encoding = fullname.split('.')[:2] +- fullname = langname + '.' + encoding ++ code = code.replace(':', '.') ++ if '@' in code: ++ code, modifier = code.split('@', 1) + else: +- langname = fullname ++ modifier = '' ++ if '.' in code: ++ langname, encoding = code.split('.')[:2] ++ else: ++ langname = code + encoding = '' + +- # First lookup: fullname (possibly with encoding) +- norm_encoding = encoding.replace('-', '') +- norm_encoding = norm_encoding.replace('_', '') +- lookup_name = langname + '.' + encoding ++ # First lookup: fullname (possibly with encoding and modifier) ++ lang_enc = langname ++ if encoding: ++ norm_encoding = encoding.replace('-', '') ++ norm_encoding = norm_encoding.replace('_', '') ++ lang_enc += '.' + norm_encoding ++ lookup_name = lang_enc ++ if modifier: ++ lookup_name += '@' + modifier + code = locale_alias.get(lookup_name, None) + if code is not None: + return code +- #print 'first lookup failed' ++ #print('first lookup failed') + +- # Second try: langname (without encoding) +- code = locale_alias.get(langname, None) +- if code is not None: +- #print 'langname lookup succeeded' +- if '.' in code: +- langname, defenc = code.split('.') +- else: +- langname = code +- defenc = '' +- if encoding: +- # Convert the encoding to a C lib compatible encoding string +- norm_encoding = encodings.normalize_encoding(encoding) +- #print 'norm encoding: %r' % norm_encoding +- norm_encoding = encodings.aliases.aliases.get(norm_encoding, +- norm_encoding) +- #print 'aliased encoding: %r' % norm_encoding +- encoding = locale_encoding_alias.get(norm_encoding, +- norm_encoding) +- else: +- encoding = defenc +- #print 'found encoding %r' % encoding +- if encoding: +- return langname + '.' + encoding +- else: +- return langname ++ if modifier: ++ # Second try: fullname without modifier (possibly with encoding) ++ code = locale_alias.get(lang_enc, None) ++ if code is not None: ++ #print('lookup without modifier succeeded') ++ if '@' not in code: ++ return _append_modifier(code, modifier) ++ if code.split('@', 1)[1].lower() == modifier: ++ return code ++ #print('second lookup failed') + +- else: +- return localename ++ if encoding: ++ # Third try: langname (without encoding, possibly with modifier) ++ lookup_name = langname ++ if modifier: ++ lookup_name += '@' + modifier ++ code = locale_alias.get(lookup_name, None) ++ if code is not None: ++ #print('lookup without encoding succeeded') ++ if '@' not in code: ++ return _replace_encoding(code, encoding) ++ code, modifier = code.split('@', 1) ++ return _replace_encoding(code, encoding) + '@' + modifier ++ ++ if modifier: ++ # Fourth try: langname (without encoding and modifier) ++ code = locale_alias.get(langname, None) ++ if code is not None: ++ #print('lookup without modifier and encoding succeeded') ++ if '@' not in code: ++ code = _replace_encoding(code, encoding) ++ return _append_modifier(code, modifier) ++ code, defmod = code.split('@', 1) ++ if defmod.lower() == modifier: ++ return _replace_encoding(code, encoding) + '@' + defmod ++ ++ return localename + + def _parse_localename(localename): + +@@ -419,7 +470,7 @@ + code = normalize(localename) + if '@' in code: + # Deal with locale modifiers +- code, modifier = code.split('@') ++ code, modifier = code.split('@', 1) + if modifier == 'euro' and '.' not in code: + # Assume Latin-9 for @euro locales. This is bogus, + # since some systems may use other encodings for these +@@ -611,6 +662,14 @@ + 'jis': 'JIS7', + 'jis7': 'JIS7', + 'ajec': 'eucJP', ++ 'koi8c': 'KOI8-C', ++ 'microsoftcp1251': 'CP1251', ++ 'microsoftcp1255': 'CP1255', ++ 'microsoftcp1256': 'CP1256', ++ '88591': 'ISO8859-1', ++ '88592': 'ISO8859-2', ++ '88595': 'ISO8859-5', ++ '885915': 'ISO8859-15', + + # Mappings from Python codec names to C lib encoding names + 'ascii': 'ISO8859-1', +@@ -638,10 +697,18 @@ + 'utf_8': 'UTF-8', + 'koi8_r': 'KOI8-R', + 'koi8_u': 'KOI8-U', ++ 'cp1251': 'CP1251', ++ 'cp1255': 'CP1255', ++ 'cp1256': 'CP1256', ++ + # XXX This list is still incomplete. If you know more + # mappings, please file a bug report. Thanks. + } + ++for k, v in sorted(locale_encoding_alias.items()): ++ k = k.replace('_', '') ++ locale_encoding_alias.setdefault(k, v) ++ + # + # The locale_alias table maps lowercase alias names to C locale names + # (case-sensitive). Encodings are always separated from the locale +@@ -732,458 +799,227 @@ + # updated 'sr_yu.utf8@cyrillic' -> 'sr_CS.UTF-8' to 'sr_RS.UTF-8' + # updated 'sr_yu@cyrillic' -> 'sr_CS.ISO8859-5' to 'sr_RS.UTF-8' + # ++# SS 2013-12-20: ++# Updated alias mapping to most recent locale.alias file ++# from X.org distribution using makelocalealias.py. ++# ++# These are the differences compared to the old mapping (Python 3.3.3 ++# and older): ++# ++# updated 'a3' -> 'a3_AZ.KOI8-C' to 'az_AZ.KOI8-C' ++# updated 'a3_az' -> 'a3_AZ.KOI8-C' to 'az_AZ.KOI8-C' ++# updated 'a3_az.koi8c' -> 'a3_AZ.KOI8-C' to 'az_AZ.KOI8-C' ++# updated 'cs_cs.iso88592' -> 'cs_CS.ISO8859-2' to 'cs_CZ.ISO8859-2' ++# updated 'hebrew' -> 'iw_IL.ISO8859-8' to 'he_IL.ISO8859-8' ++# updated 'hebrew.iso88598' -> 'iw_IL.ISO8859-8' to 'he_IL.ISO8859-8' ++# updated 'sd' -> 'sd_IN@devanagari.UTF-8' to 'sd_IN.UTF-8' ++# updated 'sr@latn' -> 'sr_RS.UTF-8@latin' to 'sr_CS.UTF-8@latin' ++# updated 'sr_cs' -> 'sr_RS.UTF-8' to 'sr_CS.UTF-8' ++# updated 'sr_cs.utf8@latn' -> 'sr_RS.UTF-8@latin' to 'sr_CS.UTF-8@latin' ++# updated 'sr_cs@latn' -> 'sr_RS.UTF-8@latin' to 'sr_CS.UTF-8@latin' + + locale_alias = { +- 'a3': 'a3_AZ.KOI8-C', +- 'a3_az': 'a3_AZ.KOI8-C', +- 'a3_az.koi8c': 'a3_AZ.KOI8-C', ++ 'a3': 'az_AZ.KOI8-C', ++ 'a3_az': 'az_AZ.KOI8-C', ++ 'a3_az.koic': 'az_AZ.KOI8-C', + 'af': 'af_ZA.ISO8859-1', + 'af_za': 'af_ZA.ISO8859-1', +- 'af_za.iso88591': 'af_ZA.ISO8859-1', + 'am': 'am_ET.UTF-8', + 'am_et': 'am_ET.UTF-8', + 'american': 'en_US.ISO8859-1', +- 'american.iso88591': 'en_US.ISO8859-1', + 'ar': 'ar_AA.ISO8859-6', + 'ar_aa': 'ar_AA.ISO8859-6', +- 'ar_aa.iso88596': 'ar_AA.ISO8859-6', + 'ar_ae': 'ar_AE.ISO8859-6', +- 'ar_ae.iso88596': 'ar_AE.ISO8859-6', + 'ar_bh': 'ar_BH.ISO8859-6', +- 'ar_bh.iso88596': 'ar_BH.ISO8859-6', + 'ar_dz': 'ar_DZ.ISO8859-6', +- 'ar_dz.iso88596': 'ar_DZ.ISO8859-6', + 'ar_eg': 'ar_EG.ISO8859-6', +- 'ar_eg.iso88596': 'ar_EG.ISO8859-6', ++ 'ar_in': 'ar_IN.UTF-8', + 'ar_iq': 'ar_IQ.ISO8859-6', +- 'ar_iq.iso88596': 'ar_IQ.ISO8859-6', + 'ar_jo': 'ar_JO.ISO8859-6', +- 'ar_jo.iso88596': 'ar_JO.ISO8859-6', + 'ar_kw': 'ar_KW.ISO8859-6', +- 'ar_kw.iso88596': 'ar_KW.ISO8859-6', + 'ar_lb': 'ar_LB.ISO8859-6', +- 'ar_lb.iso88596': 'ar_LB.ISO8859-6', + 'ar_ly': 'ar_LY.ISO8859-6', +- 'ar_ly.iso88596': 'ar_LY.ISO8859-6', + 'ar_ma': 'ar_MA.ISO8859-6', +- 'ar_ma.iso88596': 'ar_MA.ISO8859-6', + 'ar_om': 'ar_OM.ISO8859-6', +- 'ar_om.iso88596': 'ar_OM.ISO8859-6', + 'ar_qa': 'ar_QA.ISO8859-6', +- 'ar_qa.iso88596': 'ar_QA.ISO8859-6', + 'ar_sa': 'ar_SA.ISO8859-6', +- 'ar_sa.iso88596': 'ar_SA.ISO8859-6', + 'ar_sd': 'ar_SD.ISO8859-6', +- 'ar_sd.iso88596': 'ar_SD.ISO8859-6', + 'ar_sy': 'ar_SY.ISO8859-6', +- 'ar_sy.iso88596': 'ar_SY.ISO8859-6', + 'ar_tn': 'ar_TN.ISO8859-6', +- 'ar_tn.iso88596': 'ar_TN.ISO8859-6', + 'ar_ye': 'ar_YE.ISO8859-6', +- 'ar_ye.iso88596': 'ar_YE.ISO8859-6', + 'arabic': 'ar_AA.ISO8859-6', +- 'arabic.iso88596': 'ar_AA.ISO8859-6', + 'as': 'as_IN.UTF-8', ++ 'as_in': 'as_IN.UTF-8', + 'az': 'az_AZ.ISO8859-9E', + 'az_az': 'az_AZ.ISO8859-9E', + 'az_az.iso88599e': 'az_AZ.ISO8859-9E', + 'be': 'be_BY.CP1251', + 'be@latin': 'be_BY.UTF-8@latin', + 'be_by': 'be_BY.CP1251', +- 'be_by.cp1251': 'be_BY.CP1251', +- 'be_by.microsoftcp1251': 'be_BY.CP1251', +- 'be_by.utf8@latin': 'be_BY.UTF-8@latin', + 'be_by@latin': 'be_BY.UTF-8@latin', + 'bg': 'bg_BG.CP1251', + 'bg_bg': 'bg_BG.CP1251', +- 'bg_bg.cp1251': 'bg_BG.CP1251', +- 'bg_bg.iso88595': 'bg_BG.ISO8859-5', +- 'bg_bg.koi8r': 'bg_BG.KOI8-R', +- 'bg_bg.microsoftcp1251': 'bg_BG.CP1251', + 'bn_in': 'bn_IN.UTF-8', ++ 'bo_in': 'bo_IN.UTF-8', + 'bokmal': 'nb_NO.ISO8859-1', + 'bokm\xe5l': 'nb_NO.ISO8859-1', + 'br': 'br_FR.ISO8859-1', + 'br_fr': 'br_FR.ISO8859-1', +- 'br_fr.iso88591': 'br_FR.ISO8859-1', +- 'br_fr.iso885914': 'br_FR.ISO8859-14', +- 'br_fr.iso885915': 'br_FR.ISO8859-15', +- 'br_fr.iso885915@euro': 'br_FR.ISO8859-15', +- 'br_fr.utf8@euro': 'br_FR.UTF-8', +- 'br_fr@euro': 'br_FR.ISO8859-15', + 'bs': 'bs_BA.ISO8859-2', + 'bs_ba': 'bs_BA.ISO8859-2', +- 'bs_ba.iso88592': 'bs_BA.ISO8859-2', + 'bulgarian': 'bg_BG.CP1251', + 'c': 'C', + 'c-french': 'fr_CA.ISO8859-1', +- 'c-french.iso88591': 'fr_CA.ISO8859-1', ++ 'c.ascii': 'C', + 'c.en': 'C', + 'c.iso88591': 'en_US.ISO8859-1', + 'c_c': 'C', + 'c_c.c': 'C', + 'ca': 'ca_ES.ISO8859-1', + 'ca_ad': 'ca_AD.ISO8859-1', +- 'ca_ad.iso88591': 'ca_AD.ISO8859-1', +- 'ca_ad.iso885915': 'ca_AD.ISO8859-15', +- 'ca_ad.iso885915@euro': 'ca_AD.ISO8859-15', +- 'ca_ad.utf8@euro': 'ca_AD.UTF-8', +- 'ca_ad@euro': 'ca_AD.ISO8859-15', + 'ca_es': 'ca_ES.ISO8859-1', +- 'ca_es.iso88591': 'ca_ES.ISO8859-1', +- 'ca_es.iso885915': 'ca_ES.ISO8859-15', +- 'ca_es.iso885915@euro': 'ca_ES.ISO8859-15', +- 'ca_es.utf8@euro': 'ca_ES.UTF-8', +- 'ca_es@euro': 'ca_ES.ISO8859-15', + 'ca_fr': 'ca_FR.ISO8859-1', +- 'ca_fr.iso88591': 'ca_FR.ISO8859-1', +- 'ca_fr.iso885915': 'ca_FR.ISO8859-15', +- 'ca_fr.iso885915@euro': 'ca_FR.ISO8859-15', +- 'ca_fr.utf8@euro': 'ca_FR.UTF-8', +- 'ca_fr@euro': 'ca_FR.ISO8859-15', + 'ca_it': 'ca_IT.ISO8859-1', +- 'ca_it.iso88591': 'ca_IT.ISO8859-1', +- 'ca_it.iso885915': 'ca_IT.ISO8859-15', +- 'ca_it.iso885915@euro': 'ca_IT.ISO8859-15', +- 'ca_it.utf8@euro': 'ca_IT.UTF-8', +- 'ca_it@euro': 'ca_IT.ISO8859-15', + 'catalan': 'ca_ES.ISO8859-1', + 'cextend': 'en_US.ISO8859-1', +- 'cextend.en': 'en_US.ISO8859-1', + 'chinese-s': 'zh_CN.eucCN', + 'chinese-t': 'zh_TW.eucTW', + 'croatian': 'hr_HR.ISO8859-2', + 'cs': 'cs_CZ.ISO8859-2', + 'cs_cs': 'cs_CZ.ISO8859-2', +- 'cs_cs.iso88592': 'cs_CS.ISO8859-2', + 'cs_cz': 'cs_CZ.ISO8859-2', +- 'cs_cz.iso88592': 'cs_CZ.ISO8859-2', + 'cy': 'cy_GB.ISO8859-1', + 'cy_gb': 'cy_GB.ISO8859-1', +- 'cy_gb.iso88591': 'cy_GB.ISO8859-1', +- 'cy_gb.iso885914': 'cy_GB.ISO8859-14', +- 'cy_gb.iso885915': 'cy_GB.ISO8859-15', +- 'cy_gb@euro': 'cy_GB.ISO8859-15', + 'cz': 'cs_CZ.ISO8859-2', + 'cz_cz': 'cs_CZ.ISO8859-2', + 'czech': 'cs_CZ.ISO8859-2', + 'da': 'da_DK.ISO8859-1', +- 'da.iso885915': 'da_DK.ISO8859-15', + 'da_dk': 'da_DK.ISO8859-1', +- 'da_dk.88591': 'da_DK.ISO8859-1', +- 'da_dk.885915': 'da_DK.ISO8859-15', +- 'da_dk.iso88591': 'da_DK.ISO8859-1', +- 'da_dk.iso885915': 'da_DK.ISO8859-15', +- 'da_dk@euro': 'da_DK.ISO8859-15', + 'danish': 'da_DK.ISO8859-1', +- 'danish.iso88591': 'da_DK.ISO8859-1', + 'dansk': 'da_DK.ISO8859-1', + 'de': 'de_DE.ISO8859-1', +- 'de.iso885915': 'de_DE.ISO8859-15', + 'de_at': 'de_AT.ISO8859-1', +- 'de_at.iso88591': 'de_AT.ISO8859-1', +- 'de_at.iso885915': 'de_AT.ISO8859-15', +- 'de_at.iso885915@euro': 'de_AT.ISO8859-15', +- 'de_at.utf8@euro': 'de_AT.UTF-8', +- 'de_at@euro': 'de_AT.ISO8859-15', + 'de_be': 'de_BE.ISO8859-1', +- 'de_be.iso88591': 'de_BE.ISO8859-1', +- 'de_be.iso885915': 'de_BE.ISO8859-15', +- 'de_be.iso885915@euro': 'de_BE.ISO8859-15', +- 'de_be.utf8@euro': 'de_BE.UTF-8', +- 'de_be@euro': 'de_BE.ISO8859-15', + 'de_ch': 'de_CH.ISO8859-1', +- 'de_ch.iso88591': 'de_CH.ISO8859-1', +- 'de_ch.iso885915': 'de_CH.ISO8859-15', +- 'de_ch@euro': 'de_CH.ISO8859-15', + 'de_de': 'de_DE.ISO8859-1', +- 'de_de.88591': 'de_DE.ISO8859-1', +- 'de_de.885915': 'de_DE.ISO8859-15', +- 'de_de.885915@euro': 'de_DE.ISO8859-15', +- 'de_de.iso88591': 'de_DE.ISO8859-1', +- 'de_de.iso885915': 'de_DE.ISO8859-15', +- 'de_de.iso885915@euro': 'de_DE.ISO8859-15', +- 'de_de.utf8@euro': 'de_DE.UTF-8', +- 'de_de@euro': 'de_DE.ISO8859-15', + 'de_lu': 'de_LU.ISO8859-1', +- 'de_lu.iso88591': 'de_LU.ISO8859-1', +- 'de_lu.iso885915': 'de_LU.ISO8859-15', +- 'de_lu.iso885915@euro': 'de_LU.ISO8859-15', +- 'de_lu.utf8@euro': 'de_LU.UTF-8', +- 'de_lu@euro': 'de_LU.ISO8859-15', + 'deutsch': 'de_DE.ISO8859-1', + 'dutch': 'nl_NL.ISO8859-1', + 'dutch.iso88591': 'nl_BE.ISO8859-1', + 'ee': 'ee_EE.ISO8859-4', + 'ee_ee': 'ee_EE.ISO8859-4', +- 'ee_ee.iso88594': 'ee_EE.ISO8859-4', + 'eesti': 'et_EE.ISO8859-1', + 'el': 'el_GR.ISO8859-7', + 'el_gr': 'el_GR.ISO8859-7', +- 'el_gr.iso88597': 'el_GR.ISO8859-7', + 'el_gr@euro': 'el_GR.ISO8859-15', + 'en': 'en_US.ISO8859-1', +- 'en.iso88591': 'en_US.ISO8859-1', + 'en_au': 'en_AU.ISO8859-1', +- 'en_au.iso88591': 'en_AU.ISO8859-1', + 'en_be': 'en_BE.ISO8859-1', +- 'en_be@euro': 'en_BE.ISO8859-15', + 'en_bw': 'en_BW.ISO8859-1', +- 'en_bw.iso88591': 'en_BW.ISO8859-1', + 'en_ca': 'en_CA.ISO8859-1', +- 'en_ca.iso88591': 'en_CA.ISO8859-1', + 'en_gb': 'en_GB.ISO8859-1', +- 'en_gb.88591': 'en_GB.ISO8859-1', +- 'en_gb.iso88591': 'en_GB.ISO8859-1', +- 'en_gb.iso885915': 'en_GB.ISO8859-15', +- 'en_gb@euro': 'en_GB.ISO8859-15', + 'en_hk': 'en_HK.ISO8859-1', +- 'en_hk.iso88591': 'en_HK.ISO8859-1', + 'en_ie': 'en_IE.ISO8859-1', +- 'en_ie.iso88591': 'en_IE.ISO8859-1', +- 'en_ie.iso885915': 'en_IE.ISO8859-15', +- 'en_ie.iso885915@euro': 'en_IE.ISO8859-15', +- 'en_ie.utf8@euro': 'en_IE.UTF-8', +- 'en_ie@euro': 'en_IE.ISO8859-15', + 'en_in': 'en_IN.ISO8859-1', + 'en_nz': 'en_NZ.ISO8859-1', +- 'en_nz.iso88591': 'en_NZ.ISO8859-1', + 'en_ph': 'en_PH.ISO8859-1', +- 'en_ph.iso88591': 'en_PH.ISO8859-1', + 'en_sg': 'en_SG.ISO8859-1', +- 'en_sg.iso88591': 'en_SG.ISO8859-1', + 'en_uk': 'en_GB.ISO8859-1', + 'en_us': 'en_US.ISO8859-1', +- 'en_us.88591': 'en_US.ISO8859-1', +- 'en_us.885915': 'en_US.ISO8859-15', +- 'en_us.iso88591': 'en_US.ISO8859-1', +- 'en_us.iso885915': 'en_US.ISO8859-15', +- 'en_us.iso885915@euro': 'en_US.ISO8859-15', +- 'en_us@euro': 'en_US.ISO8859-15', + 'en_us@euro@euro': 'en_US.ISO8859-15', + 'en_za': 'en_ZA.ISO8859-1', +- 'en_za.88591': 'en_ZA.ISO8859-1', +- 'en_za.iso88591': 'en_ZA.ISO8859-1', +- 'en_za.iso885915': 'en_ZA.ISO8859-15', +- 'en_za@euro': 'en_ZA.ISO8859-15', + 'en_zw': 'en_ZW.ISO8859-1', +- 'en_zw.iso88591': 'en_ZW.ISO8859-1', + 'eng_gb': 'en_GB.ISO8859-1', +- 'eng_gb.8859': 'en_GB.ISO8859-1', + 'english': 'en_EN.ISO8859-1', +- 'english.iso88591': 'en_EN.ISO8859-1', + 'english_uk': 'en_GB.ISO8859-1', +- 'english_uk.8859': 'en_GB.ISO8859-1', + 'english_united-states': 'en_US.ISO8859-1', + 'english_united-states.437': 'C', + 'english_us': 'en_US.ISO8859-1', +- 'english_us.8859': 'en_US.ISO8859-1', +- 'english_us.ascii': 'en_US.ISO8859-1', + 'eo': 'eo_XX.ISO8859-3', + 'eo_eo': 'eo_EO.ISO8859-3', +- 'eo_eo.iso88593': 'eo_EO.ISO8859-3', + 'eo_xx': 'eo_XX.ISO8859-3', +- 'eo_xx.iso88593': 'eo_XX.ISO8859-3', + 'es': 'es_ES.ISO8859-1', + 'es_ar': 'es_AR.ISO8859-1', +- 'es_ar.iso88591': 'es_AR.ISO8859-1', + 'es_bo': 'es_BO.ISO8859-1', +- 'es_bo.iso88591': 'es_BO.ISO8859-1', + 'es_cl': 'es_CL.ISO8859-1', +- 'es_cl.iso88591': 'es_CL.ISO8859-1', + 'es_co': 'es_CO.ISO8859-1', +- 'es_co.iso88591': 'es_CO.ISO8859-1', + 'es_cr': 'es_CR.ISO8859-1', +- 'es_cr.iso88591': 'es_CR.ISO8859-1', + 'es_do': 'es_DO.ISO8859-1', +- 'es_do.iso88591': 'es_DO.ISO8859-1', + 'es_ec': 'es_EC.ISO8859-1', +- 'es_ec.iso88591': 'es_EC.ISO8859-1', + 'es_es': 'es_ES.ISO8859-1', +- 'es_es.88591': 'es_ES.ISO8859-1', +- 'es_es.iso88591': 'es_ES.ISO8859-1', +- 'es_es.iso885915': 'es_ES.ISO8859-15', +- 'es_es.iso885915@euro': 'es_ES.ISO8859-15', +- 'es_es.utf8@euro': 'es_ES.UTF-8', +- 'es_es@euro': 'es_ES.ISO8859-15', + 'es_gt': 'es_GT.ISO8859-1', +- 'es_gt.iso88591': 'es_GT.ISO8859-1', + 'es_hn': 'es_HN.ISO8859-1', +- 'es_hn.iso88591': 'es_HN.ISO8859-1', + 'es_mx': 'es_MX.ISO8859-1', +- 'es_mx.iso88591': 'es_MX.ISO8859-1', + 'es_ni': 'es_NI.ISO8859-1', +- 'es_ni.iso88591': 'es_NI.ISO8859-1', + 'es_pa': 'es_PA.ISO8859-1', +- 'es_pa.iso88591': 'es_PA.ISO8859-1', +- 'es_pa.iso885915': 'es_PA.ISO8859-15', +- 'es_pa@euro': 'es_PA.ISO8859-15', + 'es_pe': 'es_PE.ISO8859-1', +- 'es_pe.iso88591': 'es_PE.ISO8859-1', +- 'es_pe.iso885915': 'es_PE.ISO8859-15', +- 'es_pe@euro': 'es_PE.ISO8859-15', + 'es_pr': 'es_PR.ISO8859-1', +- 'es_pr.iso88591': 'es_PR.ISO8859-1', + 'es_py': 'es_PY.ISO8859-1', +- 'es_py.iso88591': 'es_PY.ISO8859-1', +- 'es_py.iso885915': 'es_PY.ISO8859-15', +- 'es_py@euro': 'es_PY.ISO8859-15', + 'es_sv': 'es_SV.ISO8859-1', +- 'es_sv.iso88591': 'es_SV.ISO8859-1', +- 'es_sv.iso885915': 'es_SV.ISO8859-15', +- 'es_sv@euro': 'es_SV.ISO8859-15', + 'es_us': 'es_US.ISO8859-1', +- 'es_us.iso88591': 'es_US.ISO8859-1', + 'es_uy': 'es_UY.ISO8859-1', +- 'es_uy.iso88591': 'es_UY.ISO8859-1', +- 'es_uy.iso885915': 'es_UY.ISO8859-15', +- 'es_uy@euro': 'es_UY.ISO8859-15', + 'es_ve': 'es_VE.ISO8859-1', +- 'es_ve.iso88591': 'es_VE.ISO8859-1', +- 'es_ve.iso885915': 'es_VE.ISO8859-15', +- 'es_ve@euro': 'es_VE.ISO8859-15', + 'estonian': 'et_EE.ISO8859-1', + 'et': 'et_EE.ISO8859-15', + 'et_ee': 'et_EE.ISO8859-15', +- 'et_ee.iso88591': 'et_EE.ISO8859-1', +- 'et_ee.iso885913': 'et_EE.ISO8859-13', +- 'et_ee.iso885915': 'et_EE.ISO8859-15', +- 'et_ee.iso88594': 'et_EE.ISO8859-4', +- 'et_ee@euro': 'et_EE.ISO8859-15', + 'eu': 'eu_ES.ISO8859-1', + 'eu_es': 'eu_ES.ISO8859-1', +- 'eu_es.iso88591': 'eu_ES.ISO8859-1', +- 'eu_es.iso885915': 'eu_ES.ISO8859-15', +- 'eu_es.iso885915@euro': 'eu_ES.ISO8859-15', +- 'eu_es.utf8@euro': 'eu_ES.UTF-8', +- 'eu_es@euro': 'eu_ES.ISO8859-15', + 'fa': 'fa_IR.UTF-8', + 'fa_ir': 'fa_IR.UTF-8', + 'fa_ir.isiri3342': 'fa_IR.ISIRI-3342', + 'fi': 'fi_FI.ISO8859-15', +- 'fi.iso885915': 'fi_FI.ISO8859-15', + 'fi_fi': 'fi_FI.ISO8859-15', +- 'fi_fi.88591': 'fi_FI.ISO8859-1', +- 'fi_fi.iso88591': 'fi_FI.ISO8859-1', +- 'fi_fi.iso885915': 'fi_FI.ISO8859-15', +- 'fi_fi.iso885915@euro': 'fi_FI.ISO8859-15', +- 'fi_fi.utf8@euro': 'fi_FI.UTF-8', +- 'fi_fi@euro': 'fi_FI.ISO8859-15', + 'finnish': 'fi_FI.ISO8859-1', +- 'finnish.iso88591': 'fi_FI.ISO8859-1', + 'fo': 'fo_FO.ISO8859-1', + 'fo_fo': 'fo_FO.ISO8859-1', +- 'fo_fo.iso88591': 'fo_FO.ISO8859-1', +- 'fo_fo.iso885915': 'fo_FO.ISO8859-15', +- 'fo_fo@euro': 'fo_FO.ISO8859-15', + 'fr': 'fr_FR.ISO8859-1', +- 'fr.iso885915': 'fr_FR.ISO8859-15', + 'fr_be': 'fr_BE.ISO8859-1', +- 'fr_be.88591': 'fr_BE.ISO8859-1', +- 'fr_be.iso88591': 'fr_BE.ISO8859-1', +- 'fr_be.iso885915': 'fr_BE.ISO8859-15', +- 'fr_be.iso885915@euro': 'fr_BE.ISO8859-15', +- 'fr_be.utf8@euro': 'fr_BE.UTF-8', +- 'fr_be@euro': 'fr_BE.ISO8859-15', + 'fr_ca': 'fr_CA.ISO8859-1', +- 'fr_ca.88591': 'fr_CA.ISO8859-1', +- 'fr_ca.iso88591': 'fr_CA.ISO8859-1', +- 'fr_ca.iso885915': 'fr_CA.ISO8859-15', +- 'fr_ca@euro': 'fr_CA.ISO8859-15', + 'fr_ch': 'fr_CH.ISO8859-1', +- 'fr_ch.88591': 'fr_CH.ISO8859-1', +- 'fr_ch.iso88591': 'fr_CH.ISO8859-1', +- 'fr_ch.iso885915': 'fr_CH.ISO8859-15', +- 'fr_ch@euro': 'fr_CH.ISO8859-15', + 'fr_fr': 'fr_FR.ISO8859-1', +- 'fr_fr.88591': 'fr_FR.ISO8859-1', +- 'fr_fr.iso88591': 'fr_FR.ISO8859-1', +- 'fr_fr.iso885915': 'fr_FR.ISO8859-15', +- 'fr_fr.iso885915@euro': 'fr_FR.ISO8859-15', +- 'fr_fr.utf8@euro': 'fr_FR.UTF-8', +- 'fr_fr@euro': 'fr_FR.ISO8859-15', + 'fr_lu': 'fr_LU.ISO8859-1', +- 'fr_lu.88591': 'fr_LU.ISO8859-1', +- 'fr_lu.iso88591': 'fr_LU.ISO8859-1', +- 'fr_lu.iso885915': 'fr_LU.ISO8859-15', +- 'fr_lu.iso885915@euro': 'fr_LU.ISO8859-15', +- 'fr_lu.utf8@euro': 'fr_LU.UTF-8', +- 'fr_lu@euro': 'fr_LU.ISO8859-15', + 'fran\xe7ais': 'fr_FR.ISO8859-1', + 'fre_fr': 'fr_FR.ISO8859-1', +- 'fre_fr.8859': 'fr_FR.ISO8859-1', + 'french': 'fr_FR.ISO8859-1', + 'french.iso88591': 'fr_CH.ISO8859-1', + 'french_france': 'fr_FR.ISO8859-1', +- 'french_france.8859': 'fr_FR.ISO8859-1', + 'ga': 'ga_IE.ISO8859-1', + 'ga_ie': 'ga_IE.ISO8859-1', +- 'ga_ie.iso88591': 'ga_IE.ISO8859-1', +- 'ga_ie.iso885914': 'ga_IE.ISO8859-14', +- 'ga_ie.iso885915': 'ga_IE.ISO8859-15', +- 'ga_ie.iso885915@euro': 'ga_IE.ISO8859-15', +- 'ga_ie.utf8@euro': 'ga_IE.UTF-8', +- 'ga_ie@euro': 'ga_IE.ISO8859-15', + 'galego': 'gl_ES.ISO8859-1', + 'galician': 'gl_ES.ISO8859-1', + 'gd': 'gd_GB.ISO8859-1', + 'gd_gb': 'gd_GB.ISO8859-1', +- 'gd_gb.iso88591': 'gd_GB.ISO8859-1', +- 'gd_gb.iso885914': 'gd_GB.ISO8859-14', +- 'gd_gb.iso885915': 'gd_GB.ISO8859-15', +- 'gd_gb@euro': 'gd_GB.ISO8859-15', + 'ger_de': 'de_DE.ISO8859-1', +- 'ger_de.8859': 'de_DE.ISO8859-1', + 'german': 'de_DE.ISO8859-1', + 'german.iso88591': 'de_CH.ISO8859-1', + 'german_germany': 'de_DE.ISO8859-1', +- 'german_germany.8859': 'de_DE.ISO8859-1', + 'gl': 'gl_ES.ISO8859-1', + 'gl_es': 'gl_ES.ISO8859-1', +- 'gl_es.iso88591': 'gl_ES.ISO8859-1', +- 'gl_es.iso885915': 'gl_ES.ISO8859-15', +- 'gl_es.iso885915@euro': 'gl_ES.ISO8859-15', +- 'gl_es.utf8@euro': 'gl_ES.UTF-8', +- 'gl_es@euro': 'gl_ES.ISO8859-15', + 'greek': 'el_GR.ISO8859-7', +- 'greek.iso88597': 'el_GR.ISO8859-7', + 'gu_in': 'gu_IN.UTF-8', + 'gv': 'gv_GB.ISO8859-1', + 'gv_gb': 'gv_GB.ISO8859-1', +- 'gv_gb.iso88591': 'gv_GB.ISO8859-1', +- 'gv_gb.iso885914': 'gv_GB.ISO8859-14', +- 'gv_gb.iso885915': 'gv_GB.ISO8859-15', +- 'gv_gb@euro': 'gv_GB.ISO8859-15', + 'he': 'he_IL.ISO8859-8', + 'he_il': 'he_IL.ISO8859-8', +- 'he_il.cp1255': 'he_IL.CP1255', +- 'he_il.iso88598': 'he_IL.ISO8859-8', +- 'he_il.microsoftcp1255': 'he_IL.CP1255', +- 'hebrew': 'iw_IL.ISO8859-8', +- 'hebrew.iso88598': 'iw_IL.ISO8859-8', ++ 'hebrew': 'he_IL.ISO8859-8', + 'hi': 'hi_IN.ISCII-DEV', + 'hi_in': 'hi_IN.ISCII-DEV', + 'hi_in.isciidev': 'hi_IN.ISCII-DEV', + 'hne': 'hne_IN.UTF-8', ++ 'hne_in': 'hne_IN.UTF-8', + 'hr': 'hr_HR.ISO8859-2', + 'hr_hr': 'hr_HR.ISO8859-2', +- 'hr_hr.iso88592': 'hr_HR.ISO8859-2', + 'hrvatski': 'hr_HR.ISO8859-2', + 'hu': 'hu_HU.ISO8859-2', + 'hu_hu': 'hu_HU.ISO8859-2', +- 'hu_hu.iso88592': 'hu_HU.ISO8859-2', + 'hungarian': 'hu_HU.ISO8859-2', + 'icelandic': 'is_IS.ISO8859-1', +- 'icelandic.iso88591': 'is_IS.ISO8859-1', + 'id': 'id_ID.ISO8859-1', + 'id_id': 'id_ID.ISO8859-1', + 'in': 'id_ID.ISO8859-1', + 'in_id': 'id_ID.ISO8859-1', + 'is': 'is_IS.ISO8859-1', + 'is_is': 'is_IS.ISO8859-1', +- 'is_is.iso88591': 'is_IS.ISO8859-1', +- 'is_is.iso885915': 'is_IS.ISO8859-15', +- 'is_is@euro': 'is_IS.ISO8859-15', + 'iso-8859-1': 'en_US.ISO8859-1', + 'iso-8859-15': 'en_US.ISO8859-15', + 'iso8859-1': 'en_US.ISO8859-1', +@@ -1191,46 +1027,23 @@ + 'iso_8859_1': 'en_US.ISO8859-1', + 'iso_8859_15': 'en_US.ISO8859-15', + 'it': 'it_IT.ISO8859-1', +- 'it.iso885915': 'it_IT.ISO8859-15', + 'it_ch': 'it_CH.ISO8859-1', +- 'it_ch.iso88591': 'it_CH.ISO8859-1', +- 'it_ch.iso885915': 'it_CH.ISO8859-15', +- 'it_ch@euro': 'it_CH.ISO8859-15', + 'it_it': 'it_IT.ISO8859-1', +- 'it_it.88591': 'it_IT.ISO8859-1', +- 'it_it.iso88591': 'it_IT.ISO8859-1', +- 'it_it.iso885915': 'it_IT.ISO8859-15', +- 'it_it.iso885915@euro': 'it_IT.ISO8859-15', +- 'it_it.utf8@euro': 'it_IT.UTF-8', +- 'it_it@euro': 'it_IT.ISO8859-15', + 'italian': 'it_IT.ISO8859-1', +- 'italian.iso88591': 'it_IT.ISO8859-1', + 'iu': 'iu_CA.NUNACOM-8', + 'iu_ca': 'iu_CA.NUNACOM-8', + 'iu_ca.nunacom8': 'iu_CA.NUNACOM-8', + 'iw': 'he_IL.ISO8859-8', + 'iw_il': 'he_IL.ISO8859-8', +- 'iw_il.iso88598': 'he_IL.ISO8859-8', + 'ja': 'ja_JP.eucJP', +- 'ja.jis': 'ja_JP.JIS7', +- 'ja.sjis': 'ja_JP.SJIS', + 'ja_jp': 'ja_JP.eucJP', +- 'ja_jp.ajec': 'ja_JP.eucJP', + 'ja_jp.euc': 'ja_JP.eucJP', +- 'ja_jp.eucjp': 'ja_JP.eucJP', +- 'ja_jp.iso-2022-jp': 'ja_JP.JIS7', +- 'ja_jp.iso2022jp': 'ja_JP.JIS7', +- 'ja_jp.jis': 'ja_JP.JIS7', +- 'ja_jp.jis7': 'ja_JP.JIS7', + 'ja_jp.mscode': 'ja_JP.SJIS', + 'ja_jp.pck': 'ja_JP.SJIS', +- 'ja_jp.sjis': 'ja_JP.SJIS', +- 'ja_jp.ujis': 'ja_JP.eucJP', + 'japan': 'ja_JP.eucJP', + 'japanese': 'ja_JP.eucJP', + 'japanese-euc': 'ja_JP.eucJP', + 'japanese.euc': 'ja_JP.eucJP', +- 'japanese.sjis': 'ja_JP.SJIS', + 'jp_jp': 'ja_JP.eucJP', + 'ka': 'ka_GE.GEORGIAN-ACADEMY', + 'ka_ge': 'ka_GE.GEORGIAN-ACADEMY', +@@ -1239,26 +1052,18 @@ + 'ka_ge.georgianrs': 'ka_GE.GEORGIAN-ACADEMY', + 'kl': 'kl_GL.ISO8859-1', + 'kl_gl': 'kl_GL.ISO8859-1', +- 'kl_gl.iso88591': 'kl_GL.ISO8859-1', +- 'kl_gl.iso885915': 'kl_GL.ISO8859-15', +- 'kl_gl@euro': 'kl_GL.ISO8859-15', + 'km_kh': 'km_KH.UTF-8', + 'kn': 'kn_IN.UTF-8', + 'kn_in': 'kn_IN.UTF-8', + 'ko': 'ko_KR.eucKR', + 'ko_kr': 'ko_KR.eucKR', + 'ko_kr.euc': 'ko_KR.eucKR', +- 'ko_kr.euckr': 'ko_KR.eucKR', + 'korean': 'ko_KR.eucKR', + 'korean.euc': 'ko_KR.eucKR', + 'ks': 'ks_IN.UTF-8', +- 'ks_in@devanagari': 'ks_IN@devanagari.UTF-8', ++ 'ks_in': 'ks_IN.UTF-8', + 'kw': 'kw_GB.ISO8859-1', + 'kw_gb': 'kw_GB.ISO8859-1', +- 'kw_gb.iso88591': 'kw_GB.ISO8859-1', +- 'kw_gb.iso885914': 'kw_GB.ISO8859-14', +- 'kw_gb.iso885915': 'kw_GB.ISO8859-15', +- 'kw_gb@euro': 'kw_GB.ISO8859-15', + 'ky': 'ky_KG.UTF-8', + 'ky_kg': 'ky_KG.UTF-8', + 'lithuanian': 'lt_LT.ISO8859-13', +@@ -1269,150 +1074,78 @@ + 'lo_la.mulelao1': 'lo_LA.MULELAO-1', + 'lt': 'lt_LT.ISO8859-13', + 'lt_lt': 'lt_LT.ISO8859-13', +- 'lt_lt.iso885913': 'lt_LT.ISO8859-13', +- 'lt_lt.iso88594': 'lt_LT.ISO8859-4', + 'lv': 'lv_LV.ISO8859-13', + 'lv_lv': 'lv_LV.ISO8859-13', +- 'lv_lv.iso885913': 'lv_LV.ISO8859-13', +- 'lv_lv.iso88594': 'lv_LV.ISO8859-4', + 'mai': 'mai_IN.UTF-8', ++ 'mai_in': 'mai_IN.UTF-8', + 'mi': 'mi_NZ.ISO8859-1', + 'mi_nz': 'mi_NZ.ISO8859-1', +- 'mi_nz.iso88591': 'mi_NZ.ISO8859-1', + 'mk': 'mk_MK.ISO8859-5', + 'mk_mk': 'mk_MK.ISO8859-5', +- 'mk_mk.cp1251': 'mk_MK.CP1251', +- 'mk_mk.iso88595': 'mk_MK.ISO8859-5', +- 'mk_mk.microsoftcp1251': 'mk_MK.CP1251', + 'ml': 'ml_IN.UTF-8', ++ 'ml_in': 'ml_IN.UTF-8', + 'mr': 'mr_IN.UTF-8', + 'mr_in': 'mr_IN.UTF-8', + 'ms': 'ms_MY.ISO8859-1', + 'ms_my': 'ms_MY.ISO8859-1', +- 'ms_my.iso88591': 'ms_MY.ISO8859-1', + 'mt': 'mt_MT.ISO8859-3', + 'mt_mt': 'mt_MT.ISO8859-3', +- 'mt_mt.iso88593': 'mt_MT.ISO8859-3', + 'nb': 'nb_NO.ISO8859-1', + 'nb_no': 'nb_NO.ISO8859-1', +- 'nb_no.88591': 'nb_NO.ISO8859-1', +- 'nb_no.iso88591': 'nb_NO.ISO8859-1', +- 'nb_no.iso885915': 'nb_NO.ISO8859-15', +- 'nb_no@euro': 'nb_NO.ISO8859-15', ++ 'ne_np': 'ne_NP.UTF-8', + 'nl': 'nl_NL.ISO8859-1', +- 'nl.iso885915': 'nl_NL.ISO8859-15', + 'nl_be': 'nl_BE.ISO8859-1', +- 'nl_be.88591': 'nl_BE.ISO8859-1', +- 'nl_be.iso88591': 'nl_BE.ISO8859-1', +- 'nl_be.iso885915': 'nl_BE.ISO8859-15', +- 'nl_be.iso885915@euro': 'nl_BE.ISO8859-15', +- 'nl_be.utf8@euro': 'nl_BE.UTF-8', +- 'nl_be@euro': 'nl_BE.ISO8859-15', + 'nl_nl': 'nl_NL.ISO8859-1', +- 'nl_nl.88591': 'nl_NL.ISO8859-1', +- 'nl_nl.iso88591': 'nl_NL.ISO8859-1', +- 'nl_nl.iso885915': 'nl_NL.ISO8859-15', +- 'nl_nl.iso885915@euro': 'nl_NL.ISO8859-15', +- 'nl_nl.utf8@euro': 'nl_NL.UTF-8', +- 'nl_nl@euro': 'nl_NL.ISO8859-15', + 'nn': 'nn_NO.ISO8859-1', + 'nn_no': 'nn_NO.ISO8859-1', +- 'nn_no.88591': 'nn_NO.ISO8859-1', +- 'nn_no.iso88591': 'nn_NO.ISO8859-1', +- 'nn_no.iso885915': 'nn_NO.ISO8859-15', +- 'nn_no@euro': 'nn_NO.ISO8859-15', + 'no': 'no_NO.ISO8859-1', + 'no@nynorsk': 'ny_NO.ISO8859-1', + 'no_no': 'no_NO.ISO8859-1', +- 'no_no.88591': 'no_NO.ISO8859-1', +- 'no_no.iso88591': 'no_NO.ISO8859-1', +- 'no_no.iso885915': 'no_NO.ISO8859-15', + 'no_no.iso88591@bokmal': 'no_NO.ISO8859-1', + 'no_no.iso88591@nynorsk': 'no_NO.ISO8859-1', +- 'no_no@euro': 'no_NO.ISO8859-15', + 'norwegian': 'no_NO.ISO8859-1', +- 'norwegian.iso88591': 'no_NO.ISO8859-1', + 'nr': 'nr_ZA.ISO8859-1', + 'nr_za': 'nr_ZA.ISO8859-1', +- 'nr_za.iso88591': 'nr_ZA.ISO8859-1', + 'nso': 'nso_ZA.ISO8859-15', + 'nso_za': 'nso_ZA.ISO8859-15', +- 'nso_za.iso885915': 'nso_ZA.ISO8859-15', + 'ny': 'ny_NO.ISO8859-1', + 'ny_no': 'ny_NO.ISO8859-1', +- 'ny_no.88591': 'ny_NO.ISO8859-1', +- 'ny_no.iso88591': 'ny_NO.ISO8859-1', +- 'ny_no.iso885915': 'ny_NO.ISO8859-15', +- 'ny_no@euro': 'ny_NO.ISO8859-15', + 'nynorsk': 'nn_NO.ISO8859-1', + 'oc': 'oc_FR.ISO8859-1', + 'oc_fr': 'oc_FR.ISO8859-1', +- 'oc_fr.iso88591': 'oc_FR.ISO8859-1', +- 'oc_fr.iso885915': 'oc_FR.ISO8859-15', +- 'oc_fr@euro': 'oc_FR.ISO8859-15', + 'or': 'or_IN.UTF-8', ++ 'or_in': 'or_IN.UTF-8', + 'pa': 'pa_IN.UTF-8', + 'pa_in': 'pa_IN.UTF-8', + 'pd': 'pd_US.ISO8859-1', + 'pd_de': 'pd_DE.ISO8859-1', +- 'pd_de.iso88591': 'pd_DE.ISO8859-1', +- 'pd_de.iso885915': 'pd_DE.ISO8859-15', +- 'pd_de@euro': 'pd_DE.ISO8859-15', + 'pd_us': 'pd_US.ISO8859-1', +- 'pd_us.iso88591': 'pd_US.ISO8859-1', +- 'pd_us.iso885915': 'pd_US.ISO8859-15', +- 'pd_us@euro': 'pd_US.ISO8859-15', + 'ph': 'ph_PH.ISO8859-1', + 'ph_ph': 'ph_PH.ISO8859-1', +- 'ph_ph.iso88591': 'ph_PH.ISO8859-1', + 'pl': 'pl_PL.ISO8859-2', + 'pl_pl': 'pl_PL.ISO8859-2', +- 'pl_pl.iso88592': 'pl_PL.ISO8859-2', + 'polish': 'pl_PL.ISO8859-2', + 'portuguese': 'pt_PT.ISO8859-1', +- 'portuguese.iso88591': 'pt_PT.ISO8859-1', + 'portuguese_brazil': 'pt_BR.ISO8859-1', +- 'portuguese_brazil.8859': 'pt_BR.ISO8859-1', + 'posix': 'C', + 'posix-utf2': 'C', + 'pp': 'pp_AN.ISO8859-1', + 'pp_an': 'pp_AN.ISO8859-1', +- 'pp_an.iso88591': 'pp_AN.ISO8859-1', + 'pt': 'pt_PT.ISO8859-1', +- 'pt.iso885915': 'pt_PT.ISO8859-15', + 'pt_br': 'pt_BR.ISO8859-1', +- 'pt_br.88591': 'pt_BR.ISO8859-1', +- 'pt_br.iso88591': 'pt_BR.ISO8859-1', +- 'pt_br.iso885915': 'pt_BR.ISO8859-15', +- 'pt_br@euro': 'pt_BR.ISO8859-15', + 'pt_pt': 'pt_PT.ISO8859-1', +- 'pt_pt.88591': 'pt_PT.ISO8859-1', +- 'pt_pt.iso88591': 'pt_PT.ISO8859-1', +- 'pt_pt.iso885915': 'pt_PT.ISO8859-15', +- 'pt_pt.iso885915@euro': 'pt_PT.ISO8859-15', +- 'pt_pt.utf8@euro': 'pt_PT.UTF-8', +- 'pt_pt@euro': 'pt_PT.ISO8859-15', + 'ro': 'ro_RO.ISO8859-2', + 'ro_ro': 'ro_RO.ISO8859-2', +- 'ro_ro.iso88592': 'ro_RO.ISO8859-2', + 'romanian': 'ro_RO.ISO8859-2', + 'ru': 'ru_RU.UTF-8', +- 'ru.koi8r': 'ru_RU.KOI8-R', + 'ru_ru': 'ru_RU.UTF-8', +- 'ru_ru.cp1251': 'ru_RU.CP1251', +- 'ru_ru.iso88595': 'ru_RU.ISO8859-5', +- 'ru_ru.koi8r': 'ru_RU.KOI8-R', +- 'ru_ru.microsoftcp1251': 'ru_RU.CP1251', + 'ru_ua': 'ru_UA.KOI8-U', +- 'ru_ua.cp1251': 'ru_UA.CP1251', +- 'ru_ua.koi8u': 'ru_UA.KOI8-U', +- 'ru_ua.microsoftcp1251': 'ru_UA.CP1251', + 'rumanian': 'ro_RO.ISO8859-2', + 'russian': 'ru_RU.ISO8859-5', + 'rw': 'rw_RW.ISO8859-1', + 'rw_rw': 'rw_RW.ISO8859-1', +- 'rw_rw.iso88591': 'rw_RW.ISO8859-1', +- 'sd': 'sd_IN@devanagari.UTF-8', ++ 'sd': 'sd_IN.UTF-8', ++ 'sd_in': 'sd_IN.UTF-8', + 'se_no': 'se_NO.UTF-8', + 'serbocroatian': 'sr_RS.UTF-8@latin', + 'sh': 'sr_RS.UTF-8@latin', +@@ -1426,37 +1159,26 @@ + 'sinhala': 'si_LK.UTF-8', + 'sk': 'sk_SK.ISO8859-2', + 'sk_sk': 'sk_SK.ISO8859-2', +- 'sk_sk.iso88592': 'sk_SK.ISO8859-2', + 'sl': 'sl_SI.ISO8859-2', + 'sl_cs': 'sl_CS.ISO8859-2', + 'sl_si': 'sl_SI.ISO8859-2', +- 'sl_si.iso88592': 'sl_SI.ISO8859-2', + 'slovak': 'sk_SK.ISO8859-2', + 'slovene': 'sl_SI.ISO8859-2', + 'slovenian': 'sl_SI.ISO8859-2', + 'sp': 'sr_CS.ISO8859-5', + 'sp_yu': 'sr_CS.ISO8859-5', + 'spanish': 'es_ES.ISO8859-1', +- 'spanish.iso88591': 'es_ES.ISO8859-1', + 'spanish_spain': 'es_ES.ISO8859-1', +- 'spanish_spain.8859': 'es_ES.ISO8859-1', + 'sq': 'sq_AL.ISO8859-2', + 'sq_al': 'sq_AL.ISO8859-2', +- 'sq_al.iso88592': 'sq_AL.ISO8859-2', + 'sr': 'sr_RS.UTF-8', + 'sr@cyrillic': 'sr_RS.UTF-8', +- 'sr@latin': 'sr_RS.UTF-8@latin', +- 'sr@latn': 'sr_RS.UTF-8@latin', +- 'sr_cs': 'sr_RS.UTF-8', +- 'sr_cs.iso88592': 'sr_CS.ISO8859-2', ++ 'sr@latn': 'sr_CS.UTF-8@latin', ++ 'sr_cs': 'sr_CS.UTF-8', + 'sr_cs.iso88592@latn': 'sr_CS.ISO8859-2', +- 'sr_cs.iso88595': 'sr_CS.ISO8859-5', +- 'sr_cs.utf8@latn': 'sr_RS.UTF-8@latin', +- 'sr_cs@latn': 'sr_RS.UTF-8@latin', ++ 'sr_cs@latn': 'sr_CS.UTF-8@latin', + 'sr_me': 'sr_ME.UTF-8', + 'sr_rs': 'sr_RS.UTF-8', +- 'sr_rs.utf8@latn': 'sr_RS.UTF-8@latin', +- 'sr_rs@latin': 'sr_RS.UTF-8@latin', + 'sr_rs@latn': 'sr_RS.UTF-8@latin', + 'sr_sp': 'sr_CS.ISO8859-2', + 'sr_yu': 'sr_RS.UTF-8@latin', +@@ -1465,29 +1187,15 @@ + 'sr_yu.iso88595': 'sr_CS.ISO8859-5', + 'sr_yu.iso88595@cyrillic': 'sr_CS.ISO8859-5', + 'sr_yu.microsoftcp1251@cyrillic': 'sr_CS.CP1251', +- 'sr_yu.utf8@cyrillic': 'sr_RS.UTF-8', + 'sr_yu@cyrillic': 'sr_RS.UTF-8', + 'ss': 'ss_ZA.ISO8859-1', + 'ss_za': 'ss_ZA.ISO8859-1', +- 'ss_za.iso88591': 'ss_ZA.ISO8859-1', + 'st': 'st_ZA.ISO8859-1', + 'st_za': 'st_ZA.ISO8859-1', +- 'st_za.iso88591': 'st_ZA.ISO8859-1', + 'sv': 'sv_SE.ISO8859-1', +- 'sv.iso885915': 'sv_SE.ISO8859-15', + 'sv_fi': 'sv_FI.ISO8859-1', +- 'sv_fi.iso88591': 'sv_FI.ISO8859-1', +- 'sv_fi.iso885915': 'sv_FI.ISO8859-15', +- 'sv_fi.iso885915@euro': 'sv_FI.ISO8859-15', +- 'sv_fi.utf8@euro': 'sv_FI.UTF-8', +- 'sv_fi@euro': 'sv_FI.ISO8859-15', + 'sv_se': 'sv_SE.ISO8859-1', +- 'sv_se.88591': 'sv_SE.ISO8859-1', +- 'sv_se.iso88591': 'sv_SE.ISO8859-1', +- 'sv_se.iso885915': 'sv_SE.ISO8859-15', +- 'sv_se@euro': 'sv_SE.ISO8859-15', + 'swedish': 'sv_SE.ISO8859-1', +- 'swedish.iso88591': 'sv_SE.ISO8859-1', + 'ta': 'ta_IN.TSCII-0', + 'ta_in': 'ta_IN.TSCII-0', + 'ta_in.tscii': 'ta_IN.TSCII-0', +@@ -1495,48 +1203,33 @@ + 'te': 'te_IN.UTF-8', + 'tg': 'tg_TJ.KOI8-C', + 'tg_tj': 'tg_TJ.KOI8-C', +- 'tg_tj.koi8c': 'tg_TJ.KOI8-C', + 'th': 'th_TH.ISO8859-11', + 'th_th': 'th_TH.ISO8859-11', +- 'th_th.iso885911': 'th_TH.ISO8859-11', + 'th_th.tactis': 'th_TH.TIS620', + 'th_th.tis620': 'th_TH.TIS620', + 'thai': 'th_TH.ISO8859-11', + 'tl': 'tl_PH.ISO8859-1', + 'tl_ph': 'tl_PH.ISO8859-1', +- 'tl_ph.iso88591': 'tl_PH.ISO8859-1', + 'tn': 'tn_ZA.ISO8859-15', + 'tn_za': 'tn_ZA.ISO8859-15', +- 'tn_za.iso885915': 'tn_ZA.ISO8859-15', + 'tr': 'tr_TR.ISO8859-9', + 'tr_tr': 'tr_TR.ISO8859-9', +- 'tr_tr.iso88599': 'tr_TR.ISO8859-9', + 'ts': 'ts_ZA.ISO8859-1', + 'ts_za': 'ts_ZA.ISO8859-1', +- 'ts_za.iso88591': 'ts_ZA.ISO8859-1', + 'tt': 'tt_RU.TATAR-CYR', + 'tt_ru': 'tt_RU.TATAR-CYR', +- 'tt_ru.koi8c': 'tt_RU.KOI8-C', + 'tt_ru.tatarcyr': 'tt_RU.TATAR-CYR', + 'turkish': 'tr_TR.ISO8859-9', +- 'turkish.iso88599': 'tr_TR.ISO8859-9', + 'uk': 'uk_UA.KOI8-U', + 'uk_ua': 'uk_UA.KOI8-U', +- 'uk_ua.cp1251': 'uk_UA.CP1251', +- 'uk_ua.iso88595': 'uk_UA.ISO8859-5', +- 'uk_ua.koi8u': 'uk_UA.KOI8-U', +- 'uk_ua.microsoftcp1251': 'uk_UA.CP1251', + 'univ': 'en_US.utf', + 'universal': 'en_US.utf', + 'universal.utf8@ucs4': 'en_US.UTF-8', + 'ur': 'ur_PK.CP1256', ++ 'ur_in': 'ur_IN.UTF-8', + 'ur_pk': 'ur_PK.CP1256', +- 'ur_pk.cp1256': 'ur_PK.CP1256', +- 'ur_pk.microsoftcp1256': 'ur_PK.CP1256', + 'uz': 'uz_UZ.UTF-8', + 'uz_uz': 'uz_UZ.UTF-8', +- 'uz_uz.iso88591': 'uz_UZ.ISO8859-1', +- 'uz_uz.utf8@cyrillic': 'uz_UZ.UTF-8', + 'uz_uz@cyrillic': 'uz_UZ.UTF-8', + 've': 've_ZA.UTF-8', + 've_za': 've_ZA.UTF-8', +@@ -1548,35 +1241,21 @@ + 'vi_vn.viscii111': 'vi_VN.VISCII', + 'wa': 'wa_BE.ISO8859-1', + 'wa_be': 'wa_BE.ISO8859-1', +- 'wa_be.iso88591': 'wa_BE.ISO8859-1', +- 'wa_be.iso885915': 'wa_BE.ISO8859-15', +- 'wa_be.iso885915@euro': 'wa_BE.ISO8859-15', +- 'wa_be@euro': 'wa_BE.ISO8859-15', + 'xh': 'xh_ZA.ISO8859-1', + 'xh_za': 'xh_ZA.ISO8859-1', +- 'xh_za.iso88591': 'xh_ZA.ISO8859-1', + 'yi': 'yi_US.CP1255', + 'yi_us': 'yi_US.CP1255', +- 'yi_us.cp1255': 'yi_US.CP1255', +- 'yi_us.microsoftcp1255': 'yi_US.CP1255', + 'zh': 'zh_CN.eucCN', + 'zh_cn': 'zh_CN.gb2312', + 'zh_cn.big5': 'zh_TW.big5', + 'zh_cn.euc': 'zh_CN.eucCN', +- 'zh_cn.gb18030': 'zh_CN.gb18030', +- 'zh_cn.gb2312': 'zh_CN.gb2312', +- 'zh_cn.gbk': 'zh_CN.gbk', + 'zh_hk': 'zh_HK.big5hkscs', +- 'zh_hk.big5': 'zh_HK.big5', + 'zh_hk.big5hk': 'zh_HK.big5hkscs', +- 'zh_hk.big5hkscs': 'zh_HK.big5hkscs', + 'zh_tw': 'zh_TW.big5', +- 'zh_tw.big5': 'zh_TW.big5', + 'zh_tw.euc': 'zh_TW.eucTW', + 'zh_tw.euctw': 'zh_TW.eucTW', + 'zu': 'zu_ZA.ISO8859-1', + 'zu_za': 'zu_ZA.ISO8859-1', +- 'zu_za.iso88591': 'zu_ZA.ISO8859-1', + } + + # +diff -r 3405dc9a6afa Lib/lzma.py +--- a/Lib/lzma.py ++++ b/Lib/lzma.py +@@ -225,11 +225,18 @@ + raise EOFError("Compressed file ended before the " + "end-of-stream marker was reached") + +- # Continue to next stream. + if self._decompressor.eof: ++ # Continue to next stream. + self._decompressor = LZMADecompressor(**self._init_args) +- +- self._buffer = self._decompressor.decompress(rawblock) ++ try: ++ self._buffer = self._decompressor.decompress(rawblock) ++ except LZMAError: ++ # Trailing data isn't a valid compressed stream; ignore it. ++ self._mode = _MODE_READ_EOF ++ self._size = self._pos ++ return False ++ else: ++ self._buffer = self._decompressor.decompress(rawblock) + self._buffer_offset = 0 + return True + +@@ -487,11 +494,18 @@ + results = [] + while True: + decomp = LZMADecompressor(format, memlimit, filters) +- results.append(decomp.decompress(data)) ++ try: ++ res = decomp.decompress(data) ++ except LZMAError: ++ if results: ++ break # Leftover data is not a valid LZMA/XZ stream; ignore it. ++ else: ++ raise # Error on the first iteration; bail out. ++ results.append(res) + if not decomp.eof: + raise LZMAError("Compressed data ended before the " + "end-of-stream marker was reached") +- if not decomp.unused_data: +- return b"".join(results) +- # There is unused data left over. Proceed to next stream. + data = decomp.unused_data ++ if not data: ++ break ++ return b"".join(results) +diff -r 3405dc9a6afa Lib/multiprocessing/spawn.py +--- a/Lib/multiprocessing/spawn.py ++++ b/Lib/multiprocessing/spawn.py +@@ -11,6 +11,8 @@ + import os + import pickle + import sys ++import runpy ++import types + + from . import get_start_method, set_start_method + from . import process +@@ -157,15 +159,19 @@ + start_method=get_start_method(), + ) + +- if sys.platform != 'win32' or (not WINEXE and not WINSERVICE): +- main_path = getattr(sys.modules['__main__'], '__file__', None) +- if not main_path and sys.argv[0] not in ('', '-c'): +- main_path = sys.argv[0] ++ # Figure out whether to initialise main in the subprocess as a module ++ # or through direct execution (or to leave it alone entirely) ++ main_module = sys.modules['__main__'] ++ main_mod_name = getattr(main_module.__spec__, "name", None) ++ if main_mod_name is not None: ++ d['init_main_from_name'] = main_mod_name ++ elif sys.platform != 'win32' or (not WINEXE and not WINSERVICE): ++ main_path = getattr(main_module, '__file__', None) + if main_path is not None: + if (not os.path.isabs(main_path) and + process.ORIGINAL_DIR is not None): + main_path = os.path.join(process.ORIGINAL_DIR, main_path) +- d['main_path'] = os.path.normpath(main_path) ++ d['init_main_from_path'] = os.path.normpath(main_path) + + return d + +@@ -206,53 +212,68 @@ + if 'start_method' in data: + set_start_method(data['start_method']) + +- if 'main_path' in data: +- import_main_path(data['main_path']) ++ if 'init_main_from_name' in data: ++ _fixup_main_from_name(data['init_main_from_name']) ++ elif 'init_main_from_path' in data: ++ _fixup_main_from_path(data['init_main_from_path']) ++ ++# Multiprocessing module helpers to fix up the main module in ++# spawned subprocesses ++def _fixup_main_from_name(mod_name): ++ # __main__.py files for packages, directories, zip archives, etc, run ++ # their "main only" code unconditionally, so we don't even try to ++ # populate anything in __main__, nor do we make any changes to ++ # __main__ attributes ++ current_main = sys.modules['__main__'] ++ if mod_name == "__main__" or mod_name.endswith(".__main__"): ++ return ++ ++ # If this process was forked, __main__ may already be populated ++ if getattr(current_main.__spec__, "name", None) == mod_name: ++ return ++ ++ # Otherwise, __main__ may contain some non-main code where we need to ++ # support unpickling it properly. We rerun it as __mp_main__ and make ++ # the normal __main__ an alias to that ++ old_main_modules.append(current_main) ++ main_module = types.ModuleType("__mp_main__") ++ main_content = runpy.run_module(mod_name, ++ run_name="__mp_main__", ++ alter_sys=True) ++ main_module.__dict__.update(main_content) ++ sys.modules['__main__'] = sys.modules['__mp_main__'] = main_module ++ ++ ++def _fixup_main_from_path(main_path): ++ # If this process was forked, __main__ may already be populated ++ current_main = sys.modules['__main__'] ++ ++ # Unfortunately, the main ipython launch script historically had no ++ # "if __name__ == '__main__'" guard, so we work around that ++ # by treating it like a __main__.py file ++ # See https://github.com/ipython/ipython/issues/4698 ++ main_name = os.path.splitext(os.path.basename(main_path))[0] ++ if main_name == 'ipython': ++ return ++ ++ # Otherwise, if __file__ already has the setting we expect, ++ # there's nothing more to do ++ if getattr(current_main, '__file__', None) == main_path: ++ return ++ ++ # If the parent process has sent a path through rather than a module ++ # name we assume it is an executable script that may contain ++ # non-main code that needs to be executed ++ old_main_modules.append(current_main) ++ main_module = types.ModuleType("__mp_main__") ++ main_content = runpy.run_path(main_path, ++ run_name="__mp_main__") ++ main_module.__dict__.update(main_content) ++ sys.modules['__main__'] = sys.modules['__mp_main__'] = main_module + + + def import_main_path(main_path): + ''' + Set sys.modules['__main__'] to module at main_path + ''' +- # XXX (ncoghlan): The following code makes several bogus +- # assumptions regarding the relationship between __file__ +- # and a module's real name. See PEP 302 and issue #10845 +- if getattr(sys.modules['__main__'], '__file__', None) == main_path: +- return +- +- main_name = os.path.splitext(os.path.basename(main_path))[0] +- if main_name == '__init__': +- main_name = os.path.basename(os.path.dirname(main_path)) +- +- if main_name == '__main__': +- main_module = sys.modules['__main__'] +- main_module.__file__ = main_path +- elif main_name != 'ipython': +- # Main modules not actually called __main__.py may +- # contain additional code that should still be executed +- import importlib +- import types +- +- if main_path is None: +- dirs = None +- elif os.path.basename(main_path).startswith('__init__.py'): +- dirs = [os.path.dirname(os.path.dirname(main_path))] +- else: +- dirs = [os.path.dirname(main_path)] +- +- assert main_name not in sys.modules, main_name +- sys.modules.pop('__mp_main__', None) +- # We should not try to load __main__ +- # since that would execute 'if __name__ == "__main__"' +- # clauses, potentially causing a psuedo fork bomb. +- main_module = types.ModuleType(main_name) +- # XXX Use a target of main_module? +- spec = importlib.find_spec(main_name, path=dirs) +- methods = importlib._bootstrap._SpecMethods(spec) +- methods.init_module_attrs(main_module) +- main_module.__name__ = '__mp_main__' +- code = spec.loader.get_code(main_name) +- exec(code, main_module.__dict__) +- +- old_main_modules.append(sys.modules['__main__']) +- sys.modules['__main__'] = sys.modules['__mp_main__'] = main_module ++ _fixup_main_from_path(main_path) +diff -r 3405dc9a6afa Lib/nntplib.py +--- a/Lib/nntplib.py ++++ b/Lib/nntplib.py +@@ -279,7 +279,7 @@ + + if _have_ssl: + +- def _encrypt_on(sock, context): ++ def _encrypt_on(sock, context, hostname): + """Wrap a socket in SSL/TLS. Arguments: + - sock: Socket to wrap + - context: SSL context to use for the encrypted connection +@@ -289,7 +289,8 @@ + # Generate a default SSL context if none was passed. + if context is None: + context = ssl._create_stdlib_context() +- return context.wrap_socket(sock) ++ server_hostname = hostname if ssl.HAS_SNI else None ++ return context.wrap_socket(sock, server_hostname=server_hostname) + + + # The classes themselves +@@ -1005,7 +1006,7 @@ + resp = self._shortcmd('STARTTLS') + if resp.startswith('382'): + self.file.close() +- self.sock = _encrypt_on(self.sock, context) ++ self.sock = _encrypt_on(self.sock, context, self.host) + self.file = self.sock.makefile("rwb") + self.tls_on = True + # Capabilities may change after TLS starts up, so ask for them +@@ -1065,7 +1066,7 @@ + in default port and the `ssl_context` argument for SSL connections. + """ + self.sock = socket.create_connection((host, port), timeout) +- self.sock = _encrypt_on(self.sock, ssl_context) ++ self.sock = _encrypt_on(self.sock, ssl_context, host) + file = self.sock.makefile("rwb") + _NNTPBase.__init__(self, file, host, + readermode=readermode, timeout=timeout) +diff -r 3405dc9a6afa Lib/ntpath.py +--- a/Lib/ntpath.py ++++ b/Lib/ntpath.py +@@ -204,7 +204,7 @@ + empty = _get_empty(p) + if len(p) > 1: + sep = _get_sep(p) +- normp = normcase(p) ++ normp = p.replace(_get_altsep(p), sep) + if (normp[0:2] == sep*2) and (normp[2:3] != sep): + # is a UNC path: + # vvvvvvvvvvvvvvvvvvvv drive letter or UNC path +@@ -240,26 +240,12 @@ + """ + import warnings + warnings.warn("ntpath.splitunc is deprecated, use ntpath.splitdrive instead", +- DeprecationWarning) +- sep = _get_sep(p) +- if not p[1:2]: +- return p[:0], p # Drive letter present +- firstTwo = p[0:2] +- if normcase(firstTwo) == sep + sep: +- # is a UNC path: +- # vvvvvvvvvvvvvvvvvvvv equivalent to drive letter +- # \\machine\mountpoint\directories... +- # directory ^^^^^^^^^^^^^^^ +- normp = normcase(p) +- index = normp.find(sep, 2) +- if index == -1: +- ##raise RuntimeError, 'illegal UNC path: "' + p + '"' +- return (p[:0], p) +- index = normp.find(sep, index + 1) +- if index == -1: +- index = len(p) +- return p[:index], p[index:] +- return p[:0], p ++ DeprecationWarning, 2) ++ drive, path = splitdrive(p) ++ if len(drive) == 2: ++ # Drive letter present ++ return p[:0], p ++ return drive, path + + + # Split a path in head (everything up to the last '/') and tail (the +diff -r 3405dc9a6afa Lib/pathlib.py +--- a/Lib/pathlib.py ++++ b/Lib/pathlib.py +@@ -6,19 +6,12 @@ + import posixpath + import re + import sys +-import weakref +-try: +- import threading +-except ImportError: +- import dummy_threading as threading +- +-from collections import Sequence, defaultdict ++from collections import Sequence + from contextlib import contextmanager + from errno import EINVAL, ENOENT +-from itertools import chain, count + from operator import attrgetter + from stat import S_ISDIR, S_ISLNK, S_ISREG, S_ISSOCK, S_ISBLK, S_ISCHR, S_ISFIFO +-from urllib.parse import quote as urlquote, quote_from_bytes as urlquote_from_bytes ++from urllib.parse import quote_from_bytes as urlquote_from_bytes + + + supports_symlinks = True +@@ -96,12 +89,16 @@ + (drive, root, parts) tuples. Return a new (drive, root, parts) tuple. + """ + if root2: +- parts = parts2 +- root = root2 ++ if not drv2 and drv: ++ return drv, root2, [drv + root2] + parts2[1:] ++ elif drv2: ++ if drv2 == drv or self.casefold(drv2) == self.casefold(drv): ++ # Same drive => second path is relative to the first ++ return drv, root, parts + parts2[1:] + else: +- parts = parts + parts2 +- # XXX raise error if drv and drv2 are different? +- return drv2 or drv, root, parts ++ # Second path is non-anchored (common case) ++ return drv, root, parts + parts2 ++ return drv2, root2, parts2 + + + class _WindowsFlavour(_Flavour): +@@ -257,42 +254,47 @@ + + def resolve(self, path): + sep = self.sep +- def split(p): +- return [x for x in p.split(sep) if x] +- def absparts(p): +- # Our own abspath(), since the posixpath one makes +- # the mistake of "normalizing" the path without resolving the +- # symlinks first. +- if not p.startswith(sep): +- return split(os.getcwd()) + split(p) +- else: +- return split(p) +- parts = absparts(str(path))[::-1] + accessor = path._accessor +- resolved = cur = "" +- symlinks = {} +- while parts: +- part = parts.pop() +- cur = resolved + sep + part +- if cur in symlinks and symlinks[cur] <= len(parts): +- # We've already seen the symlink and there's not less +- # work to do than the last time. +- raise RuntimeError("Symlink loop from %r" % cur) +- try: +- target = accessor.readlink(cur) +- except OSError as e: +- if e.errno != EINVAL: +- raise +- # Not a symlink +- resolved = cur +- else: +- # Take note of remaining work from this symlink +- symlinks[cur] = len(parts) +- if target.startswith(sep): +- # Symlink points to absolute path +- resolved = "" +- parts.extend(split(target)[::-1]) +- return resolved or sep ++ seen = {} ++ def _resolve(path, rest): ++ if rest.startswith(sep): ++ path = '' ++ ++ for name in rest.split(sep): ++ if not name or name == '.': ++ # current dir ++ continue ++ if name == '..': ++ # parent dir ++ path, _, _ = path.rpartition(sep) ++ continue ++ newpath = path + sep + name ++ if newpath in seen: ++ # Already seen this path ++ path = seen[newpath] ++ if path is not None: ++ # use cached value ++ continue ++ # The symlink is not resolved, so we must have a symlink loop. ++ raise RuntimeError("Symlink loop from %r" % newpath) ++ # Resolve the symbolic link ++ try: ++ target = accessor.readlink(newpath) ++ except OSError as e: ++ if e.errno != EINVAL: ++ raise ++ # Not a symlink ++ path = newpath ++ else: ++ seen[newpath] = None # not resolved symlink ++ path = _resolve(path, target) ++ seen[newpath] = path # resolved symlink ++ ++ return path ++ # NOTE: according to POSIX, getcwd() cannot contain path components ++ # which are symlinks. ++ base = '' if path.is_absolute() else os.getcwd() ++ return _resolve(base, str(path)) or sep + + def is_reserved(self, parts): + return False +@@ -778,27 +780,23 @@ + parts = self._parts + drv = self._drv + root = self._root +- if drv or root: +- if root: +- abs_parts = [drv, root] + parts[1:] +- else: +- abs_parts = [drv] + parts[1:] ++ if root: ++ abs_parts = [drv, root] + parts[1:] + else: + abs_parts = parts + to_drv, to_root, to_parts = self._parse_args(other) +- if to_drv or to_root: +- if to_root: +- to_abs_parts = [to_drv, to_root] + to_parts[1:] +- else: +- to_abs_parts = [to_drv] + to_parts[1:] ++ if to_root: ++ to_abs_parts = [to_drv, to_root] + to_parts[1:] + else: + to_abs_parts = to_parts + n = len(to_abs_parts) +- if n == 0 and (drv or root) or abs_parts[:n] != to_abs_parts: ++ cf = self._flavour.casefold_parts ++ if (root or drv) if n == 0 else cf(abs_parts[:n]) != cf(to_abs_parts): + formatted = self._format_parsed_parts(to_drv, to_root, to_parts) + raise ValueError("{!r} does not start with {!r}" + .format(str(self), str(formatted))) +- return self._from_parsed_parts('', '', abs_parts[n:]) ++ return self._from_parsed_parts('', root if n == 1 else '', ++ abs_parts[n:]) + + @property + def parts(self): +@@ -939,6 +937,15 @@ + # A stub for the opener argument to built-in open() + return self._accessor.open(self, flags, mode) + ++ def _raw_open(self, flags, mode=0o777): ++ """ ++ Open the file pointed by this path and return a file descriptor, ++ as os.open() does. ++ """ ++ if self._closed: ++ self._raise_closed() ++ return self._accessor.open(self, flags, mode) ++ + # Public API + + @classmethod +@@ -1045,15 +1052,6 @@ + import grp + return grp.getgrgid(self.stat().st_gid).gr_name + +- def _raw_open(self, flags, mode=0o777): +- """ +- Open the file pointed by this path and return a file descriptor, +- as os.open() does. +- """ +- if self._closed: +- self._raise_closed() +- return self._accessor.open(self, flags, mode) +- + def open(self, mode='r', buffering=-1, encoding=None, + errors=None, newline=None): + """ +@@ -1099,7 +1097,7 @@ + except OSError as e: + if e.errno != ENOENT: + raise +- self.parent.mkdir(mode, True) ++ self.parent.mkdir(parents=True) + self._accessor.mkdir(self, mode) + + def chmod(self, mode): +diff -r 3405dc9a6afa Lib/pickle.py +--- a/Lib/pickle.py ++++ b/Lib/pickle.py +@@ -348,24 +348,25 @@ + def __init__(self, file, protocol=None, *, fix_imports=True): + """This takes a binary file for writing a pickle data stream. + +- The optional protocol argument tells the pickler to use the ++ The optional *protocol* argument tells the pickler to use the + given protocol; supported protocols are 0, 1, 2, 3 and 4. The +- default protocol is 3; a backward-incompatible protocol designed for +- Python 3. ++ default protocol is 3; a backward-incompatible protocol designed ++ for Python 3. + + Specifying a negative protocol version selects the highest + protocol version supported. The higher the protocol used, the + more recent the version of Python needed to read the pickle + produced. + +- The file argument must have a write() method that accepts a single +- bytes argument. It can thus be a file object opened for binary +- writing, a io.BytesIO instance, or any other custom object that +- meets this interface. ++ The *file* argument must have a write() method that accepts a ++ single bytes argument. It can thus be a file object opened for ++ binary writing, a io.BytesIO instance, or any other custom ++ object that meets this interface. + +- If fix_imports is True and protocol is less than 3, pickle will try to +- map the new Python 3 names to the old module names used in Python 2, +- so that the pickle data stream is readable with Python 2. ++ If *fix_imports* is True and *protocol* is less than 3, pickle ++ will try to map the new Python 3 names to the old module names ++ used in Python 2, so that the pickle data stream is readable ++ with Python 2. + """ + if protocol is None: + protocol = DEFAULT_PROTOCOL +@@ -389,10 +390,9 @@ + """Clears the pickler's "memo". + + The memo is the data structure that remembers which objects the +- pickler has already seen, so that shared or recursive objects are +- pickled by reference and not by value. This method is useful when +- re-using picklers. +- ++ pickler has already seen, so that shared or recursive objects ++ are pickled by reference and not by value. This method is ++ useful when re-using picklers. + """ + self.memo.clear() + +@@ -954,8 +954,17 @@ + + self.memoize(obj) + ++ def save_type(self, obj): ++ if obj is type(None): ++ return self.save_reduce(type, (None,), obj=obj) ++ elif obj is type(NotImplemented): ++ return self.save_reduce(type, (NotImplemented,), obj=obj) ++ elif obj is type(...): ++ return self.save_reduce(type, (...,), obj=obj) ++ return self.save_global(obj) ++ + dispatch[FunctionType] = save_global +- dispatch[type] = save_global ++ dispatch[type] = save_type + + + # Unpickling machinery +@@ -966,8 +975,14 @@ + encoding="ASCII", errors="strict"): + """This takes a binary file for reading a pickle data stream. + +- The protocol version of the pickle is detected automatically, so no +- proto argument is needed. ++ The protocol version of the pickle is detected automatically, so ++ no proto argument is needed. ++ ++ The argument *file* must have two methods, a read() method that ++ takes an integer argument, and a readline() method that requires ++ no arguments. Both methods should return bytes. Thus *file* ++ can be a binary file object opened for reading, a io.BytesIO ++ object, or any other custom object that meets this interface. + + The file-like object must have two methods, a read() method + that takes an integer argument, and a readline() method that +@@ -976,13 +991,14 @@ + reading, a BytesIO object, or any other custom object that + meets this interface. + +- Optional keyword arguments are *fix_imports*, *encoding* and *errors*, +- which are used to control compatiblity support for pickle stream +- generated by Python 2.x. If *fix_imports* is True, pickle will try to +- map the old Python 2.x names to the new names used in Python 3.x. The +- *encoding* and *errors* tell pickle how to decode 8-bit string +- instances pickled by Python 2.x; these default to 'ASCII' and +- 'strict', respectively. ++ Optional keyword arguments are *fix_imports*, *encoding* and ++ *errors*, which are used to control compatiblity support for ++ pickle stream generated by Python 2. If *fix_imports* is True, ++ pickle will try to map the old Python 2 names to the new names ++ used in Python 3. The *encoding* and *errors* tell pickle how ++ to decode 8-bit string instances pickled by Python 2; these ++ default to 'ASCII' and 'strict', respectively. *encoding* can be ++ 'bytes' to read theses 8-bit string instances as bytes objects. + """ + self._file_readline = file.readline + self._file_read = file.read +@@ -1130,6 +1146,15 @@ + self.append(unpack('>d', self.read(8))[0]) + dispatch[BINFLOAT[0]] = load_binfloat + ++ def _decode_string(self, value): ++ # Used to allow strings from Python 2 to be decoded either as ++ # bytes or Unicode strings. This should be used only with the ++ # STRING, BINSTRING and SHORT_BINSTRING opcodes. ++ if self.encoding == "bytes": ++ return value ++ else: ++ return value.decode(self.encoding, self.errors) ++ + def load_string(self): + data = self.readline()[:-1] + # Strip outermost quotes +@@ -1137,8 +1162,7 @@ + data = data[1:-1] + else: + raise UnpicklingError("the STRING opcode argument must be quoted") +- self.append(codecs.escape_decode(data)[0] +- .decode(self.encoding, self.errors)) ++ self.append(self._decode_string(codecs.escape_decode(data)[0])) + dispatch[STRING[0]] = load_string + + def load_binstring(self): +@@ -1147,8 +1171,7 @@ + if len < 0: + raise UnpicklingError("BINSTRING pickle has negative byte count") + data = self.read(len) +- value = str(data, self.encoding, self.errors) +- self.append(value) ++ self.append(self._decode_string(data)) + dispatch[BINSTRING[0]] = load_binstring + + def load_binbytes(self): +@@ -1182,8 +1205,7 @@ + def load_short_binstring(self): + len = self.read(1)[0] + data = self.read(len) +- value = str(data, self.encoding, self.errors) +- self.append(value) ++ self.append(self._decode_string(data)) + dispatch[SHORT_BINSTRING[0]] = load_short_binstring + + def load_short_binbytes(self): +diff -r 3405dc9a6afa Lib/pickletools.py +--- a/Lib/pickletools.py ++++ b/Lib/pickletools.py +@@ -969,113 +969,107 @@ + return self.name + + +-pyint = StackObject( +- name='int', +- obtype=int, +- doc="A short (as opposed to long) Python integer object.") +- +-pylong = StackObject( +- name='long', +- obtype=int, +- doc="A long (as opposed to short) Python integer object.") ++pyint = pylong = StackObject( ++ name='int', ++ obtype=int, ++ doc="A Python integer object.") + + pyinteger_or_bool = StackObject( +- name='int_or_bool', +- obtype=(int, bool), +- doc="A Python integer object (short or long), or " +- "a Python bool.") ++ name='int_or_bool', ++ obtype=(int, bool), ++ doc="A Python integer or boolean object.") + + pybool = StackObject( +- name='bool', +- obtype=(bool,), +- doc="A Python bool object.") ++ name='bool', ++ obtype=bool, ++ doc="A Python boolean object.") + + pyfloat = StackObject( +- name='float', +- obtype=float, +- doc="A Python float object.") +- +-pystring = StackObject( +- name='string', +- obtype=bytes, +- doc="A Python (8-bit) string object.") ++ name='float', ++ obtype=float, ++ doc="A Python float object.") ++ ++pybytes_or_str = pystring = StackObject( ++ name='bytes_or_str', ++ obtype=(bytes, str), ++ doc="A Python bytes or (Unicode) string object.") + + pybytes = StackObject( +- name='bytes', +- obtype=bytes, +- doc="A Python bytes object.") ++ name='bytes', ++ obtype=bytes, ++ doc="A Python bytes object.") + + pyunicode = StackObject( +- name='str', +- obtype=str, +- doc="A Python (Unicode) string object.") ++ name='str', ++ obtype=str, ++ doc="A Python (Unicode) string object.") + + pynone = StackObject( +- name="None", +- obtype=type(None), +- doc="The Python None object.") ++ name="None", ++ obtype=type(None), ++ doc="The Python None object.") + + pytuple = StackObject( +- name="tuple", +- obtype=tuple, +- doc="A Python tuple object.") ++ name="tuple", ++ obtype=tuple, ++ doc="A Python tuple object.") + + pylist = StackObject( +- name="list", +- obtype=list, +- doc="A Python list object.") ++ name="list", ++ obtype=list, ++ doc="A Python list object.") + + pydict = StackObject( +- name="dict", +- obtype=dict, +- doc="A Python dict object.") ++ name="dict", ++ obtype=dict, ++ doc="A Python dict object.") + + pyset = StackObject( +- name="set", +- obtype=set, +- doc="A Python set object.") ++ name="set", ++ obtype=set, ++ doc="A Python set object.") + + pyfrozenset = StackObject( +- name="frozenset", +- obtype=set, +- doc="A Python frozenset object.") ++ name="frozenset", ++ obtype=set, ++ doc="A Python frozenset object.") + + anyobject = StackObject( +- name='any', +- obtype=object, +- doc="Any kind of object whatsoever.") ++ name='any', ++ obtype=object, ++ doc="Any kind of object whatsoever.") + + markobject = StackObject( +- name="mark", +- obtype=StackObject, +- doc="""'The mark' is a unique object. +- +- Opcodes that operate on a variable number of objects +- generally don't embed the count of objects in the opcode, +- or pull it off the stack. Instead the MARK opcode is used +- to push a special marker object on the stack, and then +- some other opcodes grab all the objects from the top of +- the stack down to (but not including) the topmost marker +- object. +- """) ++ name="mark", ++ obtype=StackObject, ++ doc="""'The mark' is a unique object. ++ ++Opcodes that operate on a variable number of objects ++generally don't embed the count of objects in the opcode, ++or pull it off the stack. Instead the MARK opcode is used ++to push a special marker object on the stack, and then ++some other opcodes grab all the objects from the top of ++the stack down to (but not including) the topmost marker ++object. ++""") + + stackslice = StackObject( +- name="stackslice", +- obtype=StackObject, +- doc="""An object representing a contiguous slice of the stack. +- +- This is used in conjunction with markobject, to represent all +- of the stack following the topmost markobject. For example, +- the POP_MARK opcode changes the stack from +- +- [..., markobject, stackslice] +- to +- [...] +- +- No matter how many object are on the stack after the topmost +- markobject, POP_MARK gets rid of all of them (including the +- topmost markobject too). +- """) ++ name="stackslice", ++ obtype=StackObject, ++ doc="""An object representing a contiguous slice of the stack. ++ ++This is used in conjunction with markobject, to represent all ++of the stack following the topmost markobject. For example, ++the POP_MARK opcode changes the stack from ++ ++ [..., markobject, stackslice] ++to ++ [...] ++ ++No matter how many object are on the stack after the topmost ++markobject, POP_MARK gets rid of all of them (including the ++topmost markobject too). ++""") + + ############################################################################## + # Descriptors for pickle opcodes. +@@ -1212,7 +1206,7 @@ + code='L', + arg=decimalnl_long, + stack_before=[], +- stack_after=[pylong], ++ stack_after=[pyint], + proto=0, + doc="""Push a long integer. + +@@ -1230,7 +1224,7 @@ + code='\x8a', + arg=long1, + stack_before=[], +- stack_after=[pylong], ++ stack_after=[pyint], + proto=2, + doc="""Long integer using one-byte length. + +@@ -1241,7 +1235,7 @@ + code='\x8b', + arg=long4, + stack_before=[], +- stack_after=[pylong], ++ stack_after=[pyint], + proto=2, + doc="""Long integer using found-byte length. + +@@ -1254,45 +1248,50 @@ + code='S', + arg=stringnl, + stack_before=[], +- stack_after=[pystring], ++ stack_after=[pybytes_or_str], + proto=0, + doc="""Push a Python string object. + + The argument is a repr-style string, with bracketing quote characters, + and perhaps embedded escapes. The argument extends until the next +- newline character. (Actually, they are decoded into a str instance ++ newline character. These are usually decoded into a str instance + using the encoding given to the Unpickler constructor. or the default, +- 'ASCII'.) ++ 'ASCII'. If the encoding given was 'bytes' however, they will be ++ decoded as bytes object instead. + """), + + I(name='BINSTRING', + code='T', + arg=string4, + stack_before=[], +- stack_after=[pystring], ++ stack_after=[pybytes_or_str], + proto=1, + doc="""Push a Python string object. + +- There are two arguments: the first is a 4-byte little-endian signed int +- giving the number of bytes in the string, and the second is that many +- bytes, which are taken literally as the string content. (Actually, +- they are decoded into a str instance using the encoding given to the +- Unpickler constructor. or the default, 'ASCII'.) ++ There are two arguments: the first is a 4-byte little-endian ++ signed int giving the number of bytes in the string, and the ++ second is that many bytes, which are taken literally as the string ++ content. These are usually decoded into a str instance using the ++ encoding given to the Unpickler constructor. or the default, ++ 'ASCII'. If the encoding given was 'bytes' however, they will be ++ decoded as bytes object instead. + """), + + I(name='SHORT_BINSTRING', + code='U', + arg=string1, + stack_before=[], +- stack_after=[pystring], ++ stack_after=[pybytes_or_str], + proto=1, + doc="""Push a Python string object. + +- There are two arguments: the first is a 1-byte unsigned int giving +- the number of bytes in the string, and the second is that many bytes, +- which are taken literally as the string content. (Actually, they +- are decoded into a str instance using the encoding given to the +- Unpickler constructor. or the default, 'ASCII'.) ++ There are two arguments: the first is a 1-byte unsigned int giving ++ the number of bytes in the string, and the second is that many ++ bytes, which are taken literally as the string content. These are ++ usually decoded into a str instance using the encoding given to ++ the Unpickler constructor. or the default, 'ASCII'. If the ++ encoding given was 'bytes' however, they will be decoded as bytes ++ object instead. + """), + + # Bytes (protocol 3 only; older protocols don't support bytes at all) +@@ -2313,6 +2312,7 @@ + buf.start_framing() + for start, stop, putid in opcodes: + if putid in gets: ++ buf.commit_frame() + buf.write(p[start:stop]) + if proto >= 4: + buf.end_framing() +diff -r 3405dc9a6afa Lib/platform.py +--- a/Lib/platform.py ++++ b/Lib/platform.py +@@ -122,13 +122,17 @@ + except AttributeError: + # os.devnull was added in Python 2.4, so emulate it for earlier + # Python versions +- if sys.platform in ('dos','win32','win16'): ++ if sys.platform in ('dos', 'win32', 'win16'): + # Use the old CP/M NUL as device name + DEV_NULL = 'NUL' + else: + # Standard Unix uses /dev/null + DEV_NULL = '/dev/null' + ++# Directory to search for configuration information on Unix. ++# Constant used by test_platform to test linux_distribution(). ++_UNIXCONFDIR = '/etc' ++ + ### Platform specific APIs + + _libc_search = re.compile(b'(__libc_init)' +@@ -137,7 +141,7 @@ + b'|' + br'(libc(_\w+)?\.so(?:\.(\d[0-9.]*))?)', re.ASCII) + +-def libc_ver(executable=sys.executable,lib='',version='', ++def libc_ver(executable=sys.executable, lib='', version='', + + chunksize=16384): + +@@ -159,12 +163,12 @@ + # here to work around problems with Cygwin not being + # able to open symlinks for reading + executable = os.path.realpath(executable) +- f = open(executable,'rb') ++ f = open(executable, 'rb') + binary = f.read(chunksize) + pos = 0 + while 1: + if b'libc' in binary or b'GLIBC' in binary: +- m = _libc_search.search(binary,pos) ++ m = _libc_search.search(binary, pos) + else: + m = None + if not m: +@@ -173,7 +177,7 @@ + break + pos = 0 + continue +- libcinit,glibc,glibcversion,so,threads,soversion = [ ++ libcinit, glibc, glibcversion, so, threads, soversion = [ + s.decode('latin1') if s is not None else s + for s in m.groups()] + if libcinit and not lib: +@@ -193,9 +197,9 @@ + version = version + threads + pos = m.end() + f.close() +- return lib,version ++ return lib, version + +-def _dist_try_harder(distname,version,id): ++def _dist_try_harder(distname, version, id): + + """ Tries some special tricks to get the distribution + information in case the default method fails. +@@ -210,7 +214,7 @@ + for line in open('/var/adm/inst-log/info'): + tv = line.split() + if len(tv) == 2: +- tag,value = tv ++ tag, value = tv + else: + continue + if tag == 'MIN_DIST_VERSION': +@@ -218,7 +222,7 @@ + elif tag == 'DIST_IDENT': + values = value.split('-') + id = values[2] +- return distname,version,id ++ return distname, version, id + + if os.path.exists('/etc/.installed'): + # Caldera OpenLinux has some infos in that file (thanks to Colin Kong) +@@ -227,7 +231,7 @@ + if len(pkg) >= 2 and pkg[0] == 'OpenLinux': + # XXX does Caldera support non Intel platforms ? If yes, + # where can we find the needed id ? +- return 'OpenLinux',pkg[1],id ++ return 'OpenLinux', pkg[1], id + + if os.path.isdir('/usr/lib/setup'): + # Check for slackware version tag file (thanks to Greg Andruk) +@@ -239,9 +243,9 @@ + verfiles.sort() + distname = 'slackware' + version = verfiles[-1][14:] +- return distname,version,id ++ return distname, version, id + +- return distname,version,id ++ return distname, version, id + + _release_filename = re.compile(r'(\w+)[-_](release|version)', re.ASCII) + _lsb_release_version = re.compile(r'(.+)' +@@ -310,28 +314,29 @@ + distribution read from the OS is returned. Otherwise the short + name taken from supported_dists is used. + +- Returns a tuple (distname,version,id) which default to the ++ Returns a tuple (distname, version, id) which default to the + args given as parameters. + + """ + try: +- etc = os.listdir('/etc') ++ etc = os.listdir(_UNIXCONFDIR) + except OSError: + # Probably not a Unix system +- return distname,version,id ++ return distname, version, id + etc.sort() + for file in etc: + m = _release_filename.match(file) + if m is not None: +- _distname,dummy = m.groups() ++ _distname, dummy = m.groups() + if _distname in supported_dists: + distname = _distname + break + else: +- return _dist_try_harder(distname,version,id) ++ return _dist_try_harder(distname, version, id) + + # Read the first line +- with open('/etc/'+file, 'r') as f: ++ with open(os.path.join(_UNIXCONFDIR, file), 'r', ++ encoding='utf-8', errors='surrogateescape') as f: + firstline = f.readline() + _distname, _version, _id = _parse_release_file(firstline) + +@@ -345,7 +350,7 @@ + + # To maintain backwards compatibility: + +-def dist(distname='',version='',id='', ++def dist(distname='', version='', id='', + + supported_dists=_supported_dists): + +@@ -355,7 +360,7 @@ + /etc and then reverts to _dist_try_harder() in case no + suitable files are found. + +- Returns a tuple (distname,version,id) which default to the ++ Returns a tuple (distname, version, id) which default to the + args given as parameters. + + """ +@@ -380,11 +385,11 @@ + if build: + l.append(build) + try: +- ints = map(int,l) ++ ints = map(int, l) + except ValueError: + strings = l + else: +- strings = list(map(str,ints)) ++ strings = list(map(str, ints)) + version = '.'.join(strings[:3]) + return version + +@@ -403,10 +408,10 @@ + + def _syscmd_ver(system='', release='', version='', + +- supported_platforms=('win32','win16','dos')): ++ supported_platforms=('win32', 'win16', 'dos')): + + """ Tries to figure out the OS version used and returns +- a tuple (system,release,version). ++ a tuple (system, release, version). + + It uses the "ver" shell command for this which is known + to exists on Windows, DOS. XXX Others too ? +@@ -416,10 +421,10 @@ + + """ + if sys.platform not in supported_platforms: +- return system,release,version ++ return system, release, version + + # Try some common cmd strings +- for cmd in ('ver','command /c ver','cmd /c ver'): ++ for cmd in ('ver', 'command /c ver', 'cmd /c ver'): + try: + pipe = popen(cmd) + info = pipe.read() +@@ -428,18 +433,18 @@ + # XXX How can I suppress shell errors from being written + # to stderr ? + except OSError as why: +- #print 'Command %s failed: %s' % (cmd,why) ++ #print 'Command %s failed: %s' % (cmd, why) + continue + else: + break + else: +- return system,release,version ++ return system, release, version + + # Parse the output + info = info.strip() + m = _ver_output.match(info) + if m is not None: +- system,release,version = m.groups() ++ system, release, version = m.groups() + # Strip trailing dots from version and release + if release[-1] == '.': + release = release[:-1] +@@ -448,9 +453,9 @@ + # Normalize the version and build strings (eliminating additional + # zeros) + version = _norm_version(version) +- return system,release,version ++ return system, release, version + +-def _win32_getvalue(key,name,default=''): ++def _win32_getvalue(key, name, default=''): + + """ Read a value for name from the registry key. + +@@ -465,14 +470,14 @@ + import winreg + RegQueryValueEx = winreg.QueryValueEx + try: +- return RegQueryValueEx(key,name) ++ return RegQueryValueEx(key, name) + except: + return default + +-def win32_ver(release='',version='',csd='',ptype=''): ++def win32_ver(release='', version='', csd='', ptype=''): + + """ Get additional version information from the Windows Registry +- and return a tuple (version,csd,ptype) referring to version ++ and return a tuple (version, csd, ptype) referring to version + number, CSD level (service pack), and OS type (multi/single + processor). + +@@ -509,7 +514,7 @@ + sys.getwindowsversion + except AttributeError: + # No emulation possible, so return the defaults... +- return release,version,csd,ptype ++ return release, version, csd, ptype + else: + # Emulation using winreg (added in Python 2.0) and + # sys.getwindowsversion() (added in Python 2.3) +@@ -527,8 +532,8 @@ + + # Find out the registry key and some general version infos + winver = GetVersionEx() +- maj,min,buildno,plat,csd = winver +- version = '%i.%i.%i' % (maj,min,buildno & 0xFFFF) ++ maj, min, buildno, plat, csd = winver ++ version = '%i.%i.%i' % (maj, min, buildno & 0xFFFF) + if hasattr(winver, "service_pack"): + if winver.service_pack != "": + csd = 'SP%s' % winver.service_pack_major +@@ -603,8 +608,8 @@ + else: + if not release: + # E.g. Win3.1 with win32s +- release = '%i.%i' % (maj,min) +- return release,version,csd,ptype ++ release = '%i.%i' % (maj, min) ++ return release, version, csd, ptype + + # Open the registry key + try: +@@ -612,7 +617,7 @@ + # Get a value to make sure the key exists... + RegQueryValueEx(keyCurVer, 'SystemRoot') + except: +- return release,version,csd,ptype ++ return release, version, csd, ptype + + # Parse values + #subversion = _win32_getvalue(keyCurVer, +@@ -622,17 +627,17 @@ + # release = release + subversion # 95a, 95b, etc. + build = _win32_getvalue(keyCurVer, + 'CurrentBuildNumber', +- ('',1))[0] ++ ('', 1))[0] + ptype = _win32_getvalue(keyCurVer, + 'CurrentType', +- (ptype,1))[0] ++ (ptype, 1))[0] + + # Normalize version +- version = _norm_version(version,build) ++ version = _norm_version(version, build) + + # Close key + RegCloseKey(keyCurVer) +- return release,version,csd,ptype ++ return release, version, csd, ptype + + def _mac_ver_xml(): + fn = '/System/Library/CoreServices/SystemVersion.plist' +@@ -646,16 +651,16 @@ + + pl = plistlib.readPlist(fn) + release = pl['ProductVersion'] +- versioninfo=('', '', '') ++ versioninfo = ('', '', '') + machine = os.uname().machine + if machine in ('ppc', 'Power Macintosh'): + # Canonical name + machine = 'PowerPC' + +- return release,versioninfo,machine ++ return release, versioninfo, machine + + +-def mac_ver(release='',versioninfo=('','',''),machine=''): ++def mac_ver(release='', versioninfo=('', '', ''), machine=''): + + """ Get MacOS version information and return it as tuple (release, + versioninfo, machine) with versioninfo being a tuple (version, +@@ -672,9 +677,9 @@ + return info + + # If that also doesn't work return the default values +- return release,versioninfo,machine ++ return release, versioninfo, machine + +-def _java_getprop(name,default): ++def _java_getprop(name, default): + + from java.lang import System + try: +@@ -685,13 +690,13 @@ + except AttributeError: + return default + +-def java_ver(release='',vendor='',vminfo=('','',''),osinfo=('','','')): ++def java_ver(release='', vendor='', vminfo=('', '', ''), osinfo=('', '', '')): + + """ Version interface for Jython. + +- Returns a tuple (release,vendor,vminfo,osinfo) with vminfo being +- a tuple (vm_name,vm_release,vm_vendor) and osinfo being a +- tuple (os_name,os_version,os_arch). ++ Returns a tuple (release, vendor, vminfo, osinfo) with vminfo being ++ a tuple (vm_name, vm_release, vm_vendor) and osinfo being a ++ tuple (os_name, os_version, os_arch). + + Values which cannot be determined are set to the defaults + given as parameters (which all default to ''). +@@ -701,7 +706,7 @@ + try: + import java.lang + except ImportError: +- return release,vendor,vminfo,osinfo ++ return release, vendor, vminfo, osinfo + + vendor = _java_getprop('java.vendor', vendor) + release = _java_getprop('java.version', release) +@@ -720,9 +725,9 @@ + + ### System name aliasing + +-def system_alias(system,release,version): ++def system_alias(system, release, version): + +- """ Returns (system,release,version) aliased to common ++ """ Returns (system, release, version) aliased to common + marketing names used for some systems. + + It also does some reordering of the information in some cases +@@ -732,13 +737,13 @@ + if system == 'Rhapsody': + # Apple's BSD derivative + # XXX How can we determine the marketing release number ? +- return 'MacOS X Server',system+release,version ++ return 'MacOS X Server', system+release, version + + elif system == 'SunOS': + # Sun's OS + if release < '5': + # These releases use the old name SunOS +- return system,release,version ++ return system, release, version + # Modify release (marketing release = SunOS release - 3) + l = release.split('.') + if l: +@@ -766,11 +771,11 @@ + else: + version = '64bit' + +- elif system in ('win32','win16'): ++ elif system in ('win32', 'win16'): + # In case one of the other tricks + system = 'Windows' + +- return system,release,version ++ return system, release, version + + ### Various internal helpers + +@@ -783,21 +788,21 @@ + platform = '-'.join(x.strip() for x in filter(len, args)) + + # Cleanup some possible filename obstacles... +- platform = platform.replace(' ','_') +- platform = platform.replace('/','-') +- platform = platform.replace('\\','-') +- platform = platform.replace(':','-') +- platform = platform.replace(';','-') +- platform = platform.replace('"','-') +- platform = platform.replace('(','-') +- platform = platform.replace(')','-') ++ platform = platform.replace(' ', '_') ++ platform = platform.replace('/', '-') ++ platform = platform.replace('\\', '-') ++ platform = platform.replace(':', '-') ++ platform = platform.replace(';', '-') ++ platform = platform.replace('"', '-') ++ platform = platform.replace('(', '-') ++ platform = platform.replace(')', '-') + + # No need to report 'unknown' information... +- platform = platform.replace('unknown','') ++ platform = platform.replace('unknown', '') + + # Fold '--'s and remove trailing '-' + while 1: +- cleaned = platform.replace('--','-') ++ cleaned = platform.replace('--', '-') + if cleaned == platform: + break + platform = cleaned +@@ -829,14 +834,14 @@ + filepath = os.path.abspath(filepath) + while os.path.islink(filepath): + filepath = os.path.normpath( +- os.path.join(os.path.dirname(filepath),os.readlink(filepath))) ++ os.path.join(os.path.dirname(filepath), os.readlink(filepath))) + return filepath + +-def _syscmd_uname(option,default=''): ++def _syscmd_uname(option, default=''): + + """ Interface to the system's uname command. + """ +- if sys.platform in ('dos','win32','win16'): ++ if sys.platform in ('dos', 'win32', 'win16'): + # XXX Others too ? + return default + try: +@@ -850,7 +855,7 @@ + else: + return output + +-def _syscmd_file(target,default=''): ++def _syscmd_file(target, default=''): + + """ Interface to the system's file command. + +@@ -859,7 +864,7 @@ + default in case the command should fail. + + """ +- if sys.platform in ('dos','win32','win16'): ++ if sys.platform in ('dos', 'win32', 'win16'): + # XXX Others too ? + return default + target = _follow_symlinks(target) +@@ -881,17 +886,17 @@ + # Default values for architecture; non-empty strings override the + # defaults given as parameters + _default_architecture = { +- 'win32': ('','WindowsPE'), +- 'win16': ('','Windows'), +- 'dos': ('','MSDOS'), ++ 'win32': ('', 'WindowsPE'), ++ 'win16': ('', 'Windows'), ++ 'dos': ('', 'MSDOS'), + } + +-def architecture(executable=sys.executable,bits='',linkage=''): ++def architecture(executable=sys.executable, bits='', linkage=''): + + """ Queries the given executable (defaults to the Python interpreter + binary) for various architecture information. + +- Returns a tuple (bits,linkage) which contains information about ++ Returns a tuple (bits, linkage) which contains information about + the bit architecture and the linkage format used for the + executable. Both values are returned as strings. + +@@ -929,16 +934,16 @@ + # "file" command did not return anything; we'll try to provide + # some sensible defaults then... + if sys.platform in _default_architecture: +- b,l = _default_architecture[sys.platform] ++ b, l = _default_architecture[sys.platform] + if b: + bits = b + if l: + linkage = l +- return bits,linkage ++ return bits, linkage + + if 'executable' not in fileout: + # Format not supported +- return bits,linkage ++ return bits, linkage + + # Bits + if '32-bit' in fileout: +@@ -966,7 +971,7 @@ + # XXX the A.OUT format also falls under this class... + pass + +- return bits,linkage ++ return bits, linkage + + ### Portable uname() interface + +@@ -978,7 +983,7 @@ + def uname(): + + """ Fairly portable uname interface. Returns a tuple +- of strings (system,node,release,version,machine,processor) ++ of strings (system, node, release, version, machine, processor) + identifying the underlying platform. + + Note that unlike the os.uname function this also returns +@@ -997,7 +1002,7 @@ + + # Get some infos from the builtin os.uname API... + try: +- system,node,release,version,machine = os.uname() ++ system, node, release, version, machine = os.uname() + except AttributeError: + no_os_uname = 1 + +@@ -1015,7 +1020,7 @@ + + # Try win32_ver() on win32 platforms + if system == 'win32': +- release,version,csd,ptype = win32_ver() ++ release, version, csd, ptype = win32_ver() + if release and version: + use_syscmd_ver = 0 + # Try to use the PROCESSOR_* environment variables +@@ -1034,7 +1039,7 @@ + # Try the 'ver' system command available on some + # platforms + if use_syscmd_ver: +- system,release,version = _syscmd_ver(system) ++ system, release, version = _syscmd_ver(system) + # Normalize system to what win32_ver() normally returns + # (_syscmd_ver() tends to return the vendor name as well) + if system == 'Microsoft Windows': +@@ -1052,7 +1057,7 @@ + + # In case we still don't know anything useful, we'll try to + # help ourselves +- if system in ('win32','win16'): ++ if system in ('win32', 'win16'): + if not version: + if system == 'win32': + version = '32bit' +@@ -1061,7 +1066,7 @@ + system = 'Windows' + + elif system[:4] == 'java': +- release,vendor,vminfo,osinfo = java_ver() ++ release, vendor, vminfo, osinfo = java_ver() + system = 'Java' + version = ', '.join(vminfo) + if not version: +@@ -1079,14 +1084,14 @@ + except ImportError: + pass + else: +- csid, cpu_number = vms_lib.getsyi('SYI$_CPU',0) ++ csid, cpu_number = vms_lib.getsyi('SYI$_CPU', 0) + if (cpu_number >= 128): + processor = 'Alpha' + else: + processor = 'VAX' + if not processor: + # Get processor information from the uname system command +- processor = _syscmd_uname('-p','') ++ processor = _syscmd_uname('-p', '') + + #If any unknowns still exist, replace them with ''s, which are more portable + if system == 'unknown': +@@ -1107,7 +1112,8 @@ + system = 'Windows' + release = 'Vista' + +- _uname_cache = uname_result(system,node,release,version,machine,processor) ++ _uname_cache = uname_result(system, node, release, version, ++ machine, processor) + return _uname_cache + + ### Direct interfaces to some of the uname() return values +@@ -1404,57 +1410,58 @@ + + # Get uname information and then apply platform specific cosmetics + # to it... +- system,node,release,version,machine,processor = uname() ++ system, node, release, version, machine, processor = uname() + if machine == processor: + processor = '' + if aliased: +- system,release,version = system_alias(system,release,version) ++ system, release, version = system_alias(system, release, version) + + if system == 'Windows': + # MS platforms +- rel,vers,csd,ptype = win32_ver(version) ++ rel, vers, csd, ptype = win32_ver(version) + if terse: +- platform = _platform(system,release) ++ platform = _platform(system, release) + else: +- platform = _platform(system,release,version,csd) ++ platform = _platform(system, release, version, csd) + + elif system in ('Linux',): + # Linux based systems +- distname,distversion,distid = dist('') ++ distname, distversion, distid = dist('') + if distname and not terse: +- platform = _platform(system,release,machine,processor, ++ platform = _platform(system, release, machine, processor, + 'with', +- distname,distversion,distid) ++ distname, distversion, distid) + else: + # If the distribution name is unknown check for libc vs. glibc +- libcname,libcversion = libc_ver(sys.executable) +- platform = _platform(system,release,machine,processor, ++ libcname, libcversion = libc_ver(sys.executable) ++ platform = _platform(system, release, machine, processor, + 'with', + libcname+libcversion) + elif system == 'Java': + # Java platforms +- r,v,vminfo,(os_name,os_version,os_arch) = java_ver() ++ r, v, vminfo, (os_name, os_version, os_arch) = java_ver() + if terse or not os_name: +- platform = _platform(system,release,version) ++ platform = _platform(system, release, version) + else: +- platform = _platform(system,release,version, ++ platform = _platform(system, release, version, + 'on', +- os_name,os_version,os_arch) ++ os_name, os_version, os_arch) + + elif system == 'MacOS': + # MacOS platforms + if terse: +- platform = _platform(system,release) ++ platform = _platform(system, release) + else: +- platform = _platform(system,release,machine) ++ platform = _platform(system, release, machine) + + else: + # Generic handler + if terse: +- platform = _platform(system,release) ++ platform = _platform(system, release) + else: +- bits,linkage = architecture(sys.executable) +- platform = _platform(system,release,machine,processor,bits,linkage) ++ bits, linkage = architecture(sys.executable) ++ platform = _platform(system, release, machine, ++ processor, bits, linkage) + + _platform_cache[(aliased, terse)] = platform + return platform +@@ -1465,5 +1472,5 @@ + # Default is to print the aliased verbose platform string + terse = ('terse' in sys.argv or '--terse' in sys.argv) + aliased = (not 'nonaliased' in sys.argv and not '--nonaliased' in sys.argv) +- print(platform(aliased,terse)) ++ print(platform(aliased, terse)) + sys.exit(0) +diff -r 3405dc9a6afa Lib/poplib.py +--- a/Lib/poplib.py ++++ b/Lib/poplib.py +@@ -387,7 +387,9 @@ + if context is None: + context = ssl._create_stdlib_context() + resp = self._shortcmd('STLS') +- self.sock = context.wrap_socket(self.sock) ++ server_hostname = self.host if ssl.HAS_SNI else None ++ self.sock = context.wrap_socket(self.sock, ++ server_hostname=server_hostname) + self.file = self.sock.makefile('rb') + self._tls_established = True + return resp +@@ -428,7 +430,9 @@ + + def _create_socket(self, timeout): + sock = POP3._create_socket(self, timeout) +- sock = self.context.wrap_socket(sock) ++ server_hostname = self.host if ssl.HAS_SNI else None ++ sock = self.context.wrap_socket(sock, ++ server_hostname=server_hostname) + return sock + + def stls(self, keyfile=None, certfile=None, context=None): +diff -r 3405dc9a6afa Lib/runpy.py +--- a/Lib/runpy.py ++++ b/Lib/runpy.py +@@ -14,7 +14,9 @@ + import sys + import importlib.machinery # importlib first so we can test #15386 via -m + import types +-from pkgutil import read_code, get_loader, get_importer ++from importlib import find_spec ++from importlib.util import spec_from_loader ++from pkgutil import read_code, get_importer + + __all__ = [ + "run_module", "run_path", +@@ -58,51 +60,76 @@ + self.value = self._sentinel + sys.argv[0] = self._saved_value + ++# TODO: Replace these helpers with importlib._bootstrap._SpecMethods + def _run_code(code, run_globals, init_globals=None, +- mod_name=None, mod_fname=None, +- mod_loader=None, pkg_name=None): ++ mod_name=None, mod_spec=None, ++ pkg_name=None, script_name=None): + """Helper to run code in nominated namespace""" + if init_globals is not None: + run_globals.update(init_globals) ++ if mod_spec is None: ++ loader = None ++ fname = script_name ++ cached = None ++ else: ++ loader = mod_spec.loader ++ fname = mod_spec.origin ++ cached = mod_spec.cached ++ if pkg_name is None: ++ pkg_name = mod_spec.parent + run_globals.update(__name__ = mod_name, +- __file__ = mod_fname, +- __cached__ = None, ++ __file__ = fname, ++ __cached__ = cached, + __doc__ = None, +- __loader__ = mod_loader, +- __package__ = pkg_name) ++ __loader__ = loader, ++ __package__ = pkg_name, ++ __spec__ = mod_spec) + exec(code, run_globals) + return run_globals + + def _run_module_code(code, init_globals=None, +- mod_name=None, mod_fname=None, +- mod_loader=None, pkg_name=None): ++ mod_name=None, mod_spec=None, ++ pkg_name=None, script_name=None): + """Helper to run code in new namespace with sys modified""" +- with _TempModule(mod_name) as temp_module, _ModifiedArgv0(mod_fname): ++ fname = script_name if mod_spec is None else mod_spec.origin ++ with _TempModule(mod_name) as temp_module, _ModifiedArgv0(fname): + mod_globals = temp_module.module.__dict__ + _run_code(code, mod_globals, init_globals, +- mod_name, mod_fname, mod_loader, pkg_name) ++ mod_name, mod_spec, pkg_name, script_name) + # Copy the globals of the temporary module, as they + # may be cleared when the temporary module goes away + return mod_globals.copy() + + +-# This helper is needed due to a missing component in the PEP 302 +-# loader protocol (specifically, "get_filename" is non-standard) +-# Since we can't introduce new features in maintenance releases, +-# support was added to zipimporter under the name '_get_filename' +-def _get_filename(loader, mod_name): +- for attr in ("get_filename", "_get_filename"): +- meth = getattr(loader, attr, None) +- if meth is not None: +- return os.path.abspath(meth(mod_name)) +- return None ++def _fixed_find_spec(mod_name): ++ # find_spec has the same annoying behaviour as find_loader did (it ++ # fails to work properly for dotted names), so this is a fixed version ++ # ala pkgutil.get_loader ++ if mod_name.startswith('.'): ++ msg = "Relative module name {!r} not supported".format(mod_name) ++ raise ImportError(msg) ++ path = None ++ pkg_name = mod_name.rpartition(".")[0] ++ if pkg_name: ++ pkg = importlib.import_module(pkg_name) ++ path = getattr(pkg, "__path__", None) ++ if path is None: ++ return None ++ try: ++ return importlib.find_spec(mod_name, path) ++ except (ImportError, AttributeError, TypeError, ValueError) as ex: ++ # This hack fixes an impedance mismatch between pkgutil and ++ # importlib, where the latter raises other errors for cases where ++ # pkgutil previously raised ImportError ++ msg = "Error while finding spec for {!r} ({}: {})" ++ raise ImportError(msg.format(mod_name, type(ex), ex)) from ex + + # Helper to get the loader, code and filename for a module + def _get_module_details(mod_name): +- loader = get_loader(mod_name) +- if loader is None: ++ spec = _fixed_find_spec(mod_name) ++ if spec is None: + raise ImportError("No module named %s" % mod_name) +- if loader.is_package(mod_name): ++ if spec.submodule_search_locations is not None: + if mod_name == "__main__" or mod_name.endswith(".__main__"): + raise ImportError("Cannot use package as __main__ module") + try: +@@ -111,11 +138,14 @@ + except ImportError as e: + raise ImportError(("%s; %r is a package and cannot " + + "be directly executed") %(e, mod_name)) ++ loader = spec.loader ++ if loader is None: ++ raise ImportError("%r is a namespace package and cannot be executed" ++ % mod_name) + code = loader.get_code(mod_name) + if code is None: + raise ImportError("No code object available for %s" % mod_name) +- filename = _get_filename(loader, mod_name) +- return mod_name, loader, code, filename ++ return mod_name, spec, code + + # XXX ncoghlan: Should this be documented and made public? + # (Current thoughts: don't repeat the mistake that lead to its +@@ -137,9 +167,9 @@ + """ + try: + if alter_argv or mod_name != "__main__": # i.e. -m switch +- mod_name, loader, code, fname = _get_module_details(mod_name) ++ mod_name, mod_spec, code = _get_module_details(mod_name) + else: # i.e. directory or zipfile execution +- mod_name, loader, code, fname = _get_main_module_details() ++ mod_name, mod_spec, code = _get_main_module_details() + except ImportError as exc: + # Try to provide a good error message + # for directories, zip files and the -m switch +@@ -152,12 +182,11 @@ + info = "can't find '__main__' module in %r" % sys.argv[0] + msg = "%s: %s" % (sys.executable, info) + sys.exit(msg) +- pkg_name = mod_name.rpartition('.')[0] + main_globals = sys.modules["__main__"].__dict__ + if alter_argv: +- sys.argv[0] = fname ++ sys.argv[0] = mod_spec.origin + return _run_code(code, main_globals, None, +- "__main__", fname, loader, pkg_name) ++ "__main__", mod_spec) + + def run_module(mod_name, init_globals=None, + run_name=None, alter_sys=False): +@@ -165,17 +194,14 @@ + + Returns the resulting top level namespace dictionary + """ +- mod_name, loader, code, fname = _get_module_details(mod_name) ++ mod_name, mod_spec, code = _get_module_details(mod_name) + if run_name is None: + run_name = mod_name +- pkg_name = mod_name.rpartition('.')[0] + if alter_sys: +- return _run_module_code(code, init_globals, run_name, +- fname, loader, pkg_name) ++ return _run_module_code(code, init_globals, run_name, mod_spec) + else: + # Leave the sys module alone +- return _run_code(code, {}, init_globals, run_name, +- fname, loader, pkg_name) ++ return _run_code(code, {}, init_globals, run_name, mod_spec) + + def _get_main_module_details(): + # Helper that gives a nicer error message when attempting to +@@ -204,10 +230,7 @@ + # That didn't work, so try it as normal source code + with open(fname, "rb") as f: + code = compile(f.read(), fname, 'exec') +- loader = importlib.machinery.SourceFileLoader(run_name, fname) +- else: +- loader = importlib.machinery.SourcelessFileLoader(run_name, fname) +- return code, loader ++ return code, fname + + def run_path(path_name, init_globals=None, run_name=None): + """Execute code located at the specified filesystem location +@@ -231,9 +254,9 @@ + if isinstance(importer, type(None)) or is_NullImporter: + # Not a valid sys.path entry, so run the code directly + # execfile() doesn't help as we want to allow compiled files +- code, mod_loader = _get_code_from_file(run_name, path_name) +- return _run_module_code(code, init_globals, run_name, path_name, +- mod_loader, pkg_name) ++ code, fname = _get_code_from_file(run_name, path_name) ++ return _run_module_code(code, init_globals, run_name, ++ pkg_name=pkg_name, script_name=fname) + else: + # Importer is defined for path, so add it to + # the start of sys.path +@@ -245,12 +268,12 @@ + # have no choice and we have to remove it even while we read the + # code. If we don't do this, a __loader__ attribute in the + # existing __main__ module may prevent location of the new module. +- mod_name, loader, code, fname = _get_main_module_details() ++ mod_name, mod_spec, code = _get_main_module_details() + with _TempModule(run_name) as temp_module, \ + _ModifiedArgv0(path_name): + mod_globals = temp_module.module.__dict__ + return _run_code(code, mod_globals, init_globals, +- run_name, fname, loader, pkg_name).copy() ++ run_name, mod_spec, pkg_name).copy() + finally: + try: + sys.path.remove(path_name) +diff -r 3405dc9a6afa Lib/selectors.py +--- a/Lib/selectors.py ++++ b/Lib/selectors.py +@@ -25,6 +25,9 @@ + + Returns: + corresponding file descriptor ++ ++ Raises: ++ ValueError if the object is invalid + """ + if isinstance(fileobj, int): + fd = fileobj +@@ -55,7 +58,8 @@ + + def __getitem__(self, fileobj): + try: +- return self._selector._fd_to_key[_fileobj_to_fd(fileobj)] ++ fd = self._selector._fileobj_lookup(fileobj) ++ return self._selector._fd_to_key[fd] + except KeyError: + raise KeyError("{!r} is not registered".format(fileobj)) from None + +@@ -64,7 +68,7 @@ + + + class BaseSelector(metaclass=ABCMeta): +- """Base selector class. ++ """Selector abstract base class. + + A selector supports registering file objects to be monitored for specific + I/O events. +@@ -78,12 +82,7 @@ + performant implementation on the current platform. + """ + +- def __init__(self): +- # this maps file descriptors to keys +- self._fd_to_key = {} +- # read-only mapping returned by get_map() +- self._map = _SelectorMapping(self) +- ++ @abstractmethod + def register(self, fileobj, events, data=None): + """Register a file object. + +@@ -94,19 +93,19 @@ + + Returns: + SelectorKey instance ++ ++ Raises: ++ ValueError if events is invalid ++ KeyError if fileobj is already registered ++ OSError if fileobj is closed or otherwise is unacceptable to ++ the underlying system call (if a system call is made) ++ ++ Note: ++ OSError may or may not be raised + """ +- if (not events) or (events & ~(EVENT_READ | EVENT_WRITE)): +- raise ValueError("Invalid events: {!r}".format(events)) ++ raise NotImplementedError + +- key = SelectorKey(fileobj, _fileobj_to_fd(fileobj), events, data) +- +- if key.fd in self._fd_to_key: +- raise KeyError("{!r} (FD {}) is already " +- "registered".format(fileobj, key.fd)) +- +- self._fd_to_key[key.fd] = key +- return key +- ++ @abstractmethod + def unregister(self, fileobj): + """Unregister a file object. + +@@ -115,12 +114,15 @@ + + Returns: + SelectorKey instance ++ ++ Raises: ++ KeyError if fileobj is not registered ++ ++ Note: ++ If fileobj is registered but has since been closed this does ++ *not* raise OSError (even if the wrapped syscall does) + """ +- try: +- key = self._fd_to_key.pop(_fileobj_to_fd(fileobj)) +- except KeyError: +- raise KeyError("{!r} is not registered".format(fileobj)) from None +- return key ++ raise NotImplementedError + + def modify(self, fileobj, events, data=None): + """Change a registered file object monitored events or attached data. +@@ -132,20 +134,12 @@ + + Returns: + SelectorKey instance ++ ++ Raises: ++ Anything that unregister() or register() raises + """ +- # TODO: Subclasses can probably optimize this even further. +- try: +- key = self._fd_to_key[_fileobj_to_fd(fileobj)] +- except KeyError: +- raise KeyError("{!r} is not registered".format(fileobj)) from None +- if events != key.events: +- self.unregister(fileobj) +- key = self.register(fileobj, events, data) +- elif data != key.data: +- # Use a shortcut to update the data. +- key = key._replace(data=data) +- self._fd_to_key[key.fd] = key +- return key ++ self.unregister(fileobj) ++ return self.register(fileobj, events, data) + + @abstractmethod + def select(self, timeout=None): +@@ -164,14 +158,14 @@ + list of (key, events) for ready file objects + `events` is a bitwise mask of EVENT_READ|EVENT_WRITE + """ +- raise NotImplementedError() ++ raise NotImplementedError + + def close(self): + """Close the selector. + + This must be called to make sure that any underlying resource is freed. + """ +- self._fd_to_key.clear() ++ pass + + def get_key(self, fileobj): + """Return the key associated to a registered file object. +@@ -179,14 +173,16 @@ + Returns: + SelectorKey for this file object + """ ++ mapping = self.get_map() + try: +- return self._fd_to_key[_fileobj_to_fd(fileobj)] ++ return mapping[fileobj] + except KeyError: + raise KeyError("{!r} is not registered".format(fileobj)) from None + ++ @abstractmethod + def get_map(self): + """Return a mapping of file objects to selector keys.""" +- return self._map ++ raise NotImplementedError + + def __enter__(self): + return self +@@ -194,6 +190,76 @@ + def __exit__(self, *args): + self.close() + ++ ++class _BaseSelectorImpl(BaseSelector): ++ """Base selector implementation.""" ++ ++ def __init__(self): ++ # this maps file descriptors to keys ++ self._fd_to_key = {} ++ # read-only mapping returned by get_map() ++ self._map = _SelectorMapping(self) ++ ++ def _fileobj_lookup(self, fileobj): ++ """Return a file descriptor from a file object. ++ ++ This wraps _fileobj_to_fd() to do an exhaustive search in case ++ the object is invalid but we still have it in our map. This ++ is used by unregister() so we can unregister an object that ++ was previously registered even if it is closed. It is also ++ used by _SelectorMapping. ++ """ ++ try: ++ return _fileobj_to_fd(fileobj) ++ except ValueError: ++ # Do an exhaustive search. ++ for key in self._fd_to_key.values(): ++ if key.fileobj is fileobj: ++ return key.fd ++ # Raise ValueError after all. ++ raise ++ ++ def register(self, fileobj, events, data=None): ++ if (not events) or (events & ~(EVENT_READ | EVENT_WRITE)): ++ raise ValueError("Invalid events: {!r}".format(events)) ++ ++ key = SelectorKey(fileobj, self._fileobj_lookup(fileobj), events, data) ++ ++ if key.fd in self._fd_to_key: ++ raise KeyError("{!r} (FD {}) is already registered" ++ .format(fileobj, key.fd)) ++ ++ self._fd_to_key[key.fd] = key ++ return key ++ ++ def unregister(self, fileobj): ++ try: ++ key = self._fd_to_key.pop(self._fileobj_lookup(fileobj)) ++ except KeyError: ++ raise KeyError("{!r} is not registered".format(fileobj)) from None ++ return key ++ ++ def modify(self, fileobj, events, data=None): ++ # TODO: Subclasses can probably optimize this even further. ++ try: ++ key = self._fd_to_key[self._fileobj_lookup(fileobj)] ++ except KeyError: ++ raise KeyError("{!r} is not registered".format(fileobj)) from None ++ if events != key.events: ++ self.unregister(fileobj) ++ key = self.register(fileobj, events, data) ++ elif data != key.data: ++ # Use a shortcut to update the data. ++ key = key._replace(data=data) ++ self._fd_to_key[key.fd] = key ++ return key ++ ++ def close(self): ++ self._fd_to_key.clear() ++ ++ def get_map(self): ++ return self._map ++ + def _key_from_fd(self, fd): + """Return the key associated to a given file descriptor. + +@@ -209,7 +275,7 @@ + return None + + +-class SelectSelector(BaseSelector): ++class SelectSelector(_BaseSelectorImpl): + """Select-based selector.""" + + def __init__(self): +@@ -262,7 +328,7 @@ + + if hasattr(select, 'poll'): + +- class PollSelector(BaseSelector): ++ class PollSelector(_BaseSelectorImpl): + """Poll-based selector.""" + + def __init__(self): +@@ -306,7 +372,7 @@ + + if hasattr(select, 'epoll'): + +- class EpollSelector(BaseSelector): ++ class EpollSelector(_BaseSelectorImpl): + """Epoll-based selector.""" + + def __init__(self): +@@ -328,7 +394,12 @@ + + def unregister(self, fileobj): + key = super().unregister(fileobj) +- self._epoll.unregister(key.fd) ++ try: ++ self._epoll.unregister(key.fd) ++ except OSError: ++ # This can happen if the FD was closed since it ++ # was registered. ++ pass + return key + + def select(self, timeout=None): +@@ -358,7 +429,7 @@ + + if hasattr(select, 'kqueue'): + +- class KqueueSelector(BaseSelector): ++ class KqueueSelector(_BaseSelectorImpl): + """Kqueue-based selector.""" + + def __init__(self): +@@ -385,11 +456,20 @@ + if key.events & EVENT_READ: + kev = select.kevent(key.fd, select.KQ_FILTER_READ, + select.KQ_EV_DELETE) +- self._kqueue.control([kev], 0, 0) ++ try: ++ self._kqueue.control([kev], 0, 0) ++ except OSError: ++ # This can happen if the FD was closed since it ++ # was registered. ++ pass + if key.events & EVENT_WRITE: + kev = select.kevent(key.fd, select.KQ_FILTER_WRITE, + select.KQ_EV_DELETE) +- self._kqueue.control([kev], 0, 0) ++ try: ++ self._kqueue.control([kev], 0, 0) ++ except OSError: ++ # See comment above. ++ pass + return key + + def select(self, timeout=None): +diff -r 3405dc9a6afa Lib/smtplib.py +--- a/Lib/smtplib.py ++++ b/Lib/smtplib.py +@@ -232,6 +232,7 @@ + will be used. + + """ ++ self._host = host + self.timeout = timeout + self.esmtp_features = {} + self.source_address = source_address +@@ -667,7 +668,9 @@ + if context is None: + context = ssl._create_stdlib_context(certfile=certfile, + keyfile=keyfile) +- self.sock = context.wrap_socket(self.sock) ++ server_hostname = self._host if ssl.HAS_SNI else None ++ self.sock = context.wrap_socket(self.sock, ++ server_hostname=server_hostname) + self.file = None + # RFC 3207: + # The client MUST discard any knowledge obtained from +@@ -892,7 +895,9 @@ + print('connect:', (host, port), file=stderr) + new_socket = socket.create_connection((host, port), timeout, + self.source_address) +- new_socket = self.context.wrap_socket(new_socket) ++ server_hostname = self._host if ssl.HAS_SNI else None ++ new_socket = self.context.wrap_socket(new_socket, ++ server_hostname=server_hostname) + return new_socket + + __all__.append("SMTP_SSL") +diff -r 3405dc9a6afa Lib/sqlite3/test/regression.py +--- a/Lib/sqlite3/test/regression.py ++++ b/Lib/sqlite3/test/regression.py +@@ -330,6 +330,11 @@ + datetime.datetime(2012, 4, 4, 15, 6, 0, 123456), + ]) + ++ def CheckInvalidIsolationLevelType(self): ++ # isolation level is a string, not an integer ++ self.assertRaises(TypeError, ++ sqlite.connect, ":memory:", isolation_level=123) ++ + + def suite(): + regression_suite = unittest.makeSuite(RegressionTests, "Check") +diff -r 3405dc9a6afa Lib/ssl.py +--- a/Lib/ssl.py ++++ b/Lib/ssl.py +@@ -148,7 +148,9 @@ + from _ssl import enum_certificates, enum_crls + + from socket import getnameinfo as _getnameinfo ++from socket import SHUT_RDWR as _SHUT_RDWR + from socket import socket, AF_INET, SOCK_STREAM, create_connection ++from socket import SOL_SOCKET, SO_TYPE + import base64 # for DER-to-PEM translation + import traceback + import errno +@@ -235,7 +237,9 @@ + returns nothing. + """ + if not cert: +- raise ValueError("empty or no certificate") ++ raise ValueError("empty or no certificate, match_hostname needs a " ++ "SSL socket or SSL context with either " ++ "CERT_OPTIONAL or CERT_REQUIRED") + dnsnames = [] + san = cert.get('subjectAltName', ()) + for key, value in san: +@@ -383,11 +387,14 @@ + context = SSLContext(PROTOCOL_TLSv1) + # SSLv2 considered harmful. + context.options |= OP_NO_SSLv2 ++ # disable compression to prevent CRIME attacks (OpenSSL 1.0+) ++ context.options |= getattr(_ssl, "OP_NO_COMPRESSION", 0) + # disallow ciphers with known vulnerabilities + context.set_ciphers(_RESTRICTED_CIPHERS) +- # verify certs in client mode ++ # verify certs and host name in client mode + if purpose == Purpose.SERVER_AUTH: + context.verify_mode = CERT_REQUIRED ++ context.check_hostname = True + if cafile or capath or cadata: + context.load_verify_locations(cafile, capath, cadata) + elif context.verify_mode != CERT_NONE: +@@ -399,7 +406,7 @@ + + + def _create_stdlib_context(protocol=PROTOCOL_SSLv23, *, cert_reqs=None, +- purpose=Purpose.SERVER_AUTH, ++ check_hostname=False, purpose=Purpose.SERVER_AUTH, + certfile=None, keyfile=None, + cafile=None, capath=None, cadata=None): + """Create a SSLContext object for Python stdlib modules +@@ -418,6 +425,7 @@ + + if cert_reqs is not None: + context.verify_mode = cert_reqs ++ context.check_hostname = check_hostname + + if keyfile and not certfile: + raise ValueError("certfile must be specified") +@@ -475,9 +483,20 @@ + self.ssl_version = ssl_version + self.ca_certs = ca_certs + self.ciphers = ciphers ++ # Can't use sock.type as other flags (such as SOCK_NONBLOCK) get ++ # mixed in. ++ if sock.getsockopt(SOL_SOCKET, SO_TYPE) != SOCK_STREAM: ++ raise NotImplementedError("only stream sockets are supported") + if server_side and server_hostname: + raise ValueError("server_hostname can only be specified " + "in client mode") ++ if self._context.check_hostname and not server_hostname: ++ if HAS_SNI: ++ raise ValueError("check_hostname requires server_hostname") ++ else: ++ raise ValueError("check_hostname requires server_hostname, " ++ "but it's not supported by your OpenSSL " ++ "library") + self.server_side = server_side + self.server_hostname = server_hostname + self.do_handshake_on_connect = do_handshake_on_connect +@@ -520,9 +539,9 @@ + raise ValueError("do_handshake_on_connect should not be specified for non-blocking sockets") + self.do_handshake() + +- except OSError as x: ++ except (OSError, ValueError): + self.close() +- raise x ++ raise + + @property + def context(self): +@@ -749,6 +768,12 @@ + finally: + self.settimeout(timeout) + ++ if self.context.check_hostname: ++ if not self.server_hostname: ++ raise ValueError("check_hostname needs server_hostname " ++ "argument") ++ match_hostname(self.getpeercert(), self.server_hostname) ++ + def _real_connect(self, addr, connect_ex): + if self.server_side: + raise ValueError("can't connect in server-side mode") +@@ -768,7 +793,7 @@ + if self.do_handshake_on_connect: + self.do_handshake() + return rc +- except OSError: ++ except (OSError, ValueError): + self._sslobj = None + raise + +diff -r 3405dc9a6afa Lib/subprocess.py +--- a/Lib/subprocess.py ++++ b/Lib/subprocess.py +@@ -1341,6 +1341,13 @@ + # Data format: "exception name:hex errno:description" + # Pickle is not used; it is complex and involves memory allocation. + errpipe_read, errpipe_write = os.pipe() ++ # errpipe_write must not be in the standard io 0, 1, or 2 fd range. ++ low_fds_to_close = [] ++ while errpipe_write < 3: ++ low_fds_to_close.append(errpipe_write) ++ errpipe_write = os.dup(errpipe_write) ++ for low_fd in low_fds_to_close: ++ os.close(low_fd) + try: + try: + # We must avoid complex work that could involve +@@ -1555,6 +1562,9 @@ + + self._save_input(input) + ++ if self._input: ++ input_view = memoryview(self._input) ++ + with _PopenSelector() as selector: + if self.stdin and input: + selector.register(self.stdin, selectors.EVENT_WRITE) +@@ -1576,8 +1586,8 @@ + + for key, events in ready: + if key.fileobj is self.stdin: +- chunk = self._input[self._input_offset : +- self._input_offset + _PIPE_BUF] ++ chunk = input_view[self._input_offset : ++ self._input_offset + _PIPE_BUF] + try: + self._input_offset += os.write(key.fd, chunk) + except OSError as e: +@@ -1591,7 +1601,7 @@ + selector.unregister(key.fileobj) + key.fileobj.close() + elif key.fileobj in (self.stdout, self.stderr): +- data = os.read(key.fd, 4096) ++ data = os.read(key.fd, 32768) + if not data: + selector.unregister(key.fileobj) + key.fileobj.close() +diff -r 3405dc9a6afa Lib/sysconfig.py +--- a/Lib/sysconfig.py ++++ b/Lib/sysconfig.py +@@ -585,7 +585,7 @@ + """ + if name == 'SO': + import warnings +- warnings.warn('SO is deprecated, use EXT_SUFFIX', DeprecationWarning) ++ warnings.warn('SO is deprecated, use EXT_SUFFIX', DeprecationWarning, 2) + return get_config_vars().get(name) + + +diff -r 3405dc9a6afa Lib/tempfile.py +--- a/Lib/tempfile.py ++++ b/Lib/tempfile.py +@@ -27,6 +27,7 @@ + + # Imports. + ++import functools as _functools + import warnings as _warnings + import sys as _sys + import io as _io +@@ -329,13 +330,10 @@ + "No usable temporary filename found") + + +-class _TemporaryFileWrapper: +- """Temporary file wrapper +- +- This class provides a wrapper around files opened for +- temporary use. In particular, it seeks to automatically +- remove the file when it is no longer needed. +- """ ++class _TemporaryFileCloser: ++ """A separate object allowing proper closing of a temporary file's ++ underlying file object, without adding a __del__ method to the ++ temporary file.""" + + def __init__(self, file, name, delete=True): + self.file = file +@@ -343,26 +341,6 @@ + self.close_called = False + self.delete = delete + +- def __getattr__(self, name): +- # Attribute lookups are delegated to the underlying file +- # and cached for non-numeric results +- # (i.e. methods are cached, closed and friends are not) +- file = self.__dict__['file'] +- a = getattr(file, name) +- if not isinstance(a, int): +- setattr(self, name, a) +- return a +- +- # The underlying __enter__ method returns the wrong object +- # (self.file) so override it to return the wrapper +- def __enter__(self): +- self.file.__enter__() +- return self +- +- # iter() doesn't use __getattr__ to find the __iter__ method +- def __iter__(self): +- return iter(self.file) +- + # NT provides delete-on-close as a primitive, so we don't need + # the wrapper to do anything special. We still use it so that + # file.name is useful (i.e. not "(fdopen)") with NamedTemporaryFile. +@@ -381,18 +359,72 @@ + if self.delete: + self.unlink(self.name) + ++ # Need to ensure the file is deleted on __del__ + def __del__(self): + self.close() + +- # Need to trap __exit__ as well to ensure the file gets +- # deleted when used in a with statement +- def __exit__(self, exc, value, tb): +- result = self.file.__exit__(exc, value, tb) +- self.close() +- return result + else: +- def __exit__(self, exc, value, tb): +- self.file.__exit__(exc, value, tb) ++ def close(self): ++ if not self.close_called: ++ self.close_called = True ++ self.file.close() ++ ++ ++class _TemporaryFileWrapper: ++ """Temporary file wrapper ++ ++ This class provides a wrapper around files opened for ++ temporary use. In particular, it seeks to automatically ++ remove the file when it is no longer needed. ++ """ ++ ++ def __init__(self, file, name, delete=True): ++ self.file = file ++ self.name = name ++ self.delete = delete ++ self._closer = _TemporaryFileCloser(file, name, delete) ++ ++ def __getattr__(self, name): ++ # Attribute lookups are delegated to the underlying file ++ # and cached for non-numeric results ++ # (i.e. methods are cached, closed and friends are not) ++ file = self.__dict__['file'] ++ a = getattr(file, name) ++ if hasattr(a, '__call__'): ++ func = a ++ @_functools.wraps(func) ++ def func_wrapper(*args, **kwargs): ++ return func(*args, **kwargs) ++ # Avoid closing the file as long as the wrapper is alive, ++ # see issue #18879. ++ func_wrapper._closer = self._closer ++ a = func_wrapper ++ if not isinstance(a, int): ++ setattr(self, name, a) ++ return a ++ ++ # The underlying __enter__ method returns the wrong object ++ # (self.file) so override it to return the wrapper ++ def __enter__(self): ++ self.file.__enter__() ++ return self ++ ++ # Need to trap __exit__ as well to ensure the file gets ++ # deleted when used in a with statement ++ def __exit__(self, exc, value, tb): ++ result = self.file.__exit__(exc, value, tb) ++ self.close() ++ return result ++ ++ def close(self): ++ """ ++ Close the temporary file, possibly deleting it. ++ """ ++ self._closer.close() ++ ++ # iter() doesn't use __getattr__ to find the __iter__ method ++ def __iter__(self): ++ return iter(self.file) + + + def NamedTemporaryFile(mode='w+b', buffering=-1, encoding=None, +diff -r 3405dc9a6afa Lib/test/_test_multiprocessing.py +--- a/Lib/test/_test_multiprocessing.py ++++ b/Lib/test/_test_multiprocessing.py +@@ -198,7 +198,7 @@ + + def test_current(self): + if self.TYPE == 'threads': +- return ++ self.skipTest('test not appropriate for {}'.format(self.TYPE)) + + current = self.current_process() + authkey = current.authkey +@@ -212,7 +212,7 @@ + + def test_daemon_argument(self): + if self.TYPE == "threads": +- return ++ self.skipTest('test not appropriate for {}'.format(self.TYPE)) + + # By default uses the current process's daemon flag. + proc0 = self.Process(target=self._test) +@@ -277,7 +277,7 @@ + + def test_terminate(self): + if self.TYPE == 'threads': +- return ++ self.skipTest('test not appropriate for {}'.format(self.TYPE)) + + p = self.Process(target=self._test_terminate) + p.daemon = True +@@ -385,7 +385,7 @@ + + def test_sentinel(self): + if self.TYPE == "threads": +- return ++ self.skipTest('test not appropriate for {}'.format(self.TYPE)) + event = self.Event() + p = self.Process(target=self._test_sentinel, args=(event,)) + with self.assertRaises(ValueError): +@@ -441,7 +441,7 @@ + def test_stderr_flush(self): + # sys.stderr is flushed at process shutdown (issue #13812) + if self.TYPE == "threads": +- return ++ self.skipTest('test not appropriate for {}'.format(self.TYPE)) + + testfn = test.support.TESTFN + self.addCleanup(test.support.unlink, testfn) +@@ -469,7 +469,7 @@ + def test_sys_exit(self): + # See Issue 13854 + if self.TYPE == 'threads': +- return ++ self.skipTest('test not appropriate for {}'.format(self.TYPE)) + + testfn = test.support.TESTFN + self.addCleanup(test.support.unlink, testfn) +@@ -678,7 +678,7 @@ + try: + self.assertEqual(q.qsize(), 0) + except NotImplementedError: +- return ++ self.skipTest('qsize method not implemented') + q.put(1) + self.assertEqual(q.qsize(), 1) + q.put(5) +@@ -786,7 +786,7 @@ + + def test_timeout(self): + if self.TYPE != 'processes': +- return ++ self.skipTest('test not appropriate for {}'.format(self.TYPE)) + + sem = self.Semaphore(0) + acquire = TimingWrapper(sem.acquire) +@@ -1406,7 +1406,7 @@ + + def test_thousand(self): + if self.TYPE == 'manager': +- return ++ self.skipTest('test not appropriate for {}'.format(self.TYPE)) + passes = 1000 + lock = self.Lock() + conn, child_conn = self.Pipe(False) +@@ -1701,7 +1701,7 @@ + def test_map_unplicklable(self): + # Issue #19425 -- failure to pickle should not cause a hang + if self.TYPE == 'threads': +- return ++ self.skipTest('test not appropriate for {}'.format(self.TYPE)) + class A(object): + def __reduce__(self): + raise RuntimeError('cannot pickle') +@@ -2224,7 +2224,7 @@ + + def test_sendbytes(self): + if self.TYPE != 'processes': +- return ++ self.skipTest('test not appropriate for {}'.format(self.TYPE)) + + msg = latin('abcdefghijklmnopqrstuvwxyz') + a, b = self.Pipe() +diff -r 3405dc9a6afa Lib/test/datetimetester.py +--- a/Lib/test/datetimetester.py ++++ b/Lib/test/datetimetester.py +@@ -2029,6 +2029,7 @@ + class TestSubclassDateTime(TestDateTime): + theclass = SubclassDatetime + # Override tests not designed for subclass ++ @unittest.skip('not appropriate for subclasses') + def test_roundtrip(self): + pass + +diff -r 3405dc9a6afa Lib/test/multibytecodec_support.py +--- a/Lib/test/multibytecodec_support.py ++++ b/Lib/test/multibytecodec_support.py +@@ -73,7 +73,7 @@ + + def test_xmlcharrefreplace(self): + if self.has_iso10646: +- return ++ self.skipTest('encoding contains full ISO 10646 map') + + s = "\u0b13\u0b23\u0b60 nd eggs" + self.assertEqual( +@@ -83,7 +83,7 @@ + + def test_customreplace_encode(self): + if self.has_iso10646: +- return ++ self.skipTest('encoding contains full ISO 10646 map') + + from html.entities import codepoint2name + +diff -r 3405dc9a6afa Lib/test/outstanding_bugs.py +--- a/Lib/test/outstanding_bugs.py ++++ b/Lib/test/outstanding_bugs.py +@@ -10,79 +10,9 @@ + from test import support + + # +-# One test case for outstanding bugs at the moment: ++# No test cases for outstanding bugs at the moment. + # + +-# test_io +-import io +-class TextIOWrapperTest(unittest.TestCase): +- +- def setUp(self): +- self.testdata = b"AAA\r\nBBB\rCCC\r\nDDD\nEEE\r\n" +- self.normalized = b"AAA\nBBB\nCCC\nDDD\nEEE\n".decode("ASCII") +- +- def tearDown(self): +- support.unlink(support.TESTFN) +- +- +- def test_issue1395_1(self): +- txt = io.TextIOWrapper(io.BytesIO(self.testdata), encoding="ASCII") +- +- # read one char at a time +- reads = "" +- while True: +- c = txt.read(1) +- if not c: +- break +- reads += c +- self.assertEqual(reads, self.normalized) +- +- def test_issue1395_2(self): +- txt = io.TextIOWrapper(io.BytesIO(self.testdata), encoding="ASCII") +- txt._CHUNK_SIZE = 4 +- +- reads = "" +- while True: +- c = txt.read(4) +- if not c: +- break +- reads += c +- self.assertEqual(reads, self.normalized) +- +- def test_issue1395_3(self): +- txt = io.TextIOWrapper(io.BytesIO(self.testdata), encoding="ASCII") +- txt._CHUNK_SIZE = 4 +- +- reads = txt.read(4) +- reads += txt.read(4) +- reads += txt.readline() +- reads += txt.readline() +- reads += txt.readline() +- self.assertEqual(reads, self.normalized) +- +- def test_issue1395_4(self): +- txt = io.TextIOWrapper(io.BytesIO(self.testdata), encoding="ASCII") +- txt._CHUNK_SIZE = 4 +- +- reads = txt.read(4) +- reads += txt.read() +- self.assertEqual(reads, self.normalized) +- +- def test_issue1395_5(self): +- txt = io.TextIOWrapper(io.BytesIO(self.testdata), encoding="ASCII") +- txt._CHUNK_SIZE = 4 +- +- reads = txt.read(4) +- pos = txt.tell() +- txt.seek(0) +- txt.seek(pos) +- self.assertEqual(txt.read(4), "BBB\n") +- +- +- +-def test_main(): +- support.run_unittest( +- TextIOWrapperTest) + + if __name__ == "__main__": +- test_main() ++ unittest.main() +diff -r 3405dc9a6afa Lib/test/pickletester.py +--- a/Lib/test/pickletester.py ++++ b/Lib/test/pickletester.py +@@ -3,6 +3,7 @@ + import pickle + import pickletools + import random ++import struct + import sys + import unittest + import weakref +@@ -413,6 +414,71 @@ + # set([3]) pickled from 2.x with protocol 2 + DATA6 = b'\x80\x02c__builtin__\nset\nq\x00]q\x01K\x03a\x85q\x02Rq\x03.' + ++python2_exceptions_without_args = ( ++ ArithmeticError, ++ AssertionError, ++ AttributeError, ++ BaseException, ++ BufferError, ++ BytesWarning, ++ DeprecationWarning, ++ EOFError, ++ EnvironmentError, ++ Exception, ++ FloatingPointError, ++ FutureWarning, ++ GeneratorExit, ++ IOError, ++ ImportError, ++ ImportWarning, ++ IndentationError, ++ IndexError, ++ KeyError, ++ KeyboardInterrupt, ++ LookupError, ++ MemoryError, ++ NameError, ++ NotImplementedError, ++ OSError, ++ OverflowError, ++ PendingDeprecationWarning, ++ ReferenceError, ++ RuntimeError, ++ RuntimeWarning, ++ # StandardError is gone in Python 3, we map it to Exception ++ StopIteration, ++ SyntaxError, ++ SyntaxWarning, ++ SystemError, ++ SystemExit, ++ TabError, ++ TypeError, ++ UnboundLocalError, ++ UnicodeError, ++ UnicodeWarning, ++ UserWarning, ++ ValueError, ++ Warning, ++ ZeroDivisionError, ++) ++ ++exception_pickle = b'\x80\x02cexceptions\n?\nq\x00)Rq\x01.' ++ ++# Exception objects without arguments pickled from 2.x with protocol 2 ++DATA7 = { ++ exception : ++ exception_pickle.replace(b'?', exception.__name__.encode("ascii")) ++ for exception in python2_exceptions_without_args ++} ++ ++# StandardError is mapped to Exception, test that separately ++DATA8 = exception_pickle.replace(b'?', b'StandardError') ++ ++# UnicodeEncodeError object pickled from 2.x with protocol 2 ++DATA9 = (b'\x80\x02cexceptions\nUnicodeEncodeError\n' ++ b'q\x00(U\x05asciiq\x01X\x03\x00\x00\x00fooq\x02K\x00K\x01' ++ b'U\x03badq\x03tq\x04Rq\x05.') ++ + + def create_data(): + c = C() +@@ -746,10 +812,18 @@ + self.assertEqual(self.dumps(1.2, 0)[0:3], b'F1.') + + def test_reduce(self): +- pass ++ for proto in protocols: ++ inst = AAA() ++ dumped = self.dumps(inst, proto) ++ loaded = self.loads(dumped) ++ self.assertEqual(loaded, REDUCE_A) + + def test_getinitargs(self): +- pass ++ for proto in protocols: ++ inst = initarg(1, 2) ++ dumped = self.dumps(inst, proto) ++ loaded = self.loads(dumped) ++ self.assert_is_copy(inst, loaded) + + def test_pop_empty_stack(self): + # Test issue7455 +@@ -804,6 +878,15 @@ + u = self.loads(s) + self.assertIs(NotImplemented, u) + ++ def test_singleton_types(self): ++ # Issue #6477: Test that types of built-in singletons can be pickled. ++ singletons = [None, ..., NotImplemented] ++ for singleton in singletons: ++ for proto in protocols: ++ s = self.dumps(type(singleton), proto) ++ u = self.loads(s) ++ self.assertIs(type(singleton), u) ++ + # Tests for protocol 2 + + def test_proto(self): +@@ -1205,6 +1288,21 @@ + self.assertEqual(list(loaded.keys()), ["key"]) + self.assertEqual(loaded["key"].value, "Set-Cookie: key=value") + ++ for (exc, data) in DATA7.items(): ++ loaded = self.loads(data) ++ self.assertIs(type(loaded), exc) ++ ++ loaded = self.loads(DATA8) ++ self.assertIs(type(loaded), Exception) ++ ++ loaded = self.loads(DATA9) ++ self.assertIs(type(loaded), UnicodeEncodeError) ++ self.assertEqual(loaded.object, "foo") ++ self.assertEqual(loaded.encoding, "ascii") ++ self.assertEqual(loaded.start, 0) ++ self.assertEqual(loaded.end, 1) ++ self.assertEqual(loaded.reason, "bad") ++ + def test_pickle_to_2x(self): + # Pickle non-trivial data with protocol 2, expecting that it yields + # the same result as Python 2.x did. +@@ -1215,6 +1313,35 @@ + dumped = self.dumps(set([3]), 2) + self.assertEqual(dumped, DATA6) + ++ def test_load_python2_str_as_bytes(self): ++ # From Python 2: pickle.dumps('a\x00\xa0', protocol=0) ++ self.assertEqual(self.loads(b"S'a\\x00\\xa0'\n.", ++ encoding="bytes"), b'a\x00\xa0') ++ # From Python 2: pickle.dumps('a\x00\xa0', protocol=1) ++ self.assertEqual(self.loads(b'U\x03a\x00\xa0.', ++ encoding="bytes"), b'a\x00\xa0') ++ # From Python 2: pickle.dumps('a\x00\xa0', protocol=2) ++ self.assertEqual(self.loads(b'\x80\x02U\x03a\x00\xa0.', ++ encoding="bytes"), b'a\x00\xa0') ++ ++ def test_load_python2_unicode_as_str(self): ++ # From Python 2: pickle.dumps(u'Ï€', protocol=0) ++ self.assertEqual(self.loads(b'V\\u03c0\n.', ++ encoding='bytes'), 'Ï€') ++ # From Python 2: pickle.dumps(u'Ï€', protocol=1) ++ self.assertEqual(self.loads(b'X\x02\x00\x00\x00\xcf\x80.', ++ encoding="bytes"), 'Ï€') ++ # From Python 2: pickle.dumps(u'Ï€', protocol=2) ++ self.assertEqual(self.loads(b'\x80\x02X\x02\x00\x00\x00\xcf\x80.', ++ encoding="bytes"), 'Ï€') ++ ++ def test_load_long_python2_str_as_bytes(self): ++ # From Python 2: pickle.dumps('x' * 300, protocol=1) ++ self.assertEqual(self.loads(pickle.BINSTRING + ++ struct.pack(" (1 << 32) or struct.calcsize('P') != 4, ++ 'only applies to 32-bit platforms') + def test_replace_overflow(self): + # Check for overflow checking on 32 bit machines +- if sys.maxsize != 2147483647 or struct.calcsize("P") > 4: +- return + A2_16 = "A" * (2**16) + self.checkraises(OverflowError, A2_16, "replace", "", A2_16) + self.checkraises(OverflowError, A2_16, "replace", "A", A2_16) +diff -r 3405dc9a6afa Lib/test/test_abstract_numbers.py +--- a/Lib/test/test_abstract_numbers.py ++++ b/Lib/test/test_abstract_numbers.py +@@ -4,7 +4,6 @@ + import operator + import unittest + from numbers import Complex, Real, Rational, Integral +-from test import support + + class TestNumbers(unittest.TestCase): + def test_int(self): +@@ -40,9 +39,6 @@ + self.assertRaises(TypeError, float, c1) + self.assertRaises(TypeError, int, c1) + +-def test_main(): +- support.run_unittest(TestNumbers) +- + + if __name__ == "__main__": + unittest.main() +diff -r 3405dc9a6afa Lib/test/test_aifc.py +--- a/Lib/test/test_aifc.py ++++ b/Lib/test/test_aifc.py +@@ -14,9 +14,6 @@ + module = aifc + close_fd = True + test_unseekable_read = None +- test_unseekable_write = None +- test_unseekable_incompleted_write = None +- test_unseekable_overflowed_write = None + + + class AifcPCM8Test(AifcTest, unittest.TestCase): +diff -r 3405dc9a6afa Lib/test/test_array.py +--- a/Lib/test/test_array.py ++++ b/Lib/test/test_array.py +@@ -946,7 +946,7 @@ + try: + import gc + except ImportError: +- return ++ self.skipTest('gc module not available') + a = array.array(self.typecode) + l = [iter(a)] + l.append(l) +@@ -1027,6 +1027,18 @@ + basesize = support.calcvobjsize('Pn2Pi') + support.check_sizeof(self, a, basesize) + ++ def test_initialize_with_unicode(self): ++ if self.typecode != 'u': ++ with self.assertRaises(TypeError) as cm: ++ a = array.array(self.typecode, 'foo') ++ self.assertIn("cannot use a str", str(cm.exception)) ++ with self.assertRaises(TypeError) as cm: ++ a = array.array(self.typecode, array.array('u', 'foo')) ++ self.assertIn("cannot use a unicode array", str(cm.exception)) ++ else: ++ a = array.array(self.typecode, "foo") ++ a = array.array(self.typecode, array.array('u', 'foo')) ++ + + class StringTest(BaseTest): + +diff -r 3405dc9a6afa Lib/test/test_asyncio/keycert3.pem +--- /dev/null ++++ b/Lib/test/test_asyncio/keycert3.pem +@@ -0,0 +1,73 @@ ++-----BEGIN PRIVATE KEY----- ++MIICdgIBADANBgkqhkiG9w0BAQEFAASCAmAwggJcAgEAAoGBAMLgD0kAKDb5cFyP ++jbwNfR5CtewdXC+kMXAWD8DLxiTTvhMW7qVnlwOm36mZlszHKvsRf05lT4pegiFM ++9z2j1OlaN+ci/X7NU22TNN6crYSiN77FjYJP464j876ndSxyD+rzys386T+1r1aZ ++aggEdkj1TsSsv1zWIYKlPIjlvhuxAgMBAAECgYA0aH+T2Vf3WOPv8KdkcJg6gCRe ++yJKXOWgWRcicx/CUzOEsTxmFIDPLxqAWA3k7v0B+3vjGw5Y9lycV/5XqXNoQI14j ++y09iNsumds13u5AKkGdTJnZhQ7UKdoVHfuP44ZdOv/rJ5/VD6F4zWywpe90pcbK+ ++AWDVtusgGQBSieEl1QJBAOyVrUG5l2yoUBtd2zr/kiGm/DYyXlIthQO/A3/LngDW ++5/ydGxVsT7lAVOgCsoT+0L4efTh90PjzW8LPQrPBWVMCQQDS3h/FtYYd5lfz+FNL ++9CEe1F1w9l8P749uNUD0g317zv1tatIqVCsQWHfVHNdVvfQ+vSFw38OORO00Xqs9 ++1GJrAkBkoXXEkxCZoy4PteheO/8IWWLGGr6L7di6MzFl1lIqwT6D8L9oaV2vynFT ++DnKop0pa09Unhjyw57KMNmSE2SUJAkEArloTEzpgRmCq4IK2/NpCeGdHS5uqRlbh ++1VIa/xGps7EWQl5Mn8swQDel/YP3WGHTjfx7pgSegQfkyaRtGpZ9OQJAa9Vumj8m ++JAAtI0Bnga8hgQx7BhTQY4CadDxyiRGOGYhwUzYVCqkb2sbVRH9HnwUaJT7cWBY3 ++RnJdHOMXWem7/w== ++-----END PRIVATE KEY----- ++Certificate: ++ Data: ++ Version: 1 (0x0) ++ Serial Number: 12723342612721443281 (0xb09264b1f2da21d1) ++ Signature Algorithm: sha1WithRSAEncryption ++ Issuer: C=XY, O=Python Software Foundation CA, CN=our-ca-server ++ Validity ++ Not Before: Jan 4 19:47:07 2013 GMT ++ Not After : Nov 13 19:47:07 2022 GMT ++ Subject: C=XY, L=Castle Anthrax, O=Python Software Foundation, CN=localhost ++ Subject Public Key Info: ++ Public Key Algorithm: rsaEncryption ++ Public-Key: (1024 bit) ++ Modulus: ++ 00:c2:e0:0f:49:00:28:36:f9:70:5c:8f:8d:bc:0d: ++ 7d:1e:42:b5:ec:1d:5c:2f:a4:31:70:16:0f:c0:cb: ++ c6:24:d3:be:13:16:ee:a5:67:97:03:a6:df:a9:99: ++ 96:cc:c7:2a:fb:11:7f:4e:65:4f:8a:5e:82:21:4c: ++ f7:3d:a3:d4:e9:5a:37:e7:22:fd:7e:cd:53:6d:93: ++ 34:de:9c:ad:84:a2:37:be:c5:8d:82:4f:e3:ae:23: ++ f3:be:a7:75:2c:72:0f:ea:f3:ca:cd:fc:e9:3f:b5: ++ af:56:99:6a:08:04:76:48:f5:4e:c4:ac:bf:5c:d6: ++ 21:82:a5:3c:88:e5:be:1b:b1 ++ Exponent: 65537 (0x10001) ++ Signature Algorithm: sha1WithRSAEncryption ++ 2f:42:5f:a3:09:2c:fa:51:88:c7:37:7f:ea:0e:63:f0:a2:9a: ++ e5:5a:e2:c8:20:f0:3f:60:bc:c8:0f:b6:c6:76:ce:db:83:93: ++ f5:a3:33:67:01:8e:04:cd:00:9a:73:fd:f3:35:86:fa:d7:13: ++ e2:46:c6:9d:c0:29:53:d4:a9:90:b8:77:4b:e6:83:76:e4:92: ++ d6:9c:50:cf:43:d0:c6:01:77:61:9a:de:9b:70:f7:72:cd:59: ++ 00:31:69:d9:b4:ca:06:9c:6d:c3:c7:80:8c:68:e6:b5:a2:f8: ++ ef:1d:bb:16:9f:77:77:ef:87:62:22:9b:4d:69:a4:3a:1a:f1: ++ 21:5e:8c:32:ac:92:fd:15:6b:18:c2:7f:15:0d:98:30:ca:75: ++ 8f:1a:71:df:da:1d:b2:ef:9a:e8:2d:2e:02:fd:4a:3c:aa:96: ++ 0b:06:5d:35:b3:3d:24:87:4b:e0:b0:58:60:2f:45:ac:2e:48: ++ 8a:b0:99:10:65:27:ff:cc:b1:d8:fd:bd:26:6b:b9:0c:05:2a: ++ f4:45:63:35:51:07:ed:83:85:fe:6f:69:cb:bb:40:a8:ae:b6: ++ 3b:56:4a:2d:a4:ed:6d:11:2c:4d:ed:17:24:fd:47:bc:d3:41: ++ a2:d3:06:fe:0c:90:d8:d8:94:26:c4:ff:cc:a1:d8:42:77:eb: ++ fc:a9:94:71 ++-----BEGIN CERTIFICATE----- ++MIICpDCCAYwCCQCwkmSx8toh0TANBgkqhkiG9w0BAQUFADBNMQswCQYDVQQGEwJY ++WTEmMCQGA1UECgwdUHl0aG9uIFNvZnR3YXJlIEZvdW5kYXRpb24gQ0ExFjAUBgNV ++BAMMDW91ci1jYS1zZXJ2ZXIwHhcNMTMwMTA0MTk0NzA3WhcNMjIxMTEzMTk0NzA3 ++WjBfMQswCQYDVQQGEwJYWTEXMBUGA1UEBxMOQ2FzdGxlIEFudGhyYXgxIzAhBgNV ++BAoTGlB5dGhvbiBTb2Z0d2FyZSBGb3VuZGF0aW9uMRIwEAYDVQQDEwlsb2NhbGhv ++c3QwgZ8wDQYJKoZIhvcNAQEBBQADgY0AMIGJAoGBAMLgD0kAKDb5cFyPjbwNfR5C ++tewdXC+kMXAWD8DLxiTTvhMW7qVnlwOm36mZlszHKvsRf05lT4pegiFM9z2j1Ola ++N+ci/X7NU22TNN6crYSiN77FjYJP464j876ndSxyD+rzys386T+1r1aZaggEdkj1 ++TsSsv1zWIYKlPIjlvhuxAgMBAAEwDQYJKoZIhvcNAQEFBQADggEBAC9CX6MJLPpR ++iMc3f+oOY/CimuVa4sgg8D9gvMgPtsZ2ztuDk/WjM2cBjgTNAJpz/fM1hvrXE+JG ++xp3AKVPUqZC4d0vmg3bkktacUM9D0MYBd2Ga3ptw93LNWQAxadm0ygacbcPHgIxo ++5rWi+O8duxafd3fvh2Iim01ppDoa8SFejDKskv0VaxjCfxUNmDDKdY8acd/aHbLv ++mugtLgL9SjyqlgsGXTWzPSSHS+CwWGAvRawuSIqwmRBlJ//Msdj9vSZruQwFKvRF ++YzVRB+2Dhf5vacu7QKiutjtWSi2k7W0RLE3tFyT9R7zTQaLTBv4MkNjYlCbE/8yh ++2EJ36/yplHE= ++-----END CERTIFICATE----- +diff -r 3405dc9a6afa Lib/test/test_asyncio/pycacert.pem +--- /dev/null ++++ b/Lib/test/test_asyncio/pycacert.pem +@@ -0,0 +1,78 @@ ++Certificate: ++ Data: ++ Version: 3 (0x2) ++ Serial Number: 12723342612721443280 (0xb09264b1f2da21d0) ++ Signature Algorithm: sha1WithRSAEncryption ++ Issuer: C=XY, O=Python Software Foundation CA, CN=our-ca-server ++ Validity ++ Not Before: Jan 4 19:47:07 2013 GMT ++ Not After : Jan 2 19:47:07 2023 GMT ++ Subject: C=XY, O=Python Software Foundation CA, CN=our-ca-server ++ Subject Public Key Info: ++ Public Key Algorithm: rsaEncryption ++ Public-Key: (2048 bit) ++ Modulus: ++ 00:e7:de:e9:e3:0c:9f:00:b6:a1:fd:2b:5b:96:d2: ++ 6f:cc:e0:be:86:b9:20:5e:ec:03:7a:55:ab:ea:a4: ++ e9:f9:49:85:d2:66:d5:ed:c7:7a:ea:56:8e:2d:8f: ++ e7:42:e2:62:28:a9:9f:d6:1b:8e:eb:b5:b4:9c:9f: ++ 14:ab:df:e6:94:8b:76:1d:3e:6d:24:61:ed:0c:bf: ++ 00:8a:61:0c:df:5c:c8:36:73:16:00:cd:47:ba:6d: ++ a4:a4:74:88:83:23:0a:19:fc:09:a7:3c:4a:4b:d3: ++ e7:1d:2d:e4:ea:4c:54:21:f3:26:db:89:37:18:d4: ++ 02:bb:40:32:5f:a4:ff:2d:1c:f7:d4:bb:ec:8e:cf: ++ 5c:82:ac:e6:7c:08:6c:48:85:61:07:7f:25:e0:5c: ++ e0:bc:34:5f:e0:b9:04:47:75:c8:47:0b:8d:bc:d6: ++ c8:68:5f:33:83:62:d2:20:44:35:b1:ad:81:1a:8a: ++ cd:bc:35:b0:5c:8b:47:d6:18:e9:9c:18:97:cc:01: ++ 3c:29:cc:e8:1e:e4:e4:c1:b8:de:e7:c2:11:18:87: ++ 5a:93:34:d8:a6:25:f7:14:71:eb:e4:21:a2:d2:0f: ++ 2e:2e:d4:62:00:35:d3:d6:ef:5c:60:4b:4c:a9:14: ++ e2:dd:15:58:46:37:33:26:b7:e7:2e:5d:ed:42:e4: ++ c5:4d ++ Exponent: 65537 (0x10001) ++ X509v3 extensions: ++ X509v3 Subject Key Identifier: ++ BC:DD:62:D9:76:DA:1B:D2:54:6B:CF:E0:66:9B:1E:1E:7B:56:0C:0B ++ X509v3 Authority Key Identifier: ++ keyid:BC:DD:62:D9:76:DA:1B:D2:54:6B:CF:E0:66:9B:1E:1E:7B:56:0C:0B ++ ++ X509v3 Basic Constraints: ++ CA:TRUE ++ Signature Algorithm: sha1WithRSAEncryption ++ 7d:0a:f5:cb:8d:d3:5d:bd:99:8e:f8:2b:0f:ba:eb:c2:d9:a6: ++ 27:4f:2e:7b:2f:0e:64:d8:1c:35:50:4e:ee:fc:90:b9:8d:6d: ++ a8:c5:c6:06:b0:af:f3:2d:bf:3b:b8:42:07:dd:18:7d:6d:95: ++ 54:57:85:18:60:47:2f:eb:78:1b:f9:e8:17:fd:5a:0d:87:17: ++ 28:ac:4c:6a:e6:bc:29:f4:f4:55:70:29:42:de:85:ea:ab:6c: ++ 23:06:64:30:75:02:8e:53:bc:5e:01:33:37:cc:1e:cd:b8:a4: ++ fd:ca:e4:5f:65:3b:83:1c:86:f1:55:02:a0:3a:8f:db:91:b7: ++ 40:14:b4:e7:8d:d2:ee:73:ba:e3:e5:34:2d:bc:94:6f:4e:24: ++ 06:f7:5f:8b:0e:a7:8e:6b:de:5e:75:f4:32:9a:50:b1:44:33: ++ 9a:d0:05:e2:78:82:ff:db:da:8a:63:eb:a9:dd:d1:bf:a0:61: ++ ad:e3:9e:8a:24:5d:62:0e:e7:4c:91:7f:ef:df:34:36:3b:2f: ++ 5d:f5:84:b2:2f:c4:6d:93:96:1a:6f:30:28:f1:da:12:9a:64: ++ b4:40:33:1d:bd:de:2b:53:a8:ea:be:d6:bc:4e:96:f5:44:fb: ++ 32:18:ae:d5:1f:f6:69:af:b6:4e:7b:1d:58:ec:3b:a9:53:a3: ++ 5e:58:c8:9e ++-----BEGIN CERTIFICATE----- ++MIIDbTCCAlWgAwIBAgIJALCSZLHy2iHQMA0GCSqGSIb3DQEBBQUAME0xCzAJBgNV ++BAYTAlhZMSYwJAYDVQQKDB1QeXRob24gU29mdHdhcmUgRm91bmRhdGlvbiBDQTEW ++MBQGA1UEAwwNb3VyLWNhLXNlcnZlcjAeFw0xMzAxMDQxOTQ3MDdaFw0yMzAxMDIx ++OTQ3MDdaME0xCzAJBgNVBAYTAlhZMSYwJAYDVQQKDB1QeXRob24gU29mdHdhcmUg ++Rm91bmRhdGlvbiBDQTEWMBQGA1UEAwwNb3VyLWNhLXNlcnZlcjCCASIwDQYJKoZI ++hvcNAQEBBQADggEPADCCAQoCggEBAOfe6eMMnwC2of0rW5bSb8zgvoa5IF7sA3pV ++q+qk6flJhdJm1e3HeupWji2P50LiYiipn9Ybjuu1tJyfFKvf5pSLdh0+bSRh7Qy/ ++AIphDN9cyDZzFgDNR7ptpKR0iIMjChn8Cac8SkvT5x0t5OpMVCHzJtuJNxjUArtA ++Ml+k/y0c99S77I7PXIKs5nwIbEiFYQd/JeBc4Lw0X+C5BEd1yEcLjbzWyGhfM4Ni ++0iBENbGtgRqKzbw1sFyLR9YY6ZwYl8wBPCnM6B7k5MG43ufCERiHWpM02KYl9xRx ++6+QhotIPLi7UYgA109bvXGBLTKkU4t0VWEY3Mya35y5d7ULkxU0CAwEAAaNQME4w ++HQYDVR0OBBYEFLzdYtl22hvSVGvP4GabHh57VgwLMB8GA1UdIwQYMBaAFLzdYtl2 ++2hvSVGvP4GabHh57VgwLMAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADggEB ++AH0K9cuN0129mY74Kw+668LZpidPLnsvDmTYHDVQTu78kLmNbajFxgawr/Mtvzu4 ++QgfdGH1tlVRXhRhgRy/reBv56Bf9Wg2HFyisTGrmvCn09FVwKULeheqrbCMGZDB1 ++Ao5TvF4BMzfMHs24pP3K5F9lO4MchvFVAqA6j9uRt0AUtOeN0u5zuuPlNC28lG9O ++JAb3X4sOp45r3l519DKaULFEM5rQBeJ4gv/b2opj66nd0b+gYa3jnookXWIO50yR ++f+/fNDY7L131hLIvxG2TlhpvMCjx2hKaZLRAMx293itTqOq+1rxOlvVE+zIYrtUf ++9mmvtk57HVjsO6lTo15YyJ4= ++-----END CERTIFICATE----- +diff -r 3405dc9a6afa Lib/test/test_asyncio/sample.crt +--- a/Lib/test/test_asyncio/sample.crt ++++ /dev/null +@@ -1,14 +0,0 @@ +------BEGIN CERTIFICATE----- +-MIICMzCCAZwCCQDFl4ys0fU7iTANBgkqhkiG9w0BAQUFADBeMQswCQYDVQQGEwJV +-UzETMBEGA1UECAwKQ2FsaWZvcm5pYTEWMBQGA1UEBwwNU2FuLUZyYW5jaXNjbzEi +-MCAGA1UECgwZUHl0aG9uIFNvZnR3YXJlIEZvbmRhdGlvbjAeFw0xMzAzMTgyMDA3 +-MjhaFw0yMzAzMTYyMDA3MjhaMF4xCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApDYWxp +-Zm9ybmlhMRYwFAYDVQQHDA1TYW4tRnJhbmNpc2NvMSIwIAYDVQQKDBlQeXRob24g +-U29mdHdhcmUgRm9uZGF0aW9uMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCn +-t3s+J7L0xP/YdAQOacpPi9phlrzKZhcXL3XMu2LCUg2fNJpx/47Vc5TZSaO11uO7 +-gdwVz3Z7Q2epAgwo59JLffLt5fia8+a/SlPweI/j4+wcIIIiqusnLfpqR8cIAavg +-Z06cLYCDvb9wMlheIvSJY12skc1nnphWS2YJ0Xm6uQIDAQABMA0GCSqGSIb3DQEB +-BQUAA4GBAE9PknG6pv72+5z/gsDGYy8sK5UNkbWSNr4i4e5lxVsF03+/M71H+3AB +-MxVX4+A+Vlk2fmU+BrdHIIUE0r1dDcO3josQ9hc9OJpp5VLSQFP8VeuJCmzYPp9I +-I8WbW93cnXnChTrYQVdgVoFdv7GE9YgU7NYkrGIM0nZl1/f/bHPB +------END CERTIFICATE----- +diff -r 3405dc9a6afa Lib/test/test_asyncio/sample.key +--- a/Lib/test/test_asyncio/sample.key ++++ /dev/null +@@ -1,15 +0,0 @@ +------BEGIN RSA PRIVATE KEY----- +-MIICXQIBAAKBgQCnt3s+J7L0xP/YdAQOacpPi9phlrzKZhcXL3XMu2LCUg2fNJpx +-/47Vc5TZSaO11uO7gdwVz3Z7Q2epAgwo59JLffLt5fia8+a/SlPweI/j4+wcIIIi +-qusnLfpqR8cIAavgZ06cLYCDvb9wMlheIvSJY12skc1nnphWS2YJ0Xm6uQIDAQAB +-AoGABfm8k19Yue3W68BecKEGS0VBV57GRTPT+MiBGvVGNIQ15gk6w3sGfMZsdD1y +-bsUkQgcDb2d/4i5poBTpl/+Cd41V+c20IC/sSl5X1IEreHMKSLhy/uyjyiyfXlP1 +-iXhToFCgLWwENWc8LzfUV8vuAV5WG6oL9bnudWzZxeqx8V0CQQDR7xwVj6LN70Eb +-DUhSKLkusmFw5Gk9NJ/7wZ4eHg4B8c9KNVvSlLCLhcsVTQXuqYeFpOqytI45SneP +-lr0vrvsDAkEAzITYiXu6ox5huDCG7imX2W9CAYuX638urLxBqBXMS7GqBzojD6RL +-21Q8oPwJWJquERa3HDScq1deiQbM9uKIkwJBAIa1PLslGN216Xv3UPHPScyKD/aF +-ynXIv+OnANPoiyp6RH4ksQ/18zcEGiVH8EeNpvV9tlAHhb+DZibQHgNr74sCQQC0 +-zhToplu/bVKSlUQUNO0rqrI9z30FErDewKeCw5KSsIRSU1E/uM3fHr9iyq4wiL6u +-GNjUtKZ0y46lsT9uW6LFAkB5eqeEQnshAdr3X5GykWHJ8DDGBXPPn6Rce1NX4RSq +-V9khG2z1bFyfo+hMqpYnF2k32hVq3E54RS8YYnwBsVof +------END RSA PRIVATE KEY----- +diff -r 3405dc9a6afa Lib/test/test_asyncio/ssl_cert.pem +--- /dev/null ++++ b/Lib/test/test_asyncio/ssl_cert.pem +@@ -0,0 +1,15 @@ ++-----BEGIN CERTIFICATE----- ++MIICVDCCAb2gAwIBAgIJANfHOBkZr8JOMA0GCSqGSIb3DQEBBQUAMF8xCzAJBgNV ++BAYTAlhZMRcwFQYDVQQHEw5DYXN0bGUgQW50aHJheDEjMCEGA1UEChMaUHl0aG9u ++IFNvZnR3YXJlIEZvdW5kYXRpb24xEjAQBgNVBAMTCWxvY2FsaG9zdDAeFw0xMDEw ++MDgyMzAxNTZaFw0yMDEwMDUyMzAxNTZaMF8xCzAJBgNVBAYTAlhZMRcwFQYDVQQH ++Ew5DYXN0bGUgQW50aHJheDEjMCEGA1UEChMaUHl0aG9uIFNvZnR3YXJlIEZvdW5k ++YXRpb24xEjAQBgNVBAMTCWxvY2FsaG9zdDCBnzANBgkqhkiG9w0BAQEFAAOBjQAw ++gYkCgYEA21vT5isq7F68amYuuNpSFlKDPrMUCa4YWYqZRt2OZ+/3NKaZ2xAiSwr7 ++6MrQF70t5nLbSPpqE5+5VrS58SY+g/sXLiFd6AplH1wJZwh78DofbFYXUggktFMt ++pTyiX8jtP66bkcPkDADA089RI1TQR6Ca+n7HFa7c1fabVV6i3zkCAwEAAaMYMBYw ++FAYDVR0RBA0wC4IJbG9jYWxob3N0MA0GCSqGSIb3DQEBBQUAA4GBAHPctQBEQ4wd ++BJ6+JcpIraopLn8BGhbjNWj40mmRqWB/NAWF6M5ne7KpGAu7tLeG4hb1zLaldK8G ++lxy2GPSRF6LFS48dpEj2HbMv2nvv6xxalDMJ9+DicWgAKTQ6bcX2j3GUkCR0g/T1 ++CRlNBAAlvhKzO7Clpf9l0YKBEfraJByX ++-----END CERTIFICATE----- +diff -r 3405dc9a6afa Lib/test/test_asyncio/ssl_key.pem +--- /dev/null ++++ b/Lib/test/test_asyncio/ssl_key.pem +@@ -0,0 +1,16 @@ ++-----BEGIN PRIVATE KEY----- ++MIICdwIBADANBgkqhkiG9w0BAQEFAASCAmEwggJdAgEAAoGBANtb0+YrKuxevGpm ++LrjaUhZSgz6zFAmuGFmKmUbdjmfv9zSmmdsQIksK++jK0Be9LeZy20j6ahOfuVa0 ++ufEmPoP7Fy4hXegKZR9cCWcIe/A6H2xWF1IIJLRTLaU8ol/I7T+um5HD5AwAwNPP ++USNU0Eegmvp+xxWu3NX2m1Veot85AgMBAAECgYA3ZdZ673X0oexFlq7AAmrutkHt ++CL7LvwrpOiaBjhyTxTeSNWzvtQBkIU8DOI0bIazA4UreAFffwtvEuPmonDb3F+Iq ++SMAu42XcGyVZEl+gHlTPU9XRX7nTOXVt+MlRRRxL6t9GkGfUAXI3XxJDXW3c0vBK ++UL9xqD8cORXOfE06rQJBAP8mEX1ERkR64Ptsoe4281vjTlNfIbs7NMPkUnrn9N/Y ++BLhjNIfQ3HFZG8BTMLfX7kCS9D593DW5tV4Z9BP/c6cCQQDcFzCcVArNh2JSywOQ ++ZfTfRbJg/Z5Lt9Fkngv1meeGNPgIMLN8Sg679pAOOWmzdMO3V706rNPzSVMME7E5 ++oPIfAkEA8pDddarP5tCvTTgUpmTFbakm0KoTZm2+FzHcnA4jRh+XNTjTOv98Y6Ik ++eO5d1ZnKXseWvkZncQgxfdnMqqpj5wJAcNq/RVne1DbYlwWchT2Si65MYmmJ8t+F ++0mcsULqjOnEMwf5e+ptq5LzwbyrHZYq5FNk7ocufPv/ZQrcSSC+cFwJBAKvOJByS ++x56qyGeZLOQlWS2JS3KJo59XuLFGqcbgN9Om9xFa41Yb4N9NvplFivsvZdw3m1Q/ ++SPIXQuT8RMPDVNQ= ++-----END PRIVATE KEY----- +diff -r 3405dc9a6afa Lib/test/test_asyncio/test_events.py +--- a/Lib/test/test_asyncio/test_events.py ++++ b/Lib/test/test_asyncio/test_events.py +@@ -10,6 +10,9 @@ + import ssl + except ImportError: + ssl = None ++ HAS_SNI = False ++else: ++ from ssl import HAS_SNI + import subprocess + import sys + import threading +@@ -17,7 +20,7 @@ + import errno + import unittest + import unittest.mock +-from test.support import find_unused_port, IPV6_ENABLED ++from test import support # find_unused_port, IPV6_ENABLED, TEST_HOME_DIR + + + from asyncio import futures +@@ -30,10 +33,27 @@ + from asyncio import locks + + ++def data_file(filename): ++ if hasattr(support, 'TEST_HOME_DIR'): ++ fullname = os.path.join(support.TEST_HOME_DIR, filename) ++ if os.path.isfile(fullname): ++ return fullname ++ fullname = os.path.join(os.path.dirname(__file__), filename) ++ if os.path.isfile(fullname): ++ return fullname ++ raise FileNotFoundError(filename) ++ ++ONLYCERT = data_file('ssl_cert.pem') ++ONLYKEY = data_file('ssl_key.pem') ++SIGNED_CERTFILE = data_file('keycert3.pem') ++SIGNING_CA = data_file('pycacert.pem') ++ ++ + class MyProto(protocols.Protocol): + done = None + + def __init__(self, loop=None): ++ self.transport = None + self.state = 'INITIAL' + self.nbytes = 0 + if loop is not None: +@@ -523,7 +543,7 @@ + + def test_create_connection_local_addr(self): + with test_utils.run_test_server() as httpd: +- port = find_unused_port() ++ port = support.find_unused_port() + f = self.loop.create_connection( + lambda: MyProto(loop=self.loop), + *httpd.address, local_addr=(httpd.address[0], port)) +@@ -560,6 +580,7 @@ + client.connect(('127.0.0.1', port)) + client.sendall(b'xxx') + test_utils.run_briefly(self.loop) ++ test_utils.run_until(self.loop, lambda: proto is not None, 10) + self.assertIsInstance(proto, MyProto) + self.assertEqual('INITIAL', proto.state) + test_utils.run_briefly(self.loop) +@@ -586,6 +607,20 @@ + # close server + server.close() + ++ def _make_ssl_server(self, factory, certfile, keyfile=None): ++ sslcontext = ssl.SSLContext(ssl.PROTOCOL_SSLv23) ++ sslcontext.options |= ssl.OP_NO_SSLv2 ++ sslcontext.load_cert_chain(certfile, keyfile) ++ ++ f = self.loop.create_server( ++ factory, '127.0.0.1', 0, ssl=sslcontext) ++ ++ server = self.loop.run_until_complete(f) ++ sock = server.sockets[0] ++ host, port = sock.getsockname() ++ self.assertEqual(host, '127.0.0.1') ++ return server, host, port ++ + @unittest.skipIf(ssl is None, 'No ssl module') + def test_create_server_ssl(self): + proto = None +@@ -601,19 +636,7 @@ + proto = MyProto(loop=self.loop) + return proto + +- here = os.path.dirname(__file__) +- sslcontext = ssl.SSLContext(ssl.PROTOCOL_SSLv23) +- sslcontext.load_cert_chain( +- certfile=os.path.join(here, 'sample.crt'), +- keyfile=os.path.join(here, 'sample.key')) +- +- f = self.loop.create_server( +- factory, '127.0.0.1', 0, ssl=sslcontext) +- +- server = self.loop.run_until_complete(f) +- sock = server.sockets[0] +- host, port = sock.getsockname() +- self.assertEqual(host, '127.0.0.1') ++ server, host, port = self._make_ssl_server(factory, ONLYCERT, ONLYKEY) + + f_c = self.loop.create_connection(ClientMyProto, host, port, + ssl=test_utils.dummy_ssl_context()) +@@ -645,6 +668,97 @@ + # stop serving + server.close() + ++ @unittest.skipIf(ssl is None, 'No ssl module') ++ @unittest.skipUnless(HAS_SNI, 'No SNI support in ssl module') ++ def test_create_server_ssl_verify_failed(self): ++ proto = None ++ ++ def factory(): ++ nonlocal proto ++ proto = MyProto(loop=self.loop) ++ return proto ++ ++ server, host, port = self._make_ssl_server(factory, SIGNED_CERTFILE) ++ ++ sslcontext_client = ssl.SSLContext(ssl.PROTOCOL_SSLv23) ++ sslcontext_client.options |= ssl.OP_NO_SSLv2 ++ sslcontext_client.verify_mode = ssl.CERT_REQUIRED ++ if hasattr(sslcontext_client, 'check_hostname'): ++ sslcontext_client.check_hostname = True ++ ++ # no CA loaded ++ f_c = self.loop.create_connection(MyProto, host, port, ++ ssl=sslcontext_client) ++ with self.assertRaisesRegex(ssl.SSLError, ++ 'certificate verify failed '): ++ self.loop.run_until_complete(f_c) ++ ++ # close connection ++ self.assertIsNone(proto.transport) ++ server.close() ++ ++ @unittest.skipIf(ssl is None, 'No ssl module') ++ @unittest.skipUnless(HAS_SNI, 'No SNI support in ssl module') ++ def test_create_server_ssl_match_failed(self): ++ proto = None ++ ++ def factory(): ++ nonlocal proto ++ proto = MyProto(loop=self.loop) ++ return proto ++ ++ server, host, port = self._make_ssl_server(factory, SIGNED_CERTFILE) ++ ++ sslcontext_client = ssl.SSLContext(ssl.PROTOCOL_SSLv23) ++ sslcontext_client.options |= ssl.OP_NO_SSLv2 ++ sslcontext_client.verify_mode = ssl.CERT_REQUIRED ++ sslcontext_client.load_verify_locations( ++ cafile=SIGNING_CA) ++ if hasattr(sslcontext_client, 'check_hostname'): ++ sslcontext_client.check_hostname = True ++ ++ # incorrect server_hostname ++ f_c = self.loop.create_connection(MyProto, host, port, ++ ssl=sslcontext_client) ++ with self.assertRaisesRegex( ++ ssl.CertificateError, ++ "hostname '127.0.0.1' doesn't match 'localhost'"): ++ self.loop.run_until_complete(f_c) ++ ++ # close connection ++ proto.transport.close() ++ server.close() ++ ++ @unittest.skipIf(ssl is None, 'No ssl module') ++ @unittest.skipUnless(HAS_SNI, 'No SNI support in ssl module') ++ def test_create_server_ssl_verified(self): ++ proto = None ++ ++ def factory(): ++ nonlocal proto ++ proto = MyProto(loop=self.loop) ++ return proto ++ ++ server, host, port = self._make_ssl_server(factory, SIGNED_CERTFILE) ++ ++ sslcontext_client = ssl.SSLContext(ssl.PROTOCOL_SSLv23) ++ sslcontext_client.options |= ssl.OP_NO_SSLv2 ++ sslcontext_client.verify_mode = ssl.CERT_REQUIRED ++ sslcontext_client.load_verify_locations(cafile=SIGNING_CA) ++ if hasattr(sslcontext_client, 'check_hostname'): ++ sslcontext_client.check_hostname = True ++ ++ # Connection succeeds with correct CA and server hostname. ++ f_c = self.loop.create_connection(MyProto, host, port, ++ ssl=sslcontext_client, ++ server_hostname='localhost') ++ client, pr = self.loop.run_until_complete(f_c) ++ ++ # close connection ++ proto.transport.close() ++ client.close() ++ server.close() ++ + def test_create_server_sock(self): + proto = futures.Future(loop=self.loop) + +@@ -687,7 +801,7 @@ + + server.close() + +- @unittest.skipUnless(IPV6_ENABLED, 'IPv6 not supported or enabled') ++ @unittest.skipUnless(support.IPV6_ENABLED, 'IPv6 not supported or enabled') + def test_create_server_dual_stack(self): + f_proto = futures.Future(loop=self.loop) + +@@ -699,7 +813,7 @@ + try_count = 0 + while True: + try: +- port = find_unused_port() ++ port = support.find_unused_port() + f = self.loop.create_server(TestMyProto, host=None, port=port) + server = self.loop.run_until_complete(f) + except OSError as ex: +@@ -792,7 +906,7 @@ + def test_internal_fds(self): + loop = self.create_event_loop() + if not isinstance(loop, selector_events.BaseSelectorEventLoop): +- return ++ self.skipTest('loop is not a BaseSelectorEventLoop') + + self.assertEqual(1, loop._internal_fds) + loop.close() +@@ -1286,10 +1400,19 @@ + return windows_events.ProactorEventLoop() + + def test_create_ssl_connection(self): +- raise unittest.SkipTest("IocpEventLoop imcompatible with SSL") ++ raise unittest.SkipTest("IocpEventLoop incompatible with SSL") + + def test_create_server_ssl(self): +- raise unittest.SkipTest("IocpEventLoop imcompatible with SSL") ++ raise unittest.SkipTest("IocpEventLoop incompatible with SSL") ++ ++ def test_create_server_ssl_verify_failed(self): ++ raise unittest.SkipTest("IocpEventLoop incompatible with SSL") ++ ++ def test_create_server_ssl_match_failed(self): ++ raise unittest.SkipTest("IocpEventLoop incompatible with SSL") ++ ++ def test_create_server_ssl_verified(self): ++ raise unittest.SkipTest("IocpEventLoop incompatible with SSL") + + def test_reader_callback(self): + raise unittest.SkipTest("IocpEventLoop does not have add_reader()") +@@ -1598,6 +1721,22 @@ + self.assertIs(loop, policy.get_event_loop()) + loop.close() + ++ def test_get_event_loop_calls_set_event_loop(self): ++ policy = self.create_policy() ++ ++ with unittest.mock.patch.object( ++ policy, "set_event_loop", ++ wraps=policy.set_event_loop) as m_set_event_loop: ++ ++ loop = policy.get_event_loop() ++ ++ # policy._local._loop must be set through .set_event_loop() ++ # (the unix DefaultEventLoopPolicy needs this call to attach ++ # the child watcher correctly) ++ m_set_event_loop.assert_called_with(loop) ++ ++ loop.close() ++ + def test_get_event_loop_after_set_none(self): + policy = self.create_policy() + policy.set_event_loop(None) +diff -r 3405dc9a6afa Lib/test/test_asyncio/test_proactor_events.py +--- a/Lib/test/test_asyncio/test_proactor_events.py ++++ b/Lib/test/test_asyncio/test_proactor_events.py +@@ -111,8 +111,8 @@ + tr = _ProactorSocketTransport(self.loop, self.sock, self.protocol) + tr._loop_writing = unittest.mock.Mock() + tr.write(b'data') +- self.assertEqual(tr._buffer, [b'data']) +- self.assertTrue(tr._loop_writing.called) ++ self.assertEqual(tr._buffer, None) ++ tr._loop_writing.assert_called_with(data=b'data') + + def test_write_no_data(self): + tr = _ProactorSocketTransport(self.loop, self.sock, self.protocol) +@@ -124,12 +124,12 @@ + tr._write_fut = unittest.mock.Mock() + tr._loop_writing = unittest.mock.Mock() + tr.write(b'data') +- self.assertEqual(tr._buffer, [b'data']) ++ self.assertEqual(tr._buffer, b'data') + self.assertFalse(tr._loop_writing.called) + + def test_loop_writing(self): + tr = _ProactorSocketTransport(self.loop, self.sock, self.protocol) +- tr._buffer = [b'da', b'ta'] ++ tr._buffer = bytearray(b'data') + tr._loop_writing() + self.loop._proactor.send.assert_called_with(self.sock, b'data') + self.loop._proactor.send.return_value.add_done_callback.\ +@@ -150,7 +150,7 @@ + tr.write(b'data') + tr.write(b'data') + tr.write(b'data') +- self.assertEqual(tr._buffer, []) ++ self.assertEqual(tr._buffer, None) + m_log.warning.assert_called_with('socket.send() raised exception.') + + def test_loop_writing_stop(self): +@@ -226,7 +226,7 @@ + write_fut.cancel.assert_called_with() + test_utils.run_briefly(self.loop) + self.protocol.connection_lost.assert_called_with(None) +- self.assertEqual([], tr._buffer) ++ self.assertEqual(None, tr._buffer) + self.assertEqual(tr._conn_lost, 1) + + def test_force_close_idempotent(self): +@@ -243,7 +243,7 @@ + + test_utils.run_briefly(self.loop) + self.protocol.connection_lost.assert_called_with(None) +- self.assertEqual([], tr._buffer) ++ self.assertEqual(None, tr._buffer) + + def test_call_connection_lost(self): + tr = _ProactorSocketTransport(self.loop, self.sock, self.protocol) +diff -r 3405dc9a6afa Lib/test/test_asyncio/test_selector_events.py +--- a/Lib/test/test_asyncio/test_selector_events.py ++++ b/Lib/test/test_asyncio/test_selector_events.py +@@ -32,6 +32,10 @@ + self._internal_fds += 1 + + ++def list_to_buffer(l=()): ++ return bytearray().join(l) ++ ++ + class BaseSelectorEventLoopTests(unittest.TestCase): + + def setUp(self): +@@ -613,7 +617,7 @@ + + def test_close_write_buffer(self): + tr = _SelectorTransport(self.loop, self.sock, self.protocol, None) +- tr._buffer.append(b'data') ++ tr._buffer.extend(b'data') + tr.close() + + self.assertFalse(self.loop.readers) +@@ -622,13 +626,13 @@ + + def test_force_close(self): + tr = _SelectorTransport(self.loop, self.sock, self.protocol, None) +- tr._buffer.append(b'1') ++ tr._buffer.extend(b'1') + self.loop.add_reader(7, unittest.mock.sentinel) + self.loop.add_writer(7, unittest.mock.sentinel) + tr._force_close(None) + + self.assertTrue(tr._closing) +- self.assertEqual(tr._buffer, collections.deque()) ++ self.assertEqual(tr._buffer, list_to_buffer()) + self.assertFalse(self.loop.readers) + self.assertFalse(self.loop.writers) + +@@ -783,21 +787,40 @@ + transport.write(data) + self.sock.send.assert_called_with(data) + ++ def test_write_bytearray(self): ++ data = bytearray(b'data') ++ self.sock.send.return_value = len(data) ++ ++ transport = _SelectorSocketTransport( ++ self.loop, self.sock, self.protocol) ++ transport.write(data) ++ self.sock.send.assert_called_with(data) ++ self.assertEqual(data, bytearray(b'data')) # Hasn't been mutated. ++ ++ def test_write_memoryview(self): ++ data = memoryview(b'data') ++ self.sock.send.return_value = len(data) ++ ++ transport = _SelectorSocketTransport( ++ self.loop, self.sock, self.protocol) ++ transport.write(data) ++ self.sock.send.assert_called_with(data) ++ + def test_write_no_data(self): + transport = _SelectorSocketTransport( + self.loop, self.sock, self.protocol) +- transport._buffer.append(b'data') ++ transport._buffer.extend(b'data') + transport.write(b'') + self.assertFalse(self.sock.send.called) +- self.assertEqual(collections.deque([b'data']), transport._buffer) ++ self.assertEqual(list_to_buffer([b'data']), transport._buffer) + + def test_write_buffer(self): + transport = _SelectorSocketTransport( + self.loop, self.sock, self.protocol) +- transport._buffer.append(b'data1') ++ transport._buffer.extend(b'data1') + transport.write(b'data2') + self.assertFalse(self.sock.send.called) +- self.assertEqual(collections.deque([b'data1', b'data2']), ++ self.assertEqual(list_to_buffer([b'data1', b'data2']), + transport._buffer) + + def test_write_partial(self): +@@ -809,7 +832,30 @@ + transport.write(data) + + self.loop.assert_writer(7, transport._write_ready) +- self.assertEqual(collections.deque([b'ta']), transport._buffer) ++ self.assertEqual(list_to_buffer([b'ta']), transport._buffer) ++ ++ def test_write_partial_bytearray(self): ++ data = bytearray(b'data') ++ self.sock.send.return_value = 2 ++ ++ transport = _SelectorSocketTransport( ++ self.loop, self.sock, self.protocol) ++ transport.write(data) ++ ++ self.loop.assert_writer(7, transport._write_ready) ++ self.assertEqual(list_to_buffer([b'ta']), transport._buffer) ++ self.assertEqual(data, bytearray(b'data')) # Hasn't been mutated. ++ ++ def test_write_partial_memoryview(self): ++ data = memoryview(b'data') ++ self.sock.send.return_value = 2 ++ ++ transport = _SelectorSocketTransport( ++ self.loop, self.sock, self.protocol) ++ transport.write(data) ++ ++ self.loop.assert_writer(7, transport._write_ready) ++ self.assertEqual(list_to_buffer([b'ta']), transport._buffer) + + def test_write_partial_none(self): + data = b'data' +@@ -821,7 +867,7 @@ + transport.write(data) + + self.loop.assert_writer(7, transport._write_ready) +- self.assertEqual(collections.deque([b'data']), transport._buffer) ++ self.assertEqual(list_to_buffer([b'data']), transport._buffer) + + def test_write_tryagain(self): + self.sock.send.side_effect = BlockingIOError +@@ -832,7 +878,7 @@ + transport.write(data) + + self.loop.assert_writer(7, transport._write_ready) +- self.assertEqual(collections.deque([b'data']), transport._buffer) ++ self.assertEqual(list_to_buffer([b'data']), transport._buffer) + + @unittest.mock.patch('asyncio.selector_events.logger') + def test_write_exception(self, m_log): +@@ -859,7 +905,7 @@ + def test_write_str(self): + transport = _SelectorSocketTransport( + self.loop, self.sock, self.protocol) +- self.assertRaises(AssertionError, transport.write, 'str') ++ self.assertRaises(TypeError, transport.write, 'str') + + def test_write_closing(self): + transport = _SelectorSocketTransport( +@@ -875,11 +921,10 @@ + + transport = _SelectorSocketTransport( + self.loop, self.sock, self.protocol) +- transport._buffer.append(data) ++ transport._buffer.extend(data) + self.loop.add_writer(7, transport._write_ready) + transport._write_ready() + self.assertTrue(self.sock.send.called) +- self.assertEqual(self.sock.send.call_args[0], (data,)) + self.assertFalse(self.loop.writers) + + def test_write_ready_closing(self): +@@ -889,10 +934,10 @@ + transport = _SelectorSocketTransport( + self.loop, self.sock, self.protocol) + transport._closing = True +- transport._buffer.append(data) ++ transport._buffer.extend(data) + self.loop.add_writer(7, transport._write_ready) + transport._write_ready() +- self.sock.send.assert_called_with(data) ++ self.assertTrue(self.sock.send.called) + self.assertFalse(self.loop.writers) + self.sock.close.assert_called_with() + self.protocol.connection_lost.assert_called_with(None) +@@ -900,6 +945,7 @@ + def test_write_ready_no_data(self): + transport = _SelectorSocketTransport( + self.loop, self.sock, self.protocol) ++ # This is an internal error. + self.assertRaises(AssertionError, transport._write_ready) + + def test_write_ready_partial(self): +@@ -908,11 +954,11 @@ + + transport = _SelectorSocketTransport( + self.loop, self.sock, self.protocol) +- transport._buffer.append(data) ++ transport._buffer.extend(data) + self.loop.add_writer(7, transport._write_ready) + transport._write_ready() + self.loop.assert_writer(7, transport._write_ready) +- self.assertEqual(collections.deque([b'ta']), transport._buffer) ++ self.assertEqual(list_to_buffer([b'ta']), transport._buffer) + + def test_write_ready_partial_none(self): + data = b'data' +@@ -920,23 +966,23 @@ + + transport = _SelectorSocketTransport( + self.loop, self.sock, self.protocol) +- transport._buffer.append(data) ++ transport._buffer.extend(data) + self.loop.add_writer(7, transport._write_ready) + transport._write_ready() + self.loop.assert_writer(7, transport._write_ready) +- self.assertEqual(collections.deque([b'data']), transport._buffer) ++ self.assertEqual(list_to_buffer([b'data']), transport._buffer) + + def test_write_ready_tryagain(self): + self.sock.send.side_effect = BlockingIOError + + transport = _SelectorSocketTransport( + self.loop, self.sock, self.protocol) +- transport._buffer = collections.deque([b'data1', b'data2']) ++ transport._buffer = list_to_buffer([b'data1', b'data2']) + self.loop.add_writer(7, transport._write_ready) + transport._write_ready() + + self.loop.assert_writer(7, transport._write_ready) +- self.assertEqual(collections.deque([b'data1data2']), transport._buffer) ++ self.assertEqual(list_to_buffer([b'data1data2']), transport._buffer) + + def test_write_ready_exception(self): + err = self.sock.send.side_effect = OSError() +@@ -944,7 +990,7 @@ + transport = _SelectorSocketTransport( + self.loop, self.sock, self.protocol) + transport._fatal_error = unittest.mock.Mock() +- transport._buffer.append(b'data') ++ transport._buffer.extend(b'data') + transport._write_ready() + transport._fatal_error.assert_called_with(err) + +@@ -956,7 +1002,7 @@ + transport = _SelectorSocketTransport( + self.loop, self.sock, self.protocol) + transport.close() +- transport._buffer.append(b'data') ++ transport._buffer.extend(b'data') + transport._write_ready() + remove_writer.assert_called_with(self.sock_fd) + +@@ -976,12 +1022,12 @@ + self.sock.send.side_effect = BlockingIOError + tr.write(b'data') + tr.write_eof() +- self.assertEqual(tr._buffer, collections.deque([b'data'])) ++ self.assertEqual(tr._buffer, list_to_buffer([b'data'])) + self.assertTrue(tr._eof) + self.assertFalse(self.sock.shutdown.called) + self.sock.send.side_effect = lambda _: 4 + tr._write_ready() +- self.sock.send.assert_called_with(b'data') ++ self.assertTrue(self.sock.send.called) + self.sock.shutdown.assert_called_with(socket.SHUT_WR) + tr.close() + +@@ -1065,15 +1111,34 @@ + self.assertFalse(tr._paused) + self.loop.assert_reader(1, tr._read_ready) + ++ def test_write(self): ++ transport = self._make_one() ++ transport.write(b'data') ++ self.assertEqual(list_to_buffer([b'data']), transport._buffer) ++ ++ def test_write_bytearray(self): ++ transport = self._make_one() ++ data = bytearray(b'data') ++ transport.write(data) ++ self.assertEqual(list_to_buffer([b'data']), transport._buffer) ++ self.assertEqual(data, bytearray(b'data')) # Hasn't been mutated. ++ self.assertIsNot(data, transport._buffer) # Hasn't been incorporated. ++ ++ def test_write_memoryview(self): ++ transport = self._make_one() ++ data = memoryview(b'data') ++ transport.write(data) ++ self.assertEqual(list_to_buffer([b'data']), transport._buffer) ++ + def test_write_no_data(self): + transport = self._make_one() +- transport._buffer.append(b'data') ++ transport._buffer.extend(b'data') + transport.write(b'') +- self.assertEqual(collections.deque([b'data']), transport._buffer) ++ self.assertEqual(list_to_buffer([b'data']), transport._buffer) + + def test_write_str(self): + transport = self._make_one() +- self.assertRaises(AssertionError, transport.write, 'str') ++ self.assertRaises(TypeError, transport.write, 'str') + + def test_write_closing(self): + transport = self._make_one() +@@ -1087,7 +1152,7 @@ + transport = self._make_one() + transport._conn_lost = 1 + transport.write(b'data') +- self.assertEqual(transport._buffer, collections.deque()) ++ self.assertEqual(transport._buffer, list_to_buffer()) + transport.write(b'data') + transport.write(b'data') + transport.write(b'data') +@@ -1107,7 +1172,7 @@ + transport = self._make_one() + transport._write_wants_read = True + transport._write_ready = unittest.mock.Mock() +- transport._buffer.append(b'data') ++ transport._buffer.extend(b'data') + transport._read_ready() + + self.assertFalse(transport._write_wants_read) +@@ -1168,31 +1233,31 @@ + def test_write_ready_send(self): + self.sslsock.send.return_value = 4 + transport = self._make_one() +- transport._buffer = collections.deque([b'data']) ++ transport._buffer = list_to_buffer([b'data']) + transport._write_ready() +- self.assertEqual(collections.deque(), transport._buffer) ++ self.assertEqual(list_to_buffer(), transport._buffer) + self.assertTrue(self.sslsock.send.called) + + def test_write_ready_send_none(self): + self.sslsock.send.return_value = 0 + transport = self._make_one() +- transport._buffer = collections.deque([b'data1', b'data2']) ++ transport._buffer = list_to_buffer([b'data1', b'data2']) + transport._write_ready() + self.assertTrue(self.sslsock.send.called) +- self.assertEqual(collections.deque([b'data1data2']), transport._buffer) ++ self.assertEqual(list_to_buffer([b'data1data2']), transport._buffer) + + def test_write_ready_send_partial(self): + self.sslsock.send.return_value = 2 + transport = self._make_one() +- transport._buffer = collections.deque([b'data1', b'data2']) ++ transport._buffer = list_to_buffer([b'data1', b'data2']) + transport._write_ready() + self.assertTrue(self.sslsock.send.called) +- self.assertEqual(collections.deque([b'ta1data2']), transport._buffer) ++ self.assertEqual(list_to_buffer([b'ta1data2']), transport._buffer) + + def test_write_ready_send_closing_partial(self): + self.sslsock.send.return_value = 2 + transport = self._make_one() +- transport._buffer = collections.deque([b'data1', b'data2']) ++ transport._buffer = list_to_buffer([b'data1', b'data2']) + transport._write_ready() + self.assertTrue(self.sslsock.send.called) + self.assertFalse(self.sslsock.close.called) +@@ -1201,7 +1266,7 @@ + self.sslsock.send.return_value = 4 + transport = self._make_one() + transport.close() +- transport._buffer = collections.deque([b'data']) ++ transport._buffer = list_to_buffer([b'data']) + transport._write_ready() + self.assertFalse(self.loop.writers) + self.protocol.connection_lost.assert_called_with(None) +@@ -1210,26 +1275,26 @@ + self.sslsock.send.return_value = 4 + transport = self._make_one() + transport.close() +- transport._buffer = collections.deque() ++ transport._buffer = list_to_buffer() + transport._write_ready() + self.assertFalse(self.loop.writers) + self.protocol.connection_lost.assert_called_with(None) + + def test_write_ready_send_retry(self): + transport = self._make_one() +- transport._buffer = collections.deque([b'data']) ++ transport._buffer = list_to_buffer([b'data']) + + self.sslsock.send.side_effect = ssl.SSLWantWriteError + transport._write_ready() +- self.assertEqual(collections.deque([b'data']), transport._buffer) ++ self.assertEqual(list_to_buffer([b'data']), transport._buffer) + + self.sslsock.send.side_effect = BlockingIOError() + transport._write_ready() +- self.assertEqual(collections.deque([b'data']), transport._buffer) ++ self.assertEqual(list_to_buffer([b'data']), transport._buffer) + + def test_write_ready_send_read(self): + transport = self._make_one() +- transport._buffer = collections.deque([b'data']) ++ transport._buffer = list_to_buffer([b'data']) + + self.loop.remove_writer = unittest.mock.Mock() + self.sslsock.send.side_effect = ssl.SSLWantReadError +@@ -1242,11 +1307,11 @@ + err = self.sslsock.send.side_effect = OSError() + + transport = self._make_one() +- transport._buffer = collections.deque([b'data']) ++ transport._buffer = list_to_buffer([b'data']) + transport._fatal_error = unittest.mock.Mock() + transport._write_ready() + transport._fatal_error.assert_called_with(err) +- self.assertEqual(collections.deque(), transport._buffer) ++ self.assertEqual(list_to_buffer(), transport._buffer) + + def test_write_ready_read_wants_write(self): + self.loop.add_reader = unittest.mock.Mock() +@@ -1355,6 +1420,24 @@ + self.assertEqual( + self.sock.sendto.call_args[0], (data, ('0.0.0.0', 1234))) + ++ def test_sendto_bytearray(self): ++ data = bytearray(b'data') ++ transport = _SelectorDatagramTransport( ++ self.loop, self.sock, self.protocol) ++ transport.sendto(data, ('0.0.0.0', 1234)) ++ self.assertTrue(self.sock.sendto.called) ++ self.assertEqual( ++ self.sock.sendto.call_args[0], (data, ('0.0.0.0', 1234))) ++ ++ def test_sendto_memoryview(self): ++ data = memoryview(b'data') ++ transport = _SelectorDatagramTransport( ++ self.loop, self.sock, self.protocol) ++ transport.sendto(data, ('0.0.0.0', 1234)) ++ self.assertTrue(self.sock.sendto.called) ++ self.assertEqual( ++ self.sock.sendto.call_args[0], (data, ('0.0.0.0', 1234))) ++ + def test_sendto_no_data(self): + transport = _SelectorDatagramTransport( + self.loop, self.sock, self.protocol) +@@ -1375,6 +1458,32 @@ + (b'data2', ('0.0.0.0', 12345))], + list(transport._buffer)) + ++ def test_sendto_buffer_bytearray(self): ++ data2 = bytearray(b'data2') ++ transport = _SelectorDatagramTransport( ++ self.loop, self.sock, self.protocol) ++ transport._buffer.append((b'data1', ('0.0.0.0', 12345))) ++ transport.sendto(data2, ('0.0.0.0', 12345)) ++ self.assertFalse(self.sock.sendto.called) ++ self.assertEqual( ++ [(b'data1', ('0.0.0.0', 12345)), ++ (b'data2', ('0.0.0.0', 12345))], ++ list(transport._buffer)) ++ self.assertIsInstance(transport._buffer[1][0], bytes) ++ ++ def test_sendto_buffer_memoryview(self): ++ data2 = memoryview(b'data2') ++ transport = _SelectorDatagramTransport( ++ self.loop, self.sock, self.protocol) ++ transport._buffer.append((b'data1', ('0.0.0.0', 12345))) ++ transport.sendto(data2, ('0.0.0.0', 12345)) ++ self.assertFalse(self.sock.sendto.called) ++ self.assertEqual( ++ [(b'data1', ('0.0.0.0', 12345)), ++ (b'data2', ('0.0.0.0', 12345))], ++ list(transport._buffer)) ++ self.assertIsInstance(transport._buffer[1][0], bytes) ++ + def test_sendto_tryagain(self): + data = b'data' + +@@ -1439,13 +1548,13 @@ + def test_sendto_str(self): + transport = _SelectorDatagramTransport( + self.loop, self.sock, self.protocol) +- self.assertRaises(AssertionError, transport.sendto, 'str', ()) ++ self.assertRaises(TypeError, transport.sendto, 'str', ()) + + def test_sendto_connected_addr(self): + transport = _SelectorDatagramTransport( + self.loop, self.sock, self.protocol, ('0.0.0.0', 1)) + self.assertRaises( +- AssertionError, transport.sendto, b'str', ('0.0.0.0', 2)) ++ ValueError, transport.sendto, b'str', ('0.0.0.0', 2)) + + def test_sendto_closing(self): + transport = _SelectorDatagramTransport( +diff -r 3405dc9a6afa Lib/test/test_asyncio/test_tasks.py +--- a/Lib/test/test_asyncio/test_tasks.py ++++ b/Lib/test/test_asyncio/test_tasks.py +@@ -1113,6 +1113,44 @@ + self.assertEqual(res, 'test') + self.assertIsNone(t2.result()) + ++ def test_current_task(self): ++ self.assertIsNone(tasks.Task.current_task(loop=self.loop)) ++ ++ @tasks.coroutine ++ def coro(loop): ++ self.assertTrue(tasks.Task.current_task(loop=loop) is task) ++ ++ task = tasks.Task(coro(self.loop), loop=self.loop) ++ self.loop.run_until_complete(task) ++ self.assertIsNone(tasks.Task.current_task(loop=self.loop)) ++ ++ def test_current_task_with_interleaving_tasks(self): ++ self.assertIsNone(tasks.Task.current_task(loop=self.loop)) ++ ++ fut1 = futures.Future(loop=self.loop) ++ fut2 = futures.Future(loop=self.loop) ++ ++ @tasks.coroutine ++ def coro1(loop): ++ self.assertTrue(tasks.Task.current_task(loop=loop) is task1) ++ yield from fut1 ++ self.assertTrue(tasks.Task.current_task(loop=loop) is task1) ++ fut2.set_result(True) ++ ++ @tasks.coroutine ++ def coro2(loop): ++ self.assertTrue(tasks.Task.current_task(loop=loop) is task2) ++ fut1.set_result(True) ++ yield from fut2 ++ self.assertTrue(tasks.Task.current_task(loop=loop) is task2) ++ ++ task1 = tasks.Task(coro1(self.loop), loop=self.loop) ++ task2 = tasks.Task(coro2(self.loop), loop=self.loop) ++ ++ self.loop.run_until_complete(tasks.wait((task1, task2), ++ loop=self.loop)) ++ self.assertIsNone(tasks.Task.current_task(loop=self.loop)) ++ + # Some thorough tests for cancellation propagation through + # coroutines, tasks and wait(). + +@@ -1316,6 +1354,7 @@ + c.set_result(3) + d.cancel() + e.set_exception(RuntimeError()) ++ e.exception() + + def test_return_exceptions(self): + a, b, c, d = [futures.Future(loop=self.one_loop) for i in range(4)] +@@ -1395,6 +1434,7 @@ + c.set_result(3) + d.cancel() + e.set_exception(RuntimeError()) ++ e.exception() + + def test_result_exception_one_cancellation(self): + a, b, c, d, e, f = [futures.Future(loop=self.one_loop) +diff -r 3405dc9a6afa Lib/test/test_asyncio/test_transports.py +--- a/Lib/test/test_asyncio/test_transports.py ++++ b/Lib/test/test_asyncio/test_transports.py +@@ -24,12 +24,18 @@ + transport = transports.Transport() + transport.write = unittest.mock.Mock() + +- transport.writelines(['line1', 'line2', 'line3']) +- self.assertEqual(3, transport.write.call_count) ++ transport.writelines([b'line1', ++ bytearray(b'line2'), ++ memoryview(b'line3')]) ++ self.assertEqual(1, transport.write.call_count) ++ transport.write.assert_called_with(b'line1line2line3') + + def test_not_implemented(self): + transport = transports.Transport() + ++ self.assertRaises(NotImplementedError, ++ transport.set_write_buffer_limits) ++ self.assertRaises(NotImplementedError, transport.get_write_buffer_size) + self.assertRaises(NotImplementedError, transport.write, 'data') + self.assertRaises(NotImplementedError, transport.write_eof) + self.assertRaises(NotImplementedError, transport.can_write_eof) +diff -r 3405dc9a6afa Lib/test/test_asyncio/test_unix_events.py +--- a/Lib/test/test_asyncio/test_unix_events.py ++++ b/Lib/test/test_asyncio/test_unix_events.py +@@ -379,7 +379,7 @@ + fstat_patcher = unittest.mock.patch('os.fstat') + m_fstat = fstat_patcher.start() + st = unittest.mock.Mock() +- st.st_mode = stat.S_IFIFO ++ st.st_mode = stat.S_IFSOCK + m_fstat.return_value = st + self.addCleanup(fstat_patcher.stop) + +diff -r 3405dc9a6afa Lib/test/test_asyncio/test_windows_events.py +--- a/Lib/test/test_asyncio/test_windows_events.py ++++ b/Lib/test/test_asyncio/test_windows_events.py +@@ -120,7 +120,7 @@ + self.loop.run_until_complete(f) + elapsed = self.loop.time() - start + self.assertTrue(f.result()) +- self.assertTrue(0 <= elapsed < 0.02, elapsed) ++ self.assertTrue(0 <= elapsed < 0.1, elapsed) + + _overlapped.ResetEvent(event) + +@@ -132,7 +132,7 @@ + with self.assertRaises(futures.CancelledError): + self.loop.run_until_complete(f) + elapsed = self.loop.time() - start +- self.assertTrue(0 <= elapsed < 0.02, elapsed) ++ self.assertTrue(0 <= elapsed < 0.1, elapsed) + + + if __name__ == '__main__': +diff -r 3405dc9a6afa Lib/test/test_bytes.py +--- a/Lib/test/test_bytes.py ++++ b/Lib/test/test_bytes.py +@@ -743,6 +743,12 @@ + self.assertEqual(PyBytes_FromFormat(b's:%s', c_char_p(b'cstr')), + b's:cstr') + ++ # Issue #19969 ++ self.assertRaises(OverflowError, ++ PyBytes_FromFormat, b'%c', c_int(-1)) ++ self.assertRaises(OverflowError, ++ PyBytes_FromFormat, b'%c', c_int(256)) ++ + + class ByteArrayTest(BaseBytesTest, unittest.TestCase): + type2test = bytearray +diff -r 3405dc9a6afa Lib/test/test_bz2.py +--- a/Lib/test/test_bz2.py ++++ b/Lib/test/test_bz2.py +@@ -50,6 +50,7 @@ + TEXT = b''.join(TEXT_LINES) + DATA = b'BZh91AY&SY.\xc8N\x18\x00\x01>_\x80\x00\x10@\x02\xff\xf0\x01\x07n\x00?\xe7\xff\xe00\x01\x99\xaa\x00\xc0\x03F\x86\x8c#&\x83F\x9a\x03\x06\xa6\xd0\xa6\x93M\x0fQ\xa7\xa8\x06\x804hh\x12$\x11\xa4i4\xf14S\xd2\x88\xe5\xcd9gd6\x0b\n\xe9\x9b\xd5\x8a\x99\xf7\x08.K\x8ev\xfb\xf7xw\xbb\xdf\xa1\x92\xf1\xdd|/";\xa2\xba\x9f\xd5\xb1#A\xb6\xf6\xb3o\xc9\xc5y\\\xebO\xe7\x85\x9a\xbc\xb6f8\x952\xd5\xd7"%\x89>V,\xf7\xa6z\xe2\x9f\xa3\xdf\x11\x11"\xd6E)I\xa9\x13^\xca\xf3r\xd0\x03U\x922\xf26\xec\xb6\xed\x8b\xc3U\x13\x9d\xc5\x170\xa4\xfa^\x92\xacDF\x8a\x97\xd6\x19\xfe\xdd\xb8\xbd\x1a\x9a\x19\xa3\x80ankR\x8b\xe5\xd83]\xa9\xc6\x08\x82f\xf6\xb9"6l$\xb8j@\xc0\x8a\xb0l1..\xbak\x83ls\x15\xbc\xf4\xc1\x13\xbe\xf8E\xb8\x9d\r\xa8\x9dk\x84\xd3n\xfa\xacQ\x07\xb1%y\xaav\xb4\x08\xe0z\x1b\x16\xf5\x04\xe9\xcc\xb9\x08z\x1en7.G\xfc]\xc9\x14\xe1B@\xbb!8`' + EMPTY_DATA = b'BZh9\x17rE8P\x90\x00\x00\x00\x00' ++ BAD_DATA = b'this is not a valid bzip2 file' + + def setUp(self): + self.filename = support.TESTFN +@@ -80,9 +81,10 @@ + class BZ2FileTest(BaseTest): + "Test the BZ2File class." + +- def createTempFile(self, streams=1): ++ def createTempFile(self, streams=1, suffix=b""): + with open(self.filename, "wb") as f: + f.write(self.DATA * streams) ++ f.write(suffix) + + def testBadArgs(self): + self.assertRaises(TypeError, BZ2File, 123.456) +@@ -98,6 +100,11 @@ + self.assertRaises(TypeError, bz2f.read, None) + self.assertEqual(bz2f.read(), self.TEXT) + ++ def testReadBadFile(self): ++ self.createTempFile(streams=0, suffix=self.BAD_DATA) ++ with BZ2File(self.filename) as bz2f: ++ self.assertRaises(OSError, bz2f.read) ++ + def testReadMultiStream(self): + self.createTempFile(streams=5) + with BZ2File(self.filename) as bz2f: +@@ -117,6 +124,16 @@ + finally: + bz2._BUFFER_SIZE = buffer_size + ++ def testReadTrailingJunk(self): ++ self.createTempFile(suffix=self.BAD_DATA) ++ with BZ2File(self.filename) as bz2f: ++ self.assertEqual(bz2f.read(), self.TEXT) ++ ++ def testReadMultiStreamTrailingJunk(self): ++ self.createTempFile(streams=5, suffix=self.BAD_DATA) ++ with BZ2File(self.filename) as bz2f: ++ self.assertEqual(bz2f.read(), self.TEXT * 5) ++ + def testRead0(self): + self.createTempFile() + with BZ2File(self.filename) as bz2f: +@@ -714,10 +731,21 @@ + def testDecompressIncomplete(self): + self.assertRaises(ValueError, bz2.decompress, self.DATA[:-10]) + ++ def testDecompressBadData(self): ++ self.assertRaises(OSError, bz2.decompress, self.BAD_DATA) ++ + def testDecompressMultiStream(self): + text = bz2.decompress(self.DATA * 5) + self.assertEqual(text, self.TEXT * 5) + ++ def testDecompressTrailingJunk(self): ++ text = bz2.decompress(self.DATA + self.BAD_DATA) ++ self.assertEqual(text, self.TEXT) ++ ++ def testDecompressMultiStreamTrailingJunk(self): ++ text = bz2.decompress(self.DATA * 5 + self.BAD_DATA) ++ self.assertEqual(text, self.TEXT * 5) ++ + + class OpenTest(BaseTest): + "Test the open function." +diff -r 3405dc9a6afa Lib/test/test_cmd_line_script.py +--- a/Lib/test/test_cmd_line_script.py ++++ b/Lib/test/test_cmd_line_script.py +@@ -41,11 +41,28 @@ + _loader = __loader__ if __loader__ is BuiltinImporter else type(__loader__) + print('__loader__==%a' % _loader) + print('__file__==%a' % __file__) +-assertEqual(__cached__, None) ++print('__cached__==%a' % __cached__) + print('__package__==%r' % __package__) ++# Check PEP 451 details ++import os.path ++if __package__ is not None: ++ print('__main__ was located through the import system') ++ assertIdentical(__spec__.loader, __loader__) ++ expected_spec_name = os.path.splitext(os.path.basename(__file__))[0] ++ if __package__: ++ expected_spec_name = __package__ + "." + expected_spec_name ++ assertEqual(__spec__.name, expected_spec_name) ++ assertEqual(__spec__.parent, __package__) ++ assertIdentical(__spec__.submodule_search_locations, None) ++ assertEqual(__spec__.origin, __file__) ++ if __spec__.cached is not None: ++ assertEqual(__spec__.cached, __cached__) + # Check the sys module + import sys + assertIdentical(globals(), sys.modules[__name__].__dict__) ++if __spec__ is not None: ++ # XXX: We're not currently making __main__ available under its real name ++ pass # assertIdentical(globals(), sys.modules[__spec__.name].__dict__) + from test import test_cmd_line_script + example_args_list = test_cmd_line_script.example_args + assertEqual(sys.argv[1:], example_args_list) +diff -r 3405dc9a6afa Lib/test/test_codecencodings_iso2022.py +--- a/Lib/test/test_codecencodings_iso2022.py ++++ b/Lib/test/test_codecencodings_iso2022.py +@@ -36,6 +36,7 @@ + + # iso2022_kr.txt cannot be used to test "chunk coding": the escape + # sequence is only written on the first line ++ @unittest.skip('iso2022_kr.txt cannot be used to test "chunk coding"') + def test_chunkcoding(self): + pass + +diff -r 3405dc9a6afa Lib/test/test_codecs.py +--- a/Lib/test/test_codecs.py ++++ b/Lib/test/test_codecs.py +@@ -602,7 +602,9 @@ + self.addCleanup(support.unlink, support.TESTFN) + with open(support.TESTFN, 'wb') as fp: + fp.write(s) +- with codecs.open(support.TESTFN, 'U', encoding=self.encoding) as reader: ++ with support.check_warnings(('', DeprecationWarning)): ++ reader = codecs.open(support.TESTFN, 'U', encoding=self.encoding) ++ with reader: + self.assertEqual(reader.read(), s1) + + class UTF16LETest(ReadTest, unittest.TestCase): +@@ -2333,7 +2335,7 @@ + try: + import zlib + except ImportError: +- pass ++ zlib = None + else: + bytes_transform_encodings.append("zlib_codec") + transform_aliases["zlib_codec"] = ["zip", "zlib"] +@@ -2438,6 +2440,7 @@ + bad_input.decode("rot_13") + self.assertIsNone(failure.exception.__cause__) + ++ @unittest.skipUnless(zlib, "Requires zlib support") + def test_custom_zlib_error_is_wrapped(self): + # Check zlib codec gives a good error for malformed input + msg = "^decoding with 'zlib_codec' codec failed" +diff -r 3405dc9a6afa Lib/test/test_compileall.py +--- a/Lib/test/test_compileall.py ++++ b/Lib/test/test_compileall.py +@@ -5,8 +5,6 @@ + import py_compile + import shutil + import struct +-import subprocess +-import sys + import tempfile + import time + import unittest +@@ -181,6 +179,29 @@ + self.assertNotCompiled(self.initfn) + self.assertNotCompiled(self.barfn) + ++ def test_no_args_respects_force_flag(self): ++ bazfn = script_helper.make_script(self.directory, 'baz', '') ++ self.assertRunOK(PYTHONPATH=self.directory) ++ pycpath = importlib.util.cache_from_source(bazfn) ++ # Set atime/mtime backward to avoid file timestamp resolution issues ++ os.utime(pycpath, (time.time()-60,)*2) ++ mtime = os.stat(pycpath).st_mtime ++ # Without force, no recompilation ++ self.assertRunOK(PYTHONPATH=self.directory) ++ mtime2 = os.stat(pycpath).st_mtime ++ self.assertEqual(mtime, mtime2) ++ # Now force it. ++ self.assertRunOK('-f', PYTHONPATH=self.directory) ++ mtime2 = os.stat(pycpath).st_mtime ++ self.assertNotEqual(mtime, mtime2) ++ ++ def test_no_args_respects_quiet_flag(self): ++ script_helper.make_script(self.directory, 'baz', '') ++ noisy = self.assertRunOK(PYTHONPATH=self.directory) ++ self.assertIn(b'Listing ', noisy) ++ quiet = self.assertRunOK('-q', PYTHONPATH=self.directory) ++ self.assertNotIn(b'Listing ', quiet) ++ + # Ensure that the default behavior of compileall's CLI is to create + # PEP 3147 pyc/pyo files. + for name, ext, switch in [ +diff -r 3405dc9a6afa Lib/test/test_configparser.py +--- a/Lib/test/test_configparser.py ++++ b/Lib/test/test_configparser.py +@@ -707,8 +707,7 @@ + + def test_read_returns_file_list(self): + if self.delimiters[0] != '=': +- # skip reading the file if we're using an incompatible format +- return ++ self.skipTest('incompatible format') + file1 = support.findfile("cfgparser.1") + # check when we pass a mix of readable and non-readable files: + cf = self.newconfig() +diff -r 3405dc9a6afa Lib/test/test_copy.py +--- a/Lib/test/test_copy.py ++++ b/Lib/test/test_copy.py +@@ -3,6 +3,7 @@ + import copy + import copyreg + import weakref ++import abc + from operator import le, lt, ge, gt, eq, ne + + import unittest +@@ -93,9 +94,11 @@ + pass + def f(): + pass ++ class WithMetaclass(metaclass=abc.ABCMeta): ++ pass + tests = [None, 42, 2**100, 3.14, True, False, 1j, + "hello", "hello\u1234", f.__code__, +- NewStyle, range(10), Classic, max] ++ NewStyle, range(10), Classic, max, WithMetaclass] + for x in tests: + self.assertIs(copy.copy(x), x) + +diff -r 3405dc9a6afa Lib/test/test_cprofile.py +--- a/Lib/test/test_cprofile.py ++++ b/Lib/test/test_cprofile.py +@@ -29,6 +29,7 @@ + obj.enable() + obj = _lsprof.Profiler(1) + obj.disable() ++ obj.clear() + finally: + sys.stderr = orig_stderr + finally: +diff -r 3405dc9a6afa Lib/test/test_csv.py +--- a/Lib/test/test_csv.py ++++ b/Lib/test/test_csv.py +@@ -756,6 +756,7 @@ + lineterminator = '\r\n' + quoting = csv.QUOTE_NONE + d = mydialect() ++ self.assertEqual(d.quoting, csv.QUOTE_NONE) + + mydialect.quoting = None + self.assertRaises(csv.Error, mydialect) +@@ -764,12 +765,21 @@ + mydialect.quoting = csv.QUOTE_ALL + mydialect.quotechar = '"' + d = mydialect() ++ self.assertEqual(d.quoting, csv.QUOTE_ALL) ++ self.assertEqual(d.quotechar, '"') ++ self.assertTrue(d.doublequote) + + mydialect.quotechar = "''" +- self.assertRaises(csv.Error, mydialect) ++ with self.assertRaises(csv.Error) as cm: ++ mydialect() ++ self.assertEqual(str(cm.exception), ++ '"quotechar" must be an 1-character string') + + mydialect.quotechar = 4 +- self.assertRaises(csv.Error, mydialect) ++ with self.assertRaises(csv.Error) as cm: ++ mydialect() ++ self.assertEqual(str(cm.exception), ++ '"quotechar" must be string, not int') + + def test_delimiter(self): + class mydialect(csv.Dialect): +@@ -780,12 +790,31 @@ + lineterminator = '\r\n' + quoting = csv.QUOTE_NONE + d = mydialect() ++ self.assertEqual(d.delimiter, ";") + + mydialect.delimiter = ":::" +- self.assertRaises(csv.Error, mydialect) ++ with self.assertRaises(csv.Error) as cm: ++ mydialect() ++ self.assertEqual(str(cm.exception), ++ '"delimiter" must be an 1-character string') ++ ++ mydialect.delimiter = "" ++ with self.assertRaises(csv.Error) as cm: ++ mydialect() ++ self.assertEqual(str(cm.exception), ++ '"delimiter" must be an 1-character string') ++ ++ mydialect.delimiter = b"," ++ with self.assertRaises(csv.Error) as cm: ++ mydialect() ++ self.assertEqual(str(cm.exception), ++ '"delimiter" must be string, not bytes') + + mydialect.delimiter = 4 +- self.assertRaises(csv.Error, mydialect) ++ with self.assertRaises(csv.Error) as cm: ++ mydialect() ++ self.assertEqual(str(cm.exception), ++ '"delimiter" must be string, not int') + + def test_lineterminator(self): + class mydialect(csv.Dialect): +@@ -796,12 +825,17 @@ + lineterminator = '\r\n' + quoting = csv.QUOTE_NONE + d = mydialect() ++ self.assertEqual(d.lineterminator, '\r\n') + + mydialect.lineterminator = ":::" + d = mydialect() ++ self.assertEqual(d.lineterminator, ":::") + + mydialect.lineterminator = 4 +- self.assertRaises(csv.Error, mydialect) ++ with self.assertRaises(csv.Error) as cm: ++ mydialect() ++ self.assertEqual(str(cm.exception), ++ '"lineterminator" must be a string') + + + class TestSniffer(unittest.TestCase): +diff -r 3405dc9a6afa Lib/test/test_decimal.py +--- a/Lib/test/test_decimal.py ++++ b/Lib/test/test_decimal.py +@@ -300,7 +300,6 @@ + #Exception raised where there shouldn't have been one. + self.fail('Exception "'+exception.__class__.__name__ + '" raised on line '+line) + +- return + + def eval_line(self, s): + if s.find(' -> ') >= 0 and s[:2] != '--' and not s.startswith(' --'): +@@ -460,7 +459,6 @@ + + self.assertEqual(myexceptions, theirexceptions, + 'Incorrect flags set in ' + s + ' -- got ' + str(myexceptions)) +- return + + def getexceptions(self): + return [e for e in Signals[self.decimal] if self.context.flags[e]] +@@ -1072,7 +1070,7 @@ + try: + from locale import CHAR_MAX + except ImportError: +- return ++ self.skipTest('locale.CHAR_MAX not available') + + def make_grouping(lst): + return ''.join([chr(x) for x in lst]) if self.decimal == C else lst +@@ -1163,8 +1161,12 @@ + + decimal_point = locale.localeconv()['decimal_point'] + thousands_sep = locale.localeconv()['thousands_sep'] +- if decimal_point != '\u066b' or thousands_sep != '\u066c': +- return ++ if decimal_point != '\u066b': ++ self.skipTest('inappropriate decimal point separator' ++ '({!a} not {!a})'.format(decimal_point, '\u066b')) ++ if thousands_sep != '\u066c': ++ self.skipTest('inappropriate thousands separator' ++ '({!a} not {!a})'.format(thousands_sep, '\u066c')) + + self.assertEqual(format(Decimal('100000000.123'), 'n'), + '100\u066c000\u066c000\u066b123') +@@ -1514,7 +1516,6 @@ + cls.assertTrue(c1.flags[Inexact]) + for sig in Overflow, Underflow, DivisionByZero, InvalidOperation: + cls.assertFalse(c1.flags[sig]) +- return + + def thfunc2(cls): + Decimal = cls.decimal.Decimal +@@ -1559,7 +1560,6 @@ + cls.assertTrue(thiscontext.flags[Inexact]) + for sig in Overflow, Underflow, DivisionByZero, InvalidOperation: + cls.assertFalse(thiscontext.flags[sig]) +- return + + class ThreadingTest(unittest.TestCase): + '''Unit tests for thread local contexts in Decimal.''' +@@ -1601,7 +1601,6 @@ + DefaultContext.prec = save_prec + DefaultContext.Emax = save_emax + DefaultContext.Emin = save_emin +- return + + @unittest.skipUnless(threading, 'threading required') + class CThreadingTest(ThreadingTest): +@@ -4149,6 +4148,7 @@ + self.assertTrue(P.HAVE_THREADS is True or P.HAVE_THREADS is False) + + self.assertEqual(C.__version__, P.__version__) ++ self.assertEqual(C.__libmpdec_version__, P.__libmpdec_version__) + + x = dir(C) + y = [s for s in dir(P) if '__' in s or not s.startswith('_')] +@@ -4523,7 +4523,6 @@ + self.assertEqual(d1._sign, b1._sign) + self.assertEqual(d1._int, b1._int) + self.assertEqual(d1._exp, b1._exp) +- return + + Decimal(d1) + self.assertEqual(d1._sign, b1._sign) +@@ -5269,7 +5268,7 @@ + try: + from locale import CHAR_MAX + except ImportError: +- return ++ self.skipTest('locale.CHAR_MAX not available') + + def make_grouping(lst): + return ''.join([chr(x) for x in lst]) +diff -r 3405dc9a6afa Lib/test/test_devpoll.py +--- a/Lib/test/test_devpoll.py ++++ b/Lib/test/test_devpoll.py +@@ -8,6 +8,7 @@ + import sys + import unittest + from test.support import TESTFN, run_unittest ++from _testcapi import USHRT_MAX + + try: + select.devpoll +@@ -121,6 +122,17 @@ + self.assertEqual(os.get_inheritable(devpoll.fileno()), False) + + ++ def test_events_mask_overflow(self): ++ pollster = select.devpoll() ++ w, r = os.pipe() ++ pollster.register(w) ++ # Issue #17919 ++ self.assertRaises(OverflowError, pollster.register, 0, -1) ++ self.assertRaises(OverflowError, pollster.register, 0, USHRT_MAX + 1) ++ self.assertRaises(OverflowError, pollster.modify, 1, -1) ++ self.assertRaises(OverflowError, pollster.modify, 1, USHRT_MAX + 1) ++ ++ + def test_main(): + run_unittest(DevPollTests) + +diff -r 3405dc9a6afa Lib/test/test_dis.py +--- a/Lib/test/test_dis.py ++++ b/Lib/test/test_dis.py +@@ -7,6 +7,7 @@ + import sys + import dis + import io ++import re + import types + import contextlib + +@@ -106,27 +107,26 @@ + pass + + dis_bug1333982 = """\ +- %-4d 0 LOAD_CONST 1 (0) +- 3 JUMP_IF_TRUE 33 (to 39) +- 6 POP_TOP +- 7 LOAD_GLOBAL 0 (AssertionError) +- 10 BUILD_LIST 0 +- 13 LOAD_FAST 0 (x) +- 16 GET_ITER +- >> 17 FOR_ITER 12 (to 32) +- 20 STORE_FAST 1 (s) +- 23 LOAD_FAST 1 (s) +- 26 LIST_APPEND 2 +- 29 JUMP_ABSOLUTE 17 ++%3d 0 LOAD_CONST 1 (0) ++ 3 POP_JUMP_IF_TRUE 35 ++ 6 LOAD_GLOBAL 0 (AssertionError) ++ 9 LOAD_CONST 2 ( at 0x..., file "%s", line %d>) ++ 12 LOAD_CONST 3 ('bug1333982..') ++ 15 MAKE_FUNCTION 0 ++ 18 LOAD_FAST 0 (x) ++ 21 GET_ITER ++ 22 CALL_FUNCTION 1 (1 positional, 0 keyword pair) + +- %-4d >> 32 LOAD_CONST 2 (1) +- 35 BINARY_ADD +- 36 RAISE_VARARGS 2 +- >> 39 POP_TOP ++%3d 25 LOAD_CONST 4 (1) ++ 28 BINARY_ADD ++ 29 CALL_FUNCTION 1 (1 positional, 0 keyword pair) ++ 32 RAISE_VARARGS 1 + +- %-4d 40 LOAD_CONST 0 (None) +- 43 RETURN_VALUE ++%3d >> 35 LOAD_CONST 0 (None) ++ 38 RETURN_VALUE + """ % (bug1333982.__code__.co_firstlineno + 1, ++ __file__, ++ bug1333982.__code__.co_firstlineno + 1, + bug1333982.__code__.co_firstlineno + 2, + bug1333982.__code__.co_firstlineno + 3) + +@@ -244,8 +244,14 @@ + def get_disassemble_as_string(self, func, lasti=-1): + return self.get_disassembly(func, lasti, False) + ++ def strip_addresses(self, text): ++ return re.sub(r'\b0x[0-9A-Fa-f]+\b', '0x...', text) ++ + def do_disassembly_test(self, func, expected): +- self.assertEqual(self.get_disassembly(func), expected) ++ got = self.get_disassembly(func) ++ if got != expected: ++ got = self.strip_addresses(got) ++ self.assertEqual(got, expected) + + def test_opmap(self): + self.assertEqual(dis.opmap["NOP"], 9) +@@ -266,15 +272,12 @@ + self.do_disassembly_test(bug708901, dis_bug708901) + + def test_bug_1333982(self): +- # XXX: re-enable this test! + # This one is checking bytecodes generated for an `assert` statement, + # so fails if the tests are run with -O. Skip this test then. +- pass # Test has been disabled due to change in the way +- # list comps are handled. The byte code now includes +- # a memory address and a file location, so they change from +- # run to run. +- # if __debug__: +- # self.do_disassembly_test(bug1333982, dis_bug1333982) ++ if not __debug__: ++ self.skipTest('need asserts, run without -O') ++ ++ self.do_disassembly_test(bug1333982, dis_bug1333982) + + def test_big_linenos(self): + def func(count): +@@ -825,9 +828,5 @@ + b = dis.Bytecode.from_traceback(tb) + self.assertEqual(b.dis(), dis_traceback) + +-def test_main(): +- run_unittest(DisTests, DisWithFileTests, CodeInfoTests, +- InstructionTests, BytecodeTests) +- + if __name__ == "__main__": +- test_main() ++ unittest.main() +diff -r 3405dc9a6afa Lib/test/test_doctest.py +--- a/Lib/test/test_doctest.py ++++ b/Lib/test/test_doctest.py +@@ -1054,6 +1054,33 @@ + ValueError: message + TestResults(failed=1, attempted=1) + ++If the exception does not have a message, you can still use ++IGNORE_EXCEPTION_DETAIL to normalize the modules between Python 2 and 3: ++ ++ >>> def f(x): ++ ... r''' ++ ... >>> from http.client import HTTPException ++ ... >>> raise HTTPException() #doctest: +IGNORE_EXCEPTION_DETAIL ++ ... Traceback (most recent call last): ++ ... foo.bar.HTTPException ++ ... ''' ++ >>> test = doctest.DocTestFinder().find(f)[0] ++ >>> doctest.DocTestRunner(verbose=False).run(test) ++ TestResults(failed=0, attempted=2) ++ ++Note that a trailing colon doesn't matter either: ++ ++ >>> def f(x): ++ ... r''' ++ ... >>> from http.client import HTTPException ++ ... >>> raise HTTPException() #doctest: +IGNORE_EXCEPTION_DETAIL ++ ... Traceback (most recent call last): ++ ... foo.bar.HTTPException: ++ ... ''' ++ >>> test = doctest.DocTestFinder().find(f)[0] ++ >>> doctest.DocTestRunner(verbose=False).run(test) ++ TestResults(failed=0, attempted=2) ++ + If an exception is raised but not expected, then it is reported as an + unexpected exception: + +diff -r 3405dc9a6afa Lib/test/test_docxmlrpc.py +--- a/Lib/test/test_docxmlrpc.py ++++ b/Lib/test/test_docxmlrpc.py +@@ -202,10 +202,12 @@ + """ Test that annotations works as expected """ + self.client.request("GET", "/") + response = self.client.getresponse() ++ docstring = (b'' if sys.flags.optimize >= 2 else ++ b'

Use function annotations.
') + self.assertIn( + (b'
annotation' +- b'(x: int)
Use function annotations.' +- b'
\n
' ++ b'(x: int)
' + docstring + b'
\n' ++ b'
' + b'method_annotation(x: bytes)
'), + response.read()) + +diff -r 3405dc9a6afa Lib/test/test_email/data/msg_06.txt +--- a/Lib/test/test_email/data/msg_06.txt ++++ b/Lib/test/test_email/data/msg_06.txt +@@ -5,7 +5,7 @@ + Content-Description: forwarded message + Content-Transfer-Encoding: 7bit + Message-ID: <15265.9482.641338.555352@python.org> +-From: barry@zope.com (Barry A. Warsaw) ++From: barry@python.org (Barry A. Warsaw) + Sender: barry@python.org + To: barry@python.org + Subject: forwarded message from Barry A. Warsaw +@@ -20,7 +20,7 @@ + Return-Path: + Delivered-To: barry@python.org + Message-ID: <15265.9468.713530.98441@python.org> +-From: barry@zope.com (Barry A. Warsaw) ++From: barry@python.org (Barry A. Warsaw) + Sender: barry@python.org + To: barry@python.org + Subject: testing +diff -r 3405dc9a6afa Lib/test/test_email/data/msg_08.txt +--- a/Lib/test/test_email/data/msg_08.txt ++++ b/Lib/test/test_email/data/msg_08.txt +@@ -1,5 +1,5 @@ + MIME-Version: 1.0 +-From: Barry Warsaw ++From: Barry Warsaw + To: Dingus Lovers + Subject: Lyrics + Date: Fri, 20 Apr 2001 19:35:02 -0400 +diff -r 3405dc9a6afa Lib/test/test_email/data/msg_09.txt +--- a/Lib/test/test_email/data/msg_09.txt ++++ b/Lib/test/test_email/data/msg_09.txt +@@ -1,5 +1,5 @@ + MIME-Version: 1.0 +-From: Barry Warsaw ++From: Barry Warsaw + To: Dingus Lovers + Subject: Lyrics + Date: Fri, 20 Apr 2001 19:35:02 -0400 +diff -r 3405dc9a6afa Lib/test/test_email/data/msg_10.txt +--- a/Lib/test/test_email/data/msg_10.txt ++++ b/Lib/test/test_email/data/msg_10.txt +@@ -1,5 +1,5 @@ + MIME-Version: 1.0 +-From: Barry Warsaw ++From: Barry Warsaw + To: Dingus Lovers + Subject: Lyrics + Date: Fri, 20 Apr 2001 19:35:02 -0400 +diff -r 3405dc9a6afa Lib/test/test_email/data/msg_12.txt +--- a/Lib/test/test_email/data/msg_12.txt ++++ b/Lib/test/test_email/data/msg_12.txt +@@ -1,5 +1,5 @@ + MIME-Version: 1.0 +-From: Barry Warsaw ++From: Barry Warsaw + To: Dingus Lovers + Subject: Lyrics + Date: Fri, 20 Apr 2001 19:35:02 -0400 +diff -r 3405dc9a6afa Lib/test/test_email/data/msg_12a.txt +--- a/Lib/test/test_email/data/msg_12a.txt ++++ b/Lib/test/test_email/data/msg_12a.txt +@@ -1,5 +1,5 @@ + MIME-Version: 1.0 +-From: Barry Warsaw ++From: Barry Warsaw + To: Dingus Lovers + Subject: Lyrics + Date: Fri, 20 Apr 2001 19:35:02 -0400 +diff -r 3405dc9a6afa Lib/test/test_email/test_contentmanager.py +--- a/Lib/test/test_email/test_contentmanager.py ++++ b/Lib/test/test_email/test_contentmanager.py +@@ -208,12 +208,11 @@ + "Basìc tëxt.\n") + + def test_get_text_plain_utf8_base64_recoverable_bad_CTE_data(self): +- m = self._str_msg(textwrap.dedent("""\ ++ m = self._bytes_msg(textwrap.dedent("""\ + Content-Type: text/plain; charset="utf8" + Content-Transfer-Encoding: base64 + +- QmFzw6xjIHTDq3h0Lgo\xFF= +- """)) ++ QmFzw6xjIHTDq3h0Lgo""").encode('ascii') + b'\xFF=\n') + self.assertEqual(raw_data_manager.get_content(m, errors='ignore'), + "Basìc tëxt.\n") + +diff -r 3405dc9a6afa Lib/test/test_email/test_email.py +--- a/Lib/test/test_email/test_email.py ++++ b/Lib/test/test_email/test_email.py +@@ -92,6 +92,44 @@ + msg.set_payload('This is a string payload', charset) + self.assertEqual(msg.get_charset().input_charset, 'iso-8859-1') + ++ def test_set_payload_with_8bit_data_and_charset(self): ++ data = b'\xd0\x90\xd0\x91\xd0\x92' ++ charset = Charset('utf-8') ++ msg = Message() ++ msg.set_payload(data, charset) ++ self.assertEqual(msg['content-transfer-encoding'], 'base64') ++ self.assertEqual(msg.get_payload(decode=True), data) ++ self.assertEqual(msg.get_payload(), '0JDQkdCS\n') ++ ++ def test_set_payload_with_non_ascii_and_charset_body_encoding_none(self): ++ data = b'\xd0\x90\xd0\x91\xd0\x92' ++ charset = Charset('utf-8') ++ charset.body_encoding = None # Disable base64 encoding ++ msg = Message() ++ msg.set_payload(data.decode('utf-8'), charset) ++ self.assertEqual(msg['content-transfer-encoding'], '8bit') ++ self.assertEqual(msg.get_payload(decode=True), data) ++ ++ def test_set_payload_with_8bit_data_and_charset_body_encoding_none(self): ++ data = b'\xd0\x90\xd0\x91\xd0\x92' ++ charset = Charset('utf-8') ++ charset.body_encoding = None # Disable base64 encoding ++ msg = Message() ++ msg.set_payload(data, charset) ++ self.assertEqual(msg['content-transfer-encoding'], '8bit') ++ self.assertEqual(msg.get_payload(decode=True), data) ++ ++ def test_set_payload_to_list(self): ++ msg = Message() ++ msg.set_payload([]) ++ self.assertEqual(msg.get_payload(), []) ++ ++ def test_set_payload_with_non_ascii_and_no_charset_raises(self): ++ data = b'\xd0\x90\xd0\x91\xd0\x92'.decode('utf-8') ++ msg = Message() ++ with self.assertRaises(TypeError): ++ msg.set_payload(data) ++ + def test_get_charsets(self): + eq = self.assertEqual + +@@ -558,20 +596,10 @@ + self.assertIsInstance(msg.defects[0], + errors.InvalidBase64CharactersDefect) + +- def test_broken_unicode_payload(self): +- # This test improves coverage but is not a compliance test. +- # The behavior in this situation is currently undefined by the API. +- x = 'this is a br\xf6ken thing to do' +- msg = Message() +- msg['content-type'] = 'text/plain' +- msg['content-transfer-encoding'] = '8bit' +- msg.set_payload(x) +- self.assertEqual(msg.get_payload(decode=True), +- bytes(x, 'raw-unicode-escape')) +- + def test_questionable_bytes_payload(self): + # This test improves coverage but is not a compliance test, +- # since it involves poking inside the black box. ++ # since it involves poking inside the black box in a way ++ # that actually breaks the model invariants. + x = 'this is a quéstionable thing to do'.encode('utf-8') + msg = Message() + msg['content-type'] = 'text/plain; charset="utf-8"' +@@ -737,8 +765,15 @@ + # whose output character set is 7bit gets a transfer-encoding + # of 7bit. + eq = self.assertEqual +- msg = MIMEText('文', _charset='euc-jp') ++ msg = MIMEText('文\n', _charset='euc-jp') + eq(msg['content-transfer-encoding'], '7bit') ++ eq(msg.as_string(), textwrap.dedent("""\ ++ MIME-Version: 1.0 ++ Content-Type: text/plain; charset="iso-2022-jp" ++ Content-Transfer-Encoding: 7bit ++ ++ \x1b$BJ8\x1b(B ++ """)) + + def test_qp_encode_latin1(self): + msg = MIMEText('\xe1\xf6\n', 'text', 'ISO-8859-1') +diff -r 3405dc9a6afa Lib/test/test_ensurepip.py +--- a/Lib/test/test_ensurepip.py ++++ b/Lib/test/test_ensurepip.py +@@ -1,18 +1,34 @@ + import unittest + import unittest.mock +-import ensurepip + import test.support + import os + import os.path ++import contextlib ++import sys + ++import ensurepip ++import ensurepip._uninstall ++ ++# pip currently requires ssl support, so we ensure we handle ++# it being missing (http://bugs.python.org/issue19744) ++ensurepip_no_ssl = test.support.import_fresh_module("ensurepip", ++ blocked=["ssl"]) ++try: ++ import ssl ++except ImportError: ++ def requires_usable_pip(f): ++ deco = unittest.skip(ensurepip._MISSING_SSL_MESSAGE) ++ return deco(f) ++else: ++ def requires_usable_pip(f): ++ return f + + class TestEnsurePipVersion(unittest.TestCase): + + def test_returns_version(self): + self.assertEqual(ensurepip._PIP_VERSION, ensurepip.version()) + +- +-class TestBootstrap(unittest.TestCase): ++class EnsurepipMixin: + + def setUp(self): + run_pip_patch = unittest.mock.patch("ensurepip._run_pip") +@@ -26,6 +42,10 @@ + patched_os.path = os.path + self.os_environ = patched_os.environ = os.environ.copy() + ++ ++class TestBootstrap(EnsurepipMixin, unittest.TestCase): ++ ++ @requires_usable_pip + def test_basic_bootstrapping(self): + ensurepip.bootstrap() + +@@ -40,6 +60,7 @@ + additional_paths = self.run_pip.call_args[0][1] + self.assertEqual(len(additional_paths), 2) + ++ @requires_usable_pip + def test_bootstrapping_with_root(self): + ensurepip.bootstrap(root="/foo/bar/") + +@@ -52,6 +73,7 @@ + unittest.mock.ANY, + ) + ++ @requires_usable_pip + def test_bootstrapping_with_user(self): + ensurepip.bootstrap(user=True) + +@@ -63,6 +85,7 @@ + unittest.mock.ANY, + ) + ++ @requires_usable_pip + def test_bootstrapping_with_upgrade(self): + ensurepip.bootstrap(upgrade=True) + +@@ -74,6 +97,7 @@ + unittest.mock.ANY, + ) + ++ @requires_usable_pip + def test_bootstrapping_with_verbosity_1(self): + ensurepip.bootstrap(verbosity=1) + +@@ -85,6 +109,7 @@ + unittest.mock.ANY, + ) + ++ @requires_usable_pip + def test_bootstrapping_with_verbosity_2(self): + ensurepip.bootstrap(verbosity=2) + +@@ -96,6 +121,7 @@ + unittest.mock.ANY, + ) + ++ @requires_usable_pip + def test_bootstrapping_with_verbosity_3(self): + ensurepip.bootstrap(verbosity=3) + +@@ -107,14 +133,17 @@ + unittest.mock.ANY, + ) + ++ @requires_usable_pip + def test_bootstrapping_with_regular_install(self): + ensurepip.bootstrap() + self.assertEqual(self.os_environ["ENSUREPIP_OPTIONS"], "install") + ++ @requires_usable_pip + def test_bootstrapping_with_alt_install(self): + ensurepip.bootstrap(altinstall=True) + self.assertEqual(self.os_environ["ENSUREPIP_OPTIONS"], "altinstall") + ++ @requires_usable_pip + def test_bootstrapping_with_default_pip(self): + ensurepip.bootstrap(default_pip=True) + self.assertNotIn("ENSUREPIP_OPTIONS", self.os_environ) +@@ -122,6 +151,168 @@ + def test_altinstall_default_pip_conflict(self): + with self.assertRaises(ValueError): + ensurepip.bootstrap(altinstall=True, default_pip=True) ++ self.run_pip.assert_not_called() ++ ++ @requires_usable_pip ++ def test_pip_environment_variables_removed(self): ++ # ensurepip deliberately ignores all pip environment variables ++ # See http://bugs.python.org/issue19734 for details ++ self.os_environ["PIP_THIS_SHOULD_GO_AWAY"] = "test fodder" ++ ensurepip.bootstrap() ++ self.assertNotIn("PIP_THIS_SHOULD_GO_AWAY", self.os_environ) ++ ++ ++@contextlib.contextmanager ++def fake_pip(version=ensurepip._PIP_VERSION): ++ if version is None: ++ pip = None ++ else: ++ class FakePip(): ++ __version__ = version ++ pip = FakePip() ++ sentinel = object() ++ orig_pip = sys.modules.get("pip", sentinel) ++ sys.modules["pip"] = pip ++ try: ++ yield pip ++ finally: ++ if orig_pip is sentinel: ++ del sys.modules["pip"] ++ else: ++ sys.modules["pip"] = orig_pip ++ ++class TestUninstall(EnsurepipMixin, unittest.TestCase): ++ ++ def test_uninstall_skipped_when_not_installed(self): ++ with fake_pip(None): ++ ensurepip._uninstall_helper() ++ self.run_pip.assert_not_called() ++ ++ def test_uninstall_fails_with_wrong_version(self): ++ with fake_pip("not a valid version"): ++ with self.assertRaises(RuntimeError): ++ ensurepip._uninstall_helper() ++ self.run_pip.assert_not_called() ++ ++ ++ @requires_usable_pip ++ def test_uninstall(self): ++ with fake_pip(): ++ ensurepip._uninstall_helper() ++ ++ self.run_pip.assert_called_once_with( ++ ["uninstall", "-y", "pip", "setuptools"] ++ ) ++ ++ @requires_usable_pip ++ def test_uninstall_with_verbosity_1(self): ++ with fake_pip(): ++ ensurepip._uninstall_helper(verbosity=1) ++ ++ self.run_pip.assert_called_once_with( ++ ["uninstall", "-y", "-v", "pip", "setuptools"] ++ ) ++ ++ @requires_usable_pip ++ def test_uninstall_with_verbosity_2(self): ++ with fake_pip(): ++ ensurepip._uninstall_helper(verbosity=2) ++ ++ self.run_pip.assert_called_once_with( ++ ["uninstall", "-y", "-vv", "pip", "setuptools"] ++ ) ++ ++ @requires_usable_pip ++ def test_uninstall_with_verbosity_3(self): ++ with fake_pip(): ++ ensurepip._uninstall_helper(verbosity=3) ++ ++ self.run_pip.assert_called_once_with( ++ ["uninstall", "-y", "-vvv", "pip", "setuptools"] ++ ) ++ ++ @requires_usable_pip ++ def test_pip_environment_variables_removed(self): ++ # ensurepip deliberately ignores all pip environment variables ++ # See http://bugs.python.org/issue19734 for details ++ self.os_environ["PIP_THIS_SHOULD_GO_AWAY"] = "test fodder" ++ with fake_pip(): ++ ensurepip._uninstall_helper() ++ self.assertNotIn("PIP_THIS_SHOULD_GO_AWAY", self.os_environ) ++ ++ ++class TestMissingSSL(EnsurepipMixin, unittest.TestCase): ++ ++ def setUp(self): ++ sys.modules["ensurepip"] = ensurepip_no_ssl ++ @self.addCleanup ++ def restore_module(): ++ sys.modules["ensurepip"] = ensurepip ++ super().setUp() ++ ++ def test_bootstrap_requires_ssl(self): ++ self.os_environ["PIP_THIS_SHOULD_STAY"] = "test fodder" ++ with self.assertRaisesRegex(RuntimeError, "requires SSL/TLS"): ++ ensurepip_no_ssl.bootstrap() ++ self.run_pip.assert_not_called() ++ self.assertIn("PIP_THIS_SHOULD_STAY", self.os_environ) ++ ++ def test_uninstall_requires_ssl(self): ++ self.os_environ["PIP_THIS_SHOULD_STAY"] = "test fodder" ++ with self.assertRaisesRegex(RuntimeError, "requires SSL/TLS"): ++ with fake_pip(): ++ ensurepip_no_ssl._uninstall_helper() ++ self.run_pip.assert_not_called() ++ self.assertIn("PIP_THIS_SHOULD_STAY", self.os_environ) ++ ++# Basic testing of the main functions and their argument parsing ++ ++EXPECTED_VERSION_OUTPUT = "pip " + ensurepip._PIP_VERSION ++ ++class TestBootstrappingMainFunction(EnsurepipMixin, unittest.TestCase): ++ ++ def test_bootstrap_version(self): ++ with test.support.captured_stdout() as stdout: ++ with self.assertRaises(SystemExit): ++ ensurepip._main(["--version"]) ++ result = stdout.getvalue().strip() ++ self.assertEqual(result, EXPECTED_VERSION_OUTPUT) ++ self.run_pip.assert_not_called() ++ ++ @requires_usable_pip ++ def test_basic_bootstrapping(self): ++ ensurepip._main([]) ++ ++ self.run_pip.assert_called_once_with( ++ [ ++ "install", "--no-index", "--find-links", ++ unittest.mock.ANY, "--pre", "setuptools", "pip", ++ ], ++ unittest.mock.ANY, ++ ) ++ ++ additional_paths = self.run_pip.call_args[0][1] ++ self.assertEqual(len(additional_paths), 2) ++ ++class TestUninstallationMainFunction(EnsurepipMixin, unittest.TestCase): ++ ++ def test_uninstall_version(self): ++ with test.support.captured_stdout() as stdout: ++ with self.assertRaises(SystemExit): ++ ensurepip._uninstall._main(["--version"]) ++ result = stdout.getvalue().strip() ++ self.assertEqual(result, EXPECTED_VERSION_OUTPUT) ++ self.run_pip.assert_not_called() ++ ++ @requires_usable_pip ++ def test_basic_uninstall(self): ++ with fake_pip(): ++ ensurepip._uninstall._main([]) ++ ++ self.run_pip.assert_called_once_with( ++ ["uninstall", "-y", "pip", "setuptools"] ++ ) ++ + + + if __name__ == "__main__": +diff -r 3405dc9a6afa Lib/test/test_fcntl.py +--- a/Lib/test/test_fcntl.py ++++ b/Lib/test/test_fcntl.py +@@ -115,6 +115,22 @@ + finally: + os.close(fd) + ++ def test_flock(self): ++ # Solaris needs readable file for shared lock ++ self.f = open(TESTFN, 'wb+') ++ fileno = self.f.fileno() ++ fcntl.flock(fileno, fcntl.LOCK_SH) ++ fcntl.flock(fileno, fcntl.LOCK_UN) ++ fcntl.flock(self.f, fcntl.LOCK_SH | fcntl.LOCK_NB) ++ fcntl.flock(self.f, fcntl.LOCK_UN) ++ fcntl.flock(fileno, fcntl.LOCK_EX) ++ fcntl.flock(fileno, fcntl.LOCK_UN) ++ ++ self.assertRaises(ValueError, fcntl.flock, -1, fcntl.LOCK_SH) ++ self.assertRaises(TypeError, fcntl.flock, 'spam', fcntl.LOCK_SH) ++ self.assertRaises(OverflowError, fcntl.flock, _testcapi.INT_MAX+1, ++ fcntl.LOCK_SH) ++ + + def test_main(): + run_unittest(TestFcntl) +diff -r 3405dc9a6afa Lib/test/test_fileinput.py +--- a/Lib/test/test_fileinput.py ++++ b/Lib/test/test_fileinput.py +@@ -22,7 +22,7 @@ + from io import StringIO + from fileinput import FileInput, hook_encoded + +-from test.support import verbose, TESTFN, run_unittest ++from test.support import verbose, TESTFN, run_unittest, check_warnings + from test.support import unlink as safe_unlink + + +@@ -224,8 +224,10 @@ + try: + # try opening in universal newline mode + t1 = writeTmp(1, [b"A\nB\r\nC\rD"], mode="wb") +- fi = FileInput(files=t1, mode="U") +- lines = list(fi) ++ with check_warnings(('', DeprecationWarning)): ++ fi = FileInput(files=t1, mode="U") ++ with check_warnings(('', DeprecationWarning)): ++ lines = list(fi) + self.assertEqual(lines, ["A\n", "B\n", "C\n", "D"]) + finally: + remove_tempfiles(t1) +diff -r 3405dc9a6afa Lib/test/test_fileio.py +--- a/Lib/test/test_fileio.py ++++ b/Lib/test/test_fileio.py +@@ -341,8 +341,7 @@ + try: + fn = TESTFN.encode("ascii") + except UnicodeEncodeError: +- # Skip test +- return ++ self.skipTest('could not encode %r to ascii' % TESTFN) + f = _FileIO(fn, "w") + try: + f.write(b"abc") +diff -r 3405dc9a6afa Lib/test/test_float.py +--- a/Lib/test/test_float.py ++++ b/Lib/test/test_float.py +@@ -71,7 +71,7 @@ + # it still has to accept the normal python syntax + import locale + if not locale.localeconv()['decimal_point'] == ',': +- return ++ self.skipTest('decimal_point is not ","') + + self.assertEqual(float(" 3.14 "), 3.14) + self.assertEqual(float("+3.14 "), 3.14) +diff -r 3405dc9a6afa Lib/test/test_ftplib.py +--- a/Lib/test/test_ftplib.py ++++ b/Lib/test/test_ftplib.py +@@ -15,6 +15,9 @@ + import ssl + except ImportError: + ssl = None ++ HAS_SNI = False ++else: ++ from ssl import HAS_SNI + + from unittest import TestCase, skipUnless + from test import support +@@ -301,7 +304,8 @@ + + if ssl is not None: + +- CERTFILE = os.path.join(os.path.dirname(__file__), "keycert.pem") ++ CERTFILE = os.path.join(os.path.dirname(__file__), "keycert3.pem") ++ CAFILE = os.path.join(os.path.dirname(__file__), "pycacert.pem") + + class SSLConnection(asyncore.dispatcher): + """An asyncore.dispatcher subclass supporting TLS/SSL.""" +@@ -923,6 +927,37 @@ + self.client.ccc() + self.assertRaises(ValueError, self.client.sock.unwrap) + ++ @skipUnless(HAS_SNI, 'No SNI support in ssl module') ++ def test_check_hostname(self): ++ self.client.quit() ++ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1) ++ ctx.verify_mode = ssl.CERT_REQUIRED ++ ctx.check_hostname = True ++ ctx.load_verify_locations(CAFILE) ++ self.client = ftplib.FTP_TLS(context=ctx, timeout=TIMEOUT) ++ ++ # 127.0.0.1 doesn't match SAN ++ self.client.connect(self.server.host, self.server.port) ++ with self.assertRaises(ssl.CertificateError): ++ self.client.auth() ++ # exception quits connection ++ ++ self.client.connect(self.server.host, self.server.port) ++ self.client.prot_p() ++ with self.assertRaises(ssl.CertificateError): ++ with self.client.transfercmd("list") as sock: ++ pass ++ self.client.quit() ++ ++ self.client.connect("localhost", self.server.port) ++ self.client.auth() ++ self.client.quit() ++ ++ self.client.connect("localhost", self.server.port) ++ self.client.prot_p() ++ with self.client.transfercmd("list") as sock: ++ pass ++ + + class TestTimeouts(TestCase): + +diff -r 3405dc9a6afa Lib/test/test_functools.py +--- a/Lib/test/test_functools.py ++++ b/Lib/test/test_functools.py +@@ -42,20 +42,6 @@ + self.assertEqual(p.func, capture) + self.assertEqual(p.args, (1, 2)) + self.assertEqual(p.keywords, dict(a=10, b=20)) +- # attributes should not be writable +- if not isinstance(self.partial, type): +- return +- self.assertRaises(AttributeError, setattr, p, 'func', map) +- self.assertRaises(AttributeError, setattr, p, 'args', (1, 2)) +- self.assertRaises(AttributeError, setattr, p, 'keywords', dict(a=1, b=2)) +- +- p = self.partial(hex) +- try: +- del p.__dict__ +- except TypeError: +- pass +- else: +- self.fail('partial object allowed __dict__ to be deleted') + + def test_argument_checking(self): + self.assertRaises(TypeError, self.partial) # need at least a func arg +@@ -151,6 +137,21 @@ + if c_functools: + partial = c_functools.partial + ++ def test_attributes_unwritable(self): ++ # attributes should not be writable ++ p = self.partial(capture, 1, 2, a=10, b=20) ++ self.assertRaises(AttributeError, setattr, p, 'func', map) ++ self.assertRaises(AttributeError, setattr, p, 'args', (1, 2)) ++ self.assertRaises(AttributeError, setattr, p, 'keywords', dict(a=1, b=2)) ++ ++ p = self.partial(hex) ++ try: ++ del p.__dict__ ++ except TypeError: ++ pass ++ else: ++ self.fail('partial object allowed __dict__ to be deleted') ++ + def test_repr(self): + args = (object(), object()) + args_repr = ', '.join(repr(a) for a in args) +@@ -1125,7 +1126,8 @@ + "Simple test" + return "Test" + self.assertEqual(g.__name__, "g") +- self.assertEqual(g.__doc__, "Simple test") ++ if sys.flags.optimize < 2: ++ self.assertEqual(g.__doc__, "Simple test") + + @unittest.skipUnless(decimal, 'requires _decimal') + @support.cpython_only +diff -r 3405dc9a6afa Lib/test/test_gdb.py +--- a/Lib/test/test_gdb.py ++++ b/Lib/test/test_gdb.py +@@ -170,6 +170,9 @@ + 'Do you need "set solib-search-path" or ' + '"set sysroot"?', + 'warning: Source file is more recent than executable.', ++ # Issue #19753: missing symbols on System Z ++ 'Missing separate debuginfo for ', ++ 'Try: zypper install -C ', + ) + for line in errlines: + if not line.startswith(ignore_patterns): +diff -r 3405dc9a6afa Lib/test/test_getargs2.py +--- a/Lib/test/test_getargs2.py ++++ b/Lib/test/test_getargs2.py +@@ -52,12 +52,34 @@ + def __int__(self): + return 99 + ++class IntSubclass(int): ++ def __int__(self): ++ return 99 ++ ++class BadInt: ++ def __int__(self): ++ return 1.0 ++ ++class BadInt2: ++ def __int__(self): ++ return True ++ ++class BadInt3(int): ++ def __int__(self): ++ return True ++ ++ + class Unsigned_TestCase(unittest.TestCase): + def test_b(self): + from _testcapi import getargs_b + # b returns 'unsigned char', and does range checking (0 ... UCHAR_MAX) + self.assertRaises(TypeError, getargs_b, 3.14) + self.assertEqual(99, getargs_b(Int())) ++ self.assertEqual(0, getargs_b(IntSubclass())) ++ self.assertRaises(TypeError, getargs_b, BadInt()) ++ with self.assertWarns(DeprecationWarning): ++ self.assertEqual(1, getargs_b(BadInt2())) ++ self.assertEqual(0, getargs_b(BadInt3())) + + self.assertRaises(OverflowError, getargs_b, -1) + self.assertEqual(0, getargs_b(0)) +@@ -72,6 +94,11 @@ + # B returns 'unsigned char', no range checking + self.assertRaises(TypeError, getargs_B, 3.14) + self.assertEqual(99, getargs_B(Int())) ++ self.assertEqual(0, getargs_B(IntSubclass())) ++ self.assertRaises(TypeError, getargs_B, BadInt()) ++ with self.assertWarns(DeprecationWarning): ++ self.assertEqual(1, getargs_B(BadInt2())) ++ self.assertEqual(0, getargs_B(BadInt3())) + + self.assertEqual(UCHAR_MAX, getargs_B(-1)) + self.assertEqual(0, getargs_B(0)) +@@ -86,6 +113,11 @@ + # H returns 'unsigned short', no range checking + self.assertRaises(TypeError, getargs_H, 3.14) + self.assertEqual(99, getargs_H(Int())) ++ self.assertEqual(0, getargs_H(IntSubclass())) ++ self.assertRaises(TypeError, getargs_H, BadInt()) ++ with self.assertWarns(DeprecationWarning): ++ self.assertEqual(1, getargs_H(BadInt2())) ++ self.assertEqual(0, getargs_H(BadInt3())) + + self.assertEqual(USHRT_MAX, getargs_H(-1)) + self.assertEqual(0, getargs_H(0)) +@@ -101,6 +133,11 @@ + # I returns 'unsigned int', no range checking + self.assertRaises(TypeError, getargs_I, 3.14) + self.assertEqual(99, getargs_I(Int())) ++ self.assertEqual(0, getargs_I(IntSubclass())) ++ self.assertRaises(TypeError, getargs_I, BadInt()) ++ with self.assertWarns(DeprecationWarning): ++ self.assertEqual(1, getargs_I(BadInt2())) ++ self.assertEqual(0, getargs_I(BadInt3())) + + self.assertEqual(UINT_MAX, getargs_I(-1)) + self.assertEqual(0, getargs_I(0)) +@@ -117,6 +154,10 @@ + # it does not accept float, or instances with __int__ + self.assertRaises(TypeError, getargs_k, 3.14) + self.assertRaises(TypeError, getargs_k, Int()) ++ self.assertEqual(0, getargs_k(IntSubclass())) ++ self.assertRaises(TypeError, getargs_k, BadInt()) ++ self.assertRaises(TypeError, getargs_k, BadInt2()) ++ self.assertEqual(0, getargs_k(BadInt3())) + + self.assertEqual(ULONG_MAX, getargs_k(-1)) + self.assertEqual(0, getargs_k(0)) +@@ -133,6 +174,11 @@ + # h returns 'short', and does range checking (SHRT_MIN ... SHRT_MAX) + self.assertRaises(TypeError, getargs_h, 3.14) + self.assertEqual(99, getargs_h(Int())) ++ self.assertEqual(0, getargs_h(IntSubclass())) ++ self.assertRaises(TypeError, getargs_h, BadInt()) ++ with self.assertWarns(DeprecationWarning): ++ self.assertEqual(1, getargs_h(BadInt2())) ++ self.assertEqual(0, getargs_h(BadInt3())) + + self.assertRaises(OverflowError, getargs_h, SHRT_MIN-1) + self.assertEqual(SHRT_MIN, getargs_h(SHRT_MIN)) +@@ -147,6 +193,11 @@ + # i returns 'int', and does range checking (INT_MIN ... INT_MAX) + self.assertRaises(TypeError, getargs_i, 3.14) + self.assertEqual(99, getargs_i(Int())) ++ self.assertEqual(0, getargs_i(IntSubclass())) ++ self.assertRaises(TypeError, getargs_i, BadInt()) ++ with self.assertWarns(DeprecationWarning): ++ self.assertEqual(1, getargs_i(BadInt2())) ++ self.assertEqual(0, getargs_i(BadInt3())) + + self.assertRaises(OverflowError, getargs_i, INT_MIN-1) + self.assertEqual(INT_MIN, getargs_i(INT_MIN)) +@@ -161,6 +212,11 @@ + # l returns 'long', and does range checking (LONG_MIN ... LONG_MAX) + self.assertRaises(TypeError, getargs_l, 3.14) + self.assertEqual(99, getargs_l(Int())) ++ self.assertEqual(0, getargs_l(IntSubclass())) ++ self.assertRaises(TypeError, getargs_l, BadInt()) ++ with self.assertWarns(DeprecationWarning): ++ self.assertEqual(1, getargs_l(BadInt2())) ++ self.assertEqual(0, getargs_l(BadInt3())) + + self.assertRaises(OverflowError, getargs_l, LONG_MIN-1) + self.assertEqual(LONG_MIN, getargs_l(LONG_MIN)) +@@ -176,6 +232,10 @@ + # (PY_SSIZE_T_MIN ... PY_SSIZE_T_MAX) + self.assertRaises(TypeError, getargs_n, 3.14) + self.assertRaises(TypeError, getargs_n, Int()) ++ self.assertEqual(0, getargs_n(IntSubclass())) ++ self.assertRaises(TypeError, getargs_n, BadInt()) ++ self.assertRaises(TypeError, getargs_n, BadInt2()) ++ self.assertEqual(0, getargs_n(BadInt3())) + + self.assertRaises(OverflowError, getargs_n, PY_SSIZE_T_MIN-1) + self.assertEqual(PY_SSIZE_T_MIN, getargs_n(PY_SSIZE_T_MIN)) +@@ -195,6 +255,11 @@ + self.assertRaises(TypeError, getargs_L, 3.14) + self.assertRaises(TypeError, getargs_L, "Hello") + self.assertEqual(99, getargs_L(Int())) ++ self.assertEqual(0, getargs_L(IntSubclass())) ++ self.assertRaises(TypeError, getargs_L, BadInt()) ++ with self.assertWarns(DeprecationWarning): ++ self.assertEqual(1, getargs_L(BadInt2())) ++ self.assertEqual(0, getargs_L(BadInt3())) + + self.assertRaises(OverflowError, getargs_L, LLONG_MIN-1) + self.assertEqual(LLONG_MIN, getargs_L(LLONG_MIN)) +@@ -209,6 +274,11 @@ + # K return 'unsigned long long', no range checking + self.assertRaises(TypeError, getargs_K, 3.14) + self.assertRaises(TypeError, getargs_K, Int()) ++ self.assertEqual(0, getargs_K(IntSubclass())) ++ self.assertRaises(TypeError, getargs_K, BadInt()) ++ self.assertRaises(TypeError, getargs_K, BadInt2()) ++ self.assertEqual(0, getargs_K(BadInt3())) ++ + self.assertEqual(ULLONG_MAX, getargs_K(ULLONG_MAX)) + self.assertEqual(0, getargs_K(0)) + self.assertEqual(0, getargs_K(ULLONG_MAX+1)) +diff -r 3405dc9a6afa Lib/test/test_grp.py +--- a/Lib/test/test_grp.py ++++ b/Lib/test/test_grp.py +@@ -26,8 +26,10 @@ + for e in entries: + self.check_value(e) + ++ def test_values_extended(self): ++ entries = grp.getgrall() + if len(entries) > 1000: # Huge group file (NIS?) -- skip the rest +- return ++ self.skipTest('huge group file, extended test skipped') + + for e in entries: + e2 = grp.getgrgid(e.gr_gid) +diff -r 3405dc9a6afa Lib/test/test_hmac.py +--- a/Lib/test/test_hmac.py ++++ b/Lib/test/test_hmac.py +@@ -1,9 +1,21 @@ ++import functools + import hmac + import hashlib + import unittest + import warnings + from test import support + ++ ++def ignore_warning(func): ++ @functools.wraps(func) ++ def wrapper(*args, **kwargs): ++ with warnings.catch_warnings(): ++ warnings.filterwarnings("ignore", ++ category=PendingDeprecationWarning) ++ return func(*args, **kwargs) ++ return wrapper ++ ++ + class TestVectorsTestCase(unittest.TestCase): + + def test_md5_vectors(self): +@@ -264,56 +276,63 @@ + + class ConstructorTestCase(unittest.TestCase): + ++ @ignore_warning + def test_normal(self): + # Standard constructor call. + failed = 0 + try: + h = hmac.HMAC(b"key") +- except: ++ except Exception: + self.fail("Standard constructor call raised exception.") + ++ @ignore_warning + def test_with_str_key(self): + # Pass a key of type str, which is an error, because it expects a key + # of type bytes + with self.assertRaises(TypeError): + h = hmac.HMAC("key") + ++ @ignore_warning + def test_dot_new_with_str_key(self): + # Pass a key of type str, which is an error, because it expects a key + # of type bytes + with self.assertRaises(TypeError): + h = hmac.new("key") + ++ @ignore_warning + def test_withtext(self): + # Constructor call with text. + try: + h = hmac.HMAC(b"key", b"hash this!") +- except: ++ except Exception: + self.fail("Constructor call with text argument raised exception.") ++ self.assertEqual(h.hexdigest(), '34325b639da4cfd95735b381e28cb864') + + def test_with_bytearray(self): + try: +- h = hmac.HMAC(bytearray(b"key"), bytearray(b"hash this!")) +- self.assertEqual(h.hexdigest(), '34325b639da4cfd95735b381e28cb864') +- except: ++ h = hmac.HMAC(bytearray(b"key"), bytearray(b"hash this!"), ++ digestmod="md5") ++ except Exception: + self.fail("Constructor call with bytearray arguments raised exception.") ++ self.assertEqual(h.hexdigest(), '34325b639da4cfd95735b381e28cb864') + + def test_with_memoryview_msg(self): + try: +- h = hmac.HMAC(b"key", memoryview(b"hash this!")) +- self.assertEqual(h.hexdigest(), '34325b639da4cfd95735b381e28cb864') +- except: ++ h = hmac.HMAC(b"key", memoryview(b"hash this!"), digestmod="md5") ++ except Exception: + self.fail("Constructor call with memoryview msg raised exception.") ++ self.assertEqual(h.hexdigest(), '34325b639da4cfd95735b381e28cb864') + + def test_withmodule(self): + # Constructor call with text and digest module. + try: + h = hmac.HMAC(b"key", b"", hashlib.sha1) +- except: ++ except Exception: + self.fail("Constructor call with hashlib.sha1 raised exception.") + + class SanityTestCase(unittest.TestCase): + ++ @ignore_warning + def test_default_is_md5(self): + # Testing if HMAC defaults to MD5 algorithm. + # NOTE: this whitebox test depends on the hmac class internals +@@ -324,19 +343,19 @@ + # Exercising all methods once. + # This must not raise any exceptions + try: +- h = hmac.HMAC(b"my secret key") ++ h = hmac.HMAC(b"my secret key", digestmod="md5") + h.update(b"compute the hash of this text!") + dig = h.digest() + dig = h.hexdigest() + h2 = h.copy() +- except: ++ except Exception: + self.fail("Exception raised during normal usage of HMAC class.") + + class CopyTestCase(unittest.TestCase): + + def test_attributes(self): + # Testing if attributes are of same type. +- h1 = hmac.HMAC(b"key") ++ h1 = hmac.HMAC(b"key", digestmod="md5") + h2 = h1.copy() + self.assertTrue(h1.digest_cons == h2.digest_cons, + "digest constructors don't match.") +@@ -347,7 +366,7 @@ + + def test_realcopy(self): + # Testing if the copy method created a real copy. +- h1 = hmac.HMAC(b"key") ++ h1 = hmac.HMAC(b"key", digestmod="md5") + h2 = h1.copy() + # Using id() in case somebody has overridden __eq__/__ne__. + self.assertTrue(id(h1) != id(h2), "No real copy of the HMAC instance.") +@@ -358,7 +377,7 @@ + + def test_equality(self): + # Testing if the copy has the same digests. +- h1 = hmac.HMAC(b"key") ++ h1 = hmac.HMAC(b"key", digestmod="md5") + h1.update(b"some random text") + h2 = h1.copy() + self.assertEqual(h1.digest(), h2.digest(), +diff -r 3405dc9a6afa Lib/test/test_httplib.py +--- a/Lib/test/test_httplib.py ++++ b/Lib/test/test_httplib.py +@@ -164,6 +164,9 @@ + sock = FakeSocket(body) + resp = client.HTTPResponse(sock) + resp.begin() ++ self.assertEqual(resp.read(0), b'') # Issue #20007 ++ self.assertFalse(resp.isclosed()) ++ self.assertFalse(resp.closed) + self.assertEqual(resp.read(), b"Text") + self.assertTrue(resp.isclosed()) + self.assertFalse(resp.closed) +diff -r 3405dc9a6afa Lib/test/test_imaplib.py +--- a/Lib/test/test_imaplib.py ++++ b/Lib/test/test_imaplib.py +@@ -18,8 +18,12 @@ + import ssl + except ImportError: + ssl = None ++ HAS_SNI = False ++else: ++ from ssl import HAS_SNI + + CERTFILE = None ++CAFILE = None + + + class TestImaplib(unittest.TestCase): +@@ -210,13 +214,12 @@ + + @contextmanager + def reaped_pair(self, hdlr): +- server, thread = self.make_server((support.HOST, 0), hdlr) +- client = self.imap_class(*server.server_address) +- try: +- yield server, client +- finally: +- client.logout() +- self.reap_server(server, thread) ++ with self.reaped_server(hdlr) as server: ++ client = self.imap_class(*server.server_address) ++ try: ++ yield server, client ++ finally: ++ client.logout() + + @reap_threads + def test_connect(self): +@@ -348,6 +351,26 @@ + server_class = SecureTCPServer + imap_class = IMAP4_SSL + ++ @reap_threads ++ @unittest.skipUnless(HAS_SNI, 'No SNI support in ssl module') ++ def test_ssl_verified(self): ++ ssl_context = ssl.SSLContext(ssl.PROTOCOL_SSLv23) ++ ssl_context.verify_mode = ssl.CERT_REQUIRED ++ ssl_context.check_hostname = True ++ ssl_context.load_verify_locations(CAFILE) ++ ++ with self.assertRaisesRegex(ssl.CertificateError, ++ "hostname '127.0.0.1' doesn't match 'localhost'"): ++ with self.reaped_server(SimpleIMAPHandler) as server: ++ client = self.imap_class(*server.server_address, ++ ssl_context=ssl_context) ++ client.shutdown() ++ ++ with self.reaped_server(SimpleIMAPHandler) as server: ++ client = self.imap_class("localhost", server.server_address[1], ++ ssl_context=ssl_context) ++ client.shutdown() ++ + + class RemoteIMAPTest(unittest.TestCase): + host = 'cyrus.andrew.cmu.edu' +@@ -460,11 +483,15 @@ + + if support.is_resource_enabled('network'): + if ssl: +- global CERTFILE ++ global CERTFILE, CAFILE + CERTFILE = os.path.join(os.path.dirname(__file__) or os.curdir, +- "keycert.pem") ++ "keycert3.pem") + if not os.path.exists(CERTFILE): + raise support.TestFailed("Can't read certificate files!") ++ CAFILE = os.path.join(os.path.dirname(__file__) or os.curdir, ++ "pycacert.pem") ++ if not os.path.exists(CAFILE): ++ raise support.TestFailed("Can't read CA file!") + tests.extend([ + ThreadedNetworkedTests, ThreadedNetworkedTestsSSL, + RemoteIMAPTest, RemoteIMAP_SSLTest, RemoteIMAP_STARTTLSTest, +diff -r 3405dc9a6afa Lib/test/test_imp.py +--- a/Lib/test/test_imp.py ++++ b/Lib/test/test_imp.py +@@ -272,7 +272,7 @@ + if found[0] is not None: + found[0].close() + if found[2][2] != imp.C_EXTENSION: +- return ++ self.skipTest("found module doesn't appear to be a C extension") + imp.load_module(name, None, *found[1:]) + + @unittest.skipIf(sys.dont_write_bytecode, +diff -r 3405dc9a6afa Lib/test/test_importlib/builtin/test_loader.py +--- a/Lib/test/test_importlib/builtin/test_loader.py ++++ b/Lib/test/test_importlib/builtin/test_loader.py +@@ -9,78 +9,6 @@ + import unittest + + +-class ExecModTests(abc.LoaderTests): +- +- """Test exec_module() for built-in modules.""" +- +- @classmethod +- def setUpClass(cls): +- cls.verification = {'__name__': 'errno', '__package__': '', +- '__loader__': cls.machinery.BuiltinImporter} +- +- def verify(self, module): +- """Verify that the module matches against what it should have.""" +- self.assertIsInstance(module, types.ModuleType) +- for attr, value in self.verification.items(): +- self.assertEqual(getattr(module, attr), value) +- self.assertIn(module.__name__, sys.modules) +- self.assertTrue(hasattr(module, '__spec__')) +- self.assertEqual(module.__spec__.origin, 'built-in') +- +- def load_spec(self, name): +- spec = self.machinery.ModuleSpec(name, self.machinery.BuiltinImporter, +- origin='built-in') +- module = types.ModuleType(name) +- module.__spec__ = spec +- self.machinery.BuiltinImporter.exec_module(module) +- # Strictly not what exec_module() is supposed to do, but since +- # _imp.init_builtin() does this we can't get around it. +- return sys.modules[name] +- +- def test_module(self): +- # Common case. +- with util.uncache(builtin_util.NAME): +- module = self.load_spec(builtin_util.NAME) +- self.verify(module) +- self.assertIn('built-in', str(module)) +- +- # Built-in modules cannot be a package. +- test_package = None +- +- # Built-in modules cannot be a package. +- test_lacking_parent = None +- +- # Not way to force an import failure. +- test_state_after_failure = None +- +- def test_unloadable(self): +- name = 'dssdsdfff' +- assert name not in sys.builtin_module_names +- with self.assertRaises(ImportError) as cm: +- self.load_spec(name) +- self.assertEqual(cm.exception.name, name) +- +- def test_already_imported(self): +- # Using the name of a module already imported but not a built-in should +- # still fail. +- module_name = 'builtin_reload_test' +- assert module_name not in sys.builtin_module_names +- with util.uncache(module_name): +- module = types.ModuleType(module_name) +- spec = self.machinery.ModuleSpec(module_name, +- self.machinery.BuiltinImporter, +- origin='built-in') +- module.__spec__ = spec +- sys.modules[module_name] = module +- with self.assertRaises(ImportError) as cm: +- self.machinery.BuiltinImporter.exec_module(module) +- self.assertEqual(cm.exception.name, module_name) +- +- +-Frozen_ExecModTests, Source_ExecModTests = util.test_both(ExecModTests, +- machinery=[frozen_machinery, source_machinery]) +- +- + class LoaderTests(abc.LoaderTests): + + """Test load_module() for built-in modules.""" +diff -r 3405dc9a6afa Lib/test/test_importlib/extension/test_loader.py +--- a/Lib/test/test_importlib/extension/test_loader.py ++++ b/Lib/test/test_importlib/extension/test_loader.py +@@ -10,71 +10,6 @@ + import unittest + + +-class ExecModuleTests(abc.LoaderTests): +- +- """Test load_module() for extension modules.""" +- +- def setUp(self): +- self.loader = self.machinery.ExtensionFileLoader(ext_util.NAME, +- ext_util.FILEPATH) +- +- def exec_module(self, fullname): +- module = types.ModuleType(fullname) +- module.__spec__ = self.machinery.ModuleSpec(fullname, self.loader) +- self.loader.exec_module(module) +- return sys.modules[fullname] +- +- def test_exec_module_API(self): +- with self.assertRaises(ImportError): +- self.exec_module('XXX') +- +- +- def test_module(self): +- with util.uncache(ext_util.NAME): +- module = self.exec_module(ext_util.NAME) +- for attr, value in [('__name__', ext_util.NAME), +- ('__file__', ext_util.FILEPATH), +- ('__package__', '')]: +- given = getattr(module, attr) +- self.assertEqual(given, value, +- '{}: {!r} != {!r}'.format(attr, given, value)) +- self.assertIn(ext_util.NAME, sys.modules) +- self.assertIsInstance(module.__loader__, +- self.machinery.ExtensionFileLoader) +- +- # No extension module as __init__ available for testing. +- test_package = None +- +- # No extension module in a package available for testing. +- test_lacking_parent = None +- +- def test_module_reuse(self): +- with util.uncache(ext_util.NAME): +- module1 = self.exec_module(ext_util.NAME) +- module2 = self.exec_module(ext_util.NAME) +- self.assertIs(module1, module2) +- +- def test_state_after_failure(self): +- # No easy way to trigger a failure after a successful import. +- pass +- +- def test_unloadable(self): +- name = 'asdfjkl;' +- with self.assertRaises(ImportError) as cm: +- self.exec_module(name) +- self.assertEqual(cm.exception.name, name) +- +- def test_is_package(self): +- self.assertFalse(self.loader.is_package(ext_util.NAME)) +- for suffix in self.machinery.EXTENSION_SUFFIXES: +- path = os.path.join('some', 'path', 'pkg', '__init__' + suffix) +- loader = self.machinery.ExtensionFileLoader('pkg', path) +- self.assertTrue(loader.is_package('pkg')) +- +-Frozen_ExecModuleTests, Source_ExecModuleTests = util.test_both( +- ExecModuleTests, machinery=machinery) +- +- + class LoaderTests(abc.LoaderTests): + + """Test load_module() for extension modules.""" +diff -r 3405dc9a6afa Lib/test/test_importlib/import_/test___loader__.py +--- a/Lib/test/test_importlib/import_/test___loader__.py ++++ b/Lib/test/test_importlib/import_/test___loader__.py +@@ -1,3 +1,4 @@ ++from importlib import machinery + import sys + import types + import unittest +@@ -6,6 +7,27 @@ + from . import util as import_util + + ++class SpecLoaderMock: ++ ++ def find_spec(self, fullname, path=None, target=None): ++ return machinery.ModuleSpec(fullname, self) ++ ++ def exec_module(self, module): ++ pass ++ ++ ++class SpecLoaderAttributeTests: ++ ++ def test___loader__(self): ++ loader = SpecLoaderMock() ++ with util.uncache('blah'), util.import_state(meta_path=[loader]): ++ module = self.__import__('blah') ++ self.assertEqual(loader, module.__loader__) ++ ++Frozen_SpecTests, Source_SpecTests = util.test_both( ++ SpecLoaderAttributeTests, __import__=import_util.__import__) ++ ++ + class LoaderMock: + + def find_module(self, fullname, path=None): +diff -r 3405dc9a6afa Lib/test/test_importlib/import_/test___package__.py +--- a/Lib/test/test_importlib/import_/test___package__.py ++++ b/Lib/test/test_importlib/import_/test___package__.py +@@ -36,7 +36,7 @@ + + def test_using___package__(self): + # [__package__] +- with util.mock_modules('pkg.__init__', 'pkg.fake') as importer: ++ with self.mock_modules('pkg.__init__', 'pkg.fake') as importer: + with util.import_state(meta_path=[importer]): + self.__import__('pkg.fake') + module = self.__import__('', +@@ -49,7 +49,7 @@ + globals_ = {'__name__': 'pkg.fake', '__path__': []} + if package_as_None: + globals_['__package__'] = None +- with util.mock_modules('pkg.__init__', 'pkg.fake') as importer: ++ with self.mock_modules('pkg.__init__', 'pkg.fake') as importer: + with util.import_state(meta_path=[importer]): + self.__import__('pkg.fake') + module = self.__import__('', globals= globals_, +@@ -70,11 +70,20 @@ + with self.assertRaises(TypeError): + self.__import__('', globals, {}, ['relimport'], 1) + +-Frozen_UsingPackage, Source_UsingPackage = util.test_both( +- Using__package__, __import__=import_util.__import__) ++class Using__package__PEP302(Using__package__): ++ mock_modules = util.mock_modules + ++Frozen_UsingPackagePEP302, Source_UsingPackagePEP302 = util.test_both( ++ Using__package__PEP302, __import__=import_util.__import__) + +-class Setting__package__(unittest.TestCase): ++class Using__package__PEP302(Using__package__): ++ mock_modules = util.mock_spec ++ ++Frozen_UsingPackagePEP451, Source_UsingPackagePEP451 = util.test_both( ++ Using__package__PEP302, __import__=import_util.__import__) ++ ++ ++class Setting__package__: + + """Because __package__ is a new feature, it is not always set by a loader. + Import will set it as needed to help with the transition to relying on +@@ -90,7 +99,7 @@ + + # [top-level] + def test_top_level(self): +- with util.mock_modules('top_level') as mock: ++ with self.mock_modules('top_level') as mock: + with util.import_state(meta_path=[mock]): + del mock['top_level'].__package__ + module = self.__import__('top_level') +@@ -98,7 +107,7 @@ + + # [package] + def test_package(self): +- with util.mock_modules('pkg.__init__') as mock: ++ with self.mock_modules('pkg.__init__') as mock: + with util.import_state(meta_path=[mock]): + del mock['pkg'].__package__ + module = self.__import__('pkg') +@@ -106,13 +115,19 @@ + + # [submodule] + def test_submodule(self): +- with util.mock_modules('pkg.__init__', 'pkg.mod') as mock: ++ with self.mock_modules('pkg.__init__', 'pkg.mod') as mock: + with util.import_state(meta_path=[mock]): + del mock['pkg.mod'].__package__ + pkg = self.__import__('pkg.mod') + module = getattr(pkg, 'mod') + self.assertEqual(module.__package__, 'pkg') + ++class Setting__package__PEP302(Setting__package__, unittest.TestCase): ++ mock_modules = util.mock_modules ++ ++class Setting__package__PEP451(Setting__package__, unittest.TestCase): ++ mock_modules = util.mock_spec ++ + + if __name__ == '__main__': + unittest.main() +diff -r 3405dc9a6afa Lib/test/test_importlib/import_/test_api.py +--- a/Lib/test/test_importlib/import_/test_api.py ++++ b/Lib/test/test_importlib/import_/test_api.py +@@ -1,19 +1,37 @@ + from .. import util + from . import util as import_util ++ ++from importlib import machinery + import sys + import types + import unittest + ++PKG_NAME = 'fine' ++SUBMOD_NAME = 'fine.bogus' ++ ++ ++class BadSpecFinderLoader: ++ @classmethod ++ def find_spec(cls, fullname, path=None, target=None): ++ if fullname == SUBMOD_NAME: ++ spec = machinery.ModuleSpec(fullname, cls) ++ return spec ++ ++ @staticmethod ++ def exec_module(module): ++ if module.__name__ == SUBMOD_NAME: ++ raise ImportError('I cannot be loaded!') ++ + + class BadLoaderFinder: +- bad = 'fine.bogus' + @classmethod + def find_module(cls, fullname, path): +- if fullname == cls.bad: ++ if fullname == SUBMOD_NAME: + return cls ++ + @classmethod + def load_module(cls, fullname): +- if fullname == cls.bad: ++ if fullname == SUBMOD_NAME: + raise ImportError('I cannot be loaded!') + + +@@ -37,27 +55,39 @@ + def test_nonexistent_fromlist_entry(self): + # If something in fromlist doesn't exist, that's okay. + # issue15715 +- mod = types.ModuleType('fine') ++ mod = types.ModuleType(PKG_NAME) + mod.__path__ = ['XXX'] +- with util.import_state(meta_path=[BadLoaderFinder]): +- with util.uncache('fine'): +- sys.modules['fine'] = mod +- self.__import__('fine', fromlist=['not here']) ++ with util.import_state(meta_path=[self.bad_finder_loader]): ++ with util.uncache(PKG_NAME): ++ sys.modules[PKG_NAME] = mod ++ self.__import__(PKG_NAME, fromlist=['not here']) + + def test_fromlist_load_error_propagates(self): + # If something in fromlist triggers an exception not related to not + # existing, let that exception propagate. + # issue15316 +- mod = types.ModuleType('fine') ++ mod = types.ModuleType(PKG_NAME) + mod.__path__ = ['XXX'] +- with util.import_state(meta_path=[BadLoaderFinder]): +- with util.uncache('fine'): +- sys.modules['fine'] = mod ++ with util.import_state(meta_path=[self.bad_finder_loader]): ++ with util.uncache(PKG_NAME): ++ sys.modules[PKG_NAME] = mod + with self.assertRaises(ImportError): +- self.__import__('fine', fromlist=['bogus']) ++ self.__import__(PKG_NAME, ++ fromlist=[SUBMOD_NAME.rpartition('.')[-1]]) + +-Frozen_APITests, Source_APITests = util.test_both( +- APITest, __import__=import_util.__import__) ++ ++class OldAPITests(APITest): ++ bad_finder_loader = BadLoaderFinder ++ ++Frozen_OldAPITests, Source_OldAPITests = util.test_both( ++ OldAPITests, __import__=import_util.__import__) ++ ++ ++class SpecAPITests(APITest): ++ bad_finder_loader = BadSpecFinderLoader ++ ++Frozen_SpecAPITests, Source_SpecAPITests = util.test_both( ++ SpecAPITests, __import__=import_util.__import__) + + + if __name__ == '__main__': +diff -r 3405dc9a6afa Lib/test/test_importlib/import_/test_caching.py +--- a/Lib/test/test_importlib/import_/test_caching.py ++++ b/Lib/test/test_importlib/import_/test_caching.py +@@ -39,6 +39,16 @@ + self.__import__(name) + self.assertEqual(cm.exception.name, name) + ++Frozen_UseCache, Source_UseCache = util.test_both( ++ UseCache, __import__=import_util.__import__) ++ ++ ++class ImportlibUseCache(UseCache, unittest.TestCase): ++ ++ # Pertinent only to PEP 302; exec_module() doesn't return a module. ++ ++ __import__ = import_util.__import__[1] ++ + def create_mock(self, *names, return_=None): + mock = util.mock_modules(*names) + original_load = mock.load_module +@@ -48,14 +58,6 @@ + mock.load_module = MethodType(load_module, mock) + return mock + +-Frozen_UseCache, Source_UseCache = util.test_both( +- UseCache, __import__=import_util.__import__) +- +- +-class ImportlibUseCache(UseCache, unittest.TestCase): +- +- __import__ = import_util.__import__[1] +- + # __import__ inconsistent between loaders and built-in import when it comes + # to when to use the module in sys.modules and when not to. + def test_using_cache_after_loader(self): +diff -r 3405dc9a6afa Lib/test/test_importlib/import_/test_fromlist.py +--- a/Lib/test/test_importlib/import_/test_fromlist.py ++++ b/Lib/test/test_importlib/import_/test_fromlist.py +@@ -17,7 +17,7 @@ + + def test_return_from_import(self): + # [import return] +- with util.mock_modules('pkg.__init__', 'pkg.module') as importer: ++ with util.mock_spec('pkg.__init__', 'pkg.module') as importer: + with util.import_state(meta_path=[importer]): + module = self.__import__('pkg.module') + self.assertEqual(module.__name__, 'pkg') +diff -r 3405dc9a6afa Lib/test/test_importlib/import_/test_meta_path.py +--- a/Lib/test/test_importlib/import_/test_meta_path.py ++++ b/Lib/test/test_importlib/import_/test_meta_path.py +@@ -18,23 +18,18 @@ + def test_first_called(self): + # [first called] + mod = 'top_level' +- first = util.mock_modules(mod) +- second = util.mock_modules(mod) +- with util.mock_modules(mod) as first, util.mock_modules(mod) as second: +- first.modules[mod] = 42 +- second.modules[mod] = -13 ++ with util.mock_spec(mod) as first, util.mock_spec(mod) as second: + with util.import_state(meta_path=[first, second]): +- self.assertEqual(self.__import__(mod), 42) ++ self.assertIs(self.__import__(mod), first.modules[mod]) + + def test_continuing(self): + # [continuing] + mod_name = 'for_real' +- with util.mock_modules('nonexistent') as first, \ +- util.mock_modules(mod_name) as second: +- first.find_module = lambda self, fullname, path=None: None +- second.modules[mod_name] = 42 ++ with util.mock_spec('nonexistent') as first, \ ++ util.mock_spec(mod_name) as second: ++ first.find_spec = lambda self, fullname, path=None, parent=None: None + with util.import_state(meta_path=[first, second]): +- self.assertEqual(self.__import__(mod_name), 42) ++ self.assertIs(self.__import__(mod_name), second.modules[mod_name]) + + def test_empty(self): + # Raise an ImportWarning if sys.meta_path is empty. +@@ -61,29 +56,27 @@ + [no path]. Otherwise, the value for __path__ is passed in for the 'path' + argument [path set].""" + +- def log(self, fxn): ++ def log_finder(self, importer): ++ fxn = getattr(importer, self.finder_name) + log = [] + def wrapper(self, *args, **kwargs): + log.append([args, kwargs]) + return fxn(*args, **kwargs) + return log, wrapper + +- + def test_no_path(self): + # [no path] + mod_name = 'top_level' + assert '.' not in mod_name +- with util.mock_modules(mod_name) as importer: +- log, wrapped_call = self.log(importer.find_module) +- importer.find_module = MethodType(wrapped_call, importer) ++ with self.mock_modules(mod_name) as importer: ++ log, wrapped_call = self.log_finder(importer) ++ setattr(importer, self.finder_name, MethodType(wrapped_call, importer)) + with util.import_state(meta_path=[importer]): + self.__import__(mod_name) + assert len(log) == 1 + args = log[0][0] + kwargs = log[0][1] + # Assuming all arguments are positional. +- self.assertEqual(len(args), 2) +- self.assertEqual(len(kwargs), 0) + self.assertEqual(args[0], mod_name) + self.assertIsNone(args[1]) + +@@ -93,10 +86,10 @@ + mod_name = pkg_name + '.module' + path = [42] + assert '.' in mod_name +- with util.mock_modules(pkg_name+'.__init__', mod_name) as importer: ++ with self.mock_modules(pkg_name+'.__init__', mod_name) as importer: + importer.modules[pkg_name].__path__ = path +- log, wrapped_call = self.log(importer.find_module) +- importer.find_module = MethodType(wrapped_call, importer) ++ log, wrapped_call = self.log_finder(importer) ++ setattr(importer, self.finder_name, MethodType(wrapped_call, importer)) + with util.import_state(meta_path=[importer]): + self.__import__(mod_name) + assert len(log) == 2 +@@ -107,8 +100,19 @@ + self.assertEqual(args[0], mod_name) + self.assertIs(args[1], path) + +-Frozen_CallSignature, Source_CallSignature = util.test_both( +- CallSignature, __import__=import_util.__import__) ++class CallSignaturePEP302(CallSignature): ++ mock_modules = util.mock_modules ++ finder_name = 'find_module' ++ ++Frozen_CallSignaturePEP302, Source_CallSignaturePEP302 = util.test_both( ++ CallSignaturePEP302, __import__=import_util.__import__) ++ ++class CallSignaturePEP451(CallSignature): ++ mock_modules = util.mock_spec ++ finder_name = 'find_spec' ++ ++Frozen_CallSignaturePEP451, Source_CallSignaturePEP451 = util.test_both( ++ CallSignaturePEP451, __import__=import_util.__import__) + + + if __name__ == '__main__': +diff -r 3405dc9a6afa Lib/test/test_importlib/import_/test_packages.py +--- a/Lib/test/test_importlib/import_/test_packages.py ++++ b/Lib/test/test_importlib/import_/test_packages.py +@@ -11,13 +11,13 @@ + """Importing a submodule should import the parent modules.""" + + def test_import_parent(self): +- with util.mock_modules('pkg.__init__', 'pkg.module') as mock: ++ with util.mock_spec('pkg.__init__', 'pkg.module') as mock: + with util.import_state(meta_path=[mock]): + module = self.__import__('pkg.module') + self.assertIn('pkg', sys.modules) + + def test_bad_parent(self): +- with util.mock_modules('pkg.module') as mock: ++ with util.mock_spec('pkg.module') as mock: + with util.import_state(meta_path=[mock]): + with self.assertRaises(ImportError) as cm: + self.__import__('pkg.module') +@@ -27,7 +27,7 @@ + def __init__(): + import pkg.module + 1/0 +- mock = util.mock_modules('pkg.__init__', 'pkg.module', ++ mock = util.mock_spec('pkg.__init__', 'pkg.module', + module_code={'pkg': __init__}) + with mock: + with util.import_state(meta_path=[mock]): +@@ -44,7 +44,7 @@ + def __init__(): + from . import module + 1/0 +- mock = util.mock_modules('pkg.__init__', 'pkg.module', ++ mock = util.mock_spec('pkg.__init__', 'pkg.module', + module_code={'pkg': __init__}) + with mock: + with util.import_state(meta_path=[mock]): +@@ -63,7 +63,7 @@ + def __init__(): + from ..subpkg import module + 1/0 +- mock = util.mock_modules('pkg.__init__', 'pkg.subpkg.__init__', ++ mock = util.mock_spec('pkg.__init__', 'pkg.subpkg.__init__', + 'pkg.subpkg.module', + module_code={'pkg.subpkg': __init__}) + with mock: +@@ -93,9 +93,9 @@ + subname = name + '.b' + def module_injection(): + sys.modules[subname] = 'total bunk' +- mock_modules = util.mock_modules('mod', ++ mock_spec = util.mock_spec('mod', + module_code={'mod': module_injection}) +- with mock_modules as mock: ++ with mock_spec as mock: + with util.import_state(meta_path=[mock]): + try: + submodule = self.__import__(subname) +diff -r 3405dc9a6afa Lib/test/test_importlib/import_/test_path.py +--- a/Lib/test/test_importlib/import_/test_path.py ++++ b/Lib/test/test_importlib/import_/test_path.py +@@ -17,7 +17,7 @@ + """Tests for PathFinder.""" + + def test_failure(self): +- # Test None returned upon not finding a suitable finder. ++ # Test None returned upon not finding a suitable loader. + module = '' + with util.import_state(): + self.assertIsNone(self.machinery.PathFinder.find_module(module)) +@@ -27,7 +27,7 @@ + # Implicitly tests that sys.path_importer_cache is used. + module = '' + path = '' +- importer = util.mock_modules(module) ++ importer = util.mock_spec(module) + with util.import_state(path_importer_cache={path: importer}, + path=[path]): + loader = self.machinery.PathFinder.find_module(module) +@@ -38,7 +38,7 @@ + # Implicitly tests that sys.path_importer_cache is used. + module = '' + path = '' +- importer = util.mock_modules(module) ++ importer = util.mock_spec(module) + with util.import_state(path_importer_cache={path: importer}): + loader = self.machinery.PathFinder.find_module(module, [path]) + self.assertIs(loader, importer) +@@ -47,7 +47,7 @@ + # An empty list should not count as asking for sys.path. + module = 'module' + path = '' +- importer = util.mock_modules(module) ++ importer = util.mock_spec(module) + with util.import_state(path_importer_cache={path: importer}, + path=[path]): + self.assertIsNone(self.machinery.PathFinder.find_module('module', [])) +@@ -57,7 +57,7 @@ + # Test that sys.path_importer_cache is set. + module = '' + path = '' +- importer = util.mock_modules(module) ++ importer = util.mock_spec(module) + hook = import_util.mock_path_hook(path, importer=importer) + with util.import_state(path_hooks=[hook]): + loader = self.machinery.PathFinder.find_module(module, [path]) +@@ -82,7 +82,7 @@ + # The empty string should create a finder using the cwd. + path = '' + module = '' +- importer = util.mock_modules(module) ++ importer = util.mock_spec(module) + hook = import_util.mock_path_hook(os.getcwd(), importer=importer) + with util.import_state(path=[path], path_hooks=[hook]): + loader = self.machinery.PathFinder.find_module(module) +diff -r 3405dc9a6afa Lib/test/test_importlib/import_/test_relative_imports.py +--- a/Lib/test/test_importlib/import_/test_relative_imports.py ++++ b/Lib/test/test_importlib/import_/test_relative_imports.py +@@ -64,7 +64,7 @@ + uncache_names.append(name) + else: + uncache_names.append(name[:-len('.__init__')]) +- with util.mock_modules(*create) as importer: ++ with util.mock_spec(*create) as importer: + with util.import_state(meta_path=[importer]): + for global_ in globals_: + with util.uncache(*uncache_names): +diff -r 3405dc9a6afa Lib/test/test_importlib/source/test_case_sensitivity.py +--- a/Lib/test/test_importlib/source/test_case_sensitivity.py ++++ b/Lib/test/test_importlib/source/test_case_sensitivity.py +@@ -21,13 +21,12 @@ + name = 'MoDuLe' + assert name != name.lower() + +- def find(self, path): +- finder = self.machinery.FileFinder(path, ++ def finder(self, path): ++ return self.machinery.FileFinder(path, + (self.machinery.SourceFileLoader, + self.machinery.SOURCE_SUFFIXES), + (self.machinery.SourcelessFileLoader, + self.machinery.BYTECODE_SUFFIXES)) +- return finder.find_module(self.name) + + def sensitivity_test(self): + """Look for a module with matching and non-matching sensitivity.""" +@@ -37,7 +36,9 @@ + with context as mapping: + sensitive_path = os.path.join(mapping['.root'], 'sensitive') + insensitive_path = os.path.join(mapping['.root'], 'insensitive') +- return self.find(sensitive_path), self.find(insensitive_path) ++ sensitive_finder = self.finder(sensitive_path) ++ insensitive_finder = self.finder(insensitive_path) ++ return self.find(sensitive_finder), self.find(insensitive_finder) + + def test_sensitive(self): + with test_support.EnvironmentVarGuard() as env: +@@ -46,7 +47,7 @@ + self.skipTest('os.environ changes not reflected in ' + '_os.environ') + sensitive, insensitive = self.sensitivity_test() +- self.assertTrue(hasattr(sensitive, 'load_module')) ++ self.assertIsNotNone(sensitive) + self.assertIn(self.name, sensitive.get_filename(self.name)) + self.assertIsNone(insensitive) + +@@ -57,13 +58,25 @@ + self.skipTest('os.environ changes not reflected in ' + '_os.environ') + sensitive, insensitive = self.sensitivity_test() +- self.assertTrue(hasattr(sensitive, 'load_module')) ++ self.assertIsNotNone(sensitive) + self.assertIn(self.name, sensitive.get_filename(self.name)) +- self.assertTrue(hasattr(insensitive, 'load_module')) ++ self.assertIsNotNone(insensitive) + self.assertIn(self.name, insensitive.get_filename(self.name)) + +-Frozen_CaseSensitivityTest, Source_CaseSensitivityTest = util.test_both( +- CaseSensitivityTest, importlib=importlib, machinery=machinery) ++class CaseSensitivityTestPEP302(CaseSensitivityTest): ++ def find(self, finder): ++ return finder.find_module(self.name) ++ ++Frozen_CaseSensitivityTestPEP302, Source_CaseSensitivityTestPEP302 = util.test_both( ++ CaseSensitivityTestPEP302, importlib=importlib, machinery=machinery) ++ ++class CaseSensitivityTestPEP451(CaseSensitivityTest): ++ def find(self, finder): ++ found = finder.find_spec(self.name) ++ return found.loader if found is not None else found ++ ++Frozen_CaseSensitivityTestPEP451, Source_CaseSensitivityTestPEP451 = util.test_both( ++ CaseSensitivityTestPEP451, importlib=importlib, machinery=machinery) + + + if __name__ == '__main__': +diff -r 3405dc9a6afa Lib/test/test_importlib/source/test_file_loader.py +--- a/Lib/test/test_importlib/source/test_file_loader.py ++++ b/Lib/test/test_importlib/source/test_file_loader.py +@@ -121,6 +121,10 @@ + file.write('+++ bad syntax +++') + loader = self.machinery.SourceFileLoader('_temp', mapping['_temp']) + with self.assertRaises(SyntaxError): ++ loader.exec_module(orig_module) ++ for attr in attributes: ++ self.assertEqual(getattr(orig_module, attr), value) ++ with self.assertRaises(SyntaxError): + loader.load_module(name) + for attr in attributes: + self.assertEqual(getattr(orig_module, attr), value) +@@ -171,15 +175,27 @@ + raise + self.skipTest("cannot set modification time to large integer ({})".format(e)) + loader = self.machinery.SourceFileLoader('_temp', mapping['_temp']) +- mod = loader.load_module('_temp') ++ # PEP 451 ++ module = types.ModuleType('_temp') ++ module.__spec__ = self.util.spec_from_loader('_temp', loader) ++ loader.exec_module(module) ++ self.assertEqual(module.x, 5) ++ self.assertTrue(os.path.exists(compiled)) ++ os.unlink(compiled) ++ # PEP 302 ++ mod = loader.load_module('_temp') # XXX + # Sanity checks. + self.assertEqual(mod.__cached__, compiled) + self.assertEqual(mod.x, 5) + # The pyc file was created. +- os.stat(compiled) ++ self.assertTrue(os.path.exists(compiled)) + + def test_unloadable(self): + loader = self.machinery.SourceFileLoader('good name', {}) ++ module = types.ModuleType('bad name') ++ module.__spec__ = self.machinery.ModuleSpec('bad name', loader) ++ with self.assertRaises(ImportError): ++ loader.exec_module(module) + with self.assertRaises(ImportError): + loader.load_module('bad name') + +@@ -291,8 +307,23 @@ + lambda bc: b'\x00\x00\x00\x00' + bc[4:]) + test('_temp', mapping, bc_path) + ++class BadBytecodeTestPEP451(BadBytecodeTest): + +-class SourceLoaderBadBytecodeTest(BadBytecodeTest): ++ def import_(self, file, module_name): ++ loader = self.loader(module_name, file) ++ module = types.ModuleType(module_name) ++ module.__spec__ = self.util.spec_from_loader(module_name, loader) ++ loader.exec_module(module) ++ ++class BadBytecodeTestPEP302(BadBytecodeTest): ++ ++ def import_(self, file, module_name): ++ loader = self.loader(module_name, file) ++ module = loader.load_module(module_name) ++ self.assertIn(module_name, sys.modules) ++ ++ ++class SourceLoaderBadBytecodeTest: + + @classmethod + def setUpClass(cls): +@@ -418,12 +449,24 @@ + # Make writable for eventual clean-up. + os.chmod(bytecode_path, stat.S_IWUSR) + +-Frozen_SourceBadBytecode, Source_SourceBadBytecode = util.test_both( +- SourceLoaderBadBytecodeTest, importlib=importlib, machinery=machinery, ++class SourceLoaderBadBytecodeTestPEP451( ++ SourceLoaderBadBytecodeTest, BadBytecodeTestPEP451): ++ pass ++ ++Frozen_SourceBadBytecodePEP451, Source_SourceBadBytecodePEP451 = util.test_both( ++ SourceLoaderBadBytecodeTestPEP451, importlib=importlib, machinery=machinery, + abc=importlib_abc, util=importlib_util) + ++class SourceLoaderBadBytecodeTestPEP302( ++ SourceLoaderBadBytecodeTest, BadBytecodeTestPEP302): ++ pass + +-class SourcelessLoaderBadBytecodeTest(BadBytecodeTest): ++Frozen_SourceBadBytecodePEP302, Source_SourceBadBytecodePEP302 = util.test_both( ++ SourceLoaderBadBytecodeTestPEP302, importlib=importlib, machinery=machinery, ++ abc=importlib_abc, util=importlib_util) ++ ++ ++class SourcelessLoaderBadBytecodeTest: + + @classmethod + def setUpClass(cls): +@@ -482,8 +525,20 @@ + def test_non_code_marshal(self): + self._test_non_code_marshal(del_source=True) + +-Frozen_SourcelessBadBytecode, Source_SourcelessBadBytecode = util.test_both( +- SourcelessLoaderBadBytecodeTest, importlib=importlib, ++class SourcelessLoaderBadBytecodeTestPEP451(SourcelessLoaderBadBytecodeTest, ++ BadBytecodeTestPEP451): ++ pass ++ ++Frozen_SourcelessBadBytecodePEP451, Source_SourcelessBadBytecodePEP451 = util.test_both( ++ SourcelessLoaderBadBytecodeTestPEP451, importlib=importlib, ++ machinery=machinery, abc=importlib_abc, util=importlib_util) ++ ++class SourcelessLoaderBadBytecodeTestPEP302(SourcelessLoaderBadBytecodeTest, ++ BadBytecodeTestPEP302): ++ pass ++ ++Frozen_SourcelessBadBytecodePEP302, Source_SourcelessBadBytecodePEP302 = util.test_both( ++ SourcelessLoaderBadBytecodeTestPEP302, importlib=importlib, + machinery=machinery, abc=importlib_abc, util=importlib_util) + + +diff -r 3405dc9a6afa Lib/test/test_importlib/source/test_finder.py +--- a/Lib/test/test_importlib/source/test_finder.py ++++ b/Lib/test/test_importlib/source/test_finder.py +@@ -46,9 +46,6 @@ + self.machinery.BYTECODE_SUFFIXES)] + return self.machinery.FileFinder(root, *loader_details) + +- def import_(self, root, module): +- return self.get_finder(root).find_module(module) +- + def run_test(self, test, create=None, *, compile_=None, unlink=None): + """Test the finding of 'test' with the creation of modules listed in + 'create'. +@@ -182,7 +179,23 @@ + finder = self.get_finder(file_obj.name) + self.assertEqual((None, []), finder.find_loader('doesnotexist')) + +-Frozen_FinderTests, Source_FinderTests = util.test_both(FinderTests, machinery=machinery) ++class FinderTestsPEP451(FinderTests): ++ ++ def import_(self, root, module): ++ found = self.get_finder(root).find_spec(module) ++ return found.loader if found is not None else found ++ ++Frozen_FinderTestsPEP451, Source_FinderTestsPEP451 = util.test_both( ++ FinderTestsPEP451, machinery=machinery) ++ ++ ++class FinderTestsPEP302(FinderTests): ++ ++ def import_(self, root, module): ++ return self.get_finder(root).find_module(module) ++ ++Frozen_FinderTestsPEP302, Source_FinderTestsPEP302 = util.test_both( ++ FinderTestsPEP302, machinery=machinery) + + + +diff -r 3405dc9a6afa Lib/test/test_importlib/source/test_source_encoding.py +--- a/Lib/test/test_importlib/source/test_source_encoding.py ++++ b/Lib/test/test_importlib/source/test_source_encoding.py +@@ -4,8 +4,10 @@ + machinery = util.import_importlib('importlib.machinery') + + import codecs ++import importlib.util + import re + import sys ++import types + # Because sys.path gets essentially blanked, need to have unicodedata already + # imported for the parser to use. + import unicodedata +@@ -39,7 +41,7 @@ + file.write(source) + loader = self.machinery.SourceFileLoader(self.module_name, + mapping[self.module_name]) +- return loader.load_module(self.module_name) ++ return self.load(loader) + + def create_source(self, encoding): + encoding_line = "# coding={0}".format(encoding) +@@ -86,7 +88,24 @@ + with self.assertRaises(SyntaxError): + self.run_test(source) + +-Frozen_EncodingTest, Source_EncodingTest = util.test_both(EncodingTest, machinery=machinery) ++class EncodingTestPEP451(EncodingTest): ++ ++ def load(self, loader): ++ module = types.ModuleType(self.module_name) ++ module.__spec__ = importlib.util.spec_from_loader(self.module_name, loader) ++ loader.exec_module(module) ++ return module ++ ++Frozen_EncodingTestPEP451, Source_EncodingTestPEP451 = util.test_both( ++ EncodingTestPEP451, machinery=machinery) ++ ++class EncodingTestPEP302(EncodingTest): ++ ++ def load(self, loader): ++ return loader.load_module(self.module_name) ++ ++Frozen_EncodingTestPEP302, Source_EncodingTestPEP302 = util.test_both( ++ EncodingTestPEP302, machinery=machinery) + + + class LineEndingTest: +@@ -117,8 +136,24 @@ + def test_lf(self): + self.run_test(b'\n') + +-Frozen_LineEndings, Source_LineEndings = util.test_both(LineEndingTest, machinery=machinery) ++class LineEndingTestPEP451(LineEndingTest): + ++ def load(self, loader): ++ module = types.ModuleType(self.module_name) ++ module.__spec__ = importlib.util.spec_from_loader(self.module_name, loader) ++ loader.exec_module(module) ++ return module ++ ++Frozen_LineEndingTestPEP451, Source_LineEndingTestPEP451 = util.test_both( ++ LineEndingTestPEP451, machinery=machinery) ++ ++class LineEndingTestPEP302(LineEndingTest): ++ ++ def load(self, loader): ++ return loader.load_module(self.module_name) ++ ++Frozen_LineEndingTestPEP302, Source_LineEndingTestPEP302 = util.test_both( ++ LineEndingTestPEP302, machinery=machinery) + + + if __name__ == '__main__': +diff -r 3405dc9a6afa Lib/test/test_importlib/test_api.py +--- a/Lib/test/test_importlib/test_api.py ++++ b/Lib/test/test_importlib/test_api.py +@@ -4,6 +4,7 @@ + frozen_util, source_util = util.import_importlib('importlib.util') + frozen_machinery, source_machinery = util.import_importlib('importlib.machinery') + ++from contextlib import contextmanager + import os.path + import sys + from test import support +@@ -11,6 +12,37 @@ + import unittest + + ++@contextmanager ++def temp_module(name, content='', *, pkg=False): ++ conflicts = [n for n in sys.modules if n.partition('.')[0] == name] ++ with support.temp_cwd(None) as cwd: ++ with util.uncache(name, *conflicts): ++ with support.DirsOnSysPath(cwd): ++ frozen_init.invalidate_caches() ++ ++ location = os.path.join(cwd, name) ++ if pkg: ++ modpath = os.path.join(location, '__init__.py') ++ os.mkdir(name) ++ else: ++ modpath = location + '.py' ++ if content is None: ++ # Make sure the module file gets created. ++ content = '' ++ if content is not None: ++ # not a namespace package ++ with open(modpath, 'w') as modfile: ++ modfile.write(content) ++ yield location ++ ++ ++def submodule(parent, name, pkg_dir, content=''): ++ path = os.path.join(pkg_dir, name + '.py') ++ with open(path, 'w') as subfile: ++ subfile.write(content) ++ return '{}.{}'.format(parent, name), path ++ ++ + class ImportModuleTests: + + """Test importlib.import_module.""" +@@ -246,6 +278,32 @@ + # None is returned upon failure to find a loader. + self.assertIsNone(self.init.find_spec('nevergoingtofindthismodule')) + ++ def test_find_submodule(self): ++ name = 'spam' ++ subname = 'ham' ++ with temp_module(name, pkg=True) as pkg_dir: ++ fullname, _ = submodule(name, subname, pkg_dir) ++ spec = self.init.find_spec(fullname, [pkg_dir]) ++ self.assertIsNot(spec, None) ++ self.assertNotIn(name, sorted(sys.modules)) ++ # Ensure successive calls behave the same. ++ spec_again = self.init.find_spec(fullname, [pkg_dir]) ++ # XXX Once #19927 is resolved, uncomment this line. ++ #self.assertEqual(spec_again, spec) ++ ++ def test_find_submodule_missing_path(self): ++ name = 'spam' ++ subname = 'ham' ++ with temp_module(name, pkg=True) as pkg_dir: ++ fullname, _ = submodule(name, subname, pkg_dir) ++ spec = self.init.find_spec(fullname) ++ self.assertIs(spec, None) ++ self.assertNotIn(name, sorted(sys.modules)) ++ # Ensure successive calls behave the same. ++ spec = self.init.find_spec(fullname) ++ self.assertIs(spec, None) ++ ++ + class Frozen_FindSpecTests(FindSpecTests, unittest.TestCase): + init = frozen_init + machinery = frozen_machinery +@@ -410,6 +468,16 @@ + self.assertEqual(loader.path, init_path) + self.assertEqual(ns, expected) + ++ def test_reload_submodule(self): ++ # See #19851. ++ name = 'spam' ++ subname = 'ham' ++ with temp_module(name, pkg=True) as pkg_dir: ++ fullname, _ = submodule(name, subname, pkg_dir) ++ ham = self.init.import_module(fullname) ++ reloaded = self.init.reload(ham) ++ self.assertIs(reloaded, ham) ++ + + class Frozen_ReloadTests(ReloadTests, unittest.TestCase): + init = frozen_init +diff -r 3405dc9a6afa Lib/test/test_importlib/test_spec.py +--- a/Lib/test/test_importlib/test_spec.py ++++ b/Lib/test/test_importlib/test_spec.py +@@ -10,19 +10,13 @@ + from test.support import CleanImport + import unittest + import sys ++import warnings + + + + class TestLoader: + + def __init__(self, path=None, is_package=None): +-# if path: +-# if is_package: +-# if not path.endswith('.py'): +-# path = os.path.join(path, '__init__.py') +-# elif is_package is None: +-# is_package = path.endswith('__init__.py') +- + self.path = path + self.package = is_package + +@@ -55,10 +49,13 @@ + + HAM = -1 + +- @frozen_util.module_for_loader +- def load_module(self, module): +- module.ham = self.HAM +- return module ++ with warnings.catch_warnings(): ++ warnings.simplefilter("ignore", PendingDeprecationWarning) ++ ++ @frozen_util.module_for_loader ++ def load_module(self, module): ++ module.ham = self.HAM ++ return module + + + class ModuleSpecTests: +@@ -119,6 +116,13 @@ + self.assertIs(spec.cached, None) + self.assertFalse(spec.has_location) + ++ def test_has_location_setter(self): ++ spec = self.machinery.ModuleSpec(self.name, self.loader, ++ origin='somewhere') ++ self.assertFalse(spec.has_location) ++ spec.has_location = True ++ self.assertTrue(spec.has_location) ++ + def test_equality(self): + other = type(sys.implementation)(name=self.name, + loader=self.loader, +@@ -550,9 +554,6 @@ + + class ModuleReprTests: + +- # XXX Add more tests for repr(module) once ModuleSpec._module_repr() +- # is in place? +- + def setUp(self): + self.module = type(os)('spam') + self.spec = self.machinery.ModuleSpec('spam', TestLoader()) +diff -r 3405dc9a6afa Lib/test/test_importlib/util.py +--- a/Lib/test/test_importlib/util.py ++++ b/Lib/test/test_importlib/util.py +@@ -1,4 +1,5 @@ + from contextlib import contextmanager ++from importlib import util + import os.path + from test import support + import unittest +@@ -101,9 +102,9 @@ + setattr(sys, attr, value) + + +-class mock_modules: ++class _ImporterMock: + +- """A mock importer/loader.""" ++ """Base class to help with creating importer mocks.""" + + def __init__(self, *names, module_code={}): + self.modules = {} +@@ -133,6 +134,19 @@ + def __getitem__(self, name): + return self.modules[name] + ++ def __enter__(self): ++ self._uncache = uncache(*self.modules.keys()) ++ self._uncache.__enter__() ++ return self ++ ++ def __exit__(self, *exc_info): ++ self._uncache.__exit__(None, None, None) ++ ++ ++class mock_modules(_ImporterMock): ++ ++ """Importer mock using PEP 302 APIs.""" ++ + def find_module(self, fullname, path=None): + if fullname not in self.modules: + return None +@@ -152,10 +166,28 @@ + raise + return self.modules[fullname] + +- def __enter__(self): +- self._uncache = uncache(*self.modules.keys()) +- self._uncache.__enter__() +- return self ++class mock_spec(_ImporterMock): + +- def __exit__(self, *exc_info): +- self._uncache.__exit__(None, None, None) ++ """Importer mock using PEP 451 APIs.""" ++ ++ def find_spec(self, fullname, path=None, parent=None): ++ try: ++ module = self.modules[fullname] ++ except KeyError: ++ return None ++ is_package = hasattr(module, '__path__') ++ spec = util.spec_from_file_location( ++ fullname, module.__file__, loader=self, ++ submodule_search_locations=getattr(module, '__path__', None)) ++ return spec ++ ++ def create_module(self, spec): ++ if spec.name not in self.modules: ++ raise ImportError ++ return self.modules[spec.name] ++ ++ def exec_module(self, module): ++ try: ++ self.module_code[module.__spec__.name]() ++ except KeyError: ++ pass +diff -r 3405dc9a6afa Lib/test/test_index.py +--- a/Lib/test/test_index.py ++++ b/Lib/test/test_index.py +@@ -9,7 +9,7 @@ + + class TrapInt(int): + def __index__(self): +- return self ++ return int(self) + + class BaseTestCase(unittest.TestCase): + def setUp(self): +@@ -55,6 +55,40 @@ + self.assertRaises(TypeError, slice(self.o).indices, 0) + self.assertRaises(TypeError, slice(self.n).indices, 0) + ++ def test_int_subclass_with_index(self): ++ # __index__ should be used when computing indices, even for int ++ # subclasses. See issue #17576. ++ class MyInt(int): ++ def __index__(self): ++ return int(self) + 1 ++ ++ my_int = MyInt(7) ++ direct_index = my_int.__index__() ++ operator_index = operator.index(my_int) ++ self.assertEqual(direct_index, 8) ++ self.assertEqual(operator_index, 7) ++ # Both results should be of exact type int. ++ self.assertIs(type(direct_index), int) ++ #self.assertIs(type(operator_index), int) ++ ++ def test_index_returns_int_subclass(self): ++ class BadInt: ++ def __index__(self): ++ return True ++ ++ class BadInt2(int): ++ def __index__(self): ++ return True ++ ++ bad_int = BadInt() ++ with self.assertWarns(DeprecationWarning): ++ n = operator.index(bad_int) ++ self.assertEqual(n, 1) ++ ++ bad_int = BadInt2() ++ n = operator.index(bad_int) ++ self.assertEqual(n, 0) ++ + + class SeqTestCase: + # This test case isn't run directly. It just defines common tests +diff -r 3405dc9a6afa Lib/test/test_inspect.py +--- a/Lib/test/test_inspect.py ++++ b/Lib/test/test_inspect.py +@@ -2529,7 +2529,8 @@ + # Just a quick sanity check on the output + self.assertIn(module.__name__, output) + self.assertIn(module.__file__, output) +- self.assertIn(module.__cached__, output) ++ if not sys.flags.optimize: ++ self.assertIn(module.__cached__, output) + self.assertEqual(err, b'') + + +diff -r 3405dc9a6afa Lib/test/test_int.py +--- a/Lib/test/test_int.py ++++ b/Lib/test/test_int.py +@@ -304,32 +304,7 @@ + def __int__(self): + return 42 + +- class Foo1(object): +- def __int__(self): +- return 42 +- +- class Foo2(int): +- def __int__(self): +- return 42 +- +- class Foo3(int): +- def __int__(self): +- return self +- +- class Foo4(int): +- def __int__(self): +- return 42 +- +- class Foo5(int): +- def __int__(self): +- return 42. +- + self.assertEqual(int(Foo0()), 42) +- self.assertEqual(int(Foo1()), 42) +- self.assertEqual(int(Foo2()), 42) +- self.assertEqual(int(Foo3()), 0) +- self.assertEqual(int(Foo4()), 42) +- self.assertRaises(TypeError, int, Foo5()) + + class Classic: + pass +@@ -392,6 +367,57 @@ + with self.assertRaises(TypeError): + int(TruncReturnsBadInt()) + ++ def test_int_subclass_with_int(self): ++ class MyInt(int): ++ def __int__(self): ++ return 42 ++ ++ class BadInt(int): ++ def __int__(self): ++ return 42.0 ++ ++ my_int = MyInt(7) ++ self.assertEqual(my_int, 7) ++ self.assertEqual(int(my_int), 42) ++ ++ self.assertRaises(TypeError, int, BadInt()) ++ ++ def test_int_returns_int_subclass(self): ++ class BadInt: ++ def __int__(self): ++ return True ++ ++ class BadInt2(int): ++ def __int__(self): ++ return True ++ ++ class TruncReturnsBadInt: ++ def __trunc__(self): ++ return BadInt() ++ ++ class TruncReturnsIntSubclass: ++ def __trunc__(self): ++ return True ++ ++ bad_int = BadInt() ++ with self.assertWarns(DeprecationWarning): ++ n = int(bad_int) ++ self.assertEqual(n, 1) ++ ++ bad_int = BadInt2() ++ with self.assertWarns(DeprecationWarning): ++ n = int(bad_int) ++ self.assertEqual(n, 1) ++ ++ bad_int = TruncReturnsBadInt() ++ with self.assertWarns(DeprecationWarning): ++ n = int(bad_int) ++ self.assertEqual(n, 1) ++ ++ good_int = TruncReturnsIntSubclass() ++ n = int(good_int) ++ self.assertEqual(n, 1) ++ + def test_error_message(self): + def check(s, base=None): + with self.assertRaises(ValueError, +diff -r 3405dc9a6afa Lib/test/test_io.py +--- a/Lib/test/test_io.py ++++ b/Lib/test/test_io.py +@@ -36,6 +36,7 @@ + from collections import deque, UserList + from itertools import cycle, count + from test import support ++from test.script_helper import assert_python_ok + + import codecs + import io # C implementation of io +@@ -421,14 +422,9 @@ + # a long time to build the >2GB file and takes >2GB of disk space + # therefore the resource must be enabled to run this test. + if sys.platform[:3] == 'win' or sys.platform == 'darwin': +- if not support.is_resource_enabled("largefile"): +- print("\nTesting large file ops skipped on %s." % sys.platform, +- file=sys.stderr) +- print("It requires %d bytes and a long time." % self.LARGE, +- file=sys.stderr) +- print("Use 'regrtest.py -u largefile test_io' to run it.", +- file=sys.stderr) +- return ++ support.requires( ++ 'largefile', ++ 'test requires %s bytes and a long time to run' % self.LARGE) + with self.open(support.TESTFN, "w+b", 0) as f: + self.large_file_ops(f) + with self.open(support.TESTFN, "w+b") as f: +@@ -698,6 +694,7 @@ + + self.assertEqual(42, bufio.fileno()) + ++ @unittest.skip('test having existential crisis') + def test_no_fileno(self): + # XXX will we always have fileno() function? If so, kill + # this test. Else, write it. +@@ -2593,8 +2590,46 @@ + encoding='quopri_codec') + self.assertRaises(TypeError, t.read) + ++ def _check_create_at_shutdown(self, **kwargs): ++ # Issue #20037: creating a TextIOWrapper at shutdown ++ # shouldn't crash the interpreter. ++ iomod = self.io.__name__ ++ code = """if 1: ++ import codecs ++ import {iomod} as io ++ ++ # Avoid looking up codecs at shutdown ++ codecs.lookup('utf-8') ++ ++ class C: ++ def __init__(self): ++ self.buf = io.BytesIO() ++ def __del__(self): ++ io.TextIOWrapper(self.buf, **{kwargs}) ++ print("ok") ++ c = C() ++ """.format(iomod=iomod, kwargs=kwargs) ++ return assert_python_ok("-c", code) ++ ++ def test_create_at_shutdown_without_encoding(self): ++ rc, out, err = self._check_create_at_shutdown() ++ if err: ++ # Can error out with a RuntimeError if the module state ++ # isn't found. ++ self.assertIn("RuntimeError: could not find io module state", ++ err.decode()) ++ else: ++ self.assertEqual("ok", out.decode().strip()) ++ ++ def test_create_at_shutdown_with_encoding(self): ++ rc, out, err = self._check_create_at_shutdown(encoding='utf-8', ++ errors='strict') ++ self.assertFalse(err) ++ self.assertEqual("ok", out.decode().strip()) ++ + + class CTextIOWrapperTest(TextIOWrapperTest): ++ io = io + + def test_initialization(self): + r = self.BytesIO(b"\xc3\xa9\n\n") +@@ -2638,7 +2673,7 @@ + + + class PyTextIOWrapperTest(TextIOWrapperTest): +- pass ++ io = pyio + + + class IncrementalNewlineDecoderTest(unittest.TestCase): +@@ -2777,7 +2812,8 @@ + self.assertEqual(f.mode, "wb") + f.close() + +- f = self.open(support.TESTFN, "U") ++ with support.check_warnings(('', DeprecationWarning)): ++ f = self.open(support.TESTFN, "U") + self.assertEqual(f.name, support.TESTFN) + self.assertEqual(f.buffer.name, support.TESTFN) + self.assertEqual(f.buffer.raw.name, support.TESTFN) +diff -r 3405dc9a6afa Lib/test/test_itertools.py +--- a/Lib/test/test_itertools.py ++++ b/Lib/test/test_itertools.py +@@ -10,6 +10,8 @@ + import copy + import pickle + from functools import reduce ++import sys ++import struct + maxsize = support.MAX_Py_ssize_t + minsize = -maxsize-1 + +@@ -1807,6 +1809,44 @@ + # we expect type errors because of wrong argument count + self.assertNotIn("does not take keyword arguments", err.args[0]) + ++@support.cpython_only ++class SizeofTest(unittest.TestCase): ++ def setUp(self): ++ self.ssize_t = struct.calcsize('n') ++ ++ check_sizeof = support.check_sizeof ++ ++ def test_product_sizeof(self): ++ basesize = support.calcobjsize('3Pi') ++ check = self.check_sizeof ++ check(product('ab', '12'), basesize + 2 * self.ssize_t) ++ check(product(*(('abc',) * 10)), basesize + 10 * self.ssize_t) ++ ++ def test_combinations_sizeof(self): ++ basesize = support.calcobjsize('3Pni') ++ check = self.check_sizeof ++ check(combinations('abcd', 3), basesize + 3 * self.ssize_t) ++ check(combinations(range(10), 4), basesize + 4 * self.ssize_t) ++ ++ def test_combinations_with_replacement_sizeof(self): ++ cwr = combinations_with_replacement ++ basesize = support.calcobjsize('3Pni') ++ check = self.check_sizeof ++ check(cwr('abcd', 3), basesize + 3 * self.ssize_t) ++ check(cwr(range(10), 4), basesize + 4 * self.ssize_t) ++ ++ def test_permutations_sizeof(self): ++ basesize = support.calcobjsize('4Pni') ++ check = self.check_sizeof ++ check(permutations('abcd'), ++ basesize + 4 * self.ssize_t + 4 * self.ssize_t) ++ check(permutations('abcd', 3), ++ basesize + 4 * self.ssize_t + 3 * self.ssize_t) ++ check(permutations('abcde', 3), ++ basesize + 5 * self.ssize_t + 3 * self.ssize_t) ++ check(permutations(range(10), 4), ++ basesize + 10 * self.ssize_t + 4 * self.ssize_t) ++ + + libreftest = """ Doctest for examples in the library reference: libitertools.tex + +@@ -2042,7 +2082,8 @@ + def test_main(verbose=None): + test_classes = (TestBasicOps, TestVariousIteratorArgs, TestGC, + RegressionTests, LengthTransparency, +- SubclassWithKwargsTest, TestExamples) ++ SubclassWithKwargsTest, TestExamples, ++ SizeofTest) + support.run_unittest(*test_classes) + + # verify reference counting +diff -r 3405dc9a6afa Lib/test/test_json/test_scanstring.py +--- a/Lib/test/test_json/test_scanstring.py ++++ b/Lib/test/test_json/test_scanstring.py +@@ -6,10 +6,6 @@ + def test_scanstring(self): + scanstring = self.json.decoder.scanstring + self.assertEqual( +- scanstring('"z\\ud834\\udd20x"', 1, True), +- ('z\U0001d120x', 16)) +- +- self.assertEqual( + scanstring('"z\U0001d120x"', 1, True), + ('z\U0001d120x', 5)) + +@@ -89,6 +85,53 @@ + scanstring('["Bad value", truth]', 2, True), + ('Bad value', 12)) + ++ def test_surrogates(self): ++ scanstring = self.json.decoder.scanstring ++ def assertScan(given, expect): ++ self.assertEqual(scanstring(given, 1, True), ++ (expect, len(given))) ++ ++ assertScan('"z\\ud834\\u0079x"', 'z\ud834yx') ++ assertScan('"z\\ud834\\udd20x"', 'z\U0001d120x') ++ assertScan('"z\\ud834\\ud834\\udd20x"', 'z\ud834\U0001d120x') ++ assertScan('"z\\ud834x"', 'z\ud834x') ++ assertScan('"z\\ud834\udd20x12345"', 'z\ud834\udd20x12345') ++ assertScan('"z\\udd20x"', 'z\udd20x') ++ assertScan('"z\ud834\udd20x"', 'z\ud834\udd20x') ++ assertScan('"z\ud834\\udd20x"', 'z\ud834\udd20x') ++ assertScan('"z\ud834x"', 'z\ud834x') ++ ++ def test_bad_escapes(self): ++ scanstring = self.json.decoder.scanstring ++ bad_escapes = [ ++ '"\\"', ++ '"\\x"', ++ '"\\u"', ++ '"\\u0"', ++ '"\\u01"', ++ '"\\u012"', ++ '"\\uz012"', ++ '"\\u0z12"', ++ '"\\u01z2"', ++ '"\\u012z"', ++ '"\\u0x12"', ++ '"\\u0X12"', ++ '"\\ud834\\"', ++ '"\\ud834\\u"', ++ '"\\ud834\\ud"', ++ '"\\ud834\\udd"', ++ '"\\ud834\\udd2"', ++ '"\\ud834\\uzdd2"', ++ '"\\ud834\\udzd2"', ++ '"\\ud834\\uddz2"', ++ '"\\ud834\\udd2z"', ++ '"\\ud834\\u0x20"', ++ '"\\ud834\\u0X20"', ++ ] ++ for s in bad_escapes: ++ with self.assertRaises(ValueError, msg=s): ++ scanstring(s, 1, True) ++ + def test_overflow(self): + with self.assertRaises(OverflowError): + self.json.decoder.scanstring(b"xxx", sys.maxsize+1) +diff -r 3405dc9a6afa Lib/test/test_locale.py +--- a/Lib/test/test_locale.py ++++ b/Lib/test/test_locale.py +@@ -365,6 +365,117 @@ + self.assertLess(locale.strxfrm('à'), locale.strxfrm('b')) + + ++class NormalizeTest(unittest.TestCase): ++ def check(self, localename, expected): ++ self.assertEqual(locale.normalize(localename), expected, msg=localename) ++ ++ def test_locale_alias(self): ++ for localename, alias in locale.locale_alias.items(): ++ with self.subTest(locale=(localename, alias)): ++ self.check(localename, alias) ++ ++ def test_empty(self): ++ self.check('', '') ++ ++ def test_c(self): ++ self.check('c', 'C') ++ self.check('posix', 'C') ++ ++ def test_english(self): ++ self.check('en', 'en_US.ISO8859-1') ++ self.check('EN', 'en_US.ISO8859-1') ++ self.check('en.iso88591', 'en_US.ISO8859-1') ++ self.check('en_US', 'en_US.ISO8859-1') ++ self.check('en_us', 'en_US.ISO8859-1') ++ self.check('en_GB', 'en_GB.ISO8859-1') ++ self.check('en_US.UTF-8', 'en_US.UTF-8') ++ self.check('en_US.utf8', 'en_US.UTF-8') ++ self.check('en_US:UTF-8', 'en_US.UTF-8') ++ self.check('en_US.ISO8859-1', 'en_US.ISO8859-1') ++ self.check('en_US.US-ASCII', 'en_US.ISO8859-1') ++ self.check('en_US.88591', 'en_US.ISO8859-1') ++ self.check('en_US.885915', 'en_US.ISO8859-15') ++ self.check('english', 'en_EN.ISO8859-1') ++ self.check('english_uk.ascii', 'en_GB.ISO8859-1') ++ ++ def test_hyphenated_encoding(self): ++ self.check('az_AZ.iso88599e', 'az_AZ.ISO8859-9E') ++ self.check('az_AZ.ISO8859-9E', 'az_AZ.ISO8859-9E') ++ self.check('tt_RU.koi8c', 'tt_RU.KOI8-C') ++ self.check('tt_RU.KOI8-C', 'tt_RU.KOI8-C') ++ self.check('lo_LA.cp1133', 'lo_LA.IBM-CP1133') ++ self.check('lo_LA.ibmcp1133', 'lo_LA.IBM-CP1133') ++ self.check('lo_LA.IBM-CP1133', 'lo_LA.IBM-CP1133') ++ self.check('uk_ua.microsoftcp1251', 'uk_UA.CP1251') ++ self.check('uk_ua.microsoft-cp1251', 'uk_UA.CP1251') ++ self.check('ka_ge.georgianacademy', 'ka_GE.GEORGIAN-ACADEMY') ++ self.check('ka_GE.GEORGIAN-ACADEMY', 'ka_GE.GEORGIAN-ACADEMY') ++ self.check('cs_CZ.iso88592', 'cs_CZ.ISO8859-2') ++ self.check('cs_CZ.ISO8859-2', 'cs_CZ.ISO8859-2') ++ ++ def test_euro_modifier(self): ++ self.check('de_DE@euro', 'de_DE.ISO8859-15') ++ self.check('en_US.ISO8859-15@euro', 'en_US.ISO8859-15') ++ self.check('de_DE.utf8@euro', 'de_DE.UTF-8') ++ ++ def test_latin_modifier(self): ++ self.check('be_BY.UTF-8@latin', 'be_BY.UTF-8@latin') ++ self.check('sr_RS.UTF-8@latin', 'sr_RS.UTF-8@latin') ++ self.check('sr_RS.UTF-8@latn', 'sr_RS.UTF-8@latin') ++ ++ def test_valencia_modifier(self): ++ self.check('ca_ES.UTF-8@valencia', 'ca_ES.UTF-8@valencia') ++ self.check('ca_ES@valencia', 'ca_ES.ISO8859-1@valencia') ++ self.check('ca@valencia', 'ca_ES.ISO8859-1@valencia') ++ ++ def test_devanagari_modifier(self): ++ self.check('ks_IN.UTF-8@devanagari', 'ks_IN.UTF-8@devanagari') ++ self.check('ks_IN@devanagari', 'ks_IN.UTF-8@devanagari') ++ self.check('ks@devanagari', 'ks_IN.UTF-8@devanagari') ++ self.check('ks_IN.UTF-8', 'ks_IN.UTF-8') ++ self.check('ks_IN', 'ks_IN.UTF-8') ++ self.check('ks', 'ks_IN.UTF-8') ++ self.check('sd_IN.UTF-8@devanagari', 'sd_IN.UTF-8@devanagari') ++ self.check('sd_IN@devanagari', 'sd_IN.UTF-8@devanagari') ++ self.check('sd@devanagari', 'sd_IN.UTF-8@devanagari') ++ self.check('sd_IN.UTF-8', 'sd_IN.UTF-8') ++ self.check('sd_IN', 'sd_IN.UTF-8') ++ self.check('sd', 'sd_IN.UTF-8') ++ ++ def test_euc_encoding(self): ++ self.check('ja_jp.euc', 'ja_JP.eucJP') ++ self.check('ja_jp.eucjp', 'ja_JP.eucJP') ++ self.check('ko_kr.euc', 'ko_KR.eucKR') ++ self.check('ko_kr.euckr', 'ko_KR.eucKR') ++ self.check('zh_cn.euc', 'zh_CN.eucCN') ++ self.check('zh_tw.euc', 'zh_TW.eucTW') ++ self.check('zh_tw.euctw', 'zh_TW.eucTW') ++ ++ def test_japanese(self): ++ self.check('ja', 'ja_JP.eucJP') ++ self.check('ja.jis', 'ja_JP.JIS7') ++ self.check('ja.sjis', 'ja_JP.SJIS') ++ self.check('ja_jp', 'ja_JP.eucJP') ++ self.check('ja_jp.ajec', 'ja_JP.eucJP') ++ self.check('ja_jp.euc', 'ja_JP.eucJP') ++ self.check('ja_jp.eucjp', 'ja_JP.eucJP') ++ self.check('ja_jp.iso-2022-jp', 'ja_JP.JIS7') ++ self.check('ja_jp.iso2022jp', 'ja_JP.JIS7') ++ self.check('ja_jp.jis', 'ja_JP.JIS7') ++ self.check('ja_jp.jis7', 'ja_JP.JIS7') ++ self.check('ja_jp.mscode', 'ja_JP.SJIS') ++ self.check('ja_jp.pck', 'ja_JP.SJIS') ++ self.check('ja_jp.sjis', 'ja_JP.SJIS') ++ self.check('ja_jp.ujis', 'ja_JP.eucJP') ++ self.check('ja_jp.utf8', 'ja_JP.UTF-8') ++ self.check('japan', 'ja_JP.eucJP') ++ self.check('japanese', 'ja_JP.eucJP') ++ self.check('japanese-euc', 'ja_JP.eucJP') ++ self.check('japanese.euc', 'ja_JP.eucJP') ++ self.check('japanese.sjis', 'ja_JP.SJIS') ++ self.check('jp_jp', 'ja_JP.eucJP') ++ ++ + class TestMiscellaneous(unittest.TestCase): + def test_getpreferredencoding(self): + # Invoke getpreferredencoding to make sure it does not cause exceptions. +diff -r 3405dc9a6afa Lib/test/test_logging.py +--- a/Lib/test/test_logging.py ++++ b/Lib/test/test_logging.py +@@ -41,6 +41,7 @@ + import struct + import sys + import tempfile ++from test.script_helper import assert_python_ok + from test.support import (captured_stdout, run_with_locale, run_unittest, + patch, requires_zlib, TestHandler, Matcher) + import textwrap +@@ -590,6 +591,7 @@ + for _ in range(tries): + try: + os.unlink(fname) ++ self.deletion_time = time.time() + except OSError: + pass + time.sleep(0.004 * random.randint(0, 4)) +@@ -597,6 +599,9 @@ + del_count = 500 + log_count = 500 + ++ self.handle_time = None ++ self.deletion_time = None ++ + for delay in (False, True): + fd, fn = tempfile.mkstemp('.log', 'test_logging-3-') + os.close(fd) +@@ -610,7 +615,14 @@ + for _ in range(log_count): + time.sleep(0.005) + r = logging.makeLogRecord({'msg': 'testing' }) +- h.handle(r) ++ try: ++ self.handle_time = time.time() ++ h.handle(r) ++ except Exception: ++ print('Deleted at %s, ' ++ 'opened at %s' % (self.deletion_time, ++ self.handle_time)) ++ raise + finally: + remover.join() + h.close() +@@ -912,19 +924,21 @@ + + @unittest.skipUnless(threading, 'Threading required for this test.') + class SMTPHandlerTest(BaseTest): ++ TIMEOUT = 8.0 + def test_basic(self): + sockmap = {} + server = TestSMTPServer(('localhost', 0), self.process_message, 0.001, + sockmap) + server.start() + addr = ('localhost', server.port) +- h = logging.handlers.SMTPHandler(addr, 'me', 'you', 'Log', timeout=5.0) ++ h = logging.handlers.SMTPHandler(addr, 'me', 'you', 'Log', ++ timeout=self.TIMEOUT) + self.assertEqual(h.toaddrs, ['you']) + self.messages = [] + r = logging.makeLogRecord({'msg': 'Hello'}) + self.handled = threading.Event() + h.handle(r) +- self.handled.wait(5.0) # 14314: don't wait forever ++ self.handled.wait(self.TIMEOUT) # 14314: don't wait forever + server.stop() + self.assertTrue(self.handled.is_set()) + self.assertEqual(len(self.messages), 1) +@@ -3384,6 +3398,25 @@ + logging.setLoggerClass(logging.Logger) + self.assertEqual(logging.getLoggerClass(), logging.Logger) + ++ def test_logging_at_shutdown(self): ++ # Issue #20037 ++ code = """if 1: ++ import logging ++ ++ class A: ++ def __del__(self): ++ try: ++ raise ValueError("some error") ++ except Exception: ++ logging.exception("exception in __del__") ++ ++ a = A()""" ++ rc, out, err = assert_python_ok("-c", code) ++ err = err.decode() ++ self.assertIn("exception in __del__", err) ++ self.assertIn("ValueError: some error", err) ++ ++ + class LogRecordTest(BaseTest): + def test_str_rep(self): + r = logging.makeLogRecord({}) +diff -r 3405dc9a6afa Lib/test/test_lzma.py +--- a/Lib/test/test_lzma.py ++++ b/Lib/test/test_lzma.py +@@ -314,6 +314,8 @@ + + def test_decompress_bad_input(self): + with self.assertRaises(LZMAError): ++ lzma.decompress(COMPRESSED_BOGUS) ++ with self.assertRaises(LZMAError): + lzma.decompress(COMPRESSED_RAW_1) + with self.assertRaises(LZMAError): + lzma.decompress(COMPRESSED_ALONE, format=lzma.FORMAT_XZ) +@@ -348,6 +350,16 @@ + ddata = lzma.decompress(COMPRESSED_XZ + COMPRESSED_ALONE) + self.assertEqual(ddata, INPUT * 2) + ++ # Test robust handling of non-LZMA data following the compressed stream(s). ++ ++ def test_decompress_trailing_junk(self): ++ ddata = lzma.decompress(COMPRESSED_XZ + COMPRESSED_BOGUS) ++ self.assertEqual(ddata, INPUT) ++ ++ def test_decompress_multistream_trailing_junk(self): ++ ddata = lzma.decompress(COMPRESSED_XZ * 3 + COMPRESSED_BOGUS) ++ self.assertEqual(ddata, INPUT * 3) ++ + + class TempFile: + """Context manager - creates a file, and deletes it on __exit__.""" +@@ -676,6 +688,14 @@ + finally: + lzma._BUFFER_SIZE = saved_buffer_size + ++ def test_read_trailing_junk(self): ++ with LZMAFile(BytesIO(COMPRESSED_XZ + COMPRESSED_BOGUS)) as f: ++ self.assertEqual(f.read(), INPUT) ++ ++ def test_read_multistream_trailing_junk(self): ++ with LZMAFile(BytesIO(COMPRESSED_XZ * 5 + COMPRESSED_BOGUS)) as f: ++ self.assertEqual(f.read(), INPUT * 5) ++ + def test_read_from_file(self): + with TempFile(TESTFN, COMPRESSED_XZ): + with LZMAFile(TESTFN) as f: +@@ -719,6 +739,10 @@ + with LZMAFile(BytesIO(COMPRESSED_XZ)) as f: + self.assertRaises(TypeError, f.read, None) + ++ def test_read_bad_data(self): ++ with LZMAFile(BytesIO(COMPRESSED_BOGUS)) as f: ++ self.assertRaises(LZMAError, f.read) ++ + def test_read1(self): + with LZMAFile(BytesIO(COMPRESSED_XZ)) as f: + blocks = [] +@@ -1232,6 +1256,8 @@ + Farewell. + """ + ++COMPRESSED_BOGUS = b"this is not a valid lzma stream" ++ + COMPRESSED_XZ = ( + b"\xfd7zXZ\x00\x00\x04\xe6\xd6\xb4F\x02\x00!\x01\x16\x00\x00\x00t/\xe5\xa3" + b"\xe0\x07\x80\x03\xdf]\x00\x05\x14\x07bX\x19\xcd\xddn\x98\x15\xe4\xb4\x9d" +diff -r 3405dc9a6afa Lib/test/test_memoryview.py +--- a/Lib/test/test_memoryview.py ++++ b/Lib/test/test_memoryview.py +@@ -57,7 +57,7 @@ + + def test_setitem_readonly(self): + if not self.ro_type: +- return ++ self.skipTest("no read-only type to test") + b = self.ro_type(self._source) + oldrefcount = sys.getrefcount(b) + m = self._view(b) +@@ -71,7 +71,7 @@ + + def test_setitem_writable(self): + if not self.rw_type: +- return ++ self.skipTest("no writable type to test") + tp = self.rw_type + b = self.rw_type(self._source) + oldrefcount = sys.getrefcount(b) +@@ -189,13 +189,13 @@ + + def test_attributes_readonly(self): + if not self.ro_type: +- return ++ self.skipTest("no read-only type to test") + m = self.check_attributes_with_type(self.ro_type) + self.assertEqual(m.readonly, True) + + def test_attributes_writable(self): + if not self.rw_type: +- return ++ self.skipTest("no writable type to test") + m = self.check_attributes_with_type(self.rw_type) + self.assertEqual(m.readonly, False) + +@@ -301,7 +301,7 @@ + # buffer as writable causing a segfault if using mmap + tp = self.ro_type + if tp is None: +- return ++ self.skipTest("no read-only type to test") + b = tp(self._source) + m = self._view(b) + i = io.BytesIO(b'ZZZZ') +@@ -379,12 +379,12 @@ + itemsize = array.array('i').itemsize + format = 'i' + ++ @unittest.skip('XXX test should be adapted for non-byte buffers') + def test_getbuffer(self): +- # XXX Test should be adapted for non-byte buffers + pass + ++ @unittest.skip('XXX NotImplementedError: tolist() only supports byte views') + def test_tolist(self): +- # XXX NotImplementedError: tolist() only supports byte views + pass + + +diff -r 3405dc9a6afa Lib/test/test_multiprocessing_main_handling.py +--- /dev/null ++++ b/Lib/test/test_multiprocessing_main_handling.py +@@ -0,0 +1,285 @@ ++# tests __main__ module handling in multiprocessing ++ ++import importlib ++import importlib.machinery ++import zipimport ++import unittest ++import sys ++import os ++import os.path ++import py_compile ++ ++from test import support ++from test.script_helper import ( ++ make_pkg, make_script, make_zip_pkg, make_zip_script, ++ assert_python_ok, assert_python_failure, temp_dir, ++ spawn_python, kill_python) ++ ++# Skip tests if _multiprocessing wasn't built. ++_multiprocessing = support.import_module('_multiprocessing') ++# Look up which start methods are available to test ++import multiprocessing ++AVAILABLE_START_METHODS = set(multiprocessing.get_all_start_methods()) ++ ++verbose = support.verbose ++ ++test_source = """\ ++# multiprocessing includes all sorts of shenanigans to make __main__ ++# attributes accessible in the subprocess in a pickle compatible way. ++ ++# We run the "doesn't work in the interactive interpreter" example from ++# the docs to make sure it *does* work from an executed __main__, ++# regardless of the invocation mechanism ++ ++import sys ++import time ++from multiprocessing import Pool, set_start_method ++ ++# We use this __main__ defined function in the map call below in order to ++# check that multiprocessing in correctly running the unguarded ++# code in child processes and then making it available as __main__ ++def f(x): ++ return x*x ++ ++# Check explicit relative imports ++if "check_sibling" in __file__: ++ # We're inside a package and not in a __main__.py file ++ # so make sure explicit relative imports work correctly ++ from . import sibling ++ ++if __name__ == '__main__': ++ start_method = sys.argv[1] ++ set_start_method(start_method) ++ p = Pool(5) ++ results = [] ++ p.map_async(f, [1, 2, 3], callback=results.extend) ++ deadline = time.time() + 10 # up to 10 s to report the results ++ while not results: ++ time.sleep(0.05) ++ if time.time() > deadline: ++ raise RuntimeError("Timed out waiting for results") ++ results.sort() ++ print(start_method, "->", results) ++""" ++ ++test_source_main_skipped_in_children = """\ ++# __main__.py files have an implied "if __name__ == '__main__'" so ++# multiprocessing should always skip running them in child processes ++ ++# This means we can't use __main__ defined functions in child processes, ++# so we just use "int" as a passthrough operation below ++ ++if __name__ != "__main__": ++ raise RuntimeError("Should only be called as __main__!") ++ ++import sys ++import time ++from multiprocessing import Pool, set_start_method ++ ++start_method = sys.argv[1] ++set_start_method(start_method) ++p = Pool(5) ++results = [] ++p.map_async(int, [1, 4, 9], callback=results.extend) ++deadline = time.time() + 10 # up to 10 s to report the results ++while not results: ++ time.sleep(0.05) ++ if time.time() > deadline: ++ raise RuntimeError("Timed out waiting for results") ++results.sort() ++print(start_method, "->", results) ++""" ++ ++# These helpers were copied from test_cmd_line_script & tweaked a bit... ++ ++def _make_test_script(script_dir, script_basename, ++ source=test_source, omit_suffix=False): ++ to_return = make_script(script_dir, script_basename, ++ source, omit_suffix) ++ # Hack to check explicit relative imports ++ if script_basename == "check_sibling": ++ make_script(script_dir, "sibling", "") ++ importlib.invalidate_caches() ++ return to_return ++ ++def _make_test_zip_pkg(zip_dir, zip_basename, pkg_name, script_basename, ++ source=test_source, depth=1): ++ to_return = make_zip_pkg(zip_dir, zip_basename, pkg_name, script_basename, ++ source, depth) ++ importlib.invalidate_caches() ++ return to_return ++ ++# There's no easy way to pass the script directory in to get ++# -m to work (avoiding that is the whole point of making ++# directories and zipfiles executable!) ++# So we fake it for testing purposes with a custom launch script ++launch_source = """\ ++import sys, os.path, runpy ++sys.path.insert(0, %s) ++runpy._run_module_as_main(%r) ++""" ++ ++def _make_launch_script(script_dir, script_basename, module_name, path=None): ++ if path is None: ++ path = "os.path.dirname(__file__)" ++ else: ++ path = repr(path) ++ source = launch_source % (path, module_name) ++ to_return = make_script(script_dir, script_basename, source) ++ importlib.invalidate_caches() ++ return to_return ++ ++class MultiProcessingCmdLineMixin(): ++ maxDiff = None # Show full tracebacks on subprocess failure ++ ++ def setUp(self): ++ if self.start_method not in AVAILABLE_START_METHODS: ++ self.skipTest("%r start method not available" % self.start_method) ++ ++ def _check_output(self, script_name, exit_code, out, err): ++ if verbose > 1: ++ print("Output from test script %r:" % script_name) ++ print(out) ++ self.assertEqual(exit_code, 0) ++ self.assertEqual(err.decode('utf-8'), '') ++ expected_results = "%s -> [1, 4, 9]" % self.start_method ++ self.assertEqual(out.decode('utf-8').strip(), expected_results) ++ ++ def _check_script(self, script_name, *cmd_line_switches): ++ if not __debug__: ++ cmd_line_switches += ('-' + 'O' * sys.flags.optimize,) ++ run_args = cmd_line_switches + (script_name, self.start_method) ++ rc, out, err = assert_python_ok(*run_args, __isolated=False) ++ self._check_output(script_name, rc, out, err) ++ ++ def test_basic_script(self): ++ with temp_dir() as script_dir: ++ script_name = _make_test_script(script_dir, 'script') ++ self._check_script(script_name) ++ ++ def test_basic_script_no_suffix(self): ++ with temp_dir() as script_dir: ++ script_name = _make_test_script(script_dir, 'script', ++ omit_suffix=True) ++ self._check_script(script_name) ++ ++ def test_ipython_workaround(self): ++ # Some versions of the IPython launch script are missing the ++ # __name__ = "__main__" guard, and multiprocessing has long had ++ # a workaround for that case ++ # See https://github.com/ipython/ipython/issues/4698 ++ source = test_source_main_skipped_in_children ++ with temp_dir() as script_dir: ++ script_name = _make_test_script(script_dir, 'ipython', ++ source=source) ++ self._check_script(script_name) ++ script_no_suffix = _make_test_script(script_dir, 'ipython', ++ source=source, ++ omit_suffix=True) ++ self._check_script(script_no_suffix) ++ ++ def test_script_compiled(self): ++ with temp_dir() as script_dir: ++ script_name = _make_test_script(script_dir, 'script') ++ py_compile.compile(script_name, doraise=True) ++ os.remove(script_name) ++ pyc_file = support.make_legacy_pyc(script_name) ++ self._check_script(pyc_file) ++ ++ def test_directory(self): ++ source = self.main_in_children_source ++ with temp_dir() as script_dir: ++ script_name = _make_test_script(script_dir, '__main__', ++ source=source) ++ self._check_script(script_dir) ++ ++ def test_directory_compiled(self): ++ source = self.main_in_children_source ++ with temp_dir() as script_dir: ++ script_name = _make_test_script(script_dir, '__main__', ++ source=source) ++ py_compile.compile(script_name, doraise=True) ++ os.remove(script_name) ++ pyc_file = support.make_legacy_pyc(script_name) ++ self._check_script(script_dir) ++ ++ def test_zipfile(self): ++ source = self.main_in_children_source ++ with temp_dir() as script_dir: ++ script_name = _make_test_script(script_dir, '__main__', ++ source=source) ++ zip_name, run_name = make_zip_script(script_dir, 'test_zip', script_name) ++ self._check_script(zip_name) ++ ++ def test_zipfile_compiled(self): ++ source = self.main_in_children_source ++ with temp_dir() as script_dir: ++ script_name = _make_test_script(script_dir, '__main__', ++ source=source) ++ compiled_name = py_compile.compile(script_name, doraise=True) ++ zip_name, run_name = make_zip_script(script_dir, 'test_zip', compiled_name) ++ self._check_script(zip_name) ++ ++ def test_module_in_package(self): ++ with temp_dir() as script_dir: ++ pkg_dir = os.path.join(script_dir, 'test_pkg') ++ make_pkg(pkg_dir) ++ script_name = _make_test_script(pkg_dir, 'check_sibling') ++ launch_name = _make_launch_script(script_dir, 'launch', ++ 'test_pkg.check_sibling') ++ self._check_script(launch_name) ++ ++ def test_module_in_package_in_zipfile(self): ++ with temp_dir() as script_dir: ++ zip_name, run_name = _make_test_zip_pkg(script_dir, 'test_zip', 'test_pkg', 'script') ++ launch_name = _make_launch_script(script_dir, 'launch', 'test_pkg.script', zip_name) ++ self._check_script(launch_name) ++ ++ def test_module_in_subpackage_in_zipfile(self): ++ with temp_dir() as script_dir: ++ zip_name, run_name = _make_test_zip_pkg(script_dir, 'test_zip', 'test_pkg', 'script', depth=2) ++ launch_name = _make_launch_script(script_dir, 'launch', 'test_pkg.test_pkg.script', zip_name) ++ self._check_script(launch_name) ++ ++ def test_package(self): ++ source = self.main_in_children_source ++ with temp_dir() as script_dir: ++ pkg_dir = os.path.join(script_dir, 'test_pkg') ++ make_pkg(pkg_dir) ++ script_name = _make_test_script(pkg_dir, '__main__', ++ source=source) ++ launch_name = _make_launch_script(script_dir, 'launch', 'test_pkg') ++ self._check_script(launch_name) ++ ++ def test_package_compiled(self): ++ source = self.main_in_children_source ++ with temp_dir() as script_dir: ++ pkg_dir = os.path.join(script_dir, 'test_pkg') ++ make_pkg(pkg_dir) ++ script_name = _make_test_script(pkg_dir, '__main__', ++ source=source) ++ compiled_name = py_compile.compile(script_name, doraise=True) ++ os.remove(script_name) ++ pyc_file = support.make_legacy_pyc(script_name) ++ launch_name = _make_launch_script(script_dir, 'launch', 'test_pkg') ++ self._check_script(launch_name) ++ ++# Test all supported start methods (setupClass skips as appropriate) ++ ++class SpawnCmdLineTest(MultiProcessingCmdLineMixin, unittest.TestCase): ++ start_method = 'spawn' ++ main_in_children_source = test_source_main_skipped_in_children ++ ++class ForkCmdLineTest(MultiProcessingCmdLineMixin, unittest.TestCase): ++ start_method = 'fork' ++ main_in_children_source = test_source ++ ++class ForkServerCmdLineTest(MultiProcessingCmdLineMixin, unittest.TestCase): ++ start_method = 'forkserver' ++ main_in_children_source = test_source_main_skipped_in_children ++ ++def tearDownModule(): ++ support.reap_children() ++ ++if __name__ == '__main__': ++ unittest.main() +diff -r 3405dc9a6afa Lib/test/test_nis.py +--- a/Lib/test/test_nis.py ++++ b/Lib/test/test_nis.py +@@ -12,11 +12,7 @@ + maps = nis.maps() + except nis.error as msg: + # NIS is probably not active, so this test isn't useful +- if support.verbose: +- print("Test Skipped:", msg) +- # Can't raise SkipTest as regrtest only recognizes the exception +- # import time. +- return ++ self.skipTest(str(msg)) + try: + # On some systems, this map is only accessible to the + # super user +diff -r 3405dc9a6afa Lib/test/test_ntpath.py +--- a/Lib/test/test_ntpath.py ++++ b/Lib/test/test_ntpath.py +@@ -66,6 +66,32 @@ + ('', '\\\\conky\\\\mountpoint\\foo\\bar')) + tester('ntpath.splitdrive("//conky//mountpoint/foo/bar")', + ('', '//conky//mountpoint/foo/bar')) ++ # Issue #19911: UNC part containing U+0130 ++ self.assertEqual(ntpath.splitdrive('//conky/MOUNTPOİNT/foo/bar'), ++ ('//conky/MOUNTPOİNT', '/foo/bar')) ++ ++ def test_splitunc(self): ++ with self.assertWarns(DeprecationWarning): ++ ntpath.splitunc('') ++ with support.check_warnings(('', DeprecationWarning)): ++ tester('ntpath.splitunc("c:\\foo\\bar")', ++ ('', 'c:\\foo\\bar')) ++ tester('ntpath.splitunc("c:/foo/bar")', ++ ('', 'c:/foo/bar')) ++ tester('ntpath.splitunc("\\\\conky\\mountpoint\\foo\\bar")', ++ ('\\\\conky\\mountpoint', '\\foo\\bar')) ++ tester('ntpath.splitunc("//conky/mountpoint/foo/bar")', ++ ('//conky/mountpoint', '/foo/bar')) ++ tester('ntpath.splitunc("\\\\\\conky\\mountpoint\\foo\\bar")', ++ ('', '\\\\\\conky\\mountpoint\\foo\\bar')) ++ tester('ntpath.splitunc("///conky/mountpoint/foo/bar")', ++ ('', '///conky/mountpoint/foo/bar')) ++ tester('ntpath.splitunc("\\\\conky\\\\mountpoint\\foo\\bar")', ++ ('', '\\\\conky\\\\mountpoint\\foo\\bar')) ++ tester('ntpath.splitunc("//conky//mountpoint/foo/bar")', ++ ('', '//conky//mountpoint/foo/bar')) ++ self.assertEqual(ntpath.splitunc('//conky/MOUNTPOİNT/foo/bar'), ++ ('//conky/MOUNTPOİNT', '/foo/bar')) + + def test_split(self): + tester('ntpath.split("c:\\foo\\bar")', ('c:\\foo', 'bar')) +@@ -218,7 +244,7 @@ + import nt + tester('ntpath.abspath("C:\\")', "C:\\") + except ImportError: +- pass ++ self.skipTest('nt module not available') + + def test_relpath(self): + currentdir = os.path.split(os.getcwd())[-1] +diff -r 3405dc9a6afa Lib/test/test_os.py +--- a/Lib/test/test_os.py ++++ b/Lib/test/test_os.py +@@ -508,7 +508,7 @@ + try: + os.stat(r"c:\pagefile.sys") + except FileNotFoundError: +- pass # file does not exist; cannot run test ++ self.skipTest(r'c:\pagefile.sys does not exist') + except OSError as e: + self.fail("Could not stat pagefile.sys") + +diff -r 3405dc9a6afa Lib/test/test_pathlib.py +--- a/Lib/test/test_pathlib.py ++++ b/Lib/test/test_pathlib.py +@@ -536,9 +536,14 @@ + P = self.cls + p = P('a/b') + self.assertRaises(TypeError, p.relative_to) ++ self.assertRaises(TypeError, p.relative_to, b'a') + self.assertEqual(p.relative_to(P()), P('a/b')) ++ self.assertEqual(p.relative_to(''), P('a/b')) + self.assertEqual(p.relative_to(P('a')), P('b')) ++ self.assertEqual(p.relative_to('a'), P('b')) ++ self.assertEqual(p.relative_to('a/'), P('b')) + self.assertEqual(p.relative_to(P('a/b')), P()) ++ self.assertEqual(p.relative_to('a/b'), P()) + # With several args + self.assertEqual(p.relative_to('a', 'b'), P()) + # Unrelated paths +@@ -548,13 +553,18 @@ + self.assertRaises(ValueError, p.relative_to, P('/a')) + p = P('/a/b') + self.assertEqual(p.relative_to(P('/')), P('a/b')) ++ self.assertEqual(p.relative_to('/'), P('a/b')) + self.assertEqual(p.relative_to(P('/a')), P('b')) ++ self.assertEqual(p.relative_to('/a'), P('b')) ++ self.assertEqual(p.relative_to('/a/'), P('b')) + self.assertEqual(p.relative_to(P('/a/b')), P()) ++ self.assertEqual(p.relative_to('/a/b'), P()) + # Unrelated paths + self.assertRaises(ValueError, p.relative_to, P('/c')) + self.assertRaises(ValueError, p.relative_to, P('/a/b/c')) + self.assertRaises(ValueError, p.relative_to, P('/a/c')) + self.assertRaises(ValueError, p.relative_to, P()) ++ self.assertRaises(ValueError, p.relative_to, '') + self.assertRaises(ValueError, p.relative_to, P('a')) + + def test_pickling_common(self): +@@ -917,42 +927,61 @@ + + def test_relative_to(self): + P = self.cls +- p = P('c:a/b') +- self.assertEqual(p.relative_to(P('c:')), P('a/b')) +- self.assertEqual(p.relative_to(P('c:a')), P('b')) +- self.assertEqual(p.relative_to(P('c:a/b')), P()) ++ p = P('C:Foo/Bar') ++ self.assertEqual(p.relative_to(P('c:')), P('Foo/Bar')) ++ self.assertEqual(p.relative_to('c:'), P('Foo/Bar')) ++ self.assertEqual(p.relative_to(P('c:foO')), P('Bar')) ++ self.assertEqual(p.relative_to('c:foO'), P('Bar')) ++ self.assertEqual(p.relative_to('c:foO/'), P('Bar')) ++ self.assertEqual(p.relative_to(P('c:foO/baR')), P()) ++ self.assertEqual(p.relative_to('c:foO/baR'), P()) + # Unrelated paths + self.assertRaises(ValueError, p.relative_to, P()) ++ self.assertRaises(ValueError, p.relative_to, '') + self.assertRaises(ValueError, p.relative_to, P('d:')) +- self.assertRaises(ValueError, p.relative_to, P('a')) +- self.assertRaises(ValueError, p.relative_to, P('/a')) +- self.assertRaises(ValueError, p.relative_to, P('c:a/b/c')) +- self.assertRaises(ValueError, p.relative_to, P('c:a/c')) +- self.assertRaises(ValueError, p.relative_to, P('c:/a')) +- p = P('c:/a/b') +- self.assertEqual(p.relative_to(P('c:')), P('/a/b')) +- self.assertEqual(p.relative_to(P('c:/')), P('a/b')) +- self.assertEqual(p.relative_to(P('c:/a')), P('b')) +- self.assertEqual(p.relative_to(P('c:/a/b')), P()) ++ self.assertRaises(ValueError, p.relative_to, P('/')) ++ self.assertRaises(ValueError, p.relative_to, P('Foo')) ++ self.assertRaises(ValueError, p.relative_to, P('/Foo')) ++ self.assertRaises(ValueError, p.relative_to, P('C:/Foo')) ++ self.assertRaises(ValueError, p.relative_to, P('C:Foo/Bar/Baz')) ++ self.assertRaises(ValueError, p.relative_to, P('C:Foo/Baz')) ++ p = P('C:/Foo/Bar') ++ self.assertEqual(p.relative_to(P('c:')), P('/Foo/Bar')) ++ self.assertEqual(p.relative_to('c:'), P('/Foo/Bar')) ++ self.assertEqual(str(p.relative_to(P('c:'))), '\\Foo\\Bar') ++ self.assertEqual(str(p.relative_to('c:')), '\\Foo\\Bar') ++ self.assertEqual(p.relative_to(P('c:/')), P('Foo/Bar')) ++ self.assertEqual(p.relative_to('c:/'), P('Foo/Bar')) ++ self.assertEqual(p.relative_to(P('c:/foO')), P('Bar')) ++ self.assertEqual(p.relative_to('c:/foO'), P('Bar')) ++ self.assertEqual(p.relative_to('c:/foO/'), P('Bar')) ++ self.assertEqual(p.relative_to(P('c:/foO/baR')), P()) ++ self.assertEqual(p.relative_to('c:/foO/baR'), P()) + # Unrelated paths +- self.assertRaises(ValueError, p.relative_to, P('c:/c')) +- self.assertRaises(ValueError, p.relative_to, P('c:/a/b/c')) +- self.assertRaises(ValueError, p.relative_to, P('c:/a/c')) +- self.assertRaises(ValueError, p.relative_to, P('c:a')) ++ self.assertRaises(ValueError, p.relative_to, P('C:/Baz')) ++ self.assertRaises(ValueError, p.relative_to, P('C:/Foo/Bar/Baz')) ++ self.assertRaises(ValueError, p.relative_to, P('C:/Foo/Baz')) ++ self.assertRaises(ValueError, p.relative_to, P('C:Foo')) + self.assertRaises(ValueError, p.relative_to, P('d:')) + self.assertRaises(ValueError, p.relative_to, P('d:/')) +- self.assertRaises(ValueError, p.relative_to, P('/a')) +- self.assertRaises(ValueError, p.relative_to, P('//c/a')) ++ self.assertRaises(ValueError, p.relative_to, P('/')) ++ self.assertRaises(ValueError, p.relative_to, P('/Foo')) ++ self.assertRaises(ValueError, p.relative_to, P('//C/Foo')) + # UNC paths +- p = P('//a/b/c/d') +- self.assertEqual(p.relative_to(P('//a/b')), P('c/d')) +- self.assertEqual(p.relative_to(P('//a/b/c')), P('d')) +- self.assertEqual(p.relative_to(P('//a/b/c/d')), P()) ++ p = P('//Server/Share/Foo/Bar') ++ self.assertEqual(p.relative_to(P('//sErver/sHare')), P('Foo/Bar')) ++ self.assertEqual(p.relative_to('//sErver/sHare'), P('Foo/Bar')) ++ self.assertEqual(p.relative_to('//sErver/sHare/'), P('Foo/Bar')) ++ self.assertEqual(p.relative_to(P('//sErver/sHare/Foo')), P('Bar')) ++ self.assertEqual(p.relative_to('//sErver/sHare/Foo'), P('Bar')) ++ self.assertEqual(p.relative_to('//sErver/sHare/Foo/'), P('Bar')) ++ self.assertEqual(p.relative_to(P('//sErver/sHare/Foo/Bar')), P()) ++ self.assertEqual(p.relative_to('//sErver/sHare/Foo/Bar'), P()) + # Unrelated paths +- self.assertRaises(ValueError, p.relative_to, P('/a/b/c')) +- self.assertRaises(ValueError, p.relative_to, P('c:/a/b/c')) +- self.assertRaises(ValueError, p.relative_to, P('//z/b/c')) +- self.assertRaises(ValueError, p.relative_to, P('//a/z/c')) ++ self.assertRaises(ValueError, p.relative_to, P('/Server/Share/Foo')) ++ self.assertRaises(ValueError, p.relative_to, P('c:/Server/Share/Foo')) ++ self.assertRaises(ValueError, p.relative_to, P('//z/Share/Foo')) ++ self.assertRaises(ValueError, p.relative_to, P('//Server/z/Foo')) + + def test_is_absolute(self): + P = self.cls +@@ -975,6 +1004,48 @@ + self.assertTrue(P('//a/b/c').is_absolute()) + self.assertTrue(P('//a/b/c/d').is_absolute()) + ++ def test_join(self): ++ P = self.cls ++ p = P('C:/a/b') ++ pp = p.joinpath('x/y') ++ self.assertEqual(pp, P('C:/a/b/x/y')) ++ pp = p.joinpath('/x/y') ++ self.assertEqual(pp, P('C:/x/y')) ++ # Joining with a different drive => the first path is ignored, even ++ # if the second path is relative. ++ pp = p.joinpath('D:x/y') ++ self.assertEqual(pp, P('D:x/y')) ++ pp = p.joinpath('D:/x/y') ++ self.assertEqual(pp, P('D:/x/y')) ++ pp = p.joinpath('//host/share/x/y') ++ self.assertEqual(pp, P('//host/share/x/y')) ++ # Joining with the same drive => the first path is appended to if ++ # the second path is relative. ++ pp = p.joinpath('c:x/y') ++ self.assertEqual(pp, P('C:/a/b/x/y')) ++ pp = p.joinpath('c:/x/y') ++ self.assertEqual(pp, P('C:/x/y')) ++ ++ def test_div(self): ++ # Basically the same as joinpath() ++ P = self.cls ++ p = P('C:/a/b') ++ self.assertEqual(p / 'x/y', P('C:/a/b/x/y')) ++ self.assertEqual(p / 'x' / 'y', P('C:/a/b/x/y')) ++ self.assertEqual(p / '/x/y', P('C:/x/y')) ++ self.assertEqual(p / '/x' / 'y', P('C:/x/y')) ++ # Joining with a different drive => the first path is ignored, even ++ # if the second path is relative. ++ self.assertEqual(p / 'D:x/y', P('D:x/y')) ++ self.assertEqual(p / 'D:' / 'x/y', P('D:x/y')) ++ self.assertEqual(p / 'D:/x/y', P('D:/x/y')) ++ self.assertEqual(p / 'D:' / '/x/y', P('D:/x/y')) ++ self.assertEqual(p / '//host/share/x/y', P('//host/share/x/y')) ++ # Joining with the same drive => the first path is appended to if ++ # the second path is relative. ++ self.assertEqual(p / 'c:x/y', P('C:/a/b/x/y')) ++ self.assertEqual(p / 'c:/x/y', P('C:/x/y')) ++ + def test_is_reserved(self): + P = self.cls + self.assertIs(False, P('').is_reserved()) +@@ -1093,20 +1164,21 @@ + with open(join('dirC', 'dirD', 'fileD'), 'wb') as f: + f.write(b"this is file D\n") + if not symlink_skip_reason: +- if os.name == 'nt': +- # Workaround for http://bugs.python.org/issue13772 +- def dirlink(src, dest): +- os.symlink(src, dest, target_is_directory=True) +- else: +- def dirlink(src, dest): +- os.symlink(src, dest) + # Relative symlinks + os.symlink('fileA', join('linkA')) + os.symlink('non-existing', join('brokenLink')) +- dirlink('dirB', join('linkB')) +- dirlink(os.path.join('..', 'dirB'), join('dirA', 'linkC')) ++ self.dirlink('dirB', join('linkB')) ++ self.dirlink(os.path.join('..', 'dirB'), join('dirA', 'linkC')) + # This one goes upwards but doesn't create a loop +- dirlink(os.path.join('..', 'dirB'), join('dirB', 'linkD')) ++ self.dirlink(os.path.join('..', 'dirB'), join('dirB', 'linkD')) ++ ++ if os.name == 'nt': ++ # Workaround for http://bugs.python.org/issue13772 ++ def dirlink(self, src, dest): ++ os.symlink(src, dest, target_is_directory=True) ++ else: ++ def dirlink(self, src, dest): ++ os.symlink(src, dest) + + def assertSame(self, path_a, path_b): + self.assertTrue(os.path.samefile(str(path_a), str(path_b)), +@@ -1269,6 +1341,16 @@ + p = P(BASE, 'dirA', 'linkX', 'linkY', 'fileB') + self._check_resolve_absolute(p, P(BASE, 'dirB', 'fileB')) + ++ @with_symlinks ++ def test_resolve_dot(self): ++ # See https://bitbucket.org/pitrou/pathlib/issue/9/pathresolve-fails-on-complex-symlinks ++ p = self.cls(BASE) ++ self.dirlink('.', join('0')) ++ self.dirlink(os.path.join('0', '0'), join('1')) ++ self.dirlink(os.path.join('1', '1'), join('2')) ++ q = p / '2' ++ self.assertEqual(q.resolve(), p) ++ + def test_with(self): + p = self.cls(BASE) + it = p.iterdir() +@@ -1322,14 +1404,22 @@ + def test_owner(self): + p = self.cls(BASE) / 'fileA' + uid = p.stat().st_uid +- name = pwd.getpwuid(uid).pw_name ++ try: ++ name = pwd.getpwuid(uid).pw_name ++ except KeyError: ++ self.skipTest( ++ "user %d doesn't have an entry in the system database" % uid) + self.assertEqual(name, p.owner()) + + @unittest.skipUnless(grp, "the grp module is needed for this test") + def test_group(self): + p = self.cls(BASE) / 'fileA' + gid = p.stat().st_gid +- name = grp.getgrgid(gid).gr_name ++ try: ++ name = grp.getgrgid(gid).gr_name ++ except KeyError: ++ self.skipTest( ++ "group %d doesn't have an entry in the system database" % gid) + self.assertEqual(name, p.group()) + + def test_unlink(self): +@@ -1417,7 +1507,6 @@ + with self.assertRaises(OSError) as cm: + p.mkdir() + self.assertEqual(cm.exception.errno, errno.EEXIST) +- # XXX test `mode` arg + + def test_mkdir_parents(self): + # Creating a chain of directories +@@ -1432,7 +1521,17 @@ + with self.assertRaises(OSError) as cm: + p.mkdir(parents=True) + self.assertEqual(cm.exception.errno, errno.EEXIST) +- # XXX test `mode` arg ++ # test `mode` arg ++ mode = stat.S_IMODE(p.stat().st_mode) # default mode ++ p = self.cls(BASE, 'newdirD', 'newdirE') ++ p.mkdir(0o555, parents=True) ++ self.assertTrue(p.exists()) ++ self.assertTrue(p.is_dir()) ++ if os.name != 'nt': ++ # the directory's permissions follow the mode argument ++ self.assertEqual(stat.S_IMODE(p.stat().st_mode), 0o555 & mode) ++ # the parent's permissions follow the default process settings ++ self.assertEqual(stat.S_IMODE(p.parent.stat().st_mode), mode) + + @with_symlinks + def test_symlink_to(self): +@@ -1559,6 +1658,59 @@ + # 'bin' + self.assertIs(p.parts[2], q.parts[3]) + ++ def _check_complex_symlinks(self, link0_target): ++ # Test solving a non-looping chain of symlinks (issue #19887) ++ P = self.cls(BASE) ++ self.dirlink(os.path.join('link0', 'link0'), join('link1')) ++ self.dirlink(os.path.join('link1', 'link1'), join('link2')) ++ self.dirlink(os.path.join('link2', 'link2'), join('link3')) ++ self.dirlink(link0_target, join('link0')) ++ ++ # Resolve absolute paths ++ p = (P / 'link0').resolve() ++ self.assertEqual(p, P) ++ self.assertEqual(str(p), BASE) ++ p = (P / 'link1').resolve() ++ self.assertEqual(p, P) ++ self.assertEqual(str(p), BASE) ++ p = (P / 'link2').resolve() ++ self.assertEqual(p, P) ++ self.assertEqual(str(p), BASE) ++ p = (P / 'link3').resolve() ++ self.assertEqual(p, P) ++ self.assertEqual(str(p), BASE) ++ ++ # Resolve relative paths ++ old_path = os.getcwd() ++ os.chdir(BASE) ++ try: ++ p = self.cls('link0').resolve() ++ self.assertEqual(p, P) ++ self.assertEqual(str(p), BASE) ++ p = self.cls('link1').resolve() ++ self.assertEqual(p, P) ++ self.assertEqual(str(p), BASE) ++ p = self.cls('link2').resolve() ++ self.assertEqual(p, P) ++ self.assertEqual(str(p), BASE) ++ p = self.cls('link3').resolve() ++ self.assertEqual(p, P) ++ self.assertEqual(str(p), BASE) ++ finally: ++ os.chdir(old_path) ++ ++ @with_symlinks ++ def test_complex_symlinks_absolute(self): ++ self._check_complex_symlinks(BASE) ++ ++ @with_symlinks ++ def test_complex_symlinks_relative(self): ++ self._check_complex_symlinks('.') ++ ++ @with_symlinks ++ def test_complex_symlinks_relative_dot_dot(self): ++ self._check_complex_symlinks(os.path.join('dirA', '..')) ++ + + class PathTest(_BasePathTest, unittest.TestCase): + cls = pathlib.Path +diff -r 3405dc9a6afa Lib/test/test_pep3151.py +--- a/Lib/test/test_pep3151.py ++++ b/Lib/test/test_pep3151.py +@@ -157,8 +157,6 @@ + e.characters_written = 5 + self.assertEqual(e.characters_written, 5) + +- # XXX VMSError not tested +- + + class ExplicitSubclassingTest(unittest.TestCase): + +diff -r 3405dc9a6afa Lib/test/test_pickle.py +--- a/Lib/test/test_pickle.py ++++ b/Lib/test/test_pickle.py +@@ -83,13 +83,17 @@ + + + class PyDispatchTableTests(AbstractDispatchTableTests): ++ + pickler_class = pickle._Pickler ++ + def get_dispatch_table(self): + return pickle.dispatch_table.copy() + + + class PyChainDispatchTableTests(AbstractDispatchTableTests): ++ + pickler_class = pickle._Pickler ++ + def get_dispatch_table(self): + return collections.ChainMap({}, pickle.dispatch_table) + +diff -r 3405dc9a6afa Lib/test/test_pickletools.py +--- a/Lib/test/test_pickletools.py ++++ b/Lib/test/test_pickletools.py +@@ -6,8 +6,6 @@ + + class OptimizedPickleTests(AbstractPickleTests, AbstractPickleModuleTests): + +- optimized = True +- + def dumps(self, arg, proto=None): + return pickletools.optimize(pickle.dumps(arg, proto)) + +diff -r 3405dc9a6afa Lib/test/test_platform.py +--- a/Lib/test/test_platform.py ++++ b/Lib/test/test_platform.py +@@ -1,7 +1,9 @@ ++from unittest import mock + import os + import platform + import subprocess + import sys ++import tempfile + import unittest + import warnings + +@@ -295,6 +297,19 @@ + returncode = ret >> 8 + self.assertEqual(returncode, len(data)) + ++ def test_linux_distribution_encoding(self): ++ # Issue #17429 ++ with tempfile.TemporaryDirectory() as tempdir: ++ filename = os.path.join(tempdir, 'fedora-release') ++ with open(filename, 'w', encoding='utf-8') as f: ++ f.write('Fedora release 19 (Schr\xf6dinger\u2019s Cat)\n') ++ ++ with mock.patch('platform._UNIXCONFDIR', tempdir): ++ distname, version, distid = platform.linux_distribution() ++ ++ self.assertEqual(distname, 'Fedora') ++ self.assertEqual(version, '19') ++ self.assertEqual(distid, 'Schr\xf6dinger\u2019s Cat') + + def test_main(): + support.run_unittest( +diff -r 3405dc9a6afa Lib/test/test_poll.py +--- a/Lib/test/test_poll.py ++++ b/Lib/test/test_poll.py +@@ -4,7 +4,7 @@ + import subprocess + import random + import select +-import _testcapi ++from _testcapi import USHRT_MAX, INT_MAX, UINT_MAX + try: + import threading + except ImportError: +@@ -161,14 +161,13 @@ + if x != 5: + self.fail('Overflow must have occurred') + +- pollster = select.poll() +- # Issue 15989 +- self.assertRaises(OverflowError, pollster.register, 0, +- _testcapi.SHRT_MAX + 1) +- self.assertRaises(OverflowError, pollster.register, 0, +- _testcapi.USHRT_MAX + 1) +- self.assertRaises(OverflowError, pollster.poll, _testcapi.INT_MAX + 1) +- self.assertRaises(OverflowError, pollster.poll, _testcapi.UINT_MAX + 1) ++ # Issues #15989, #17919 ++ self.assertRaises(OverflowError, pollster.register, 0, -1) ++ self.assertRaises(OverflowError, pollster.register, 0, USHRT_MAX + 1) ++ self.assertRaises(OverflowError, pollster.modify, 1, -1) ++ self.assertRaises(OverflowError, pollster.modify, 1, USHRT_MAX + 1) ++ self.assertRaises(OverflowError, pollster.poll, INT_MAX + 1) ++ self.assertRaises(OverflowError, pollster.poll, UINT_MAX + 1) + + @unittest.skipUnless(threading, 'Threading required for this test.') + @reap_threads +diff -r 3405dc9a6afa Lib/test/test_poplib.py +--- a/Lib/test/test_poplib.py ++++ b/Lib/test/test_poplib.py +@@ -21,9 +21,14 @@ + SUPPORTS_SSL = False + if hasattr(poplib, 'POP3_SSL'): + import ssl ++ from ssl import HAS_SNI + + SUPPORTS_SSL = True +- CERTFILE = os.path.join(os.path.dirname(__file__) or os.curdir, "keycert.pem") ++ CERTFILE = os.path.join(os.path.dirname(__file__) or os.curdir, "keycert3.pem") ++ CAFILE = os.path.join(os.path.dirname(__file__) or os.curdir, "pycacert.pem") ++else: ++ HAS_SNI = False ++ + requires_ssl = skipUnless(SUPPORTS_SSL, 'SSL not supported') + + # the dummy data returned by server when LIST and RETR commands are issued +@@ -329,9 +334,16 @@ + self.assertEqual(resp, expected) + + @requires_ssl ++ @skipUnless(HAS_SNI, 'No SNI support in ssl module') + def test_stls_context(self): + expected = b'+OK Begin TLS negotiation' + ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1) ++ ctx.load_verify_locations(CAFILE) ++ ctx.verify_mode = ssl.CERT_REQUIRED ++ ctx.check_hostname = True ++ with self.assertRaises(ssl.CertificateError): ++ resp = self.client.stls(context=ctx) ++ self.client = poplib.POP3("localhost", self.server.port, timeout=3) + resp = self.client.stls(context=ctx) + self.assertEqual(resp, expected) + +@@ -414,7 +426,7 @@ + # happens in the test_too_long_lines case; the overlong + # response will be treated as response to QUIT and raise + # this exception +- pass ++ self.client.close() + self.server.stop() + + def test_stls(self): +diff -r 3405dc9a6afa Lib/test/test_pwd.py +--- a/Lib/test/test_pwd.py ++++ b/Lib/test/test_pwd.py +@@ -8,8 +8,6 @@ + + def test_values(self): + entries = pwd.getpwall() +- entriesbyname = {} +- entriesbyuid = {} + + for e in entries: + self.assertEqual(len(e), 7) +@@ -32,13 +30,20 @@ + # for one uid + # self.assertEqual(pwd.getpwuid(e.pw_uid), e) + # instead of this collect all entries for one uid +- # and check afterwards ++ # and check afterwards (done in test_values_extended) ++ ++ def test_values_extended(self): ++ entries = pwd.getpwall() ++ entriesbyname = {} ++ entriesbyuid = {} ++ ++ if len(entries) > 1000: # Huge passwd file (NIS?) -- skip this test ++ self.skipTest('passwd file is huge; extended test skipped') ++ ++ for e in entries: + entriesbyname.setdefault(e.pw_name, []).append(e) + entriesbyuid.setdefault(e.pw_uid, []).append(e) + +- if len(entries) > 1000: # Huge passwd file (NIS?) -- skip the rest +- return +- + # check whether the entry returned by getpwuid() + # for each uid is among those from getpwall() for this uid + for e in entries: +diff -r 3405dc9a6afa Lib/test/test_random.py +--- a/Lib/test/test_random.py ++++ b/Lib/test/test_random.py +@@ -240,10 +240,10 @@ + + def test_bigrand_ranges(self): + for i in [40,80, 160, 200, 211, 250, 375, 512, 550]: +- start = self.gen.randrange(2 ** i) +- stop = self.gen.randrange(2 ** (i-2)) ++ start = self.gen.randrange(2 ** (i-2)) ++ stop = self.gen.randrange(2 ** i) + if stop <= start: +- return ++ continue + self.assertTrue(start <= self.gen.randrange(start, stop) < stop) + + def test_rangelimits(self): +@@ -432,10 +432,10 @@ + + def test_bigrand_ranges(self): + for i in [40,80, 160, 200, 211, 250, 375, 512, 550]: +- start = self.gen.randrange(2 ** i) +- stop = self.gen.randrange(2 ** (i-2)) ++ start = self.gen.randrange(2 ** (i-2)) ++ stop = self.gen.randrange(2 ** i) + if stop <= start: +- return ++ continue + self.assertTrue(start <= self.gen.randrange(start, stop) < stop) + + def test_rangelimits(self): +diff -r 3405dc9a6afa Lib/test/test_reprlib.py +--- a/Lib/test/test_reprlib.py ++++ b/Lib/test/test_reprlib.py +@@ -167,8 +167,15 @@ + eq(r([[[[[[[{}]]]]]]]), "[[[[[[[...]]]]]]]") + + def test_cell(self): +- # XXX Hmm? How to get at a cell object? +- pass ++ def get_cell(): ++ x = 42 ++ def inner(): ++ return x ++ return inner ++ x = get_cell().__closure__[0] ++ self.assertRegex(repr(x), r'') ++ self.assertRegex(r(x), r'') + + def test_descriptors(self): + eq = self.assertEqual +@@ -274,6 +281,7 @@ + eq(repr(foo.foo), + "" % foo.__name__) + ++ @unittest.skip('need a suitable object') + def test_object(self): + # XXX Test the repr of a type with a really long tp_name but with no + # tp_repr. WIBNI we had ::Inline? :) +@@ -321,6 +329,7 @@ + ' 1: print(" Package tree in:", sub_dir) + sys.path.insert(0, pkg_dir) + if verbose > 1: print(" Updated sys.path:", sys.path[0]) +- for i in range(depth): +- sub_dir = os.path.join(sub_dir, pkg_name) +- pkg_fname = self._add_pkg_dir(sub_dir) +- if verbose > 1: print(" Next level in:", sub_dir) +- if verbose > 1: print(" Created:", pkg_fname) ++ if depth: ++ namespace_flags = [parent_namespaces] * depth ++ namespace_flags[-1] = namespace ++ for namespace_flag in namespace_flags: ++ sub_dir = os.path.join(sub_dir, pkg_name) ++ pkg_fname = self._add_pkg_dir(sub_dir, namespace_flag) ++ if verbose > 1: print(" Next level in:", sub_dir) ++ if verbose > 1: print(" Created:", pkg_fname) + mod_fname = os.path.join(sub_dir, test_fname) + mod_file = open(mod_fname, "w") + mod_file.write(source) + mod_file.close() + if verbose > 1: print(" Created:", mod_fname) + mod_name = (pkg_name+".")*depth + mod_base +- return pkg_dir, mod_fname, mod_name ++ mod_spec = importlib.util.spec_from_file_location(mod_name, ++ mod_fname) ++ return pkg_dir, mod_fname, mod_name, mod_spec + + def _del_pkg(self, top, depth, mod_name): + for entry in list(sys.modules): +@@ -231,20 +271,29 @@ + def _fix_ns_for_legacy_pyc(self, ns, alter_sys): + char_to_add = "c" if __debug__ else "o" + ns["__file__"] += char_to_add ++ ns["__cached__"] = ns["__file__"] ++ spec = ns["__spec__"] ++ new_spec = importlib.util.spec_from_file_location(spec.name, ++ ns["__file__"]) ++ ns["__spec__"] = new_spec + if alter_sys: + ns["run_argv0"] += char_to_add + + +- def _check_module(self, depth, alter_sys=False): +- pkg_dir, mod_fname, mod_name = ( +- self._make_pkg(example_source, depth)) ++ def _check_module(self, depth, alter_sys=False, ++ *, namespace=False, parent_namespaces=False): ++ pkg_dir, mod_fname, mod_name, mod_spec = ( ++ self._make_pkg(example_source, depth, ++ namespace=namespace, ++ parent_namespaces=parent_namespaces)) + forget(mod_name) + expected_ns = example_namespace.copy() + expected_ns.update({ + "__name__": mod_name, + "__file__": mod_fname, ++ "__cached__": mod_spec.cached, + "__package__": mod_name.rpartition(".")[0], +-# "__spec__": None, # XXX Needs to be set. ++ "__spec__": mod_spec, + }) + if alter_sys: + expected_ns.update({ +@@ -271,17 +320,21 @@ + self._del_pkg(pkg_dir, depth, mod_name) + if verbose > 1: print("Module executed successfully") + +- def _check_package(self, depth, alter_sys=False): +- pkg_dir, mod_fname, mod_name = ( +- self._make_pkg(example_source, depth, "__main__")) ++ def _check_package(self, depth, alter_sys=False, ++ *, namespace=False, parent_namespaces=False): ++ pkg_dir, mod_fname, mod_name, mod_spec = ( ++ self._make_pkg(example_source, depth, "__main__", ++ namespace=namespace, ++ parent_namespaces=parent_namespaces)) + pkg_name = mod_name.rpartition(".")[0] + forget(mod_name) + expected_ns = example_namespace.copy() + expected_ns.update({ + "__name__": mod_name, + "__file__": mod_fname, ++ "__cached__": importlib.util.cache_from_source(mod_fname), + "__package__": pkg_name, +-# "__spec__": None, # XXX Needs to be set. ++ "__spec__": mod_spec, + }) + if alter_sys: + expected_ns.update({ +@@ -337,7 +390,7 @@ + from . import sibling + from ..uncle.cousin import nephew + """ +- pkg_dir, mod_fname, mod_name = ( ++ pkg_dir, mod_fname, mod_name, mod_spec = ( + self._make_pkg(contents, depth)) + if run_name is None: + expected_name = mod_name +@@ -376,11 +429,31 @@ + if verbose > 1: print("Testing package depth:", depth) + self._check_module(depth) + ++ def test_run_module_in_namespace_package(self): ++ for depth in range(1, 4): ++ if verbose > 1: print("Testing package depth:", depth) ++ self._check_module(depth, namespace=True, parent_namespaces=True) ++ + def test_run_package(self): + for depth in range(1, 4): + if verbose > 1: print("Testing package depth:", depth) + self._check_package(depth) + ++ def test_run_package_in_namespace_package(self): ++ for depth in range(1, 4): ++ if verbose > 1: print("Testing package depth:", depth) ++ self._check_package(depth, parent_namespaces=True) ++ ++ def test_run_namespace_package(self): ++ for depth in range(1, 4): ++ if verbose > 1: print("Testing package depth:", depth) ++ self._check_package(depth, namespace=True) ++ ++ def test_run_namespace_package_in_namespace_package(self): ++ for depth in range(1, 4): ++ if verbose > 1: print("Testing package depth:", depth) ++ self._check_package(depth, namespace=True, parent_namespaces=True) ++ + def test_run_module_alter_sys(self): + for depth in range(4): + if verbose > 1: print("Testing package depth:", depth) +@@ -404,14 +477,16 @@ + def test_run_name(self): + depth = 1 + run_name = "And now for something completely different" +- pkg_dir, mod_fname, mod_name = ( ++ pkg_dir, mod_fname, mod_name, mod_spec = ( + self._make_pkg(example_source, depth)) + forget(mod_name) + expected_ns = example_namespace.copy() + expected_ns.update({ + "__name__": run_name, + "__file__": mod_fname, ++ "__cached__": importlib.util.cache_from_source(mod_fname), + "__package__": mod_name.rpartition(".")[0], ++ "__spec__": mod_spec, + }) + def create_ns(init_globals): + return run_module(mod_name, init_globals, run_name) +@@ -440,7 +515,7 @@ + pkg_name = ".".join([base_name] * max_depth) + expected_packages.add(pkg_name) + expected_modules.add(pkg_name + ".runpy_test") +- pkg_dir, mod_fname, mod_name = ( ++ pkg_dir, mod_fname, mod_name, mod_spec = ( + self._make_pkg("", max_depth)) + self.addCleanup(self._del_pkg, pkg_dir, max_depth, mod_name) + for depth in range(2, max_depth+1): +@@ -458,21 +533,39 @@ + class RunPathTestCase(unittest.TestCase, CodeExecutionMixin): + """Unit tests for runpy.run_path""" + +- def _make_test_script(self, script_dir, script_basename, source=None): ++ def _make_test_script(self, script_dir, script_basename, ++ source=None, omit_suffix=False): + if source is None: + source = example_source +- return make_script(script_dir, script_basename, source) ++ return make_script(script_dir, script_basename, ++ source, omit_suffix) + + def _check_script(self, script_name, expected_name, expected_file, +- expected_argv0): ++ expected_argv0, mod_name=None, ++ expect_spec=True, check_loader=True): + # First check is without run_name + def create_ns(init_globals): + return run_path(script_name, init_globals) + expected_ns = example_namespace.copy() ++ if mod_name is None: ++ spec_name = expected_name ++ else: ++ spec_name = mod_name ++ if expect_spec: ++ mod_spec = importlib.util.spec_from_file_location(spec_name, ++ expected_file) ++ mod_cached = mod_spec.cached ++ if not check_loader: ++ mod_spec.loader = None ++ else: ++ mod_spec = mod_cached = None ++ + expected_ns.update({ + "__name__": expected_name, + "__file__": expected_file, ++ "__cached__": mod_cached, + "__package__": "", ++ "__spec__": mod_spec, + "run_argv0": expected_argv0, + "run_name_in_sys_modules": True, + "module_in_sys_modules": True, +@@ -482,6 +575,12 @@ + run_name = "prove.issue15230.is.fixed" + def create_ns(init_globals): + return run_path(script_name, init_globals, run_name) ++ if expect_spec and mod_name is None: ++ mod_spec = importlib.util.spec_from_file_location(run_name, ++ expected_file) ++ if not check_loader: ++ mod_spec.loader = None ++ expected_ns["__spec__"] = mod_spec + expected_ns["__name__"] = run_name + expected_ns["__package__"] = run_name.rpartition(".")[0] + self.check_code_execution(create_ns, expected_ns) +@@ -495,7 +594,15 @@ + mod_name = 'script' + script_name = self._make_test_script(script_dir, mod_name) + self._check_script(script_name, "", script_name, +- script_name) ++ script_name, expect_spec=False) ++ ++ def test_basic_script_no_suffix(self): ++ with temp_dir() as script_dir: ++ mod_name = 'script' ++ script_name = self._make_test_script(script_dir, mod_name, ++ omit_suffix=True) ++ self._check_script(script_name, "", script_name, ++ script_name, expect_spec=False) + + def test_script_compiled(self): + with temp_dir() as script_dir: +@@ -504,14 +611,14 @@ + compiled_name = py_compile.compile(script_name, doraise=True) + os.remove(script_name) + self._check_script(compiled_name, "", compiled_name, +- compiled_name) ++ compiled_name, expect_spec=False) + + def test_directory(self): + with temp_dir() as script_dir: + mod_name = '__main__' + script_name = self._make_test_script(script_dir, mod_name) + self._check_script(script_dir, "", script_name, +- script_dir) ++ script_dir, mod_name=mod_name) + + def test_directory_compiled(self): + with temp_dir() as script_dir: +@@ -522,7 +629,7 @@ + if not sys.dont_write_bytecode: + legacy_pyc = make_legacy_pyc(script_name) + self._check_script(script_dir, "", legacy_pyc, +- script_dir) ++ script_dir, mod_name=mod_name) + + def test_directory_error(self): + with temp_dir() as script_dir: +@@ -536,7 +643,8 @@ + mod_name = '__main__' + script_name = self._make_test_script(script_dir, mod_name) + zip_name, fname = make_zip_script(script_dir, 'test_zip', script_name) +- self._check_script(zip_name, "", fname, zip_name) ++ self._check_script(zip_name, "", fname, zip_name, ++ mod_name=mod_name, check_loader=False) + + def test_zipfile_compiled(self): + with temp_dir() as script_dir: +@@ -545,7 +653,8 @@ + compiled_name = py_compile.compile(script_name, doraise=True) + zip_name, fname = make_zip_script(script_dir, 'test_zip', + compiled_name) +- self._check_script(zip_name, "", fname, zip_name) ++ self._check_script(zip_name, "", fname, zip_name, ++ mod_name=mod_name, check_loader=False) + + def test_zipfile_error(self): + with temp_dir() as script_dir: +diff -r 3405dc9a6afa Lib/test/test_selectors.py +--- a/Lib/test/test_selectors.py ++++ b/Lib/test/test_selectors.py +@@ -1,4 +1,5 @@ + import errno ++import os + import random + import selectors + import signal +@@ -49,13 +50,17 @@ + + class BaseSelectorTestCase(unittest.TestCase): + ++ def make_socketpair(self): ++ rd, wr = socketpair() ++ self.addCleanup(rd.close) ++ self.addCleanup(wr.close) ++ return rd, wr ++ + def test_register(self): + s = self.SELECTOR() + self.addCleanup(s.close) + +- rd, wr = socketpair() +- self.addCleanup(rd.close) +- self.addCleanup(wr.close) ++ rd, wr = self.make_socketpair() + + key = s.register(rd, selectors.EVENT_READ, "data") + self.assertIsInstance(key, selectors.SelectorKey) +@@ -81,9 +86,7 @@ + s = self.SELECTOR() + self.addCleanup(s.close) + +- rd, wr = socketpair() +- self.addCleanup(rd.close) +- self.addCleanup(wr.close) ++ rd, wr = self.make_socketpair() + + s.register(rd, selectors.EVENT_READ) + s.unregister(rd) +@@ -94,13 +97,52 @@ + # unregister twice + self.assertRaises(KeyError, s.unregister, rd) + ++ def test_unregister_after_fd_close(self): ++ s = self.SELECTOR() ++ self.addCleanup(s.close) ++ rd, wr = self.make_socketpair() ++ r, w = rd.fileno(), wr.fileno() ++ s.register(r, selectors.EVENT_READ) ++ s.register(w, selectors.EVENT_WRITE) ++ rd.close() ++ wr.close() ++ s.unregister(r) ++ s.unregister(w) ++ ++ @unittest.skipUnless(os.name == 'posix', "requires posix") ++ def test_unregister_after_fd_close_and_reuse(self): ++ s = self.SELECTOR() ++ self.addCleanup(s.close) ++ rd, wr = self.make_socketpair() ++ r, w = rd.fileno(), wr.fileno() ++ s.register(r, selectors.EVENT_READ) ++ s.register(w, selectors.EVENT_WRITE) ++ rd2, wr2 = self.make_socketpair() ++ rd.close() ++ wr.close() ++ os.dup2(rd2.fileno(), r) ++ os.dup2(wr2.fileno(), w) ++ self.addCleanup(os.close, r) ++ self.addCleanup(os.close, w) ++ s.unregister(r) ++ s.unregister(w) ++ ++ def test_unregister_after_socket_close(self): ++ s = self.SELECTOR() ++ self.addCleanup(s.close) ++ rd, wr = self.make_socketpair() ++ s.register(rd, selectors.EVENT_READ) ++ s.register(wr, selectors.EVENT_WRITE) ++ rd.close() ++ wr.close() ++ s.unregister(rd) ++ s.unregister(wr) ++ + def test_modify(self): + s = self.SELECTOR() + self.addCleanup(s.close) + +- rd, wr = socketpair() +- self.addCleanup(rd.close) +- self.addCleanup(wr.close) ++ rd, wr = self.make_socketpair() + + key = s.register(rd, selectors.EVENT_READ) + +@@ -138,9 +180,7 @@ + s = self.SELECTOR() + self.addCleanup(s.close) + +- rd, wr = socketpair() +- self.addCleanup(rd.close) +- self.addCleanup(wr.close) ++ rd, wr = self.make_socketpair() + + s.register(rd, selectors.EVENT_READ) + s.register(wr, selectors.EVENT_WRITE) +@@ -153,9 +193,7 @@ + s = self.SELECTOR() + self.addCleanup(s.close) + +- rd, wr = socketpair() +- self.addCleanup(rd.close) +- self.addCleanup(wr.close) ++ rd, wr = self.make_socketpair() + + key = s.register(rd, selectors.EVENT_READ, "data") + self.assertEqual(key, s.get_key(rd)) +@@ -167,9 +205,7 @@ + s = self.SELECTOR() + self.addCleanup(s.close) + +- rd, wr = socketpair() +- self.addCleanup(rd.close) +- self.addCleanup(wr.close) ++ rd, wr = self.make_socketpair() + + keys = s.get_map() + self.assertFalse(keys) +@@ -194,9 +230,7 @@ + s = self.SELECTOR() + self.addCleanup(s.close) + +- rd, wr = socketpair() +- self.addCleanup(rd.close) +- self.addCleanup(wr.close) ++ rd, wr = self.make_socketpair() + + s.register(rd, selectors.EVENT_READ) + wr_key = s.register(wr, selectors.EVENT_WRITE) +@@ -214,9 +248,7 @@ + s = self.SELECTOR() + self.addCleanup(s.close) + +- rd, wr = socketpair() +- self.addCleanup(rd.close) +- self.addCleanup(wr.close) ++ rd, wr = self.make_socketpair() + + with s as sel: + sel.register(rd, selectors.EVENT_READ) +@@ -247,9 +279,7 @@ + w2r = {} + + for i in range(NUM_SOCKETS): +- rd, wr = socketpair() +- self.addCleanup(rd.close) +- self.addCleanup(wr.close) ++ rd, wr = self.make_socketpair() + s.register(rd, selectors.EVENT_READ) + s.register(wr, selectors.EVENT_WRITE) + readers.append(rd) +@@ -293,9 +323,7 @@ + s = self.SELECTOR() + self.addCleanup(s.close) + +- rd, wr = socketpair() +- self.addCleanup(rd.close) +- self.addCleanup(wr.close) ++ rd, wr = self.make_socketpair() + + s.register(wr, selectors.EVENT_WRITE) + t = time() +@@ -322,9 +350,7 @@ + s = self.SELECTOR() + self.addCleanup(s.close) + +- rd, wr = socketpair() +- self.addCleanup(rd.close) +- self.addCleanup(wr.close) ++ rd, wr = self.make_socketpair() + + orig_alrm_handler = signal.signal(signal.SIGALRM, lambda *args: None) + self.addCleanup(signal.signal, signal.SIGALRM, orig_alrm_handler) +@@ -364,16 +390,13 @@ + + for i in range(NUM_FDS // 2): + try: +- rd, wr = socketpair() ++ rd, wr = self.make_socketpair() + except OSError: + # too many FDs, skip - note that we should only catch EMFILE + # here, but apparently *BSD and Solaris can fail upon connect() + # or bind() with EADDRNOTAVAIL, so let's be safe + self.skipTest("FD limit reached") + +- self.addCleanup(rd.close) +- self.addCleanup(wr.close) +- + try: + s.register(rd, selectors.EVENT_READ) + s.register(wr, selectors.EVENT_WRITE) +diff -r 3405dc9a6afa Lib/test/test_shutil.py +--- a/Lib/test/test_shutil.py ++++ b/Lib/test/test_shutil.py +@@ -753,11 +753,9 @@ + self.assertEqual(os.stat(restrictive_subdir).st_mode, + os.stat(restrictive_subdir_dst).st_mode) + ++ @unittest.skipIf(os.name == 'nt', 'temporarily disabled on Windows') + @unittest.skipUnless(hasattr(os, 'link'), 'requires os.link') + def test_dont_copy_file_onto_link_to_itself(self): +- # Temporarily disable test on Windows. +- if os.name == 'nt': +- return + # bug 851123. + os.mkdir(TESTFN) + src = os.path.join(TESTFN, 'cheese') +diff -r 3405dc9a6afa Lib/test/test_signal.py +--- a/Lib/test/test_signal.py ++++ b/Lib/test/test_signal.py +@@ -873,7 +873,7 @@ + + # Unblock SIGUSR1 + try: +- # unblock the pending signal calls immediatly the signal handler ++ # unblock the pending signal calls immediately the signal handler + signal.pthread_sigmask(signal.SIG_UNBLOCK, [signum]) + except ZeroDivisionError: + pass +diff -r 3405dc9a6afa Lib/test/test_site.py +--- a/Lib/test/test_site.py ++++ b/Lib/test/test_site.py +@@ -6,8 +6,7 @@ + """ + import unittest + import test.support +-from test.support import run_unittest, TESTFN, EnvironmentVarGuard +-from test.support import captured_stderr ++from test.support import captured_stderr, TESTFN, EnvironmentVarGuard + import builtins + import os + import sys +@@ -19,13 +18,13 @@ + import sysconfig + from copy import copy + +-# Need to make sure to not import 'site' if someone specified ``-S`` at the +-# command-line. Detect this by just making sure 'site' has not been imported +-# already. +-if "site" in sys.modules: +- import site +-else: +- raise unittest.SkipTest("importation of site.py suppressed") ++# These tests are not particularly useful if Python was invoked with -S. ++# If you add tests that are useful under -S, this skip should be moved ++# to the class level. ++if sys.flags.no_site: ++ raise unittest.SkipTest("Python was invoked with -S") ++ ++import site + + if site.ENABLE_USER_SITE and not os.path.isdir(site.USER_SITE): + # need to add user site directory for tests +@@ -370,6 +369,7 @@ + self.assertNotIn(path, seen_paths) + seen_paths.add(path) + ++ @unittest.skip('test not implemented') + def test_add_build_dir(self): + # Test that the build directory's Modules directory is used when it + # should be. +diff -r 3405dc9a6afa Lib/test/test_smtpnet.py +--- a/Lib/test/test_smtpnet.py ++++ b/Lib/test/test_smtpnet.py +@@ -3,23 +3,35 @@ + import unittest + from test import support + import smtplib ++import socket + + ssl = support.import_module("ssl") + + support.requires("network") + ++def check_ssl_verifiy(host, port): ++ context = ssl.create_default_context() ++ with socket.create_connection((host, port)) as sock: ++ try: ++ sock = context.wrap_socket(sock, server_hostname=host) ++ except Exception: ++ return False ++ else: ++ sock.close() ++ return True ++ + + class SmtpTest(unittest.TestCase): + testServer = 'smtp.gmail.com' + remotePort = 25 +- context = ssl.SSLContext(ssl.PROTOCOL_SSLv23) + + def test_connect_starttls(self): + support.get_attribute(smtplib, 'SMTP_SSL') ++ context = ssl.SSLContext(ssl.PROTOCOL_SSLv23) + with support.transient_internet(self.testServer): + server = smtplib.SMTP(self.testServer, self.remotePort) + try: +- server.starttls(context=self.context) ++ server.starttls(context=context) + except smtplib.SMTPException as e: + if e.args[0] == 'STARTTLS extension not supported by server.': + unittest.skip(e.args[0]) +@@ -32,7 +44,7 @@ + class SmtpSSLTest(unittest.TestCase): + testServer = 'smtp.gmail.com' + remotePort = 465 +- context = ssl.SSLContext(ssl.PROTOCOL_SSLv23) ++ can_verify = check_ssl_verifiy(testServer, remotePort) + + def test_connect(self): + support.get_attribute(smtplib, 'SMTP_SSL') +@@ -49,9 +61,19 @@ + server.quit() + + def test_connect_using_sslcontext(self): ++ context = ssl.SSLContext(ssl.PROTOCOL_SSLv23) + support.get_attribute(smtplib, 'SMTP_SSL') + with support.transient_internet(self.testServer): +- server = smtplib.SMTP_SSL(self.testServer, self.remotePort, context=self.context) ++ server = smtplib.SMTP_SSL(self.testServer, self.remotePort, context=context) ++ server.ehlo() ++ server.quit() ++ ++ @unittest.skipUnless(can_verify, "SSL certificate can't be verified") ++ def test_connect_using_sslcontext_verified(self): ++ support.get_attribute(smtplib, 'SMTP_SSL') ++ context = ssl.create_default_context() ++ with support.transient_internet(self.testServer): ++ server = smtplib.SMTP_SSL(self.testServer, self.remotePort, context=context) + server.ehlo() + server.quit() + +diff -r 3405dc9a6afa Lib/test/test_socket.py +--- a/Lib/test/test_socket.py ++++ b/Lib/test/test_socket.py +@@ -745,13 +745,13 @@ + ip = socket.gethostbyname(hostname) + except OSError: + # Probably name lookup wasn't set up right; skip this test +- return ++ self.skipTest('name lookup failure') + self.assertTrue(ip.find('.') >= 0, "Error resolving host to ip.") + try: + hname, aliases, ipaddrs = socket.gethostbyaddr(ip) + except OSError: + # Probably a similar problem as above; skip this test +- return ++ self.skipTest('name lookup failure') + all_host_names = [hostname, hname] + aliases + fqhn = socket.getfqdn(ip) + if not fqhn in all_host_names: +@@ -977,16 +977,16 @@ + try: + from socket import inet_pton, AF_INET6, has_ipv6 + if not has_ipv6: +- return ++ self.skipTest('IPv6 not available') + except ImportError: +- return ++ self.skipTest('could not import needed symbols from socket') + + if sys.platform == "win32": + try: + inet_pton(AF_INET6, '::') + except OSError as e: + if e.winerror == 10022: +- return # IPv6 might not be installed on this PC ++ self.skipTest('IPv6 might not be supported') + + f = lambda a: inet_pton(AF_INET6, a) + assertInvalid = lambda a: self.assertRaises( +@@ -1063,16 +1063,16 @@ + try: + from socket import inet_ntop, AF_INET6, has_ipv6 + if not has_ipv6: +- return ++ self.skipTest('IPv6 not available') + except ImportError: +- return ++ self.skipTest('could not import needed symbols from socket') + + if sys.platform == "win32": + try: + inet_ntop(AF_INET6, b'\x00' * 16) + except OSError as e: + if e.winerror == 10022: +- return # IPv6 might not be installed on this PC ++ self.skipTest('IPv6 might not be supported') + + f = lambda a: inet_ntop(AF_INET6, a) + assertInvalid = lambda a: self.assertRaises( +@@ -1106,7 +1106,7 @@ + my_ip_addr = socket.gethostbyname(socket.gethostname()) + except OSError: + # Probably name lookup wasn't set up right; skip this test +- return ++ self.skipTest('name lookup failure') + self.assertIn(name[0], ("0.0.0.0", my_ip_addr), '%s invalid' % name[0]) + self.assertEqual(name[1], port) + +diff -r 3405dc9a6afa Lib/test/test_ssl.py +--- a/Lib/test/test_ssl.py ++++ b/Lib/test/test_ssl.py +@@ -150,6 +150,10 @@ + else: + self.assertRaises(ssl.SSLError, ssl.RAND_bytes, 16) + ++ # negative num is invalid ++ self.assertRaises(ValueError, ssl.RAND_bytes, -5) ++ self.assertRaises(ValueError, ssl.RAND_pseudo_bytes, -5) ++ + self.assertRaises(TypeError, ssl.RAND_egd, 1) + self.assertRaises(TypeError, ssl.RAND_egd, 'foo', 1) + ssl.RAND_add("this is a random string", 75.0) +@@ -628,6 +632,17 @@ + self.assertEqual(ssl.Purpose.CLIENT_AUTH.oid, + '1.3.6.1.5.5.7.3.2') + ++ def test_unsupported_dtls(self): ++ s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) ++ self.addCleanup(s.close) ++ with self.assertRaises(NotImplementedError) as cx: ++ ssl.wrap_socket(s, cert_reqs=ssl.CERT_NONE) ++ self.assertEqual(str(cx.exception), "only stream sockets are supported") ++ ctx = ssl.SSLContext(ssl.PROTOCOL_SSLv23) ++ with self.assertRaises(NotImplementedError) as cx: ++ ctx.wrap_socket(s) ++ self.assertEqual(str(cx.exception), "only stream sockets are supported") ++ + + class ContextTests(unittest.TestCase): + +@@ -1003,6 +1018,7 @@ + ctx = ssl.create_default_context() + self.assertEqual(ctx.protocol, ssl.PROTOCOL_TLSv1) + self.assertEqual(ctx.verify_mode, ssl.CERT_REQUIRED) ++ self.assertTrue(ctx.check_hostname) + self.assertEqual(ctx.options & ssl.OP_NO_SSLv2, ssl.OP_NO_SSLv2) + + with open(SIGNING_CA) as f: +@@ -1022,6 +1038,7 @@ + ctx = ssl._create_stdlib_context() + self.assertEqual(ctx.protocol, ssl.PROTOCOL_SSLv23) + self.assertEqual(ctx.verify_mode, ssl.CERT_NONE) ++ self.assertFalse(ctx.check_hostname) + self.assertEqual(ctx.options & ssl.OP_NO_SSLv2, ssl.OP_NO_SSLv2) + + ctx = ssl._create_stdlib_context(ssl.PROTOCOL_TLSv1) +@@ -1030,9 +1047,11 @@ + self.assertEqual(ctx.options & ssl.OP_NO_SSLv2, ssl.OP_NO_SSLv2) + + ctx = ssl._create_stdlib_context(ssl.PROTOCOL_TLSv1, +- cert_reqs=ssl.CERT_REQUIRED) ++ cert_reqs=ssl.CERT_REQUIRED, ++ check_hostname=True) + self.assertEqual(ctx.protocol, ssl.PROTOCOL_TLSv1) + self.assertEqual(ctx.verify_mode, ssl.CERT_REQUIRED) ++ self.assertTrue(ctx.check_hostname) + self.assertEqual(ctx.options & ssl.OP_NO_SSLv2, ssl.OP_NO_SSLv2) + + ctx = ssl._create_stdlib_context(purpose=ssl.Purpose.CLIENT_AUTH) +@@ -1040,6 +1059,28 @@ + self.assertEqual(ctx.verify_mode, ssl.CERT_NONE) + self.assertEqual(ctx.options & ssl.OP_NO_SSLv2, ssl.OP_NO_SSLv2) + ++ def test_check_hostname(self): ++ ctx = ssl.SSLContext(ssl.PROTOCOL_TLSv1) ++ self.assertFalse(ctx.check_hostname) ++ ++ # Requires CERT_REQUIRED or CERT_OPTIONAL ++ with self.assertRaises(ValueError): ++ ctx.check_hostname = True ++ ctx.verify_mode = ssl.CERT_REQUIRED ++ self.assertFalse(ctx.check_hostname) ++ ctx.check_hostname = True ++ self.assertTrue(ctx.check_hostname) ++ ++ ctx.verify_mode = ssl.CERT_OPTIONAL ++ ctx.check_hostname = True ++ self.assertTrue(ctx.check_hostname) ++ ++ # Cannot set CERT_NONE with check_hostname enabled ++ with self.assertRaises(ValueError): ++ ctx.verify_mode = ssl.CERT_NONE ++ ctx.check_hostname = False ++ self.assertFalse(ctx.check_hostname) ++ + + class SSLErrorTests(unittest.TestCase): + +@@ -1175,8 +1216,10 @@ + cert_reqs=ssl.CERT_REQUIRED, + ca_certs=SVN_PYTHON_ORG_ROOT_CERT) + try: +- self.assertEqual(errno.ECONNREFUSED, +- s.connect_ex(("svn.python.org", 444))) ++ rc = s.connect_ex(("svn.python.org", 444)) ++ # Issue #19919: Windows machines or VMs hosted on Windows ++ # machines sometimes return EWOULDBLOCK. ++ self.assertIn(rc, (errno.ECONNREFUSED, errno.EWOULDBLOCK)) + finally: + s.close() + +@@ -1393,6 +1436,21 @@ + s.close() + self.assertEqual(len(ctx.get_ca_certs()), 1) + ++ @needs_sni ++ def test_context_setget(self): ++ # Check that the context of a connected socket can be replaced. ++ with support.transient_internet("svn.python.org"): ++ ctx1 = ssl.SSLContext(ssl.PROTOCOL_TLSv1) ++ ctx2 = ssl.SSLContext(ssl.PROTOCOL_SSLv23) ++ s = socket.socket(socket.AF_INET) ++ with ctx1.wrap_socket(s) as ss: ++ ss.connect(("svn.python.org", 443)) ++ self.assertIs(ss.context, ctx1) ++ self.assertIs(ss._sslobj.context, ctx1) ++ ss.context = ctx2 ++ self.assertIs(ss.context, ctx2) ++ self.assertIs(ss._sslobj.context, ctx2) ++ + try: + import threading + except ImportError: +@@ -1930,6 +1988,45 @@ + cert = s.getpeercert() + self.assertTrue(cert, "Can't get peer certificate.") + ++ @needs_sni ++ def test_check_hostname(self): ++ if support.verbose: ++ sys.stdout.write("\n") ++ ++ server_context = ssl.SSLContext(ssl.PROTOCOL_TLSv1) ++ server_context.load_cert_chain(SIGNED_CERTFILE) ++ ++ context = ssl.SSLContext(ssl.PROTOCOL_TLSv1) ++ context.verify_mode = ssl.CERT_REQUIRED ++ context.check_hostname = True ++ context.load_verify_locations(SIGNING_CA) ++ ++ # correct hostname should verify ++ server = ThreadedEchoServer(context=server_context, chatty=True) ++ with server: ++ with context.wrap_socket(socket.socket(), ++ server_hostname="localhost") as s: ++ s.connect((HOST, server.port)) ++ cert = s.getpeercert() ++ self.assertTrue(cert, "Can't get peer certificate.") ++ ++ # incorrect hostname should raise an exception ++ server = ThreadedEchoServer(context=server_context, chatty=True) ++ with server: ++ with context.wrap_socket(socket.socket(), ++ server_hostname="invalid") as s: ++ with self.assertRaisesRegex(ssl.CertificateError, ++ "hostname 'invalid' doesn't match 'localhost'"): ++ s.connect((HOST, server.port)) ++ ++ # missing server_hostname arg should cause an exception, too ++ server = ThreadedEchoServer(context=server_context, chatty=True) ++ with server: ++ with socket.socket() as s: ++ with self.assertRaisesRegex(ValueError, ++ "check_hostname requires server_hostname"): ++ context.wrap_socket(s) ++ + def test_empty_cert(self): + """Connecting with an empty cert file""" + bad_cert_test(os.path.join(os.path.dirname(__file__) or os.curdir, +diff -r 3405dc9a6afa Lib/test/test_statistics.py +--- a/Lib/test/test_statistics.py ++++ b/Lib/test/test_statistics.py +@@ -8,6 +8,7 @@ + import doctest + import math + import random ++import sys + import types + import unittest + +@@ -271,9 +272,9 @@ + # Test that approx_equal(a, b) == approx_equal(b, a) + args = [-23, -2, 5, 107, 93568] + delta = 2 +- for x in args: ++ for a in args: + for type_ in (int, float, Decimal, Fraction): +- x = type_(x)*100 ++ x = type_(a)*100 + y = x + delta + r = abs(delta/max(x, y)) + # There are five cases to check: +@@ -625,6 +626,8 @@ + + + class DocTests(unittest.TestCase): ++ @unittest.skipIf(sys.flags.optimize >= 2, ++ "Docstrings are omitted with -OO and above") + def test_doc_tests(self): + failed, tried = doctest.testmod(statistics) + self.assertGreater(tried, 0) +diff -r 3405dc9a6afa Lib/test/test_strptime.py +--- a/Lib/test/test_strptime.py ++++ b/Lib/test/test_strptime.py +@@ -223,6 +223,10 @@ + with self.assertRaises(ValueError) as e: + _strptime._strptime_time('', '%D') + self.assertIs(e.exception.__suppress_context__, True) ++ # additional check for IndexError branch (issue #19545) ++ with self.assertRaises(ValueError) as e: ++ _strptime._strptime_time('19', '%Y %') ++ self.assertIs(e.exception.__suppress_context__, True) + + def test_unconverteddata(self): + # Check ValueError is raised when there is unconverted data +@@ -319,7 +323,7 @@ + # when time.tzname[0] == time.tzname[1] and time.daylight + tz_name = time.tzname[0] + if tz_name.upper() in ("UTC", "GMT"): +- return ++ self.skipTest('need non-UTC/GMT timezone') + try: + original_tzname = time.tzname + original_daylight = time.daylight +@@ -532,7 +536,7 @@ + try: + locale.setlocale(locale.LC_TIME, ('en_US', 'UTF8')) + except locale.Error: +- return ++ self.skipTest('test needs en_US.UTF8 locale') + try: + _strptime._strptime_time('10', '%d') + # Get id of current cache object. +@@ -549,7 +553,7 @@ + # If this is the case just suppress the exception and fall-through + # to the resetting to the original locale. + except locale.Error: +- pass ++ self.skipTest('test needs de_DE.UTF8 locale') + # Make sure we don't trample on the locale setting once we leave the + # test. + finally: +diff -r 3405dc9a6afa Lib/test/test_strtod.py +--- a/Lib/test/test_strtod.py ++++ b/Lib/test/test_strtod.py +@@ -248,6 +248,37 @@ + else: + assert False, "expected ValueError" + ++ @test.support.bigmemtest(size=test.support._2G+10, memuse=3, dry_run=False) ++ def test_oversized_digit_strings(self, maxsize): ++ # Input string whose length doesn't fit in an INT. ++ s = "1." + "1" * maxsize ++ with self.assertRaises(ValueError): ++ float(s) ++ del s ++ ++ s = "0." + "0" * maxsize + "1" ++ with self.assertRaises(ValueError): ++ float(s) ++ del s ++ ++ def test_large_exponents(self): ++ # Verify that the clipping of the exponent in strtod doesn't affect the ++ # output values. ++ def positive_exp(n): ++ """ Long string with value 1.0 and exponent n""" ++ return '0.{}1e+{}'.format('0'*(n-1), n) ++ ++ def negative_exp(n): ++ """ Long string with value 1.0 and exponent -n""" ++ return '1{}e-{}'.format('0'*n, n) ++ ++ self.assertEqual(float(positive_exp(10000)), 1.0) ++ self.assertEqual(float(positive_exp(20000)), 1.0) ++ self.assertEqual(float(positive_exp(30000)), 1.0) ++ self.assertEqual(float(negative_exp(10000)), 1.0) ++ self.assertEqual(float(negative_exp(20000)), 1.0) ++ self.assertEqual(float(negative_exp(30000)), 1.0) ++ + def test_particular(self): + # inputs that produced crashes or incorrectly rounded results with + # previous versions of dtoa.c, for various reasons +diff -r 3405dc9a6afa Lib/test/test_subprocess.py +--- a/Lib/test/test_subprocess.py ++++ b/Lib/test/test_subprocess.py +@@ -1559,6 +1559,27 @@ + # all standard fds closed. + self.check_close_std_fds([0, 1, 2]) + ++ def test_small_errpipe_write_fd(self): ++ """Issue #15798: Popen should work when stdio fds are available.""" ++ new_stdin = os.dup(0) ++ new_stdout = os.dup(1) ++ try: ++ os.close(0) ++ os.close(1) ++ ++ # Side test: if errpipe_write fails to have its CLOEXEC ++ # flag set this should cause the parent to think the exec ++ # failed. Extremely unlikely: everyone supports CLOEXEC. ++ subprocess.Popen([ ++ sys.executable, "-c", ++ "print('AssertionError:0:CLOEXEC failure.')"]).wait() ++ finally: ++ # Restore original stdin and stdout ++ os.dup2(new_stdin, 0) ++ os.dup2(new_stdout, 1) ++ os.close(new_stdin) ++ os.close(new_stdout) ++ + def test_remapping_std_fds(self): + # open up some temporary files + temps = [mkstemp() for i in range(3)] +diff -r 3405dc9a6afa Lib/test/test_sunau.py +--- a/Lib/test/test_sunau.py ++++ b/Lib/test/test_sunau.py +@@ -6,10 +6,12 @@ + import sunau + + +-class SunauPCM8Test(audiotests.AudioWriteTests, +- audiotests.AudioTestsWithSourceFile, +- unittest.TestCase): ++class SunauTest(audiotests.AudioWriteTests, ++ audiotests.AudioTestsWithSourceFile): + module = sunau ++ ++ ++class SunauPCM8Test(SunauTest, unittest.TestCase): + sndfilename = 'pluck-pcm8.au' + sndfilenframes = 3307 + nchannels = 2 +@@ -26,10 +28,7 @@ + """) + + +-class SunauPCM16Test(audiotests.AudioWriteTests, +- audiotests.AudioTestsWithSourceFile, +- unittest.TestCase): +- module = sunau ++class SunauPCM16Test(SunauTest, unittest.TestCase): + sndfilename = 'pluck-pcm16.au' + sndfilenframes = 3307 + nchannels = 2 +@@ -48,10 +47,7 @@ + """) + + +-class SunauPCM24Test(audiotests.AudioWriteTests, +- audiotests.AudioTestsWithSourceFile, +- unittest.TestCase): +- module = sunau ++class SunauPCM24Test(SunauTest, unittest.TestCase): + sndfilename = 'pluck-pcm24.au' + sndfilenframes = 3307 + nchannels = 2 +@@ -76,10 +72,7 @@ + """) + + +-class SunauPCM32Test(audiotests.AudioWriteTests, +- audiotests.AudioTestsWithSourceFile, +- unittest.TestCase): +- module = sunau ++class SunauPCM32Test(SunauTest, unittest.TestCase): + sndfilename = 'pluck-pcm32.au' + sndfilenframes = 3307 + nchannels = 2 +@@ -104,10 +97,7 @@ + """) + + +-class SunauULAWTest(audiotests.AudioWriteTests, +- audiotests.AudioTestsWithSourceFile, +- unittest.TestCase): +- module = sunau ++class SunauULAWTest(SunauTest, unittest.TestCase): + sndfilename = 'pluck-ulaw.au' + sndfilenframes = 3307 + nchannels = 2 +diff -r 3405dc9a6afa Lib/test/test_sys.py +--- a/Lib/test/test_sys.py ++++ b/Lib/test/test_sys.py +@@ -447,7 +447,7 @@ + self.assertIsInstance(sys.hash_info.inf, int) + self.assertIsInstance(sys.hash_info.nan, int) + self.assertIsInstance(sys.hash_info.imag, int) +- algo = sysconfig.get_config_var("PY_HASH_ALGORITHM") ++ algo = sysconfig.get_config_var("Py_HASH_ALGORITHM") + if sys.hash_info.algorithm in {"fnv", "siphash24"}: + self.assertIn(sys.hash_info.hash_bits, {32, 64}) + self.assertIn(sys.hash_info.seed_bits, {32, 64, 128}) +@@ -457,11 +457,7 @@ + elif algo == 2: + self.assertEqual(sys.hash_info.algorithm, "fnv") + else: +- processor = platform.processor().lower() +- if processor in {"sparc", "mips"}: +- self.assertEqual(sys.hash_info.algorithm, "fnv") +- else: +- self.assertEqual(sys.hash_info.algorithm, "siphash24") ++ self.assertIn(sys.hash_info.algorithm, {"fnv", "siphash24"}) + else: + # PY_HASH_EXTERNAL + self.assertEqual(algo, 0) +@@ -669,6 +665,9 @@ + ret, out, err = assert_python_ok(*args) + self.assertIn(b"free PyDictObjects", err) + ++ # The function has no parameter ++ self.assertRaises(TypeError, sys._debugmallocstats, True) ++ + @unittest.skipUnless(hasattr(sys, "getallocatedblocks"), + "sys.getallocatedblocks unavailable on this build") + def test_getallocatedblocks(self): +@@ -822,7 +821,7 @@ + nfrees = len(x.f_code.co_freevars) + extras = x.f_code.co_stacksize + x.f_code.co_nlocals +\ + ncells + nfrees - 1 +- check(x, vsize('13P3ic' + CO_MAXBLOCKS*'3i' + 'P' + extras*'P')) ++ check(x, vsize('12P3ic' + CO_MAXBLOCKS*'3i' + 'P' + extras*'P')) + # function + def func(): pass + check(func, size('12P')) +diff -r 3405dc9a6afa Lib/test/test_sysconfig.py +--- a/Lib/test/test_sysconfig.py ++++ b/Lib/test/test_sysconfig.py +@@ -5,7 +5,7 @@ + import shutil + from copy import copy + +-from test.support import (run_unittest, TESTFN, unlink, ++from test.support import (run_unittest, TESTFN, unlink, check_warnings, + captured_stdout, skip_unless_symlink) + + import sysconfig +@@ -378,8 +378,9 @@ + @unittest.skipIf(sysconfig.get_config_var('EXT_SUFFIX') is None, + 'EXT_SUFFIX required for this test') + def test_SO_value(self): +- self.assertEqual(sysconfig.get_config_var('SO'), +- sysconfig.get_config_var('EXT_SUFFIX')) ++ with check_warnings(('', DeprecationWarning)): ++ self.assertEqual(sysconfig.get_config_var('SO'), ++ sysconfig.get_config_var('EXT_SUFFIX')) + + @unittest.skipIf(sysconfig.get_config_var('EXT_SUFFIX') is None, + 'EXT_SUFFIX required for this test') +diff -r 3405dc9a6afa Lib/test/test_syslog.py +--- a/Lib/test/test_syslog.py ++++ b/Lib/test/test_syslog.py +@@ -32,6 +32,10 @@ + def test_log_upto(self): + syslog.LOG_UPTO(syslog.LOG_INFO) + ++ def test_openlog_noargs(self): ++ syslog.openlog() ++ syslog.syslog('test message from python test_syslog') ++ + def test_main(): + support.run_unittest(__name__) + +diff -r 3405dc9a6afa Lib/test/test_tcl.py +--- a/Lib/test/test_tcl.py ++++ b/Lib/test/test_tcl.py +@@ -35,6 +35,7 @@ + + def setUp(self): + self.interp = Tcl() ++ self.wantobjects = self.interp.tk.wantobjects() + + def testEval(self): + tcl = self.interp +@@ -167,22 +168,31 @@ + def passValue(value): + return self.interp.call('set', '_', value) + +- self.assertEqual(passValue(True), True) +- self.assertEqual(passValue(False), False) ++ self.assertEqual(passValue(True), True if self.wantobjects else '1') ++ self.assertEqual(passValue(False), False if self.wantobjects else '0') + self.assertEqual(passValue('string'), 'string') + self.assertEqual(passValue('string\u20ac'), 'string\u20ac') + for i in (0, 1, -1, 2**31-1, -2**31): +- self.assertEqual(passValue(i), i) ++ self.assertEqual(passValue(i), i if self.wantobjects else str(i)) + for f in (0.0, 1.0, -1.0, 1/3, + sys.float_info.min, sys.float_info.max, + -sys.float_info.min, -sys.float_info.max): +- self.assertEqual(passValue(f), f) +- for f in float('nan'), float('inf'), -float('inf'): +- if f != f: # NaN +- self.assertNotEqual(passValue(f), f) ++ if self.wantobjects: ++ self.assertEqual(passValue(f), f) + else: +- self.assertEqual(passValue(f), f) +- self.assertEqual(passValue((1, '2', (3.4,))), (1, '2', (3.4,))) ++ self.assertEqual(float(passValue(f)), f) ++ if self.wantobjects: ++ f = passValue(float('nan')) ++ self.assertNotEqual(f, f) ++ self.assertEqual(passValue(float('inf')), float('inf')) ++ self.assertEqual(passValue(-float('inf')), -float('inf')) ++ else: ++ f = float(passValue(float('nan'))) ++ self.assertNotEqual(f, f) ++ self.assertEqual(float(passValue(float('inf'))), float('inf')) ++ self.assertEqual(float(passValue(-float('inf'))), -float('inf')) ++ self.assertEqual(passValue((1, '2', (3.4,))), ++ (1, '2', (3.4,)) if self.wantobjects else '1 2 3.4') + + def test_splitlist(self): + splitlist = self.interp.tk.splitlist +@@ -207,12 +217,15 @@ + ('a 3.4', ('a', '3.4')), + (('a', 3.4), ('a', 3.4)), + ((), ()), +- (call('list', 1, '2', (3.4,)), (1, '2', (3.4,))), ++ (call('list', 1, '2', (3.4,)), ++ (1, '2', (3.4,)) if self.wantobjects else ++ ('1', '2', '3.4')), + ] + if tcl_version >= (8, 5): + testcases += [ + (call('dict', 'create', 1, '\u20ac', b'\xe2\x82\xac', (3.4,)), +- (1, '\u20ac', '\u20ac', (3.4,))), ++ (1, '\u20ac', '\u20ac', (3.4,)) if self.wantobjects else ++ ('1', '\u20ac', '\u20ac', '3.4')), + ] + for arg, res in testcases: + self.assertEqual(splitlist(arg), res, msg=arg) +@@ -244,12 +257,15 @@ + (('a', 3.4), ('a', 3.4)), + (('a', (2, 3.4)), ('a', (2, 3.4))), + ((), ()), +- (call('list', 1, '2', (3.4,)), (1, '2', (3.4,))), ++ (call('list', 1, '2', (3.4,)), ++ (1, '2', (3.4,)) if self.wantobjects else ++ ('1', '2', '3.4')), + ] + if tcl_version >= (8, 5): + testcases += [ + (call('dict', 'create', 12, '\u20ac', b'\xe2\x82\xac', (3.4,)), +- (12, '\u20ac', '\u20ac', (3.4,))), ++ (12, '\u20ac', '\u20ac', (3.4,)) if self.wantobjects else ++ ('12', '\u20ac', '\u20ac', '3.4')), + ] + for arg, res in testcases: + self.assertEqual(split(arg), res, msg=arg) +diff -r 3405dc9a6afa Lib/test/test_telnetlib.py +--- a/Lib/test/test_telnetlib.py ++++ b/Lib/test/test_telnetlib.py +@@ -114,7 +114,6 @@ + class MockSelector(selectors.BaseSelector): + + def __init__(self): +- super().__init__() + self.keys = {} + + def register(self, fileobj, events, data=None): +@@ -123,8 +122,7 @@ + return key + + def unregister(self, fileobj): +- key = self.keys.pop(fileobj) +- return key ++ return self.keys.pop(fileobj) + + def select(self, timeout=None): + block = False +@@ -137,6 +135,9 @@ + else: + return [(key, key.events) for key in self.keys.values()] + ++ def get_map(self): ++ return self.keys ++ + + @contextlib.contextmanager + def test_socket(reads): +diff -r 3405dc9a6afa Lib/test/test_tempfile.py +--- a/Lib/test/test_tempfile.py ++++ b/Lib/test/test_tempfile.py +@@ -8,6 +8,7 @@ + import re + import warnings + import contextlib ++import weakref + + import unittest + from test import support +@@ -324,10 +325,9 @@ + finally: + os.rmdir(dir) + ++ @unittest.skipUnless(has_stat, 'os.stat not available') + def test_file_mode(self): + # _mkstemp_inner creates files with the proper mode +- if not has_stat: +- return # ugh, can't use SkipTest. + + file = self.do_create() + mode = stat.S_IMODE(os.stat(file.name).st_mode) +@@ -339,10 +339,9 @@ + expected = user * (1 + 8 + 64) + self.assertEqual(mode, expected) + ++ @unittest.skipUnless(has_spawnl, 'os.spawnl not available') + def test_noinherit(self): + # _mkstemp_inner file handles are not inherited by child processes +- if not has_spawnl: +- return # ugh, can't use SkipTest. + + if support.verbose: + v="v" +@@ -378,10 +377,9 @@ + "child process caught fatal signal %d" % -retval) + self.assertFalse(retval > 0, "child process reports failure %d"%retval) + ++ @unittest.skipUnless(has_textmode, "text mode not available") + def test_textmode(self): + # _mkstemp_inner can create files in text mode +- if not has_textmode: +- return # ugh, can't use SkipTest. + + # A text file is truncated at the first Ctrl+Z byte + f = self.do_create(bin=0) +@@ -571,10 +569,9 @@ + finally: + os.rmdir(dir) + ++ @unittest.skipUnless(has_stat, 'os.stat not available') + def test_mode(self): + # mkdtemp creates directories with the proper mode +- if not has_stat: +- return # ugh, can't use SkipTest. + + dir = self.do_create() + try: +@@ -693,6 +690,22 @@ + self.do_create(pre="a", suf="b") + self.do_create(pre="aa", suf=".txt") + ++ def test_method_lookup(self): ++ # Issue #18879: Looking up a temporary file method should keep it ++ # alive long enough. ++ f = self.do_create() ++ wr = weakref.ref(f) ++ write = f.write ++ write2 = f.write ++ del f ++ write(b'foo') ++ del write ++ write2(b'bar') ++ del write2 ++ if support.check_impl_detail(cpython=True): ++ # No reference cycle was created. ++ self.assertIsNone(wr()) ++ + def test_creates_named(self): + # NamedTemporaryFile creates files with names + f = tempfile.NamedTemporaryFile() +diff -r 3405dc9a6afa Lib/test/test_thread.py +--- a/Lib/test/test_thread.py ++++ b/Lib/test/test_thread.py +@@ -68,39 +68,35 @@ + thread.stack_size(0) + self.assertEqual(thread.stack_size(), 0, "stack_size not reset to default") + +- if os.name not in ("nt", "posix"): +- return +- +- tss_supported = True ++ @unittest.skipIf(os.name not in ("nt", "posix"), 'test meant for nt and posix') ++ def test_nt_and_posix_stack_size(self): + try: + thread.stack_size(4096) + except ValueError: + verbose_print("caught expected ValueError setting " + "stack_size(4096)") + except thread.error: +- tss_supported = False +- verbose_print("platform does not support changing thread stack " +- "size") ++ self.skipTest("platform does not support changing thread stack " ++ "size") + +- if tss_supported: +- fail_msg = "stack_size(%d) failed - should succeed" +- for tss in (262144, 0x100000, 0): +- thread.stack_size(tss) +- self.assertEqual(thread.stack_size(), tss, fail_msg % tss) +- verbose_print("successfully set stack_size(%d)" % tss) ++ fail_msg = "stack_size(%d) failed - should succeed" ++ for tss in (262144, 0x100000, 0): ++ thread.stack_size(tss) ++ self.assertEqual(thread.stack_size(), tss, fail_msg % tss) ++ verbose_print("successfully set stack_size(%d)" % tss) + +- for tss in (262144, 0x100000): +- verbose_print("trying stack_size = (%d)" % tss) +- self.next_ident = 0 +- self.created = 0 +- for i in range(NUMTASKS): +- self.newtask() ++ for tss in (262144, 0x100000): ++ verbose_print("trying stack_size = (%d)" % tss) ++ self.next_ident = 0 ++ self.created = 0 ++ for i in range(NUMTASKS): ++ self.newtask() + +- verbose_print("waiting for all tasks to complete") +- self.done_mutex.acquire() +- verbose_print("all tasks done") ++ verbose_print("waiting for all tasks to complete") ++ self.done_mutex.acquire() ++ verbose_print("all tasks done") + +- thread.stack_size(0) ++ thread.stack_size(0) + + def test__count(self): + # Test the _count() function. +diff -r 3405dc9a6afa Lib/test/test_threaded_import.py +--- a/Lib/test/test_threaded_import.py ++++ b/Lib/test/test_threaded_import.py +@@ -57,7 +57,7 @@ + } + + class Finder: +- """A dummy finder to detect concurrent access to its find_module() ++ """A dummy finder to detect concurrent access to its find_spec() + method.""" + + def __init__(self): +@@ -65,8 +65,8 @@ + self.x = 0 + self.lock = threading.Lock() + +- def find_module(self, name, path=None): +- # Simulate some thread-unsafe behaviour. If calls to find_module() ++ def find_spec(self, name, path=None, target=None): ++ # Simulate some thread-unsafe behaviour. If calls to find_spec() + # are properly serialized, `x` will end up the same as `numcalls`. + # Otherwise not. + assert imp.lock_held() +@@ -80,7 +80,7 @@ + """A dummy finder which flushes sys.path_importer_cache when it gets + called.""" + +- def find_module(self, name, path=None): ++ def find_spec(self, name, path=None, target=None): + sys.path_importer_cache.clear() + + +@@ -145,13 +145,13 @@ + # dedicated meta_path entry. + flushing_finder = FlushingFinder() + def path_hook(path): +- finder.find_module('') ++ finder.find_spec('') + raise ImportError + sys.path_hooks.insert(0, path_hook) + sys.meta_path.append(flushing_finder) + try: + # Flush the cache a first time +- flushing_finder.find_module('') ++ flushing_finder.find_spec('') + numtests = self.check_parallel_module_init() + self.assertGreater(finder.numcalls, 0) + self.assertEqual(finder.x, finder.numcalls) +diff -r 3405dc9a6afa Lib/test/test_threading.py +--- a/Lib/test/test_threading.py ++++ b/Lib/test/test_threading.py +@@ -662,6 +662,44 @@ + self.assertRegex(err.rstrip(), + b"^sys:1: ResourceWarning: unclosed file ") + ++ def test_frame_tstate_tracing(self): ++ # Issue #14432: Crash when a generator is created in a C thread that is ++ # destroyed while the generator is still used. The issue was that a ++ # generator contains a frame, and the frame kept a reference to the ++ # Python state of the destroyed C thread. The crash occurs when a trace ++ # function is setup. ++ ++ def noop_trace(frame, event, arg): ++ # no operation ++ return noop_trace ++ ++ def generator(): ++ while 1: ++ yield "genereator" ++ ++ def callback(): ++ if callback.gen is None: ++ callback.gen = generator() ++ return next(callback.gen) ++ callback.gen = None ++ ++ old_trace = sys.gettrace() ++ sys.settrace(noop_trace) ++ try: ++ # Install a trace function ++ threading.settrace(noop_trace) ++ ++ # Create a generator in a C thread which exits after the call ++ _testcapi.call_in_temporary_c_thread(callback) ++ ++ # Call the generator in a different Python thread, check that the ++ # generator didn't keep a reference to the destroyed thread state ++ for test in range(3): ++ # The trace function is still called here ++ callback() ++ finally: ++ sys.settrace(old_trace) ++ + + class ThreadJoinOnShutdown(BaseTestCase): + +diff -r 3405dc9a6afa Lib/test/test_time.py +--- a/Lib/test/test_time.py ++++ b/Lib/test/test_time.py +@@ -198,6 +198,10 @@ + with self.assertRaises(ValueError) as e: + time.strptime('', '%D') + self.assertIs(e.exception.__suppress_context__, True) ++ # additional check for IndexError branch (issue #19545) ++ with self.assertRaises(ValueError) as e: ++ time.strptime('19', '%Y %') ++ self.assertIs(e.exception.__suppress_context__, True) + + def test_asctime(self): + time.asctime(time.gmtime(self.t)) +@@ -380,7 +384,7 @@ + t2 = time.monotonic() + dt = t2 - t1 + self.assertGreater(t2, t1) +- self.assertAlmostEqual(dt, 0.5, delta=0.2) ++ self.assertTrue(0.5 <= dt <= 1.0, dt) + + # monotonic() is a monotonic but non adjustable clock + info = time.get_clock_info('monotonic') +@@ -468,8 +472,7 @@ + try: + tmp = locale.setlocale(locale.LC_ALL, "fr_FR") + except locale.Error: +- # skip this test +- return ++ self.skipTest('could not set locale.LC_ALL to fr_FR') + # This should not cause an exception + time.strftime("%B", (2009,2,1,0,0,0,0,0,0)) + +diff -r 3405dc9a6afa Lib/test/test_tracemalloc.py +--- a/Lib/test/test_tracemalloc.py ++++ b/Lib/test/test_tracemalloc.py +@@ -1,6 +1,4 @@ +-import _tracemalloc + import contextlib +-import datetime + import os + import sys + import tracemalloc +@@ -184,19 +182,19 @@ + obj_size = 1024 * 1024 + tracemalloc.clear_traces() + obj, obj_traceback = allocate_bytes(obj_size) +- size, max_size = tracemalloc.get_traced_memory() ++ size, peak_size = tracemalloc.get_traced_memory() + self.assertGreaterEqual(size, obj_size) +- self.assertGreaterEqual(max_size, size) ++ self.assertGreaterEqual(peak_size, size) + + self.assertLessEqual(size - obj_size, max_error) +- self.assertLessEqual(max_size - size, max_error) ++ self.assertLessEqual(peak_size - size, max_error) + + # destroy the object + obj = None +- size2, max_size2 = tracemalloc.get_traced_memory() ++ size2, peak_size2 = tracemalloc.get_traced_memory() + self.assertLess(size2, size) + self.assertGreaterEqual(size - size2, obj_size - max_error) +- self.assertGreaterEqual(max_size2, max_size) ++ self.assertGreaterEqual(peak_size2, peak_size) + + # clear_traces() must reset traced memory counters + tracemalloc.clear_traces() +@@ -204,10 +202,10 @@ + + # allocate another object + obj, obj_traceback = allocate_bytes(obj_size) +- size, max_size = tracemalloc.get_traced_memory() +- self.assertGreater(size, 0) ++ size, peak_size = tracemalloc.get_traced_memory() ++ self.assertGreaterEqual(size, obj_size) + +- # stop() rests also traced memory counters ++ # stop() also resets traced memory counters + tracemalloc.stop() + self.assertEqual(tracemalloc.get_traced_memory(), (0, 0)) + +@@ -729,7 +727,7 @@ + stdout = stdout.rstrip() + self.assertEqual(stdout, b'False') + +- # PYTHON* environment varibles must be ignored when -E option is ++ # PYTHON* environment variables must be ignored when -E option is + # present + code = 'import tracemalloc; print(tracemalloc.is_tracing())' + ok, stdout, stderr = assert_python_ok('-E', '-c', code, PYTHONTRACEMALLOC='1') +@@ -749,14 +747,14 @@ + self.assertEqual(stdout, b'10') + + def test_env_var_invalid(self): +- for nframe in (-1, 0, 5000): ++ for nframe in (-1, 0, 2**30): + with self.subTest(nframe=nframe): + with support.SuppressCrashReport(): + ok, stdout, stderr = assert_python_failure( + '-c', 'pass', + PYTHONTRACEMALLOC=str(nframe)) +- self.assertIn(b'PYTHONTRACEMALLOC must be an integer ' +- b'in range [1; 100]', ++ self.assertIn(b'PYTHONTRACEMALLOC: invalid ' ++ b'number of frames', + stderr) + + def test_sys_xoptions(self): +@@ -772,13 +770,13 @@ + self.assertEqual(stdout, str(nframe).encode('ascii')) + + def test_sys_xoptions_invalid(self): +- for nframe in (-1, 0, 5000): ++ for nframe in (-1, 0, 2**30): + with self.subTest(nframe=nframe): + with support.SuppressCrashReport(): + args = ('-X', 'tracemalloc=%s' % nframe, '-c', 'pass') + ok, stdout, stderr = assert_python_failure(*args) +- self.assertIn(b'-X tracemalloc=NFRAME: number of frame must ' +- b'be an integer in range [1; 100]', ++ self.assertIn(b'-X tracemalloc=NFRAME: invalid ' ++ b'number of frames', + stderr) + + +diff -r 3405dc9a6afa Lib/test/test_unicode.py +--- a/Lib/test/test_unicode.py ++++ b/Lib/test/test_unicode.py +@@ -973,6 +973,8 @@ + self.assertRaises(ValueError, "{a{b}".format, 42) + self.assertRaises(ValueError, "{[}".format, 42) + ++ self.assertEqual("0x{:0{:d}X}".format(0x0,16), "0x0000000000000000") ++ + def test_format_map(self): + self.assertEqual(''.format_map({}), '') + self.assertEqual('a'.format_map({}), 'a') +@@ -2000,12 +2002,12 @@ + self.assertEqual(repr('\U00010000'), "'%c'" % (0x10000,)) # printable + self.assertEqual(repr('\U00014000'), "'\\U00014000'") # nonprintable + ++ # This test only affects 32-bit platforms because expandtabs can only take ++ # an int as the max value, not a 64-bit C long. If expandtabs is changed ++ # to take a 64-bit long, this test should apply to all platforms. ++ @unittest.skipIf(sys.maxsize > (1 << 32) or struct.calcsize('P') != 4, ++ 'only applies to 32-bit platforms') + def test_expandtabs_overflows_gracefully(self): +- # This test only affects 32-bit platforms because expandtabs can only take +- # an int as the max value, not a 64-bit C long. If expandtabs is changed +- # to take a 64-bit long, this test should apply to all platforms. +- if sys.maxsize > (1 << 32) or struct.calcsize('P') != 4: +- return + self.assertRaises(OverflowError, 't\tt\t'.expandtabs, sys.maxsize) + + @support.cpython_only +diff -r 3405dc9a6afa Lib/test/test_urllib2net.py +--- a/Lib/test/test_urllib2net.py ++++ b/Lib/test/test_urllib2net.py +@@ -14,6 +14,8 @@ + except ImportError: + ssl = None + ++support.requires("network") ++ + TIMEOUT = 60 # seconds + + +@@ -339,5 +341,4 @@ + + + if __name__ == "__main__": +- support.requires("network") + unittest.main() +diff -r 3405dc9a6afa Lib/test/test_urllibnet.py +--- a/Lib/test/test_urllibnet.py ++++ b/Lib/test/test_urllibnet.py +@@ -98,11 +98,10 @@ + open_url.close() + self.assertEqual(code, 404) + ++ # On Windows, socket handles are not file descriptors; this ++ # test can't pass on Windows. ++ @unittest.skipIf(sys.platform in ('win32',), 'not appropriate for Windows') + def test_fileno(self): +- if sys.platform in ('win32',): +- # On Windows, socket handles are not file descriptors; this +- # test can't pass on Windows. +- return + # Make sure fd returned by fileno is valid. + with self.urlopen("http://www.python.org/", timeout=None) as open_url: + fd = open_url.fileno() +diff -r 3405dc9a6afa Lib/test/test_uuid.py +--- a/Lib/test/test_uuid.py ++++ b/Lib/test/test_uuid.py +@@ -1,5 +1,7 @@ + import unittest ++from test import support + import builtins ++import io + import os + import uuid + +@@ -356,6 +358,26 @@ + + self.assertEqual(node1, node2) + ++ @unittest.skipUnless(os.name == 'posix', 'requires Posix') ++ def test_find_mac(self): ++ data = '''\ ++ ++fake hwaddr ++cscotun0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00 ++eth0 Link encap:Ethernet HWaddr 12:34:56:78:90:ab ++''' ++ def mock_popen(cmd): ++ return io.StringIO(data) ++ ++ with support.swap_attr(os, 'popen', mock_popen): ++ mac = uuid._find_mac( ++ command='ifconfig', ++ args='', ++ hw_identifiers=['hwaddr'], ++ get_index=lambda x: x + 1, ++ ) ++ self.assertEqual(mac, 0x1234567890ab) ++ + @unittest.skipUnless(importable('ctypes'), 'requires ctypes') + def test_uuid1(self): + equal = self.assertEqual +diff -r 3405dc9a6afa Lib/test/test_venv.py +--- a/Lib/test/test_venv.py ++++ b/Lib/test/test_venv.py +@@ -5,6 +5,7 @@ + Licensed to the PSF under a contributor agreement. + """ + ++import ensurepip + import os + import os.path + import shutil +@@ -13,8 +14,12 @@ + import tempfile + from test.support import (captured_stdout, captured_stderr, run_unittest, + can_symlink, EnvironmentVarGuard) ++import textwrap + import unittest + import venv ++ ++# pip currently requires ssl support, so we ensure we handle ++# it being missing (http://bugs.python.org/issue19744) + try: + import ssl + except ImportError: +@@ -257,33 +262,34 @@ + @skipInVenv + class EnsurePipTest(BaseTest): + """Test venv module installation of pip.""" +- +- def test_no_pip_by_default(self): +- shutil.rmtree(self.env_dir) +- self.run_with_capture(venv.create, self.env_dir) +- envpy = os.path.join(os.path.realpath(self.env_dir), self.bindir, self.exe) ++ def assert_pip_not_installed(self): ++ envpy = os.path.join(os.path.realpath(self.env_dir), ++ self.bindir, self.exe) + try_import = 'try:\n import pip\nexcept ImportError:\n print("OK")' + cmd = [envpy, '-c', try_import] + p = subprocess.Popen(cmd, stdout=subprocess.PIPE, + stderr=subprocess.PIPE) + out, err = p.communicate() +- self.assertEqual(err, b"") +- self.assertEqual(out.strip(), b"OK") ++ # We force everything to text, so unittest gives the detailed diff ++ # if we get unexpected results ++ err = err.decode("latin-1") # Force to text, prevent decoding errors ++ self.assertEqual(err, "") ++ out = out.decode("latin-1") # Force to text, prevent decoding errors ++ self.assertEqual(out.strip(), "OK") ++ ++ ++ def test_no_pip_by_default(self): ++ shutil.rmtree(self.env_dir) ++ self.run_with_capture(venv.create, self.env_dir) ++ self.assert_pip_not_installed() + + def test_explicit_no_pip(self): + shutil.rmtree(self.env_dir) + self.run_with_capture(venv.create, self.env_dir, with_pip=False) +- envpy = os.path.join(os.path.realpath(self.env_dir), self.bindir, self.exe) +- try_import = 'try:\n import pip\nexcept ImportError:\n print("OK")' +- cmd = [envpy, '-c', try_import] +- p = subprocess.Popen(cmd, stdout=subprocess.PIPE, +- stderr=subprocess.PIPE) +- out, err = p.communicate() +- self.assertEqual(err, b"") +- self.assertEqual(out.strip(), b"OK") ++ self.assert_pip_not_installed() + +- # Temporary skip for http://bugs.python.org/issue19744 +- @unittest.skipIf(ssl is None, 'pip needs SSL support') ++ # Requesting pip fails without SSL (http://bugs.python.org/issue19744) ++ @unittest.skipIf(ssl is None, ensurepip._MISSING_SSL_MESSAGE) + def test_with_pip(self): + shutil.rmtree(self.env_dir) + with EnvironmentVarGuard() as envvars: +@@ -291,10 +297,12 @@ + # warnings in current versions of Python. Ensure related + # environment settings don't cause venv to fail. + envvars["PYTHONWARNINGS"] = "e" +- # pip doesn't ignore environment variables when running in +- # isolated mode, and we don't have an active virtualenv here ++ # ensurepip is different enough from a normal pip invocation ++ # that we want to ensure it ignores the normal pip environment ++ # variable settings. We set PIP_NO_INSTALL here specifically ++ # to check that ensurepip (and hence venv) ignores it. + # See http://bugs.python.org/issue19734 for details +- del envvars["PIP_REQUIRE_VIRTUALENV"] ++ envvars["PIP_NO_INSTALL"] = "1" + try: + self.run_with_capture(venv.create, self.env_dir, with_pip=True) + except subprocess.CalledProcessError as exc: +@@ -303,6 +311,7 @@ + details = exc.output.decode(errors="replace") + msg = "{}\n\n**Subprocess Output**\n{}".format(exc, details) + self.fail(msg) ++ # Ensure pip is available in the virtual environment + envpy = os.path.join(os.path.realpath(self.env_dir), self.bindir, self.exe) + cmd = [envpy, '-Im', 'pip', '--version'] + p = subprocess.Popen(cmd, stdout=subprocess.PIPE, +@@ -313,10 +322,32 @@ + err = err.decode("latin-1") # Force to text, prevent decoding errors + self.assertEqual(err, "") + out = out.decode("latin-1") # Force to text, prevent decoding errors ++ expected_version = "pip {}".format(ensurepip.version()) ++ self.assertEqual(out[:len(expected_version)], expected_version) + env_dir = os.fsencode(self.env_dir).decode("latin-1") +- self.assertTrue(out.startswith("pip")) + self.assertIn(env_dir, out) + ++ # http://bugs.python.org/issue19728 ++ # Check the private uninstall command provided for the Windows ++ # installers works (at least in a virtual environment) ++ cmd = [envpy, '-Im', 'ensurepip._uninstall'] ++ with EnvironmentVarGuard() as envvars: ++ p = subprocess.Popen(cmd, stdout=subprocess.PIPE, ++ stderr=subprocess.PIPE) ++ out, err = p.communicate() ++ # We force everything to text, so unittest gives the detailed diff ++ # if we get unexpected results ++ err = err.decode("latin-1") # Force to text, prevent decoding errors ++ self.assertEqual(err, "") ++ # Being fairly specific regarding the expected behaviour for the ++ # initial bundling phase in Python 3.4. If the output changes in ++ # future pip versions, this test can likely be relaxed further. ++ out = out.decode("latin-1") # Force to text, prevent decoding errors ++ self.assertIn("Successfully uninstalled pip", out) ++ self.assertIn("Successfully uninstalled setuptools", out) ++ # Check pip is now gone from the virtual environment ++ self.assert_pip_not_installed() ++ + + def test_main(): + run_unittest(BasicTest, EnsurePipTest) +diff -r 3405dc9a6afa Lib/test/test_warnings.py +--- a/Lib/test/test_warnings.py ++++ b/Lib/test/test_warnings.py +@@ -695,7 +695,7 @@ + # Explicit tests for the test.support convenience wrapper + wmod = self.module + if wmod is not sys.modules['warnings']: +- return ++ self.skipTest('module to test is not loaded warnings module') + with support.check_warnings(quiet=False) as w: + self.assertEqual(w.warnings, []) + wmod.simplefilter("always") +diff -r 3405dc9a6afa Lib/test/test_wave.py +--- a/Lib/test/test_wave.py ++++ b/Lib/test/test_wave.py +@@ -6,10 +6,12 @@ + import wave + + +-class WavePCM8Test(audiotests.AudioWriteTests, +- audiotests.AudioTestsWithSourceFile, +- unittest.TestCase): ++class WaveTest(audiotests.AudioWriteTests, ++ audiotests.AudioTestsWithSourceFile): + module = wave ++ ++ ++class WavePCM8Test(WaveTest, unittest.TestCase): + sndfilename = 'pluck-pcm8.wav' + sndfilenframes = 3307 + nchannels = 2 +@@ -26,10 +28,7 @@ + """) + + +-class WavePCM16Test(audiotests.AudioWriteTests, +- audiotests.AudioTestsWithSourceFile, +- unittest.TestCase): +- module = wave ++class WavePCM16Test(WaveTest, unittest.TestCase): + sndfilename = 'pluck-pcm16.wav' + sndfilenframes = 3307 + nchannels = 2 +@@ -50,10 +49,7 @@ + frames = byteswap(frames, 2) + + +-class WavePCM24Test(audiotests.AudioWriteTests, +- audiotests.AudioTestsWithSourceFile, +- unittest.TestCase): +- module = wave ++class WavePCM24Test(WaveTest, unittest.TestCase): + sndfilename = 'pluck-pcm24.wav' + sndfilenframes = 3307 + nchannels = 2 +@@ -80,10 +76,7 @@ + frames = byteswap(frames, 3) + + +-class WavePCM32Test(audiotests.AudioWriteTests, +- audiotests.AudioTestsWithSourceFile, +- unittest.TestCase): +- module = wave ++class WavePCM32Test(WaveTest, unittest.TestCase): + sndfilename = 'pluck-pcm32.wav' + sndfilenframes = 3307 + nchannels = 2 +diff -r 3405dc9a6afa Lib/test/test_weakset.py +--- a/Lib/test/test_weakset.py ++++ b/Lib/test/test_weakset.py +@@ -370,10 +370,14 @@ + def testcontext(): + try: + it = iter(s) +- next(it) +- del it ++ # Start iterator ++ yielded = ustr(str(next(it))) + # Schedule an item for removal and recreate it + u = ustr(str(items.pop())) ++ if yielded == u: ++ # The iterator still has a reference to the removed item, ++ # advance it (issue #20006). ++ next(it) + gc.collect() # just in case + yield u + finally: +diff -r 3405dc9a6afa Lib/test/test_winsound.py +--- a/Lib/test/test_winsound.py ++++ b/Lib/test/test_winsound.py +@@ -158,18 +158,15 @@ + ) + + def test_alias_fallback(self): +- # This test can't be expected to work on all systems. The MS +- # PlaySound() docs say: +- # +- # If it cannot find the specified sound, PlaySound uses the +- # default system event sound entry instead. If the function +- # can find neither the system default entry nor the default +- # sound, it makes no sound and returns FALSE. +- # +- # It's known to return FALSE on some real systems. +- +- # winsound.PlaySound('!"$%&/(#+*', winsound.SND_ALIAS) +- return ++ # In the absense of the ability to tell if a sound was actually ++ # played, this test has two acceptable outcomes: success (no error, ++ # sound was theoretically played; although as issue #19987 shows ++ # a box without a soundcard can "succeed") or RuntimeError. Any ++ # other error is a failure. ++ try: ++ winsound.PlaySound('!"$%&/(#+*', winsound.SND_ALIAS) ++ except RuntimeError: ++ pass + + def test_alias_nofallback(self): + if _have_soundcard(): +diff -r 3405dc9a6afa Lib/test/test_xml_etree.py +--- a/Lib/test/test_xml_etree.py ++++ b/Lib/test/test_xml_etree.py +@@ -526,6 +526,11 @@ + ('end-ns', None), + ]) + ++ events = ('start-ns', 'end-ns') ++ context = iterparse(io.StringIO(r""), events) ++ res = [action for action, elem in context] ++ self.assertEqual(res, ['start-ns', 'end-ns']) ++ + events = ("start", "end", "bogus") + with self.assertRaises(ValueError) as cm: + with open(SIMPLE_XMLFILE, "rb") as f: +diff -r 3405dc9a6afa Lib/test/test_xmlrpc_net.py +--- a/Lib/test/test_xmlrpc_net.py ++++ b/Lib/test/test_xmlrpc_net.py +@@ -19,7 +19,6 @@ + builders = server.getAllBuilders() + except OSError as e: + self.skipTest("network error: %s" % e) +- return + self.addCleanup(lambda: server('close')()) + + # Perform a minimal sanity check on the result, just to be sure +diff -r 3405dc9a6afa Lib/test/test_zipfile.py +--- a/Lib/test/test_zipfile.py ++++ b/Lib/test/test_zipfile.py +@@ -14,7 +14,7 @@ + + from test.support import (TESTFN, findfile, unlink, + requires_zlib, requires_bz2, requires_lzma, +- captured_stdout) ++ captured_stdout, check_warnings) + + TESTFN2 = TESTFN + "2" + TESTFNDIR = TESTFN + "d" +@@ -35,6 +35,10 @@ + yield f + test.assertFalse(f.closed) + ++def openU(zipfp, fn): ++ with check_warnings(('', DeprecationWarning)): ++ return zipfp.open(fn, 'rU') ++ + class AbstractTestsWithSourceFile: + @classmethod + def setUpClass(cls): +@@ -875,6 +879,17 @@ + data += zipfp.read(info) + self.assertIn(data, {b"foobar", b"barfoo"}) + ++ def test_universal_deprecation(self): ++ f = io.BytesIO() ++ with zipfile.ZipFile(f, "w") as zipfp: ++ zipfp.writestr('spam.txt', b'ababagalamaga') ++ ++ with zipfile.ZipFile(f, "r") as zipfp: ++ for mode in 'U', 'rU': ++ with self.assertWarns(DeprecationWarning): ++ zipopen = zipfp.open('spam.txt', mode) ++ zipopen.close() ++ + def test_universal_readaheads(self): + f = io.BytesIO() + +@@ -884,7 +899,7 @@ + + data2 = b'' + with zipfile.ZipFile(f, 'r') as zipfp, \ +- zipfp.open(TESTFN, 'rU') as zipopen: ++ openU(zipfp, TESTFN) as zipopen: + for line in zipopen: + data2 += line + +@@ -1613,7 +1628,7 @@ + # Read the ZIP archive + with zipfile.ZipFile(f, "r") as zipfp: + for sep, fn in self.arcfiles.items(): +- with zipfp.open(fn, "rU") as fp: ++ with openU(zipfp, fn) as fp: + zipdata = fp.read() + self.assertEqual(self.arcdata[sep], zipdata) + +@@ -1627,7 +1642,7 @@ + # Read the ZIP archive + with zipfile.ZipFile(f, "r") as zipfp: + for sep, fn in self.arcfiles.items(): +- with zipfp.open(fn, "rU") as zipopen: ++ with openU(zipfp, fn) as zipopen: + data = b'' + while True: + read = zipopen.readline() +@@ -1652,7 +1667,7 @@ + # Read the ZIP archive + with zipfile.ZipFile(f, "r") as zipfp: + for sep, fn in self.arcfiles.items(): +- with zipfp.open(fn, "rU") as zipopen: ++ with openU(zipfp, fn) as zipopen: + for line in self.line_gen: + linedata = zipopen.readline() + self.assertEqual(linedata, line + b'\n') +@@ -1667,7 +1682,7 @@ + # Read the ZIP archive + with zipfile.ZipFile(f, "r") as zipfp: + for sep, fn in self.arcfiles.items(): +- with zipfp.open(fn, "rU") as fp: ++ with openU(zipfp, fn) as fp: + ziplines = fp.readlines() + for line, zipline in zip(self.line_gen, ziplines): + self.assertEqual(zipline, line + b'\n') +@@ -1682,7 +1697,7 @@ + # Read the ZIP archive + with zipfile.ZipFile(f, "r") as zipfp: + for sep, fn in self.arcfiles.items(): +- with zipfp.open(fn, "rU") as fp: ++ with openU(zipfp, fn) as fp: + for line, zipline in zip(self.line_gen, fp): + self.assertEqual(zipline, line + b'\n') + +diff -r 3405dc9a6afa Lib/test/test_zipimport.py +--- a/Lib/test/test_zipimport.py ++++ b/Lib/test/test_zipimport.py +@@ -136,7 +136,7 @@ + # so we'll simply skip it then. Bug #765456. + # + if "zlib" in sys.builtin_module_names: +- return ++ self.skipTest('zlib is a builtin module') + if "zlib" in sys.modules: + del sys.modules["zlib"] + files = {"zlib.py": (NOW, test_src)} +diff -r 3405dc9a6afa Lib/tkinter/__init__.py +--- a/Lib/tkinter/__init__.py ++++ b/Lib/tkinter/__init__.py +@@ -220,12 +220,12 @@ + _varnum += 1 + if value is not None: + self.initialize(value) +- elif not self._tk.call("info", "exists", self._name): ++ elif not self._tk.getboolean(self._tk.call("info", "exists", self._name)): + self.initialize(self._default) + def __del__(self): + """Unset the variable in Tcl.""" +- if (self._tk is not None and self._tk.call("info", "exists", +- self._name)): ++ if (self._tk is not None and ++ self._tk.getboolean(self._tk.call("info", "exists", self._name))): + self._tk.globalunsetvar(self._name) + def __str__(self): + """Return the name of the variable in Tcl.""" +@@ -1235,6 +1235,19 @@ + exc, val, tb = sys.exc_info() + root = self._root() + root.report_callback_exception(exc, val, tb) ++ ++ def _getconfigure(self, *args): ++ """Call Tcl configure command and return the result as a dict.""" ++ cnf = {} ++ for x in self.tk.splitlist(self.tk.call(*args)): ++ x = self.tk.splitlist(x) ++ cnf[x[0][1:]] = (x[0][1:],) + x[1:] ++ return cnf ++ ++ def _getconfigure1(self, *args): ++ x = self.tk.splitlist(self.tk.call(*args)) ++ return (x[0][1:],) + x[1:] ++ + def _configure(self, cmd, cnf, kw): + """Internal function.""" + if kw: +@@ -1242,15 +1255,9 @@ + elif cnf: + cnf = _cnfmerge(cnf) + if cnf is None: +- cnf = {} +- for x in self.tk.split( +- self.tk.call(_flatten((self._w, cmd)))): +- cnf[x[0][1:]] = (x[0][1:],) + x[1:] +- return cnf ++ return self._getconfigure(_flatten((self._w, cmd))) + if isinstance(cnf, str): +- x = self.tk.split( +- self.tk.call(_flatten((self._w, cmd, '-'+cnf)))) +- return (x[0][1:],) + x[1:] ++ return self._getconfigure1(_flatten((self._w, cmd, '-'+cnf))) + self.tk.call(_flatten((self._w, cmd)) + self._options(cnf)) + # These used to be defined in Widget: + def configure(self, cnf=None, **kw): +@@ -1271,7 +1278,7 @@ + def keys(self): + """Return a list of all resource names of this widget.""" + return [x[0][1:] for x in +- self.tk.split(self.tk.call(self._w, 'configure'))] ++ self.tk.splitlist(self.tk.call(self._w, 'configure'))] + def __str__(self): + """Return the window path name of this widget.""" + return self._w +@@ -3786,16 +3793,10 @@ + + """ + if cnf is None and not kw: +- cnf = {} +- for x in self.tk.split( +- self.tk.call(self._w, +- 'paneconfigure', tagOrId)): +- cnf[x[0][1:]] = (x[0][1:],) + x[1:] +- return cnf ++ return self._getconfigure(self._w, 'paneconfigure', tagOrId) + if isinstance(cnf, str) and not kw: +- x = self.tk.split(self.tk.call( +- self._w, 'paneconfigure', tagOrId, '-'+cnf)) +- return (x[0][1:],) + x[1:] ++ return self._getconfigure1( ++ self._w, 'paneconfigure', tagOrId, '-'+cnf) + self.tk.call((self._w, 'paneconfigure', tagOrId) + + self._options(cnf, kw)) + paneconfig = paneconfigure +diff -r 3405dc9a6afa Lib/tkinter/test/test_tkinter/test_text.py +--- a/Lib/tkinter/test/test_tkinter/test_text.py ++++ b/Lib/tkinter/test/test_tkinter/test_text.py +@@ -16,12 +16,13 @@ + + def test_debug(self): + text = self.text ++ wantobjects = self.root.wantobjects() + olddebug = text.debug() + try: + text.debug(0) +- self.assertEqual(text.debug(), 0) ++ self.assertEqual(text.debug(), 0 if wantobjects else '0') + text.debug(1) +- self.assertEqual(text.debug(), 1) ++ self.assertEqual(text.debug(), 1 if wantobjects else '1') + finally: + text.debug(olddebug) + self.assertEqual(text.debug(), olddebug) +diff -r 3405dc9a6afa Lib/tkinter/test/test_tkinter/test_variables.py +--- a/Lib/tkinter/test/test_tkinter/test_variables.py ++++ b/Lib/tkinter/test/test_tkinter/test_variables.py +@@ -24,6 +24,9 @@ + + class TestVariable(TestBase): + ++ def info_exists(self, *args): ++ return self.root.getboolean(self.root.call("info", "exists", *args)) ++ + def test_default(self): + v = Variable(self.root) + self.assertEqual("", v.get()) +@@ -35,21 +38,21 @@ + self.assertEqual("varname", str(v)) + + def test___del__(self): +- self.assertFalse(self.root.call("info", "exists", "varname")) ++ self.assertFalse(self.info_exists("varname")) + v = Variable(self.root, "sample string", "varname") +- self.assertTrue(self.root.call("info", "exists", "varname")) ++ self.assertTrue(self.info_exists("varname")) + del v +- self.assertFalse(self.root.call("info", "exists", "varname")) ++ self.assertFalse(self.info_exists("varname")) + + def test_dont_unset_not_existing(self): +- self.assertFalse(self.root.call("info", "exists", "varname")) ++ self.assertFalse(self.info_exists("varname")) + v1 = Variable(self.root, name="name") + v2 = Variable(self.root, name="name") + del v1 +- self.assertFalse(self.root.call("info", "exists", "name")) ++ self.assertFalse(self.info_exists("name")) + # shouldn't raise exception + del v2 +- self.assertFalse(self.root.call("info", "exists", "name")) ++ self.assertFalse(self.info_exists("name")) + + def test___eq__(self): + # values doesn't matter, only class and name are checked +diff -r 3405dc9a6afa Lib/tkinter/test/widget_tests.py +--- a/Lib/tkinter/test/widget_tests.py ++++ b/Lib/tkinter/test/widget_tests.py +@@ -62,9 +62,7 @@ + if not isinstance(widget, Scale): + t = widget.configure(name) + self.assertEqual(len(t), 5) +- ## XXX +- if not isinstance(t[4], tuple): +- self.assertEqual2(t[4], expected, eq=eq) ++ self.assertEqual2(t[4], expected, eq=eq) + + def checkInvalidParam(self, widget, name, value, errmsg=None, *, + keep_orig=True): +diff -r 3405dc9a6afa Lib/tkinter/tix.py +--- a/Lib/tkinter/tix.py ++++ b/Lib/tkinter/tix.py +@@ -122,13 +122,9 @@ + elif cnf: + cnf = _cnfmerge(cnf) + if cnf is None: +- cnf = {} +- for x in self.tk.split(self.tk.call('tix', 'configure')): +- cnf[x[0][1:]] = (x[0][1:],) + x[1:] +- return cnf ++ return self._getconfigure('tix', 'configure') + if isinstance(cnf, str): +- x = self.tk.split(self.tk.call('tix', 'configure', '-'+cnf)) +- return (x[0][1:],) + x[1:] ++ return self._getconfigure1('tix', 'configure', '-'+cnf) + return self.tk.call(('tix', 'configure') + self._options(cnf)) + + def tix_filedialog(self, dlgclass=None): +@@ -380,7 +376,7 @@ + """Return the name of all subwidgets.""" + try: + x = self.tk.call(self._w, 'subwidgets', '-all') +- return self.tk.split(x) ++ return self.tk.splitlist(x) + except TclError: + return None + +@@ -473,13 +469,6 @@ + self.tk.call('destroy', self._w) + + +-# Useful func. to split Tcl lists and return as a dict. From Tkinter.py +-def _lst2dict(lst): +- dict = {} +- for x in lst: +- dict[x[0][1:]] = (x[0][1:],) + x[1:] +- return dict +- + # Useful class to create a display style - later shared by many items. + # Contributed by Steffen Kremser + class DisplayStyle: +@@ -515,10 +504,8 @@ + self.tk.call(self.stylename, 'configure', '-%s'%key, value) + + def config(self, cnf={}, **kw): +- return _lst2dict( +- self.tk.split( +- self.tk.call( +- self.stylename, 'configure', *self._options(cnf,kw)))) ++ return self._getconfigure( ++ self.stylename, 'configure', *self._options(cnf,kw)) + + def __getitem__(self,key): + return self.tk.call(self.stylename, 'cget', '-%s'%key) +@@ -928,9 +915,7 @@ + + def header_configure(self, col, cnf={}, **kw): + if cnf is None: +- return _lst2dict( +- self.tk.split( +- self.tk.call(self._w, 'header', 'configure', col))) ++ return self._getconfigure(self._w, 'header', 'configure', col) + self.tk.call(self._w, 'header', 'configure', col, + *self._options(cnf, kw)) + +@@ -955,9 +940,8 @@ + + def indicator_configure(self, entry, cnf={}, **kw): + if cnf is None: +- return _lst2dict( +- self.tk.split( +- self.tk.call(self._w, 'indicator', 'configure', entry))) ++ return self._getconfigure( ++ self._w, 'indicator', 'configure', entry) + self.tk.call( + self._w, 'indicator', 'configure', entry, *self._options(cnf, kw)) + +@@ -1017,9 +1001,7 @@ + + def item_configure(self, entry, col, cnf={}, **kw): + if cnf is None: +- return _lst2dict( +- self.tk.split( +- self.tk.call(self._w, 'item', 'configure', entry, col))) ++ return self._getconfigure(self._w, 'item', 'configure', entry, col) + self.tk.call(self._w, 'item', 'configure', entry, col, + *self._options(cnf, kw)) + +@@ -1038,9 +1020,7 @@ + + def entryconfigure(self, entry, cnf={}, **kw): + if cnf is None: +- return _lst2dict( +- self.tk.split( +- self.tk.call(self._w, 'entryconfigure', entry))) ++ return self._getconfigure(self._w, 'entryconfigure', entry) + self.tk.call(self._w, 'entryconfigure', entry, + *self._options(cnf, kw)) + +@@ -1254,9 +1234,7 @@ + + def paneconfigure(self, entry, cnf={}, **kw): + if cnf is None: +- return _lst2dict( +- self.tk.split( +- self.tk.call(self._w, 'paneconfigure', entry))) ++ return self._getconfigure(self._w, 'paneconfigure', entry) + self.tk.call(self._w, 'paneconfigure', entry, *self._options(cnf, kw)) + + def panes(self): +diff -r 3405dc9a6afa Lib/tokenize.py +--- a/Lib/tokenize.py ++++ b/Lib/tokenize.py +@@ -333,7 +333,7 @@ + def detect_encoding(readline): + """ + The detect_encoding() function is used to detect the encoding that should +- be used to decode a Python source file. It requires one argment, readline, ++ be used to decode a Python source file. It requires one argument, readline, + in the same way as the tokenize() generator. + + It will call readline a maximum of twice, and return the encoding used +diff -r 3405dc9a6afa Lib/tracemalloc.py +--- a/Lib/tracemalloc.py ++++ b/Lib/tracemalloc.py +@@ -39,7 +39,7 @@ + self.count = count + + def __hash__(self): +- return (self.traceback, self.size, self.count) ++ return hash((self.traceback, self.size, self.count)) + + def __eq__(self, other): + return (self.traceback == other.traceback +@@ -79,8 +79,8 @@ + self.count_diff = count_diff + + def __hash__(self): +- return (self.traceback, self.size, self.size_diff, +- self.count, self.count_diff) ++ return hash((self.traceback, self.size, self.size_diff, ++ self.count, self.count_diff)) + + def __eq__(self, other): + return (self.traceback == other.traceback +@@ -104,7 +104,6 @@ + def __repr__(self): + return ('' + % (self.traceback, self.size, self.size_diff, +- + self.count, self.count_diff)) + + def _sort_key(self): +@@ -380,10 +379,6 @@ + if cumulative and key_type not in ('lineno', 'filename'): + raise ValueError("cumulative mode cannot by used " + "with key type %r" % key_type) +- if cumulative and self.traceback_limit < 2: +- raise ValueError("cumulative mode needs tracebacks with at least " +- "2 frames, traceback limit is %s" +- % self.traceback_limit) + + stats = {} + tracebacks = {} +diff -r 3405dc9a6afa Lib/unittest/case.py +--- a/Lib/unittest/case.py ++++ b/Lib/unittest/case.py +@@ -69,6 +69,9 @@ + else: + self.success = False + self.errors.append((test_case, exc_info)) ++ # explicitly break a reference cycle: ++ # exc_info -> frame -> exc_info ++ exc_info = None + else: + if self.result_supports_subtests and self.success: + self.errors.append((test_case, None)) +@@ -559,8 +562,8 @@ + return + expecting_failure = getattr(testMethod, + "__unittest_expecting_failure__", False) ++ outcome = _Outcome(result) + try: +- outcome = _Outcome(result) + self._outcome = outcome + + with outcome.testPartExecutor(self): +@@ -593,6 +596,15 @@ + if stopTestRun is not None: + stopTestRun() + ++ # explicitly break reference cycles: ++ # outcome.errors -> frame -> outcome -> outcome.errors ++ # outcome.expectedFailure -> frame -> outcome -> outcome.expectedFailure ++ outcome.errors.clear() ++ outcome.expectedFailure = None ++ ++ # clear the outcome, no more needed ++ self._outcome = None ++ + def doCleanups(self): + """Execute all cleanup functions. Normally called for you after + tearDown.""" +diff -r 3405dc9a6afa Lib/unittest/suite.py +--- a/Lib/unittest/suite.py ++++ b/Lib/unittest/suite.py +@@ -20,6 +20,7 @@ + + def __init__(self, tests=()): + self._tests = [] ++ self._removed_tests = 0 + self.addTests(tests) + + def __repr__(self): +@@ -37,9 +38,10 @@ + return iter(self._tests) + + def countTestCases(self): +- cases = 0 ++ cases = self._removed_tests + for test in self: +- cases += test.countTestCases() ++ if test: ++ cases += test.countTestCases() + return cases + + def addTest(self, test): +@@ -70,10 +72,16 @@ + def _removeTestAtIndex(self, index): + """Stop holding a reference to the TestCase at index.""" + try: ++ test = self._tests[index] ++ except TypeError: ++ # support for suite implementations that have overriden self._tests ++ pass ++ else: ++ # Some unittest tests add non TestCase/TestSuite objects to ++ # the suite. ++ if hasattr(test, 'countTestCases'): ++ self._removed_tests += test.countTestCases() + self._tests[index] = None +- except TypeError: +- # support for suite implementations that have overriden self._test +- pass + + def __call__(self, *args, **kwds): + return self.run(*args, **kwds) +diff -r 3405dc9a6afa Lib/unittest/test/test_case.py +--- a/Lib/unittest/test/test_case.py ++++ b/Lib/unittest/test/test_case.py +@@ -876,8 +876,6 @@ + with self.assertRaises(self.failureException) as cm: + self.assertEqual(s1, s2) + c = 'xxxx[85 chars]xxxxxxxxxxx' +- #print() +- #print(str(cm.exception)) + self.assertEqual(str(cm.exception), "'%sa%s' != '%sb%s'" % (c, p, c, p)) + + p = 'y' * 100 +@@ -1533,6 +1531,32 @@ + del case + self.assertFalse(wr()) + ++ def test_no_exception_leak(self): ++ # Issue #19880: TestCase.run() should not keep a reference ++ # to the exception ++ class MyException(Exception): ++ ninstance = 0 ++ ++ def __init__(self): ++ MyException.ninstance += 1 ++ Exception.__init__(self) ++ ++ def __del__(self): ++ MyException.ninstance -= 1 ++ ++ class TestCase(unittest.TestCase): ++ def test1(self): ++ raise MyException() ++ ++ @unittest.expectedFailure ++ def test2(self): ++ raise MyException() ++ ++ for method_name in ('test1', 'test2'): ++ testcase = TestCase(method_name) ++ testcase.run() ++ self.assertEqual(MyException.ninstance, 0) ++ + + if __name__ == "__main__": + unittest.main() +diff -r 3405dc9a6afa Lib/unittest/test/test_suite.py +--- a/Lib/unittest/test/test_suite.py ++++ b/Lib/unittest/test/test_suite.py +@@ -51,6 +51,9 @@ + suite = unittest.TestSuite() + + self.assertEqual(suite.countTestCases(), 0) ++ # countTestCases() still works after tests are run ++ suite.run(unittest.TestResult()) ++ self.assertEqual(suite.countTestCases(), 0) + + # "class TestSuite([tests])" + # ... +@@ -63,6 +66,9 @@ + suite = unittest.TestSuite([]) + + self.assertEqual(suite.countTestCases(), 0) ++ # countTestCases() still works after tests are run ++ suite.run(unittest.TestResult()) ++ self.assertEqual(suite.countTestCases(), 0) + + # "class TestSuite([tests])" + # ... +@@ -84,6 +90,14 @@ + suite_3 = unittest.TestSuite(set(suite_1)) + self.assertEqual(suite_3.countTestCases(), 2) + ++ # countTestCases() still works after tests are run ++ suite_1.run(unittest.TestResult()) ++ self.assertEqual(suite_1.countTestCases(), 2) ++ suite_2.run(unittest.TestResult()) ++ self.assertEqual(suite_2.countTestCases(), 2) ++ suite_3.run(unittest.TestResult()) ++ self.assertEqual(suite_3.countTestCases(), 2) ++ + # "class TestSuite([tests])" + # ... + # "If tests is given, it must be an iterable of individual test cases +@@ -99,6 +113,9 @@ + + suite = unittest.TestSuite(tests()) + self.assertEqual(suite.countTestCases(), 2) ++ # countTestCases() still works after tests are run ++ suite.run(unittest.TestResult()) ++ self.assertEqual(suite.countTestCases(), 2) + + ################################################################ + ### /Tests for TestSuite.__init__ +@@ -145,6 +162,9 @@ + suite = unittest.TestSuite((test1, test2)) + + self.assertEqual(suite.countTestCases(), 2) ++ # countTestCases() still works after tests are run ++ suite.run(unittest.TestResult()) ++ self.assertEqual(suite.countTestCases(), 2) + + # "Return the number of tests represented by the this test object. + # ...this method is also implemented by the TestSuite class, which can +@@ -162,6 +182,10 @@ + parent = unittest.TestSuite((test3, child, Test1('test1'))) + + self.assertEqual(parent.countTestCases(), 4) ++ # countTestCases() still works after tests are run ++ parent.run(unittest.TestResult()) ++ self.assertEqual(parent.countTestCases(), 4) ++ self.assertEqual(child.countTestCases(), 2) + + # "Run the tests associated with this suite, collecting the result into + # the test result object passed as result." +@@ -220,6 +244,9 @@ + + self.assertEqual(suite.countTestCases(), 1) + self.assertEqual(list(suite), [test]) ++ # countTestCases() still works after tests are run ++ suite.run(unittest.TestResult()) ++ self.assertEqual(suite.countTestCases(), 1) + + # "Add a ... TestSuite to the suite" + def test_addTest__TestSuite(self): +@@ -233,6 +260,9 @@ + + self.assertEqual(suite.countTestCases(), 1) + self.assertEqual(list(suite), [suite_2]) ++ # countTestCases() still works after tests are run ++ suite.run(unittest.TestResult()) ++ self.assertEqual(suite.countTestCases(), 1) + + # "Add all the tests from an iterable of TestCase and TestSuite + # instances to this test suite." +@@ -392,6 +422,7 @@ + self.assertEqual(len(result.errors), 1) + self.assertEqual(len(result.failures), 0) + self.assertEqual(result.testsRun, 2) ++ self.assertEqual(suite.countTestCases(), 2) + + + def test_overriding_call(self): +diff -r 3405dc9a6afa Lib/uuid.py +--- a/Lib/uuid.py ++++ b/Lib/uuid.py +@@ -312,26 +312,35 @@ + return int((self.int >> 76) & 0xf) + + def _find_mac(command, args, hw_identifiers, get_index): +- import os +- for dir in ['', '/sbin/', '/usr/sbin']: +- executable = os.path.join(dir, command) +- if not os.path.exists(executable): +- continue ++ import os, shutil ++ executable = shutil.which(command) ++ if executable is None: ++ path = os.pathsep.join(('/sbin', '/usr/sbin')) ++ executable = shutil.which(command, path=path) ++ if executable is None: ++ return None + +- try: +- # LC_ALL to get English output, 2>/dev/null to +- # prevent output on stderr +- cmd = 'LC_ALL=C %s %s 2>/dev/null' % (executable, args) +- with os.popen(cmd) as pipe: +- for line in pipe: +- words = line.lower().split() +- for i in range(len(words)): +- if words[i] in hw_identifiers: ++ try: ++ # LC_MESSAGES to get English output, 2>/dev/null to ++ # prevent output on stderr ++ cmd = 'LC_MESSAGES=C %s %s 2>/dev/null' % (executable, args) ++ with os.popen(cmd) as pipe: ++ for line in pipe: ++ words = line.lower().split() ++ for i in range(len(words)): ++ if words[i] in hw_identifiers: ++ try: + return int( + words[get_index(i)].replace(':', ''), 16) +- except OSError: +- continue +- return None ++ except (ValueError, IndexError): ++ # Virtual interfaces, such as those provided by ++ # VPNs, do not have a colon-delimited MAC address ++ # as expected, but a 16-byte HWAddr separated by ++ # dashes. These should be ignored in favor of a ++ # real MAC address ++ pass ++ except OSError: ++ pass + + def _ifconfig_getnode(): + """Get the hardware address on Unix by running ifconfig.""" +diff -r 3405dc9a6afa Lib/webbrowser.py +--- a/Lib/webbrowser.py ++++ b/Lib/webbrowser.py +@@ -2,14 +2,11 @@ + """Interfaces for launching and remotely controlling Web browsers.""" + # Maintained by Georg Brandl. + +-import io + import os + import shlex + import shutil + import sys +-import stat + import subprocess +-import time + + __all__ = ["Error", "open", "open_new", "open_new_tab", "get", "register"] + +diff -r 3405dc9a6afa Makefile.pre.in +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -910,7 +910,8 @@ + $(srcdir)/Include/warnings.h \ + $(srcdir)/Include/weakrefobject.h \ + pyconfig.h \ +- $(PARSER_HEADERS) ++ $(PARSER_HEADERS) \ ++ $(AST_H) + + $(LIBRARY_OBJS) $(MODOBJS) Modules/python.o: $(PYTHON_HEADERS) + +diff -r 3405dc9a6afa Misc/ACKS +--- a/Misc/ACKS ++++ b/Misc/ACKS +@@ -293,6 +293,7 @@ + Jonathan Dasteel + Pierre-Yves David + A. Jesse Jiryu Davis ++Merlijn van Deen + John DeGood + Ned Deily + Vincent Delft +@@ -407,6 +408,7 @@ + Andrew Francis + Stefan Franke + Martin Franklin ++Kent Frazier + Bruce Frederiksen + Robin Friedrich + Bradley Froehle +@@ -449,6 +451,7 @@ + Jonathan Giddy + Johannes Gijsbers + Michael Gilfix ++Julian Gindi + Yannick Gingras + Matt Giuca + Wim Glenn +@@ -708,6 +711,7 @@ + Andrew Kuchling + Dave Kuhlman + Jon Kuhn ++Toshio Kuratomi + Vladimir Kushnir + Erno Kuusela + Ross Lagerwall +@@ -1132,6 +1136,7 @@ + James Sanders + Ilya Sandler + Rafael Santos ++Simon Sapin + Mark Sapiro + Ty Sarna + Hugh Sasse +@@ -1451,4 +1456,5 @@ + Cheng Zhang + Kai Zhu + Tarek Ziadé ++Gennadiy Zlobin + Peter Åstrand +diff -r 3405dc9a6afa Misc/NEWS +--- a/Misc/NEWS ++++ b/Misc/NEWS +@@ -2,6 +2,327 @@ + Python News + +++++++++++ + ++What's New in Python 3.4.0 Beta 2? ++================================== ++ ++Release date: 2014-01-05 ++ ++Core and Builtins ++----------------- ++ ++- Issue #19969: PyBytes_FromFormatV() now raises an OverflowError if "%c" ++ argument is not in range [0; 255]. ++ ++- Issue #19787: PyThread_set_key_value() now always set the value. In Python ++ 3.3, the function did nothing if the key already exists (if the current value ++ is a non-NULL pointer). ++ ++- Issue #14432: Remove the thread state field from the frame structure. Fix a ++ crash when a generator is created in a C thread that is destroyed while the ++ generator is still used. The issue was that a generator contains a frame, and ++ the frame kept a reference to the Python state of the destroyed C thread. The ++ crash occurs when a trace function is setup. ++ ++- Issue #19576: PyGILState_Ensure() now initializes threads. At startup, Python ++ has no concrete GIL. If PyGILState_Ensure() is called from a new thread for ++ the first time and PyEval_InitThreads() was not called yet, a GIL needs to be ++ created. ++ ++- Issue #17576: Deprecation warning emitted now when __int__() or __index__() ++ return not int instance. ++ ++- Issue #19932: Fix typo in import.h, missing whitespaces in function prototypes. ++ ++- Issue #19736: Add module-level statvfs constants defined for GNU/glibc ++ based systems. ++ ++- Issue #19729: In str.format(), fix recursive expansion in format spec. ++ ++- Issue #19638: Fix possible crash / undefined behaviour from huge (more than 2 ++ billion characters) input strings in _Py_dg_strtod. ++ ++Library ++------- ++ ++- Fix breakage in TestSuite.countTestCases() introduced by issue #11798. ++ ++- Issue #19918: Fix PurePath.relative_to() under Windows. ++ ++- Issue #19422: Explicitly disallow non-SOCK_STREAM sockets in the ssl ++ module, rather than silently let them emit clear text data. ++ ++- Issue #20046: Locale alias table no longer contains entities which can be ++ calculated. Generalized support of the euro modifier. ++ ++- Issue #20027: Fixed locale aliases for devanagari locales. ++ ++- Issue #20067: Tkinter variables now work when wantobjects is false. ++ ++- Issue #19020: Tkinter now uses splitlist() instead of split() in configure ++ methods. ++ ++- Issue #19744: ensurepip now provides a better error message when Python is ++ built without SSL/TLS support (pip currently requires that support to run, ++ even if only operating with local wheel files) ++ ++- Issue #19734: ensurepip now ignores all pip environment variables to avoid ++ odd behaviour based on user configuration settings ++ ++- Fix TypeError on "setup.py upload --show-response". ++ ++- Issue #20045: Fix "setup.py register --list-classifiers". ++ ++- Issue #18879: When a method is looked up on a temporary file, avoid closing ++ the file before the method is possibly called. ++ ++- Issue #20037: Avoid crashes when opening a text file late at interpreter ++ shutdown. ++ ++- Issue #19967: Thanks to the PEP 442, asyncio.Future now uses a ++ destructor to log uncaught exceptions, instead of the dedicated ++ _TracebackLogger class. ++ ++- Added a Task.current_task() class method to asyncio. ++ ++- Issue #19850: Set SA_RESTART in asyncio when registering a signal ++ handler to limit EINTR occurrences. ++ ++- Implemented write flow control in asyncio for proactor event loop (Windows). ++ ++- Change write buffer in asyncio use to avoid O(N**2) behavior. Make ++ write()/sendto() accept bytearray/memoryview. ++ ++- Issue #20034: Updated alias mapping to most recent locale.alias file ++ from X.org distribution using makelocalealias.py. ++ ++- Issue #5815: Fixed support for locales with modifiers. Fixed support for ++ locale encodings with hyphens. ++ ++- Issue #20026: Fix the sqlite module to handle correctly invalid isolation ++ level (wrong type). ++ ++- Issue #18829: csv.Dialect() now checks type for delimiter, escapechar and ++ quotechar fields. Original patch by Vajrasky Kok. ++ ++- Issue #19855: uuid.getnode() on Unix now looks on the PATH for the ++ executables used to find the mac address, with /sbin and /usr/sbin as ++ fallbacks. ++ ++- Issue #20007: HTTPResponse.read(0) no more prematurely closes connection. ++ Original patch by Simon Sapin. ++ ++- Issue #19946: multiprocessing now uses runpy to initialize __main__ in ++ child processes when necessary, allowing it to correctly handle scripts ++ without suffixes and submodules that use explicit relative imports or ++ otherwise rely on parent modules being correctly imported prior to ++ execution. ++ ++- Issue #19921: When Path.mkdir() is called with parents=True, any missing ++ parent is created with the default permissions, ignoring the mode argument ++ (mimicking the POSIX "mkdir -p" command). ++ ++- Issue #19887: Improve the Path.resolve() algorithm to support certain ++ symlink chains. ++ ++- Issue #19912: Fixed numerous bugs in ntpath.splitunc(). ++ ++- Issue #19911: ntpath.splitdrive() now correctly processes the 'İ' character ++ (U+0130, LATIN CAPITAL LETTER I WITH DOT ABOVE). ++ ++- Issue #19532: python -m compileall with no filename/directory arguments now ++ respects the -f and -q flags instead of ignoring them. ++ ++- Issue #19623: Fixed writing to unseekable files in the aifc module. ++ ++- Issue #19946: multiprocessing.spawn now raises ImportError when the module to ++ be used as the main module cannot be imported. ++ ++- Issue #17919: select.poll.register() again works with poll.POLLNVAL on AIX. ++ Fixed integer overflow in the eventmask parameter. ++ ++- Issue #19063: if a Charset's body_encoding was set to None, the email ++ package would generate a message claiming the Content-Transfer-Encoding ++ was 7bit, and produce garbage output for the content. This now works. ++ A couple of other set_payload mishandlings of non-ASCII are also fixed. ++ In addition, calling set_payload with a string argument without ++ specifying a charset now raises an error (this is a new error in 3.4). ++ ++- Issue #15475: Add __sizeof__ implementations for itertools objects. ++ ++- Issue #19880: Fix a reference leak in unittest.TestCase. Explicitly break ++ reference cycles between frames and the _Outcome instance. ++ ++- Issue #17429: platform.linux_distribution() now decodes files from the UTF-8 ++ encoding with the surrogateescape error handler, instead of decoding from the ++ locale encoding in strict mode. It fixes the function on Fedora 19 which is ++ probably the first major distribution release with a non-ASCII name. Patch ++ written by Toshio Kuratomi. ++ ++- Issue #19343: Expose FreeBSD-specific APIs in resource module. Original ++ patch by Koobs. ++ ++- Issue #19929: Call os.read with 32768 within subprocess.Popen.communicate ++ rather than 4096 for efficiency. A microbenchmark shows Linux and OS X ++ both using ~50% less cpu time this way. ++ ++- Issue #19506: Use a memoryview to avoid a data copy when piping data ++ to stdin within subprocess.Popen.communicate. 5-10% less cpu usage. ++ ++- Issue #19876: selectors unregister() no longer raises ValueError or OSError ++ if the FD is closed (as long as it was registered). ++ ++- Issue #19908: pathlib now joins relative Windows paths correctly when a drive ++ is present. Original patch by Antoine Pitrou. ++ ++- Issue #19296: Silence compiler warning in dbm_open ++ ++- Issue #6784: Strings from Python 2 can now be unpickled as bytes ++ objects by setting the encoding argument of Unpickler to be 'bytes'. ++ Initial patch by Merlijn van Deen. ++ ++- Issue #19839: Fix regression in bz2 module's handling of non-bzip2 data at ++ EOF, and analogous bug in lzma module. ++ ++- Issue #19881: Fix pickling bug where cpickle would emit bad pickle data for ++ large bytes string (i.e., with size greater than 2**32-1). ++ ++- Issue #19138: doctest's IGNORE_EXCEPTION_DETAIL now allows a match when ++ no exception detail exists (no colon following the exception's name, or ++ a colon does follow but no text follows the colon). ++ ++- Issue #19827: On UNIX, setblocking() and settimeout() methods of ++ socket.socket can now avoid a second syscall if the ioctl() function can be ++ used, or if the non-blocking flag of the socket is unchanged. ++ ++- Issue #19785: smtplib now supports SSLContext.check_hostname and server name ++ indication for TLS/SSL connections. ++ ++- Issue #19784: poplib now supports SSLContext.check_hostname and server name ++ indication for TLS/SSL connections. ++ ++- Issue #19783: nntplib now supports SSLContext.check_hostname and server name ++ indication for TLS/SSL connections. ++ ++- Issue #19782: imaplib now supports SSLContext.check_hostname and server name ++ indication for TLS/SSL connections. ++ ++- Issue #19834: Support unpickling of exceptions pickled by Python 2. ++ ++- Issue #19781: ftplib now supports SSLContext.check_hostname and server name ++ indication for TLS/SSL connections. ++ ++- Issue #19509: Add SSLContext.check_hostname to match the peer's certificate ++ with server_hostname on handshake. ++ ++- Issue #15798: Fixed subprocess.Popen() to no longer fail if file ++ descriptor 0, 1 or 2 is closed. ++ ++- Issue #17897: Optimized unpickle prefetching. ++ ++- Issue #3693: Make the error message more helpful when the array.array() ++ constructor is given a str. Move the array module typecode documentation to ++ the docstring of the constructor. ++ ++- Issue #19088: Fixed incorrect caching of the copyreg module in ++ object.__reduce__() and object.__reduce_ex__(). ++ ++- Issue #19698: Removed exec_module() methods from ++ importlib.machinery.BuiltinImporter and ExtensionFileLoader. ++ ++- Issue #18864: Added a setter for ModuleSpec.has_location. ++ ++- Fixed _pickle.Unpickler to not fail when loading empty strings as ++ persistent IDs. ++ ++- Issue #11480: Fixed copy.copy to work with classes with custom metaclasses. ++ Patch by Daniel Urban. ++ ++- Issue #6477: Added support for pickling the types of built-in singletons ++ (i.e., Ellipsis, NotImplemented, None). ++ ++- Issue #19851: Fixed a regression in reloading sub-modules. ++ ++- ssl.create_default_context() sets OP_NO_COMPRESSION to prevent CRIME. ++ ++- Issue #19802: Add socket.SO_PRIORITY. ++ ++- Issue #11508: Fixed uuid.getnode() and uuid.uuid1() on environment with ++ virtual interface. Original patch by Kent Frazier. ++ ++- Issue #11489: JSON decoder now accepts lone surrogates. ++ ++- Issue #19545: Avoid chained exceptions while passing stray % to ++ time.strptime(). Initial patch by Claudiu Popa. ++ ++IDLE ++---- ++ ++- Issue #20058: sys.stdin.readline() in IDLE now always returns only one line. ++ ++- Issue #19481: print() of string subclass instance in IDLE no longer hangs. ++ ++- Issue #18270: Prevent possible IDLE AttributeError on OS X when no initial ++ shell window is present. ++ ++Tests ++----- ++ ++- Issue #20070: Don't run test_urllib2net when network resources are not ++ enabled. ++ ++- Issue #19938: Re-enabled test_bug_1333982 in test_dis, which had been ++ disabled since 3.0 due to the changes in listcomp handling. ++ ++- Issue #19320: test_tcl no longer fails when wantobjects is false. ++ ++- Issue #19919: Fix flacky SSL test. connect_ex() sometimes returns ++ EWOULDBLOCK on Windows or VMs hosted on Windows. ++ ++- Issue #19912: Added tests for ntpath.splitunc(). ++ ++- Issue #19828: Fixed test_site when the whole suite is run with -S. ++ ++- Issue #19928: Implemented a test for repr() of cell objects. ++ ++- Issue #19535: Fixed test_docxmlrpc, test_functools, test_inspect, and ++ test_statistics when python is run with -OO. ++ ++- Issue #19926: Removed unneeded test_main from test_abstract_numbers. ++ Patch by Vajrasky Kok. ++ ++- Issue #19572: More skipped tests explicitly marked as skipped. ++ ++- Issue #19595, #19987: Re-enabled a long-disabled test in test_winsound. ++ ++- Issue #19588: Fixed tests in test_random that were silently skipped most ++ of the time. Patch by Julian Gindi. ++ ++Build ++----- ++ ++- Issue #16136: Remove VMS support ++ ++- Issue #18215: Add script Tools/ssl/test_multiple_versions.py to compile and ++ run Python's unit tests with multiple versions of OpenSSL. ++ ++- Issue #19922: define _INCLUDE__STDC_A1_SOURCE in HP-UX to include mbstate_t ++ for mbrtowc(). ++ ++- Issue #19788: kill_python(_d).exe is now run as a PreBuildEvent on the ++ pythoncore sub-project. This should prevent build errors due a previous ++ build's python(_d).exe still running. ++ ++Documentation ++------------- ++ ++- Issue #18840: Introduce the json module in the tutorial, and deemphasize ++ the pickle module. ++ ++- Issue #19845: Updated the Compiling Python on Windows section. ++ ++- Issue #19795: Improved markup of True/False constants. ++ ++ + What's New in Python 3.4.0 Beta 1? + ================================== + +@@ -1584,8 +1905,9 @@ + do with byte strings. + + - Issue #18116: getpass was always getting an error when testing /dev/tty, +- and thus was always falling back to stdin. It also leaked an open file +- when it did so. Both of these issues are now fixed. ++ and thus was always falling back to stdin, and would then raise an exception ++ if stdin could not be used (such as /dev/null). It also leaked an open file. ++ All of these issues are now fixed. + + - Issue #17198: Fix a NameError in the dbm module. Patch by Valentina + Mukhamedzhanova. +@@ -2349,8 +2671,9 @@ + Content-Length and the incoming stream is finished. Patch by Eran + Rundstein. + +-- Add abc.ABC class to use inheritance rather than a direct invocation of +- ABCMeta metaclass. Patch by Bruno Dupuis. ++- Issue #16049: Add abc.ABC class to enable the use of inheritance to create ++ ABCs, rather than the more cumbersome metaclass=ABCMeta. Patch by Bruno ++ Dupuis. + + - Expose the TCP_FASTOPEN and MSG_FASTOPEN flags in socket when they're + available. +@@ -2388,8 +2711,8 @@ + - Issue #10182: The re module doesn't truncate indices to 32 bits anymore. + Patch by Serhiy Storchaka. + +-- Issue #16333: use (",", ": ") as default separator when indent is specified +- to avoid trailing whitespace. Patch by Serhiy Storchaka. ++- Issue #16333: use (",", ": ") as default separator in json when indent is ++ specified, to avoid trailing whitespace. Patch by Serhiy Storchaka. + + - Issue #16573: In 2to3, treat enumerate() like a consuming call, so superfluous + list() calls aren't added to filter(), map(), and zip() which are directly +@@ -2518,12 +2841,12 @@ + - Issue #14398: Fix size truncation and overflow bugs in the bz2 module. + + - Issue #12692: Fix resource leak in urllib.request when talking to an HTTP +- server that does not include a "Connection: close" header in its responses. ++ server that does not include a ``Connection: close`` header in its responses. + + - Issue #12034: Fix bogus caching of result in check_GetFinalPathNameByHandle. + Patch by Atsuo Ishimoto. + +-- Improve performance of `lzma.LZMAFile`. ++- Improve performance of `lzma.LZMAFile` (see also issue #16034). + + - Issue #16220: wsgiref now always calls close() on an iterable response. + Patch by Brent Tubbs. +@@ -2767,7 +3090,7 @@ + - Issue #18207: Fix test_ssl for some versions of OpenSSL that ignore seconds + in ASN1_TIME fields. + +-- Issue #18094: test_uuid no more reports skipped tests as passed. ++- Issue #18094: test_uuid no longer reports skipped tests as passed. + + - Issue #17992: Add timeouts to asyncore and asynchat tests so that they won't + accidentally hang. +@@ -2848,8 +3171,6 @@ + + - Issue #15539: Added regression tests for Tools/scripts/pindent.py. + +-- Issue #16836: Enable IPv6 support even if IPv6 is disabled on the build host. +- + - Issue #17479: test_io now works with unittest test discovery. + Patch by Zachary Ware. + +@@ -3003,7 +3324,7 @@ + - Issue #15484: Fix _PYTHON_PROJECT_BASE for srcdir != builddir builds; + use _PYTHON_PROJECT_BASE in distutils/sysconfig.py. + +-- Drop support for Windows 2000. ++- Drop support for Windows 2000 (changeset e52df05b496a). + + - Issue #17029: Let h2py search the multiarch system include directory. + +@@ -3018,6 +3339,8 @@ + - Fix cross compiling issue in setup.py, ensure that lib_dirs and inc_dirs are + defined in cross compiling mode, too. + ++- Issue #16836: Enable IPv6 support even if IPv6 is disabled on the build host. ++ + - Issue #16593: Have BSD 'make -s' do the right thing, thanks to Daniel Shahaf + + - Issue #16262: fix out-of-src-tree builds, if mercurial is not installed. +@@ -3206,8 +3529,8 @@ + - Issue #17028: Allowed Python arguments to be supplied to the Windows + launcher. + +-- Issue #17156: pygettext.py now uses an encoding of source file and correctly +- writes and escapes non-ascii characters. ++- Issue #17156: pygettext.py now detects the encoding of source files and ++ correctly writes and escapes non-ascii characters. + + - Issue #15539: Fix a number of bugs in Tools/scripts/pindent.py. Now + pindent.py works with a "with" statement. pindent.py no longer produces +@@ -6091,7 +6414,7 @@ + given as a low fd, it gets overwritten. + + - Issue #12576: Fix urlopen behavior on sites which do not send (or obfuscates) +- Connection:close header. ++ ``Connection: close`` header. + + - Issue #12560: Build libpython.so on OpenBSD. Patch by Stefan Sperling. + +@@ -6686,7 +7009,7 @@ + + - Issue #11127: Raise a TypeError when trying to pickle a socket object. + +-- Issue #11563: Connection:close header is sent by requests using URLOpener ++- Issue #11563: ``Connection: close`` header is sent by requests using URLOpener + class which helps in closing of sockets after connection is over. Patch + contributions by Jeff McNeil and Nadeem Vawda. + +@@ -7262,7 +7585,7 @@ + - Issue #11505: improves test coverage of string.py. Patch by Alicia + Arlen + +-- Issue #11490: test_subprocess:test_leaking_fds_on_error no longer gives a ++- Issue #11490: test_subprocess.test_leaking_fds_on_error no longer gives a + false positive if the last directory in the path is inaccessible. + + - Issue #11223: Fix test_threadsignals to fail, not hang, when the +diff -r 3405dc9a6afa Modules/_cryptmodule.c +--- a/Modules/_cryptmodule.c ++++ b/Modules/_cryptmodule.c +@@ -5,19 +5,12 @@ + + #include + +-#ifdef __VMS +-#include +-#endif +- + /* Module crypt */ + + + static PyObject *crypt_crypt(PyObject *self, PyObject *args) + { + char *word, *salt; +-#ifndef __VMS +- extern char * crypt(const char *, const char *); +-#endif + + if (!PyArg_ParseTuple(args, "ss:crypt", &word, &salt)) { + return NULL; +diff -r 3405dc9a6afa Modules/_csv.c +--- a/Modules/_csv.c ++++ b/Modules/_csv.c +@@ -239,6 +239,12 @@ + *target = '\0'; + if (src != Py_None) { + Py_ssize_t len; ++ if (!PyUnicode_Check(src)) { ++ PyErr_Format(PyExc_TypeError, ++ "\"%s\" must be string, not %.200s", name, ++ src->ob_type->tp_name); ++ return -1; ++ } + len = PyUnicode_GetLength(src); + if (len > 1) { + PyErr_Format(PyExc_TypeError, +@@ -425,7 +431,8 @@ + if (dialect_check_quoting(self->quoting)) + goto err; + if (self->delimiter == 0) { +- PyErr_SetString(PyExc_TypeError, "delimiter must be set"); ++ PyErr_SetString(PyExc_TypeError, ++ "\"delimiter\" must be an 1-character string"); + goto err; + } + if (quotechar == Py_None && quoting == NULL) +diff -r 3405dc9a6afa Modules/_ctypes/libffi.diff +--- a/Modules/_ctypes/libffi.diff ++++ b/Modules/_ctypes/libffi.diff +@@ -167,3 +167,39 @@ + #endif /* WIN32 */ + + #ifdef __OS2__ ++@@ -3393,7 +3393,7 @@ ++ *ss = m->seg; /* Push current record */ ++ m->seg.base = tbase; ++ m->seg.size = tsize; ++- set_segment_flags(&m->seg, mmapped); +++ (void)set_segment_flags(&m->seg, mmapped); ++ m->seg.next = ss; ++ ++ /* Insert trailing fenceposts */ ++@@ -3553,7 +3553,7 @@ ++ if (!is_initialized(m)) { /* first-time initialization */ ++ m->seg.base = m->least_addr = tbase; ++ m->seg.size = tsize; ++- set_segment_flags(&m->seg, mmap_flag); +++ (void)set_segment_flags(&m->seg, mmap_flag); ++ m->magic = mparams.magic; ++ init_bins(m); ++ if (is_global(m)) ++@@ -4502,7 +4502,7 @@ ++ char* tbase = (char*)(CALL_MMAP(tsize)); ++ if (tbase != CMFAIL) { ++ m = init_user_mstate(tbase, tsize); ++- set_segment_flags(&m->seg, IS_MMAPPED_BIT); +++ (void)set_segment_flags(&m->seg, IS_MMAPPED_BIT); ++ set_lock(m, locked); ++ } ++ } ++@@ -4517,7 +4517,7 @@ ++ if (capacity > msize + TOP_FOOT_SIZE && ++ capacity < (size_t) -(msize + TOP_FOOT_SIZE + mparams.page_size)) { ++ m = init_user_mstate((char*)base, capacity); ++- set_segment_flags(&m->seg, EXTERN_BIT); +++ (void)set_segment_flags(&m->seg, EXTERN_BIT); ++ set_lock(m, locked); ++ } ++ return (mspace)m; +diff -r 3405dc9a6afa Modules/_ctypes/libffi/src/dlmalloc.c +--- a/Modules/_ctypes/libffi/src/dlmalloc.c ++++ b/Modules/_ctypes/libffi/src/dlmalloc.c +@@ -3393,7 +3393,7 @@ + *ss = m->seg; /* Push current record */ + m->seg.base = tbase; + m->seg.size = tsize; +- set_segment_flags(&m->seg, mmapped); ++ (void)set_segment_flags(&m->seg, mmapped); + m->seg.next = ss; + + /* Insert trailing fenceposts */ +@@ -3553,7 +3553,7 @@ + if (!is_initialized(m)) { /* first-time initialization */ + m->seg.base = m->least_addr = tbase; + m->seg.size = tsize; +- set_segment_flags(&m->seg, mmap_flag); ++ (void)set_segment_flags(&m->seg, mmap_flag); + m->magic = mparams.magic; + init_bins(m); + if (is_global(m)) +@@ -4502,7 +4502,7 @@ + char* tbase = (char*)(CALL_MMAP(tsize)); + if (tbase != CMFAIL) { + m = init_user_mstate(tbase, tsize); +- set_segment_flags(&m->seg, IS_MMAPPED_BIT); ++ (void)set_segment_flags(&m->seg, IS_MMAPPED_BIT); + set_lock(m, locked); + } + } +@@ -4517,7 +4517,7 @@ + if (capacity > msize + TOP_FOOT_SIZE && + capacity < (size_t) -(msize + TOP_FOOT_SIZE + mparams.page_size)) { + m = init_user_mstate((char*)base, capacity); +- set_segment_flags(&m->seg, EXTERN_BIT); ++ (void)set_segment_flags(&m->seg, EXTERN_BIT); + set_lock(m, locked); + } + return (mspace)m; +diff -r 3405dc9a6afa Modules/_cursesmodule.c +--- a/Modules/_cursesmodule.c ++++ b/Modules/_cursesmodule.c +@@ -1414,7 +1414,8 @@ + static PyObject * + PyCursesWindow_InCh(PyCursesWindowObject *self, PyObject *args) + { +- int x, y, rtn; ++ int x, y; ++ unsigned long rtn; + + switch (PyTuple_Size(args)) { + case 0: +@@ -1429,7 +1430,7 @@ + PyErr_SetString(PyExc_TypeError, "inch requires 0 or 2 arguments"); + return NULL; + } +- return PyLong_FromLong((long) rtn); ++ return PyLong_FromUnsignedLong(rtn); + } + + static PyObject * +diff -r 3405dc9a6afa Modules/_datetimemodule.c +--- a/Modules/_datetimemodule.c ++++ b/Modules/_datetimemodule.c +@@ -613,7 +613,7 @@ + sizeof(_PyDateTime_BaseTime)); + if (self == NULL) + return (PyObject *)PyErr_NoMemory(); +- PyObject_INIT(self, type); ++ (void)PyObject_INIT(self, type); + return self; + } + +@@ -628,7 +628,7 @@ + sizeof(_PyDateTime_BaseDateTime)); + if (self == NULL) + return (PyObject *)PyErr_NoMemory(); +- PyObject_INIT(self, type); ++ (void)PyObject_INIT(self, type); + return self; + } + +diff -r 3405dc9a6afa Modules/_dbmmodule.c +--- a/Modules/_dbmmodule.c ++++ b/Modules/_dbmmodule.c +@@ -66,7 +66,8 @@ + if (dp == NULL) + return NULL; + dp->di_size = -1; +- if ( (dp->di_dbm = dbm_open(file, flags, mode)) == 0 ) { ++ /* See issue #19296 */ ++ if ( (dp->di_dbm = dbm_open((char *)file, flags, mode)) == 0 ) { + PyErr_SetFromErrno(DbmError); + Py_DECREF(dp); + return NULL; +diff -r 3405dc9a6afa Modules/_decimal/_decimal.c +--- a/Modules/_decimal/_decimal.c ++++ b/Modules/_decimal/_decimal.c +@@ -39,6 +39,11 @@ + #include "memory.h" + + ++#if MPD_MAJOR_VERSION != 2 ++ #error "libmpdec major version 2 required" ++#endif ++ ++ + /* + * Type sizes with assertions in mpdecimal.h and pyport.h: + * sizeof(size_t) == sizeof(Py_ssize_t) +@@ -5730,7 +5735,8 @@ + } + + /* Add specification version number */ +- CHECK_INT(PyModule_AddStringConstant(m, "__version__", " 1.70")); ++ CHECK_INT(PyModule_AddStringConstant(m, "__version__", "1.70")); ++ CHECK_INT(PyModule_AddStringConstant(m, "__libmpdec_version__", mpd_version())); + + + return m; +diff -r 3405dc9a6afa Modules/_decimal/libmpdec/basearith.c +--- a/Modules/_decimal/libmpdec/basearith.c ++++ b/Modules/_decimal/libmpdec/basearith.c +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2008-2012 Stefan Krah. All rights reserved. ++ * Copyright (c) 2008-2016 Stefan Krah. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions +diff -r 3405dc9a6afa Modules/_decimal/libmpdec/basearith.h +--- a/Modules/_decimal/libmpdec/basearith.h ++++ b/Modules/_decimal/libmpdec/basearith.h +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2008-2012 Stefan Krah. All rights reserved. ++ * Copyright (c) 2008-2016 Stefan Krah. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions +diff -r 3405dc9a6afa Modules/_decimal/libmpdec/bits.h +--- a/Modules/_decimal/libmpdec/bits.h ++++ b/Modules/_decimal/libmpdec/bits.h +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2008-2012 Stefan Krah. All rights reserved. ++ * Copyright (c) 2008-2016 Stefan Krah. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions +diff -r 3405dc9a6afa Modules/_decimal/libmpdec/constants.c +--- a/Modules/_decimal/libmpdec/constants.c ++++ b/Modules/_decimal/libmpdec/constants.c +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2008-2012 Stefan Krah. All rights reserved. ++ * Copyright (c) 2008-2016 Stefan Krah. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions +diff -r 3405dc9a6afa Modules/_decimal/libmpdec/constants.h +--- a/Modules/_decimal/libmpdec/constants.h ++++ b/Modules/_decimal/libmpdec/constants.h +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2008-2012 Stefan Krah. All rights reserved. ++ * Copyright (c) 2008-2016 Stefan Krah. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions +diff -r 3405dc9a6afa Modules/_decimal/libmpdec/context.c +--- a/Modules/_decimal/libmpdec/context.c ++++ b/Modules/_decimal/libmpdec/context.c +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2008-2012 Stefan Krah. All rights reserved. ++ * Copyright (c) 2008-2016 Stefan Krah. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions +diff -r 3405dc9a6afa Modules/_decimal/libmpdec/convolute.c +--- a/Modules/_decimal/libmpdec/convolute.c ++++ b/Modules/_decimal/libmpdec/convolute.c +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2008-2012 Stefan Krah. All rights reserved. ++ * Copyright (c) 2008-2016 Stefan Krah. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions +diff -r 3405dc9a6afa Modules/_decimal/libmpdec/convolute.h +--- a/Modules/_decimal/libmpdec/convolute.h ++++ b/Modules/_decimal/libmpdec/convolute.h +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2008-2012 Stefan Krah. All rights reserved. ++ * Copyright (c) 2008-2016 Stefan Krah. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions +diff -r 3405dc9a6afa Modules/_decimal/libmpdec/crt.c +--- a/Modules/_decimal/libmpdec/crt.c ++++ b/Modules/_decimal/libmpdec/crt.c +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2008-2012 Stefan Krah. All rights reserved. ++ * Copyright (c) 2008-2016 Stefan Krah. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions +diff -r 3405dc9a6afa Modules/_decimal/libmpdec/crt.h +--- a/Modules/_decimal/libmpdec/crt.h ++++ b/Modules/_decimal/libmpdec/crt.h +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2008-2012 Stefan Krah. All rights reserved. ++ * Copyright (c) 2008-2016 Stefan Krah. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions +diff -r 3405dc9a6afa Modules/_decimal/libmpdec/difradix2.c +--- a/Modules/_decimal/libmpdec/difradix2.c ++++ b/Modules/_decimal/libmpdec/difradix2.c +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2008-2012 Stefan Krah. All rights reserved. ++ * Copyright (c) 2008-2016 Stefan Krah. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions +diff -r 3405dc9a6afa Modules/_decimal/libmpdec/difradix2.h +--- a/Modules/_decimal/libmpdec/difradix2.h ++++ b/Modules/_decimal/libmpdec/difradix2.h +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2008-2012 Stefan Krah. All rights reserved. ++ * Copyright (c) 2008-2016 Stefan Krah. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions +diff -r 3405dc9a6afa Modules/_decimal/libmpdec/fnt.c +--- a/Modules/_decimal/libmpdec/fnt.c ++++ b/Modules/_decimal/libmpdec/fnt.c +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2008-2012 Stefan Krah. All rights reserved. ++ * Copyright (c) 2008-2016 Stefan Krah. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions +diff -r 3405dc9a6afa Modules/_decimal/libmpdec/fnt.h +--- a/Modules/_decimal/libmpdec/fnt.h ++++ b/Modules/_decimal/libmpdec/fnt.h +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2008-2012 Stefan Krah. All rights reserved. ++ * Copyright (c) 2008-2016 Stefan Krah. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions +diff -r 3405dc9a6afa Modules/_decimal/libmpdec/fourstep.c +--- a/Modules/_decimal/libmpdec/fourstep.c ++++ b/Modules/_decimal/libmpdec/fourstep.c +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2008-2012 Stefan Krah. All rights reserved. ++ * Copyright (c) 2008-2016 Stefan Krah. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions +diff -r 3405dc9a6afa Modules/_decimal/libmpdec/fourstep.h +--- a/Modules/_decimal/libmpdec/fourstep.h ++++ b/Modules/_decimal/libmpdec/fourstep.h +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2008-2012 Stefan Krah. All rights reserved. ++ * Copyright (c) 2008-2016 Stefan Krah. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions +diff -r 3405dc9a6afa Modules/_decimal/libmpdec/io.c +--- a/Modules/_decimal/libmpdec/io.c ++++ b/Modules/_decimal/libmpdec/io.c +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2008-2012 Stefan Krah. All rights reserved. ++ * Copyright (c) 2008-2016 Stefan Krah. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions +diff -r 3405dc9a6afa Modules/_decimal/libmpdec/io.h +--- a/Modules/_decimal/libmpdec/io.h ++++ b/Modules/_decimal/libmpdec/io.h +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2008-2012 Stefan Krah. All rights reserved. ++ * Copyright (c) 2008-2016 Stefan Krah. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions +diff -r 3405dc9a6afa Modules/_decimal/libmpdec/literature/fnt.py +--- a/Modules/_decimal/libmpdec/literature/fnt.py ++++ b/Modules/_decimal/libmpdec/literature/fnt.py +@@ -1,5 +1,5 @@ + # +-# Copyright (c) 2008-2012 Stefan Krah. All rights reserved. ++# Copyright (c) 2008-2016 Stefan Krah. All rights reserved. + # + # Redistribution and use in source and binary forms, with or without + # modification, are permitted provided that the following conditions +diff -r 3405dc9a6afa Modules/_decimal/libmpdec/literature/mulmod-64.txt +--- a/Modules/_decimal/libmpdec/literature/mulmod-64.txt ++++ b/Modules/_decimal/libmpdec/literature/mulmod-64.txt +@@ -59,7 +59,7 @@ + Maximum numbers of step b): + --------------------------- + +-# To avoid unneccessary formalism, define: ++# To avoid unnecessary formalism, define: + + def R(hi, lo, z): + return divmod(hi * z - hi + lo, 2**64) +diff -r 3405dc9a6afa Modules/_decimal/libmpdec/literature/umodarith.lisp +--- a/Modules/_decimal/libmpdec/literature/umodarith.lisp ++++ b/Modules/_decimal/libmpdec/literature/umodarith.lisp +@@ -1,5 +1,5 @@ + ; +-; Copyright (c) 2008-2012 Stefan Krah. All rights reserved. ++; Copyright (c) 2008-2016 Stefan Krah. All rights reserved. + ; + ; Redistribution and use in source and binary forms, with or without + ; modification, are permitted provided that the following conditions +diff -r 3405dc9a6afa Modules/_decimal/libmpdec/memory.c +--- a/Modules/_decimal/libmpdec/memory.c ++++ b/Modules/_decimal/libmpdec/memory.c +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2008-2012 Stefan Krah. All rights reserved. ++ * Copyright (c) 2008-2016 Stefan Krah. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions +diff -r 3405dc9a6afa Modules/_decimal/libmpdec/memory.h +--- a/Modules/_decimal/libmpdec/memory.h ++++ b/Modules/_decimal/libmpdec/memory.h +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2008-2012 Stefan Krah. All rights reserved. ++ * Copyright (c) 2008-2016 Stefan Krah. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions +diff -r 3405dc9a6afa Modules/_decimal/libmpdec/mpdecimal.c +--- a/Modules/_decimal/libmpdec/mpdecimal.c ++++ b/Modules/_decimal/libmpdec/mpdecimal.c +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2008-2012 Stefan Krah. All rights reserved. ++ * Copyright (c) 2008-2016 Stefan Krah. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions +@@ -97,6 +97,8 @@ + mpd_ssize_t exp); + static inline mpd_ssize_t _mpd_real_size(mpd_uint_t *data, mpd_ssize_t size); + ++static int _mpd_cmp_abs(const mpd_t *a, const mpd_t *b); ++ + static void _mpd_qadd(mpd_t *result, const mpd_t *a, const mpd_t *b, + const mpd_context_t *ctx, uint32_t *status); + static inline void _mpd_qmul(mpd_t *result, const mpd_t *a, const mpd_t *b, +@@ -111,6 +113,17 @@ + + + /******************************************************************************/ ++/* Version */ ++/******************************************************************************/ ++ ++const char * ++mpd_version(void) ++{ ++ return MPD_VERSION; ++} ++ ++ ++/******************************************************************************/ + /* Performance critical inline functions */ + /******************************************************************************/ + +@@ -379,42 +392,42 @@ + + /* Dynamic decimal */ + ALWAYS_INLINE int +-mpd_isdynamic(mpd_t *dec) ++mpd_isdynamic(const mpd_t *dec) + { + return !(dec->flags & MPD_STATIC); + } + + /* Static decimal */ + ALWAYS_INLINE int +-mpd_isstatic(mpd_t *dec) ++mpd_isstatic(const mpd_t *dec) + { + return dec->flags & MPD_STATIC; + } + + /* Data of decimal is dynamic */ + ALWAYS_INLINE int +-mpd_isdynamic_data(mpd_t *dec) ++mpd_isdynamic_data(const mpd_t *dec) + { + return !(dec->flags & MPD_DATAFLAGS); + } + + /* Data of decimal is static */ + ALWAYS_INLINE int +-mpd_isstatic_data(mpd_t *dec) ++mpd_isstatic_data(const mpd_t *dec) + { + return dec->flags & MPD_STATIC_DATA; + } + + /* Data of decimal is shared */ + ALWAYS_INLINE int +-mpd_isshared_data(mpd_t *dec) ++mpd_isshared_data(const mpd_t *dec) + { + return dec->flags & MPD_SHARED_DATA; + } + + /* Data of decimal is const */ + ALWAYS_INLINE int +-mpd_isconst_data(mpd_t *dec) ++mpd_isconst_data(const mpd_t *dec) + { + return dec->flags & MPD_CONST_DATA; + } +@@ -584,7 +597,7 @@ + + /* Copy sign from another decimal */ + ALWAYS_INLINE void +-mpd_signcpy(mpd_t *result, mpd_t *a) ++mpd_signcpy(mpd_t *result, const mpd_t *a) + { + uint8_t sign = a->flags&MPD_NEG; + +@@ -1345,6 +1358,91 @@ + return MPD_SSIZE_MAX; + } + ++#if defined(CONFIG_32) && !defined(LEGACY_COMPILER) ++/* ++ * Quietly get a uint64_t from a decimal. If the operation is impossible, ++ * MPD_Invalid_operation is set. ++ */ ++static uint64_t ++_c32_qget_u64(int use_sign, const mpd_t *a, uint32_t *status) ++{ ++ MPD_NEW_STATIC(tmp,0,0,20,3); ++ mpd_context_t maxcontext; ++ uint64_t ret; ++ ++ tmp_data[0] = 709551615; ++ tmp_data[1] = 446744073; ++ tmp_data[2] = 18; ++ ++ if (mpd_isspecial(a)) { ++ *status |= MPD_Invalid_operation; ++ return UINT64_MAX; ++ } ++ if (mpd_iszero(a)) { ++ return 0; ++ } ++ if (use_sign && mpd_isnegative(a)) { ++ *status |= MPD_Invalid_operation; ++ return UINT64_MAX; ++ } ++ if (!_mpd_isint(a)) { ++ *status |= MPD_Invalid_operation; ++ return UINT64_MAX; ++ } ++ ++ if (_mpd_cmp_abs(a, &tmp) > 0) { ++ *status |= MPD_Invalid_operation; ++ return UINT64_MAX; ++ } ++ ++ mpd_maxcontext(&maxcontext); ++ mpd_qrescale(&tmp, a, 0, &maxcontext, &maxcontext.status); ++ maxcontext.status &= ~MPD_Rounded; ++ if (maxcontext.status != 0) { ++ *status |= (maxcontext.status|MPD_Invalid_operation); /* GCOV_NOT_REACHED */ ++ return UINT64_MAX; /* GCOV_NOT_REACHED */ ++ } ++ ++ ret = 0; ++ switch (tmp.len) { ++ case 3: ++ ret += (uint64_t)tmp_data[2] * 1000000000000000000ULL; ++ case 2: ++ ret += (uint64_t)tmp_data[1] * 1000000000ULL; ++ case 1: ++ ret += tmp_data[0]; ++ break; ++ default: ++ abort(); /* GCOV_NOT_REACHED */ ++ } ++ ++ return ret; ++} ++ ++static int64_t ++_c32_qget_i64(const mpd_t *a, uint32_t *status) ++{ ++ uint64_t u; ++ int isneg; ++ ++ u = _c32_qget_u64(0, a, status); ++ if (*status&MPD_Invalid_operation) { ++ return INT64_MAX; ++ } ++ ++ isneg = mpd_isnegative(a); ++ if (u <= INT64_MAX) { ++ return isneg ? -((int64_t)u) : (int64_t)u; ++ } ++ else if (isneg && u+(INT64_MIN+INT64_MAX) == INT64_MAX) { ++ return INT64_MIN; ++ } ++ ++ *status |= MPD_Invalid_operation; ++ return INT64_MAX; ++} ++#endif /* CONFIG_32 && !LEGACY_COMPILER */ ++ + #ifdef CONFIG_64 + /* quietly get a uint64_t from a decimal */ + uint64_t +@@ -1359,7 +1457,57 @@ + { + return mpd_qget_ssize(a, status); + } ++ ++/* quietly get a uint32_t from a decimal */ ++uint32_t ++mpd_qget_u32(const mpd_t *a, uint32_t *status) ++{ ++ uint64_t x = mpd_qget_uint(a, status); ++ ++ if (*status&MPD_Invalid_operation) { ++ return UINT32_MAX; ++ } ++ if (x > UINT32_MAX) { ++ *status |= MPD_Invalid_operation; ++ return UINT32_MAX; ++ } ++ ++ return (uint32_t)x; ++} ++ ++/* quietly get an int32_t from a decimal */ ++int32_t ++mpd_qget_i32(const mpd_t *a, uint32_t *status) ++{ ++ int64_t x = mpd_qget_ssize(a, status); ++ ++ if (*status&MPD_Invalid_operation) { ++ return INT32_MAX; ++ } ++ if (x < INT32_MIN || x > INT32_MAX) { ++ *status |= MPD_Invalid_operation; ++ return INT32_MAX; ++ } ++ ++ return (int32_t)x; ++} + #else ++#ifndef LEGACY_COMPILER ++/* quietly get a uint64_t from a decimal */ ++uint64_t ++mpd_qget_u64(const mpd_t *a, uint32_t *status) ++{ ++ return _c32_qget_u64(1, a, status); ++} ++ ++/* quietly get an int64_t from a decimal */ ++int64_t ++mpd_qget_i64(const mpd_t *a, uint32_t *status) ++{ ++ return _c32_qget_i64(a, status); ++} ++#endif ++ + /* quietly get a uint32_t from a decimal */ + uint32_t + mpd_qget_u32(const mpd_t *a, uint32_t *status) +@@ -3054,9 +3202,9 @@ + } + + static inline void +-_mpd_ptrswap(mpd_t **a, mpd_t **b) +-{ +- mpd_t *t = *a; ++_mpd_ptrswap(const mpd_t **a, const mpd_t **b) ++{ ++ const mpd_t *t = *a; + *a = *b; + *b = t; + } +@@ -3084,7 +3232,7 @@ + _mpd_qaddsub(mpd_t *result, const mpd_t *a, const mpd_t *b, uint8_t sign_b, + const mpd_context_t *ctx, uint32_t *status) + { +- mpd_t *big, *small; ++ const mpd_t *big, *small; + MPD_NEW_STATIC(big_aligned,0,0,0,0); + MPD_NEW_CONST(tiny,0,0,1,1,1,1); + mpd_uint_t carry; +@@ -3094,7 +3242,7 @@ + + + /* compare exponents */ +- big = (mpd_t *)a; small = (mpd_t *)b; ++ big = a; small = b; + if (big->exp != small->exp) { + if (small->exp > big->exp) { + _mpd_ptrswap(&big, &small); +@@ -3386,6 +3534,34 @@ + { + mpd_qadd_uint(result, a, b, ctx, status); + } ++#elif !defined(LEGACY_COMPILER) ++/* Add decimal and int64_t. */ ++void ++mpd_qadd_i64(mpd_t *result, const mpd_t *a, int64_t b, ++ const mpd_context_t *ctx, uint32_t *status) ++{ ++ mpd_context_t maxcontext; ++ MPD_NEW_STATIC(bb,0,0,0,0); ++ ++ mpd_maxcontext(&maxcontext); ++ mpd_qset_i64(&bb, b, &maxcontext, status); ++ mpd_qadd(result, a, &bb, ctx, status); ++ mpd_del(&bb); ++} ++ ++/* Add decimal and uint64_t. */ ++void ++mpd_qadd_u64(mpd_t *result, const mpd_t *a, uint64_t b, ++ const mpd_context_t *ctx, uint32_t *status) ++{ ++ mpd_context_t maxcontext; ++ MPD_NEW_STATIC(bb,0,0,0,0); ++ ++ mpd_maxcontext(&maxcontext); ++ mpd_qset_u64(&bb, b, &maxcontext, status); ++ mpd_qadd(result, a, &bb, ctx, status); ++ mpd_del(&bb); ++} + #endif + + /* Subtract int32_t from decimal. */ +@@ -3420,6 +3596,34 @@ + { + mpd_qsub_uint(result, a, b, ctx, status); + } ++#elif !defined(LEGACY_COMPILER) ++/* Subtract int64_t from decimal. */ ++void ++mpd_qsub_i64(mpd_t *result, const mpd_t *a, int64_t b, ++ const mpd_context_t *ctx, uint32_t *status) ++{ ++ mpd_context_t maxcontext; ++ MPD_NEW_STATIC(bb,0,0,0,0); ++ ++ mpd_maxcontext(&maxcontext); ++ mpd_qset_i64(&bb, b, &maxcontext, status); ++ mpd_qsub(result, a, &bb, ctx, status); ++ mpd_del(&bb); ++} ++ ++/* Subtract uint64_t from decimal. */ ++void ++mpd_qsub_u64(mpd_t *result, const mpd_t *a, uint64_t b, ++ const mpd_context_t *ctx, uint32_t *status) ++{ ++ mpd_context_t maxcontext; ++ MPD_NEW_STATIC(bb,0,0,0,0); ++ ++ mpd_maxcontext(&maxcontext); ++ mpd_qset_u64(&bb, b, &maxcontext, status); ++ mpd_qsub(result, a, &bb, ctx, status); ++ mpd_del(&bb); ++} + #endif + + +@@ -3871,6 +4075,34 @@ + { + mpd_qdiv_uint(result, a, b, ctx, status); + } ++#elif !defined(LEGACY_COMPILER) ++/* Divide decimal by int64_t. */ ++void ++mpd_qdiv_i64(mpd_t *result, const mpd_t *a, int64_t b, ++ const mpd_context_t *ctx, uint32_t *status) ++{ ++ mpd_context_t maxcontext; ++ MPD_NEW_STATIC(bb,0,0,0,0); ++ ++ mpd_maxcontext(&maxcontext); ++ mpd_qset_i64(&bb, b, &maxcontext, status); ++ mpd_qdiv(result, a, &bb, ctx, status); ++ mpd_del(&bb); ++} ++ ++/* Divide decimal by uint64_t. */ ++void ++mpd_qdiv_u64(mpd_t *result, const mpd_t *a, uint64_t b, ++ const mpd_context_t *ctx, uint32_t *status) ++{ ++ mpd_context_t maxcontext; ++ MPD_NEW_STATIC(bb,0,0,0,0); ++ ++ mpd_maxcontext(&maxcontext); ++ mpd_qset_u64(&bb, b, &maxcontext, status); ++ mpd_qdiv(result, a, &bb, ctx, status); ++ mpd_del(&bb); ++} + #endif + + /* Pad the result with trailing zeros if it has fewer digits than prec. */ +@@ -4189,21 +4421,22 @@ + const mpd_context_t *ctx, uint32_t *status) + { + uint32_t workstatus = 0; +- mpd_t *cc = (mpd_t *)c; ++ mpd_t *cc = NULL; + + if (result == c) { + if ((cc = mpd_qncopy(c)) == NULL) { + mpd_seterror(result, MPD_Malloc_error, status); + return; + } ++ c = cc; + } + + _mpd_qmul(result, a, b, ctx, &workstatus); + if (!(workstatus&MPD_Invalid_operation)) { +- mpd_qadd(result, result, cc, ctx, &workstatus); +- } +- +- if (cc != c) mpd_del(cc); ++ mpd_qadd(result, result, c, ctx, &workstatus); ++ } ++ ++ if (cc) mpd_del(cc); + *status |= workstatus; + } + +@@ -5495,7 +5728,7 @@ + _mpd_qmul(mpd_t *result, const mpd_t *a, const mpd_t *b, + const mpd_context_t *ctx, uint32_t *status) + { +- mpd_t *big = (mpd_t *)a, *small = (mpd_t *)b; ++ const mpd_t *big = a, *small = b; + mpd_uint_t *rdata = NULL; + mpd_uint_t rbuf[MPD_MINALLOC_MAX]; + mpd_size_t rsize, i; +@@ -5664,6 +5897,34 @@ + { + mpd_qmul_uint(result, a, b, ctx, status); + } ++#elif !defined(LEGACY_COMPILER) ++/* Multiply decimal and int64_t. */ ++void ++mpd_qmul_i64(mpd_t *result, const mpd_t *a, int64_t b, ++ const mpd_context_t *ctx, uint32_t *status) ++{ ++ mpd_context_t maxcontext; ++ MPD_NEW_STATIC(bb,0,0,0,0); ++ ++ mpd_maxcontext(&maxcontext); ++ mpd_qset_i64(&bb, b, &maxcontext, status); ++ mpd_qmul(result, a, &bb, ctx, status); ++ mpd_del(&bb); ++} ++ ++/* Multiply decimal and uint64_t. */ ++void ++mpd_qmul_u64(mpd_t *result, const mpd_t *a, uint64_t b, ++ const mpd_context_t *ctx, uint32_t *status) ++{ ++ mpd_context_t maxcontext; ++ MPD_NEW_STATIC(bb,0,0,0,0); ++ ++ mpd_maxcontext(&maxcontext); ++ mpd_qset_u64(&bb, b, &maxcontext, status); ++ mpd_qmul(result, a, &bb, ctx, status); ++ mpd_del(&bb); ++} + #endif + + /* Like the minus operator. */ +diff -r 3405dc9a6afa Modules/_decimal/libmpdec/mpdecimal.h +--- a/Modules/_decimal/libmpdec/mpdecimal.h ++++ b/Modules/_decimal/libmpdec/mpdecimal.h +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2008-2012 Stefan Krah. All rights reserved. ++ * Copyright (c) 2008-2016 Stefan Krah. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions +@@ -32,7 +32,10 @@ + + #ifdef __cplusplus + extern "C" { +-#define __STDC_LIMIT_MACROS ++ #ifndef __STDC_LIMIT_MACROS ++ #define __STDC_LIMIT_MACROS ++ #define MPD_CLEAR_STDC_LIMIT_MACROS ++ #endif + #endif + + +@@ -100,6 +103,19 @@ + + + /******************************************************************************/ ++/* Version */ ++/******************************************************************************/ ++ ++#define MPD_MAJOR_VERSION 2 ++#define MPD_MINOR_VERSION 4 ++#define MPD_MICRO_VERSION 0 ++ ++#define MPD_VERSION "2.4.0" ++ ++const char *mpd_version(void); ++ ++ ++/******************************************************************************/ + /* Configuration */ + /******************************************************************************/ + +@@ -241,7 +257,7 @@ + extern const char *mpd_clamp_string[MPD_CLAMP_GUARD]; + + +-typedef struct { ++typedef struct mpd_context_t { + mpd_ssize_t prec; /* precision */ + mpd_ssize_t emax; /* max positive exp */ + mpd_ssize_t emin; /* min negative exp */ +@@ -353,7 +369,7 @@ + #define MPD_DATAFLAGS (MPD_STATIC_DATA|MPD_SHARED_DATA|MPD_CONST_DATA) + + /* mpd_t */ +-typedef struct { ++typedef struct mpd_t { + uint8_t flags; + mpd_ssize_t exp; + mpd_ssize_t digits; +@@ -371,7 +387,7 @@ + /******************************************************************************/ + + /* format specification */ +-typedef struct { ++typedef struct mpd_spec_t { + mpd_ssize_t min_width; /* minimum field width */ + mpd_ssize_t prec; /* fraction digits or significant digits */ + char type; /* conversion specifier */ +@@ -437,6 +453,12 @@ + mpd_uint_t mpd_qget_uint(const mpd_t *dec, uint32_t *status); + mpd_uint_t mpd_qabs_uint(const mpd_t *dec, uint32_t *status); + ++int32_t mpd_qget_i32(const mpd_t *dec, uint32_t *status); ++uint32_t mpd_qget_u32(const mpd_t *dec, uint32_t *status); ++#ifndef LEGACY_COMPILER ++int64_t mpd_qget_i64(const mpd_t *dec, uint32_t *status); ++uint64_t mpd_qget_u64(const mpd_t *dec, uint32_t *status); ++#endif + + /* quiet functions */ + int mpd_qcheck_nan(mpd_t *nanresult, const mpd_t *a, const mpd_context_t *ctx, uint32_t *status); +@@ -528,6 +550,17 @@ + void mpd_qsqrt(mpd_t *result, const mpd_t *a, const mpd_context_t *ctx, uint32_t *status); + void mpd_qinvroot(mpd_t *result, const mpd_t *a, const mpd_context_t *ctx, uint32_t *status); + ++#ifndef LEGACY_COMPILER ++void mpd_qadd_i64(mpd_t *result, const mpd_t *a, int64_t b, const mpd_context_t *ctx, uint32_t *status); ++void mpd_qadd_u64(mpd_t *result, const mpd_t *a, uint64_t b, const mpd_context_t *ctx, uint32_t *status); ++void mpd_qsub_i64(mpd_t *result, const mpd_t *a, int64_t b, const mpd_context_t *ctx, uint32_t *status); ++void mpd_qsub_u64(mpd_t *result, const mpd_t *a, uint64_t b, const mpd_context_t *ctx, uint32_t *status); ++void mpd_qmul_i64(mpd_t *result, const mpd_t *a, int64_t b, const mpd_context_t *ctx, uint32_t *status); ++void mpd_qmul_u64(mpd_t *result, const mpd_t *a, uint64_t b, const mpd_context_t *ctx, uint32_t *status); ++void mpd_qdiv_i64(mpd_t *result, const mpd_t *a, int64_t b, const mpd_context_t *ctx, uint32_t *status); ++void mpd_qdiv_u64(mpd_t *result, const mpd_t *a, uint64_t b, const mpd_context_t *ctx, uint32_t *status); ++#endif ++ + + size_t mpd_sizeinbase(const mpd_t *a, uint32_t base); + void mpd_qimport_u16(mpd_t *result, const uint16_t *srcdata, size_t srclen, +@@ -571,6 +604,12 @@ + mpd_ssize_t mpd_get_ssize(const mpd_t *a, mpd_context_t *ctx); + mpd_uint_t mpd_get_uint(const mpd_t *a, mpd_context_t *ctx); + mpd_uint_t mpd_abs_uint(const mpd_t *a, mpd_context_t *ctx); ++int32_t mpd_get_i32(const mpd_t *a, mpd_context_t *ctx); ++uint32_t mpd_get_u32(const mpd_t *a, mpd_context_t *ctx); ++#ifndef LEGACY_COMPILER ++int64_t mpd_get_i64(const mpd_t *a, mpd_context_t *ctx); ++uint64_t mpd_get_u64(const mpd_t *a, mpd_context_t *ctx); ++#endif + void mpd_and(mpd_t *result, const mpd_t *a, const mpd_t *b, mpd_context_t *ctx); + void mpd_copy(mpd_t *result, const mpd_t *a, mpd_context_t *ctx); + void mpd_canonical(mpd_t *result, const mpd_t *a, mpd_context_t *ctx); +@@ -641,6 +680,17 @@ + void mpd_sqrt(mpd_t *result, const mpd_t *a, mpd_context_t *ctx); + void mpd_invroot(mpd_t *result, const mpd_t *a, mpd_context_t *ctx); + ++#ifndef LEGACY_COMPILER ++void mpd_add_i64(mpd_t *result, const mpd_t *a, int64_t b, mpd_context_t *ctx); ++void mpd_add_u64(mpd_t *result, const mpd_t *a, uint64_t b, mpd_context_t *ctx); ++void mpd_sub_i64(mpd_t *result, const mpd_t *a, int64_t b, mpd_context_t *ctx); ++void mpd_sub_u64(mpd_t *result, const mpd_t *a, uint64_t b, mpd_context_t *ctx); ++void mpd_div_i64(mpd_t *result, const mpd_t *a, int64_t b, mpd_context_t *ctx); ++void mpd_div_u64(mpd_t *result, const mpd_t *a, uint64_t b, mpd_context_t *ctx); ++void mpd_mul_i64(mpd_t *result, const mpd_t *a, int64_t b, mpd_context_t *ctx); ++void mpd_mul_u64(mpd_t *result, const mpd_t *a, uint64_t b, mpd_context_t *ctx); ++#endif ++ + + /******************************************************************************/ + /* Configuration specific */ +@@ -649,36 +699,8 @@ + #ifdef CONFIG_64 + void mpd_qsset_i64(mpd_t *result, int64_t a, const mpd_context_t *ctx, uint32_t *status); + void mpd_qsset_u64(mpd_t *result, uint64_t a, const mpd_context_t *ctx, uint32_t *status); +-int64_t mpd_qget_i64(const mpd_t *dec, uint32_t *status); +-uint64_t mpd_qget_u64(const mpd_t *dec, uint32_t *status); +- +-void mpd_qadd_i64(mpd_t *result, const mpd_t *a, int64_t b, const mpd_context_t *ctx, uint32_t *status); +-void mpd_qadd_u64(mpd_t *result, const mpd_t *a, uint64_t b, const mpd_context_t *ctx, uint32_t *status); +-void mpd_qsub_i64(mpd_t *result, const mpd_t *a, int64_t b, const mpd_context_t *ctx, uint32_t *status); +-void mpd_qsub_u64(mpd_t *result, const mpd_t *a, uint64_t b, const mpd_context_t *ctx, uint32_t *status); +-void mpd_qmul_i64(mpd_t *result, const mpd_t *a, int64_t b, const mpd_context_t *ctx, uint32_t *status); +-void mpd_qmul_u64(mpd_t *result, const mpd_t *a, uint64_t b, const mpd_context_t *ctx, uint32_t *status); +-void mpd_qdiv_i64(mpd_t *result, const mpd_t *a, int64_t b, const mpd_context_t *ctx, uint32_t *status); +-void mpd_qdiv_u64(mpd_t *result, const mpd_t *a, uint64_t b, const mpd_context_t *ctx, uint32_t *status); +- + void mpd_sset_i64(mpd_t *result, int64_t a, mpd_context_t *ctx); + void mpd_sset_u64(mpd_t *result, uint64_t a, mpd_context_t *ctx); +-int64_t mpd_get_i64(const mpd_t *a, mpd_context_t *ctx); +-uint64_t mpd_get_u64(const mpd_t *a, mpd_context_t *ctx); +- +-void mpd_add_i64(mpd_t *result, const mpd_t *a, int64_t b, mpd_context_t *ctx); +-void mpd_add_u64(mpd_t *result, const mpd_t *a, uint64_t b, mpd_context_t *ctx); +-void mpd_sub_i64(mpd_t *result, const mpd_t *a, int64_t b, mpd_context_t *ctx); +-void mpd_sub_u64(mpd_t *result, const mpd_t *a, uint64_t b, mpd_context_t *ctx); +-void mpd_div_i64(mpd_t *result, const mpd_t *a, int64_t b, mpd_context_t *ctx); +-void mpd_div_u64(mpd_t *result, const mpd_t *a, uint64_t b, mpd_context_t *ctx); +-void mpd_mul_i64(mpd_t *result, const mpd_t *a, int64_t b, mpd_context_t *ctx); +-void mpd_mul_u64(mpd_t *result, const mpd_t *a, uint64_t b, mpd_context_t *ctx); +-#else +-int32_t mpd_qget_i32(const mpd_t *dec, uint32_t *status); +-uint32_t mpd_qget_u32(const mpd_t *dec, uint32_t *status); +-int32_t mpd_get_i32(const mpd_t *a, mpd_context_t *ctx); +-uint32_t mpd_get_u32(const mpd_t *a, mpd_context_t *ctx); + #endif + + +@@ -728,12 +750,12 @@ + /* 1 if dec is positive, -1 if dec is negative */ + EXTINLINE int mpd_arith_sign(const mpd_t *dec); + EXTINLINE long mpd_radix(void); +-EXTINLINE int mpd_isdynamic(mpd_t *dec); +-EXTINLINE int mpd_isstatic(mpd_t *dec); +-EXTINLINE int mpd_isdynamic_data(mpd_t *dec); +-EXTINLINE int mpd_isstatic_data(mpd_t *dec); +-EXTINLINE int mpd_isshared_data(mpd_t *dec); +-EXTINLINE int mpd_isconst_data(mpd_t *dec); ++EXTINLINE int mpd_isdynamic(const mpd_t *dec); ++EXTINLINE int mpd_isstatic(const mpd_t *dec); ++EXTINLINE int mpd_isdynamic_data(const mpd_t *dec); ++EXTINLINE int mpd_isstatic_data(const mpd_t *dec); ++EXTINLINE int mpd_isshared_data(const mpd_t *dec); ++EXTINLINE int mpd_isconst_data(const mpd_t *dec); + EXTINLINE mpd_ssize_t mpd_trail_zeros(const mpd_t *dec); + + +@@ -745,7 +767,7 @@ + EXTINLINE void mpd_setdigits(mpd_t *result); + EXTINLINE void mpd_set_sign(mpd_t *result, uint8_t sign); + /* copy sign from another decimal */ +-EXTINLINE void mpd_signcpy(mpd_t *result, mpd_t *a); ++EXTINLINE void mpd_signcpy(mpd_t *result, const mpd_t *a); + EXTINLINE void mpd_set_infinity(mpd_t *result); + EXTINLINE void mpd_set_qnan(mpd_t *result); + EXTINLINE void mpd_set_snan(mpd_t *result); +@@ -811,6 +833,10 @@ + + + #ifdef __cplusplus ++ #ifdef MPD_CLEAR_STDC_LIMIT_MACROS ++ #undef MPD_CLEAR_STDC_LIMIT_MACROS ++ #undef __STDC_LIMIT_MACROS ++ #endif + } /* END extern "C" */ + #endif + +diff -r 3405dc9a6afa Modules/_decimal/libmpdec/numbertheory.c +--- a/Modules/_decimal/libmpdec/numbertheory.c ++++ b/Modules/_decimal/libmpdec/numbertheory.c +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2008-2012 Stefan Krah. All rights reserved. ++ * Copyright (c) 2008-2016 Stefan Krah. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions +diff -r 3405dc9a6afa Modules/_decimal/libmpdec/numbertheory.h +--- a/Modules/_decimal/libmpdec/numbertheory.h ++++ b/Modules/_decimal/libmpdec/numbertheory.h +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2008-2012 Stefan Krah. All rights reserved. ++ * Copyright (c) 2008-2016 Stefan Krah. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions +diff -r 3405dc9a6afa Modules/_decimal/libmpdec/sixstep.c +--- a/Modules/_decimal/libmpdec/sixstep.c ++++ b/Modules/_decimal/libmpdec/sixstep.c +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2008-2012 Stefan Krah. All rights reserved. ++ * Copyright (c) 2008-2016 Stefan Krah. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions +diff -r 3405dc9a6afa Modules/_decimal/libmpdec/sixstep.h +--- a/Modules/_decimal/libmpdec/sixstep.h ++++ b/Modules/_decimal/libmpdec/sixstep.h +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2008-2012 Stefan Krah. All rights reserved. ++ * Copyright (c) 2008-2016 Stefan Krah. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions +diff -r 3405dc9a6afa Modules/_decimal/libmpdec/transpose.c +--- a/Modules/_decimal/libmpdec/transpose.c ++++ b/Modules/_decimal/libmpdec/transpose.c +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2008-2012 Stefan Krah. All rights reserved. ++ * Copyright (c) 2008-2016 Stefan Krah. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions +@@ -169,7 +169,7 @@ + /* + * Transpose 2^n * 2^n matrix. For cache efficiency, the matrix is split into + * square blocks with side length 'SIDE'. First, the blocks are transposed, +- * then a square tranposition is done on each individual block. ++ * then a square transposition is done on each individual block. + */ + static void + squaretrans_pow2(mpd_uint_t *matrix, mpd_size_t size) +diff -r 3405dc9a6afa Modules/_decimal/libmpdec/transpose.h +--- a/Modules/_decimal/libmpdec/transpose.h ++++ b/Modules/_decimal/libmpdec/transpose.h +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2008-2012 Stefan Krah. All rights reserved. ++ * Copyright (c) 2008-2016 Stefan Krah. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions +diff -r 3405dc9a6afa Modules/_decimal/libmpdec/typearith.h +--- a/Modules/_decimal/libmpdec/typearith.h ++++ b/Modules/_decimal/libmpdec/typearith.h +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2008-2012 Stefan Krah. All rights reserved. ++ * Copyright (c) 2008-2016 Stefan Krah. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions +diff -r 3405dc9a6afa Modules/_decimal/libmpdec/umodarith.h +--- a/Modules/_decimal/libmpdec/umodarith.h ++++ b/Modules/_decimal/libmpdec/umodarith.h +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2008-2012 Stefan Krah. All rights reserved. ++ * Copyright (c) 2008-2016 Stefan Krah. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions +diff -r 3405dc9a6afa Modules/_decimal/libmpdec/vccompat.h +--- a/Modules/_decimal/libmpdec/vccompat.h ++++ b/Modules/_decimal/libmpdec/vccompat.h +@@ -1,5 +1,5 @@ + /* +- * Copyright (c) 2008-2012 Stefan Krah. All rights reserved. ++ * Copyright (c) 2008-2016 Stefan Krah. All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions +diff -r 3405dc9a6afa Modules/_decimal/libmpdec/vcdiv64.asm +--- a/Modules/_decimal/libmpdec/vcdiv64.asm ++++ b/Modules/_decimal/libmpdec/vcdiv64.asm +@@ -1,5 +1,5 @@ + ; +-; Copyright (c) 2008-2012 Stefan Krah. All rights reserved. ++; Copyright (c) 2008-2016 Stefan Krah. All rights reserved. + ; + ; Redistribution and use in source and binary forms, with or without + ; modification, are permitted provided that the following conditions +diff -r 3405dc9a6afa Modules/_elementtree.c +--- a/Modules/_elementtree.c ++++ b/Modules/_elementtree.c +@@ -567,8 +567,9 @@ + PyObject* attrib = NULL; + if (!PyArg_ParseTuple(args, "O!O|O!:SubElement", + &Element_Type, &parent, &tag, +- &PyDict_Type, &attrib)) ++ &PyDict_Type, &attrib)) { + return NULL; ++ } + + if (attrib) { + /* attrib passed as positional arg */ +@@ -652,7 +653,6 @@ + } + + /* -------------------------------------------------------------------- */ +-/* methods (in alphabetical order) */ + + static PyObject* + element_append(ElementObject* self, PyObject* args) +@@ -696,8 +696,7 @@ + return NULL; + + element = (ElementObject*) create_new_element( +- self->tag, (self->extra) ? self->extra->attrib : Py_None +- ); ++ self->tag, (self->extra) ? self->extra->attrib : Py_None); + if (!element) + return NULL; + +@@ -710,7 +709,6 @@ + Py_INCREF(JOIN_OBJ(element->tail)); + + if (self->extra) { +- + if (element_resize(element, self->extra->length) < 0) { + Py_DECREF(element); + return NULL; +@@ -722,7 +720,6 @@ + } + + element->extra->length = self->extra->length; +- + } + + return (PyObject*) element; +@@ -779,7 +776,6 @@ + element->tail = JOIN_SET(tail, JOIN_GET(self->tail)); + + if (self->extra) { +- + if (element_resize(element, self->extra->length) < 0) + goto error; + +@@ -793,7 +789,6 @@ + } + + element->extra->length = self->extra->length; +- + } + + /* add object to memo dictionary (so deepcopy won't visit it again) */ +@@ -1141,8 +1136,8 @@ + + for (i = 0; i < self->extra->length; i++) { + ElementObject* item = (ElementObject*) self->extra->children[i]; +- if (Element_CheckExact(item) && (PyObject_RichCompareBool(item->tag, tag, Py_EQ) == 1)) { +- ++ if (Element_CheckExact(item) && ++ (PyObject_RichCompareBool(item->tag, tag, Py_EQ) == 1)) { + PyObject* text = element_get_text(item); + if (text == Py_None) + return PyUnicode_New(0, 0); +@@ -1207,12 +1202,12 @@ + elementtreestate *st = ET_STATE_GLOBAL; + + if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|O:iterfind", kwlist, +- &tag, &namespaces)) ++ &tag, &namespaces)) { + return NULL; ++ } + + return _PyObject_CallMethodId( +- st->elementpath_obj, &PyId_iterfind, "OOO", self, tag, namespaces +- ); ++ st->elementpath_obj, &PyId_iterfind, "OOO", self, tag, namespaces); + } + + static PyObject* +@@ -3043,7 +3038,10 @@ + if (PyErr_Occurred()) + return; + +- suri = PyUnicode_DecodeUTF8(uri, strlen(uri), "strict"); ++ if (uri) ++ suri = PyUnicode_DecodeUTF8(uri, strlen(uri), "strict"); ++ else ++ suri = PyUnicode_FromString(""); + if (!suri) + return; + +diff -r 3405dc9a6afa Modules/_hashopenssl.c +--- a/Modules/_hashopenssl.c ++++ b/Modules/_hashopenssl.c +@@ -557,6 +557,7 @@ + return 1; + } + ++/* LCOV_EXCL_START */ + static PyObject * + _setException(PyObject *exc) + { +@@ -585,6 +586,7 @@ + } + return NULL; + } ++/* LCOV_EXCL_STOP */ + + PyDoc_STRVAR(pbkdf2_hmac__doc__, + "pbkdf2_hmac(hash_name, password, salt, iterations, dklen=None) -> key\n\ +diff -r 3405dc9a6afa Modules/_io/_iomodule.c +--- a/Modules/_io/_iomodule.c ++++ b/Modules/_io/_iomodule.c +@@ -539,6 +539,20 @@ + } + + ++_PyIO_State * ++_PyIO_get_module_state(void) ++{ ++ PyObject *mod = PyState_FindModule(&_PyIO_Module); ++ _PyIO_State *state; ++ if (mod == NULL || (state = IO_MOD_STATE(mod)) == NULL) { ++ PyErr_SetString(PyExc_RuntimeError, ++ "could not find io module state " ++ "(interpreter shutdown?)"); ++ return NULL; ++ } ++ return state; ++} ++ + PyObject * + _PyIO_get_locale_module(_PyIO_State *state) + { +diff -r 3405dc9a6afa Modules/_io/_iomodule.h +--- a/Modules/_io/_iomodule.h ++++ b/Modules/_io/_iomodule.h +@@ -135,8 +135,9 @@ + } _PyIO_State; + + #define IO_MOD_STATE(mod) ((_PyIO_State *)PyModule_GetState(mod)) +-#define IO_STATE IO_MOD_STATE(PyState_FindModule(&_PyIO_Module)) ++#define IO_STATE() _PyIO_get_module_state() + ++extern _PyIO_State *_PyIO_get_module_state(void); + extern PyObject *_PyIO_get_locale_module(_PyIO_State *); + + extern PyObject *_PyIO_str_close; +diff -r 3405dc9a6afa Modules/_io/bufferedio.c +--- a/Modules/_io/bufferedio.c ++++ b/Modules/_io/bufferedio.c +@@ -91,7 +91,9 @@ + static PyObject * + bufferediobase_unsupported(const char *message) + { +- PyErr_SetString(IO_STATE->unsupported_operation, message); ++ _PyIO_State *state = IO_STATE(); ++ if (state != NULL) ++ PyErr_SetString(state->unsupported_operation, message); + return NULL; + } + +diff -r 3405dc9a6afa Modules/_io/fileio.c +--- a/Modules/_io/fileio.c ++++ b/Modules/_io/fileio.c +@@ -493,8 +493,10 @@ + static PyObject * + err_mode(char *action) + { +- PyErr_Format(IO_STATE->unsupported_operation, +- "File not open for %s", action); ++ _PyIO_State *state = IO_STATE(); ++ if (state != NULL) ++ PyErr_Format(state->unsupported_operation, ++ "File not open for %s", action); + return NULL; + } + +diff -r 3405dc9a6afa Modules/_io/iobase.c +--- a/Modules/_io/iobase.c ++++ b/Modules/_io/iobase.c +@@ -69,7 +69,9 @@ + static PyObject * + iobase_unsupported(const char *message) + { +- PyErr_SetString(IO_STATE->unsupported_operation, message); ++ _PyIO_State *state = IO_STATE(); ++ if (state != NULL) ++ PyErr_SetString(state->unsupported_operation, message); + return NULL; + } + +diff -r 3405dc9a6afa Modules/_io/textio.c +--- a/Modules/_io/textio.c ++++ b/Modules/_io/textio.c +@@ -45,7 +45,9 @@ + static PyObject * + _unsupported(const char *message) + { +- PyErr_SetString(IO_STATE->unsupported_operation, message); ++ _PyIO_State *state = IO_STATE(); ++ if (state != NULL) ++ PyErr_SetString(state->unsupported_operation, message); + return NULL; + } + +@@ -852,7 +854,7 @@ + char *errors = NULL; + char *newline = NULL; + int line_buffering = 0, write_through = 0; +- _PyIO_State *state = IO_STATE; ++ _PyIO_State *state = NULL; + + PyObject *res; + int r; +@@ -891,6 +893,9 @@ + if (encoding == NULL) { + /* Try os.device_encoding(fileno) */ + PyObject *fileno; ++ state = IO_STATE(); ++ if (state == NULL) ++ goto error; + fileno = _PyObject_CallMethodId(buffer, &PyId_fileno, NULL); + /* Ignore only AttributeError and UnsupportedOperation */ + if (fileno == NULL) { +diff -r 3405dc9a6afa Modules/_json.c +--- a/Modules/_json.c ++++ b/Modules/_json.c +@@ -409,17 +409,10 @@ + } + } + /* Surrogate pair */ +- if (Py_UNICODE_IS_HIGH_SURROGATE(c)) { ++ if (Py_UNICODE_IS_HIGH_SURROGATE(c) && end + 6 < len && ++ PyUnicode_READ(kind, buf, next++) == '\\' && ++ PyUnicode_READ(kind, buf, next++) == 'u') { + Py_UCS4 c2 = 0; +- if (end + 6 >= len) { +- raise_errmsg("Unpaired high surrogate", pystr, end - 5); +- goto bail; +- } +- if (PyUnicode_READ(kind, buf, next++) != '\\' || +- PyUnicode_READ(kind, buf, next++) != 'u') { +- raise_errmsg("Unpaired high surrogate", pystr, end - 5); +- goto bail; +- } + end += 6; + /* Decode 4 hex digits */ + for (; next < end; next++) { +@@ -440,15 +433,10 @@ + goto bail; + } + } +- if (!Py_UNICODE_IS_LOW_SURROGATE(c2)) { +- raise_errmsg("Unpaired high surrogate", pystr, end - 5); +- goto bail; +- } +- c = Py_UNICODE_JOIN_SURROGATES(c, c2); +- } +- else if (Py_UNICODE_IS_LOW_SURROGATE(c)) { +- raise_errmsg("Unpaired low surrogate", pystr, end - 5); +- goto bail; ++ if (Py_UNICODE_IS_LOW_SURROGATE(c2)) ++ c = Py_UNICODE_JOIN_SURROGATES(c, c2); ++ else ++ end -= 6; + } + } + APPEND_OLD_CHUNK +diff -r 3405dc9a6afa Modules/_pickle.c +--- a/Modules/_pickle.c ++++ b/Modules/_pickle.c +@@ -4,6 +4,30 @@ + PyDoc_STRVAR(pickle_module_doc, + "Optimized C implementation for the Python pickle module."); + ++/*[clinic] ++module _pickle ++class _pickle.Pickler ++class _pickle.PicklerMemoProxy ++class _pickle.Unpickler ++class _pickle.UnpicklerMemoProxy ++[clinic]*/ ++/*[clinic checksum: da39a3ee5e6b4b0d3255bfef95601890afd80709]*/ ++ ++/*[python] ++class PicklerObject_converter(self_converter): ++ type = "PicklerObject *" ++ ++class PicklerMemoProxyObject_converter(self_converter): ++ type = "PicklerMemoProxyObject *" ++ ++class UnpicklerObject_converter(self_converter): ++ type = "UnpicklerObject *" ++ ++class UnpicklerMemoProxyObject_converter(self_converter): ++ type = "UnpicklerMemoProxyObject *" ++[python]*/ ++/*[python checksum: da39a3ee5e6b4b0d3255bfef95601890afd80709]*/ ++ + /* Bump this when new opcodes are added to the pickle protocol. */ + enum { + HIGHEST_PROTOCOL = 4, +@@ -86,16 +110,6 @@ + FRAME = '\x95' + }; + +-/* These aren't opcodes -- they're ways to pickle bools before protocol 2 +- * so that unpicklers written before bools were introduced unpickle them +- * as ints, but unpicklers after can recognize that bools were intended. +- * Note that protocol 2 added direct ways to pickle bools. +- */ +-#undef TRUE +-#define TRUE "I01\n" +-#undef FALSE +-#define FALSE "I00\n" +- + enum { + /* Keep in synch with pickle.Pickler._BATCHSIZE. This is how many elements + batch_list/dict() pumps out before doing APPENDS/SETITEMS. Nothing will +@@ -118,40 +132,238 @@ + FRAME_HEADER_SIZE = 9 + }; + +-/* Exception classes for pickle. These should override the ones defined in +- pickle.py, when the C-optimized Pickler and Unpickler are used. */ +-static PyObject *PickleError = NULL; +-static PyObject *PicklingError = NULL; +-static PyObject *UnpicklingError = NULL; +- +-/* copyreg.dispatch_table, {type_object: pickling_function} */ +-static PyObject *dispatch_table = NULL; +-/* For EXT[124] opcodes. */ +-/* copyreg._extension_registry, {(module_name, function_name): code} */ +-static PyObject *extension_registry = NULL; +-/* copyreg._inverted_registry, {code: (module_name, function_name)} */ +-static PyObject *inverted_registry = NULL; +-/* copyreg._extension_cache, {code: object} */ +-static PyObject *extension_cache = NULL; +- +-/* _compat_pickle.NAME_MAPPING, {(oldmodule, oldname): (newmodule, newname)} */ +-static PyObject *name_mapping_2to3 = NULL; +-/* _compat_pickle.IMPORT_MAPPING, {oldmodule: newmodule} */ +-static PyObject *import_mapping_2to3 = NULL; +-/* Same, but with REVERSE_NAME_MAPPING / REVERSE_IMPORT_MAPPING */ +-static PyObject *name_mapping_3to2 = NULL; +-static PyObject *import_mapping_3to2 = NULL; +- +-/* XXX: Are these really nescessary? */ +-/* As the name says, an empty tuple. */ +-static PyObject *empty_tuple = NULL; +-/* For looking up name pairs in copyreg._extension_registry. */ +-static PyObject *two_tuple = NULL; ++/*************************************************************************/ ++ ++/* State of the pickle module, per PEP 3121. */ ++typedef struct { ++ /* Exception classes for pickle. */ ++ PyObject *PickleError; ++ PyObject *PicklingError; ++ PyObject *UnpicklingError; ++ ++ /* copyreg.dispatch_table, {type_object: pickling_function} */ ++ PyObject *dispatch_table; ++ ++ /* For the extension opcodes EXT1, EXT2 and EXT4. */ ++ ++ /* copyreg._extension_registry, {(module_name, function_name): code} */ ++ PyObject *extension_registry; ++ /* copyreg._extension_cache, {code: object} */ ++ PyObject *extension_cache; ++ /* copyreg._inverted_registry, {code: (module_name, function_name)} */ ++ PyObject *inverted_registry; ++ ++ /* Import mappings for compatibility with Python 2.x */ ++ ++ /* _compat_pickle.NAME_MAPPING, ++ {(oldmodule, oldname): (newmodule, newname)} */ ++ PyObject *name_mapping_2to3; ++ /* _compat_pickle.IMPORT_MAPPING, {oldmodule: newmodule} */ ++ PyObject *import_mapping_2to3; ++ /* Same, but with REVERSE_NAME_MAPPING / REVERSE_IMPORT_MAPPING */ ++ PyObject *name_mapping_3to2; ++ PyObject *import_mapping_3to2; ++ ++ /* codecs.encode, used for saving bytes in older protocols */ ++ PyObject *codecs_encode; ++} PickleState; ++ ++/* Forward declaration of the _pickle module definition. */ ++static struct PyModuleDef _picklemodule; ++ ++/* Given a module object, get its per-module state. */ ++static PickleState * ++_Pickle_GetState(PyObject *module) ++{ ++ return (PickleState *)PyModule_GetState(module); ++} ++ ++/* Find the module instance imported in the currently running sub-interpreter ++ and get its state. */ ++static PickleState * ++_Pickle_GetGlobalState(void) ++{ ++ return _Pickle_GetState(PyState_FindModule(&_picklemodule)); ++} ++ ++/* Clear the given pickle module state. */ ++static void ++_Pickle_ClearState(PickleState *st) ++{ ++ Py_CLEAR(st->PickleError); ++ Py_CLEAR(st->PicklingError); ++ Py_CLEAR(st->UnpicklingError); ++ Py_CLEAR(st->dispatch_table); ++ Py_CLEAR(st->extension_registry); ++ Py_CLEAR(st->extension_cache); ++ Py_CLEAR(st->inverted_registry); ++ Py_CLEAR(st->name_mapping_2to3); ++ Py_CLEAR(st->import_mapping_2to3); ++ Py_CLEAR(st->name_mapping_3to2); ++ Py_CLEAR(st->import_mapping_3to2); ++ Py_CLEAR(st->codecs_encode); ++} ++ ++/* Initialize the given pickle module state. */ ++static int ++_Pickle_InitState(PickleState *st) ++{ ++ PyObject *copyreg = NULL; ++ PyObject *compat_pickle = NULL; ++ PyObject *codecs = NULL; ++ ++ copyreg = PyImport_ImportModule("copyreg"); ++ if (!copyreg) ++ goto error; ++ st->dispatch_table = PyObject_GetAttrString(copyreg, "dispatch_table"); ++ if (!st->dispatch_table) ++ goto error; ++ if (!PyDict_CheckExact(st->dispatch_table)) { ++ PyErr_Format(PyExc_RuntimeError, ++ "copyreg.dispatch_table should be a dict, not %.200s", ++ Py_TYPE(st->dispatch_table)->tp_name); ++ goto error; ++ } ++ st->extension_registry = \ ++ PyObject_GetAttrString(copyreg, "_extension_registry"); ++ if (!st->extension_registry) ++ goto error; ++ if (!PyDict_CheckExact(st->extension_registry)) { ++ PyErr_Format(PyExc_RuntimeError, ++ "copyreg._extension_registry should be a dict, " ++ "not %.200s", Py_TYPE(st->extension_registry)->tp_name); ++ goto error; ++ } ++ st->inverted_registry = \ ++ PyObject_GetAttrString(copyreg, "_inverted_registry"); ++ if (!st->inverted_registry) ++ goto error; ++ if (!PyDict_CheckExact(st->inverted_registry)) { ++ PyErr_Format(PyExc_RuntimeError, ++ "copyreg._inverted_registry should be a dict, " ++ "not %.200s", Py_TYPE(st->inverted_registry)->tp_name); ++ goto error; ++ } ++ st->extension_cache = PyObject_GetAttrString(copyreg, "_extension_cache"); ++ if (!st->extension_cache) ++ goto error; ++ if (!PyDict_CheckExact(st->extension_cache)) { ++ PyErr_Format(PyExc_RuntimeError, ++ "copyreg._extension_cache should be a dict, " ++ "not %.200s", Py_TYPE(st->extension_cache)->tp_name); ++ goto error; ++ } ++ Py_CLEAR(copyreg); ++ ++ /* Load the 2.x -> 3.x stdlib module mapping tables */ ++ compat_pickle = PyImport_ImportModule("_compat_pickle"); ++ if (!compat_pickle) ++ goto error; ++ st->name_mapping_2to3 = \ ++ PyObject_GetAttrString(compat_pickle, "NAME_MAPPING"); ++ if (!st->name_mapping_2to3) ++ goto error; ++ if (!PyDict_CheckExact(st->name_mapping_2to3)) { ++ PyErr_Format(PyExc_RuntimeError, ++ "_compat_pickle.NAME_MAPPING should be a dict, not %.200s", ++ Py_TYPE(st->name_mapping_2to3)->tp_name); ++ goto error; ++ } ++ st->import_mapping_2to3 = \ ++ PyObject_GetAttrString(compat_pickle, "IMPORT_MAPPING"); ++ if (!st->import_mapping_2to3) ++ goto error; ++ if (!PyDict_CheckExact(st->import_mapping_2to3)) { ++ PyErr_Format(PyExc_RuntimeError, ++ "_compat_pickle.IMPORT_MAPPING should be a dict, " ++ "not %.200s", Py_TYPE(st->import_mapping_2to3)->tp_name); ++ goto error; ++ } ++ /* ... and the 3.x -> 2.x mapping tables */ ++ st->name_mapping_3to2 = \ ++ PyObject_GetAttrString(compat_pickle, "REVERSE_NAME_MAPPING"); ++ if (!st->name_mapping_3to2) ++ goto error; ++ if (!PyDict_CheckExact(st->name_mapping_3to2)) { ++ PyErr_Format(PyExc_RuntimeError, ++ "_compat_pickle.REVERSE_NAME_MAPPING should be a dict, " ++ "not %.200s", Py_TYPE(st->name_mapping_3to2)->tp_name); ++ goto error; ++ } ++ st->import_mapping_3to2 = \ ++ PyObject_GetAttrString(compat_pickle, "REVERSE_IMPORT_MAPPING"); ++ if (!st->import_mapping_3to2) ++ goto error; ++ if (!PyDict_CheckExact(st->import_mapping_3to2)) { ++ PyErr_Format(PyExc_RuntimeError, ++ "_compat_pickle.REVERSE_IMPORT_MAPPING should be a dict, " ++ "not %.200s", Py_TYPE(st->import_mapping_3to2)->tp_name); ++ goto error; ++ } ++ Py_CLEAR(compat_pickle); ++ ++ codecs = PyImport_ImportModule("codecs"); ++ if (codecs == NULL) ++ goto error; ++ st->codecs_encode = PyObject_GetAttrString(codecs, "encode"); ++ if (st->codecs_encode == NULL) { ++ goto error; ++ } ++ if (!PyCallable_Check(st->codecs_encode)) { ++ PyErr_Format(PyExc_RuntimeError, ++ "codecs.encode should be a callable, not %.200s", ++ Py_TYPE(st->codecs_encode)->tp_name); ++ goto error; ++ } ++ Py_CLEAR(codecs); ++ ++ return 0; ++ ++ error: ++ Py_CLEAR(copyreg); ++ Py_CLEAR(compat_pickle); ++ Py_CLEAR(codecs); ++ _Pickle_ClearState(st); ++ return -1; ++} ++ ++/* Helper for calling a function with a single argument quickly. ++ ++ This function steals the reference of the given argument. */ ++static PyObject * ++_Pickle_FastCall(PyObject *func, PyObject *obj) ++{ ++ PyObject *result; ++ PyObject *arg_tuple = PyTuple_New(1); ++ ++ /* Note: this function used to reuse the argument tuple. This used to give ++ a slight performance boost with older pickle implementations where many ++ unbuffered reads occurred (thus needing many function calls). ++ ++ However, this optimization was removed because it was too complicated ++ to get right. It abused the C API for tuples to mutate them which led ++ to subtle reference counting and concurrency bugs. Furthermore, the ++ introduction of protocol 4 and the prefetching optimization via peek() ++ significantly reduced the number of function calls we do. Thus, the ++ benefits became marginal at best. */ ++ ++ if (arg_tuple == NULL) { ++ Py_DECREF(obj); ++ return NULL; ++ } ++ PyTuple_SET_ITEM(arg_tuple, 0, obj); ++ result = PyObject_Call(func, arg_tuple, NULL); ++ Py_CLEAR(arg_tuple); ++ return result; ++} ++ ++/*************************************************************************/ + + static int + stack_underflow(void) + { +- PyErr_SetString(UnpicklingError, "unpickling stack underflow"); ++ PickleState *st = _Pickle_GetGlobalState(); ++ PyErr_SetString(st->UnpicklingError, "unpickling stack underflow"); + return -1; + } + +@@ -252,8 +464,9 @@ + static PyObject * + Pdata_pop(Pdata *self) + { ++ PickleState *st = _Pickle_GetGlobalState(); + if (Py_SIZE(self) == 0) { +- PyErr_SetString(UnpicklingError, "bad pickle data"); ++ PyErr_SetString(st->UnpicklingError, "bad pickle data"); + return NULL; + } + return self->data[--Py_SIZE(self)]; +@@ -332,7 +545,6 @@ + pickling. */ + PyObject *pers_func; /* persistent_id() method, can be NULL */ + PyObject *dispatch_table; /* private dispatch_table, can be NULL */ +- PyObject *arg; + + PyObject *write; /* write() method of the output stream. */ + PyObject *output_buffer; /* Write into a local bytearray buffer before +@@ -369,7 +581,6 @@ + Py_ssize_t memo_size; /* Capacity of the memo array */ + Py_ssize_t memo_len; /* Number of objects in the memo */ + +- PyObject *arg; + PyObject *pers_func; /* persistent_load() method, can be NULL. */ + + Py_buffer buffer; +@@ -625,60 +836,6 @@ + + /*************************************************************************/ + +-/* Helpers for creating the argument tuple passed to functions. This has the +- performance advantage of calling PyTuple_New() only once. +- +- XXX(avassalotti): Inline directly in _Pickler_FastCall() and +- _Unpickler_FastCall(). */ +-#define ARG_TUP(self, obj) do { \ +- if ((self)->arg || ((self)->arg=PyTuple_New(1))) { \ +- Py_XDECREF(PyTuple_GET_ITEM((self)->arg, 0)); \ +- PyTuple_SET_ITEM((self)->arg, 0, (obj)); \ +- } \ +- else { \ +- Py_DECREF((obj)); \ +- } \ +- } while (0) +- +-#define FREE_ARG_TUP(self) do { \ +- if ((self)->arg->ob_refcnt > 1) \ +- Py_CLEAR((self)->arg); \ +- } while (0) +- +-/* A temporary cleaner API for fast single argument function call. +- +- XXX: Does caching the argument tuple provides any real performance benefits? +- +- A quick benchmark, on a 2.0GHz Athlon64 3200+ running Linux 2.6.24 with +- glibc 2.7, tells me that it takes roughly 20,000,000 PyTuple_New(1) calls +- when the tuple is retrieved from the freelist (i.e, call PyTuple_New() then +- immediately DECREF it) and 1,200,000 calls when allocating brand new tuples +- (i.e, call PyTuple_New() and store the returned value in an array), to save +- one second (wall clock time). Either ways, the loading time a pickle stream +- large enough to generate this number of calls would be massively +- overwhelmed by other factors, like I/O throughput, the GC traversal and +- object allocation overhead. So, I really doubt these functions provide any +- real benefits. +- +- On the other hand, oprofile reports that pickle spends a lot of time in +- these functions. But, that is probably more related to the function call +- overhead, than the argument tuple allocation. +- +- XXX: And, what is the reference behavior of these? Steal, borrow? At first +- glance, it seems to steal the reference of 'arg' and borrow the reference +- of 'func'. */ +-static PyObject * +-_Pickler_FastCall(PicklerObject *self, PyObject *func, PyObject *arg) +-{ +- PyObject *result = NULL; +- +- ARG_TUP(self, arg); +- if (self->arg) { +- result = PyObject_Call(func, self->arg, NULL); +- FREE_ARG_TUP(self); +- } +- return result; +-} + + static int + _Pickler_ClearBuffer(PicklerObject *self) +@@ -696,18 +853,16 @@ + static void + _write_size64(char *out, size_t value) + { +- out[0] = (unsigned char)(value & 0xff); +- out[1] = (unsigned char)((value >> 8) & 0xff); +- out[2] = (unsigned char)((value >> 16) & 0xff); +- out[3] = (unsigned char)((value >> 24) & 0xff); +-#if SIZEOF_SIZE_T >= 8 +- out[4] = (unsigned char)((value >> 32) & 0xff); +- out[5] = (unsigned char)((value >> 40) & 0xff); +- out[6] = (unsigned char)((value >> 48) & 0xff); +- out[7] = (unsigned char)((value >> 56) & 0xff); +-#else +- out[4] = out[5] = out[6] = out[7] = 0; +-#endif ++ int i; ++ ++ assert(sizeof(size_t) <= 8); ++ ++ for (i = 0; i < sizeof(size_t); i++) { ++ out[i] = (unsigned char)((value >> (8 * i)) & 0xff); ++ } ++ for (i = sizeof(size_t); i < 8; i++) { ++ out[i] = 0; ++ } + } + + static void +@@ -775,7 +930,7 @@ + if (output == NULL) + return -1; + +- result = _Pickler_FastCall(self, self->write, output); ++ result = _Pickle_FastCall(self->write, output); + Py_XDECREF(result); + return (result == NULL) ? -1 : 0; + } +@@ -841,7 +996,6 @@ + + self->pers_func = NULL; + self->dispatch_table = NULL; +- self->arg = NULL; + self->write = NULL; + self->proto = 0; + self->bin = 0; +@@ -866,34 +1020,29 @@ + } + + static int +-_Pickler_SetProtocol(PicklerObject *self, PyObject *proto_obj, +- PyObject *fix_imports_obj) +-{ +- long proto = 0; +- int fix_imports; +- +- if (proto_obj == NULL || proto_obj == Py_None) ++_Pickler_SetProtocol(PicklerObject *self, PyObject *protocol, int fix_imports) ++{ ++ long proto; ++ ++ if (protocol == NULL || protocol == Py_None) { + proto = DEFAULT_PROTOCOL; ++ } + else { +- proto = PyLong_AsLong(proto_obj); +- if (proto == -1 && PyErr_Occurred()) ++ proto = PyLong_AsLong(protocol); ++ if (proto < 0) { ++ if (proto == -1 && PyErr_Occurred()) ++ return -1; ++ proto = HIGHEST_PROTOCOL; ++ } ++ else if (proto > HIGHEST_PROTOCOL) { ++ PyErr_Format(PyExc_ValueError, "pickle protocol must be <= %d", ++ HIGHEST_PROTOCOL); + return -1; +- } +- if (proto < 0) +- proto = HIGHEST_PROTOCOL; +- if (proto > HIGHEST_PROTOCOL) { +- PyErr_Format(PyExc_ValueError, "pickle protocol must be <= %d", +- HIGHEST_PROTOCOL); +- return -1; +- } +- fix_imports = PyObject_IsTrue(fix_imports_obj); +- if (fix_imports == -1) +- return -1; +- +- self->proto = proto; ++ } ++ } ++ self->proto = (int)proto; + self->bin = proto > 0; + self->fix_imports = fix_imports && proto < 3; +- + return 0; + } + +@@ -915,20 +1064,6 @@ + return 0; + } + +-/* See documentation for _Pickler_FastCall(). */ +-static PyObject * +-_Unpickler_FastCall(UnpicklerObject *self, PyObject *func, PyObject *arg) +-{ +- PyObject *result = NULL; +- +- ARG_TUP(self, arg); +- if (self->arg) { +- result = PyObject_Call(func, self->arg, NULL); +- FREE_ARG_TUP(self); +- } +- return result; +-} +- + /* Returns the size of the input on success, -1 on failure. This takes its + own reference to `input`. */ + static Py_ssize_t +@@ -986,56 +1121,51 @@ + _Unpickler_ReadFromFile(UnpicklerObject *self, Py_ssize_t n) + { + PyObject *data; +- Py_ssize_t read_size, prefetched_size = 0; ++ Py_ssize_t read_size; + + assert(self->read != NULL); + + if (_Unpickler_SkipConsumed(self) < 0) + return -1; + +- if (n == READ_WHOLE_LINE) ++ if (n == READ_WHOLE_LINE) { ++ PyObject *empty_tuple = PyTuple_New(0); + data = PyObject_Call(self->readline, empty_tuple, NULL); ++ Py_DECREF(empty_tuple); ++ } + else { +- PyObject *len = PyLong_FromSsize_t(n); +- if (len == NULL) +- return -1; +- data = _Unpickler_FastCall(self, self->read, len); +- } +- if (data == NULL) +- return -1; +- +- /* Prefetch some data without advancing the file pointer, if possible */ +- if (self->peek) { +- PyObject *len, *prefetched; +- len = PyLong_FromSsize_t(PREFETCH); +- if (len == NULL) { +- Py_DECREF(data); +- return -1; +- } +- prefetched = _Unpickler_FastCall(self, self->peek, len); +- if (prefetched == NULL) { +- if (PyErr_ExceptionMatches(PyExc_NotImplementedError)) { ++ PyObject *len; ++ /* Prefetch some data without advancing the file pointer, if possible */ ++ if (self->peek && n < PREFETCH) { ++ len = PyLong_FromSsize_t(PREFETCH); ++ if (len == NULL) ++ return -1; ++ data = _Pickle_FastCall(self->peek, len); ++ if (data == NULL) { ++ if (!PyErr_ExceptionMatches(PyExc_NotImplementedError)) ++ return -1; + /* peek() is probably not supported by the given file object */ + PyErr_Clear(); + Py_CLEAR(self->peek); + } + else { ++ read_size = _Unpickler_SetStringInput(self, data); + Py_DECREF(data); +- return -1; ++ self->prefetched_idx = 0; ++ if (n <= read_size) ++ return n; + } + } +- else { +- assert(PyBytes_Check(prefetched)); +- prefetched_size = PyBytes_GET_SIZE(prefetched); +- PyBytes_ConcatAndDel(&data, prefetched); +- if (data == NULL) +- return -1; +- } +- } +- +- read_size = _Unpickler_SetStringInput(self, data) - prefetched_size; ++ len = PyLong_FromSsize_t(n); ++ if (len == NULL) ++ return -1; ++ data = _Pickle_FastCall(self->read, len); ++ } ++ if (data == NULL) ++ return -1; ++ ++ read_size = _Unpickler_SetStringInput(self, data); + Py_DECREF(data); +- self->prefetched_idx = read_size; + return read_size; + } + +@@ -1222,7 +1352,6 @@ + if (self == NULL) + return NULL; + +- self->arg = NULL; + self->pers_func = NULL; + self->input_buffer = NULL; + self->input_line = NULL; +@@ -1339,7 +1468,8 @@ + len = 5; + } + else { /* unlikely */ +- PyErr_SetString(PicklingError, ++ PickleState *st = _Pickle_GetGlobalState(); ++ PyErr_SetString(st->PicklingError, + "memo id too large for LONG_BINGET"); + return -1; + } +@@ -1395,7 +1525,8 @@ + len = 5; + } + else { /* unlikely */ +- PyErr_SetString(PicklingError, ++ PickleState *st = _Pickle_GetGlobalState(); ++ PyErr_SetString(st->PicklingError, + "memo id too large for LONG_BINPUT"); + return -1; + } +@@ -1552,7 +1683,7 @@ + key = PyLong_FromVoidPtr(obj); + if (key == NULL) + return 0; +- if (PyDict_GetItem(self->fast_memo, key)) { ++ if (PyDict_GetItemWithError(self->fast_memo, key)) { + Py_DECREF(key); + PyErr_Format(PyExc_ValueError, + "fast mode: can't pickle cyclic objects " +@@ -1561,6 +1692,9 @@ + self->fast_nesting = -1; + return 0; + } ++ if (PyErr_Occurred()) { ++ return 0; ++ } + if (PyDict_SetItem(self->fast_memo, key, Py_None) < 0) { + Py_DECREF(key); + self->fast_nesting = -1; +@@ -1600,46 +1734,58 @@ + static int + save_bool(PicklerObject *self, PyObject *obj) + { +- static const char *buf[2] = { FALSE, TRUE }; +- const char len[2] = {sizeof(FALSE) - 1, sizeof(TRUE) - 1}; +- int p = (obj == Py_True); +- + if (self->proto >= 2) { +- const char bool_op = p ? NEWTRUE : NEWFALSE; ++ const char bool_op = (obj == Py_True) ? NEWTRUE : NEWFALSE; + if (_Pickler_Write(self, &bool_op, 1) < 0) + return -1; + } +- else if (_Pickler_Write(self, buf[p], len[p]) < 0) +- return -1; +- ++ else { ++ /* These aren't opcodes -- they're ways to pickle bools before protocol 2 ++ * so that unpicklers written before bools were introduced unpickle them ++ * as ints, but unpicklers after can recognize that bools were intended. ++ * Note that protocol 2 added direct ways to pickle bools. ++ */ ++ const char *bool_str = (obj == Py_True) ? "I01\n" : "I00\n"; ++ if (_Pickler_Write(self, bool_str, strlen(bool_str)) < 0) ++ return -1; ++ } + return 0; + } + + static int +-save_int(PicklerObject *self, long x) +-{ +- char pdata[32]; +- Py_ssize_t len = 0; +- +- if (!self->bin +-#if SIZEOF_LONG > 4 +- || x > 0x7fffffffL || x < -0x80000000L +-#endif +- ) { +- /* Text-mode pickle, or long too big to fit in the 4-byte +- * signed BININT format: store as a string. +- */ +- pdata[0] = LONG; /* use LONG for consistency with pickle.py */ +- PyOS_snprintf(pdata + 1, sizeof(pdata) - 1, "%ldL\n", x); +- if (_Pickler_Write(self, pdata, strlen(pdata)) < 0) +- return -1; +- } +- else { +- /* Binary pickle and x fits in a signed 4-byte int. */ +- pdata[1] = (unsigned char)(x & 0xff); +- pdata[2] = (unsigned char)((x >> 8) & 0xff); +- pdata[3] = (unsigned char)((x >> 16) & 0xff); +- pdata[4] = (unsigned char)((x >> 24) & 0xff); ++save_long(PicklerObject *self, PyObject *obj) ++{ ++ PyObject *repr = NULL; ++ Py_ssize_t size; ++ long val; ++ int status = 0; ++ ++ const char long_op = LONG; ++ ++ val= PyLong_AsLong(obj); ++ if (val == -1 && PyErr_Occurred()) { ++ /* out of range for int pickling */ ++ PyErr_Clear(); ++ } ++ else if (self->bin && ++ (sizeof(long) <= 4 || ++ (val <= 0x7fffffffL && val >= (-0x7fffffffL - 1)))) { ++ /* result fits in a signed 4-byte integer. ++ ++ Note: we can't use -0x80000000L in the above condition because some ++ compilers (e.g., MSVC) will promote 0x80000000L to an unsigned type ++ before applying the unary minus when sizeof(long) <= 4. The ++ resulting value stays unsigned which is commonly not what we want, ++ so MSVC happily warns us about it. However, that result would have ++ been fine because we guard for sizeof(long) <= 4 which turns the ++ condition true in that particular case. */ ++ char pdata[32]; ++ Py_ssize_t len = 0; ++ ++ pdata[1] = (unsigned char)(val & 0xff); ++ pdata[2] = (unsigned char)((val >> 8) & 0xff); ++ pdata[3] = (unsigned char)((val >> 16) & 0xff); ++ pdata[4] = (unsigned char)((val >> 24) & 0xff); + + if ((pdata[4] == 0) && (pdata[3] == 0)) { + if (pdata[2] == 0) { +@@ -1658,30 +1804,9 @@ + + if (_Pickler_Write(self, pdata, len) < 0) + return -1; +- } +- +- return 0; +-} +- +-static int +-save_long(PicklerObject *self, PyObject *obj) +-{ +- PyObject *repr = NULL; +- Py_ssize_t size; +- long val = PyLong_AsLong(obj); +- int status = 0; +- +- const char long_op = LONG; +- +- if (val == -1 && PyErr_Occurred()) { +- /* out of range for int pickling */ +- PyErr_Clear(); +- } +- else +-#if SIZEOF_LONG > 4 +- if (val <= 0x7fffffffL && val >= -0x80000000L) +-#endif +- return save_int(self, val); ++ ++ return 0; ++ } + + if (self->proto >= 2) { + /* Linear-time pickling. */ +@@ -1847,26 +1972,14 @@ + Python 2 *and* the appropriate 'bytes' object when unpickled + using Python 3. Again this is a hack and we don't need to do this + with newer protocols. */ +- static PyObject *codecs_encode = NULL; + PyObject *reduce_value = NULL; + int status; + +- if (codecs_encode == NULL) { +- PyObject *codecs_module = PyImport_ImportModule("codecs"); +- if (codecs_module == NULL) { +- return -1; +- } +- codecs_encode = PyObject_GetAttrString(codecs_module, "encode"); +- Py_DECREF(codecs_module); +- if (codecs_encode == NULL) { +- return -1; +- } +- } +- + if (PyBytes_GET_SIZE(obj) == 0) { + reduce_value = Py_BuildValue("(O())", (PyObject*)&PyBytes_Type); + } + else { ++ PickleState *st = _Pickle_GetGlobalState(); + PyObject *unicode_str = + PyUnicode_DecodeLatin1(PyBytes_AS_STRING(obj), + PyBytes_GET_SIZE(obj), +@@ -1876,7 +1989,7 @@ + if (unicode_str == NULL) + return -1; + reduce_value = Py_BuildValue("(O(OO))", +- codecs_encode, unicode_str, ++ st->codecs_encode, unicode_str, + _PyUnicode_FromId(&PyId_latin1)); + Py_DECREF(unicode_str); + } +@@ -1912,12 +2025,9 @@ + len = 5; + } + else if (self->proto >= 4) { +- int i; + header[0] = BINBYTES8; +- for (i = 0; i < 8; i++) { +- _write_size64(header + 1, size); +- } +- len = 8; ++ _write_size64(header + 1, size); ++ len = 9; + } + else { + PyErr_SetString(PyExc_OverflowError, +@@ -2025,12 +2135,8 @@ + len = 5; + } + else if (self->proto >= 4) { +- int i; +- + header[0] = BINUNICODE8; +- for (i = 0; i < 8; i++) { +- _write_size64(header + 1, size); +- } ++ _write_size64(header + 1, size); + len = 9; + } + else { +@@ -2887,11 +2993,12 @@ + { + PyObject *key; + PyObject *item; ++ PickleState *st = _Pickle_GetGlobalState(); + + key = PyTuple_Pack(2, *module_name, *global_name); + if (key == NULL) + return -1; +- item = PyDict_GetItemWithError(name_mapping_3to2, key); ++ item = PyDict_GetItemWithError(st->name_mapping_3to2, key); + Py_DECREF(key); + if (item) { + PyObject *fixed_module_name; +@@ -2927,7 +3034,7 @@ + return -1; + } + +- item = PyDict_GetItemWithError(import_mapping_3to2, *module_name); ++ item = PyDict_GetItemWithError(st->import_mapping_3to2, *module_name); + if (item) { + if (!PyUnicode_Check(item)) { + PyErr_Format(PyExc_RuntimeError, +@@ -2954,6 +3061,7 @@ + PyObject *module_name = NULL; + PyObject *module = NULL; + PyObject *cls; ++ PickleState *st = _Pickle_GetGlobalState(); + int status = 0; + _Py_IDENTIFIER(__name__); + _Py_IDENTIFIER(__qualname__); +@@ -2994,21 +3102,21 @@ + extra parameters of __import__ to fix that. */ + module = PyImport_Import(module_name); + if (module == NULL) { +- PyErr_Format(PicklingError, ++ PyErr_Format(st->PicklingError, + "Can't pickle %R: import of module %R failed", + obj, module_name); + goto error; + } + cls = getattribute(module, global_name, self->proto >= 4); + if (cls == NULL) { +- PyErr_Format(PicklingError, ++ PyErr_Format(st->PicklingError, + "Can't pickle %R: attribute lookup %S on %S failed", + obj, global_name, module_name); + goto error; + } + if (cls != obj) { + Py_DECREF(cls); +- PyErr_Format(PicklingError, ++ PyErr_Format(st->PicklingError, + "Can't pickle %R: it's not the same object as %S.%S", + obj, module_name, global_name); + goto error; +@@ -3019,18 +3127,27 @@ + /* See whether this is in the extension registry, and if + * so generate an EXT opcode. + */ ++ PyObject *extension_key; + PyObject *code_obj; /* extension code as Python object */ + long code; /* extension code as C value */ + char pdata[5]; + Py_ssize_t n; + +- PyTuple_SET_ITEM(two_tuple, 0, module_name); +- PyTuple_SET_ITEM(two_tuple, 1, global_name); +- code_obj = PyDict_GetItem(extension_registry, two_tuple); ++ extension_key = PyTuple_Pack(2, module_name, global_name); ++ if (extension_key == NULL) { ++ goto error; ++ } ++ code_obj = PyDict_GetItemWithError(st->extension_registry, ++ extension_key); ++ Py_DECREF(extension_key); + /* The object is not registered in the extension registry. + This is the most likely code path. */ +- if (code_obj == NULL) ++ if (code_obj == NULL) { ++ if (PyErr_Occurred()) { ++ goto error; ++ } + goto gen_global; ++ } + + /* XXX: pickle.py doesn't check neither the type, nor the range + of the value returned by the extension_registry. It should for +@@ -3038,7 +3155,7 @@ + + /* Verify code_obj has the right type and value. */ + if (!PyLong_Check(code_obj)) { +- PyErr_Format(PicklingError, ++ PyErr_Format(st->PicklingError, + "Can't pickle %R: extension code %R isn't an integer", + obj, code_obj); + goto error; +@@ -3046,9 +3163,8 @@ + code = PyLong_AS_LONG(code_obj); + if (code <= 0 || code > 0x7fffffffL) { + if (!PyErr_Occurred()) +- PyErr_Format(PicklingError, +- "Can't pickle %R: extension code %ld is out of range", +- obj, code); ++ PyErr_Format(st->PicklingError, "Can't pickle %R: extension " ++ "code %ld is out of range", obj, code); + goto error; + } + +@@ -3121,7 +3237,7 @@ + encoded = unicode_encoder(module_name); + if (encoded == NULL) { + if (PyErr_ExceptionMatches(PyExc_UnicodeEncodeError)) +- PyErr_Format(PicklingError, ++ PyErr_Format(st->PicklingError, + "can't pickle module identifier '%S' using " + "pickle protocol %i", + module_name, self->proto); +@@ -3140,7 +3256,7 @@ + encoded = unicode_encoder(global_name); + if (encoded == NULL) { + if (PyErr_ExceptionMatches(PyExc_UnicodeEncodeError)) +- PyErr_Format(PicklingError, ++ PyErr_Format(st->PicklingError, + "can't pickle global identifier '%S' using " + "pickle protocol %i", + global_name, self->proto); +@@ -3172,6 +3288,36 @@ + } + + static int ++save_singleton_type(PicklerObject *self, PyObject *obj, PyObject *singleton) ++{ ++ PyObject *reduce_value; ++ int status; ++ ++ reduce_value = Py_BuildValue("O(O)", &PyType_Type, singleton); ++ if (reduce_value == NULL) { ++ return -1; ++ } ++ status = save_reduce(self, reduce_value, obj); ++ Py_DECREF(reduce_value); ++ return status; ++} ++ ++static int ++save_type(PicklerObject *self, PyObject *obj) ++{ ++ if (obj == (PyObject *)&_PyNone_Type) { ++ return save_singleton_type(self, obj, Py_None); ++ } ++ else if (obj == (PyObject *)&PyEllipsis_Type) { ++ return save_singleton_type(self, obj, Py_Ellipsis); ++ } ++ else if (obj == (PyObject *)&_PyNotImplemented_Type) { ++ return save_singleton_type(self, obj, Py_NotImplemented); ++ } ++ return save_global(self, obj, NULL); ++} ++ ++static int + save_pers(PicklerObject *self, PyObject *obj, PyObject *func) + { + PyObject *pid = NULL; +@@ -3181,7 +3327,7 @@ + const char binpersid_op = BINPERSID; + + Py_INCREF(obj); +- pid = _Pickler_FastCall(self, func, obj); ++ pid = _Pickle_FastCall(func, obj); + if (pid == NULL) + return -1; + +@@ -3253,6 +3399,7 @@ + PyObject *state = NULL; + PyObject *listitems = Py_None; + PyObject *dictitems = Py_None; ++ PickleState *st = _Pickle_GetGlobalState(); + Py_ssize_t size; + int use_newobj = 0, use_newobj_ex = 0; + +@@ -3263,7 +3410,7 @@ + + size = PyTuple_Size(args); + if (size < 2 || size > 5) { +- PyErr_SetString(PicklingError, "tuple returned by " ++ PyErr_SetString(st->PicklingError, "tuple returned by " + "__reduce__ must contain 2 through 5 elements"); + return -1; + } +@@ -3273,12 +3420,12 @@ + return -1; + + if (!PyCallable_Check(callable)) { +- PyErr_SetString(PicklingError, "first item of the tuple " ++ PyErr_SetString(st->PicklingError, "first item of the tuple " + "returned by __reduce__ must be callable"); + return -1; + } + if (!PyTuple_Check(argtup)) { +- PyErr_SetString(PicklingError, "second item of the tuple " ++ PyErr_SetString(st->PicklingError, "second item of the tuple " + "returned by __reduce__ must be a tuple"); + return -1; + } +@@ -3289,7 +3436,7 @@ + if (listitems == Py_None) + listitems = NULL; + else if (!PyIter_Check(listitems)) { +- PyErr_Format(PicklingError, "fourth element of the tuple " ++ PyErr_Format(st->PicklingError, "fourth element of the tuple " + "returned by __reduce__ must be an iterator, not %s", + Py_TYPE(listitems)->tp_name); + return -1; +@@ -3298,7 +3445,7 @@ + if (dictitems == Py_None) + dictitems = NULL; + else if (!PyIter_Check(dictitems)) { +- PyErr_Format(PicklingError, "fifth element of the tuple " ++ PyErr_Format(st->PicklingError, "fifth element of the tuple " + "returned by __reduce__ must be an iterator, not %s", + Py_TYPE(dictitems)->tp_name); + return -1; +@@ -3337,7 +3484,7 @@ + PyObject *kwargs; + + if (Py_SIZE(argtup) != 3) { +- PyErr_Format(PicklingError, ++ PyErr_Format(st->PicklingError, + "length of the NEWOBJ_EX argument tuple must be " + "exactly 3, not %zd", Py_SIZE(argtup)); + return -1; +@@ -3345,21 +3492,21 @@ + + cls = PyTuple_GET_ITEM(argtup, 0); + if (!PyType_Check(cls)) { +- PyErr_Format(PicklingError, ++ PyErr_Format(st->PicklingError, + "first item from NEWOBJ_EX argument tuple must " + "be a class, not %.200s", Py_TYPE(cls)->tp_name); + return -1; + } + args = PyTuple_GET_ITEM(argtup, 1); + if (!PyTuple_Check(args)) { +- PyErr_Format(PicklingError, ++ PyErr_Format(st->PicklingError, + "second item from NEWOBJ_EX argument tuple must " + "be a tuple, not %.200s", Py_TYPE(args)->tp_name); + return -1; + } + kwargs = PyTuple_GET_ITEM(argtup, 2); + if (!PyDict_Check(kwargs)) { +- PyErr_Format(PicklingError, ++ PyErr_Format(st->PicklingError, + "third item from NEWOBJ_EX argument tuple must " + "be a dict, not %.200s", Py_TYPE(kwargs)->tp_name); + return -1; +@@ -3380,13 +3527,13 @@ + + /* Sanity checks. */ + if (Py_SIZE(argtup) < 1) { +- PyErr_SetString(PicklingError, "__newobj__ arglist is empty"); ++ PyErr_SetString(st->PicklingError, "__newobj__ arglist is empty"); + return -1; + } + + cls = PyTuple_GET_ITEM(argtup, 0); + if (!PyType_Check(cls)) { +- PyErr_SetString(PicklingError, "args[0] from " ++ PyErr_SetString(st->PicklingError, "args[0] from " + "__newobj__ args is not a type"); + return -1; + } +@@ -3396,7 +3543,7 @@ + p = obj_class != cls; /* true iff a problem */ + Py_DECREF(obj_class); + if (p) { +- PyErr_SetString(PicklingError, "args[0] from " ++ PyErr_SetString(st->PicklingError, "args[0] from " + "__newobj__ args has the wrong class"); + return -1; + } +@@ -3579,7 +3726,7 @@ + goto done; + } + else if (type == &PyType_Type) { +- status = save_global(self, obj, NULL); ++ status = save_type(self, obj); + goto done; + } + else if (type == &PyFunction_Type) { +@@ -3594,12 +3741,22 @@ + * __reduce_ex__ method, or the object's __reduce__ method. + */ + if (self->dispatch_table == NULL) { +- reduce_func = PyDict_GetItem(dispatch_table, (PyObject *)type); +- /* PyDict_GetItem() unlike PyObject_GetItem() and +- PyObject_GetAttr() returns a borrowed ref */ +- Py_XINCREF(reduce_func); ++ PickleState *st = _Pickle_GetGlobalState(); ++ reduce_func = PyDict_GetItemWithError(st->dispatch_table, ++ (PyObject *)type); ++ if (reduce_func == NULL) { ++ if (PyErr_Occurred()) { ++ goto error; ++ } ++ } else { ++ /* PyDict_GetItemWithError() returns a borrowed reference. ++ Increase the reference count to be consistent with ++ PyObject_GetItem and _PyObject_GetAttrId used below. */ ++ Py_INCREF(reduce_func); ++ } + } else { +- reduce_func = PyObject_GetItem(self->dispatch_table, (PyObject *)type); ++ reduce_func = PyObject_GetItem(self->dispatch_table, ++ (PyObject *)type); + if (reduce_func == NULL) { + if (PyErr_ExceptionMatches(PyExc_KeyError)) + PyErr_Clear(); +@@ -3609,7 +3766,7 @@ + } + if (reduce_func != NULL) { + Py_INCREF(obj); +- reduce_value = _Pickler_FastCall(self, reduce_func, obj); ++ reduce_value = _Pickle_FastCall(reduce_func, obj); + } + else if (PyType_IsSubtype(type, &PyType_Type)) { + status = save_global(self, obj, NULL); +@@ -3634,21 +3791,29 @@ + PyObject *proto; + proto = PyLong_FromLong(self->proto); + if (proto != NULL) { +- reduce_value = _Pickler_FastCall(self, reduce_func, proto); ++ reduce_value = _Pickle_FastCall(reduce_func, proto); + } + } + else { +- if (PyErr_ExceptionMatches(PyExc_AttributeError)) ++ PickleState *st = _Pickle_GetGlobalState(); ++ ++ if (PyErr_ExceptionMatches(PyExc_AttributeError)) { + PyErr_Clear(); +- else ++ } ++ else { + goto error; ++ } + /* Check for a __reduce__ method. */ + reduce_func = _PyObject_GetAttrId(obj, &PyId___reduce__); + if (reduce_func != NULL) { +- reduce_value = PyObject_Call(reduce_func, empty_tuple, NULL); ++ PyObject *empty_tuple = PyTuple_New(0); ++ reduce_value = PyObject_Call(reduce_func, empty_tuple, ++ NULL); ++ Py_DECREF(empty_tuple); + } + else { +- PyErr_Format(PicklingError, "can't pickle '%.200s' object: %R", ++ PyErr_Format(st->PicklingError, ++ "can't pickle '%.200s' object: %R", + type->tp_name, obj); + goto error; + } +@@ -3664,7 +3829,8 @@ + } + + if (!PyTuple_Check(reduce_value)) { +- PyErr_SetString(PicklingError, ++ PickleState *st = _Pickle_GetGlobalState(); ++ PyErr_SetString(st->PicklingError, + "__reduce__ must return a string or tuple"); + goto error; + } +@@ -3708,16 +3874,35 @@ + return 0; + } + +-PyDoc_STRVAR(Pickler_clear_memo_doc, +-"clear_memo() -> None. Clears the pickler's \"memo\"." ++/*[clinic] ++ ++_pickle.Pickler.clear_memo ++ ++ self: PicklerObject ++ ++Clears the pickler's "memo". ++ ++The memo is the data structure that remembers which objects the ++pickler has already seen, so that shared or recursive objects are ++pickled by reference and not by value. This method is useful when ++re-using picklers. ++[clinic]*/ ++ ++PyDoc_STRVAR(_pickle_Pickler_clear_memo__doc__, ++"clear_memo()\n" ++"Clears the pickler\'s \"memo\".\n" + "\n" + "The memo is the data structure that remembers which objects the\n" + "pickler has already seen, so that shared or recursive objects are\n" + "pickled by reference and not by value. This method is useful when\n" + "re-using picklers."); + ++#define _PICKLE_PICKLER_CLEAR_MEMO_METHODDEF \ ++ {"clear_memo", (PyCFunction)_pickle_Pickler_clear_memo, METH_NOARGS, _pickle_Pickler_clear_memo__doc__}, ++ + static PyObject * +-Pickler_clear_memo(PicklerObject *self) ++_pickle_Pickler_clear_memo(PicklerObject *self) ++/*[clinic checksum: 9c32be7e7a17ff82a81aae409d0d4f469033a5b2]*/ + { + if (self->memo) + PyMemoTable_Clear(self->memo); +@@ -3725,27 +3910,39 @@ + Py_RETURN_NONE; + } + +-PyDoc_STRVAR(Pickler_dump_doc, +-"dump(obj) -> None. Write a pickled representation of obj to the open file."); ++/*[clinic] ++ ++_pickle.Pickler.dump ++ ++ self: PicklerObject ++ obj: object ++ / ++ ++Write a pickled representation of the given object to the open file. ++[clinic]*/ ++ ++PyDoc_STRVAR(_pickle_Pickler_dump__doc__, ++"dump(obj)\n" ++"Write a pickled representation of the given object to the open file."); ++ ++#define _PICKLE_PICKLER_DUMP_METHODDEF \ ++ {"dump", (PyCFunction)_pickle_Pickler_dump, METH_O, _pickle_Pickler_dump__doc__}, + + static PyObject * +-Pickler_dump(PicklerObject *self, PyObject *args) +-{ +- PyObject *obj; +- ++_pickle_Pickler_dump(PicklerObject *self, PyObject *obj) ++/*[clinic checksum: b72a69ec98737fabf66dae7c5a3210178bdbd3e6]*/ ++{ + /* Check whether the Pickler was initialized correctly (issue3664). + Developers often forget to call __init__() in their subclasses, which + would trigger a segfault without this check. */ + if (self->write == NULL) { +- PyErr_Format(PicklingError, ++ PickleState *st = _Pickle_GetGlobalState(); ++ PyErr_Format(st->PicklingError, + "Pickler.__init__() was not called by %s.__init__()", + Py_TYPE(self)->tp_name); + return NULL; + } + +- if (!PyArg_ParseTuple(args, "O:dump", &obj)) +- return NULL; +- + if (_Pickler_ClearBuffer(self) < 0) + return NULL; + +@@ -3759,10 +3956,8 @@ + } + + static struct PyMethodDef Pickler_methods[] = { +- {"dump", (PyCFunction)Pickler_dump, METH_VARARGS, +- Pickler_dump_doc}, +- {"clear_memo", (PyCFunction)Pickler_clear_memo, METH_NOARGS, +- Pickler_clear_memo_doc}, ++ _PICKLE_PICKLER_DUMP_METHODDEF ++ _PICKLE_PICKLER_CLEAR_MEMO_METHODDEF + {NULL, NULL} /* sentinel */ + }; + +@@ -3775,7 +3970,6 @@ + Py_XDECREF(self->write); + Py_XDECREF(self->pers_func); + Py_XDECREF(self->dispatch_table); +- Py_XDECREF(self->arg); + Py_XDECREF(self->fast_memo); + + PyMemoTable_Del(self->memo); +@@ -3789,7 +3983,6 @@ + Py_VISIT(self->write); + Py_VISIT(self->pers_func); + Py_VISIT(self->dispatch_table); +- Py_VISIT(self->arg); + Py_VISIT(self->fast_memo); + return 0; + } +@@ -3801,7 +3994,6 @@ + Py_CLEAR(self->write); + Py_CLEAR(self->pers_func); + Py_CLEAR(self->dispatch_table); +- Py_CLEAR(self->arg); + Py_CLEAR(self->fast_memo); + + if (self->memo != NULL) { +@@ -3813,59 +4005,103 @@ + } + + +-PyDoc_STRVAR(Pickler_doc, +-"Pickler(file, protocol=None)" +-"\n" ++/*[clinic] ++ ++_pickle.Pickler.__init__ ++ ++ self: PicklerObject ++ file: object ++ protocol: object = NULL ++ fix_imports: bool = True ++ ++This takes a binary file for writing a pickle data stream. ++ ++The optional *protocol* argument tells the pickler to use the given ++protocol; supported protocols are 0, 1, 2, 3 and 4. The default ++protocol is 3; a backward-incompatible protocol designed for Python 3. ++ ++Specifying a negative protocol version selects the highest protocol ++version supported. The higher the protocol used, the more recent the ++version of Python needed to read the pickle produced. ++ ++The *file* argument must have a write() method that accepts a single ++bytes argument. It can thus be a file object opened for binary ++writing, a io.BytesIO instance, or any other custom object that meets ++this interface. ++ ++If *fix_imports* is True and protocol is less than 3, pickle will try ++to map the new Python 3 names to the old module names used in Python ++2, so that the pickle data stream is readable with Python 2. ++[clinic]*/ ++ ++PyDoc_STRVAR(_pickle_Pickler___init____doc__, ++"__init__(file, protocol=None, fix_imports=True)\n" + "This takes a binary file for writing a pickle data stream.\n" + "\n" +-"The optional protocol argument tells the pickler to use the\n" +-"given protocol; supported protocols are 0, 1, 2, 3 and 4. The\n" +-"default protocol is 3; a backward-incompatible protocol designed for\n" +-"Python 3.\n" ++"The optional *protocol* argument tells the pickler to use the given\n" ++"protocol; supported protocols are 0, 1, 2, 3 and 4. The default\n" ++"protocol is 3; a backward-incompatible protocol designed for Python 3.\n" + "\n" +-"Specifying a negative protocol version selects the highest\n" +-"protocol version supported. The higher the protocol used, the\n" +-"more recent the version of Python needed to read the pickle\n" +-"produced.\n" ++"Specifying a negative protocol version selects the highest protocol\n" ++"version supported. The higher the protocol used, the more recent the\n" ++"version of Python needed to read the pickle produced.\n" + "\n" +-"The file argument must have a write() method that accepts a single\n" ++"The *file* argument must have a write() method that accepts a single\n" + "bytes argument. It can thus be a file object opened for binary\n" +-"writing, a io.BytesIO instance, or any other custom object that\n" +-"meets this interface.\n" ++"writing, a io.BytesIO instance, or any other custom object that meets\n" ++"this interface.\n" + "\n" +-"If fix_imports is True and protocol is less than 3, pickle will try to\n" +-"map the new Python 3 names to the old module names used in Python 2,\n" +-"so that the pickle data stream is readable with Python 2.\n"); +- +-static int +-Pickler_init(PicklerObject *self, PyObject *args, PyObject *kwds) +-{ +- static char *kwlist[] = {"file", "protocol", "fix_imports", 0}; ++"If *fix_imports* is True and protocol is less than 3, pickle will try\n" ++"to map the new Python 3 names to the old module names used in Python\n" ++"2, so that the pickle data stream is readable with Python 2."); ++ ++#define _PICKLE_PICKLER___INIT___METHODDEF \ ++ {"__init__", (PyCFunction)_pickle_Pickler___init__, METH_VARARGS|METH_KEYWORDS, _pickle_Pickler___init____doc__}, ++ ++static PyObject * ++_pickle_Pickler___init___impl(PicklerObject *self, PyObject *file, PyObject *protocol, int fix_imports); ++ ++static PyObject * ++_pickle_Pickler___init__(PyObject *self, PyObject *args, PyObject *kwargs) ++{ ++ PyObject *return_value = NULL; ++ static char *_keywords[] = {"file", "protocol", "fix_imports", NULL}; + PyObject *file; +- PyObject *proto_obj = NULL; +- PyObject *fix_imports = Py_True; ++ PyObject *protocol = NULL; ++ int fix_imports = 1; ++ ++ if (!PyArg_ParseTupleAndKeywords(args, kwargs, ++ "O|Op:__init__", _keywords, ++ &file, &protocol, &fix_imports)) ++ goto exit; ++ return_value = _pickle_Pickler___init___impl((PicklerObject *)self, file, protocol, fix_imports); ++ ++exit: ++ return return_value; ++} ++ ++static PyObject * ++_pickle_Pickler___init___impl(PicklerObject *self, PyObject *file, PyObject *protocol, int fix_imports) ++/*[clinic checksum: 2b5ce6452544600478cf9f4b701ab9d9b5efbab9]*/ ++{ + _Py_IDENTIFIER(persistent_id); + _Py_IDENTIFIER(dispatch_table); + +- if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|OO:Pickler", +- kwlist, &file, &proto_obj, &fix_imports)) +- return -1; +- + /* In case of multiple __init__() calls, clear previous content. */ + if (self->write != NULL) + (void)Pickler_clear(self); + +- if (_Pickler_SetProtocol(self, proto_obj, fix_imports) < 0) +- return -1; ++ if (_Pickler_SetProtocol(self, protocol, fix_imports) < 0) ++ return NULL; + + if (_Pickler_SetOutputStream(self, file) < 0) +- return -1; ++ return NULL; + + /* memo and output_buffer may have already been created in _Pickler_New */ + if (self->memo == NULL) { + self->memo = PyMemoTable_New(); + if (self->memo == NULL) +- return -1; ++ return NULL; + } + self->output_len = 0; + if (self->output_buffer == NULL) { +@@ -3873,10 +4109,9 @@ + self->output_buffer = PyBytes_FromStringAndSize(NULL, + self->max_output_len); + if (self->output_buffer == NULL) +- return -1; +- } +- +- self->arg = NULL; ++ return NULL; ++ } ++ + self->fast = 0; + self->fast_nesting = 0; + self->fast_memo = NULL; +@@ -3885,15 +4120,28 @@ + self->pers_func = _PyObject_GetAttrId((PyObject *)self, + &PyId_persistent_id); + if (self->pers_func == NULL) +- return -1; ++ return NULL; + } + self->dispatch_table = NULL; + if (_PyObject_HasAttrId((PyObject *)self, &PyId_dispatch_table)) { + self->dispatch_table = _PyObject_GetAttrId((PyObject *)self, + &PyId_dispatch_table); + if (self->dispatch_table == NULL) +- return -1; +- } ++ return NULL; ++ } ++ ++ Py_RETURN_NONE; ++} ++ ++/* Wrap the Clinic generated signature to slot it in tp_init. */ ++static int ++Pickler_init(PyObject *self, PyObject *args, PyObject *kwargs) ++{ ++ PyObject *result = _pickle_Pickler___init__(self, args, kwargs); ++ if (result == NULL) { ++ return -1; ++ } ++ Py_DECREF(result); + return 0; + } + +@@ -3912,22 +4160,48 @@ + PicklerObject *pickler; /* Pickler whose memo table we're proxying. */ + } PicklerMemoProxyObject; + +-PyDoc_STRVAR(pmp_clear_doc, +-"memo.clear() -> None. Remove all items from memo."); ++/*[clinic] ++_pickle.PicklerMemoProxy.clear ++ ++ self: PicklerMemoProxyObject ++ ++Remove all items from memo. ++[clinic]*/ ++ ++PyDoc_STRVAR(_pickle_PicklerMemoProxy_clear__doc__, ++"clear()\n" ++"Remove all items from memo."); ++ ++#define _PICKLE_PICKLERMEMOPROXY_CLEAR_METHODDEF \ ++ {"clear", (PyCFunction)_pickle_PicklerMemoProxy_clear, METH_NOARGS, _pickle_PicklerMemoProxy_clear__doc__}, + + static PyObject * +-pmp_clear(PicklerMemoProxyObject *self) ++_pickle_PicklerMemoProxy_clear(PicklerMemoProxyObject *self) ++/*[clinic checksum: 507f13938721992e175a3e58b5ad02620045a1cc]*/ + { + if (self->pickler->memo) + PyMemoTable_Clear(self->pickler->memo); + Py_RETURN_NONE; + } + +-PyDoc_STRVAR(pmp_copy_doc, +-"memo.copy() -> new_memo. Copy the memo to a new object."); ++/*[clinic] ++_pickle.PicklerMemoProxy.copy ++ ++ self: PicklerMemoProxyObject ++ ++Copy the memo to a new object. ++[clinic]*/ ++ ++PyDoc_STRVAR(_pickle_PicklerMemoProxy_copy__doc__, ++"copy()\n" ++"Copy the memo to a new object."); ++ ++#define _PICKLE_PICKLERMEMOPROXY_COPY_METHODDEF \ ++ {"copy", (PyCFunction)_pickle_PicklerMemoProxy_copy, METH_NOARGS, _pickle_PicklerMemoProxy_copy__doc__}, + + static PyObject * +-pmp_copy(PicklerMemoProxyObject *self) ++_pickle_PicklerMemoProxy_copy(PicklerMemoProxyObject *self) ++/*[clinic checksum: 73a5117ab354290ebdbe07bd0bf7232d0936a69d]*/ + { + Py_ssize_t i; + PyMemoTable *memo; +@@ -3964,14 +4238,27 @@ + return NULL; + } + +-PyDoc_STRVAR(pmp_reduce_doc, +-"memo.__reduce__(). Pickling support."); ++/*[clinic] ++_pickle.PicklerMemoProxy.__reduce__ ++ ++ self: PicklerMemoProxyObject ++ ++Implement pickle support. ++[clinic]*/ ++ ++PyDoc_STRVAR(_pickle_PicklerMemoProxy___reduce____doc__, ++"__reduce__()\n" ++"Implement pickle support."); ++ ++#define _PICKLE_PICKLERMEMOPROXY___REDUCE___METHODDEF \ ++ {"__reduce__", (PyCFunction)_pickle_PicklerMemoProxy___reduce__, METH_NOARGS, _pickle_PicklerMemoProxy___reduce____doc__}, + + static PyObject * +-pmp_reduce(PicklerMemoProxyObject *self, PyObject *args) ++_pickle_PicklerMemoProxy___reduce__(PicklerMemoProxyObject *self) ++/*[clinic checksum: 40f0bf7a9b161e77130674f0481bda0a0184dcce]*/ + { + PyObject *reduce_value, *dict_args; +- PyObject *contents = pmp_copy(self); ++ PyObject *contents = _pickle_PicklerMemoProxy_copy(self); + if (contents == NULL) + return NULL; + +@@ -3994,9 +4281,9 @@ + } + + static PyMethodDef picklerproxy_methods[] = { +- {"clear", (PyCFunction)pmp_clear, METH_NOARGS, pmp_clear_doc}, +- {"copy", (PyCFunction)pmp_copy, METH_NOARGS, pmp_copy_doc}, +- {"__reduce__", (PyCFunction)pmp_reduce, METH_VARARGS, pmp_reduce_doc}, ++ _PICKLE_PICKLERMEMOPROXY_CLEAR_METHODDEF ++ _PICKLE_PICKLERMEMOPROXY_COPY_METHODDEF ++ _PICKLE_PICKLERMEMOPROXY___REDUCE___METHODDEF + {NULL, NULL} /* sentinel */ + }; + +@@ -4208,7 +4495,7 @@ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, +- Pickler_doc, /*tp_doc*/ ++ _pickle_Pickler___init____doc__, /*tp_doc*/ + (traverseproc)Pickler_traverse, /*tp_traverse*/ + (inquiry)Pickler_clear, /*tp_clear*/ + 0, /*tp_richcompare*/ +@@ -4223,7 +4510,7 @@ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ +- (initproc)Pickler_init, /*tp_init*/ ++ Pickler_init, /*tp_init*/ + PyType_GenericAlloc, /*tp_alloc*/ + PyType_GenericNew, /*tp_new*/ + PyObject_GC_Del, /*tp_free*/ +@@ -4249,8 +4536,9 @@ + static Py_ssize_t + marker(UnpicklerObject *self) + { ++ PickleState *st = _Pickle_GetGlobalState(); + if (self->num_marks < 1) { +- PyErr_SetString(UnpicklingError, "could not find MARK"); ++ PyErr_SetString(st->UnpicklingError, "could not find MARK"); + return -1; + } + +@@ -4267,7 +4555,8 @@ + static int + bad_readline(void) + { +- PyErr_SetString(UnpicklingError, "pickle data was truncated"); ++ PickleState *st = _Pickle_GetGlobalState(); ++ PyErr_SetString(st->UnpicklingError, "pickle data was truncated"); + return -1; + } + +@@ -4462,8 +4751,9 @@ + + size = calc_binint(nbytes, size); + if (size < 0) { ++ PickleState *st = _Pickle_GetGlobalState(); + /* Corrupt or hostile pickle -- we never write one like this */ +- PyErr_SetString(UnpicklingError, ++ PyErr_SetString(st->UnpicklingError, + "LONG pickle has negative byte count"); + return -1; + } +@@ -4537,7 +4827,7 @@ + load_string(UnpicklerObject *self) + { + PyObject *bytes; +- PyObject *str = NULL; ++ PyObject *obj; + Py_ssize_t len; + char *s, *p; + +@@ -4551,7 +4841,8 @@ + len -= 2; + } + else { +- PyErr_SetString(UnpicklingError, ++ PickleState *st = _Pickle_GetGlobalState(); ++ PyErr_SetString(st->UnpicklingError, + "the STRING opcode argument must be quoted"); + return -1; + } +@@ -4562,12 +4853,59 @@ + bytes = PyBytes_DecodeEscape(p, len, NULL, 0, NULL); + if (bytes == NULL) + return -1; +- str = PyUnicode_FromEncodedObject(bytes, self->encoding, self->errors); +- Py_DECREF(bytes); +- if (str == NULL) +- return -1; +- +- PDATA_PUSH(self->stack, str, -1); ++ ++ /* Leave the Python 2.x strings as bytes if the *encoding* given to the ++ Unpickler was 'bytes'. Otherwise, convert them to unicode. */ ++ if (strcmp(self->encoding, "bytes") == 0) { ++ obj = bytes; ++ } ++ else { ++ obj = PyUnicode_FromEncodedObject(bytes, self->encoding, self->errors); ++ Py_DECREF(bytes); ++ if (obj == NULL) { ++ return -1; ++ } ++ } ++ ++ PDATA_PUSH(self->stack, obj, -1); ++ return 0; ++} ++ ++static int ++load_counted_binstring(UnpicklerObject *self, int nbytes) ++{ ++ PyObject *obj; ++ Py_ssize_t size; ++ char *s; ++ ++ if (_Unpickler_Read(self, &s, nbytes) < 0) ++ return -1; ++ ++ size = calc_binsize(s, nbytes); ++ if (size < 0) { ++ PickleState *st = _Pickle_GetGlobalState(); ++ PyErr_Format(st->UnpicklingError, ++ "BINSTRING exceeds system's maximum size of %zd bytes", ++ PY_SSIZE_T_MAX); ++ return -1; ++ } ++ ++ if (_Unpickler_Read(self, &s, size) < 0) ++ return -1; ++ ++ /* Convert Python 2.x strings to bytes if the *encoding* given to the ++ Unpickler was 'bytes'. Otherwise, convert them to unicode. */ ++ if (strcmp(self->encoding, "bytes") == 0) { ++ obj = PyBytes_FromStringAndSize(s, size); ++ } ++ else { ++ obj = PyUnicode_Decode(s, size, self->encoding, self->errors); ++ } ++ if (obj == NULL) { ++ return -1; ++ } ++ ++ PDATA_PUSH(self->stack, obj, -1); + return 0; + } + +@@ -4601,35 +4939,6 @@ + } + + static int +-load_counted_binstring(UnpicklerObject *self, int nbytes) +-{ +- PyObject *str; +- Py_ssize_t size; +- char *s; +- +- if (_Unpickler_Read(self, &s, nbytes) < 0) +- return -1; +- +- size = calc_binsize(s, nbytes); +- if (size < 0) { +- PyErr_Format(UnpicklingError, +- "BINSTRING exceeds system's maximum size of %zd bytes", +- PY_SSIZE_T_MAX); +- return -1; +- } +- +- if (_Unpickler_Read(self, &s, size) < 0) +- return -1; +- /* Convert Python 2.x strings to unicode. */ +- str = PyUnicode_Decode(s, size, self->encoding, self->errors); +- if (str == NULL) +- return -1; +- +- PDATA_PUSH(self->stack, str, -1); +- return 0; +-} +- +-static int + load_unicode(UnpicklerObject *self) + { + PyObject *str; +@@ -4920,6 +5229,7 @@ + PyObject *clsraw = NULL; + PyTypeObject *cls; /* clsraw cast to its true type */ + PyObject *obj; ++ PickleState *st = _Pickle_GetGlobalState(); + + /* Stack is ... cls argtuple, and we want to call + * cls.__new__(cls, *argtuple). +@@ -4928,7 +5238,8 @@ + if (args == NULL) + goto error; + if (!PyTuple_Check(args)) { +- PyErr_SetString(UnpicklingError, "NEWOBJ expected an arg " "tuple."); ++ PyErr_SetString(st->UnpicklingError, ++ "NEWOBJ expected an arg " "tuple."); + goto error; + } + +@@ -4937,12 +5248,12 @@ + if (cls == NULL) + goto error; + if (!PyType_Check(cls)) { +- PyErr_SetString(UnpicklingError, "NEWOBJ class argument " ++ PyErr_SetString(st->UnpicklingError, "NEWOBJ class argument " + "isn't a type object"); + goto error; + } + if (cls->tp_new == NULL) { +- PyErr_SetString(UnpicklingError, "NEWOBJ class argument " ++ PyErr_SetString(st->UnpicklingError, "NEWOBJ class argument " + "has NULL tp_new"); + goto error; + } +@@ -4968,6 +5279,7 @@ + { + PyObject *cls, *args, *kwargs; + PyObject *obj; ++ PickleState *st = _Pickle_GetGlobalState(); + + PDATA_POP(self->stack, kwargs); + if (kwargs == NULL) { +@@ -4989,7 +5301,7 @@ + Py_DECREF(kwargs); + Py_DECREF(args); + Py_DECREF(cls); +- PyErr_Format(UnpicklingError, ++ PyErr_Format(st->UnpicklingError, + "NEWOBJ_EX class argument must be a type, not %.200s", + Py_TYPE(cls)->tp_name); + return -1; +@@ -4999,7 +5311,7 @@ + Py_DECREF(kwargs); + Py_DECREF(args); + Py_DECREF(cls); +- PyErr_SetString(UnpicklingError, ++ PyErr_SetString(st->UnpicklingError, + "NEWOBJ_EX class argument doesn't have __new__"); + return -1; + } +@@ -5061,7 +5373,8 @@ + PDATA_POP(self->stack, module_name); + if (module_name == NULL || !PyUnicode_CheckExact(module_name) || + global_name == NULL || !PyUnicode_CheckExact(global_name)) { +- PyErr_SetString(UnpicklingError, "STACK_GLOBAL requires str"); ++ PickleState *st = _Pickle_GetGlobalState(); ++ PyErr_SetString(st->UnpicklingError, "STACK_GLOBAL requires str"); + Py_XDECREF(global_name); + Py_XDECREF(module_name); + return -1; +@@ -5085,16 +5398,16 @@ + if (self->pers_func) { + if ((len = _Unpickler_Readline(self, &s)) < 0) + return -1; +- if (len < 2) ++ if (len < 1) + return bad_readline(); + + pid = PyBytes_FromStringAndSize(s, len - 1); + if (pid == NULL) + return -1; + +- /* Ugh... this does not leak since _Unpickler_FastCall() steals the +- reference to pid first. */ +- pid = _Unpickler_FastCall(self, self->pers_func, pid); ++ /* This does not leak since _Pickle_FastCall() steals the reference ++ to pid first. */ ++ pid = _Pickle_FastCall(self->pers_func, pid); + if (pid == NULL) + return -1; + +@@ -5102,7 +5415,8 @@ + return 0; + } + else { +- PyErr_SetString(UnpicklingError, ++ PickleState *st = _Pickle_GetGlobalState(); ++ PyErr_SetString(st->UnpicklingError, + "A load persistent id instruction was encountered,\n" + "but no persistent_load function was specified."); + return -1; +@@ -5119,9 +5433,9 @@ + if (pid == NULL) + return -1; + +- /* Ugh... this does not leak since _Unpickler_FastCall() steals the ++ /* This does not leak since _Pickle_FastCall() steals the + reference to pid first. */ +- pid = _Unpickler_FastCall(self, self->pers_func, pid); ++ pid = _Pickle_FastCall(self->pers_func, pid); + if (pid == NULL) + return -1; + +@@ -5129,7 +5443,8 @@ + return 0; + } + else { +- PyErr_SetString(UnpicklingError, ++ PickleState *st = _Pickle_GetGlobalState(); ++ PyErr_SetString(st->UnpicklingError, + "A load persistent id instruction was encountered,\n" + "but no persistent_load function was specified."); + return -1; +@@ -5285,6 +5600,7 @@ + PyObject *obj; /* the object to push */ + PyObject *pair; /* (module_name, class_name) */ + PyObject *module_name, *class_name; ++ PickleState *st = _Pickle_GetGlobalState(); + + assert(nbytes == 1 || nbytes == 2 || nbytes == 4); + if (_Unpickler_Read(self, &codebytes, nbytes) < 0) +@@ -5292,7 +5608,7 @@ + code = calc_binint(codebytes, nbytes); + if (code <= 0) { /* note that 0 is forbidden */ + /* Corrupt or hostile pickle. */ +- PyErr_SetString(UnpicklingError, "EXT specifies code <= 0"); ++ PyErr_SetString(st->UnpicklingError, "EXT specifies code <= 0"); + return -1; + } + +@@ -5300,20 +5616,26 @@ + py_code = PyLong_FromLong(code); + if (py_code == NULL) + return -1; +- obj = PyDict_GetItem(extension_cache, py_code); ++ obj = PyDict_GetItemWithError(st->extension_cache, py_code); + if (obj != NULL) { + /* Bingo. */ + Py_DECREF(py_code); + PDATA_APPEND(self->stack, obj, -1); + return 0; + } ++ if (PyErr_Occurred()) { ++ Py_DECREF(py_code); ++ return -1; ++ } + + /* Look up the (module_name, class_name) pair. */ +- pair = PyDict_GetItem(inverted_registry, py_code); ++ pair = PyDict_GetItemWithError(st->inverted_registry, py_code); + if (pair == NULL) { + Py_DECREF(py_code); +- PyErr_Format(PyExc_ValueError, "unregistered extension " +- "code %ld", code); ++ if (!PyErr_Occurred()) { ++ PyErr_Format(PyExc_ValueError, "unregistered extension " ++ "code %ld", code); ++ } + return -1; + } + /* Since the extension registry is manipulable via Python code, +@@ -5334,7 +5656,7 @@ + return -1; + } + /* Cache code -> obj. */ +- code = PyDict_SetItem(extension_cache, py_code, obj); ++ code = PyDict_SetItem(st->extension_cache, py_code, obj); + Py_DECREF(py_code); + if (code < 0) { + Py_DECREF(obj); +@@ -5469,7 +5791,7 @@ + PyObject *result; + + value = self->stack->data[i]; +- result = _Unpickler_FastCall(self, append_func, value); ++ result = _Pickle_FastCall(append_func, value); + if (result == NULL) { + Pdata_clear(self->stack, i + 1); + Py_SIZE(self->stack) = x; +@@ -5511,8 +5833,10 @@ + if (len == x) /* nothing to do */ + return 0; + if ((len - x) % 2 != 0) { ++ PickleState *st = _Pickle_GetGlobalState(); + /* Currupt or hostile pickle -- we never write one like this. */ +- PyErr_SetString(UnpicklingError, "odd number of items for SETITEMS"); ++ PyErr_SetString(st->UnpicklingError, ++ "odd number of items for SETITEMS"); + return -1; + } + +@@ -5584,7 +5908,7 @@ + PyObject *item; + + item = self->stack->data[i]; +- result = _Unpickler_FastCall(self, add_func, item); ++ result = _Pickle_FastCall(add_func, item); + if (result == NULL) { + Pdata_clear(self->stack, i + 1); + Py_SIZE(self->stack) = mark; +@@ -5631,9 +5955,7 @@ + PyObject *result; + + /* The explicit __setstate__ is responsible for everything. */ +- /* Ugh... this does not leak since _Unpickler_FastCall() steals the +- reference to state first. */ +- result = _Unpickler_FastCall(self, setstate, state); ++ result = _Pickle_FastCall(setstate, state); + Py_DECREF(setstate); + if (result == NULL) + return -1; +@@ -5664,7 +5986,8 @@ + _Py_IDENTIFIER(__dict__); + + if (!PyDict_Check(state)) { +- PyErr_SetString(UnpicklingError, "state is not a dictionary"); ++ PickleState *st = _Pickle_GetGlobalState(); ++ PyErr_SetString(st->UnpicklingError, "state is not a dictionary"); + goto error; + } + dict = _PyObject_GetAttrId(inst, &PyId___dict__); +@@ -5693,7 +6016,8 @@ + Py_ssize_t i; + + if (!PyDict_Check(slotstate)) { +- PyErr_SetString(UnpicklingError, ++ PickleState *st = _Pickle_GetGlobalState(); ++ PyErr_SetString(st->UnpicklingError, + "slot state is not a dictionary"); + goto error; + } +@@ -5916,11 +6240,14 @@ + break; + + default: +- if (s[0] == '\0') ++ if (s[0] == '\0') { + PyErr_SetNone(PyExc_EOFError); +- else +- PyErr_Format(UnpicklingError, ++ } ++ else { ++ PickleState *st = _Pickle_GetGlobalState(); ++ PyErr_Format(st->UnpicklingError, + "invalid load key, '%c'.", s[0]); ++ } + return NULL; + } + +@@ -5938,70 +6265,129 @@ + return value; + } + +-PyDoc_STRVAR(Unpickler_load_doc, +-"load() -> object. Load a pickle." ++/*[clinic] ++ ++_pickle.Unpickler.load ++ ++Load a pickle. ++ ++Read a pickled object representation from the open file object given ++in the constructor, and return the reconstituted object hierarchy ++specified therein. ++[clinic]*/ ++ ++PyDoc_STRVAR(_pickle_Unpickler_load__doc__, ++"load()\n" ++"Load a pickle.\n" + "\n" +-"Read a pickled object representation from the open file object given in\n" +-"the constructor, and return the reconstituted object hierarchy specified\n" +-"therein.\n"); ++"Read a pickled object representation from the open file object given\n" ++"in the constructor, and return the reconstituted object hierarchy\n" ++"specified therein."); ++ ++#define _PICKLE_UNPICKLER_LOAD_METHODDEF \ ++ {"load", (PyCFunction)_pickle_Unpickler_load, METH_NOARGS, _pickle_Unpickler_load__doc__}, + + static PyObject * +-Unpickler_load(UnpicklerObject *self) +-{ ++_pickle_Unpickler_load(PyObject *self) ++/*[clinic checksum: c2ae1263f0dd000f34ccf0fe59d7c544464babc4]*/ ++{ ++ UnpicklerObject *unpickler = (UnpicklerObject*)self; ++ + /* Check whether the Unpickler was initialized correctly. This prevents + segfaulting if a subclass overridden __init__ with a function that does + not call Unpickler.__init__(). Here, we simply ensure that self->read + is not NULL. */ +- if (self->read == NULL) { +- PyErr_Format(UnpicklingError, ++ if (unpickler->read == NULL) { ++ PickleState *st = _Pickle_GetGlobalState(); ++ PyErr_Format(st->UnpicklingError, + "Unpickler.__init__() was not called by %s.__init__()", +- Py_TYPE(self)->tp_name); ++ Py_TYPE(unpickler)->tp_name); + return NULL; + } + +- return load(self); ++ return load(unpickler); + } + + /* The name of find_class() is misleading. In newer pickle protocols, this + function is used for loading any global (i.e., functions), not just + classes. The name is kept only for backward compatibility. */ + +-PyDoc_STRVAR(Unpickler_find_class_doc, +-"find_class(module_name, global_name) -> object.\n" ++/*[clinic] ++ ++_pickle.Unpickler.find_class ++ ++ self: UnpicklerObject ++ module_name: object ++ global_name: object ++ / ++ ++Return an object from a specified module. ++ ++If necessary, the module will be imported. Subclasses may override ++this method (e.g. to restrict unpickling of arbitrary classes and ++functions). ++ ++This method is called whenever a class or a function object is ++needed. Both arguments passed are str objects. ++[clinic]*/ ++ ++PyDoc_STRVAR(_pickle_Unpickler_find_class__doc__, ++"find_class(module_name, global_name)\n" ++"Return an object from a specified module.\n" + "\n" +-"Return an object from a specified module, importing the module if\n" +-"necessary. Subclasses may override this method (e.g. to restrict\n" +-"unpickling of arbitrary classes and functions).\n" ++"If necessary, the module will be imported. Subclasses may override\n" ++"this method (e.g. to restrict unpickling of arbitrary classes and\n" ++"functions).\n" + "\n" + "This method is called whenever a class or a function object is\n" +-"needed. Both arguments passed are str objects.\n"); ++"needed. Both arguments passed are str objects."); ++ ++#define _PICKLE_UNPICKLER_FIND_CLASS_METHODDEF \ ++ {"find_class", (PyCFunction)_pickle_Unpickler_find_class, METH_VARARGS, _pickle_Unpickler_find_class__doc__}, + + static PyObject * +-Unpickler_find_class(UnpicklerObject *self, PyObject *args) ++_pickle_Unpickler_find_class_impl(UnpicklerObject *self, PyObject *module_name, PyObject *global_name); ++ ++static PyObject * ++_pickle_Unpickler_find_class(PyObject *self, PyObject *args) ++{ ++ PyObject *return_value = NULL; ++ PyObject *module_name; ++ PyObject *global_name; ++ ++ if (!PyArg_ParseTuple(args, ++ "OO:find_class", ++ &module_name, &global_name)) ++ goto exit; ++ return_value = _pickle_Unpickler_find_class_impl((UnpicklerObject *)self, module_name, global_name); ++ ++exit: ++ return return_value; ++} ++ ++static PyObject * ++_pickle_Unpickler_find_class_impl(UnpicklerObject *self, PyObject *module_name, PyObject *global_name) ++/*[clinic checksum: 1f353d13a32c9d94feb1466b3c2d0529a7e5650e]*/ + { + PyObject *global; + PyObject *modules_dict; + PyObject *module; +- PyObject *module_name, *global_name; + _Py_IDENTIFIER(modules); + +- if (!PyArg_UnpackTuple(args, "find_class", 2, 2, +- &module_name, &global_name)) +- return NULL; +- + /* Try to map the old names used in Python 2.x to the new ones used in + Python 3.x. We do this only with old pickle protocols and when the + user has not disabled the feature. */ + if (self->proto < 3 && self->fix_imports) { + PyObject *key; + PyObject *item; ++ PickleState *st = _Pickle_GetGlobalState(); + + /* Check if the global (i.e., a function or a class) was renamed + or moved to another module. */ + key = PyTuple_Pack(2, module_name, global_name); + if (key == NULL) + return NULL; +- item = PyDict_GetItemWithError(name_mapping_2to3, key); ++ item = PyDict_GetItemWithError(st->name_mapping_2to3, key); + Py_DECREF(key); + if (item) { + if (!PyTuple_Check(item) || PyTuple_GET_SIZE(item) != 2) { +@@ -6027,7 +6413,7 @@ + } + + /* Check if the module was renamed. */ +- item = PyDict_GetItemWithError(import_mapping_2to3, module_name); ++ item = PyDict_GetItemWithError(st->import_mapping_2to3, module_name); + if (item) { + if (!PyUnicode_Check(item)) { + PyErr_Format(PyExc_RuntimeError, +@@ -6065,10 +6451,8 @@ + } + + static struct PyMethodDef Unpickler_methods[] = { +- {"load", (PyCFunction)Unpickler_load, METH_NOARGS, +- Unpickler_load_doc}, +- {"find_class", (PyCFunction)Unpickler_find_class, METH_VARARGS, +- Unpickler_find_class_doc}, ++ _PICKLE_UNPICKLER_LOAD_METHODDEF ++ _PICKLE_UNPICKLER_FIND_CLASS_METHODDEF + {NULL, NULL} /* sentinel */ + }; + +@@ -6081,7 +6465,6 @@ + Py_XDECREF(self->peek); + Py_XDECREF(self->stack); + Py_XDECREF(self->pers_func); +- Py_XDECREF(self->arg); + if (self->buffer.buf != NULL) { + PyBuffer_Release(&self->buffer); + self->buffer.buf = NULL; +@@ -6104,7 +6487,6 @@ + Py_VISIT(self->peek); + Py_VISIT(self->stack); + Py_VISIT(self->pers_func); +- Py_VISIT(self->arg); + return 0; + } + +@@ -6116,7 +6498,6 @@ + Py_CLEAR(self->peek); + Py_CLEAR(self->stack); + Py_CLEAR(self->pers_func); +- Py_CLEAR(self->arg); + if (self->buffer.buf != NULL) { + PyBuffer_Release(&self->buffer); + self->buffer.buf = NULL; +@@ -6135,77 +6516,113 @@ + return 0; + } + +-PyDoc_STRVAR(Unpickler_doc, +-"Unpickler(file, *, encoding='ASCII', errors='strict')" +-"\n" ++/*[clinic] ++ ++_pickle.Unpickler.__init__ ++ ++ self: UnpicklerObject ++ file: object ++ * ++ fix_imports: bool = True ++ encoding: str = 'ASCII' ++ errors: str = 'strict' ++ ++This takes a binary file for reading a pickle data stream. ++ ++The protocol version of the pickle is detected automatically, so no ++protocol argument is needed. Bytes past the pickled object's ++representation are ignored. ++ ++The argument *file* must have two methods, a read() method that takes ++an integer argument, and a readline() method that requires no ++arguments. Both methods should return bytes. Thus *file* can be a ++binary file object opened for reading, a io.BytesIO object, or any ++other custom object that meets this interface. ++ ++Optional keyword arguments are *fix_imports*, *encoding* and *errors*, ++which are used to control compatiblity support for pickle stream ++generated by Python 2. If *fix_imports* is True, pickle will try to ++map the old Python 2 names to the new names used in Python 3. The ++*encoding* and *errors* tell pickle how to decode 8-bit string ++instances pickled by Python 2; these default to 'ASCII' and 'strict', ++respectively. The *encoding* can be 'bytes' to read these 8-bit ++string instances as bytes objects. ++[clinic]*/ ++ ++PyDoc_STRVAR(_pickle_Unpickler___init____doc__, ++"__init__(file, *, fix_imports=True, encoding=\'ASCII\', errors=\'strict\')\n" + "This takes a binary file for reading a pickle data stream.\n" + "\n" + "The protocol version of the pickle is detected automatically, so no\n" +-"proto argument is needed.\n" ++"protocol argument is needed. Bytes past the pickled object\'s\n" ++"representation are ignored.\n" + "\n" +-"The file-like object must have two methods, a read() method\n" +-"that takes an integer argument, and a readline() method that\n" +-"requires no arguments. Both methods should return bytes.\n" +-"Thus file-like object can be a binary file object opened for\n" +-"reading, a BytesIO object, or any other custom object that\n" +-"meets this interface.\n" ++"The argument *file* must have two methods, a read() method that takes\n" ++"an integer argument, and a readline() method that requires no\n" ++"arguments. Both methods should return bytes. Thus *file* can be a\n" ++"binary file object opened for reading, a io.BytesIO object, or any\n" ++"other custom object that meets this interface.\n" + "\n" + "Optional keyword arguments are *fix_imports*, *encoding* and *errors*,\n" + "which are used to control compatiblity support for pickle stream\n" +-"generated by Python 2.x. If *fix_imports* is True, pickle will try to\n" +-"map the old Python 2.x names to the new names used in Python 3.x. The\n" ++"generated by Python 2. If *fix_imports* is True, pickle will try to\n" ++"map the old Python 2 names to the new names used in Python 3. The\n" + "*encoding* and *errors* tell pickle how to decode 8-bit string\n" +-"instances pickled by Python 2.x; these default to 'ASCII' and\n" +-"'strict', respectively.\n"); +- +-static int +-Unpickler_init(UnpicklerObject *self, PyObject *args, PyObject *kwds) +-{ +- static char *kwlist[] = {"file", "fix_imports", "encoding", "errors", 0}; ++"instances pickled by Python 2; these default to \'ASCII\' and \'strict\',\n" ++"respectively. The *encoding* can be \'bytes\' to read these 8-bit\n" ++"string instances as bytes objects."); ++ ++#define _PICKLE_UNPICKLER___INIT___METHODDEF \ ++ {"__init__", (PyCFunction)_pickle_Unpickler___init__, METH_VARARGS|METH_KEYWORDS, _pickle_Unpickler___init____doc__}, ++ ++static PyObject * ++_pickle_Unpickler___init___impl(UnpicklerObject *self, PyObject *file, int fix_imports, const char *encoding, const char *errors); ++ ++static PyObject * ++_pickle_Unpickler___init__(PyObject *self, PyObject *args, PyObject *kwargs) ++{ ++ PyObject *return_value = NULL; ++ static char *_keywords[] = {"file", "fix_imports", "encoding", "errors", NULL}; + PyObject *file; +- PyObject *fix_imports = Py_True; +- char *encoding = NULL; +- char *errors = NULL; ++ int fix_imports = 1; ++ const char *encoding = "ASCII"; ++ const char *errors = "strict"; ++ ++ if (!PyArg_ParseTupleAndKeywords(args, kwargs, ++ "O|$pss:__init__", _keywords, ++ &file, &fix_imports, &encoding, &errors)) ++ goto exit; ++ return_value = _pickle_Unpickler___init___impl((UnpicklerObject *)self, file, fix_imports, encoding, errors); ++ ++exit: ++ return return_value; ++} ++ ++static PyObject * ++_pickle_Unpickler___init___impl(UnpicklerObject *self, PyObject *file, int fix_imports, const char *encoding, const char *errors) ++/*[clinic checksum: 9ce6783224e220573d42a94fe1bb7199d6f1c5a6]*/ ++{ + _Py_IDENTIFIER(persistent_load); + +- /* XXX: That is an horrible error message. But, I don't know how to do +- better... */ +- if (Py_SIZE(args) != 1) { +- PyErr_Format(PyExc_TypeError, +- "%s takes exactly one positional argument (%zd given)", +- Py_TYPE(self)->tp_name, Py_SIZE(args)); +- return -1; +- } +- +- /* Arguments parsing needs to be done in the __init__() method to allow +- subclasses to define their own __init__() method, which may (or may +- not) support Unpickler arguments. However, this means we need to be +- extra careful in the other Unpickler methods, since a subclass could +- forget to call Unpickler.__init__() thus breaking our internal +- invariants. */ +- if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|Oss:Unpickler", kwlist, +- &file, &fix_imports, &encoding, &errors)) +- return -1; +- + /* In case of multiple __init__() calls, clear previous content. */ + if (self->read != NULL) + (void)Unpickler_clear(self); + + if (_Unpickler_SetInputStream(self, file) < 0) +- return -1; ++ return NULL; + + if (_Unpickler_SetInputEncoding(self, encoding, errors) < 0) +- return -1; +- +- self->fix_imports = PyObject_IsTrue(fix_imports); ++ return NULL; ++ ++ self->fix_imports = fix_imports; + if (self->fix_imports == -1) +- return -1; ++ return NULL; + + if (_PyObject_HasAttrId((PyObject *)self, &PyId_persistent_load)) { + self->pers_func = _PyObject_GetAttrId((PyObject *)self, + &PyId_persistent_load); + if (self->pers_func == NULL) +- return -1; ++ return NULL; + } + else { + self->pers_func = NULL; +@@ -6213,16 +6630,27 @@ + + self->stack = (Pdata *)Pdata_New(); + if (self->stack == NULL) +- return -1; ++ return NULL; + + self->memo_size = 32; + self->memo = _Unpickler_NewMemo(self->memo_size); + if (self->memo == NULL) +- return -1; +- +- self->arg = NULL; ++ return NULL; ++ + self->proto = 0; + ++ Py_RETURN_NONE; ++} ++ ++/* Wrap the Clinic generated signature to slot it in tp_init. */ ++static int ++Unpickler_init(PyObject *self, PyObject *args, PyObject *kwargs) ++{ ++ PyObject *result = _pickle_Unpickler___init__(self, args, kwargs); ++ if (result == NULL) { ++ return -1; ++ } ++ Py_DECREF(result); + return 0; + } + +@@ -6244,11 +6672,24 @@ + UnpicklerObject *unpickler; + } UnpicklerMemoProxyObject; + +-PyDoc_STRVAR(ump_clear_doc, +-"memo.clear() -> None. Remove all items from memo."); ++/*[clinic] ++_pickle.UnpicklerMemoProxy.clear ++ ++ self: UnpicklerMemoProxyObject ++ ++Remove all items from memo. ++[clinic]*/ ++ ++PyDoc_STRVAR(_pickle_UnpicklerMemoProxy_clear__doc__, ++"clear()\n" ++"Remove all items from memo."); ++ ++#define _PICKLE_UNPICKLERMEMOPROXY_CLEAR_METHODDEF \ ++ {"clear", (PyCFunction)_pickle_UnpicklerMemoProxy_clear, METH_NOARGS, _pickle_UnpicklerMemoProxy_clear__doc__}, + + static PyObject * +-ump_clear(UnpicklerMemoProxyObject *self) ++_pickle_UnpicklerMemoProxy_clear(UnpicklerMemoProxyObject *self) ++/*[clinic checksum: 46fecf4e33c0c873124f845edf6cc3a2e9864bd5]*/ + { + _Unpickler_MemoCleanup(self->unpickler); + self->unpickler->memo = _Unpickler_NewMemo(self->unpickler->memo_size); +@@ -6257,11 +6698,24 @@ + Py_RETURN_NONE; + } + +-PyDoc_STRVAR(ump_copy_doc, +-"memo.copy() -> new_memo. Copy the memo to a new object."); ++/*[clinic] ++_pickle.UnpicklerMemoProxy.copy ++ ++ self: UnpicklerMemoProxyObject ++ ++Copy the memo to a new object. ++[clinic]*/ ++ ++PyDoc_STRVAR(_pickle_UnpicklerMemoProxy_copy__doc__, ++"copy()\n" ++"Copy the memo to a new object."); ++ ++#define _PICKLE_UNPICKLERMEMOPROXY_COPY_METHODDEF \ ++ {"copy", (PyCFunction)_pickle_UnpicklerMemoProxy_copy, METH_NOARGS, _pickle_UnpicklerMemoProxy_copy__doc__}, + + static PyObject * +-ump_copy(UnpicklerMemoProxyObject *self) ++_pickle_UnpicklerMemoProxy_copy(UnpicklerMemoProxyObject *self) ++/*[clinic checksum: f8856c4e8a33540886dfbb245f286af3008fa0ad]*/ + { + Py_ssize_t i; + PyObject *new_memo = PyDict_New(); +@@ -6291,15 +6745,28 @@ + return NULL; + } + +-PyDoc_STRVAR(ump_reduce_doc, +-"memo.__reduce__(). Pickling support."); ++/*[clinic] ++_pickle.UnpicklerMemoProxy.__reduce__ ++ ++ self: UnpicklerMemoProxyObject ++ ++Implement pickling support. ++[clinic]*/ ++ ++PyDoc_STRVAR(_pickle_UnpicklerMemoProxy___reduce____doc__, ++"__reduce__()\n" ++"Implement pickling support."); ++ ++#define _PICKLE_UNPICKLERMEMOPROXY___REDUCE___METHODDEF \ ++ {"__reduce__", (PyCFunction)_pickle_UnpicklerMemoProxy___reduce__, METH_NOARGS, _pickle_UnpicklerMemoProxy___reduce____doc__}, + + static PyObject * +-ump_reduce(UnpicklerMemoProxyObject *self, PyObject *args) ++_pickle_UnpicklerMemoProxy___reduce__(UnpicklerMemoProxyObject *self) ++/*[clinic checksum: ab5516a77659144e1191c7dd70a0c6c7455660bc]*/ + { + PyObject *reduce_value; + PyObject *constructor_args; +- PyObject *contents = ump_copy(self); ++ PyObject *contents = _pickle_UnpicklerMemoProxy_copy(self); + if (contents == NULL) + return NULL; + +@@ -6322,9 +6789,9 @@ + } + + static PyMethodDef unpicklerproxy_methods[] = { +- {"clear", (PyCFunction)ump_clear, METH_NOARGS, ump_clear_doc}, +- {"copy", (PyCFunction)ump_copy, METH_NOARGS, ump_copy_doc}, +- {"__reduce__", (PyCFunction)ump_reduce, METH_VARARGS, ump_reduce_doc}, ++ _PICKLE_UNPICKLERMEMOPROXY_CLEAR_METHODDEF ++ _PICKLE_UNPICKLERMEMOPROXY_COPY_METHODDEF ++ _PICKLE_UNPICKLERMEMOPROXY___REDUCE___METHODDEF + {NULL, NULL} /* sentinel */ + }; + +@@ -6548,7 +7015,7 @@ + 0, /*tp_setattro*/ + 0, /*tp_as_buffer*/ + Py_TPFLAGS_DEFAULT | Py_TPFLAGS_BASETYPE | Py_TPFLAGS_HAVE_GC, +- Unpickler_doc, /*tp_doc*/ ++ _pickle_Unpickler___init____doc__, /*tp_doc*/ + (traverseproc)Unpickler_traverse, /*tp_traverse*/ + (inquiry)Unpickler_clear, /*tp_clear*/ + 0, /*tp_richcompare*/ +@@ -6563,63 +7030,106 @@ + 0, /*tp_descr_get*/ + 0, /*tp_descr_set*/ + 0, /*tp_dictoffset*/ +- (initproc)Unpickler_init, /*tp_init*/ ++ Unpickler_init, /*tp_init*/ + PyType_GenericAlloc, /*tp_alloc*/ + PyType_GenericNew, /*tp_new*/ + PyObject_GC_Del, /*tp_free*/ + 0, /*tp_is_gc*/ + }; + +-PyDoc_STRVAR(pickle_dump_doc, +-"dump(obj, file, protocol=None, *, fix_imports=True) -> None\n" ++/*[clinic] ++ ++_pickle.dump ++ ++ obj: object ++ file: object ++ protocol: object = NULL ++ * ++ fix_imports: bool = True ++ ++Write a pickled representation of obj to the open file object file. ++ ++This is equivalent to ``Pickler(file, protocol).dump(obj)``, but may ++be more efficient. ++ ++The optional *protocol* argument tells the pickler to use the given ++protocol supported protocols are 0, 1, 2, 3 and 4. The default ++protocol is 3; a backward-incompatible protocol designed for Python 3. ++ ++Specifying a negative protocol version selects the highest protocol ++version supported. The higher the protocol used, the more recent the ++version of Python needed to read the pickle produced. ++ ++The *file* argument must have a write() method that accepts a single ++bytes argument. It can thus be a file object opened for binary ++writing, a io.BytesIO instance, or any other custom object that meets ++this interface. ++ ++If *fix_imports* is True and protocol is less than 3, pickle will try ++to map the new Python 3 names to the old module names used in Python ++2, so that the pickle data stream is readable with Python 2. ++[clinic]*/ ++ ++PyDoc_STRVAR(_pickle_dump__doc__, ++"dump(obj, file, protocol=None, *, fix_imports=True)\n" ++"Write a pickled representation of obj to the open file object file.\n" + "\n" +-"Write a pickled representation of obj to the open file object file. This\n" +-"is equivalent to ``Pickler(file, protocol).dump(obj)``, but may be more\n" +-"efficient.\n" ++"This is equivalent to ``Pickler(file, protocol).dump(obj)``, but may\n" ++"be more efficient.\n" + "\n" +-"The optional protocol argument tells the pickler to use the given protocol;\n" +-"supported protocols are 0, 1, 2, 3. The default protocol is 3; a\n" +-"backward-incompatible protocol designed for Python 3.0.\n" ++"The optional *protocol* argument tells the pickler to use the given\n" ++"protocol supported protocols are 0, 1, 2, 3 and 4. The default\n" ++"protocol is 3; a backward-incompatible protocol designed for Python 3.\n" + "\n" +-"Specifying a negative protocol version selects the highest protocol version\n" +-"supported. The higher the protocol used, the more recent the version of\n" +-"Python needed to read the pickle produced.\n" ++"Specifying a negative protocol version selects the highest protocol\n" ++"version supported. The higher the protocol used, the more recent the\n" ++"version of Python needed to read the pickle produced.\n" + "\n" +-"The file argument must have a write() method that accepts a single bytes\n" +-"argument. It can thus be a file object opened for binary writing, a\n" +-"io.BytesIO instance, or any other custom object that meets this interface.\n" ++"The *file* argument must have a write() method that accepts a single\n" ++"bytes argument. It can thus be a file object opened for binary\n" ++"writing, a io.BytesIO instance, or any other custom object that meets\n" ++"this interface.\n" + "\n" +-"If fix_imports is True and protocol is less than 3, pickle will try to\n" +-"map the new Python 3.x names to the old module names used in Python 2.x,\n" +-"so that the pickle data stream is readable with Python 2.x.\n"); ++"If *fix_imports* is True and protocol is less than 3, pickle will try\n" ++"to map the new Python 3 names to the old module names used in Python\n" ++"2, so that the pickle data stream is readable with Python 2."); ++ ++#define _PICKLE_DUMP_METHODDEF \ ++ {"dump", (PyCFunction)_pickle_dump, METH_VARARGS|METH_KEYWORDS, _pickle_dump__doc__}, + + static PyObject * +-pickle_dump(PyObject *self, PyObject *args, PyObject *kwds) +-{ +- static char *kwlist[] = {"obj", "file", "protocol", "fix_imports", 0}; ++_pickle_dump_impl(PyModuleDef *module, PyObject *obj, PyObject *file, PyObject *protocol, int fix_imports); ++ ++static PyObject * ++_pickle_dump(PyModuleDef *module, PyObject *args, PyObject *kwargs) ++{ ++ PyObject *return_value = NULL; ++ static char *_keywords[] = {"obj", "file", "protocol", "fix_imports", NULL}; + PyObject *obj; + PyObject *file; +- PyObject *proto = NULL; +- PyObject *fix_imports = Py_True; +- PicklerObject *pickler; +- +- /* fix_imports is a keyword-only argument. */ +- if (Py_SIZE(args) > 3) { +- PyErr_Format(PyExc_TypeError, +- "pickle.dump() takes at most 3 positional " +- "argument (%zd given)", Py_SIZE(args)); +- return NULL; +- } +- +- if (!PyArg_ParseTupleAndKeywords(args, kwds, "OO|OO:dump", kwlist, +- &obj, &file, &proto, &fix_imports)) +- return NULL; +- +- pickler = _Pickler_New(); ++ PyObject *protocol = NULL; ++ int fix_imports = 1; ++ ++ if (!PyArg_ParseTupleAndKeywords(args, kwargs, ++ "OO|O$p:dump", _keywords, ++ &obj, &file, &protocol, &fix_imports)) ++ goto exit; ++ return_value = _pickle_dump_impl(module, obj, file, protocol, fix_imports); ++ ++exit: ++ return return_value; ++} ++ ++static PyObject * ++_pickle_dump_impl(PyModuleDef *module, PyObject *obj, PyObject *file, PyObject *protocol, int fix_imports) ++/*[clinic checksum: eb5c23e64da34477178230b704d2cc9c6b6650ea]*/ ++{ ++ PicklerObject *pickler = _Pickler_New(); ++ + if (pickler == NULL) + return NULL; + +- if (_Pickler_SetProtocol(pickler, proto, fix_imports) < 0) ++ if (_Pickler_SetProtocol(pickler, protocol, fix_imports) < 0) + goto error; + + if (_Pickler_SetOutputStream(pickler, file) < 0) +@@ -6639,51 +7149,82 @@ + return NULL; + } + +-PyDoc_STRVAR(pickle_dumps_doc, +-"dumps(obj, protocol=None, *, fix_imports=True) -> bytes\n" ++/*[clinic] ++ ++_pickle.dumps ++ ++ obj: object ++ protocol: object = NULL ++ * ++ fix_imports: bool = True ++ ++Return the pickled representation of the object as a bytes object. ++ ++The optional *protocol* argument tells the pickler to use the given ++protocol; supported protocols are 0, 1, 2, 3 and 4. The default ++protocol is 3; a backward-incompatible protocol designed for Python 3. ++ ++Specifying a negative protocol version selects the highest protocol ++version supported. The higher the protocol used, the more recent the ++version of Python needed to read the pickle produced. ++ ++If *fix_imports* is True and *protocol* is less than 3, pickle will ++try to map the new Python 3 names to the old module names used in ++Python 2, so that the pickle data stream is readable with Python 2. ++[clinic]*/ ++ ++PyDoc_STRVAR(_pickle_dumps__doc__, ++"dumps(obj, protocol=None, *, fix_imports=True)\n" ++"Return the pickled representation of the object as a bytes object.\n" + "\n" +-"Return the pickled representation of the object as a bytes\n" +-"object, instead of writing it to a file.\n" ++"The optional *protocol* argument tells the pickler to use the given\n" ++"protocol; supported protocols are 0, 1, 2, 3 and 4. The default\n" ++"protocol is 3; a backward-incompatible protocol designed for Python 3.\n" + "\n" +-"The optional protocol argument tells the pickler to use the given protocol;\n" +-"supported protocols are 0, 1, 2, 3. The default protocol is 3; a\n" +-"backward-incompatible protocol designed for Python 3.0.\n" ++"Specifying a negative protocol version selects the highest protocol\n" ++"version supported. The higher the protocol used, the more recent the\n" ++"version of Python needed to read the pickle produced.\n" + "\n" +-"Specifying a negative protocol version selects the highest protocol version\n" +-"supported. The higher the protocol used, the more recent the version of\n" +-"Python needed to read the pickle produced.\n" +-"\n" +-"If fix_imports is True and *protocol* is less than 3, pickle will try to\n" +-"map the new Python 3.x names to the old module names used in Python 2.x,\n" +-"so that the pickle data stream is readable with Python 2.x.\n"); ++"If *fix_imports* is True and *protocol* is less than 3, pickle will\n" ++"try to map the new Python 3 names to the old module names used in\n" ++"Python 2, so that the pickle data stream is readable with Python 2."); ++ ++#define _PICKLE_DUMPS_METHODDEF \ ++ {"dumps", (PyCFunction)_pickle_dumps, METH_VARARGS|METH_KEYWORDS, _pickle_dumps__doc__}, + + static PyObject * +-pickle_dumps(PyObject *self, PyObject *args, PyObject *kwds) +-{ +- static char *kwlist[] = {"obj", "protocol", "fix_imports", 0}; ++_pickle_dumps_impl(PyModuleDef *module, PyObject *obj, PyObject *protocol, int fix_imports); ++ ++static PyObject * ++_pickle_dumps(PyModuleDef *module, PyObject *args, PyObject *kwargs) ++{ ++ PyObject *return_value = NULL; ++ static char *_keywords[] = {"obj", "protocol", "fix_imports", NULL}; + PyObject *obj; +- PyObject *proto = NULL; ++ PyObject *protocol = NULL; ++ int fix_imports = 1; ++ ++ if (!PyArg_ParseTupleAndKeywords(args, kwargs, ++ "O|O$p:dumps", _keywords, ++ &obj, &protocol, &fix_imports)) ++ goto exit; ++ return_value = _pickle_dumps_impl(module, obj, protocol, fix_imports); ++ ++exit: ++ return return_value; ++} ++ ++static PyObject * ++_pickle_dumps_impl(PyModuleDef *module, PyObject *obj, PyObject *protocol, int fix_imports) ++/*[clinic checksum: e9b915d61202a9692cb6c6718db74fe54fc9c4d1]*/ ++{ + PyObject *result; +- PyObject *fix_imports = Py_True; +- PicklerObject *pickler; +- +- /* fix_imports is a keyword-only argument. */ +- if (Py_SIZE(args) > 2) { +- PyErr_Format(PyExc_TypeError, +- "pickle.dumps() takes at most 2 positional " +- "argument (%zd given)", Py_SIZE(args)); +- return NULL; +- } +- +- if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|OO:dumps", kwlist, +- &obj, &proto, &fix_imports)) +- return NULL; +- +- pickler = _Pickler_New(); ++ PicklerObject *pickler = _Pickler_New(); ++ + if (pickler == NULL) + return NULL; + +- if (_Pickler_SetProtocol(pickler, proto, fix_imports) < 0) ++ if (_Pickler_SetProtocol(pickler, protocol, fix_imports) < 0) + goto error; + + if (dump(pickler, obj) < 0) +@@ -6698,54 +7239,100 @@ + return NULL; + } + +-PyDoc_STRVAR(pickle_load_doc, +-"load(file, *, fix_imports=True, encoding='ASCII', errors='strict') -> object\n" ++/*[clinic] ++ ++_pickle.load ++ ++ file: object ++ * ++ fix_imports: bool = True ++ encoding: str = 'ASCII' ++ errors: str = 'strict' ++ ++Read and return an object from the pickle data stored in a file. ++ ++This is equivalent to ``Unpickler(file).load()``, but may be more ++efficient. ++ ++The protocol version of the pickle is detected automatically, so no ++protocol argument is needed. Bytes past the pickled object's ++representation are ignored. ++ ++The argument *file* must have two methods, a read() method that takes ++an integer argument, and a readline() method that requires no ++arguments. Both methods should return bytes. Thus *file* can be a ++binary file object opened for reading, a io.BytesIO object, or any ++other custom object that meets this interface. ++ ++Optional keyword arguments are *fix_imports*, *encoding* and *errors*, ++which are used to control compatiblity support for pickle stream ++generated by Python 2. If *fix_imports* is True, pickle will try to ++map the old Python 2 names to the new names used in Python 3. The ++*encoding* and *errors* tell pickle how to decode 8-bit string ++instances pickled by Python 2; these default to 'ASCII' and 'strict', ++respectively. The *encoding* can be 'bytes' to read these 8-bit ++string instances as bytes objects. ++[clinic]*/ ++ ++PyDoc_STRVAR(_pickle_load__doc__, ++"load(file, *, fix_imports=True, encoding=\'ASCII\', errors=\'strict\')\n" ++"Read and return an object from the pickle data stored in a file.\n" + "\n" +-"Read a pickled object representation from the open file object file and\n" +-"return the reconstituted object hierarchy specified therein. This is\n" +-"equivalent to ``Unpickler(file).load()``, but may be more efficient.\n" ++"This is equivalent to ``Unpickler(file).load()``, but may be more\n" ++"efficient.\n" + "\n" +-"The protocol version of the pickle is detected automatically, so no protocol\n" +-"argument is needed. Bytes past the pickled object's representation are\n" +-"ignored.\n" ++"The protocol version of the pickle is detected automatically, so no\n" ++"protocol argument is needed. Bytes past the pickled object\'s\n" ++"representation are ignored.\n" + "\n" +-"The argument file must have two methods, a read() method that takes an\n" +-"integer argument, and a readline() method that requires no arguments. Both\n" +-"methods should return bytes. Thus *file* can be a binary file object opened\n" +-"for reading, a BytesIO object, or any other custom object that meets this\n" +-"interface.\n" ++"The argument *file* must have two methods, a read() method that takes\n" ++"an integer argument, and a readline() method that requires no\n" ++"arguments. Both methods should return bytes. Thus *file* can be a\n" ++"binary file object opened for reading, a io.BytesIO object, or any\n" ++"other custom object that meets this interface.\n" + "\n" +-"Optional keyword arguments are fix_imports, encoding and errors,\n" +-"which are used to control compatiblity support for pickle stream generated\n" +-"by Python 2.x. If fix_imports is True, pickle will try to map the old\n" +-"Python 2.x names to the new names used in Python 3.x. The encoding and\n" +-"errors tell pickle how to decode 8-bit string instances pickled by Python\n" +-"2.x; these default to 'ASCII' and 'strict', respectively.\n"); ++"Optional keyword arguments are *fix_imports*, *encoding* and *errors*,\n" ++"which are used to control compatiblity support for pickle stream\n" ++"generated by Python 2. If *fix_imports* is True, pickle will try to\n" ++"map the old Python 2 names to the new names used in Python 3. The\n" ++"*encoding* and *errors* tell pickle how to decode 8-bit string\n" ++"instances pickled by Python 2; these default to \'ASCII\' and \'strict\',\n" ++"respectively. The *encoding* can be \'bytes\' to read these 8-bit\n" ++"string instances as bytes objects."); ++ ++#define _PICKLE_LOAD_METHODDEF \ ++ {"load", (PyCFunction)_pickle_load, METH_VARARGS|METH_KEYWORDS, _pickle_load__doc__}, + + static PyObject * +-pickle_load(PyObject *self, PyObject *args, PyObject *kwds) +-{ +- static char *kwlist[] = {"file", "fix_imports", "encoding", "errors", 0}; ++_pickle_load_impl(PyModuleDef *module, PyObject *file, int fix_imports, const char *encoding, const char *errors); ++ ++static PyObject * ++_pickle_load(PyModuleDef *module, PyObject *args, PyObject *kwargs) ++{ ++ PyObject *return_value = NULL; ++ static char *_keywords[] = {"file", "fix_imports", "encoding", "errors", NULL}; + PyObject *file; +- PyObject *fix_imports = Py_True; ++ int fix_imports = 1; ++ const char *encoding = "ASCII"; ++ const char *errors = "strict"; ++ ++ if (!PyArg_ParseTupleAndKeywords(args, kwargs, ++ "O|$pss:load", _keywords, ++ &file, &fix_imports, &encoding, &errors)) ++ goto exit; ++ return_value = _pickle_load_impl(module, file, fix_imports, encoding, errors); ++ ++exit: ++ return return_value; ++} ++ ++static PyObject * ++_pickle_load_impl(PyModuleDef *module, PyObject *file, int fix_imports, const char *encoding, const char *errors) ++/*[clinic checksum: b41f06970e57acf2fd602e4b7f88e3f3e1e53087]*/ ++{ + PyObject *result; +- char *encoding = NULL; +- char *errors = NULL; +- UnpicklerObject *unpickler; +- +- /* fix_imports, encoding and errors are a keyword-only argument. */ +- if (Py_SIZE(args) != 1) { +- PyErr_Format(PyExc_TypeError, +- "pickle.load() takes exactly one positional " +- "argument (%zd given)", Py_SIZE(args)); +- return NULL; +- } +- +- if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|Oss:load", kwlist, +- &file, &fix_imports, &encoding, &errors)) +- return NULL; +- +- unpickler = _Unpickler_New(); ++ UnpicklerObject *unpickler = _Unpickler_New(); ++ + if (unpickler == NULL) + return NULL; + +@@ -6755,9 +7342,7 @@ + if (_Unpickler_SetInputEncoding(unpickler, encoding, errors) < 0) + goto error; + +- unpickler->fix_imports = PyObject_IsTrue(fix_imports); +- if (unpickler->fix_imports == -1) +- goto error; ++ unpickler->fix_imports = fix_imports; + + result = load(unpickler); + Py_DECREF(unpickler); +@@ -6768,59 +7353,92 @@ + return NULL; + } + +-PyDoc_STRVAR(pickle_loads_doc, +-"loads(input, *, fix_imports=True, encoding='ASCII', errors='strict') -> object\n" ++/*[clinic] ++ ++_pickle.loads ++ ++ data: object ++ * ++ fix_imports: bool = True ++ encoding: str = 'ASCII' ++ errors: str = 'strict' ++ ++Read and return an object from the given pickle data. ++ ++The protocol version of the pickle is detected automatically, so no ++protocol argument is needed. Bytes past the pickled object's ++representation are ignored. ++ ++Optional keyword arguments are *fix_imports*, *encoding* and *errors*, ++which are used to control compatiblity support for pickle stream ++generated by Python 2. If *fix_imports* is True, pickle will try to ++map the old Python 2 names to the new names used in Python 3. The ++*encoding* and *errors* tell pickle how to decode 8-bit string ++instances pickled by Python 2; these default to 'ASCII' and 'strict', ++respectively. The *encoding* can be 'bytes' to read these 8-bit ++string instances as bytes objects. ++[clinic]*/ ++ ++PyDoc_STRVAR(_pickle_loads__doc__, ++"loads(data, *, fix_imports=True, encoding=\'ASCII\', errors=\'strict\')\n" ++"Read and return an object from the given pickle data.\n" + "\n" +-"Read a pickled object hierarchy from a bytes object and return the\n" +-"reconstituted object hierarchy specified therein\n" ++"The protocol version of the pickle is detected automatically, so no\n" ++"protocol argument is needed. Bytes past the pickled object\'s\n" ++"representation are ignored.\n" + "\n" +-"The protocol version of the pickle is detected automatically, so no protocol\n" +-"argument is needed. Bytes past the pickled object's representation are\n" +-"ignored.\n" +-"\n" +-"Optional keyword arguments are fix_imports, encoding and errors, which\n" +-"are used to control compatiblity support for pickle stream generated\n" +-"by Python 2.x. If fix_imports is True, pickle will try to map the old\n" +-"Python 2.x names to the new names used in Python 3.x. The encoding and\n" +-"errors tell pickle how to decode 8-bit string instances pickled by Python\n" +-"2.x; these default to 'ASCII' and 'strict', respectively.\n"); ++"Optional keyword arguments are *fix_imports*, *encoding* and *errors*,\n" ++"which are used to control compatiblity support for pickle stream\n" ++"generated by Python 2. If *fix_imports* is True, pickle will try to\n" ++"map the old Python 2 names to the new names used in Python 3. The\n" ++"*encoding* and *errors* tell pickle how to decode 8-bit string\n" ++"instances pickled by Python 2; these default to \'ASCII\' and \'strict\',\n" ++"respectively. The *encoding* can be \'bytes\' to read these 8-bit\n" ++"string instances as bytes objects."); ++ ++#define _PICKLE_LOADS_METHODDEF \ ++ {"loads", (PyCFunction)_pickle_loads, METH_VARARGS|METH_KEYWORDS, _pickle_loads__doc__}, + + static PyObject * +-pickle_loads(PyObject *self, PyObject *args, PyObject *kwds) +-{ +- static char *kwlist[] = {"input", "fix_imports", "encoding", "errors", 0}; +- PyObject *input; +- PyObject *fix_imports = Py_True; ++_pickle_loads_impl(PyModuleDef *module, PyObject *data, int fix_imports, const char *encoding, const char *errors); ++ ++static PyObject * ++_pickle_loads(PyModuleDef *module, PyObject *args, PyObject *kwargs) ++{ ++ PyObject *return_value = NULL; ++ static char *_keywords[] = {"data", "fix_imports", "encoding", "errors", NULL}; ++ PyObject *data; ++ int fix_imports = 1; ++ const char *encoding = "ASCII"; ++ const char *errors = "strict"; ++ ++ if (!PyArg_ParseTupleAndKeywords(args, kwargs, ++ "O|$pss:loads", _keywords, ++ &data, &fix_imports, &encoding, &errors)) ++ goto exit; ++ return_value = _pickle_loads_impl(module, data, fix_imports, encoding, errors); ++ ++exit: ++ return return_value; ++} ++ ++static PyObject * ++_pickle_loads_impl(PyModuleDef *module, PyObject *data, int fix_imports, const char *encoding, const char *errors) ++/*[clinic checksum: 0663de43aca6c21508a777e29d98c9c3a6e7f72d]*/ ++{ + PyObject *result; +- char *encoding = NULL; +- char *errors = NULL; +- UnpicklerObject *unpickler; +- +- /* fix_imports, encoding and errors are a keyword-only argument. */ +- if (Py_SIZE(args) != 1) { +- PyErr_Format(PyExc_TypeError, +- "pickle.loads() takes exactly one positional " +- "argument (%zd given)", Py_SIZE(args)); +- return NULL; +- } +- +- if (!PyArg_ParseTupleAndKeywords(args, kwds, "O|Oss:loads", kwlist, +- &input, &fix_imports, &encoding, &errors)) +- return NULL; +- +- unpickler = _Unpickler_New(); ++ UnpicklerObject *unpickler = _Unpickler_New(); ++ + if (unpickler == NULL) + return NULL; + +- if (_Unpickler_SetStringInput(unpickler, input) < 0) ++ if (_Unpickler_SetStringInput(unpickler, data) < 0) + goto error; + + if (_Unpickler_SetInputEncoding(unpickler, encoding, errors) < 0) + goto error; + +- unpickler->fix_imports = PyObject_IsTrue(fix_imports); +- if (unpickler->fix_imports == -1) +- goto error; ++ unpickler->fix_imports = fix_imports; + + result = load(unpickler); + Py_DECREF(unpickler); +@@ -6831,139 +7449,69 @@ + return NULL; + } + +- + static struct PyMethodDef pickle_methods[] = { +- {"dump", (PyCFunction)pickle_dump, METH_VARARGS|METH_KEYWORDS, +- pickle_dump_doc}, +- {"dumps", (PyCFunction)pickle_dumps, METH_VARARGS|METH_KEYWORDS, +- pickle_dumps_doc}, +- {"load", (PyCFunction)pickle_load, METH_VARARGS|METH_KEYWORDS, +- pickle_load_doc}, +- {"loads", (PyCFunction)pickle_loads, METH_VARARGS|METH_KEYWORDS, +- pickle_loads_doc}, ++ _PICKLE_DUMP_METHODDEF ++ _PICKLE_DUMPS_METHODDEF ++ _PICKLE_LOAD_METHODDEF ++ _PICKLE_LOADS_METHODDEF + {NULL, NULL} /* sentinel */ + }; + + static int +-initmodule(void) +-{ +- PyObject *copyreg = NULL; +- PyObject *compat_pickle = NULL; +- +- /* XXX: We should ensure that the types of the dictionaries imported are +- exactly PyDict objects. Otherwise, it is possible to crash the pickle +- since we use the PyDict API directly to access these dictionaries. */ +- +- copyreg = PyImport_ImportModule("copyreg"); +- if (!copyreg) +- goto error; +- dispatch_table = PyObject_GetAttrString(copyreg, "dispatch_table"); +- if (!dispatch_table) +- goto error; +- extension_registry = \ +- PyObject_GetAttrString(copyreg, "_extension_registry"); +- if (!extension_registry) +- goto error; +- inverted_registry = PyObject_GetAttrString(copyreg, "_inverted_registry"); +- if (!inverted_registry) +- goto error; +- extension_cache = PyObject_GetAttrString(copyreg, "_extension_cache"); +- if (!extension_cache) +- goto error; +- Py_CLEAR(copyreg); +- +- /* Load the 2.x -> 3.x stdlib module mapping tables */ +- compat_pickle = PyImport_ImportModule("_compat_pickle"); +- if (!compat_pickle) +- goto error; +- name_mapping_2to3 = PyObject_GetAttrString(compat_pickle, "NAME_MAPPING"); +- if (!name_mapping_2to3) +- goto error; +- if (!PyDict_CheckExact(name_mapping_2to3)) { +- PyErr_Format(PyExc_RuntimeError, +- "_compat_pickle.NAME_MAPPING should be a dict, not %.200s", +- Py_TYPE(name_mapping_2to3)->tp_name); +- goto error; +- } +- import_mapping_2to3 = PyObject_GetAttrString(compat_pickle, +- "IMPORT_MAPPING"); +- if (!import_mapping_2to3) +- goto error; +- if (!PyDict_CheckExact(import_mapping_2to3)) { +- PyErr_Format(PyExc_RuntimeError, +- "_compat_pickle.IMPORT_MAPPING should be a dict, " +- "not %.200s", Py_TYPE(import_mapping_2to3)->tp_name); +- goto error; +- } +- /* ... and the 3.x -> 2.x mapping tables */ +- name_mapping_3to2 = PyObject_GetAttrString(compat_pickle, +- "REVERSE_NAME_MAPPING"); +- if (!name_mapping_3to2) +- goto error; +- if (!PyDict_CheckExact(name_mapping_3to2)) { +- PyErr_Format(PyExc_RuntimeError, +- "_compat_pickle.REVERSE_NAME_MAPPING should be a dict, " +- "not %.200s", Py_TYPE(name_mapping_3to2)->tp_name); +- goto error; +- } +- import_mapping_3to2 = PyObject_GetAttrString(compat_pickle, +- "REVERSE_IMPORT_MAPPING"); +- if (!import_mapping_3to2) +- goto error; +- if (!PyDict_CheckExact(import_mapping_3to2)) { +- PyErr_Format(PyExc_RuntimeError, +- "_compat_pickle.REVERSE_IMPORT_MAPPING should be a dict, " +- "not %.200s", Py_TYPE(import_mapping_3to2)->tp_name); +- goto error; +- } +- Py_CLEAR(compat_pickle); +- +- empty_tuple = PyTuple_New(0); +- if (empty_tuple == NULL) +- goto error; +- two_tuple = PyTuple_New(2); +- if (two_tuple == NULL) +- goto error; +- /* We use this temp container with no regard to refcounts, or to +- * keeping containees alive. Exempt from GC, because we don't +- * want anything looking at two_tuple() by magic. +- */ +- PyObject_GC_UnTrack(two_tuple); +- ++pickle_clear(PyObject *m) ++{ ++ _Pickle_ClearState(_Pickle_GetState(m)); + return 0; +- +- error: +- Py_CLEAR(copyreg); +- Py_CLEAR(dispatch_table); +- Py_CLEAR(extension_registry); +- Py_CLEAR(inverted_registry); +- Py_CLEAR(extension_cache); +- Py_CLEAR(compat_pickle); +- Py_CLEAR(name_mapping_2to3); +- Py_CLEAR(import_mapping_2to3); +- Py_CLEAR(name_mapping_3to2); +- Py_CLEAR(import_mapping_3to2); +- Py_CLEAR(empty_tuple); +- Py_CLEAR(two_tuple); +- return -1; ++} ++ ++static void ++pickle_free(PyObject *m) ++{ ++ _Pickle_ClearState(_Pickle_GetState(m)); ++} ++ ++static int ++pickle_traverse(PyObject *m, visitproc visit, void *arg) ++{ ++ PickleState *st = _Pickle_GetState(m); ++ Py_VISIT(st->PickleError); ++ Py_VISIT(st->PicklingError); ++ Py_VISIT(st->UnpicklingError); ++ Py_VISIT(st->dispatch_table); ++ Py_VISIT(st->extension_registry); ++ Py_VISIT(st->extension_cache); ++ Py_VISIT(st->inverted_registry); ++ Py_VISIT(st->name_mapping_2to3); ++ Py_VISIT(st->import_mapping_2to3); ++ Py_VISIT(st->name_mapping_3to2); ++ Py_VISIT(st->import_mapping_3to2); ++ Py_VISIT(st->codecs_encode); ++ return 0; + } + + static struct PyModuleDef _picklemodule = { + PyModuleDef_HEAD_INIT, +- "_pickle", +- pickle_module_doc, +- -1, +- pickle_methods, +- NULL, +- NULL, +- NULL, +- NULL ++ "_pickle", /* m_name */ ++ pickle_module_doc, /* m_doc */ ++ sizeof(PickleState), /* m_size */ ++ pickle_methods, /* m_methods */ ++ NULL, /* m_reload */ ++ pickle_traverse, /* m_traverse */ ++ pickle_clear, /* m_clear */ ++ (freefunc)pickle_free /* m_free */ + }; + + PyMODINIT_FUNC + PyInit__pickle(void) + { + PyObject *m; ++ PickleState *st; ++ ++ m = PyState_FindModule(&_picklemodule); ++ if (m) { ++ Py_INCREF(m); ++ return m; ++ } + + if (PyType_Ready(&Unpickler_Type) < 0) + return NULL; +@@ -6988,27 +7536,32 @@ + if (PyModule_AddObject(m, "Unpickler", (PyObject *)&Unpickler_Type) < 0) + return NULL; + ++ st = _Pickle_GetState(m); ++ + /* Initialize the exceptions. */ +- PickleError = PyErr_NewException("_pickle.PickleError", NULL, NULL); +- if (PickleError == NULL) ++ st->PickleError = PyErr_NewException("_pickle.PickleError", NULL, NULL); ++ if (st->PickleError == NULL) + return NULL; +- PicklingError = \ +- PyErr_NewException("_pickle.PicklingError", PickleError, NULL); +- if (PicklingError == NULL) ++ st->PicklingError = \ ++ PyErr_NewException("_pickle.PicklingError", st->PickleError, NULL); ++ if (st->PicklingError == NULL) + return NULL; +- UnpicklingError = \ +- PyErr_NewException("_pickle.UnpicklingError", PickleError, NULL); +- if (UnpicklingError == NULL) ++ st->UnpicklingError = \ ++ PyErr_NewException("_pickle.UnpicklingError", st->PickleError, NULL); ++ if (st->UnpicklingError == NULL) + return NULL; + +- if (PyModule_AddObject(m, "PickleError", PickleError) < 0) ++ Py_INCREF(st->PickleError); ++ if (PyModule_AddObject(m, "PickleError", st->PickleError) < 0) + return NULL; +- if (PyModule_AddObject(m, "PicklingError", PicklingError) < 0) ++ Py_INCREF(st->PicklingError); ++ if (PyModule_AddObject(m, "PicklingError", st->PicklingError) < 0) + return NULL; +- if (PyModule_AddObject(m, "UnpicklingError", UnpicklingError) < 0) ++ Py_INCREF(st->UnpicklingError); ++ if (PyModule_AddObject(m, "UnpicklingError", st->UnpicklingError) < 0) + return NULL; + +- if (initmodule() < 0) ++ if (_Pickle_InitState(st) < 0) + return NULL; + + return m; +diff -r 3405dc9a6afa Modules/_sqlite/connection.c +--- a/Modules/_sqlite/connection.c ++++ b/Modules/_sqlite/connection.c +@@ -128,7 +128,10 @@ + Py_INCREF(isolation_level); + } + self->isolation_level = NULL; +- pysqlite_connection_set_isolation_level(self, isolation_level); ++ if (pysqlite_connection_set_isolation_level(self, isolation_level) < 0) { ++ Py_DECREF(isolation_level); ++ return -1; ++ } + Py_DECREF(isolation_level); + + self->statement_cache = (pysqlite_Cache*)PyObject_CallFunction((PyObject*)&pysqlite_CacheType, "Oi", self, cached_statements); +diff -r 3405dc9a6afa Modules/_ssl.c +--- a/Modules/_ssl.c ++++ b/Modules/_ssl.c +@@ -97,7 +97,7 @@ + # define HAVE_TLSv1_2 0 + #endif + +-/* SNI support (client- and server-side) appeared in OpenSSL 1.0.0. ++/* SNI support (client- and server-side) appeared in OpenSSL 1.0.0 and 0.9.8f + * This includes the SSL_set_SSL_CTX() function. + */ + #ifdef SSL_CTRL_SET_TLSEXT_HOSTNAME +@@ -214,6 +214,7 @@ + #ifndef OPENSSL_NO_TLSEXT + PyObject *set_hostname; + #endif ++ int check_hostname; + } PySSLContext; + + typedef struct { +@@ -2050,6 +2051,8 @@ + #ifndef OPENSSL_NO_TLSEXT + self->set_hostname = NULL; + #endif ++ /* Don't check host name by default */ ++ self->check_hostname = 0; + /* Defaults */ + SSL_CTX_set_verify(self->ctx, SSL_VERIFY_NONE, NULL); + SSL_CTX_set_options(self->ctx, +@@ -2231,6 +2234,12 @@ + "invalid value for verify_mode"); + return -1; + } ++ if (mode == SSL_VERIFY_NONE && self->check_hostname) { ++ PyErr_SetString(PyExc_ValueError, ++ "Cannot set verify_mode to CERT_NONE when " ++ "check_hostname is enabled."); ++ return -1; ++ } + SSL_CTX_set_verify(self->ctx, mode, NULL); + return 0; + } +@@ -2304,6 +2313,30 @@ + return 0; + } + ++static PyObject * ++get_check_hostname(PySSLContext *self, void *c) ++{ ++ return PyBool_FromLong(self->check_hostname); ++} ++ ++static int ++set_check_hostname(PySSLContext *self, PyObject *arg, void *c) ++{ ++ int check_hostname; ++ if (!PyArg_Parse(arg, "p", &check_hostname)) ++ return -1; ++ if (check_hostname && ++ SSL_CTX_get_verify_mode(self->ctx) == SSL_VERIFY_NONE) { ++ PyErr_SetString(PyExc_ValueError, ++ "check_hostname needs a SSL context with either " ++ "CERT_OPTIONAL or CERT_REQUIRED"); ++ return -1; ++ } ++ self->check_hostname = check_hostname; ++ return 0; ++} ++ ++ + typedef struct { + PyThreadState *thread_state; + PyObject *callable; +@@ -3093,6 +3126,8 @@ + + + static PyGetSetDef context_getsetlist[] = { ++ {"check_hostname", (getter) get_check_hostname, ++ (setter) set_check_hostname, NULL}, + {"options", (getter) get_options, + (setter) set_options, NULL}, + #ifdef HAVE_OPENSSL_VERIFY_PARAM +@@ -3209,6 +3244,11 @@ + const char *errstr; + PyObject *v; + ++ if (len < 0) { ++ PyErr_SetString(PyExc_ValueError, "num must be positive"); ++ return NULL; ++ } ++ + bytes = PyBytes_FromStringAndSize(NULL, len); + if (bytes == NULL) + return NULL; +diff -r 3405dc9a6afa Modules/_testcapimodule.c +--- a/Modules/_testcapimodule.c ++++ b/Modules/_testcapimodule.c +@@ -2869,6 +2869,96 @@ + "This docstring has a valid signature and some extra newlines." + ); + ++#ifdef WITH_THREAD ++typedef struct { ++ PyThread_type_lock start_event; ++ PyThread_type_lock exit_event; ++ PyObject *callback; ++} test_c_thread_t; ++ ++static void ++temporary_c_thread(void *data) ++{ ++ test_c_thread_t *test_c_thread = data; ++ PyGILState_STATE state; ++ PyObject *res; ++ ++ PyThread_release_lock(test_c_thread->start_event); ++ ++ /* Allocate a Python thread state for this thread */ ++ state = PyGILState_Ensure(); ++ ++ res = PyObject_CallFunction(test_c_thread->callback, "", NULL); ++ Py_CLEAR(test_c_thread->callback); ++ ++ if (res == NULL) { ++ PyErr_Print(); ++ } ++ else { ++ Py_DECREF(res); ++ } ++ ++ /* Destroy the Python thread state for this thread */ ++ PyGILState_Release(state); ++ ++ PyThread_release_lock(test_c_thread->exit_event); ++ ++ PyThread_exit_thread(); ++} ++ ++static PyObject * ++call_in_temporary_c_thread(PyObject *self, PyObject *callback) ++{ ++ PyObject *res = NULL; ++ test_c_thread_t test_c_thread; ++ long thread; ++ ++ PyEval_InitThreads(); ++ ++ test_c_thread.start_event = PyThread_allocate_lock(); ++ test_c_thread.exit_event = PyThread_allocate_lock(); ++ test_c_thread.callback = NULL; ++ if (!test_c_thread.start_event || !test_c_thread.exit_event) { ++ PyErr_SetString(PyExc_RuntimeError, "could not allocate lock"); ++ goto exit; ++ } ++ ++ Py_INCREF(callback); ++ test_c_thread.callback = callback; ++ ++ PyThread_acquire_lock(test_c_thread.start_event, 1); ++ PyThread_acquire_lock(test_c_thread.exit_event, 1); ++ ++ thread = PyThread_start_new_thread(temporary_c_thread, &test_c_thread); ++ if (thread == -1) { ++ PyErr_SetString(PyExc_RuntimeError, "unable to start the thread"); ++ PyThread_release_lock(test_c_thread.start_event); ++ PyThread_release_lock(test_c_thread.exit_event); ++ goto exit; ++ } ++ ++ PyThread_acquire_lock(test_c_thread.start_event, 1); ++ PyThread_release_lock(test_c_thread.start_event); ++ ++ Py_BEGIN_ALLOW_THREADS ++ PyThread_acquire_lock(test_c_thread.exit_event, 1); ++ PyThread_release_lock(test_c_thread.exit_event); ++ Py_END_ALLOW_THREADS ++ ++ Py_INCREF(Py_None); ++ res = Py_None; ++ ++exit: ++ Py_CLEAR(test_c_thread.callback); ++ if (test_c_thread.start_event) ++ PyThread_free_lock(test_c_thread.start_event); ++ if (test_c_thread.exit_event) ++ PyThread_free_lock(test_c_thread.exit_event); ++ return res; ++} ++#endif /* WITH_THREAD */ ++ ++ + static PyMethodDef TestMethods[] = { + {"raise_exception", raise_exception, METH_VARARGS}, + {"raise_memoryerror", (PyCFunction)raise_memoryerror, METH_NOARGS}, +@@ -2997,6 +3087,10 @@ + {"docstring_with_signature_and_extra_newlines", + (PyCFunction)test_with_docstring, METH_NOARGS, + docstring_with_signature_and_extra_newlines}, ++#ifdef WITH_THREAD ++ {"call_in_temporary_c_thread", call_in_temporary_c_thread, METH_O, ++ PyDoc_STR("set_error_class(error_class) -> None")}, ++#endif + {NULL, NULL} /* sentinel */ + }; + +diff -r 3405dc9a6afa Modules/_tracemalloc.c +--- a/Modules/_tracemalloc.c ++++ b/Modules/_tracemalloc.c +@@ -9,7 +9,6 @@ + + /* Forward declaration */ + static void tracemalloc_stop(void); +-static int tracemalloc_atexit_register(void); + static void* raw_malloc(size_t size); + static void raw_free(void *ptr); + +@@ -27,11 +26,6 @@ + PyMemAllocator obj; + } allocators; + +-/* Arbitrary limit of the number of frames in a traceback. The value was chosen +- to not allocate too much memory on the stack (see TRACEBACK_STACK_SIZE +- below). */ +-#define MAX_NFRAME 100 +- + static struct { + /* Module initialized? + Variable protected by the GIL */ +@@ -41,9 +35,6 @@ + TRACEMALLOC_FINALIZED + } initialized; + +- /* atexit handler registered? */ +- int atexit_registered; +- + /* Is tracemalloc tracing memory allocations? + Variable protected by the GIL */ + int tracing; +@@ -51,7 +42,7 @@ + /* limit of the number of frames in a traceback, 1 by default. + Variable protected by the GIL. */ + int max_nframe; +-} tracemalloc_config = {TRACEMALLOC_NOT_INITIALIZED, 0, 0, 1}; ++} tracemalloc_config = {TRACEMALLOC_NOT_INITIALIZED, 0, 1}; + + #if defined(TRACE_RAW_MALLOC) && defined(WITH_THREAD) + /* This lock is needed because tracemalloc_free() is called without +@@ -88,13 +79,19 @@ + + #define TRACEBACK_SIZE(NFRAME) \ + (sizeof(traceback_t) + sizeof(frame_t) * (NFRAME - 1)) +-#define TRACEBACK_STACK_SIZE TRACEBACK_SIZE(MAX_NFRAME) ++ ++#define MAX_NFRAME \ ++ ((INT_MAX - sizeof(traceback_t)) / sizeof(frame_t) + 1) + + static PyObject *unknown_filename = NULL; + static traceback_t tracemalloc_empty_traceback; + ++/* Trace of a memory block */ + typedef struct { ++ /* Size of the memory block in bytes */ + size_t size; ++ ++ /* Traceback where the memory block was allocated */ + traceback_t *traceback; + } trace_t; + +@@ -102,15 +99,19 @@ + Protected by TABLES_LOCK(). */ + static size_t tracemalloc_traced_memory = 0; + +-/* Maximum size in bytes of traced memory. ++/* Peak size in bytes of traced memory. + Protected by TABLES_LOCK(). */ +-static size_t tracemalloc_max_traced_memory = 0; ++static size_t tracemalloc_peak_traced_memory = 0; + + /* Hash table used as a set to to intern filenames: + PyObject* => PyObject*. + Protected by the GIL */ + static _Py_hashtable_t *tracemalloc_filenames = NULL; + ++/* Buffer to store a new traceback in traceback_new(). ++ Protected by the GIL. */ ++static traceback_t *tracemalloc_traceback = NULL; ++ + /* Hash table used as a set to intern tracebacks: + traceback_t* => traceback_t* + Protected by the GIL */ +@@ -164,16 +165,14 @@ + static void + set_reentrant(int reentrant) + { ++ assert(reentrant == 0 || reentrant == 1); + if (reentrant) { + assert(PyThread_get_key_value(tracemalloc_reentrant_key) == NULL); +- PyThread_set_key_value(tracemalloc_reentrant_key, +- REENTRANT); ++ PyThread_set_key_value(tracemalloc_reentrant_key, REENTRANT); + } + else { +- /* FIXME: PyThread_set_key_value() cannot be used to set the flag +- to zero, because it does nothing if the variable has already +- a value set. */ +- PyThread_delete_key_value(tracemalloc_reentrant_key); ++ assert(PyThread_get_key_value(tracemalloc_reentrant_key) == REENTRANT); ++ PyThread_set_key_value(tracemalloc_reentrant_key, NULL); + } + } + +@@ -279,7 +278,7 @@ + code = pyframe->f_code; + if (code == NULL) { + #ifdef TRACE_DEBUG +- tracemalloc_error("failed to get the code object of the a frame"); ++ tracemalloc_error("failed to get the code object of the frame"); + #endif + return; + } +@@ -337,8 +336,7 @@ + traceback_hash(traceback_t *traceback) + { + /* code based on tuplehash() of Objects/tupleobject.c */ +- Py_uhash_t x; /* Unsigned for defined overflow behavior. */ +- Py_hash_t y; ++ Py_uhash_t x, y; /* Unsigned for defined overflow behavior. */ + int len = traceback->nframe; + Py_uhash_t mult = _PyHASH_MULTIPLIER; + frame_t *frame; +@@ -346,13 +344,13 @@ + x = 0x345678UL; + frame = traceback->frames; + while (--len >= 0) { +- y = PyObject_Hash(frame->filename); +- y ^= frame->lineno; ++ y = (Py_uhash_t)PyObject_Hash(frame->filename); ++ y ^= (Py_uhash_t)frame->lineno; + frame++; + + x = (x ^ y) * mult; + /* the cast might truncate len; that doesn't change hash stability */ +- mult += (Py_hash_t)(82520UL + len + len); ++ mult += (Py_uhash_t)(82520UL + len + len); + } + x += 97531UL; + return x; +@@ -389,8 +387,7 @@ + static traceback_t * + traceback_new(void) + { +- char stack_buffer[TRACEBACK_STACK_SIZE]; +- traceback_t *traceback = (traceback_t *)stack_buffer; ++ traceback_t *traceback; + _Py_hashtable_entry_t *entry; + + #ifdef WITH_THREAD +@@ -398,6 +395,7 @@ + #endif + + /* get frames */ ++ traceback = tracemalloc_traceback; + traceback->nframe = 0; + traceback_get_frames(traceback); + if (traceback->nframe == 0) +@@ -437,7 +435,7 @@ + } + + static int +-tracemalloc_log_alloc(void *ptr, size_t size) ++tracemalloc_add_trace(void *ptr, size_t size) + { + traceback_t *traceback; + trace_t trace; +@@ -454,145 +452,91 @@ + trace.size = size; + trace.traceback = traceback; + +- TABLES_LOCK(); + res = _Py_HASHTABLE_SET(tracemalloc_traces, ptr, trace); + if (res == 0) { + assert(tracemalloc_traced_memory <= PY_SIZE_MAX - size); + tracemalloc_traced_memory += size; +- if (tracemalloc_traced_memory > tracemalloc_max_traced_memory) +- tracemalloc_max_traced_memory = tracemalloc_traced_memory; ++ if (tracemalloc_traced_memory > tracemalloc_peak_traced_memory) ++ tracemalloc_peak_traced_memory = tracemalloc_traced_memory; + } +- TABLES_UNLOCK(); + + return res; + } + + static void +-tracemalloc_log_free(void *ptr) ++tracemalloc_remove_trace(void *ptr) + { + trace_t trace; + +- TABLES_LOCK(); + if (_Py_hashtable_pop(tracemalloc_traces, ptr, &trace, sizeof(trace))) { + assert(tracemalloc_traced_memory >= trace.size); + tracemalloc_traced_memory -= trace.size; + } +- TABLES_UNLOCK(); + } + + static void* +-tracemalloc_malloc(void *ctx, size_t size, int gil_held) ++tracemalloc_malloc(void *ctx, size_t size) + { + PyMemAllocator *alloc = (PyMemAllocator *)ctx; +-#if defined(TRACE_RAW_MALLOC) && defined(WITH_THREAD) +- PyGILState_STATE gil_state; +-#endif + void *ptr; + +- if (get_reentrant()) { +- return alloc->malloc(alloc->ctx, size); ++ ptr = alloc->malloc(alloc->ctx, size); ++ if (ptr == NULL) ++ return NULL; ++ ++ TABLES_LOCK(); ++ if (tracemalloc_add_trace(ptr, size) < 0) { ++ /* Failed to allocate a trace for the new memory block */ ++ TABLES_UNLOCK(); ++ alloc->free(alloc->ctx, ptr); ++ return NULL; + } +- +- /* Ignore reentrant call. PyObjet_Malloc() calls PyMem_Malloc() +- for allocations larger than 512 bytes. PyGILState_Ensure() may call +- PyMem_RawMalloc() indirectly which would call PyGILState_Ensure() if +- reentrant are not disabled. */ +- set_reentrant(1); +-#ifdef WITH_THREAD +-#ifdef TRACE_RAW_MALLOC +- if (!gil_held) +- gil_state = PyGILState_Ensure(); +-#else +- assert(gil_held); +-#endif +-#endif +- ptr = alloc->malloc(alloc->ctx, size); +- +- if (ptr != NULL) { +- if (tracemalloc_log_alloc(ptr, size) < 0) { +- /* Memory allocation failed */ +- alloc->free(alloc->ctx, ptr); +- ptr = NULL; +- } +- } +- set_reentrant(0); +- +-#if defined(TRACE_RAW_MALLOC) && defined(WITH_THREAD) +- if (!gil_held) +- PyGILState_Release(gil_state); +-#endif +- ++ TABLES_UNLOCK(); + return ptr; + } + + static void* +-tracemalloc_realloc(void *ctx, void *ptr, size_t new_size, int gil_held) ++tracemalloc_realloc(void *ctx, void *ptr, size_t new_size) + { + PyMemAllocator *alloc = (PyMemAllocator *)ctx; +-#if defined(TRACE_RAW_MALLOC) && defined(WITH_THREAD) +- PyGILState_STATE gil_state; +-#endif + void *ptr2; + +- if (get_reentrant()) { +- /* Reentrant call to PyMem_Realloc() and PyMem_RawRealloc(). +- Example: PyMem_RawRealloc() is called internally by pymalloc +- (_PyObject_Malloc() and _PyObject_Realloc()) to allocate a new +- arena (new_arena()). */ +- ptr2 = alloc->realloc(alloc->ctx, ptr, new_size); ++ ptr2 = alloc->realloc(alloc->ctx, ptr, new_size); ++ if (ptr2 == NULL) ++ return NULL; + +- if (ptr2 != NULL && ptr != NULL) +- tracemalloc_log_free(ptr); ++ if (ptr != NULL) { ++ /* an existing memory block has been resized */ + +- return ptr2; ++ TABLES_LOCK(); ++ tracemalloc_remove_trace(ptr); ++ ++ if (tracemalloc_add_trace(ptr2, new_size) < 0) { ++ /* Memory allocation failed. The error cannot be reported to ++ the caller, because realloc() may already have shrinked the ++ memory block and so removed bytes. ++ ++ This case is very unlikely: an hash entry has just been ++ released, so the hash table should have at least one free entry. ++ ++ The GIL and the table lock ensures that only one thread is ++ allocating memory. */ ++ assert(0 && "should never happen"); ++ } ++ TABLES_UNLOCK(); + } ++ else { ++ /* new allocation */ + +- /* Ignore reentrant call. PyObjet_Realloc() calls PyMem_Realloc() for +- allocations larger than 512 bytes. PyGILState_Ensure() may call +- PyMem_RawMalloc() indirectly which would call PyGILState_Ensure() if +- reentrant are not disabled. */ +- set_reentrant(1); +-#ifdef WITH_THREAD +-#ifdef TRACE_RAW_MALLOC +- if (!gil_held) +- gil_state = PyGILState_Ensure(); +-#else +- assert(gil_held); +-#endif +-#endif +- ptr2 = alloc->realloc(alloc->ctx, ptr, new_size); +- +- if (ptr2 != NULL) { +- if (ptr != NULL) { +- /* resize */ +- tracemalloc_log_free(ptr); +- +- if (tracemalloc_log_alloc(ptr2, new_size) < 0) { +- /* Memory allocation failed. The error cannot be reported to +- the caller, because realloc() may already have shrinked the +- memory block and so removed bytes. +- +- This case is very unlikely since we just released an hash +- entry, so we have enough free bytes to allocate the new +- entry. */ +- } ++ TABLES_LOCK(); ++ if (tracemalloc_add_trace(ptr2, new_size) < 0) { ++ /* Failed to allocate a trace for the new memory block */ ++ TABLES_UNLOCK(); ++ alloc->free(alloc->ctx, ptr2); ++ return NULL; + } +- else { +- /* new allocation */ +- if (tracemalloc_log_alloc(ptr2, new_size) < 0) { +- /* Memory allocation failed */ +- alloc->free(alloc->ctx, ptr2); +- ptr2 = NULL; +- } +- } ++ TABLES_UNLOCK(); + } +- set_reentrant(0); +- +-#if defined(TRACE_RAW_MALLOC) && defined(WITH_THREAD) +- if (!gil_held) +- PyGILState_Release(gil_state); +-#endif +- + return ptr2; + } + +@@ -608,34 +552,135 @@ + a deadlock in PyThreadState_DeleteCurrent(). */ + + alloc->free(alloc->ctx, ptr); +- tracemalloc_log_free(ptr); ++ ++ TABLES_LOCK(); ++ tracemalloc_remove_trace(ptr); ++ TABLES_UNLOCK(); + } + + static void* + tracemalloc_malloc_gil(void *ctx, size_t size) + { +- return tracemalloc_malloc(ctx, size, 1); ++ void *ptr; ++ ++ if (get_reentrant()) { ++ PyMemAllocator *alloc = (PyMemAllocator *)ctx; ++ return alloc->malloc(alloc->ctx, size); ++ } ++ ++ /* Ignore reentrant call. PyObjet_Malloc() calls PyMem_Malloc() for ++ allocations larger than 512 bytes, don't trace the same memory ++ allocation twice. */ ++ set_reentrant(1); ++ ++ ptr = tracemalloc_malloc(ctx, size); ++ ++ set_reentrant(0); ++ return ptr; + } + + static void* + tracemalloc_realloc_gil(void *ctx, void *ptr, size_t new_size) + { +- return tracemalloc_realloc(ctx, ptr, new_size, 1); ++ void *ptr2; ++ ++ if (get_reentrant()) { ++ /* Reentrant call to PyMem_Realloc() and PyMem_RawRealloc(). ++ Example: PyMem_RawRealloc() is called internally by pymalloc ++ (_PyObject_Malloc() and _PyObject_Realloc()) to allocate a new ++ arena (new_arena()). */ ++ PyMemAllocator *alloc = (PyMemAllocator *)ctx; ++ ++ ptr2 = alloc->realloc(alloc->ctx, ptr, new_size); ++ if (ptr2 != NULL && ptr != NULL) { ++ TABLES_LOCK(); ++ tracemalloc_remove_trace(ptr); ++ TABLES_UNLOCK(); ++ } ++ return ptr2; ++ } ++ ++ /* Ignore reentrant call. PyObjet_Realloc() calls PyMem_Realloc() for ++ allocations larger than 512 bytes. Don't trace the same memory ++ allocation twice. */ ++ set_reentrant(1); ++ ++ ptr2 = tracemalloc_realloc(ctx, ptr, new_size); ++ ++ set_reentrant(0); ++ return ptr2; + } + + #ifdef TRACE_RAW_MALLOC + static void* + tracemalloc_raw_malloc(void *ctx, size_t size) + { +- return tracemalloc_malloc(ctx, size, 0); ++#ifdef WITH_THREAD ++ PyGILState_STATE gil_state; ++#endif ++ void *ptr; ++ ++ if (get_reentrant()) { ++ PyMemAllocator *alloc = (PyMemAllocator *)ctx; ++ return alloc->malloc(alloc->ctx, size); ++ } ++ ++ /* Ignore reentrant call. PyGILState_Ensure() may call PyMem_RawMalloc() ++ indirectly which would call PyGILState_Ensure() if reentrant are not ++ disabled. */ ++ set_reentrant(1); ++ ++#ifdef WITH_THREAD ++ gil_state = PyGILState_Ensure(); ++ ptr = tracemalloc_malloc(ctx, size); ++ PyGILState_Release(gil_state); ++#else ++ ptr = tracemalloc_malloc(ctx, size); ++#endif ++ ++ set_reentrant(0); ++ return ptr; + } + + static void* + tracemalloc_raw_realloc(void *ctx, void *ptr, size_t new_size) + { +- return tracemalloc_realloc(ctx, ptr, new_size, 0); ++#ifdef WITH_THREAD ++ PyGILState_STATE gil_state; ++#endif ++ void *ptr2; ++ ++ if (get_reentrant()) { ++ /* Reentrant call to PyMem_RawRealloc(). */ ++ PyMemAllocator *alloc = (PyMemAllocator *)ctx; ++ ++ ptr2 = alloc->realloc(alloc->ctx, ptr, new_size); ++ ++ if (ptr2 != NULL && ptr != NULL) { ++ TABLES_LOCK(); ++ tracemalloc_remove_trace(ptr); ++ TABLES_UNLOCK(); ++ } ++ return ptr2; ++ } ++ ++ /* Ignore reentrant call. PyGILState_Ensure() may call PyMem_RawMalloc() ++ indirectly which would call PyGILState_Ensure() if reentrant calls are ++ not disabled. */ ++ set_reentrant(1); ++ ++#ifdef WITH_THREAD ++ gil_state = PyGILState_Ensure(); ++ ptr2 = tracemalloc_realloc(ctx, ptr, new_size); ++ PyGILState_Release(gil_state); ++#else ++ ptr2 = tracemalloc_realloc(ctx, ptr, new_size); ++#endif ++ ++ set_reentrant(0); ++ return ptr2; + } +-#endif ++#endif /* TRACE_RAW_MALLOC */ + + static int + tracemalloc_clear_filename(_Py_hashtable_entry_t *entry, void *user_data) +@@ -669,7 +714,7 @@ + TABLES_LOCK(); + _Py_hashtable_clear(tracemalloc_traces); + tracemalloc_traced_memory = 0; +- tracemalloc_max_traced_memory = 0; ++ tracemalloc_peak_traced_memory = 0; + TABLES_UNLOCK(); + + _Py_hashtable_foreach(tracemalloc_tracebacks, traceback_free_traceback, NULL); +@@ -783,9 +828,10 @@ + } + + static int +-tracemalloc_start(void) ++tracemalloc_start(int max_nframe) + { + PyMemAllocator alloc; ++ size_t size; + + if (tracemalloc_init() < 0) + return -1; +@@ -795,8 +841,17 @@ + return 0; + } + +- if (tracemalloc_atexit_register() < 0) ++ assert(1 <= max_nframe && max_nframe <= MAX_NFRAME); ++ tracemalloc_config.max_nframe = max_nframe; ++ ++ /* allocate a buffer to store a new traceback */ ++ size = TRACEBACK_SIZE(max_nframe); ++ assert(tracemalloc_traceback == NULL); ++ tracemalloc_traceback = raw_malloc(size); ++ if (tracemalloc_traceback == NULL) { ++ PyErr_NoMemory(); + return -1; ++ } + + #ifdef TRACE_RAW_MALLOC + alloc.malloc = tracemalloc_raw_malloc; +@@ -849,9 +904,10 @@ + + /* release memory */ + tracemalloc_clear_traces(); ++ raw_free(tracemalloc_traceback); ++ tracemalloc_traceback = NULL; + } + +- + static PyObject* + lineno_as_obj(int lineno) + { +@@ -1018,7 +1074,7 @@ + } + + PyDoc_STRVAR(tracemalloc_get_traces_doc, +- "get_traces() -> list\n" ++ "_get_traces() -> list\n" + "\n" + "Get traces of all memory blocks allocated by Python.\n" + "Return a list of (size: int, traceback: tuple) tuples.\n" +@@ -1041,6 +1097,8 @@ + if (!tracemalloc_config.tracing) + return get_traces.list; + ++ /* the traceback hash table is used temporarily to intern traceback tuple ++ of (filename, lineno) tuples */ + get_traces.tracebacks = hashtable_new(sizeof(PyObject *), + _Py_hashtable_hash_ptr, + _Py_hashtable_compare_direct); +@@ -1083,7 +1141,7 @@ + } + + PyDoc_STRVAR(tracemalloc_get_object_traceback_doc, +- "get_object_traceback(obj)\n" ++ "_get_object_traceback(obj)\n" + "\n" + "Get the traceback where the Python object obj was allocated.\n" + "Return a tuple of (filename: str, lineno: int) tuples.\n" +@@ -1118,65 +1176,6 @@ + return traceback_to_pyobject(trace.traceback, NULL); + } + +-static PyObject* +-tracemalloc_atexit(PyObject *self) +-{ +-#ifdef WITH_THREAD +- assert(PyGILState_Check()); +-#endif +- tracemalloc_deinit(); +- Py_RETURN_NONE; +-} +- +-static PyMethodDef atexit_method = { +- "_atexit", (PyCFunction)tracemalloc_atexit, METH_NOARGS, NULL}; +- +-static int +-tracemalloc_atexit_register(void) +-{ +- PyObject *method = NULL, *atexit = NULL, *func = NULL; +- PyObject *result; +- int ret = -1; +- +- if (tracemalloc_config.atexit_registered) +- return 0; +- tracemalloc_config.atexit_registered = 1; +- +- /* private functions */ +- method = PyCFunction_New(&atexit_method, NULL); +- if (method == NULL) +- goto done; +- +- atexit = PyImport_ImportModule("atexit"); +- if (atexit == NULL) { +- if (!PyErr_Warn(PyExc_ImportWarning, +- "atexit module is missing: " +- "cannot automatically disable tracemalloc at exit")) +- { +- PyErr_Clear(); +- return 0; +- } +- goto done; +- } +- +- func = PyObject_GetAttrString(atexit, "register"); +- if (func == NULL) +- goto done; +- +- result = PyObject_CallFunction(func, "O", method); +- if (result == NULL) +- goto done; +- Py_DECREF(result); +- +- ret = 0; +- +-done: +- Py_XDECREF(method); +- Py_XDECREF(func); +- Py_XDECREF(atexit); +- return ret; +-} +- + PyDoc_STRVAR(tracemalloc_start_doc, + "start(nframe: int=1)\n" + "\n" +@@ -1187,6 +1186,7 @@ + py_tracemalloc_start(PyObject *self, PyObject *args) + { + Py_ssize_t nframe = 1; ++ int nframe_int; + + if (!PyArg_ParseTuple(args, "|n:start", &nframe)) + return NULL; +@@ -1194,12 +1194,12 @@ + if (nframe < 1 || nframe > MAX_NFRAME) { + PyErr_Format(PyExc_ValueError, + "the number of frames must be in range [1; %i]", +- MAX_NFRAME); ++ (int)MAX_NFRAME); + return NULL; + } +- tracemalloc_config.max_nframe = Py_SAFE_DOWNCAST(nframe, Py_ssize_t, int); ++ nframe_int = Py_SAFE_DOWNCAST(nframe, Py_ssize_t, int); + +- if (tracemalloc_start() < 0) ++ if (tracemalloc_start(nframe_int) < 0) + return NULL; + + Py_RETURN_NONE; +@@ -1257,28 +1257,28 @@ + } + + PyDoc_STRVAR(tracemalloc_get_traced_memory_doc, +- "get_traced_memory() -> int\n" ++ "get_traced_memory() -> (int, int)\n" + "\n" +- "Get the current size and maximum size of memory blocks traced\n" +- "by the tracemalloc module as a tuple: (size: int, max_size: int)."); ++ "Get the current size and peak size of memory blocks traced\n" ++ "by the tracemalloc module as a tuple: (current: int, peak: int)."); + + static PyObject* + tracemalloc_get_traced_memory(PyObject *self) + { +- Py_ssize_t size, max_size; +- PyObject *size_obj, *max_size_obj; ++ Py_ssize_t size, peak_size; ++ PyObject *size_obj, *peak_size_obj; + + if (!tracemalloc_config.tracing) + return Py_BuildValue("ii", 0, 0); + + TABLES_LOCK(); + size = tracemalloc_traced_memory; +- max_size = tracemalloc_max_traced_memory; ++ peak_size = tracemalloc_peak_traced_memory; + TABLES_UNLOCK(); + + size_obj = PyLong_FromSize_t(size); +- max_size_obj = PyLong_FromSize_t(max_size); +- return Py_BuildValue("NN", size_obj, max_size_obj); ++ peak_size_obj = PyLong_FromSize_t(peak_size); ++ return Py_BuildValue("NN", size_obj, peak_size_obj); + } + + static PyMethodDef module_methods[] = { +@@ -1371,16 +1371,16 @@ + + if ((p = Py_GETENV("PYTHONTRACEMALLOC")) && *p != '\0') { + char *endptr = p; +- unsigned long value; ++ long value; + +- value = strtoul(p, &endptr, 10); ++ errno = 0; ++ value = strtol(p, &endptr, 10); + if (*endptr != '\0' + || value < 1 + || value > MAX_NFRAME +- || (errno == ERANGE && value == ULONG_MAX)) ++ || errno == ERANGE) + { +- Py_FatalError("PYTHONTRACEMALLOC must be an integer " +- "in range [1; " STR(MAX_NFRAME) "]"); ++ Py_FatalError("PYTHONTRACEMALLOC: invalid number of frames"); + return -1; + } + +@@ -1410,12 +1410,19 @@ + nframe = parse_sys_xoptions(value); + Py_DECREF(value); + if (nframe < 0) { +- Py_FatalError("-X tracemalloc=NFRAME: number of frame must be " +- "an integer in range [1; " STR(MAX_NFRAME) "]"); ++ Py_FatalError("-X tracemalloc=NFRAME: invalid number of frames"); + } + } + +- tracemalloc_config.max_nframe = nframe; +- return tracemalloc_start(); ++ return tracemalloc_start(nframe); + } + ++void ++_PyTraceMalloc_Fini(void) ++{ ++#ifdef WITH_THREAD ++ assert(PyGILState_Check()); ++#endif ++ tracemalloc_deinit(); ++} ++ +diff -r 3405dc9a6afa Modules/arraymodule.c +--- a/Modules/arraymodule.c ++++ b/Modules/arraymodule.c +@@ -2518,6 +2518,20 @@ + if (!PyArg_ParseTuple(args, "C|O:array", &c, &initial)) + return NULL; + ++ if (initial && c != 'u') { ++ if (PyUnicode_Check(initial)) { ++ PyErr_Format(PyExc_TypeError, "cannot use a str to initialize " ++ "an array with typecode '%c'", c); ++ return NULL; ++ } ++ else if (array_Check(initial) && ++ ((arrayobject*)initial)->ob_descr->typecode == 'u') { ++ PyErr_Format(PyExc_TypeError, "cannot use a unicode array to " ++ "initialize an array with typecode '%c'", c); ++ return NULL; ++ } ++ } ++ + if (!(initial == NULL || PyList_Check(initial) + || PyByteArray_Check(initial) + || PyBytes_Check(initial) +@@ -2644,9 +2658,19 @@ + "This module defines an object type which can efficiently represent\n\ + an array of basic values: characters, integers, floating point\n\ + numbers. Arrays are sequence types and behave very much like lists,\n\ +-except that the type of objects stored in them is constrained. The\n\ +-type is specified at object creation time by using a type code, which\n\ +-is a single character. The following type codes are defined:\n\ ++except that the type of objects stored in them is constrained.\n"); ++ ++PyDoc_STRVAR(arraytype_doc, ++"array(typecode [, initializer]) -> array\n\ ++\n\ ++Return a new array whose items are restricted by typecode, and\n\ ++initialized from the optional initializer value, which must be a list,\n\ ++string or iterable over elements of the appropriate type.\n\ ++\n\ ++Arrays represent basic values and behave very much like lists, except\n\ ++the type of objects stored in them is constrained. The type is specified\n\ ++at object creation time by using a type code, which is a single character.\n\ ++The following type codes are defined:\n\ + \n\ + Type code C Type Minimum size in bytes \n\ + 'b' signed integer 1 \n\ +@@ -2670,21 +2694,6 @@ + C compiler used to build Python supports 'long long', or, on Windows, \n\ + '__int64'.\n\ + \n\ +-The constructor is:\n\ +-\n\ +-array(typecode [, initializer]) -- create a new array\n\ +-"); +- +-PyDoc_STRVAR(arraytype_doc, +-"array(typecode [, initializer]) -> array\n\ +-\n\ +-Return a new array whose items are restricted by typecode, and\n\ +-initialized from the optional initializer value, which must be a list,\n\ +-string or iterable over elements of the appropriate type.\n\ +-\n\ +-Arrays represent basic values and behave very much like lists, except\n\ +-the type of objects stored in them is constrained.\n\ +-\n\ + Methods:\n\ + \n\ + append() -- append a new item to the end of the array\n\ +diff -r 3405dc9a6afa Modules/expat/xmlparse.c +--- a/Modules/expat/xmlparse.c ++++ b/Modules/expat/xmlparse.c +@@ -2,12 +2,6 @@ + See the file COPYING for copying permission. + */ + +-#include +-#include /* memset(), memcpy() */ +-#include +-#include /* UINT_MAX */ +-#include /* time() */ +- + #define XML_BUILDING_EXPAT 1 + + #ifdef COMPILED_FROM_DSP +@@ -22,6 +16,12 @@ + #include + #endif /* ndef COMPILED_FROM_DSP */ + ++#include ++#include /* memset(), memcpy() */ ++#include ++#include /* UINT_MAX */ ++#include /* time() */ ++ + #include "ascii.h" + #include "expat.h" + +diff -r 3405dc9a6afa Modules/expat/xmlrole.c +--- a/Modules/expat/xmlrole.c ++++ b/Modules/expat/xmlrole.c +@@ -2,8 +2,6 @@ + See the file COPYING for copying permission. + */ + +-#include +- + #ifdef COMPILED_FROM_DSP + #include "winconfig.h" + #elif defined(MACOS_CLASSIC) +@@ -18,6 +16,8 @@ + #endif + #endif /* ndef COMPILED_FROM_DSP */ + ++#include ++ + #include "expat_external.h" + #include "internal.h" + #include "xmlrole.h" +diff -r 3405dc9a6afa Modules/expat/xmltok.c +--- a/Modules/expat/xmltok.c ++++ b/Modules/expat/xmltok.c +@@ -2,8 +2,6 @@ + See the file COPYING for copying permission. + */ + +-#include +- + #ifdef COMPILED_FROM_DSP + #include "winconfig.h" + #elif defined(MACOS_CLASSIC) +@@ -18,6 +16,8 @@ + #endif + #endif /* ndef COMPILED_FROM_DSP */ + ++#include ++ + #include "expat_external.h" + #include "internal.h" + #include "xmltok.h" +diff -r 3405dc9a6afa Modules/faulthandler.c +--- a/Modules/faulthandler.c ++++ b/Modules/faulthandler.c +@@ -303,7 +303,7 @@ + return; + } + #endif +- /* call the previous signal handler: it is called immediatly if we use ++ /* call the previous signal handler: it is called immediately if we use + sigaction() thanks to SA_NODEFER flag, otherwise it is deferred */ + raise(signum); + } +diff -r 3405dc9a6afa Modules/fcntlmodule.c +--- a/Modules/fcntlmodule.c ++++ b/Modules/fcntlmodule.c +@@ -208,11 +208,7 @@ + return NULL; + } + Py_BEGIN_ALLOW_THREADS +-#ifdef __VMS +- ret = ioctl(fd, code, (void *)arg); +-#else + ret = ioctl(fd, code, arg); +-#endif + Py_END_ALLOW_THREADS + if (ret < 0) { + PyErr_SetFromErrno(PyExc_IOError); +@@ -628,6 +624,8 @@ + return NULL; + + /* Add some symbolic constants to the module */ +- all_ins(m); ++ if (all_ins(m) < 0) ++ return NULL; ++ + return m; + } +diff -r 3405dc9a6afa Modules/fpectlmodule.c +--- a/Modules/fpectlmodule.c ++++ b/Modules/fpectlmodule.c +@@ -70,10 +70,6 @@ + + #if defined(__FreeBSD__) + # include +-#elif defined(__VMS) +-#define __NEW_STARLET +-#include +-#include + #endif + + #ifndef WANT_SIGFPE_HANDLER +@@ -182,23 +178,6 @@ + ieee_set_fp_control(fp_control); + PyOS_setsig(SIGFPE, handler); + +-/*-- DEC ALPHA VMS --------------------------------------------------------*/ +-#elif defined(__ALPHA) && defined(__VMS) +- IEEE clrmsk; +- IEEE setmsk; +- clrmsk.ieee$q_flags = +- IEEE$M_TRAP_ENABLE_UNF | IEEE$M_TRAP_ENABLE_INE | +- IEEE$M_MAP_UMZ; +- setmsk.ieee$q_flags = +- IEEE$M_TRAP_ENABLE_INV | IEEE$M_TRAP_ENABLE_DZE | +- IEEE$M_TRAP_ENABLE_OVF; +- sys$ieee_set_fp_control(&clrmsk, &setmsk, 0); +- PyOS_setsig(SIGFPE, handler); +- +-/*-- HP IA64 VMS --------------------------------------------------------*/ +-#elif defined(__ia64) && defined(__VMS) +- PyOS_setsig(SIGFPE, handler); +- + /*-- Cray Unicos ----------------------------------------------------------*/ + #elif defined(cray) + /* UNICOS delivers SIGFPE by default, but no matherr */ +@@ -251,14 +230,6 @@ + #ifdef __FreeBSD__ + fpresetsticky(fpgetsticky()); + fpsetmask(0); +-#elif defined(__VMS) +- IEEE clrmsk; +- clrmsk.ieee$q_flags = +- IEEE$M_TRAP_ENABLE_UNF | IEEE$M_TRAP_ENABLE_INE | +- IEEE$M_MAP_UMZ | IEEE$M_TRAP_ENABLE_INV | +- IEEE$M_TRAP_ENABLE_DZE | IEEE$M_TRAP_ENABLE_OVF | +- IEEE$M_INHERIT; +- sys$ieee_set_fp_control(&clrmsk, 0, 0); + #else + fputs("Operation not implemented\n", stderr); + #endif +diff -r 3405dc9a6afa Modules/gcmodule.c +--- a/Modules/gcmodule.c ++++ b/Modules/gcmodule.c +@@ -1498,6 +1498,7 @@ + "isenabled() -- Returns true if automatic collection is enabled.\n" + "collect() -- Do a full collection right now.\n" + "get_count() -- Return the current collection counts.\n" ++"get_stats() -- Return list of dictionaries containing per-generation stats.\n" + "set_debug() -- Set debugging flags.\n" + "get_debug() -- Get debugging flags.\n" + "set_threshold() -- Set the collection thresholds.\n" +diff -r 3405dc9a6afa Modules/getpath.c +--- a/Modules/getpath.c ++++ b/Modules/getpath.c +@@ -110,11 +110,7 @@ + #endif + + #ifndef PREFIX +-# ifdef __VMS +-# define PREFIX "" +-# else +-# define PREFIX "/usr/local" +-# endif ++# define PREFIX "/usr/local" + #endif + + #ifndef EXEC_PREFIX +diff -r 3405dc9a6afa Modules/grpmodule.c +--- a/Modules/grpmodule.c ++++ b/Modules/grpmodule.c +@@ -58,17 +58,12 @@ + + #define SET(i,val) PyStructSequence_SET_ITEM(v, i, val) + SET(setIndex++, PyUnicode_DecodeFSDefault(p->gr_name)); +-#ifdef __VMS +- SET(setIndex++, Py_None); +- Py_INCREF(Py_None); +-#else + if (p->gr_passwd) + SET(setIndex++, PyUnicode_DecodeFSDefault(p->gr_passwd)); + else { + SET(setIndex++, Py_None); + Py_INCREF(Py_None); + } +-#endif + SET(setIndex++, _PyLong_FromGid(p->gr_gid)); + SET(setIndex++, w); + #undef SET +diff -r 3405dc9a6afa Modules/itertoolsmodule.c +--- a/Modules/itertoolsmodule.c ++++ b/Modules/itertoolsmodule.c +@@ -2057,6 +2057,18 @@ + Py_TYPE(lz)->tp_free(lz); + } + ++static PyObject * ++product_sizeof(productobject *lz, void *unused) ++{ ++ Py_ssize_t res; ++ ++ res = sizeof(productobject); ++ res += PyTuple_GET_SIZE(lz->pools) * sizeof(Py_ssize_t); ++ return PyLong_FromSsize_t(res); ++} ++ ++PyDoc_STRVAR(sizeof_doc, "Returns size in memory, in bytes."); ++ + static int + product_traverse(productobject *lz, visitproc visit, void *arg) + { +@@ -2226,6 +2238,8 @@ + reduce_doc}, + {"__setstate__", (PyCFunction)product_setstate, METH_O, + setstate_doc}, ++ {"__sizeof__", (PyCFunction)product_sizeof, METH_NOARGS, ++ sizeof_doc}, + {NULL, NULL} /* sentinel */ + }; + +@@ -2366,6 +2380,16 @@ + Py_TYPE(co)->tp_free(co); + } + ++static PyObject * ++combinations_sizeof(combinationsobject *co, void *unused) ++{ ++ Py_ssize_t res; ++ ++ res = sizeof(combinationsobject); ++ res += co->r * sizeof(Py_ssize_t); ++ return PyLong_FromSsize_t(res); ++} ++ + static int + combinations_traverse(combinationsobject *co, visitproc visit, void *arg) + { +@@ -2537,6 +2561,8 @@ + reduce_doc}, + {"__setstate__", (PyCFunction)combinations_setstate, METH_O, + setstate_doc}, ++ {"__sizeof__", (PyCFunction)combinations_sizeof, METH_NOARGS, ++ sizeof_doc}, + {NULL, NULL} /* sentinel */ + }; + +@@ -2695,6 +2721,16 @@ + Py_TYPE(co)->tp_free(co); + } + ++static PyObject * ++cwr_sizeof(cwrobject *co, void *unused) ++{ ++ Py_ssize_t res; ++ ++ res = sizeof(cwrobject); ++ res += co->r * sizeof(Py_ssize_t); ++ return PyLong_FromSsize_t(res); ++} ++ + static int + cwr_traverse(cwrobject *co, visitproc visit, void *arg) + { +@@ -2854,6 +2890,8 @@ + reduce_doc}, + {"__setstate__", (PyCFunction)cwr_setstate, METH_O, + setstate_doc}, ++ {"__sizeof__", (PyCFunction)cwr_sizeof, METH_NOARGS, ++ sizeof_doc}, + {NULL, NULL} /* sentinel */ + }; + +@@ -3030,6 +3068,17 @@ + Py_TYPE(po)->tp_free(po); + } + ++static PyObject * ++permutations_sizeof(permutationsobject *po, void *unused) ++{ ++ Py_ssize_t res; ++ ++ res = sizeof(permutationsobject); ++ res += PyTuple_GET_SIZE(po->pool) * sizeof(Py_ssize_t); ++ res += po->r * sizeof(Py_ssize_t); ++ return PyLong_FromSsize_t(res); ++} ++ + static int + permutations_traverse(permutationsobject *po, visitproc visit, void *arg) + { +@@ -3235,6 +3284,8 @@ + reduce_doc}, + {"__setstate__", (PyCFunction)permutations_setstate, METH_O, + setstate_doc}, ++ {"__sizeof__", (PyCFunction)permutations_sizeof, METH_NOARGS, ++ sizeof_doc}, + {NULL, NULL} /* sentinel */ + }; + +diff -r 3405dc9a6afa Modules/main.c +--- a/Modules/main.c ++++ b/Modules/main.c +@@ -5,11 +5,6 @@ + + #include + +-#ifdef __VMS +-#error "PEP 11: VMS is now unsupported, code will be removed in Python 3.4" +-#include +-#endif +- + #if defined(MS_WINDOWS) || defined(__CYGWIN__) + #include + #ifdef HAVE_FCNTL_H +@@ -124,19 +119,7 @@ + fprintf(f, usage_5, DELIM, PYTHONHOMEHELP); + fputs(usage_6, f); + } +-#if defined(__VMS) +- if (exitcode == 0) { +- /* suppress 'error' message */ +- return 1; +- } +- else { +- /* STS$M_INHIB_MSG + SS$_ABORT */ +- return 0x1000002c; +- } +-#else + return exitcode; +-#endif +- /*NOTREACHED*/ + } + + static void RunStartupFile(PyCompilerFlags *cf) +@@ -580,14 +563,7 @@ + if (command == NULL && module == NULL && _PyOS_optind < argc && + wcscmp(argv[_PyOS_optind], L"-") != 0) + { +-#ifdef __VMS +- filename = decc$translate_vms(argv[_PyOS_optind]); +- if (filename == (char *)0 || filename == (char *)-1) +- filename = argv[_PyOS_optind]; +- +-#else + filename = argv[_PyOS_optind]; +-#endif + } + + stdin_is_interactive = Py_FdIsInteractive(stdin, (char *)0); +@@ -623,11 +599,6 @@ + #endif /* !MS_WINDOWS */ + /* Leave stderr alone - it should be unbuffered anyway. */ + } +-#ifdef __VMS +- else { +- setvbuf (stdout, (char *)NULL, _IOLBF, BUFSIZ); +- } +-#endif /* __VMS */ + + #ifdef __APPLE__ + /* On MacOS X, when the Python interpreter is embedded in an +diff -r 3405dc9a6afa Modules/mmapmodule.c +--- a/Modules/mmapmodule.c ++++ b/Modules/mmapmodule.c +@@ -1158,12 +1158,6 @@ + (void)fcntl(fd, F_FULLFSYNC); + #endif + #ifdef HAVE_FSTAT +-# ifdef __VMS +- /* on OpenVMS we must ensure that all bytes are written to the file */ +- if (fd != -1) { +- fsync(fd); +- } +-# endif + if (fd != -1 && fstat(fd, &st) == 0 && S_ISREG(st.st_mode)) { + if (map_size == 0) { + if (st.st_size == 0) { +diff -r 3405dc9a6afa Modules/ossaudiodev.c +--- a/Modules/ossaudiodev.c ++++ b/Modules/ossaudiodev.c +@@ -564,7 +564,6 @@ + { + int wanted_fmt, wanted_channels, wanted_rate, strict=0; + int fmt, channels, rate; +- PyObject * rv; /* return tuple (fmt, channels, rate) */ + + if (!_is_fd_valid(self->fd)) + return NULL; +@@ -609,13 +608,7 @@ + + /* Construct the return value: a (fmt, channels, rate) tuple that + tells what the audio hardware was actually set to. */ +- rv = PyTuple_New(3); +- if (rv == NULL) +- return NULL; +- PyTuple_SET_ITEM(rv, 0, PyLong_FromLong(fmt)); +- PyTuple_SET_ITEM(rv, 1, PyLong_FromLong(channels)); +- PyTuple_SET_ITEM(rv, 2, PyLong_FromLong(rate)); +- return rv; ++ return Py_BuildValue("(iii)", fmt, channels, rate); + } + + static int +diff -r 3405dc9a6afa Modules/posixmodule.c +--- a/Modules/posixmodule.c ++++ b/Modules/posixmodule.c +@@ -29,11 +29,6 @@ + #include "posixmodule.h" + #endif + +-#if defined(__VMS) +-# error "PEP 11: VMS is now unsupported, code will be removed in Python 3.4" +-# include +-#endif /* defined(__VMS) */ +- + #ifdef __cplusplus + extern "C" { + #endif +@@ -164,9 +159,6 @@ + #define HAVE_FSYNC 1 + #define fsync _commit + #else +-#if defined(__VMS) +-/* Everything needed is defined in vms/pyconfig.h */ +-#else /* all other compilers */ + /* Unix functions that the configure script doesn't check for */ + #define HAVE_EXECV 1 + #define HAVE_FORK 1 +@@ -184,7 +176,6 @@ + #define HAVE_SYSTEM 1 + #define HAVE_WAIT 1 + #define HAVE_TTYNAME 1 +-#endif /* __VMS */ + #endif /* _MSC_VER */ + #endif /* __BORLANDC__ */ + #endif /* ! __WATCOMC__ || __QNX__ */ +@@ -385,6 +376,8 @@ + #endif + #endif + ++#define DWORD_MAX 4294967295U ++ + + #ifdef MS_WINDOWS + static int +@@ -897,7 +890,7 @@ + + length = PyBytes_GET_SIZE(bytes); + #ifdef MS_WINDOWS +- if (length > MAX_PATH) { ++ if (length > MAX_PATH-1) { + FORMAT_EXCEPTION(PyExc_ValueError, "%s too long for Windows"); + Py_DECREF(bytes); + return 0; +@@ -1376,18 +1369,18 @@ + static BOOL __stdcall + win32_chdir(LPCSTR path) + { +- char new_path[MAX_PATH+1]; ++ char new_path[MAX_PATH]; + int result; + char env[4] = "=x:"; + + if(!SetCurrentDirectoryA(path)) + return FALSE; +- result = GetCurrentDirectoryA(MAX_PATH+1, new_path); ++ result = GetCurrentDirectoryA(Py_ARRAY_LENGTH(new_path), new_path); + if (!result) + return FALSE; + /* In the ANSI API, there should not be any paths longer +- than MAX_PATH. */ +- assert(result <= MAX_PATH+1); ++ than MAX_PATH-1 (not including the final null character). */ ++ assert(result < Py_ARRAY_LENGTH(new_path)); + if (strncmp(new_path, "\\\\", 2) == 0 || + strncmp(new_path, "//", 2) == 0) + /* UNC path, nothing to do. */ +@@ -1401,16 +1394,16 @@ + static BOOL __stdcall + win32_wchdir(LPCWSTR path) + { +- wchar_t _new_path[MAX_PATH+1], *new_path = _new_path; ++ wchar_t _new_path[MAX_PATH], *new_path = _new_path; + int result; + wchar_t env[4] = L"=x:"; + + if(!SetCurrentDirectoryW(path)) + return FALSE; +- result = GetCurrentDirectoryW(MAX_PATH+1, new_path); ++ result = GetCurrentDirectoryW(Py_ARRAY_LENGTH(new_path), new_path); + if (!result) + return FALSE; +- if (result > MAX_PATH+1) { ++ if (result > Py_ARRAY_LENGTH(new_path)) { + new_path = PyMem_RawMalloc(result * sizeof(wchar_t)); + if (!new_path) { + SetLastError(ERROR_OUTOFMEMORY); +@@ -1664,7 +1657,7 @@ + /* FILE_FLAG_BACKUP_SEMANTICS is required to open a directory */ + /* FILE_FLAG_OPEN_REPARSE_POINT does not follow the symlink. + Because of this, calls like GetFinalPathNameByHandle will return +- the symlink path agin and not the actual final path. */ ++ the symlink path again and not the actual final path. */ + FILE_ATTRIBUTE_NORMAL|FILE_FLAG_BACKUP_SEMANTICS| + FILE_FLAG_OPEN_REPARSE_POINT, + NULL); +@@ -1760,7 +1753,7 @@ + /* FILE_FLAG_BACKUP_SEMANTICS is required to open a directory */ + /* FILE_FLAG_OPEN_REPARSE_POINT does not follow the symlink. + Because of this, calls like GetFinalPathNameByHandle will return +- the symlink path agin and not the actual final path. */ ++ the symlink path again and not the actual final path. */ + FILE_ATTRIBUTE_NORMAL|FILE_FLAG_BACKUP_SEMANTICS| + FILE_FLAG_OPEN_REPARSE_POINT, + NULL); +@@ -2763,17 +2756,7 @@ + { + char *ret; + +-#if defined(__VMS) +- /* file descriptor 0 only, the default input device (stdin) */ +- if (fd == 0) { +- ret = ttyname(); +- } +- else { +- ret = NULL; +- } +-#else + ret = ttyname(fd); +-#endif + if (ret == NULL) + posix_error(); + return ret; +@@ -3396,11 +3379,11 @@ + PyObject *resobj; + DWORD len; + Py_BEGIN_ALLOW_THREADS +- len = GetCurrentDirectoryW(sizeof wbuf/ sizeof wbuf[0], wbuf); ++ len = GetCurrentDirectoryW(Py_ARRAY_LENGTH(wbuf), wbuf); + /* If the buffer is large enough, len does not include the + terminating \0. If the buffer is too small, len includes + the space needed for the terminator. */ +- if (len >= sizeof wbuf/ sizeof wbuf[0]) { ++ if (len >= Py_ARRAY_LENGTH(wbuf)) { + wbuf2 = PyMem_RawMalloc(len * sizeof(wchar_t)); + if (wbuf2) + len = GetCurrentDirectoryW(len, wbuf2); +@@ -3581,10 +3564,10 @@ + HANDLE hFindFile = INVALID_HANDLE_VALUE; + BOOL result; + WIN32_FIND_DATA FileData; +- char namebuf[MAX_PATH+5]; /* Overallocate for \\*.*\0 */ ++ char namebuf[MAX_PATH+4]; /* Overallocate for "\*.*" */ + char *bufptr = namebuf; + /* only claim to have space for MAX_PATH */ +- Py_ssize_t len = sizeof(namebuf)-5; ++ Py_ssize_t len = Py_ARRAY_LENGTH(namebuf)-4; + PyObject *po = NULL; + wchar_t *wnamebuf = NULL; + +@@ -3744,10 +3727,8 @@ + if (path->fd != -1) { + /* closedir() closes the FD, so we duplicate it */ + fd = _Py_dup(path->fd); +- if (fd == -1) { +- list = posix_error(); +- goto exit; +- } ++ if (fd == -1) ++ return NULL; + + return_str = 1; + +@@ -3873,14 +3854,14 @@ + posix__getfullpathname(PyObject *self, PyObject *args) + { + const char *path; +- char outbuf[MAX_PATH*2]; ++ char outbuf[MAX_PATH]; + char *temp; + PyObject *po; + + if (PyArg_ParseTuple(args, "U|:_getfullpathname", &po)) + { + wchar_t *wpath; +- wchar_t woutbuf[MAX_PATH*2], *woutbufp = woutbuf; ++ wchar_t woutbuf[MAX_PATH], *woutbufp = woutbuf; + wchar_t *wtemp; + DWORD result; + PyObject *v; +@@ -4039,24 +4020,31 @@ + { + PyObject *po, *result; + wchar_t *path, *mountpath=NULL; +- size_t bufsize; ++ size_t buflen; + BOOL ret; + + if (!PyArg_ParseTuple(args, "U|:_getvolumepathname", &po)) + return NULL; +- path = PyUnicode_AsUnicode(po); ++ path = PyUnicode_AsUnicodeAndSize(po, &buflen); + if (path == NULL) + return NULL; ++ buflen += 1; + + /* Volume path should be shorter than entire path */ +- bufsize = max(MAX_PATH, wcslen(path) * 2 * sizeof(wchar_t)+1); +- mountpath = (wchar_t *)PyMem_Malloc(bufsize); ++ buflen = Py_MAX(buflen, MAX_PATH); ++ ++ if (buflen > DWORD_MAX) { ++ PyErr_SetString(PyExc_OverflowError, "path too long"); ++ return NULL; ++ } ++ ++ mountpath = (wchar_t *)PyMem_Malloc(buflen * sizeof(wchar_t)); + if (mountpath == NULL) + return PyErr_NoMemory(); + + Py_BEGIN_ALLOW_THREADS + ret = GetVolumePathNameW(path, mountpath, +- Py_SAFE_DOWNCAST(bufsize, size_t, DWORD)); ++ Py_SAFE_DOWNCAST(buflen, size_t, DWORD)); + Py_END_ALLOW_THREADS + + if (!ret) { +@@ -6005,7 +5993,7 @@ + goto posix_error; + + #else +- master_fd = _Py_open(DEV_PTY_FILE, O_RDWR | O_NOCTTY); /* open master */ ++ master_fd = open(DEV_PTY_FILE, O_RDWR | O_NOCTTY); /* open master */ + if (master_fd < 0) + goto posix_error; + +@@ -6032,6 +6020,10 @@ + slave_fd = _Py_open(slave_name, O_RDWR | O_NOCTTY); /* open slave */ + if (slave_fd < 0) + goto posix_error; ++ ++ if (_Py_set_inheritable(master_fd, 0, NULL) < 0) ++ goto posix_error; ++ + #if !defined(__CYGWIN__) && !defined(HAVE_DEV_PTC) + ioctl(slave_fd, I_PUSH, "ptem"); /* push ptem */ + ioctl(slave_fd, I_PUSH, "ldterm"); /* push ldterm */ +@@ -8329,10 +8321,6 @@ + int res; + if (!PyArg_ParseTuple(args, "i:fstat", &fd)) + return NULL; +-#ifdef __VMS +- /* on OpenVMS we must ensure that all bytes are written to the file */ +- fsync(fd); +-#endif + Py_BEGIN_ALLOW_THREADS + res = FSTAT(fd, &st); + Py_END_ALLOW_THREADS +@@ -11845,6 +11833,35 @@ + if (PyModule_AddIntMacro(m, ST_NOSUID)) return -1; + #endif /* ST_NOSUID */ + ++ /* GNU extensions */ ++#ifdef ST_NODEV ++ if (PyModule_AddIntMacro(m, ST_NODEV)) return -1; ++#endif /* ST_NODEV */ ++#ifdef ST_NOEXEC ++ if (PyModule_AddIntMacro(m, ST_NOEXEC)) return -1; ++#endif /* ST_NOEXEC */ ++#ifdef ST_SYNCHRONOUS ++ if (PyModule_AddIntMacro(m, ST_SYNCHRONOUS)) return -1; ++#endif /* ST_SYNCHRONOUS */ ++#ifdef ST_MANDLOCK ++ if (PyModule_AddIntMacro(m, ST_MANDLOCK)) return -1; ++#endif /* ST_MANDLOCK */ ++#ifdef ST_WRITE ++ if (PyModule_AddIntMacro(m, ST_WRITE)) return -1; ++#endif /* ST_WRITE */ ++#ifdef ST_APPEND ++ if (PyModule_AddIntMacro(m, ST_APPEND)) return -1; ++#endif /* ST_APPEND */ ++#ifdef ST_NOATIME ++ if (PyModule_AddIntMacro(m, ST_NOATIME)) return -1; ++#endif /* ST_NOATIME */ ++#ifdef ST_NODIRATIME ++ if (PyModule_AddIntMacro(m, ST_NODIRATIME)) return -1; ++#endif /* ST_NODIRATIME */ ++#ifdef ST_RELATIME ++ if (PyModule_AddIntMacro(m, ST_RELATIME)) return -1; ++#endif /* ST_RELATIME */ ++ + /* FreeBSD sendfile() constants */ + #ifdef SF_NODISKIO + if (PyModule_AddIntMacro(m, SF_NODISKIO)) return -1; +diff -r 3405dc9a6afa Modules/pwdmodule.c +--- a/Modules/pwdmodule.c ++++ b/Modules/pwdmodule.c +@@ -69,18 +69,10 @@ + #define SETS(i,val) sets(v, i, val) + + SETS(setIndex++, p->pw_name); +-#ifdef __VMS +- SETS(setIndex++, ""); +-#else + SETS(setIndex++, p->pw_passwd); +-#endif + PyStructSequence_SET_ITEM(v, setIndex++, _PyLong_FromUid(p->pw_uid)); + PyStructSequence_SET_ITEM(v, setIndex++, _PyLong_FromGid(p->pw_gid)); +-#ifdef __VMS +- SETS(setIndex++, ""); +-#else + SETS(setIndex++, p->pw_gecos); +-#endif + SETS(setIndex++, p->pw_dir); + SETS(setIndex++, p->pw_shell); + +diff -r 3405dc9a6afa Modules/readline.c +--- a/Modules/readline.c ++++ b/Modules/readline.c +@@ -1118,7 +1118,7 @@ + + + static char * +-readline_until_enter_or_signal(char *prompt, int *signal) ++readline_until_enter_or_signal(const char *prompt, int *signal) + { + PyOS_sighandler_t old_inthandler; + char *p; +diff -r 3405dc9a6afa Modules/resource.c +--- a/Modules/resource.c ++++ b/Modules/resource.c +@@ -424,6 +424,20 @@ + PyModule_AddIntMacro(m, RUSAGE_THREAD); + #endif + ++/* FreeBSD specific */ ++ ++#ifdef RLIMIT_SWAP ++ PyModule_AddIntMacro(m, RLIMIT_SWAP); ++#endif ++ ++#ifdef RLIMIT_SBSIZE ++ PyModule_AddIntMacro(m, RLIMIT_SBSIZE); ++#endif ++ ++#ifdef RLIMIT_NPTS ++ PyModule_AddIntMacro(m, RLIMIT_NPTS); ++#endif ++ + #if defined(HAVE_LONG_LONG) + if (sizeof(RLIM_INFINITY) > sizeof(long)) { + v = PyLong_FromLongLong((PY_LONG_LONG) RLIM_INFINITY); +diff -r 3405dc9a6afa Modules/selectmodule.c +--- a/Modules/selectmodule.c ++++ b/Modules/selectmodule.c +@@ -52,9 +52,6 @@ + # include + #else + # define SOCKET int +-# if defined(__VMS) +-# include +-# endif + #endif + + /* list of Python objects and their file descriptor */ +@@ -356,7 +353,7 @@ + assert(i < self->ufd_len); + /* Never overflow */ + self->ufds[i].fd = (int)PyLong_AsLong(key); +- self->ufds[i].events = (short)PyLong_AsLong(value); ++ self->ufds[i].events = (short)(unsigned short)PyLong_AsLong(value); + i++; + } + assert(i == self->ufd_len); +@@ -364,6 +361,24 @@ + return 1; + } + ++static int ++ushort_converter(PyObject *obj, void *ptr) ++{ ++ unsigned long uval; ++ ++ uval = PyLong_AsUnsignedLong(obj); ++ if (uval == (unsigned long)-1 && PyErr_Occurred()) ++ return 0; ++ if (uval > USHRT_MAX) { ++ PyErr_SetString(PyExc_OverflowError, ++ "Python int too large for C unsigned short"); ++ return 0; ++ } ++ ++ *(unsigned short *)ptr = Py_SAFE_DOWNCAST(uval, unsigned long, unsigned short); ++ return 1; ++} ++ + PyDoc_STRVAR(poll_register_doc, + "register(fd [, eventmask] ) -> None\n\n\ + Register a file descriptor with the polling object.\n\ +@@ -376,12 +391,11 @@ + { + PyObject *o, *key, *value; + int fd; +- short events = POLLIN | POLLPRI | POLLOUT; ++ unsigned short events = POLLIN | POLLPRI | POLLOUT; + int err; + +- if (!PyArg_ParseTuple(args, "O|h:register", &o, &events)) { ++ if (!PyArg_ParseTuple(args, "O|O&:register", &o, ushort_converter, &events)) + return NULL; +- } + + fd = PyObject_AsFileDescriptor(o); + if (fd == -1) return NULL; +@@ -419,12 +433,12 @@ + poll_modify(pollObject *self, PyObject *args) + { + PyObject *o, *key, *value; +- int fd, events; ++ int fd; ++ unsigned short events; + int err; + +- if (!PyArg_ParseTuple(args, "Oi:modify", &o, &events)) { ++ if (!PyArg_ParseTuple(args, "OO&:modify", &o, ushort_converter, &events)) + return NULL; +- } + + fd = PyObject_AsFileDescriptor(o); + if (fd == -1) return NULL; +@@ -729,14 +743,14 @@ + internal_devpoll_register(devpollObject *self, PyObject *args, int remove) + { + PyObject *o; +- int fd, events = POLLIN | POLLPRI | POLLOUT; ++ int fd; ++ unsigned short events = POLLIN | POLLPRI | POLLOUT; + + if (self->fd_devpoll < 0) + return devpoll_err_closed(); + +- if (!PyArg_ParseTuple(args, "O|i:register", &o, &events)) { ++ if (!PyArg_ParseTuple(args, "O|O&:register", &o, ushort_converter, &events)) + return NULL; +- } + + fd = PyObject_AsFileDescriptor(o); + if (fd == -1) return NULL; +@@ -752,7 +766,7 @@ + } + + self->fds[self->n_fds].fd = fd; +- self->fds[self->n_fds].events = events; ++ self->fds[self->n_fds].events = (signed short)events; + + if (++self->n_fds == self->max_n_fds) { + if (devpoll_flush(self)) +@@ -1317,16 +1331,16 @@ + return NULL; + } + +- switch(op) { +- case EPOLL_CTL_ADD: +- case EPOLL_CTL_MOD: ++ switch (op) { ++ case EPOLL_CTL_ADD: ++ case EPOLL_CTL_MOD: + ev.events = events; + ev.data.fd = fd; + Py_BEGIN_ALLOW_THREADS + result = epoll_ctl(epfd, op, fd, &ev); + Py_END_ALLOW_THREADS + break; +- case EPOLL_CTL_DEL: ++ case EPOLL_CTL_DEL: + /* In kernel versions before 2.6.9, the EPOLL_CTL_DEL + * operation required a non-NULL pointer in event, even + * though this argument is ignored. */ +@@ -1339,7 +1353,7 @@ + } + Py_END_ALLOW_THREADS + break; +- default: ++ default: + result = -1; + errno = EINVAL; + } +@@ -1691,17 +1705,17 @@ + * kevent is not standard and its members vary across BSDs. + */ + #if !defined(__OpenBSD__) +-# define IDENT_TYPE T_UINTPTRT +-# define IDENT_CAST Py_intptr_t +-# define DATA_TYPE T_INTPTRT ++# define IDENT_TYPE T_UINTPTRT ++# define IDENT_CAST Py_intptr_t ++# define DATA_TYPE T_INTPTRT + # define DATA_FMT_UNIT INTPTRT_FMT_UNIT +-# define IDENT_AsType PyLong_AsUintptr_t ++# define IDENT_AsType PyLong_AsUintptr_t + #else +-# define IDENT_TYPE T_UINT +-# define IDENT_CAST int +-# define DATA_TYPE T_INT ++# define IDENT_TYPE T_UINT ++# define IDENT_CAST int ++# define DATA_TYPE T_INT + # define DATA_FMT_UNIT "i" +-# define IDENT_AsType PyLong_AsUnsignedLong ++# define IDENT_AsType PyLong_AsUnsignedLong + #endif + + /* Unfortunately, we can't store python objects in udata, because +@@ -1753,7 +1767,7 @@ + + if (PyLong_Check(pfd) + #if IDENT_TYPE == T_UINT +- && PyLong_AsUnsignedLong(pfd) <= UINT_MAX ++ && PyLong_AsUnsignedLong(pfd) <= UINT_MAX + #endif + ) { + self->e.ident = IDENT_AsType(pfd); +@@ -1795,22 +1809,22 @@ + } + + switch (op) { +- case Py_EQ: ++ case Py_EQ: + result = (result == 0); + break; +- case Py_NE: ++ case Py_NE: + result = (result != 0); + break; +- case Py_LE: ++ case Py_LE: + result = (result <= 0); + break; +- case Py_GE: ++ case Py_GE: + result = (result >= 0); + break; +- case Py_LT: ++ case Py_LT: + result = (result < 0); + break; +- case Py_GT: ++ case Py_GT: + result = (result > 0); + break; + } +@@ -2236,7 +2250,7 @@ + that are ready.\n\ + \n\ + *** IMPORTANT NOTICE ***\n\ +-On Windows and OpenVMS, only sockets are supported; on Unix, all file\n\ ++On Windows only sockets are supported; on Unix, all file\n\ + descriptors can be used."); + + static PyMethodDef select_methods[] = { +@@ -2254,7 +2268,7 @@ + "This module supports asynchronous I/O on multiple file descriptors.\n\ + \n\ + *** IMPORTANT NOTICE ***\n\ +-On Windows and OpenVMS, only sockets are supported; on Unix, all file descriptors."); ++On Windows only sockets are supported; on Unix, all file descriptors."); + + + static struct PyModuleDef selectmodule = { +diff -r 3405dc9a6afa Modules/socketmodule.c +--- a/Modules/socketmodule.c ++++ b/Modules/socketmodule.c +@@ -188,7 +188,7 @@ + #if defined(WITH_THREAD) && (defined(__APPLE__) || \ + (defined(__FreeBSD__) && __FreeBSD_version+0 < 503000) || \ + defined(__OpenBSD__) || defined(__NetBSD__) || \ +- defined(__VMS) || !defined(HAVE_GETADDRINFO)) ++ !defined(HAVE_GETADDRINFO)) + #define USE_GETADDRINFO_LOCK + #endif + +@@ -212,10 +212,6 @@ + # include + #endif + +-#if defined(__VMS) +-# include +-#endif +- + #ifdef __APPLE__ + # include + #endif +@@ -403,11 +399,6 @@ + #endif + #endif + +-#ifdef __VMS +-/* TCP/IP Services for VMS uses a maximum send/recv buffer length */ +-#define SEGMENT_SIZE (32 * 1024 -1) +-#endif +- + /* Convert "sock_addr_t *" to "struct sockaddr *". */ + #define SAS2SA(x) (&((x)->sa)) + +@@ -556,37 +547,14 @@ + return NULL; + } + +-#ifdef __VMS +-/* Function to send in segments */ +-static int +-sendsegmented(int sock_fd, char *buf, int len, int flags) +-{ +- int n = 0; +- int remaining = len; +- +- while (remaining > 0) { +- unsigned int segment; +- +- segment = (remaining >= SEGMENT_SIZE ? SEGMENT_SIZE : remaining); +- n = send(sock_fd, buf, segment, flags); +- if (n < 0) { +- return n; +- } +- remaining -= segment; +- buf += segment; +- } /* end while */ +- +- return len; +-} +-#endif +- + /* Function to perform the setting of socket blocking mode + internally. block = (1 | 0). */ + static int + internal_setblocking(PySocketSockObject *s, int block) + { +-#ifndef MS_WINDOWS +- int delay_flag; ++#if !defined(MS_WINDOWS) \ ++ && !((defined(HAVE_SYS_IOCTL_H) && defined(FIONBIO))) ++ int delay_flag, new_delay_flag; + #endif + #ifdef SOCK_NONBLOCK + if (block) +@@ -597,17 +565,18 @@ + + Py_BEGIN_ALLOW_THREADS + #ifndef MS_WINDOWS +-#if defined(__VMS) ++#if (defined(HAVE_SYS_IOCTL_H) && defined(FIONBIO)) + block = !block; + ioctl(s->sock_fd, FIONBIO, (unsigned int *)&block); +-#else /* !__VMS */ ++#else + delay_flag = fcntl(s->sock_fd, F_GETFL, 0); + if (block) +- delay_flag &= (~O_NONBLOCK); ++ new_delay_flag = delay_flag & (~O_NONBLOCK); + else +- delay_flag |= O_NONBLOCK; +- fcntl(s->sock_fd, F_SETFL, delay_flag); +-#endif /* !__VMS */ ++ new_delay_flag = delay_flag | O_NONBLOCK; ++ if (new_delay_flag != delay_flag) ++ fcntl(s->sock_fd, F_SETFL, new_delay_flag); ++#endif + #else /* MS_WINDOWS */ + block = !block; + ioctlsocket(s->sock_fd, FIONBIO, (u_long*)&block); +@@ -2225,13 +2194,7 @@ + return s->errorhandler(); + return PyLong_FromLong(flag); + } +-#ifdef __VMS +- /* socklen_t is unsigned so no negative test is needed, +- test buflen == 0 is previously done */ +- if (buflen > 1024) { +-#else + if (buflen <= 0 || buflen > 1024) { +-#endif + PyErr_SetString(PyExc_OSError, + "getsockopt buflen out of range"); + return NULL; +@@ -2320,8 +2283,8 @@ + PyDoc_STRVAR(detach_doc, + "detach()\n\ + \n\ +-Close the socket object without closing the underlying file descriptor.\ +-The object cannot be used after this call, but the file descriptor\ ++Close the socket object without closing the underlying file descriptor.\n\ ++The object cannot be used after this call, but the file descriptor\n\ + can be reused for other purposes. The file descriptor is returned."); + + static int +@@ -2601,10 +2564,6 @@ + { + Py_ssize_t outlen = -1; + int timeout; +-#ifdef __VMS +- int remaining; +- char *read_buf; +-#endif + + if (!IS_SELECTABLE(s)) { + select_error(); +@@ -2615,7 +2574,6 @@ + return 0; + } + +-#ifndef __VMS + BEGIN_SELECT_LOOP(s) + Py_BEGIN_ALLOW_THREADS + timeout = internal_select_ex(s, 0, interval); +@@ -2641,48 +2599,6 @@ + s->errorhandler(); + return -1; + } +-#else +- read_buf = cbuf; +- remaining = len; +- while (remaining != 0) { +- unsigned int segment; +- int nread = -1; +- +- segment = remaining /SEGMENT_SIZE; +- if (segment != 0) { +- segment = SEGMENT_SIZE; +- } +- else { +- segment = remaining; +- } +- +- BEGIN_SELECT_LOOP(s) +- Py_BEGIN_ALLOW_THREADS +- timeout = internal_select_ex(s, 0, interval); +- if (!timeout) +- nread = recv(s->sock_fd, read_buf, segment, flags); +- Py_END_ALLOW_THREADS +- if (timeout == 1) { +- PyErr_SetString(socket_timeout, "timed out"); +- return -1; +- } +- END_SELECT_LOOP(s) +- +- if (nread < 0) { +- s->errorhandler(); +- return -1; +- } +- if (nread != remaining) { +- read_buf += nread; +- break; +- } +- +- remaining -= segment; +- read_buf += segment; +- } +- outlen = read_buf - cbuf; +-#endif /* !__VMS */ +- + return outlen; + } + +@@ -3316,9 +3232,7 @@ + Py_BEGIN_ALLOW_THREADS + timeout = internal_select_ex(s, 1, interval); + if (!timeout) { +-#ifdef __VMS +- n = sendsegmented(s->sock_fd, buf, len, flags); +-#elif defined(MS_WINDOWS) ++#ifdef MS_WINDOWS + if (len > INT_MAX) + len = INT_MAX; + n = send(s->sock_fd, buf, (int)len, flags); +@@ -3373,9 +3287,7 @@ + timeout = internal_select(s, 1); + n = -1; + if (!timeout) { +-#ifdef __VMS +- n = sendsegmented(s->sock_fd, buf, len, flags); +-#elif defined(MS_WINDOWS) ++#ifdef MS_WINDOWS + if (len > INT_MAX) + len = INT_MAX; + n = send(s->sock_fd, buf, (int)len, flags); +@@ -5308,9 +5220,9 @@ + #if defined(__APPLE__) && defined(AI_NUMERICSERV) + if ((flags & AI_NUMERICSERV) && (pptr == NULL || (pptr[0] == '0' && pptr[1] == 0))) { + /* On OSX upto at least OSX 10.8 getaddrinfo crashes +- * if AI_NUMERICSERV is set and the servname is NULL or "0". +- * This workaround avoids a segfault in libsystem. +- */ ++ * if AI_NUMERICSERV is set and the servname is NULL or "0". ++ * This workaround avoids a segfault in libsystem. ++ */ + pptr = "00"; + } + #endif +@@ -6241,6 +6153,9 @@ + #ifdef SO_BINDTODEVICE + PyModule_AddIntMacro(m, SO_BINDTODEVICE); + #endif ++#ifdef SO_PRIORITY ++ PyModule_AddIntMacro(m, SO_PRIORITY); ++#endif + + /* Maximum number of connections for "listen" */ + #ifdef SOMAXCONN +diff -r 3405dc9a6afa Objects/abstract.c +--- a/Objects/abstract.c ++++ b/Objects/abstract.c +@@ -1155,7 +1155,7 @@ + return type_error("bad operand type for abs(): '%.200s'", o); + } + +-/* Return a Python int from the object item ++/* Return a Python int from the object item. + Raise TypeError if the result is not an int + or if the object cannot be interpreted as an index. + */ +@@ -1169,21 +1169,30 @@ + Py_INCREF(item); + return item; + } +- if (PyIndex_Check(item)) { +- result = item->ob_type->tp_as_number->nb_index(item); +- if (result && !PyLong_Check(result)) { +- PyErr_Format(PyExc_TypeError, +- "__index__ returned non-int " +- "(type %.200s)", +- result->ob_type->tp_name); +- Py_DECREF(result); +- return NULL; +- } +- } +- else { ++ if (!PyIndex_Check(item)) { + PyErr_Format(PyExc_TypeError, + "'%.200s' object cannot be interpreted " + "as an integer", item->ob_type->tp_name); ++ return NULL; ++ } ++ result = item->ob_type->tp_as_number->nb_index(item); ++ if (!result || PyLong_CheckExact(result)) ++ return result; ++ if (!PyLong_Check(result)) { ++ PyErr_Format(PyExc_TypeError, ++ "__index__ returned non-int (type %.200s)", ++ result->ob_type->tp_name); ++ Py_DECREF(result); ++ return NULL; ++ } ++ /* Issue #17576: warn if 'result' not of exact type int. */ ++ if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, ++ "__index__ returned non-int (type %.200s). " ++ "The ability to return an instance of a strict subclass of int " ++ "is deprecated, and may be removed in a future version of Python.", ++ result->ob_type->tp_name)) { ++ Py_DECREF(result); ++ return NULL; + } + return result; + } +@@ -1235,34 +1244,6 @@ + } + + +-/* +- Returns the Integral instance converted to an int. The instance is expected +- to be an int or have an __int__ method. Steals integral's +- reference. error_format will be used to create the TypeError if integral +- isn't actually an Integral instance. error_format should be a format string +- that can accept a char* naming integral's type. +-*/ +-static PyObject * +-convert_integral_to_int(PyObject *integral, const char *error_format) +-{ +- PyNumberMethods *nb; +- if (PyLong_Check(integral)) +- return integral; +- nb = Py_TYPE(integral)->tp_as_number; +- if (nb->nb_int) { +- PyObject *as_int = nb->nb_int(integral); +- if (!as_int || PyLong_Check(as_int)) { +- Py_DECREF(integral); +- return as_int; +- } +- Py_DECREF(as_int); +- } +- PyErr_Format(PyExc_TypeError, error_format, Py_TYPE(integral)->tp_name); +- Py_DECREF(integral); +- return NULL; +-} +- +- + PyObject * + PyNumber_Long(PyObject *o) + { +@@ -1280,29 +1261,28 @@ + } + m = o->ob_type->tp_as_number; + if (m && m->nb_int) { /* This should include subclasses of int */ +- PyObject *res = m->nb_int(o); +- if (res && !PyLong_Check(res)) { +- PyErr_Format(PyExc_TypeError, +- "__int__ returned non-int (type %.200s)", +- res->ob_type->tp_name); +- Py_DECREF(res); +- return NULL; +- } +- return res; ++ return (PyObject *)_PyLong_FromNbInt(o); + } +- if (PyLong_Check(o)) /* An int subclass without nb_int */ +- return _PyLong_Copy((PyLongObject *)o); + trunc_func = _PyObject_LookupSpecial(o, &PyId___trunc__); + if (trunc_func) { + PyObject *truncated = PyEval_CallObject(trunc_func, NULL); + PyObject *int_instance; + Py_DECREF(trunc_func); +- if (truncated == NULL) +- return NULL; ++ if (truncated == NULL || PyLong_Check(truncated)) ++ return truncated; + /* __trunc__ is specified to return an Integral type, + but int() needs to return a int. */ +- int_instance = convert_integral_to_int(truncated, +- "__trunc__ returned non-Integral (type %.200s)"); ++ m = truncated->ob_type->tp_as_number; ++ if (m == NULL || m->nb_int == NULL) { ++ PyErr_Format( ++ PyExc_TypeError, ++ "__trunc__ returned non-Integral (type %.200s)", ++ truncated->ob_type->tp_name); ++ Py_DECREF(truncated); ++ return NULL; ++ } ++ int_instance = (PyObject *)_PyLong_FromNbInt(truncated); ++ Py_DECREF(truncated); + return int_instance; + } + if (PyErr_Occurred()) +@@ -2093,7 +2073,8 @@ + "NULL result without error in PyObject_Call"); + } + #else +- assert(result != NULL || PyErr_Occurred()); ++ assert((result != NULL && !PyErr_Occurred()) ++ || (result == NULL && PyErr_Occurred())); + #endif + return result; + } +diff -r 3405dc9a6afa Objects/bytesobject.c +--- a/Objects/bytesobject.c ++++ b/Objects/bytesobject.c +@@ -107,7 +107,7 @@ + op = (PyBytesObject *)PyObject_MALLOC(PyBytesObject_SIZE + size); + if (op == NULL) + return PyErr_NoMemory(); +- PyObject_INIT_VAR(op, &PyBytes_Type, size); ++ (void)PyObject_INIT_VAR(op, &PyBytes_Type, size); + op->ob_shash = -1; + if (str != NULL) + Py_MEMCPY(op->ob_sval, str, size); +@@ -155,7 +155,7 @@ + op = (PyBytesObject *)PyObject_MALLOC(PyBytesObject_SIZE + size); + if (op == NULL) + return PyErr_NoMemory(); +- PyObject_INIT_VAR(op, &PyBytes_Type, size); ++ (void)PyObject_INIT_VAR(op, &PyBytes_Type, size); + op->ob_shash = -1; + Py_MEMCPY(op->ob_sval, str, size+1); + /* share short strings */ +@@ -195,8 +195,17 @@ + + switch (*f) { + case 'c': +- (void)va_arg(count, int); +- /* fall through... */ ++ { ++ int c = va_arg(count, int); ++ if (c < 0 || c > 255) { ++ PyErr_SetString(PyExc_OverflowError, ++ "PyBytes_FromFormatV(): %c format " ++ "expects an integer in range [0; 255]"); ++ return NULL; ++ } ++ n++; ++ break; ++ } + case '%': + n++; + break; +@@ -276,8 +285,12 @@ + + switch (*f) { + case 'c': +- *s++ = va_arg(vargs, int); ++ { ++ int c = va_arg(vargs, int); ++ /* c has been checked for overflow in the first step */ ++ *s++ = (unsigned char)c; + break; ++ } + case 'd': + if (longflag) + sprintf(s, "%ld", va_arg(vargs, long)); +@@ -749,7 +762,7 @@ + op = (PyBytesObject *)PyObject_MALLOC(PyBytesObject_SIZE + nbytes); + if (op == NULL) + return PyErr_NoMemory(); +- PyObject_INIT_VAR(op, &PyBytes_Type, size); ++ (void)PyObject_INIT_VAR(op, &PyBytes_Type, size); + op->ob_shash = -1; + op->ob_sval[size] = '\0'; + if (Py_SIZE(a) == 1 && n > 0) { +diff -r 3405dc9a6afa Objects/classobject.c +--- a/Objects/classobject.c ++++ b/Objects/classobject.c +@@ -52,7 +52,7 @@ + im = free_list; + if (im != NULL) { + free_list = (PyMethodObject *)(im->im_self); +- PyObject_INIT(im, &PyMethod_Type); ++ (void)PyObject_INIT(im, &PyMethod_Type); + numfree--; + } + else { +diff -r 3405dc9a6afa Objects/complexobject.c +--- a/Objects/complexobject.c ++++ b/Objects/complexobject.c +@@ -217,7 +217,7 @@ + op = (PyComplexObject *) PyObject_MALLOC(sizeof(PyComplexObject)); + if (op == NULL) + return PyErr_NoMemory(); +- PyObject_INIT(op, &PyComplex_Type); ++ (void)PyObject_INIT(op, &PyComplex_Type); + op->cval = cval; + return (PyObject *) op; + } +diff -r 3405dc9a6afa Objects/descrobject.c +--- a/Objects/descrobject.c ++++ b/Objects/descrobject.c +@@ -1547,21 +1547,25 @@ + "\n" + "fget is a function to be used for getting an attribute value, and likewise\n" + "fset is a function for setting, and fdel a function for del'ing, an\n" +-"attribute. Typical use is to define a managed attribute x:\n" ++"attribute. Typical use is to define a managed attribute x:\n\n" + "class C(object):\n" + " def getx(self): return self._x\n" + " def setx(self, value): self._x = value\n" + " def delx(self): del self._x\n" + " x = property(getx, setx, delx, \"I'm the 'x' property.\")\n" + "\n" +-"Decorators make defining new properties or modifying existing ones easy:\n" ++"Decorators make defining new properties or modifying existing ones easy:\n\n" + "class C(object):\n" + " @property\n" +-" def x(self): return self._x\n" ++" def x(self):\n" ++" \"I am the 'x' property.\"\n" ++" return self._x\n" + " @x.setter\n" +-" def x(self, value): self._x = value\n" ++" def x(self, value):\n" ++" self._x = value\n" + " @x.deleter\n" +-" def x(self): del self._x\n" ++" def x(self):\n" ++" del self._x\n" + ); + + static int +diff -r 3405dc9a6afa Objects/exceptions.c +--- a/Objects/exceptions.c ++++ b/Objects/exceptions.c +@@ -16,9 +16,6 @@ + #ifdef MS_WINDOWS + PyObject *PyExc_WindowsError = NULL; + #endif +-#ifdef __VMS +-PyObject *PyExc_VMSError = NULL; +-#endif + + /* The dict map from errno codes to OSError subclasses */ + static PyObject *errnomap = NULL; +@@ -2473,9 +2470,6 @@ + #ifdef MS_WINDOWS + INIT_ALIAS(WindowsError, OSError) + #endif +-#ifdef __VMS +- INIT_ALIAS(VMSError, OSError) +-#endif + POST_INIT(EOFError) + POST_INIT(RuntimeError) + POST_INIT(NotImplementedError) +diff -r 3405dc9a6afa Objects/floatobject.c +--- a/Objects/floatobject.c ++++ b/Objects/floatobject.c +@@ -119,7 +119,7 @@ + return PyErr_NoMemory(); + } + /* Inline PyObject_New */ +- PyObject_INIT(op, &PyFloat_Type); ++ (void)PyObject_INIT(op, &PyFloat_Type); + op->ob_fval = fval; + return (PyObject *) op; + } +diff -r 3405dc9a6afa Objects/frameobject.c +--- a/Objects/frameobject.c ++++ b/Objects/frameobject.c +@@ -726,7 +726,6 @@ + Py_INCREF(locals); + f->f_locals = locals; + } +- f->f_tstate = tstate; + + f->f_lasti = -1; + f->f_lineno = code->co_firstlineno; +diff -r 3405dc9a6afa Objects/longobject.c +--- a/Objects/longobject.c ++++ b/Objects/longobject.c +@@ -122,6 +122,56 @@ + return v; + } + ++/* _PyLong_FromNbInt: Convert the given object to a PyLongObject ++ using the nb_int slot, if available. Raise TypeError if either the ++ nb_int slot is not available or the result of the call to nb_int ++ returns something not of type int. ++*/ ++PyLongObject * ++_PyLong_FromNbInt(PyObject *integral) ++{ ++ PyNumberMethods *nb; ++ PyObject *result; ++ ++ /* Fast path for the case that we already have an int. */ ++ if (PyLong_CheckExact(integral)) { ++ Py_INCREF(integral); ++ return (PyLongObject *)integral; ++ } ++ ++ nb = Py_TYPE(integral)->tp_as_number; ++ if (nb == NULL || nb->nb_int == NULL) { ++ PyErr_Format(PyExc_TypeError, ++ "an integer is required (got type %.200s)", ++ Py_TYPE(integral)->tp_name); ++ return NULL; ++ } ++ ++ /* Convert using the nb_int slot, which should return something ++ of exact type int. */ ++ result = nb->nb_int(integral); ++ if (!result || PyLong_CheckExact(result)) ++ return (PyLongObject *)result; ++ if (!PyLong_Check(result)) { ++ PyErr_Format(PyExc_TypeError, ++ "__int__ returned non-int (type %.200s)", ++ result->ob_type->tp_name); ++ Py_DECREF(result); ++ return NULL; ++ } ++ /* Issue #17576: warn if 'result' not of exact type int. */ ++ if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1, ++ "__int__ returned non-int (type %.200s). " ++ "The ability to return an instance of a strict subclass of int " ++ "is deprecated, and may be removed in a future version of Python.", ++ result->ob_type->tp_name)) { ++ Py_DECREF(result); ++ return NULL; ++ } ++ return (PyLongObject *)result; ++} ++ ++ + /* Allocate a new int object with size digits. + Return NULL and set exception if we run out of memory. */ + +@@ -353,28 +403,17 @@ + return -1; + } + +- if (!PyLong_Check(vv)) { +- PyNumberMethods *nb; +- nb = vv->ob_type->tp_as_number; +- if (nb == NULL || nb->nb_int == NULL) { +- PyErr_SetString(PyExc_TypeError, +- "an integer is required"); +- return -1; +- } +- vv = (*nb->nb_int) (vv); +- if (vv == NULL) ++ if (PyLong_Check(vv)) { ++ v = (PyLongObject *)vv; ++ } ++ else { ++ v = _PyLong_FromNbInt(vv); ++ if (v == NULL) + return -1; + do_decref = 1; +- if (!PyLong_Check(vv)) { +- Py_DECREF(vv); +- PyErr_SetString(PyExc_TypeError, +- "nb_int should return int object"); +- return -1; +- } + } + + res = -1; +- v = (PyLongObject *)vv; + i = Py_SIZE(v); + + switch (i) { +@@ -418,7 +457,7 @@ + } + exit: + if (do_decref) { +- Py_DECREF(vv); ++ Py_DECREF(v); + } + return res; + } +@@ -636,36 +675,25 @@ + unsigned long + PyLong_AsUnsignedLongMask(PyObject *op) + { +- PyNumberMethods *nb; + PyLongObject *lo; + unsigned long val; + +- if (op && PyLong_Check(op)) ++ if (op == NULL) { ++ PyErr_BadInternalCall(); ++ return (unsigned long)-1; ++ } ++ ++ if (PyLong_Check(op)) { + return _PyLong_AsUnsignedLongMask(op); +- +- if (op == NULL || (nb = op->ob_type->tp_as_number) == NULL || +- nb->nb_int == NULL) { +- PyErr_SetString(PyExc_TypeError, "an integer is required"); +- return (unsigned long)-1; +- } +- +- lo = (PyLongObject*) (*nb->nb_int) (op); ++ } ++ ++ lo = _PyLong_FromNbInt(op); + if (lo == NULL) + return (unsigned long)-1; +- if (PyLong_Check(lo)) { +- val = _PyLong_AsUnsignedLongMask((PyObject *)lo); +- Py_DECREF(lo); +- if (PyErr_Occurred()) +- return (unsigned long)-1; +- return val; +- } +- else +- { +- Py_DECREF(lo); +- PyErr_SetString(PyExc_TypeError, +- "nb_int should return int object"); +- return (unsigned long)-1; +- } ++ ++ val = _PyLong_AsUnsignedLongMask((PyObject *)lo); ++ Py_DECREF(lo); ++ return val; + } + + int +@@ -1167,40 +1195,41 @@ + PyLongObject *v; + PY_LONG_LONG bytes; + int res; ++ int do_decref = 0; /* if nb_int was called */ + + if (vv == NULL) { + PyErr_BadInternalCall(); + return -1; + } +- if (!PyLong_Check(vv)) { +- PyNumberMethods *nb; +- PyObject *io; +- if ((nb = vv->ob_type->tp_as_number) == NULL || +- nb->nb_int == NULL) { +- PyErr_SetString(PyExc_TypeError, "an integer is required"); ++ ++ if (PyLong_Check(vv)) { ++ v = (PyLongObject *)vv; ++ } ++ else { ++ v = _PyLong_FromNbInt(vv); ++ if (v == NULL) + return -1; +- } +- io = (*nb->nb_int) (vv); +- if (io == NULL) +- return -1; +- if (PyLong_Check(io)) { +- bytes = PyLong_AsLongLong(io); +- Py_DECREF(io); +- return bytes; +- } +- Py_DECREF(io); +- PyErr_SetString(PyExc_TypeError, "integer conversion failed"); +- return -1; +- } +- +- v = (PyLongObject*)vv; ++ do_decref = 1; ++ } ++ ++ res = 0; + switch(Py_SIZE(v)) { +- case -1: return -(sdigit)v->ob_digit[0]; +- case 0: return 0; +- case 1: return v->ob_digit[0]; +- } +- res = _PyLong_AsByteArray((PyLongObject *)vv, (unsigned char *)&bytes, +- SIZEOF_LONG_LONG, PY_LITTLE_ENDIAN, 1); ++ case -1: ++ bytes = -(sdigit)v->ob_digit[0]; ++ break; ++ case 0: ++ bytes = 0; ++ break; ++ case 1: ++ bytes = v->ob_digit[0]; ++ break; ++ default: ++ res = _PyLong_AsByteArray((PyLongObject *)v, (unsigned char *)&bytes, ++ SIZEOF_LONG_LONG, PY_LITTLE_ENDIAN, 1); ++ } ++ if (do_decref) { ++ Py_DECREF(v); ++ } + + /* Plan 9 can't handle PY_LONG_LONG in ? : expressions */ + if (res < 0) +@@ -1280,36 +1309,25 @@ + unsigned PY_LONG_LONG + PyLong_AsUnsignedLongLongMask(PyObject *op) + { +- PyNumberMethods *nb; + PyLongObject *lo; + unsigned PY_LONG_LONG val; + +- if (op && PyLong_Check(op)) ++ if (op == NULL) { ++ PyErr_BadInternalCall(); ++ return (unsigned long)-1; ++ } ++ ++ if (PyLong_Check(op)) { + return _PyLong_AsUnsignedLongLongMask(op); +- +- if (op == NULL || (nb = op->ob_type->tp_as_number) == NULL || +- nb->nb_int == NULL) { +- PyErr_SetString(PyExc_TypeError, "an integer is required"); +- return (unsigned PY_LONG_LONG)-1; +- } +- +- lo = (PyLongObject*) (*nb->nb_int) (op); ++ } ++ ++ lo = _PyLong_FromNbInt(op); + if (lo == NULL) + return (unsigned PY_LONG_LONG)-1; +- if (PyLong_Check(lo)) { +- val = _PyLong_AsUnsignedLongLongMask((PyObject *)lo); +- Py_DECREF(lo); +- if (PyErr_Occurred()) +- return (unsigned PY_LONG_LONG)-1; +- return val; +- } +- else +- { +- Py_DECREF(lo); +- PyErr_SetString(PyExc_TypeError, +- "nb_int should return int object"); +- return (unsigned PY_LONG_LONG)-1; +- } ++ ++ val = _PyLong_AsUnsignedLongLongMask((PyObject *)lo); ++ Py_DECREF(lo); ++ return val; + } + + /* Get a C long long int from an int object or any object that has an +@@ -1339,28 +1357,17 @@ + return -1; + } + +- if (!PyLong_Check(vv)) { +- PyNumberMethods *nb; +- nb = vv->ob_type->tp_as_number; +- if (nb == NULL || nb->nb_int == NULL) { +- PyErr_SetString(PyExc_TypeError, +- "an integer is required"); +- return -1; +- } +- vv = (*nb->nb_int) (vv); +- if (vv == NULL) ++ if (PyLong_Check(vv)) { ++ v = (PyLongObject *)vv; ++ } ++ else { ++ v = _PyLong_FromNbInt(vv); ++ if (v == NULL) + return -1; + do_decref = 1; +- if (!PyLong_Check(vv)) { +- Py_DECREF(vv); +- PyErr_SetString(PyExc_TypeError, +- "nb_int should return int object"); +- return -1; +- } + } + + res = -1; +- v = (PyLongObject *)vv; + i = Py_SIZE(v); + + switch (i) { +@@ -1404,7 +1411,7 @@ + } + exit: + if (do_decref) { +- Py_DECREF(vv); ++ Py_DECREF(v); + } + return res; + } +@@ -5089,7 +5096,7 @@ + assert(v->ob_digit[0] == abs(ival)); + } + else { +- PyObject_INIT(v, &PyLong_Type); ++ (void)PyObject_INIT(v, &PyLong_Type); + } + Py_SIZE(v) = size; + v->ob_digit[0] = abs(ival); +diff -r 3405dc9a6afa Objects/methodobject.c +--- a/Objects/methodobject.c ++++ b/Objects/methodobject.c +@@ -29,7 +29,7 @@ + op = free_list; + if (op != NULL) { + free_list = (PyCFunctionObject *)(op->m_self); +- PyObject_INIT(op, &PyCFunction_Type); ++ (void)PyObject_INIT(op, &PyCFunction_Type); + numfree--; + } + else { +diff -r 3405dc9a6afa Objects/object.c +--- a/Objects/object.c ++++ b/Objects/object.c +@@ -1409,7 +1409,7 @@ + 0, /* nb_index */ + }; + +-static PyTypeObject PyNone_Type = { ++PyTypeObject _PyNone_Type = { + PyVarObject_HEAD_INIT(&PyType_Type, 0) + "NoneType", + 0, +@@ -1452,7 +1452,7 @@ + + PyObject _Py_NoneStruct = { + _PyObject_EXTRA_INIT +- 1, &PyNone_Type ++ 1, &_PyNone_Type + }; + + /* NotImplemented is an object that can be used to signal that an +@@ -1494,7 +1494,7 @@ + Py_FatalError("deallocating NotImplemented"); + } + +-static PyTypeObject PyNotImplemented_Type = { ++PyTypeObject _PyNotImplemented_Type = { + PyVarObject_HEAD_INIT(&PyType_Type, 0) + "NotImplementedType", + 0, +@@ -1537,7 +1537,7 @@ + + PyObject _Py_NotImplementedStruct = { + _PyObject_EXTRA_INIT +- 1, &PyNotImplemented_Type ++ 1, &_PyNotImplemented_Type + }; + + void +@@ -1567,10 +1567,10 @@ + if (PyType_Ready(&PyList_Type) < 0) + Py_FatalError("Can't initialize list type"); + +- if (PyType_Ready(&PyNone_Type) < 0) ++ if (PyType_Ready(&_PyNone_Type) < 0) + Py_FatalError("Can't initialize None type"); + +- if (PyType_Ready(&PyNotImplemented_Type) < 0) ++ if (PyType_Ready(&_PyNotImplemented_Type) < 0) + Py_FatalError("Can't initialize NotImplemented type"); + + if (PyType_Ready(&PyTraceBack_Type) < 0) +diff -r 3405dc9a6afa Objects/setobject.c +--- a/Objects/setobject.c ++++ b/Objects/setobject.c +@@ -36,9 +36,6 @@ + + #define dummy (&_dummy_struct) + +-/* Exported for the gdb plugin's benefit. */ +-PyObject *_PySet_Dummy = dummy; +- + + /* ======================================================================== */ + /* ======= Begin logic for probing the hash table ========================= */ +@@ -2345,6 +2342,9 @@ + return set_update_internal((PySetObject *)set, iterable); + } + ++/* Exported for the gdb plugin's benefit. */ ++PyObject *_PySet_Dummy = dummy; ++ + #ifdef Py_DEBUG + + /* Test code to be called with any three element set. +diff -r 3405dc9a6afa Objects/typeobject.c +--- a/Objects/typeobject.c ++++ b/Objects/typeobject.c +@@ -7,10 +7,6 @@ + #include + + +-/* Cached lookup of the copyreg module, for faster __reduce__ calls */ +- +-static PyObject *cached_copyreg_module = NULL; +- + /* Support type attribute cache */ + + /* The cache can keep references to the names alive for longer than +@@ -79,9 +75,6 @@ + _PyType_Fini(void) + { + PyType_ClearCache(); +- /* Need to forget our obsolete instance of the copyreg module at +- * interpreter shutdown (issue #17408). */ +- Py_CLEAR(cached_copyreg_module); + } + + void +@@ -794,7 +787,7 @@ + Py_INCREF(type); + + if (type->tp_itemsize == 0) +- PyObject_INIT(obj, type); ++ (void)PyObject_INIT(obj, type); + else + (void) PyObject_INIT_VAR((PyVarObject *)obj, type, nitems); + +@@ -3390,19 +3383,29 @@ + static PyObject * + import_copyreg(void) + { +- static PyObject *copyreg_str; +- +- if (!copyreg_str) { +- copyreg_str = PyUnicode_InternFromString("copyreg"); +- if (copyreg_str == NULL) +- return NULL; +- } +- if (!cached_copyreg_module) { +- cached_copyreg_module = PyImport_Import(copyreg_str); +- } +- +- Py_XINCREF(cached_copyreg_module); +- return cached_copyreg_module; ++ PyObject *copyreg_str; ++ PyObject *copyreg_module; ++ PyInterpreterState *interp = PyThreadState_GET()->interp; ++ _Py_IDENTIFIER(copyreg); ++ ++ copyreg_str = _PyUnicode_FromId(&PyId_copyreg); ++ if (copyreg_str == NULL) { ++ return NULL; ++ } ++ /* Try to fetch cached copy of copyreg from sys.modules first in an ++ attempt to avoid the import overhead. Previously this was implemented ++ by storing a reference to the cached module in a static variable, but ++ this broke when multiple embeded interpreters were in use (see issue ++ #17408 and #19088). */ ++ copyreg_module = PyDict_GetItemWithError(interp->modules, copyreg_str); ++ if (copyreg_module != NULL) { ++ Py_INCREF(copyreg_module); ++ return copyreg_module; ++ } ++ if (PyErr_Occurred()) { ++ return NULL; ++ } ++ return PyImport_Import(copyreg_str); + } + + Py_LOCAL(PyObject *) +diff -r 3405dc9a6afa PCbuild/_overlapped.vcxproj.filters +--- /dev/null ++++ b/PCbuild/_overlapped.vcxproj.filters +@@ -0,0 +1,13 @@ ++ ++ ++ ++ ++ {6f67c8db-7de7-4714-a967-2b0d4bc71f2e} ++ ++ ++ ++ ++ Source Files ++ ++ ++ +\ No newline at end of file +diff -r 3405dc9a6afa PCbuild/_sha3.vcxproj.filters +--- /dev/null ++++ b/PCbuild/_sha3.vcxproj.filters +@@ -0,0 +1,13 @@ ++ ++ ++ ++ ++ {f1f1fd19-4f85-4a56-be41-af14f0bc2a9c} ++ ++ ++ ++ ++ Source Files ++ ++ ++ +\ No newline at end of file +diff -r 3405dc9a6afa PCbuild/pythoncore.vcxproj +--- a/PCbuild/pythoncore.vcxproj ++++ b/PCbuild/pythoncore.vcxproj +@@ -181,6 +181,12 @@ + libc;%(IgnoreSpecificDefaultLibraries) + 0x1e000000 + ++ ++ $(KillPythonExe) ++ ++ ++ Killing any running $(PythonExe) instances... ++ + + + +@@ -206,6 +212,12 @@ + libc;%(IgnoreSpecificDefaultLibraries) + 0x1e000000 + ++ ++ $(KillPythonExe) ++ ++ ++ Killing any running $(PythonExe) instances... ++ + + + +@@ -231,6 +243,12 @@ + libc;%(IgnoreSpecificDefaultLibraries) + 0x1e000000 + ++ ++ $(KillPythonExe) ++ ++ ++ Killing any running $(PythonExe) instances... ++ + + + +@@ -259,6 +277,12 @@ + libc;%(IgnoreSpecificDefaultLibraries) + 0x1e000000 + ++ ++ $(KillPythonExe) ++ ++ ++ Killing any running $(PythonExe) instances... ++ + + + +@@ -282,6 +306,12 @@ + libc;%(IgnoreSpecificDefaultLibraries) + 0x1e000000 + ++ ++ $(KillPythonExe) ++ ++ ++ Killing any running $(PythonExe) instances... ++ + + + +@@ -308,6 +338,12 @@ + 0x1e000000 + MachineX64 + ++ ++ $(KillPythonExe) ++ ++ ++ Killing any running $(PythonExe) instances... ++ + + + +@@ -331,6 +367,12 @@ + libc;%(IgnoreSpecificDefaultLibraries) + 0x1e000000 + ++ ++ $(KillPythonExe) ++ ++ ++ Killing any running $(PythonExe) instances... ++ + + + +@@ -357,6 +399,12 @@ + 0x1e000000 + MachineX64 + ++ ++ $(KillPythonExe) ++ ++ ++ Killing any running $(PythonExe) instances... ++ + + + +diff -r 3405dc9a6afa PCbuild/pythoncore.vcxproj.filters +--- a/PCbuild/pythoncore.vcxproj.filters ++++ b/PCbuild/pythoncore.vcxproj.filters +@@ -414,7 +414,6 @@ + + Python + +- + + Python + +@@ -424,6 +423,12 @@ + + Include + ++ ++ Include ++ ++ ++ Modules ++ + + + +@@ -930,13 +935,24 @@ + + PC + +- + + Modules + + + Python + ++ ++ Objects ++ ++ ++ Modules ++ ++ ++ Modules ++ ++ ++ Modules ++ + + + +diff -r 3405dc9a6afa Parser/myreadline.c +--- a/Parser/myreadline.c ++++ b/Parser/myreadline.c +@@ -15,10 +15,6 @@ + #include "windows.h" + #endif /* MS_WINDOWS */ + +-#ifdef __VMS +-extern char* vms__StdioReadline(FILE *sys_stdin, FILE *sys_stdout, char *prompt); +-#endif +- + + PyThreadState* _PyOS_ReadlineTState; + +@@ -189,11 +185,7 @@ + + + if (PyOS_ReadlineFunctionPointer == NULL) { +-#ifdef __VMS +- PyOS_ReadlineFunctionPointer = vms__StdioReadline; +-#else + PyOS_ReadlineFunctionPointer = PyOS_StdioReadline; +-#endif + } + + #ifdef WITH_THREAD +diff -r 3405dc9a6afa Parser/node.c +--- a/Parser/node.c ++++ b/Parser/node.c +@@ -91,7 +91,7 @@ + if (current_capacity < 0 || required_capacity < 0) + return E_OVERFLOW; + if (current_capacity < required_capacity) { +- if (required_capacity > PY_SIZE_MAX / sizeof(node)) { ++ if ((size_t)required_capacity > PY_SIZE_MAX / sizeof(node)) { + return E_NOMEM; + } + n = n1->n_child; +diff -r 3405dc9a6afa Python/bltinmodule.c +--- a/Python/bltinmodule.c ++++ b/Python/bltinmodule.c +@@ -695,7 +695,7 @@ + PyDoc_STRVAR(compile_doc, + "compile(source, filename, mode[, flags[, dont_inherit]]) -> code object\n\ + \n\ +-Compile the source string (a Python module, statement or expression)\n\ ++Compile the source (a Python module, statement or expression)\n\ + into a code object that can be executed by exec() or eval().\n\ + The filename will be used for run-time error messages.\n\ + The mode must be 'exec' to compile a module, 'single' to compile a\n\ +diff -r 3405dc9a6afa Python/ceval.c +--- a/Python/ceval.c ++++ b/Python/ceval.c +@@ -123,13 +123,16 @@ + static int lltrace; + static int prtrace(PyObject *, char *); + #endif +-static int call_trace(Py_tracefunc, PyObject *, PyFrameObject *, ++static int call_trace(Py_tracefunc, PyObject *, ++ PyThreadState *, PyFrameObject *, + int, PyObject *); + static int call_trace_protected(Py_tracefunc, PyObject *, +- PyFrameObject *, int, PyObject *); +-static void call_exc_trace(Py_tracefunc, PyObject *, PyFrameObject *); ++ PyThreadState *, PyFrameObject *, ++ int, PyObject *); ++static void call_exc_trace(Py_tracefunc, PyObject *, ++ PyThreadState *, PyFrameObject *); + static int maybe_call_line_trace(Py_tracefunc, PyObject *, +- PyFrameObject *, int *, int *, int *); ++ PyThreadState *, PyFrameObject *, int *, int *, int *); + + static PyObject * cmp_outcome(int, PyObject *, PyObject *); + static PyObject * import_from(PyObject *, PyObject *); +@@ -1136,7 +1139,7 @@ + whenever an exception is detected. */ + if (call_trace_protected(tstate->c_tracefunc, + tstate->c_traceobj, +- f, PyTrace_CALL, Py_None)) { ++ tstate, f, PyTrace_CALL, Py_None)) { + /* Trace function raised an error */ + goto exit_eval_frame; + } +@@ -1146,7 +1149,7 @@ + return itself and isn't called for "line" events */ + if (call_trace_protected(tstate->c_profilefunc, + tstate->c_profileobj, +- f, PyTrace_CALL, Py_None)) { ++ tstate, f, PyTrace_CALL, Py_None)) { + /* Profile function raised an error */ + goto exit_eval_frame; + } +@@ -1293,8 +1296,8 @@ + + err = maybe_call_line_trace(tstate->c_tracefunc, + tstate->c_traceobj, +- f, &instr_lb, &instr_ub, +- &instr_prev); ++ tstate, f, ++ &instr_lb, &instr_ub, &instr_prev); + /* Reload possibly changed frame fields */ + JUMPTO(f->f_lasti); + if (f->f_stacktop != NULL) { +@@ -1906,7 +1909,7 @@ + PyObject *val; + if (tstate->c_tracefunc != NULL + && PyErr_ExceptionMatches(PyExc_StopIteration)) +- call_exc_trace(tstate->c_tracefunc, tstate->c_traceobj, f); ++ call_exc_trace(tstate->c_tracefunc, tstate->c_traceobj, tstate, f); + err = _PyGen_FetchStopIterationValue(&val); + if (err < 0) + goto error; +@@ -2658,7 +2661,7 @@ + if (!PyErr_ExceptionMatches(PyExc_StopIteration)) + goto error; + else if (tstate->c_tracefunc != NULL) +- call_exc_trace(tstate->c_tracefunc, tstate->c_traceobj, f); ++ call_exc_trace(tstate->c_tracefunc, tstate->c_traceobj, tstate, f); + PyErr_Clear(); + } + /* iterator ended normally */ +@@ -3054,7 +3057,8 @@ + PyTraceBack_Here(f); + + if (tstate->c_tracefunc != NULL) +- call_exc_trace(tstate->c_tracefunc, tstate->c_traceobj, f); ++ call_exc_trace(tstate->c_tracefunc, tstate->c_traceobj, ++ tstate, f); + + fast_block_end: + assert(why != WHY_NOT); +@@ -3182,8 +3186,8 @@ + if (tstate->use_tracing) { + if (tstate->c_tracefunc) { + if (why == WHY_RETURN || why == WHY_YIELD) { +- if (call_trace(tstate->c_tracefunc, +- tstate->c_traceobj, f, ++ if (call_trace(tstate->c_tracefunc, tstate->c_traceobj, ++ tstate, f, + PyTrace_RETURN, retval)) { + Py_XDECREF(retval); + retval = NULL; +@@ -3191,18 +3195,19 @@ + } + } + else if (why == WHY_EXCEPTION) { +- call_trace_protected(tstate->c_tracefunc, +- tstate->c_traceobj, f, ++ call_trace_protected(tstate->c_tracefunc, tstate->c_traceobj, ++ tstate, f, + PyTrace_RETURN, NULL); + } + } + if (tstate->c_profilefunc) { + if (why == WHY_EXCEPTION) + call_trace_protected(tstate->c_profilefunc, +- tstate->c_profileobj, f, ++ tstate->c_profileobj, ++ tstate, f, + PyTrace_RETURN, NULL); +- else if (call_trace(tstate->c_profilefunc, +- tstate->c_profileobj, f, ++ else if (call_trace(tstate->c_profilefunc, tstate->c_profileobj, ++ tstate, f, + PyTrace_RETURN, retval)) { + Py_XDECREF(retval); + retval = NULL; +@@ -3846,7 +3851,8 @@ + #endif + + static void +-call_exc_trace(Py_tracefunc func, PyObject *self, PyFrameObject *f) ++call_exc_trace(Py_tracefunc func, PyObject *self, ++ PyThreadState *tstate, PyFrameObject *f) + { + PyObject *type, *value, *traceback, *orig_traceback, *arg; + int err; +@@ -3862,7 +3868,7 @@ + PyErr_Restore(type, value, orig_traceback); + return; + } +- err = call_trace(func, self, f, PyTrace_EXCEPTION, arg); ++ err = call_trace(func, self, tstate, f, PyTrace_EXCEPTION, arg); + Py_DECREF(arg); + if (err == 0) + PyErr_Restore(type, value, orig_traceback); +@@ -3874,13 +3880,14 @@ + } + + static int +-call_trace_protected(Py_tracefunc func, PyObject *obj, PyFrameObject *frame, ++call_trace_protected(Py_tracefunc func, PyObject *obj, ++ PyThreadState *tstate, PyFrameObject *frame, + int what, PyObject *arg) + { + PyObject *type, *value, *traceback; + int err; + PyErr_Fetch(&type, &value, &traceback); +- err = call_trace(func, obj, frame, what, arg); ++ err = call_trace(func, obj, tstate, frame, what, arg); + if (err == 0) + { + PyErr_Restore(type, value, traceback); +@@ -3895,10 +3902,10 @@ + } + + static int +-call_trace(Py_tracefunc func, PyObject *obj, PyFrameObject *frame, ++call_trace(Py_tracefunc func, PyObject *obj, ++ PyThreadState *tstate, PyFrameObject *frame, + int what, PyObject *arg) + { +- PyThreadState *tstate = frame->f_tstate; + int result; + if (tstate->tracing) + return 0; +@@ -3914,8 +3921,7 @@ + PyObject * + _PyEval_CallTracing(PyObject *func, PyObject *args) + { +- PyFrameObject *frame = PyEval_GetFrame(); +- PyThreadState *tstate = frame->f_tstate; ++ PyThreadState *tstate = PyThreadState_GET(); + int save_tracing = tstate->tracing; + int save_use_tracing = tstate->use_tracing; + PyObject *result; +@@ -3932,8 +3938,8 @@ + /* See Objects/lnotab_notes.txt for a description of how tracing works. */ + static int + maybe_call_line_trace(Py_tracefunc func, PyObject *obj, +- PyFrameObject *frame, int *instr_lb, int *instr_ub, +- int *instr_prev) ++ PyThreadState *tstate, PyFrameObject *frame, ++ int *instr_lb, int *instr_ub, int *instr_prev) + { + int result = 0; + int line = frame->f_lineno; +@@ -3953,7 +3959,7 @@ + number and call the trace function. */ + if (frame->f_lasti == *instr_lb || frame->f_lasti < *instr_prev) { + frame->f_lineno = line; +- result = call_trace(func, obj, frame, PyTrace_LINE, Py_None); ++ result = call_trace(func, obj, tstate, frame, PyTrace_LINE, Py_None); + } + *instr_prev = frame->f_lasti; + return result; +@@ -4149,10 +4155,9 @@ + + #define C_TRACE(x, call) \ + if (tstate->use_tracing && tstate->c_profilefunc) { \ +- if (call_trace(tstate->c_profilefunc, \ +- tstate->c_profileobj, \ +- tstate->frame, PyTrace_C_CALL, \ +- func)) { \ ++ if (call_trace(tstate->c_profilefunc, tstate->c_profileobj, \ ++ tstate, tstate->frame, \ ++ PyTrace_C_CALL, func)) { \ + x = NULL; \ + } \ + else { \ +@@ -4161,14 +4166,14 @@ + if (x == NULL) { \ + call_trace_protected(tstate->c_profilefunc, \ + tstate->c_profileobj, \ +- tstate->frame, PyTrace_C_EXCEPTION, \ +- func); \ ++ tstate, tstate->frame, \ ++ PyTrace_C_EXCEPTION, func); \ + /* XXX should pass (type, value, tb) */ \ + } else { \ + if (call_trace(tstate->c_profilefunc, \ + tstate->c_profileobj, \ +- tstate->frame, PyTrace_C_RETURN, \ +- func)) { \ ++ tstate, tstate->frame, \ ++ PyTrace_C_RETURN, func)) { \ + Py_DECREF(x); \ + x = NULL; \ + } \ +diff -r 3405dc9a6afa Python/compile.c +--- a/Python/compile.c ++++ b/Python/compile.c +@@ -3899,7 +3899,7 @@ + a->a_lnotab = PyBytes_FromStringAndSize(NULL, DEFAULT_LNOTAB_SIZE); + if (!a->a_lnotab) + return 0; +- if (nblocks > PY_SIZE_MAX / sizeof(basicblock *)) { ++ if ((size_t)nblocks > PY_SIZE_MAX / sizeof(basicblock *)) { + PyErr_NoMemory(); + return 0; + } +diff -r 3405dc9a6afa Python/dtoa.c +--- a/Python/dtoa.c ++++ b/Python/dtoa.c +@@ -204,7 +204,24 @@ + MAX_ABS_EXP in absolute value get truncated to +-MAX_ABS_EXP. MAX_ABS_EXP + should fit into an int. */ + #ifndef MAX_ABS_EXP +-#define MAX_ABS_EXP 19999U ++#define MAX_ABS_EXP 1100000000U ++#endif ++/* Bound on length of pieces of input strings in _Py_dg_strtod; specifically, ++ this is used to bound the total number of digits ignoring leading zeros and ++ the number of digits that follow the decimal point. Ideally, MAX_DIGITS ++ should satisfy MAX_DIGITS + 400 < MAX_ABS_EXP; that ensures that the ++ exponent clipping in _Py_dg_strtod can't affect the value of the output. */ ++#ifndef MAX_DIGITS ++#define MAX_DIGITS 1000000000U ++#endif ++ ++/* Guard against trying to use the above values on unusual platforms with ints ++ * of width less than 32 bits. */ ++#if MAX_ABS_EXP > INT_MAX ++#error "MAX_ABS_EXP should fit in an int" ++#endif ++#if MAX_DIGITS > INT_MAX ++#error "MAX_DIGITS should fit in an int" + #endif + + /* The following definition of Storeinc is appropriate for MIPS processors. +@@ -1538,6 +1555,7 @@ + Long L; + BCinfo bc; + Bigint *bb, *bb1, *bd, *bd0, *bs, *delta; ++ size_t ndigits, fraclen; + + dval(&rv) = 0.; + +@@ -1560,40 +1578,53 @@ + c = *++s; + lz = s != s1; + +- /* Point s0 at the first nonzero digit (if any). nd0 will be the position +- of the point relative to s0. nd will be the total number of digits +- ignoring leading zeros. */ ++ /* Point s0 at the first nonzero digit (if any). fraclen will be the ++ number of digits between the decimal point and the end of the ++ digit string. ndigits will be the total number of digits ignoring ++ leading zeros. */ + s0 = s1 = s; + while ('0' <= c && c <= '9') + c = *++s; +- nd0 = nd = s - s1; ++ ndigits = s - s1; ++ fraclen = 0; + + /* Parse decimal point and following digits. */ + if (c == '.') { + c = *++s; +- if (!nd) { ++ if (!ndigits) { + s1 = s; + while (c == '0') + c = *++s; + lz = lz || s != s1; +- nd0 -= s - s1; ++ fraclen += (s - s1); + s0 = s; + } + s1 = s; + while ('0' <= c && c <= '9') + c = *++s; +- nd += s - s1; ++ ndigits += s - s1; ++ fraclen += s - s1; + } + +- /* Now lz is true if and only if there were leading zero digits, and nd +- gives the total number of digits ignoring leading zeros. A valid input +- must have at least one digit. */ +- if (!nd && !lz) { ++ /* Now lz is true if and only if there were leading zero digits, and ++ ndigits gives the total number of digits ignoring leading zeros. A ++ valid input must have at least one digit. */ ++ if (!ndigits && !lz) { + if (se) + *se = (char *)s00; + goto parse_error; + } + ++ /* Range check ndigits and fraclen to make sure that they, and values ++ computed with them, can safely fit in an int. */ ++ if (ndigits > MAX_DIGITS || fraclen > MAX_DIGITS) { ++ if (se) ++ *se = (char *)s00; ++ goto parse_error; ++ } ++ nd = (int)ndigits; ++ nd0 = (int)ndigits - (int)fraclen; ++ + /* Parse exponent. */ + e = 0; + if (c == 'e' || c == 'E') { +diff -r 3405dc9a6afa Python/dynload_shlib.c +--- a/Python/dynload_shlib.c ++++ b/Python/dynload_shlib.c +@@ -36,25 +36,16 @@ + #ifdef __CYGWIN__ + ".dll", + #else /* !__CYGWIN__ */ +-#ifdef __VMS +- ".exe", +- ".EXE", +-#else /* !__VMS */ + "." SOABI ".so", + ".abi" PYTHON_ABI_STRING ".so", + ".so", +-#endif /* __VMS */ + #endif /* __CYGWIN__ */ + NULL, + }; + + static struct { + dev_t dev; +-#ifdef __VMS +- ino_t ino[3]; +-#else + ino_t ino; +-#endif + void *handle; + } handles[128]; + static int nhandles = 0; +@@ -95,29 +86,12 @@ + } + if (nhandles < 128) { + handles[nhandles].dev = statb.st_dev; +-#ifdef __VMS +- handles[nhandles].ino[0] = statb.st_ino[0]; +- handles[nhandles].ino[1] = statb.st_ino[1]; +- handles[nhandles].ino[2] = statb.st_ino[2]; +-#else + handles[nhandles].ino = statb.st_ino; +-#endif + } + } + + dlopenflags = PyThreadState_GET()->interp->dlopenflags; + +-#ifdef __VMS +- /* VMS currently don't allow a pathname, use a logical name instead */ +- /* Concatenate 'python_module_' and shortname */ +- /* so "import vms.bar" will use the logical python_module_bar */ +- /* As C module use only one name space this is probably not a */ +- /* important limitation */ +- PyOS_snprintf(pathbuf, sizeof(pathbuf), "python_module_%-.200s", +- shortname); +- pathname = pathbuf; +-#endif +- + handle = dlopen(pathname, dlopenflags); + + if (handle == NULL) { +diff -r 3405dc9a6afa Python/importlib.h +--- a/Python/importlib.h ++++ b/Python/importlib.h +@@ -1,8 +1,8 @@ + /* Auto-generated by Modules/_freeze_importlib.c */ + const unsigned char _Py_M__importlib[] = { + 99,0,0,0,0,0,0,0,0,0,0,0,0,7,0,0, +- 0,64,0,0,0,115,182,4,0,0,100,0,0,90,0,0, +- 100,157,0,90,1,0,100,4,0,100,5,0,132,0,0,90, ++ 0,64,0,0,0,115,201,4,0,0,100,0,0,90,0,0, ++ 100,159,0,90,1,0,100,4,0,100,5,0,132,0,0,90, + 2,0,100,6,0,100,7,0,132,0,0,90,3,0,100,8, + 0,100,9,0,132,0,0,90,4,0,100,10,0,100,11,0, + 132,0,0,90,5,0,100,12,0,100,13,0,132,0,0,90, +@@ -12,1474 +12,1538 @@ + 10,0,100,22,0,100,23,0,100,24,0,132,1,0,90,11, + 0,100,25,0,100,26,0,132,0,0,90,12,0,100,27,0, + 100,28,0,132,0,0,90,13,0,101,14,0,101,12,0,106, +- 15,0,131,1,0,90,16,0,105,0,0,90,17,0,105,0, +- 0,90,18,0,71,100,29,0,100,30,0,132,0,0,100,30, +- 0,101,19,0,131,3,0,90,20,0,71,100,31,0,100,32, +- 0,132,0,0,100,32,0,131,2,0,90,21,0,71,100,33, ++ 15,0,131,1,0,90,16,0,71,100,29,0,100,30,0,132, ++ 0,0,100,30,0,131,2,0,90,17,0,105,0,0,90,18, ++ 0,105,0,0,90,19,0,71,100,31,0,100,32,0,132,0, ++ 0,100,32,0,101,20,0,131,3,0,90,21,0,71,100,33, + 0,100,34,0,132,0,0,100,34,0,131,2,0,90,22,0, + 71,100,35,0,100,36,0,132,0,0,100,36,0,131,2,0, +- 90,23,0,100,37,0,100,38,0,132,0,0,90,24,0,100, +- 39,0,100,40,0,132,0,0,90,25,0,100,41,0,100,42, +- 0,132,0,0,90,26,0,100,43,0,106,27,0,100,44,0, +- 100,45,0,131,2,0,100,46,0,23,90,28,0,101,29,0, +- 106,30,0,101,28,0,100,45,0,131,2,0,90,31,0,100, +- 47,0,90,32,0,100,48,0,103,1,0,90,33,0,100,49, +- 0,103,1,0,90,34,0,100,50,0,103,1,0,90,35,0, +- 100,51,0,100,52,0,100,53,0,132,1,0,90,36,0,100, +- 54,0,100,55,0,132,0,0,90,37,0,100,56,0,100,57, +- 0,132,0,0,90,38,0,100,58,0,100,59,0,132,0,0, +- 90,39,0,100,60,0,100,61,0,100,62,0,100,63,0,132, +- 0,1,90,40,0,100,64,0,100,65,0,132,0,0,90,41, +- 0,100,66,0,100,67,0,132,0,0,90,42,0,100,68,0, +- 100,69,0,132,0,0,90,43,0,100,70,0,100,71,0,132, +- 0,0,90,44,0,100,72,0,100,73,0,132,0,0,90,45, +- 0,100,51,0,100,51,0,100,51,0,100,74,0,100,75,0, +- 132,3,0,90,46,0,100,51,0,100,51,0,100,51,0,100, +- 76,0,100,77,0,132,3,0,90,47,0,100,78,0,100,78, +- 0,100,79,0,100,80,0,132,2,0,90,48,0,100,81,0, +- 100,82,0,132,0,0,90,49,0,100,83,0,100,84,0,132, +- 0,0,90,50,0,71,100,85,0,100,86,0,132,0,0,100, +- 86,0,131,2,0,90,51,0,71,100,87,0,100,88,0,132, +- 0,0,100,88,0,131,2,0,90,52,0,100,89,0,100,51, +- 0,100,90,0,100,51,0,100,91,0,100,92,0,132,0,2, +- 90,53,0,101,54,0,131,0,0,90,55,0,100,51,0,100, +- 93,0,100,51,0,100,94,0,101,55,0,100,95,0,100,96, +- 0,132,1,2,90,56,0,100,51,0,100,51,0,100,97,0, +- 100,98,0,132,2,0,90,57,0,71,100,99,0,100,100,0, +- 132,0,0,100,100,0,131,2,0,90,58,0,71,100,101,0, ++ 90,23,0,71,100,37,0,100,38,0,132,0,0,100,38,0, ++ 131,2,0,90,24,0,100,39,0,100,40,0,132,0,0,90, ++ 25,0,100,41,0,100,42,0,132,0,0,90,26,0,100,43, ++ 0,100,44,0,132,0,0,90,27,0,100,45,0,106,28,0, ++ 100,46,0,100,47,0,131,2,0,100,48,0,23,90,29,0, ++ 101,30,0,106,31,0,101,29,0,100,47,0,131,2,0,90, ++ 32,0,100,49,0,90,33,0,100,50,0,103,1,0,90,34, ++ 0,100,51,0,103,1,0,90,35,0,100,52,0,103,1,0, ++ 90,36,0,100,53,0,100,54,0,100,55,0,132,1,0,90, ++ 37,0,100,56,0,100,57,0,132,0,0,90,38,0,100,58, ++ 0,100,59,0,132,0,0,90,39,0,100,60,0,100,61,0, ++ 132,0,0,90,40,0,100,62,0,100,63,0,100,64,0,100, ++ 65,0,132,0,1,90,41,0,100,66,0,100,67,0,132,0, ++ 0,90,42,0,100,68,0,100,69,0,132,0,0,90,43,0, ++ 100,70,0,100,71,0,132,0,0,90,44,0,100,72,0,100, ++ 73,0,132,0,0,90,45,0,100,74,0,100,75,0,132,0, ++ 0,90,46,0,100,53,0,100,53,0,100,53,0,100,76,0, ++ 100,77,0,132,3,0,90,47,0,100,53,0,100,53,0,100, ++ 53,0,100,78,0,100,79,0,132,3,0,90,48,0,100,80, ++ 0,100,80,0,100,81,0,100,82,0,132,2,0,90,49,0, ++ 100,83,0,100,84,0,132,0,0,90,50,0,100,85,0,100, ++ 86,0,132,0,0,90,51,0,71,100,87,0,100,88,0,132, ++ 0,0,100,88,0,131,2,0,90,52,0,71,100,89,0,100, ++ 90,0,132,0,0,100,90,0,131,2,0,90,53,0,100,91, ++ 0,100,53,0,100,92,0,100,53,0,100,93,0,100,94,0, ++ 132,0,2,90,54,0,101,55,0,131,0,0,90,56,0,100, ++ 53,0,100,95,0,100,53,0,100,96,0,101,56,0,100,97, ++ 0,100,98,0,132,1,2,90,57,0,100,53,0,100,53,0, ++ 100,99,0,100,100,0,132,2,0,90,58,0,71,100,101,0, + 100,102,0,132,0,0,100,102,0,131,2,0,90,59,0,71, + 100,103,0,100,104,0,132,0,0,100,104,0,131,2,0,90, + 60,0,71,100,105,0,100,106,0,132,0,0,100,106,0,131, + 2,0,90,61,0,71,100,107,0,100,108,0,132,0,0,100, + 108,0,131,2,0,90,62,0,71,100,109,0,100,110,0,132, +- 0,0,100,110,0,101,62,0,131,3,0,90,63,0,71,100, +- 111,0,100,112,0,132,0,0,100,112,0,131,2,0,90,64, +- 0,71,100,113,0,100,114,0,132,0,0,100,114,0,101,64, +- 0,101,63,0,131,4,0,90,65,0,71,100,115,0,100,116, +- 0,132,0,0,100,116,0,101,64,0,101,62,0,131,4,0, +- 90,66,0,103,0,0,90,67,0,71,100,117,0,100,118,0, +- 132,0,0,100,118,0,131,2,0,90,68,0,71,100,119,0, ++ 0,0,100,110,0,131,2,0,90,63,0,71,100,111,0,100, ++ 112,0,132,0,0,100,112,0,101,63,0,131,3,0,90,64, ++ 0,71,100,113,0,100,114,0,132,0,0,100,114,0,131,2, ++ 0,90,65,0,71,100,115,0,100,116,0,132,0,0,100,116, ++ 0,101,65,0,101,64,0,131,4,0,90,66,0,71,100,117, ++ 0,100,118,0,132,0,0,100,118,0,101,65,0,101,63,0, ++ 131,4,0,90,67,0,103,0,0,90,68,0,71,100,119,0, + 100,120,0,132,0,0,100,120,0,131,2,0,90,69,0,71, + 100,121,0,100,122,0,132,0,0,100,122,0,131,2,0,90, + 70,0,71,100,123,0,100,124,0,132,0,0,100,124,0,131, + 2,0,90,71,0,71,100,125,0,100,126,0,132,0,0,100, + 126,0,131,2,0,90,72,0,71,100,127,0,100,128,0,132, +- 0,0,100,128,0,131,2,0,90,73,0,100,129,0,100,130, +- 0,132,0,0,90,74,0,100,51,0,100,131,0,100,132,0, +- 132,1,0,90,75,0,100,133,0,100,134,0,132,0,0,90, +- 76,0,100,135,0,90,77,0,101,77,0,100,136,0,23,90, +- 78,0,100,137,0,100,138,0,132,0,0,90,79,0,100,139, +- 0,100,140,0,132,0,0,90,80,0,100,51,0,100,78,0, +- 100,141,0,100,142,0,132,2,0,90,81,0,100,143,0,100, +- 144,0,132,0,0,90,82,0,100,145,0,100,146,0,132,0, +- 0,90,83,0,100,147,0,100,148,0,132,0,0,90,84,0, +- 100,51,0,100,51,0,102,0,0,100,78,0,100,149,0,100, +- 150,0,132,4,0,90,85,0,100,151,0,100,152,0,132,0, +- 0,90,86,0,100,153,0,100,154,0,132,0,0,90,87,0, +- 100,155,0,100,156,0,132,0,0,90,88,0,100,51,0,83, +- 41,158,97,83,1,0,0,67,111,114,101,32,105,109,112,108, +- 101,109,101,110,116,97,116,105,111,110,32,111,102,32,105,109, +- 112,111,114,116,46,10,10,84,104,105,115,32,109,111,100,117, +- 108,101,32,105,115,32,78,79,84,32,109,101,97,110,116,32, +- 116,111,32,98,101,32,100,105,114,101,99,116,108,121,32,105, +- 109,112,111,114,116,101,100,33,32,73,116,32,104,97,115,32, +- 98,101,101,110,32,100,101,115,105,103,110,101,100,32,115,117, +- 99,104,10,116,104,97,116,32,105,116,32,99,97,110,32,98, +- 101,32,98,111,111,116,115,116,114,97,112,112,101,100,32,105, +- 110,116,111,32,80,121,116,104,111,110,32,97,115,32,116,104, +- 101,32,105,109,112,108,101,109,101,110,116,97,116,105,111,110, +- 32,111,102,32,105,109,112,111,114,116,46,32,65,115,10,115, +- 117,99,104,32,105,116,32,114,101,113,117,105,114,101,115,32, +- 116,104,101,32,105,110,106,101,99,116,105,111,110,32,111,102, +- 32,115,112,101,99,105,102,105,99,32,109,111,100,117,108,101, +- 115,32,97,110,100,32,97,116,116,114,105,98,117,116,101,115, +- 32,105,110,32,111,114,100,101,114,32,116,111,10,119,111,114, +- 107,46,32,79,110,101,32,115,104,111,117,108,100,32,117,115, +- 101,32,105,109,112,111,114,116,108,105,98,32,97,115,32,116, +- 104,101,32,112,117,98,108,105,99,45,102,97,99,105,110,103, +- 32,118,101,114,115,105,111,110,32,111,102,32,116,104,105,115, +- 32,109,111,100,117,108,101,46,10,10,218,3,119,105,110,218, +- 6,99,121,103,119,105,110,218,6,100,97,114,119,105,110,99, +- 0,0,0,0,0,0,0,0,1,0,0,0,2,0,0,0, +- 67,0,0,0,115,49,0,0,0,116,0,0,106,1,0,106, +- 2,0,116,3,0,131,1,0,114,33,0,100,1,0,100,2, +- 0,132,0,0,125,0,0,110,12,0,100,3,0,100,2,0, +- 132,0,0,125,0,0,124,0,0,83,41,4,78,99,0,0, +- 0,0,0,0,0,0,0,0,0,0,2,0,0,0,83,0, +- 0,0,115,13,0,0,0,100,1,0,116,0,0,106,1,0, +- 107,6,0,83,41,2,122,53,84,114,117,101,32,105,102,32, +- 102,105,108,101,110,97,109,101,115,32,109,117,115,116,32,98, +- 101,32,99,104,101,99,107,101,100,32,99,97,115,101,45,105, +- 110,115,101,110,115,105,116,105,118,101,108,121,46,115,12,0, +- 0,0,80,89,84,72,79,78,67,65,83,69,79,75,41,2, +- 218,3,95,111,115,90,7,101,110,118,105,114,111,110,169,0, +- 114,4,0,0,0,114,4,0,0,0,250,29,60,102,114,111, +- 122,101,110,32,105,109,112,111,114,116,108,105,98,46,95,98, +- 111,111,116,115,116,114,97,112,62,218,11,95,114,101,108,97, +- 120,95,99,97,115,101,30,0,0,0,115,2,0,0,0,0, +- 2,122,37,95,109,97,107,101,95,114,101,108,97,120,95,99, +- 97,115,101,46,60,108,111,99,97,108,115,62,46,95,114,101, +- 108,97,120,95,99,97,115,101,99,0,0,0,0,0,0,0, +- 0,0,0,0,0,1,0,0,0,83,0,0,0,115,4,0, +- 0,0,100,1,0,83,41,2,122,53,84,114,117,101,32,105, +- 102,32,102,105,108,101,110,97,109,101,115,32,109,117,115,116, +- 32,98,101,32,99,104,101,99,107,101,100,32,99,97,115,101, +- 45,105,110,115,101,110,115,105,116,105,118,101,108,121,46,70, +- 114,4,0,0,0,114,4,0,0,0,114,4,0,0,0,114, +- 4,0,0,0,114,5,0,0,0,114,6,0,0,0,34,0, +- 0,0,115,2,0,0,0,0,2,41,4,218,3,115,121,115, +- 218,8,112,108,97,116,102,111,114,109,218,10,115,116,97,114, +- 116,115,119,105,116,104,218,27,95,67,65,83,69,95,73,78, +- 83,69,78,83,73,84,73,86,69,95,80,76,65,84,70,79, +- 82,77,83,41,1,114,6,0,0,0,114,4,0,0,0,114, +- 4,0,0,0,114,5,0,0,0,218,16,95,109,97,107,101, +- 95,114,101,108,97,120,95,99,97,115,101,28,0,0,0,115, +- 8,0,0,0,0,1,18,1,15,4,12,3,114,11,0,0, +- 0,99,1,0,0,0,0,0,0,0,1,0,0,0,3,0, +- 0,0,67,0,0,0,115,26,0,0,0,116,0,0,124,0, +- 0,131,1,0,100,1,0,64,106,1,0,100,2,0,100,3, +- 0,131,2,0,83,41,4,122,42,67,111,110,118,101,114,116, +- 32,97,32,51,50,45,98,105,116,32,105,110,116,101,103,101, +- 114,32,116,111,32,108,105,116,116,108,101,45,101,110,100,105, +- 97,110,46,108,3,0,0,0,255,127,255,127,3,0,233,4, +- 0,0,0,218,6,108,105,116,116,108,101,41,2,218,3,105, +- 110,116,218,8,116,111,95,98,121,116,101,115,41,1,218,1, +- 120,114,4,0,0,0,114,4,0,0,0,114,5,0,0,0, +- 218,7,95,119,95,108,111,110,103,40,0,0,0,115,2,0, +- 0,0,0,2,114,17,0,0,0,99,1,0,0,0,0,0, +- 0,0,1,0,0,0,3,0,0,0,67,0,0,0,115,16, +- 0,0,0,116,0,0,106,1,0,124,0,0,100,1,0,131, +- 2,0,83,41,2,122,47,67,111,110,118,101,114,116,32,52, +- 32,98,121,116,101,115,32,105,110,32,108,105,116,116,108,101, +- 45,101,110,100,105,97,110,32,116,111,32,97,110,32,105,110, +- 116,101,103,101,114,46,114,13,0,0,0,41,2,114,14,0, +- 0,0,218,10,102,114,111,109,95,98,121,116,101,115,41,1, +- 90,9,105,110,116,95,98,121,116,101,115,114,4,0,0,0, +- 114,4,0,0,0,114,5,0,0,0,218,7,95,114,95,108, +- 111,110,103,45,0,0,0,115,2,0,0,0,0,2,114,19, +- 0,0,0,99,0,0,0,0,0,0,0,0,1,0,0,0, +- 3,0,0,0,71,0,0,0,115,26,0,0,0,116,0,0, +- 106,1,0,100,1,0,100,2,0,132,0,0,124,0,0,68, +- 131,1,0,131,1,0,83,41,3,122,31,82,101,112,108,97, +- 99,101,109,101,110,116,32,102,111,114,32,111,115,46,112,97, +- 116,104,46,106,111,105,110,40,41,46,99,1,0,0,0,0, +- 0,0,0,2,0,0,0,4,0,0,0,83,0,0,0,115, +- 37,0,0,0,103,0,0,124,0,0,93,27,0,125,1,0, +- 124,1,0,114,6,0,124,1,0,106,0,0,116,1,0,131, +- 1,0,145,2,0,113,6,0,83,114,4,0,0,0,41,2, +- 218,6,114,115,116,114,105,112,218,15,112,97,116,104,95,115, +- 101,112,97,114,97,116,111,114,115,41,2,218,2,46,48,218, +- 4,112,97,114,116,114,4,0,0,0,114,4,0,0,0,114, +- 5,0,0,0,250,10,60,108,105,115,116,99,111,109,112,62, +- 52,0,0,0,115,2,0,0,0,9,1,122,30,95,112,97, +- 116,104,95,106,111,105,110,46,60,108,111,99,97,108,115,62, +- 46,60,108,105,115,116,99,111,109,112,62,41,2,218,8,112, +- 97,116,104,95,115,101,112,218,4,106,111,105,110,41,1,218, +- 10,112,97,116,104,95,112,97,114,116,115,114,4,0,0,0, +- 114,4,0,0,0,114,5,0,0,0,218,10,95,112,97,116, +- 104,95,106,111,105,110,50,0,0,0,115,4,0,0,0,0, +- 2,15,1,114,28,0,0,0,99,1,0,0,0,0,0,0, +- 0,5,0,0,0,5,0,0,0,67,0,0,0,115,134,0, +- 0,0,116,0,0,116,1,0,131,1,0,100,1,0,107,2, +- 0,114,52,0,124,0,0,106,2,0,116,3,0,131,1,0, +- 92,3,0,125,1,0,125,2,0,125,3,0,124,1,0,124, +- 3,0,102,2,0,83,120,69,0,116,4,0,124,0,0,131, +- 1,0,68,93,55,0,125,4,0,124,4,0,116,1,0,107, +- 6,0,114,65,0,124,0,0,106,5,0,124,4,0,100,2, +- 0,100,1,0,131,1,1,92,2,0,125,1,0,125,3,0, +- 124,1,0,124,3,0,102,2,0,83,113,65,0,87,100,3, +- 0,124,0,0,102,2,0,83,41,4,122,32,82,101,112,108, +- 97,99,101,109,101,110,116,32,102,111,114,32,111,115,46,112, +- 97,116,104,46,115,112,108,105,116,40,41,46,233,1,0,0, +- 0,90,8,109,97,120,115,112,108,105,116,218,0,41,6,218, +- 3,108,101,110,114,21,0,0,0,218,10,114,112,97,114,116, +- 105,116,105,111,110,114,25,0,0,0,218,8,114,101,118,101, +- 114,115,101,100,218,6,114,115,112,108,105,116,41,5,218,4, +- 112,97,116,104,90,5,102,114,111,110,116,218,1,95,218,4, +- 116,97,105,108,114,16,0,0,0,114,4,0,0,0,114,4, +- 0,0,0,114,5,0,0,0,218,11,95,112,97,116,104,95, +- 115,112,108,105,116,56,0,0,0,115,16,0,0,0,0,2, +- 18,1,24,1,10,1,19,1,12,1,27,1,14,1,114,38, ++ 0,0,100,128,0,131,2,0,90,73,0,71,100,129,0,100, ++ 130,0,132,0,0,100,130,0,131,2,0,90,74,0,100,131, ++ 0,100,132,0,132,0,0,90,75,0,100,53,0,100,133,0, ++ 100,134,0,132,1,0,90,76,0,100,135,0,100,136,0,132, ++ 0,0,90,77,0,100,137,0,90,78,0,101,78,0,100,138, ++ 0,23,90,79,0,100,139,0,100,140,0,132,0,0,90,80, ++ 0,100,141,0,100,142,0,132,0,0,90,81,0,100,53,0, ++ 100,80,0,100,143,0,100,144,0,132,2,0,90,82,0,100, ++ 145,0,100,146,0,132,0,0,90,83,0,100,147,0,100,148, ++ 0,132,0,0,90,84,0,100,149,0,100,150,0,132,0,0, ++ 90,85,0,100,53,0,100,53,0,102,0,0,100,80,0,100, ++ 151,0,100,152,0,132,4,0,90,86,0,100,153,0,100,154, ++ 0,132,0,0,90,87,0,100,155,0,100,156,0,132,0,0, ++ 90,88,0,100,157,0,100,158,0,132,0,0,90,89,0,100, ++ 53,0,83,41,160,97,83,1,0,0,67,111,114,101,32,105, ++ 109,112,108,101,109,101,110,116,97,116,105,111,110,32,111,102, ++ 32,105,109,112,111,114,116,46,10,10,84,104,105,115,32,109, ++ 111,100,117,108,101,32,105,115,32,78,79,84,32,109,101,97, ++ 110,116,32,116,111,32,98,101,32,100,105,114,101,99,116,108, ++ 121,32,105,109,112,111,114,116,101,100,33,32,73,116,32,104, ++ 97,115,32,98,101,101,110,32,100,101,115,105,103,110,101,100, ++ 32,115,117,99,104,10,116,104,97,116,32,105,116,32,99,97, ++ 110,32,98,101,32,98,111,111,116,115,116,114,97,112,112,101, ++ 100,32,105,110,116,111,32,80,121,116,104,111,110,32,97,115, ++ 32,116,104,101,32,105,109,112,108,101,109,101,110,116,97,116, ++ 105,111,110,32,111,102,32,105,109,112,111,114,116,46,32,65, ++ 115,10,115,117,99,104,32,105,116,32,114,101,113,117,105,114, ++ 101,115,32,116,104,101,32,105,110,106,101,99,116,105,111,110, ++ 32,111,102,32,115,112,101,99,105,102,105,99,32,109,111,100, ++ 117,108,101,115,32,97,110,100,32,97,116,116,114,105,98,117, ++ 116,101,115,32,105,110,32,111,114,100,101,114,32,116,111,10, ++ 119,111,114,107,46,32,79,110,101,32,115,104,111,117,108,100, ++ 32,117,115,101,32,105,109,112,111,114,116,108,105,98,32,97, ++ 115,32,116,104,101,32,112,117,98,108,105,99,45,102,97,99, ++ 105,110,103,32,118,101,114,115,105,111,110,32,111,102,32,116, ++ 104,105,115,32,109,111,100,117,108,101,46,10,10,218,3,119, ++ 105,110,218,6,99,121,103,119,105,110,218,6,100,97,114,119, ++ 105,110,99,0,0,0,0,0,0,0,0,1,0,0,0,2, ++ 0,0,0,67,0,0,0,115,49,0,0,0,116,0,0,106, ++ 1,0,106,2,0,116,3,0,131,1,0,114,33,0,100,1, ++ 0,100,2,0,132,0,0,125,0,0,110,12,0,100,3,0, ++ 100,2,0,132,0,0,125,0,0,124,0,0,83,41,4,78, ++ 99,0,0,0,0,0,0,0,0,0,0,0,0,2,0,0, ++ 0,83,0,0,0,115,13,0,0,0,100,1,0,116,0,0, ++ 106,1,0,107,6,0,83,41,2,122,53,84,114,117,101,32, ++ 105,102,32,102,105,108,101,110,97,109,101,115,32,109,117,115, ++ 116,32,98,101,32,99,104,101,99,107,101,100,32,99,97,115, ++ 101,45,105,110,115,101,110,115,105,116,105,118,101,108,121,46, ++ 115,12,0,0,0,80,89,84,72,79,78,67,65,83,69,79, ++ 75,41,2,218,3,95,111,115,90,7,101,110,118,105,114,111, ++ 110,169,0,114,4,0,0,0,114,4,0,0,0,250,29,60, ++ 102,114,111,122,101,110,32,105,109,112,111,114,116,108,105,98, ++ 46,95,98,111,111,116,115,116,114,97,112,62,218,11,95,114, ++ 101,108,97,120,95,99,97,115,101,30,0,0,0,115,2,0, ++ 0,0,0,2,122,37,95,109,97,107,101,95,114,101,108,97, ++ 120,95,99,97,115,101,46,60,108,111,99,97,108,115,62,46, ++ 95,114,101,108,97,120,95,99,97,115,101,99,0,0,0,0, ++ 0,0,0,0,0,0,0,0,1,0,0,0,83,0,0,0, ++ 115,4,0,0,0,100,1,0,83,41,2,122,53,84,114,117, ++ 101,32,105,102,32,102,105,108,101,110,97,109,101,115,32,109, ++ 117,115,116,32,98,101,32,99,104,101,99,107,101,100,32,99, ++ 97,115,101,45,105,110,115,101,110,115,105,116,105,118,101,108, ++ 121,46,70,114,4,0,0,0,114,4,0,0,0,114,4,0, ++ 0,0,114,4,0,0,0,114,5,0,0,0,114,6,0,0, ++ 0,34,0,0,0,115,2,0,0,0,0,2,41,4,218,3, ++ 115,121,115,218,8,112,108,97,116,102,111,114,109,218,10,115, ++ 116,97,114,116,115,119,105,116,104,218,27,95,67,65,83,69, ++ 95,73,78,83,69,78,83,73,84,73,86,69,95,80,76,65, ++ 84,70,79,82,77,83,41,1,114,6,0,0,0,114,4,0, ++ 0,0,114,4,0,0,0,114,5,0,0,0,218,16,95,109, ++ 97,107,101,95,114,101,108,97,120,95,99,97,115,101,28,0, ++ 0,0,115,8,0,0,0,0,1,18,1,15,4,12,3,114, ++ 11,0,0,0,99,1,0,0,0,0,0,0,0,1,0,0, ++ 0,3,0,0,0,67,0,0,0,115,26,0,0,0,116,0, ++ 0,124,0,0,131,1,0,100,1,0,64,106,1,0,100,2, ++ 0,100,3,0,131,2,0,83,41,4,122,42,67,111,110,118, ++ 101,114,116,32,97,32,51,50,45,98,105,116,32,105,110,116, ++ 101,103,101,114,32,116,111,32,108,105,116,116,108,101,45,101, ++ 110,100,105,97,110,46,108,3,0,0,0,255,127,255,127,3, ++ 0,233,4,0,0,0,218,6,108,105,116,116,108,101,41,2, ++ 218,3,105,110,116,218,8,116,111,95,98,121,116,101,115,41, ++ 1,218,1,120,114,4,0,0,0,114,4,0,0,0,114,5, ++ 0,0,0,218,7,95,119,95,108,111,110,103,40,0,0,0, ++ 115,2,0,0,0,0,2,114,17,0,0,0,99,1,0,0, ++ 0,0,0,0,0,1,0,0,0,3,0,0,0,67,0,0, ++ 0,115,16,0,0,0,116,0,0,106,1,0,124,0,0,100, ++ 1,0,131,2,0,83,41,2,122,47,67,111,110,118,101,114, ++ 116,32,52,32,98,121,116,101,115,32,105,110,32,108,105,116, ++ 116,108,101,45,101,110,100,105,97,110,32,116,111,32,97,110, ++ 32,105,110,116,101,103,101,114,46,114,13,0,0,0,41,2, ++ 114,14,0,0,0,218,10,102,114,111,109,95,98,121,116,101, ++ 115,41,1,90,9,105,110,116,95,98,121,116,101,115,114,4, ++ 0,0,0,114,4,0,0,0,114,5,0,0,0,218,7,95, ++ 114,95,108,111,110,103,45,0,0,0,115,2,0,0,0,0, ++ 2,114,19,0,0,0,99,0,0,0,0,0,0,0,0,1, ++ 0,0,0,3,0,0,0,71,0,0,0,115,26,0,0,0, ++ 116,0,0,106,1,0,100,1,0,100,2,0,132,0,0,124, ++ 0,0,68,131,1,0,131,1,0,83,41,3,122,31,82,101, ++ 112,108,97,99,101,109,101,110,116,32,102,111,114,32,111,115, ++ 46,112,97,116,104,46,106,111,105,110,40,41,46,99,1,0, ++ 0,0,0,0,0,0,2,0,0,0,4,0,0,0,83,0, ++ 0,0,115,37,0,0,0,103,0,0,124,0,0,93,27,0, ++ 125,1,0,124,1,0,114,6,0,124,1,0,106,0,0,116, ++ 1,0,131,1,0,145,2,0,113,6,0,83,114,4,0,0, ++ 0,41,2,218,6,114,115,116,114,105,112,218,15,112,97,116, ++ 104,95,115,101,112,97,114,97,116,111,114,115,41,2,218,2, ++ 46,48,218,4,112,97,114,116,114,4,0,0,0,114,4,0, ++ 0,0,114,5,0,0,0,250,10,60,108,105,115,116,99,111, ++ 109,112,62,52,0,0,0,115,2,0,0,0,9,1,122,30, ++ 95,112,97,116,104,95,106,111,105,110,46,60,108,111,99,97, ++ 108,115,62,46,60,108,105,115,116,99,111,109,112,62,41,2, ++ 218,8,112,97,116,104,95,115,101,112,218,4,106,111,105,110, ++ 41,1,218,10,112,97,116,104,95,112,97,114,116,115,114,4, ++ 0,0,0,114,4,0,0,0,114,5,0,0,0,218,10,95, ++ 112,97,116,104,95,106,111,105,110,50,0,0,0,115,4,0, ++ 0,0,0,2,15,1,114,28,0,0,0,99,1,0,0,0, ++ 0,0,0,0,5,0,0,0,5,0,0,0,67,0,0,0, ++ 115,134,0,0,0,116,0,0,116,1,0,131,1,0,100,1, ++ 0,107,2,0,114,52,0,124,0,0,106,2,0,116,3,0, ++ 131,1,0,92,3,0,125,1,0,125,2,0,125,3,0,124, ++ 1,0,124,3,0,102,2,0,83,120,69,0,116,4,0,124, ++ 0,0,131,1,0,68,93,55,0,125,4,0,124,4,0,116, ++ 1,0,107,6,0,114,65,0,124,0,0,106,5,0,124,4, ++ 0,100,2,0,100,1,0,131,1,1,92,2,0,125,1,0, ++ 125,3,0,124,1,0,124,3,0,102,2,0,83,113,65,0, ++ 87,100,3,0,124,0,0,102,2,0,83,41,4,122,32,82, ++ 101,112,108,97,99,101,109,101,110,116,32,102,111,114,32,111, ++ 115,46,112,97,116,104,46,115,112,108,105,116,40,41,46,233, ++ 1,0,0,0,90,8,109,97,120,115,112,108,105,116,218,0, ++ 41,6,218,3,108,101,110,114,21,0,0,0,218,10,114,112, ++ 97,114,116,105,116,105,111,110,114,25,0,0,0,218,8,114, ++ 101,118,101,114,115,101,100,218,6,114,115,112,108,105,116,41, ++ 5,218,4,112,97,116,104,90,5,102,114,111,110,116,218,1, ++ 95,218,4,116,97,105,108,114,16,0,0,0,114,4,0,0, ++ 0,114,4,0,0,0,114,5,0,0,0,218,11,95,112,97, ++ 116,104,95,115,112,108,105,116,56,0,0,0,115,16,0,0, ++ 0,0,2,18,1,24,1,10,1,19,1,12,1,27,1,14, ++ 1,114,38,0,0,0,99,1,0,0,0,0,0,0,0,1, ++ 0,0,0,2,0,0,0,67,0,0,0,115,13,0,0,0, ++ 116,0,0,106,1,0,124,0,0,131,1,0,83,41,1,122, ++ 126,83,116,97,116,32,116,104,101,32,112,97,116,104,46,10, ++ 10,32,32,32,32,77,97,100,101,32,97,32,115,101,112,97, ++ 114,97,116,101,32,102,117,110,99,116,105,111,110,32,116,111, ++ 32,109,97,107,101,32,105,116,32,101,97,115,105,101,114,32, ++ 116,111,32,111,118,101,114,114,105,100,101,32,105,110,32,101, ++ 120,112,101,114,105,109,101,110,116,115,10,32,32,32,32,40, ++ 101,46,103,46,32,99,97,99,104,101,32,115,116,97,116,32, ++ 114,101,115,117,108,116,115,41,46,10,10,32,32,32,32,41, ++ 2,114,3,0,0,0,90,4,115,116,97,116,41,1,114,35, ++ 0,0,0,114,4,0,0,0,114,4,0,0,0,114,5,0, ++ 0,0,218,10,95,112,97,116,104,95,115,116,97,116,68,0, ++ 0,0,115,2,0,0,0,0,7,114,39,0,0,0,99,2, ++ 0,0,0,0,0,0,0,3,0,0,0,11,0,0,0,67, ++ 0,0,0,115,58,0,0,0,121,16,0,116,0,0,124,0, ++ 0,131,1,0,125,2,0,87,110,22,0,4,116,1,0,107, ++ 10,0,114,40,0,1,1,1,100,1,0,83,89,110,1,0, ++ 88,124,2,0,106,2,0,100,2,0,64,124,1,0,107,2, ++ 0,83,41,3,122,49,84,101,115,116,32,119,104,101,116,104, ++ 101,114,32,116,104,101,32,112,97,116,104,32,105,115,32,116, ++ 104,101,32,115,112,101,99,105,102,105,101,100,32,109,111,100, ++ 101,32,116,121,112,101,46,70,105,0,240,0,0,41,3,114, ++ 39,0,0,0,218,7,79,83,69,114,114,111,114,218,7,115, ++ 116,95,109,111,100,101,41,3,114,35,0,0,0,218,4,109, ++ 111,100,101,90,9,115,116,97,116,95,105,110,102,111,114,4, ++ 0,0,0,114,4,0,0,0,114,5,0,0,0,218,18,95, ++ 112,97,116,104,95,105,115,95,109,111,100,101,95,116,121,112, ++ 101,78,0,0,0,115,10,0,0,0,0,2,3,1,16,1, ++ 13,1,9,1,114,43,0,0,0,99,1,0,0,0,0,0, ++ 0,0,1,0,0,0,3,0,0,0,67,0,0,0,115,13, ++ 0,0,0,116,0,0,124,0,0,100,1,0,131,2,0,83, ++ 41,2,122,31,82,101,112,108,97,99,101,109,101,110,116,32, ++ 102,111,114,32,111,115,46,112,97,116,104,46,105,115,102,105, ++ 108,101,46,105,0,128,0,0,41,1,114,43,0,0,0,41, ++ 1,114,35,0,0,0,114,4,0,0,0,114,4,0,0,0, ++ 114,5,0,0,0,218,12,95,112,97,116,104,95,105,115,102, ++ 105,108,101,87,0,0,0,115,2,0,0,0,0,2,114,44, + 0,0,0,99,1,0,0,0,0,0,0,0,1,0,0,0, +- 2,0,0,0,67,0,0,0,115,13,0,0,0,116,0,0, +- 106,1,0,124,0,0,131,1,0,83,41,1,122,126,83,116, +- 97,116,32,116,104,101,32,112,97,116,104,46,10,10,32,32, +- 32,32,77,97,100,101,32,97,32,115,101,112,97,114,97,116, +- 101,32,102,117,110,99,116,105,111,110,32,116,111,32,109,97, +- 107,101,32,105,116,32,101,97,115,105,101,114,32,116,111,32, +- 111,118,101,114,114,105,100,101,32,105,110,32,101,120,112,101, +- 114,105,109,101,110,116,115,10,32,32,32,32,40,101,46,103, +- 46,32,99,97,99,104,101,32,115,116,97,116,32,114,101,115, +- 117,108,116,115,41,46,10,10,32,32,32,32,41,2,114,3, +- 0,0,0,90,4,115,116,97,116,41,1,114,35,0,0,0, +- 114,4,0,0,0,114,4,0,0,0,114,5,0,0,0,218, +- 10,95,112,97,116,104,95,115,116,97,116,68,0,0,0,115, +- 2,0,0,0,0,7,114,39,0,0,0,99,2,0,0,0, +- 0,0,0,0,3,0,0,0,11,0,0,0,67,0,0,0, +- 115,58,0,0,0,121,16,0,116,0,0,124,0,0,131,1, +- 0,125,2,0,87,110,22,0,4,116,1,0,107,10,0,114, +- 40,0,1,1,1,100,1,0,83,89,110,1,0,88,124,2, +- 0,106,2,0,100,2,0,64,124,1,0,107,2,0,83,41, +- 3,122,49,84,101,115,116,32,119,104,101,116,104,101,114,32, +- 116,104,101,32,112,97,116,104,32,105,115,32,116,104,101,32, +- 115,112,101,99,105,102,105,101,100,32,109,111,100,101,32,116, +- 121,112,101,46,70,105,0,240,0,0,41,3,114,39,0,0, +- 0,218,7,79,83,69,114,114,111,114,218,7,115,116,95,109, +- 111,100,101,41,3,114,35,0,0,0,218,4,109,111,100,101, +- 90,9,115,116,97,116,95,105,110,102,111,114,4,0,0,0, +- 114,4,0,0,0,114,5,0,0,0,218,18,95,112,97,116, +- 104,95,105,115,95,109,111,100,101,95,116,121,112,101,78,0, +- 0,0,115,10,0,0,0,0,2,3,1,16,1,13,1,9, +- 1,114,43,0,0,0,99,1,0,0,0,0,0,0,0,1, +- 0,0,0,3,0,0,0,67,0,0,0,115,13,0,0,0, +- 116,0,0,124,0,0,100,1,0,131,2,0,83,41,2,122, +- 31,82,101,112,108,97,99,101,109,101,110,116,32,102,111,114, +- 32,111,115,46,112,97,116,104,46,105,115,102,105,108,101,46, +- 105,0,128,0,0,41,1,114,43,0,0,0,41,1,114,35, +- 0,0,0,114,4,0,0,0,114,4,0,0,0,114,5,0, +- 0,0,218,12,95,112,97,116,104,95,105,115,102,105,108,101, +- 87,0,0,0,115,2,0,0,0,0,2,114,44,0,0,0, +- 99,1,0,0,0,0,0,0,0,1,0,0,0,3,0,0, +- 0,67,0,0,0,115,34,0,0,0,124,0,0,115,21,0, +- 116,0,0,106,1,0,131,0,0,125,0,0,110,0,0,116, +- 2,0,124,0,0,100,1,0,131,2,0,83,41,2,122,30, +- 82,101,112,108,97,99,101,109,101,110,116,32,102,111,114,32, +- 111,115,46,112,97,116,104,46,105,115,100,105,114,46,105,0, +- 64,0,0,41,3,114,3,0,0,0,218,6,103,101,116,99, +- 119,100,114,43,0,0,0,41,1,114,35,0,0,0,114,4, +- 0,0,0,114,4,0,0,0,114,5,0,0,0,218,11,95, +- 112,97,116,104,95,105,115,100,105,114,92,0,0,0,115,6, +- 0,0,0,0,2,6,1,15,1,114,46,0,0,0,105,182, +- 1,0,0,99,3,0,0,0,0,0,0,0,6,0,0,0, +- 17,0,0,0,67,0,0,0,115,192,0,0,0,100,1,0, +- 106,0,0,124,0,0,116,1,0,124,0,0,131,1,0,131, +- 2,0,125,3,0,116,2,0,106,3,0,124,3,0,116,2, +- 0,106,4,0,116,2,0,106,5,0,66,116,2,0,106,6, +- 0,66,124,2,0,100,2,0,64,131,3,0,125,4,0,121, +- 60,0,116,7,0,106,8,0,124,4,0,100,3,0,131,2, +- 0,143,20,0,125,5,0,124,5,0,106,9,0,124,1,0, +- 131,1,0,1,87,100,4,0,81,88,116,2,0,106,10,0, +- 124,3,0,124,0,0,131,2,0,1,87,110,59,0,4,116, +- 11,0,107,10,0,114,187,0,1,1,1,121,17,0,116,2, +- 0,106,12,0,124,3,0,131,1,0,1,87,110,18,0,4, +- 116,11,0,107,10,0,114,179,0,1,1,1,89,110,1,0, +- 88,130,0,0,89,110,1,0,88,100,4,0,83,41,5,122, +- 162,66,101,115,116,45,101,102,102,111,114,116,32,102,117,110, +- 99,116,105,111,110,32,116,111,32,119,114,105,116,101,32,100, +- 97,116,97,32,116,111,32,97,32,112,97,116,104,32,97,116, +- 111,109,105,99,97,108,108,121,46,10,32,32,32,32,66,101, +- 32,112,114,101,112,97,114,101,100,32,116,111,32,104,97,110, +- 100,108,101,32,97,32,70,105,108,101,69,120,105,115,116,115, +- 69,114,114,111,114,32,105,102,32,99,111,110,99,117,114,114, +- 101,110,116,32,119,114,105,116,105,110,103,32,111,102,32,116, +- 104,101,10,32,32,32,32,116,101,109,112,111,114,97,114,121, +- 32,102,105,108,101,32,105,115,32,97,116,116,101,109,112,116, +- 101,100,46,122,5,123,125,46,123,125,105,182,1,0,0,90, +- 2,119,98,78,41,13,218,6,102,111,114,109,97,116,218,2, +- 105,100,114,3,0,0,0,90,4,111,112,101,110,90,6,79, +- 95,69,88,67,76,90,7,79,95,67,82,69,65,84,90,8, +- 79,95,87,82,79,78,76,89,218,3,95,105,111,218,6,70, +- 105,108,101,73,79,218,5,119,114,105,116,101,218,7,114,101, +- 112,108,97,99,101,114,40,0,0,0,90,6,117,110,108,105, +- 110,107,41,6,114,35,0,0,0,218,4,100,97,116,97,114, +- 42,0,0,0,90,8,112,97,116,104,95,116,109,112,90,2, +- 102,100,218,4,102,105,108,101,114,4,0,0,0,114,4,0, +- 0,0,114,5,0,0,0,218,13,95,119,114,105,116,101,95, +- 97,116,111,109,105,99,99,0,0,0,115,26,0,0,0,0, +- 5,24,1,9,1,33,1,3,3,21,1,19,1,20,1,13, +- 1,3,1,17,1,13,1,5,1,114,55,0,0,0,99,2, +- 0,0,0,0,0,0,0,3,0,0,0,7,0,0,0,67, +- 0,0,0,115,95,0,0,0,120,69,0,100,1,0,100,2, +- 0,100,3,0,100,4,0,103,4,0,68,93,49,0,125,2, +- 0,116,0,0,124,1,0,124,2,0,131,2,0,114,19,0, +- 116,1,0,124,0,0,124,2,0,116,2,0,124,1,0,124, +- 2,0,131,2,0,131,3,0,1,113,19,0,113,19,0,87, +- 124,0,0,106,3,0,106,4,0,124,1,0,106,3,0,131, +- 1,0,1,100,5,0,83,41,6,122,47,83,105,109,112,108, +- 101,32,115,117,98,115,116,105,116,117,116,101,32,102,111,114, +- 32,102,117,110,99,116,111,111,108,115,46,117,112,100,97,116, +- 101,95,119,114,97,112,112,101,114,46,218,10,95,95,109,111, +- 100,117,108,101,95,95,218,8,95,95,110,97,109,101,95,95, +- 218,12,95,95,113,117,97,108,110,97,109,101,95,95,218,7, +- 95,95,100,111,99,95,95,78,41,5,218,7,104,97,115,97, +- 116,116,114,218,7,115,101,116,97,116,116,114,218,7,103,101, +- 116,97,116,116,114,218,8,95,95,100,105,99,116,95,95,218, +- 6,117,112,100,97,116,101,41,3,90,3,110,101,119,90,3, +- 111,108,100,114,52,0,0,0,114,4,0,0,0,114,4,0, +- 0,0,114,5,0,0,0,218,5,95,119,114,97,112,121,0, +- 0,0,115,8,0,0,0,0,2,25,1,15,1,32,1,114, +- 65,0,0,0,99,1,0,0,0,0,0,0,0,1,0,0, +- 0,2,0,0,0,67,0,0,0,115,16,0,0,0,116,0, +- 0,116,1,0,131,1,0,124,0,0,131,1,0,83,41,1, +- 78,41,2,218,4,116,121,112,101,114,7,0,0,0,41,1, +- 218,4,110,97,109,101,114,4,0,0,0,114,4,0,0,0, +- 114,5,0,0,0,218,11,95,110,101,119,95,109,111,100,117, +- 108,101,129,0,0,0,115,2,0,0,0,0,1,114,68,0, +- 0,0,99,0,0,0,0,0,0,0,0,0,0,0,0,1, +- 0,0,0,64,0,0,0,115,16,0,0,0,101,0,0,90, +- 1,0,100,0,0,90,2,0,100,1,0,83,41,2,218,14, +- 95,68,101,97,100,108,111,99,107,69,114,114,111,114,78,41, +- 3,114,57,0,0,0,114,56,0,0,0,114,58,0,0,0, +- 114,4,0,0,0,114,4,0,0,0,114,4,0,0,0,114, +- 5,0,0,0,114,69,0,0,0,144,0,0,0,115,2,0, +- 0,0,12,1,114,69,0,0,0,99,0,0,0,0,0,0, +- 0,0,0,0,0,0,2,0,0,0,64,0,0,0,115,82, +- 0,0,0,101,0,0,90,1,0,100,0,0,90,2,0,100, +- 1,0,90,3,0,100,2,0,100,3,0,132,0,0,90,4, +- 0,100,4,0,100,5,0,132,0,0,90,5,0,100,6,0, +- 100,7,0,132,0,0,90,6,0,100,8,0,100,9,0,132, +- 0,0,90,7,0,100,10,0,100,11,0,132,0,0,90,8, +- 0,100,12,0,83,41,13,218,11,95,77,111,100,117,108,101, +- 76,111,99,107,122,169,65,32,114,101,99,117,114,115,105,118, +- 101,32,108,111,99,107,32,105,109,112,108,101,109,101,110,116, +- 97,116,105,111,110,32,119,104,105,99,104,32,105,115,32,97, +- 98,108,101,32,116,111,32,100,101,116,101,99,116,32,100,101, +- 97,100,108,111,99,107,115,10,32,32,32,32,40,101,46,103, +- 46,32,116,104,114,101,97,100,32,49,32,116,114,121,105,110, +- 103,32,116,111,32,116,97,107,101,32,108,111,99,107,115,32, +- 65,32,116,104,101,110,32,66,44,32,97,110,100,32,116,104, +- 114,101,97,100,32,50,32,116,114,121,105,110,103,32,116,111, +- 10,32,32,32,32,116,97,107,101,32,108,111,99,107,115,32, +- 66,32,116,104,101,110,32,65,41,46,10,32,32,32,32,99, +- 2,0,0,0,0,0,0,0,2,0,0,0,2,0,0,0, +- 67,0,0,0,115,70,0,0,0,116,0,0,106,1,0,131, +- 0,0,124,0,0,95,2,0,116,0,0,106,1,0,131,0, +- 0,124,0,0,95,3,0,124,1,0,124,0,0,95,4,0, +- 100,0,0,124,0,0,95,5,0,100,1,0,124,0,0,95, +- 6,0,100,1,0,124,0,0,95,7,0,100,0,0,83,41, +- 2,78,233,0,0,0,0,41,8,218,7,95,116,104,114,101, +- 97,100,90,13,97,108,108,111,99,97,116,101,95,108,111,99, +- 107,218,4,108,111,99,107,218,6,119,97,107,101,117,112,114, +- 67,0,0,0,218,5,111,119,110,101,114,218,5,99,111,117, +- 110,116,218,7,119,97,105,116,101,114,115,41,2,218,4,115, +- 101,108,102,114,67,0,0,0,114,4,0,0,0,114,4,0, +- 0,0,114,5,0,0,0,218,8,95,95,105,110,105,116,95, +- 95,154,0,0,0,115,12,0,0,0,0,1,15,1,15,1, +- 9,1,9,1,9,1,122,20,95,77,111,100,117,108,101,76, +- 111,99,107,46,95,95,105,110,105,116,95,95,99,1,0,0, +- 0,0,0,0,0,4,0,0,0,2,0,0,0,67,0,0, +- 0,115,87,0,0,0,116,0,0,106,1,0,131,0,0,125, +- 1,0,124,0,0,106,2,0,125,2,0,120,59,0,116,3, +- 0,106,4,0,124,2,0,131,1,0,125,3,0,124,3,0, +- 100,0,0,107,8,0,114,55,0,100,1,0,83,124,3,0, +- 106,2,0,125,2,0,124,2,0,124,1,0,107,2,0,114, +- 24,0,100,2,0,83,113,24,0,100,0,0,83,41,3,78, +- 70,84,41,5,114,72,0,0,0,218,9,103,101,116,95,105, +- 100,101,110,116,114,75,0,0,0,218,12,95,98,108,111,99, +- 107,105,110,103,95,111,110,218,3,103,101,116,41,4,114,78, +- 0,0,0,218,2,109,101,218,3,116,105,100,114,73,0,0, ++ 3,0,0,0,67,0,0,0,115,34,0,0,0,124,0,0, ++ 115,21,0,116,0,0,106,1,0,131,0,0,125,0,0,110, ++ 0,0,116,2,0,124,0,0,100,1,0,131,2,0,83,41, ++ 2,122,30,82,101,112,108,97,99,101,109,101,110,116,32,102, ++ 111,114,32,111,115,46,112,97,116,104,46,105,115,100,105,114, ++ 46,105,0,64,0,0,41,3,114,3,0,0,0,218,6,103, ++ 101,116,99,119,100,114,43,0,0,0,41,1,114,35,0,0, + 0,114,4,0,0,0,114,4,0,0,0,114,5,0,0,0, +- 218,12,104,97,115,95,100,101,97,100,108,111,99,107,162,0, +- 0,0,115,18,0,0,0,0,2,12,1,9,1,3,1,15, +- 1,12,1,4,1,9,1,12,1,122,24,95,77,111,100,117, +- 108,101,76,111,99,107,46,104,97,115,95,100,101,97,100,108, +- 111,99,107,99,1,0,0,0,0,0,0,0,2,0,0,0, +- 17,0,0,0,67,0,0,0,115,214,0,0,0,116,0,0, +- 106,1,0,131,0,0,125,1,0,124,0,0,116,2,0,124, +- 1,0,60,122,177,0,120,170,0,124,0,0,106,3,0,143, +- 130,0,1,124,0,0,106,4,0,100,1,0,107,2,0,115, +- 68,0,124,0,0,106,5,0,124,1,0,107,2,0,114,96, +- 0,124,1,0,124,0,0,95,5,0,124,0,0,4,106,4, +- 0,100,2,0,55,2,95,4,0,100,3,0,83,124,0,0, +- 106,6,0,131,0,0,114,127,0,116,7,0,100,4,0,124, +- 0,0,22,131,1,0,130,1,0,110,0,0,124,0,0,106, +- 8,0,106,9,0,100,5,0,131,1,0,114,163,0,124,0, +- 0,4,106,10,0,100,2,0,55,2,95,10,0,110,0,0, +- 87,100,6,0,81,88,124,0,0,106,8,0,106,9,0,131, +- 0,0,1,124,0,0,106,8,0,106,11,0,131,0,0,1, +- 113,28,0,87,100,6,0,116,2,0,124,1,0,61,88,100, +- 6,0,83,41,7,122,185,10,32,32,32,32,32,32,32,32, +- 65,99,113,117,105,114,101,32,116,104,101,32,109,111,100,117, +- 108,101,32,108,111,99,107,46,32,32,73,102,32,97,32,112, +- 111,116,101,110,116,105,97,108,32,100,101,97,100,108,111,99, +- 107,32,105,115,32,100,101,116,101,99,116,101,100,44,10,32, +- 32,32,32,32,32,32,32,97,32,95,68,101,97,100,108,111, +- 99,107,69,114,114,111,114,32,105,115,32,114,97,105,115,101, +- 100,46,10,32,32,32,32,32,32,32,32,79,116,104,101,114, +- 119,105,115,101,44,32,116,104,101,32,108,111,99,107,32,105, +- 115,32,97,108,119,97,121,115,32,97,99,113,117,105,114,101, +- 100,32,97,110,100,32,84,114,117,101,32,105,115,32,114,101, +- 116,117,114,110,101,100,46,10,32,32,32,32,32,32,32,32, +- 114,71,0,0,0,114,29,0,0,0,84,122,23,100,101,97, +- 100,108,111,99,107,32,100,101,116,101,99,116,101,100,32,98, +- 121,32,37,114,70,78,41,12,114,72,0,0,0,114,80,0, +- 0,0,114,81,0,0,0,114,73,0,0,0,114,76,0,0, +- 0,114,75,0,0,0,114,85,0,0,0,114,69,0,0,0, +- 114,74,0,0,0,218,7,97,99,113,117,105,114,101,114,77, +- 0,0,0,218,7,114,101,108,101,97,115,101,41,2,114,78, +- 0,0,0,114,84,0,0,0,114,4,0,0,0,114,4,0, +- 0,0,114,5,0,0,0,114,86,0,0,0,174,0,0,0, +- 115,32,0,0,0,0,6,12,1,10,1,3,1,3,1,10, +- 1,30,1,9,1,15,1,4,1,12,1,19,1,18,1,24, +- 2,13,1,20,2,122,19,95,77,111,100,117,108,101,76,111, +- 99,107,46,97,99,113,117,105,114,101,99,1,0,0,0,0, +- 0,0,0,2,0,0,0,10,0,0,0,67,0,0,0,115, +- 165,0,0,0,116,0,0,106,1,0,131,0,0,125,1,0, +- 124,0,0,106,2,0,143,138,0,1,124,0,0,106,3,0, +- 124,1,0,107,3,0,114,52,0,116,4,0,100,1,0,131, +- 1,0,130,1,0,110,0,0,124,0,0,106,5,0,100,2, +- 0,107,4,0,115,73,0,116,6,0,130,1,0,124,0,0, +- 4,106,5,0,100,3,0,56,2,95,5,0,124,0,0,106, +- 5,0,100,2,0,107,2,0,114,155,0,100,0,0,124,0, +- 0,95,3,0,124,0,0,106,7,0,114,155,0,124,0,0, +- 4,106,7,0,100,3,0,56,2,95,7,0,124,0,0,106, +- 8,0,106,9,0,131,0,0,1,113,155,0,110,0,0,87, +- 100,0,0,81,88,100,0,0,83,41,4,78,122,31,99,97, +- 110,110,111,116,32,114,101,108,101,97,115,101,32,117,110,45, +- 97,99,113,117,105,114,101,100,32,108,111,99,107,114,71,0, +- 0,0,114,29,0,0,0,41,10,114,72,0,0,0,114,80, +- 0,0,0,114,73,0,0,0,114,75,0,0,0,218,12,82, +- 117,110,116,105,109,101,69,114,114,111,114,114,76,0,0,0, +- 218,14,65,115,115,101,114,116,105,111,110,69,114,114,111,114, +- 114,77,0,0,0,114,74,0,0,0,114,87,0,0,0,41, +- 2,114,78,0,0,0,114,84,0,0,0,114,4,0,0,0, +- 114,4,0,0,0,114,5,0,0,0,114,87,0,0,0,199, +- 0,0,0,115,22,0,0,0,0,1,12,1,10,1,15,1, +- 15,1,21,1,15,1,15,1,9,1,9,1,15,1,122,19, +- 95,77,111,100,117,108,101,76,111,99,107,46,114,101,108,101, +- 97,115,101,99,1,0,0,0,0,0,0,0,1,0,0,0, +- 4,0,0,0,67,0,0,0,115,25,0,0,0,100,1,0, +- 106,0,0,124,0,0,106,1,0,116,2,0,124,0,0,131, +- 1,0,131,2,0,83,41,2,78,122,23,95,77,111,100,117, +- 108,101,76,111,99,107,40,123,33,114,125,41,32,97,116,32, +- 123,125,41,3,114,47,0,0,0,114,67,0,0,0,114,48, +- 0,0,0,41,1,114,78,0,0,0,114,4,0,0,0,114, +- 4,0,0,0,114,5,0,0,0,218,8,95,95,114,101,112, +- 114,95,95,212,0,0,0,115,2,0,0,0,0,1,122,20, +- 95,77,111,100,117,108,101,76,111,99,107,46,95,95,114,101, +- 112,114,95,95,78,41,9,114,57,0,0,0,114,56,0,0, +- 0,114,58,0,0,0,114,59,0,0,0,114,79,0,0,0, +- 114,85,0,0,0,114,86,0,0,0,114,87,0,0,0,114, +- 90,0,0,0,114,4,0,0,0,114,4,0,0,0,114,4, +- 0,0,0,114,5,0,0,0,114,70,0,0,0,148,0,0, +- 0,115,12,0,0,0,12,4,6,2,12,8,12,12,12,25, +- 12,13,114,70,0,0,0,99,0,0,0,0,0,0,0,0, +- 0,0,0,0,2,0,0,0,64,0,0,0,115,70,0,0, +- 0,101,0,0,90,1,0,100,0,0,90,2,0,100,1,0, +- 90,3,0,100,2,0,100,3,0,132,0,0,90,4,0,100, +- 4,0,100,5,0,132,0,0,90,5,0,100,6,0,100,7, +- 0,132,0,0,90,6,0,100,8,0,100,9,0,132,0,0, +- 90,7,0,100,10,0,83,41,11,218,16,95,68,117,109,109, +- 121,77,111,100,117,108,101,76,111,99,107,122,86,65,32,115, +- 105,109,112,108,101,32,95,77,111,100,117,108,101,76,111,99, +- 107,32,101,113,117,105,118,97,108,101,110,116,32,102,111,114, +- 32,80,121,116,104,111,110,32,98,117,105,108,100,115,32,119, +- 105,116,104,111,117,116,10,32,32,32,32,109,117,108,116,105, +- 45,116,104,114,101,97,100,105,110,103,32,115,117,112,112,111, +- 114,116,46,99,2,0,0,0,0,0,0,0,2,0,0,0, +- 2,0,0,0,67,0,0,0,115,22,0,0,0,124,1,0, +- 124,0,0,95,0,0,100,1,0,124,0,0,95,1,0,100, +- 0,0,83,41,2,78,114,71,0,0,0,41,2,114,67,0, +- 0,0,114,76,0,0,0,41,2,114,78,0,0,0,114,67, +- 0,0,0,114,4,0,0,0,114,4,0,0,0,114,5,0, +- 0,0,114,79,0,0,0,220,0,0,0,115,4,0,0,0, +- 0,1,9,1,122,25,95,68,117,109,109,121,77,111,100,117, +- 108,101,76,111,99,107,46,95,95,105,110,105,116,95,95,99, +- 1,0,0,0,0,0,0,0,1,0,0,0,3,0,0,0, +- 67,0,0,0,115,19,0,0,0,124,0,0,4,106,0,0, +- 100,1,0,55,2,95,0,0,100,2,0,83,41,3,78,114, +- 29,0,0,0,84,41,1,114,76,0,0,0,41,1,114,78, +- 0,0,0,114,4,0,0,0,114,4,0,0,0,114,5,0, +- 0,0,114,86,0,0,0,224,0,0,0,115,4,0,0,0, +- 0,1,15,1,122,24,95,68,117,109,109,121,77,111,100,117, +- 108,101,76,111,99,107,46,97,99,113,117,105,114,101,99,1, +- 0,0,0,0,0,0,0,1,0,0,0,3,0,0,0,67, +- 0,0,0,115,49,0,0,0,124,0,0,106,0,0,100,1, +- 0,107,2,0,114,30,0,116,1,0,100,2,0,131,1,0, +- 130,1,0,110,0,0,124,0,0,4,106,0,0,100,3,0, +- 56,2,95,0,0,100,0,0,83,41,4,78,114,71,0,0, +- 0,122,31,99,97,110,110,111,116,32,114,101,108,101,97,115, +- 101,32,117,110,45,97,99,113,117,105,114,101,100,32,108,111, +- 99,107,114,29,0,0,0,41,2,114,76,0,0,0,114,88, +- 0,0,0,41,1,114,78,0,0,0,114,4,0,0,0,114, +- 4,0,0,0,114,5,0,0,0,114,87,0,0,0,228,0, +- 0,0,115,6,0,0,0,0,1,15,1,15,1,122,24,95, +- 68,117,109,109,121,77,111,100,117,108,101,76,111,99,107,46, +- 114,101,108,101,97,115,101,99,1,0,0,0,0,0,0,0, +- 1,0,0,0,4,0,0,0,67,0,0,0,115,25,0,0, +- 0,100,1,0,106,0,0,124,0,0,106,1,0,116,2,0, +- 124,0,0,131,1,0,131,2,0,83,41,2,78,122,28,95, +- 68,117,109,109,121,77,111,100,117,108,101,76,111,99,107,40, +- 123,33,114,125,41,32,97,116,32,123,125,41,3,114,47,0, +- 0,0,114,67,0,0,0,114,48,0,0,0,41,1,114,78, +- 0,0,0,114,4,0,0,0,114,4,0,0,0,114,5,0, +- 0,0,114,90,0,0,0,233,0,0,0,115,2,0,0,0, +- 0,1,122,25,95,68,117,109,109,121,77,111,100,117,108,101, +- 76,111,99,107,46,95,95,114,101,112,114,95,95,78,41,8, +- 114,57,0,0,0,114,56,0,0,0,114,58,0,0,0,114, +- 59,0,0,0,114,79,0,0,0,114,86,0,0,0,114,87, +- 0,0,0,114,90,0,0,0,114,4,0,0,0,114,4,0, +- 0,0,114,4,0,0,0,114,5,0,0,0,114,91,0,0, +- 0,216,0,0,0,115,10,0,0,0,12,2,6,2,12,4, +- 12,4,12,5,114,91,0,0,0,99,0,0,0,0,0,0, +- 0,0,0,0,0,0,2,0,0,0,64,0,0,0,115,52, +- 0,0,0,101,0,0,90,1,0,100,0,0,90,2,0,100, +- 1,0,100,2,0,132,0,0,90,3,0,100,3,0,100,4, +- 0,132,0,0,90,4,0,100,5,0,100,6,0,132,0,0, +- 90,5,0,100,7,0,83,41,8,218,18,95,77,111,100,117, +- 108,101,76,111,99,107,77,97,110,97,103,101,114,99,2,0, +- 0,0,0,0,0,0,2,0,0,0,2,0,0,0,67,0, +- 0,0,115,22,0,0,0,124,1,0,124,0,0,95,0,0, +- 100,0,0,124,0,0,95,1,0,100,0,0,83,41,1,78, +- 41,2,218,5,95,110,97,109,101,218,5,95,108,111,99,107, +- 41,2,114,78,0,0,0,114,67,0,0,0,114,4,0,0, +- 0,114,4,0,0,0,114,5,0,0,0,114,79,0,0,0, +- 239,0,0,0,115,4,0,0,0,0,1,9,1,122,27,95, +- 77,111,100,117,108,101,76,111,99,107,77,97,110,97,103,101, +- 114,46,95,95,105,110,105,116,95,95,99,1,0,0,0,0, +- 0,0,0,1,0,0,0,10,0,0,0,67,0,0,0,115, +- 53,0,0,0,122,22,0,116,0,0,124,0,0,106,1,0, +- 131,1,0,124,0,0,95,2,0,87,100,0,0,116,3,0, +- 106,4,0,131,0,0,1,88,124,0,0,106,2,0,106,5, +- 0,131,0,0,1,100,0,0,83,41,1,78,41,6,218,16, +- 95,103,101,116,95,109,111,100,117,108,101,95,108,111,99,107, +- 114,93,0,0,0,114,94,0,0,0,218,4,95,105,109,112, +- 218,12,114,101,108,101,97,115,101,95,108,111,99,107,114,86, +- 0,0,0,41,1,114,78,0,0,0,114,4,0,0,0,114, +- 4,0,0,0,114,5,0,0,0,218,9,95,95,101,110,116, +- 101,114,95,95,243,0,0,0,115,8,0,0,0,0,1,3, +- 1,22,2,11,1,122,28,95,77,111,100,117,108,101,76,111, +- 99,107,77,97,110,97,103,101,114,46,95,95,101,110,116,101, +- 114,95,95,99,1,0,0,0,0,0,0,0,3,0,0,0, +- 1,0,0,0,79,0,0,0,115,17,0,0,0,124,0,0, +- 106,0,0,106,1,0,131,0,0,1,100,0,0,83,41,1, +- 78,41,2,114,94,0,0,0,114,87,0,0,0,41,3,114, +- 78,0,0,0,218,4,97,114,103,115,218,6,107,119,97,114, +- 103,115,114,4,0,0,0,114,4,0,0,0,114,5,0,0, +- 0,218,8,95,95,101,120,105,116,95,95,250,0,0,0,115, +- 2,0,0,0,0,1,122,27,95,77,111,100,117,108,101,76, +- 111,99,107,77,97,110,97,103,101,114,46,95,95,101,120,105, +- 116,95,95,78,41,6,114,57,0,0,0,114,56,0,0,0, +- 114,58,0,0,0,114,79,0,0,0,114,98,0,0,0,114, +- 101,0,0,0,114,4,0,0,0,114,4,0,0,0,114,4, +- 0,0,0,114,5,0,0,0,114,92,0,0,0,237,0,0, +- 0,115,6,0,0,0,12,2,12,4,12,7,114,92,0,0, +- 0,99,1,0,0,0,0,0,0,0,3,0,0,0,11,0, +- 0,0,3,0,0,0,115,142,0,0,0,100,1,0,125,1, +- 0,121,17,0,116,0,0,136,0,0,25,131,0,0,125,1, +- 0,87,110,18,0,4,116,1,0,107,10,0,114,43,0,1, +- 1,1,89,110,1,0,88,124,1,0,100,1,0,107,8,0, +- 114,138,0,116,2,0,100,1,0,107,8,0,114,83,0,116, +- 3,0,136,0,0,131,1,0,125,1,0,110,12,0,116,4, +- 0,136,0,0,131,1,0,125,1,0,135,0,0,102,1,0, +- 100,2,0,100,3,0,134,0,0,125,2,0,116,5,0,106, +- 6,0,124,1,0,124,2,0,131,2,0,116,0,0,136,0, +- 0,60,110,0,0,124,1,0,83,41,4,122,109,71,101,116, +- 32,111,114,32,99,114,101,97,116,101,32,116,104,101,32,109, +- 111,100,117,108,101,32,108,111,99,107,32,102,111,114,32,97, +- 32,103,105,118,101,110,32,109,111,100,117,108,101,32,110,97, +- 109,101,46,10,10,32,32,32,32,83,104,111,117,108,100,32, +- 111,110,108,121,32,98,101,32,99,97,108,108,101,100,32,119, +- 105,116,104,32,116,104,101,32,105,109,112,111,114,116,32,108, +- 111,99,107,32,116,97,107,101,110,46,78,99,1,0,0,0, +- 0,0,0,0,1,0,0,0,2,0,0,0,19,0,0,0, +- 115,11,0,0,0,116,0,0,136,0,0,61,100,0,0,83, +- 41,1,78,41,1,218,13,95,109,111,100,117,108,101,95,108, +- 111,99,107,115,41,1,114,36,0,0,0,41,1,114,67,0, +- 0,0,114,4,0,0,0,114,5,0,0,0,218,2,99,98, +- 14,1,0,0,115,2,0,0,0,0,1,122,28,95,103,101, +- 116,95,109,111,100,117,108,101,95,108,111,99,107,46,60,108, +- 111,99,97,108,115,62,46,99,98,41,7,114,102,0,0,0, +- 218,8,75,101,121,69,114,114,111,114,114,72,0,0,0,114, +- 91,0,0,0,114,70,0,0,0,218,8,95,119,101,97,107, +- 114,101,102,90,3,114,101,102,41,3,114,67,0,0,0,114, +- 73,0,0,0,114,103,0,0,0,114,4,0,0,0,41,1, +- 114,67,0,0,0,114,5,0,0,0,114,95,0,0,0,0, +- 1,0,0,115,24,0,0,0,0,4,6,1,3,1,17,1, +- 13,1,5,1,12,1,12,1,15,2,12,1,18,2,25,1, +- 114,95,0,0,0,99,1,0,0,0,0,0,0,0,2,0, +- 0,0,11,0,0,0,67,0,0,0,115,71,0,0,0,116, +- 0,0,124,0,0,131,1,0,125,1,0,116,1,0,106,2, +- 0,131,0,0,1,121,14,0,124,1,0,106,3,0,131,0, +- 0,1,87,110,18,0,4,116,4,0,107,10,0,114,56,0, +- 1,1,1,89,110,11,0,88,124,1,0,106,5,0,131,0, +- 0,1,100,1,0,83,41,2,97,21,1,0,0,82,101,108, +- 101,97,115,101,32,116,104,101,32,103,108,111,98,97,108,32, +- 105,109,112,111,114,116,32,108,111,99,107,44,32,97,110,100, +- 32,97,99,113,117,105,114,101,115,32,116,104,101,110,32,114, +- 101,108,101,97,115,101,32,116,104,101,10,32,32,32,32,109, +- 111,100,117,108,101,32,108,111,99,107,32,102,111,114,32,97, +- 32,103,105,118,101,110,32,109,111,100,117,108,101,32,110,97, +- 109,101,46,10,32,32,32,32,84,104,105,115,32,105,115,32, +- 117,115,101,100,32,116,111,32,101,110,115,117,114,101,32,97, +- 32,109,111,100,117,108,101,32,105,115,32,99,111,109,112,108, +- 101,116,101,108,121,32,105,110,105,116,105,97,108,105,122,101, +- 100,44,32,105,110,32,116,104,101,10,32,32,32,32,101,118, +- 101,110,116,32,105,116,32,105,115,32,98,101,105,110,103,32, +- 105,109,112,111,114,116,101,100,32,98,121,32,97,110,111,116, +- 104,101,114,32,116,104,114,101,97,100,46,10,10,32,32,32, +- 32,83,104,111,117,108,100,32,111,110,108,121,32,98,101,32, +- 99,97,108,108,101,100,32,119,105,116,104,32,116,104,101,32, +- 105,109,112,111,114,116,32,108,111,99,107,32,116,97,107,101, +- 110,46,78,41,6,114,95,0,0,0,114,96,0,0,0,114, +- 97,0,0,0,114,86,0,0,0,114,69,0,0,0,114,87, +- 0,0,0,41,2,114,67,0,0,0,114,73,0,0,0,114, +- 4,0,0,0,114,4,0,0,0,114,5,0,0,0,218,19, +- 95,108,111,99,107,95,117,110,108,111,99,107,95,109,111,100, +- 117,108,101,19,1,0,0,115,14,0,0,0,0,7,12,1, +- 10,1,3,1,14,1,13,3,5,2,114,106,0,0,0,99, +- 1,0,0,0,0,0,0,0,3,0,0,0,3,0,0,0, +- 79,0,0,0,115,13,0,0,0,124,0,0,124,1,0,124, +- 2,0,142,0,0,83,41,1,97,46,1,0,0,114,101,109, +- 111,118,101,95,105,109,112,111,114,116,108,105,98,95,102,114, +- 97,109,101,115,32,105,110,32,105,109,112,111,114,116,46,99, +- 32,119,105,108,108,32,97,108,119,97,121,115,32,114,101,109, +- 111,118,101,32,115,101,113,117,101,110,99,101,115,10,32,32, +- 32,32,111,102,32,105,109,112,111,114,116,108,105,98,32,102, +- 114,97,109,101,115,32,116,104,97,116,32,101,110,100,32,119, +- 105,116,104,32,97,32,99,97,108,108,32,116,111,32,116,104, +- 105,115,32,102,117,110,99,116,105,111,110,10,10,32,32,32, +- 32,85,115,101,32,105,116,32,105,110,115,116,101,97,100,32, +- 111,102,32,97,32,110,111,114,109,97,108,32,99,97,108,108, +- 32,105,110,32,112,108,97,99,101,115,32,119,104,101,114,101, +- 32,105,110,99,108,117,100,105,110,103,32,116,104,101,32,105, +- 109,112,111,114,116,108,105,98,10,32,32,32,32,102,114,97, +- 109,101,115,32,105,110,116,114,111,100,117,99,101,115,32,117, +- 110,119,97,110,116,101,100,32,110,111,105,115,101,32,105,110, +- 116,111,32,116,104,101,32,116,114,97,99,101,98,97,99,107, +- 32,40,101,46,103,46,32,119,104,101,110,32,101,120,101,99, +- 117,116,105,110,103,10,32,32,32,32,109,111,100,117,108,101, +- 32,99,111,100,101,41,10,32,32,32,32,114,4,0,0,0, +- 41,3,218,1,102,114,99,0,0,0,90,4,107,119,100,115, +- 114,4,0,0,0,114,4,0,0,0,114,5,0,0,0,218, +- 25,95,99,97,108,108,95,119,105,116,104,95,102,114,97,109, +- 101,115,95,114,101,109,111,118,101,100,39,1,0,0,115,2, +- 0,0,0,0,8,114,108,0,0,0,105,228,12,0,0,233, +- 2,0,0,0,114,13,0,0,0,115,2,0,0,0,13,10, +- 90,11,95,95,112,121,99,97,99,104,101,95,95,122,3,46, +- 112,121,122,4,46,112,121,99,122,4,46,112,121,111,78,99, +- 2,0,0,0,0,0,0,0,11,0,0,0,6,0,0,0, +- 67,0,0,0,115,180,0,0,0,124,1,0,100,1,0,107, +- 8,0,114,25,0,116,0,0,106,1,0,106,2,0,12,110, +- 3,0,124,1,0,125,2,0,124,2,0,114,46,0,116,3, +- 0,125,3,0,110,6,0,116,4,0,125,3,0,116,5,0, +- 124,0,0,131,1,0,92,2,0,125,4,0,125,5,0,124, +- 5,0,106,6,0,100,2,0,131,1,0,92,3,0,125,6, +- 0,125,7,0,125,8,0,116,0,0,106,7,0,106,8,0, +- 125,9,0,124,9,0,100,1,0,107,8,0,114,133,0,116, +- 9,0,100,3,0,131,1,0,130,1,0,110,0,0,100,4, +- 0,106,10,0,124,6,0,124,7,0,124,9,0,124,3,0, +- 100,5,0,25,103,4,0,131,1,0,125,10,0,116,11,0, +- 124,4,0,116,12,0,124,10,0,131,3,0,83,41,6,97, +- 244,1,0,0,71,105,118,101,110,32,116,104,101,32,112,97, +- 116,104,32,116,111,32,97,32,46,112,121,32,102,105,108,101, +- 44,32,114,101,116,117,114,110,32,116,104,101,32,112,97,116, +- 104,32,116,111,32,105,116,115,32,46,112,121,99,47,46,112, +- 121,111,32,102,105,108,101,46,10,10,32,32,32,32,84,104, +- 101,32,46,112,121,32,102,105,108,101,32,100,111,101,115,32, +- 110,111,116,32,110,101,101,100,32,116,111,32,101,120,105,115, +- 116,59,32,116,104,105,115,32,115,105,109,112,108,121,32,114, +- 101,116,117,114,110,115,32,116,104,101,32,112,97,116,104,32, +- 116,111,32,116,104,101,10,32,32,32,32,46,112,121,99,47, +- 46,112,121,111,32,102,105,108,101,32,99,97,108,99,117,108, +- 97,116,101,100,32,97,115,32,105,102,32,116,104,101,32,46, +- 112,121,32,102,105,108,101,32,119,101,114,101,32,105,109,112, +- 111,114,116,101,100,46,32,32,84,104,101,32,101,120,116,101, +- 110,115,105,111,110,10,32,32,32,32,119,105,108,108,32,98, +- 101,32,46,112,121,99,32,117,110,108,101,115,115,32,115,121, +- 115,46,102,108,97,103,115,46,111,112,116,105,109,105,122,101, +- 32,105,115,32,110,111,110,45,122,101,114,111,44,32,116,104, +- 101,110,32,105,116,32,119,105,108,108,32,98,101,32,46,112, +- 121,111,46,10,10,32,32,32,32,73,102,32,100,101,98,117, +- 103,95,111,118,101,114,114,105,100,101,32,105,115,32,110,111, +- 116,32,78,111,110,101,44,32,116,104,101,110,32,105,116,32, +- 109,117,115,116,32,98,101,32,97,32,98,111,111,108,101,97, +- 110,32,97,110,100,32,105,115,32,117,115,101,100,32,105,110, +- 10,32,32,32,32,112,108,97,99,101,32,111,102,32,115,121, +- 115,46,102,108,97,103,115,46,111,112,116,105,109,105,122,101, +- 46,10,10,32,32,32,32,73,102,32,115,121,115,46,105,109, +- 112,108,101,109,101,110,116,97,116,105,111,110,46,99,97,99, +- 104,101,95,116,97,103,32,105,115,32,78,111,110,101,32,116, +- 104,101,110,32,78,111,116,73,109,112,108,101,109,101,110,116, +- 101,100,69,114,114,111,114,32,105,115,32,114,97,105,115,101, +- 100,46,10,10,32,32,32,32,78,218,1,46,122,36,115,121, +- 115,46,105,109,112,108,101,109,101,110,116,97,116,105,111,110, +- 46,99,97,99,104,101,95,116,97,103,32,105,115,32,78,111, +- 110,101,114,30,0,0,0,114,71,0,0,0,41,13,114,7, +- 0,0,0,218,5,102,108,97,103,115,218,8,111,112,116,105, +- 109,105,122,101,218,23,68,69,66,85,71,95,66,89,84,69, +- 67,79,68,69,95,83,85,70,70,73,88,69,83,218,27,79, +- 80,84,73,77,73,90,69,68,95,66,89,84,69,67,79,68, +- 69,95,83,85,70,70,73,88,69,83,114,38,0,0,0,218, +- 9,112,97,114,116,105,116,105,111,110,218,14,105,109,112,108, +- 101,109,101,110,116,97,116,105,111,110,218,9,99,97,99,104, +- 101,95,116,97,103,218,19,78,111,116,73,109,112,108,101,109, +- 101,110,116,101,100,69,114,114,111,114,114,26,0,0,0,114, +- 28,0,0,0,218,8,95,80,89,67,65,67,72,69,41,11, +- 114,35,0,0,0,90,14,100,101,98,117,103,95,111,118,101, +- 114,114,105,100,101,218,5,100,101,98,117,103,218,8,115,117, +- 102,102,105,120,101,115,218,4,104,101,97,100,114,37,0,0, +- 0,218,13,98,97,115,101,95,102,105,108,101,110,97,109,101, +- 218,3,115,101,112,114,36,0,0,0,90,3,116,97,103,218, +- 8,102,105,108,101,110,97,109,101,114,4,0,0,0,114,4, +- 0,0,0,114,5,0,0,0,218,17,99,97,99,104,101,95, +- 102,114,111,109,95,115,111,117,114,99,101,162,1,0,0,115, +- 22,0,0,0,0,13,31,1,6,1,9,2,6,1,18,1, +- 24,1,12,1,12,1,15,1,31,1,114,126,0,0,0,99, +- 1,0,0,0,0,0,0,0,5,0,0,0,5,0,0,0, +- 67,0,0,0,115,193,0,0,0,116,0,0,106,1,0,106, +- 2,0,100,1,0,107,8,0,114,33,0,116,3,0,100,2, +- 0,131,1,0,130,1,0,110,0,0,116,4,0,124,0,0, +- 131,1,0,92,2,0,125,1,0,125,2,0,116,4,0,124, +- 1,0,131,1,0,92,2,0,125,1,0,125,3,0,124,3, +- 0,116,5,0,107,3,0,114,108,0,116,6,0,100,3,0, +- 106,7,0,116,5,0,124,0,0,131,2,0,131,1,0,130, +- 1,0,110,0,0,124,2,0,106,8,0,100,4,0,131,1, +- 0,100,5,0,107,3,0,114,153,0,116,6,0,100,6,0, +- 106,7,0,124,2,0,131,1,0,131,1,0,130,1,0,110, +- 0,0,124,2,0,106,9,0,100,4,0,131,1,0,100,7, +- 0,25,125,4,0,116,10,0,124,1,0,124,4,0,116,11, +- 0,100,7,0,25,23,131,2,0,83,41,8,97,121,1,0, +- 0,71,105,118,101,110,32,116,104,101,32,112,97,116,104,32, +- 116,111,32,97,32,46,112,121,99,46,47,46,112,121,111,32, +- 102,105,108,101,44,32,114,101,116,117,114,110,32,116,104,101, +- 32,112,97,116,104,32,116,111,32,105,116,115,32,46,112,121, +- 32,102,105,108,101,46,10,10,32,32,32,32,84,104,101,32, +- 46,112,121,99,47,46,112,121,111,32,102,105,108,101,32,100, +- 111,101,115,32,110,111,116,32,110,101,101,100,32,116,111,32, +- 101,120,105,115,116,59,32,116,104,105,115,32,115,105,109,112, +- 108,121,32,114,101,116,117,114,110,115,32,116,104,101,32,112, +- 97,116,104,32,116,111,10,32,32,32,32,116,104,101,32,46, +- 112,121,32,102,105,108,101,32,99,97,108,99,117,108,97,116, +- 101,100,32,116,111,32,99,111,114,114,101,115,112,111,110,100, +- 32,116,111,32,116,104,101,32,46,112,121,99,47,46,112,121, +- 111,32,102,105,108,101,46,32,32,73,102,32,112,97,116,104, +- 32,100,111,101,115,10,32,32,32,32,110,111,116,32,99,111, +- 110,102,111,114,109,32,116,111,32,80,69,80,32,51,49,52, +- 55,32,102,111,114,109,97,116,44,32,86,97,108,117,101,69, +- 114,114,111,114,32,119,105,108,108,32,98,101,32,114,97,105, +- 115,101,100,46,32,73,102,10,32,32,32,32,115,121,115,46, +- 105,109,112,108,101,109,101,110,116,97,116,105,111,110,46,99, +- 97,99,104,101,95,116,97,103,32,105,115,32,78,111,110,101, +- 32,116,104,101,110,32,78,111,116,73,109,112,108,101,109,101, +- 110,116,101,100,69,114,114,111,114,32,105,115,32,114,97,105, +- 115,101,100,46,10,10,32,32,32,32,78,122,36,115,121,115, +- 46,105,109,112,108,101,109,101,110,116,97,116,105,111,110,46, +- 99,97,99,104,101,95,116,97,103,32,105,115,32,78,111,110, +- 101,122,37,123,125,32,110,111,116,32,98,111,116,116,111,109, +- 45,108,101,118,101,108,32,100,105,114,101,99,116,111,114,121, +- 32,105,110,32,123,33,114,125,114,110,0,0,0,114,109,0, +- 0,0,122,28,101,120,112,101,99,116,101,100,32,111,110,108, +- 121,32,50,32,100,111,116,115,32,105,110,32,123,33,114,125, +- 114,71,0,0,0,41,12,114,7,0,0,0,114,116,0,0, +- 0,114,117,0,0,0,114,118,0,0,0,114,38,0,0,0, +- 114,119,0,0,0,218,10,86,97,108,117,101,69,114,114,111, +- 114,114,47,0,0,0,114,76,0,0,0,114,115,0,0,0, +- 114,28,0,0,0,218,15,83,79,85,82,67,69,95,83,85, +- 70,70,73,88,69,83,41,5,114,35,0,0,0,114,122,0, +- 0,0,90,16,112,121,99,97,99,104,101,95,102,105,108,101, +- 110,97,109,101,90,7,112,121,99,97,99,104,101,114,123,0, +- 0,0,114,4,0,0,0,114,4,0,0,0,114,5,0,0, +- 0,218,17,115,111,117,114,99,101,95,102,114,111,109,95,99, +- 97,99,104,101,189,1,0,0,115,24,0,0,0,0,9,18, +- 1,15,1,18,1,18,1,12,1,3,1,24,1,21,1,3, +- 1,21,1,19,1,114,129,0,0,0,99,1,0,0,0,0, +- 0,0,0,5,0,0,0,13,0,0,0,67,0,0,0,115, +- 164,0,0,0,116,0,0,124,0,0,131,1,0,100,1,0, +- 107,2,0,114,22,0,100,2,0,83,124,0,0,106,1,0, +- 100,3,0,131,1,0,92,3,0,125,1,0,125,2,0,125, +- 3,0,124,1,0,12,115,81,0,124,3,0,106,2,0,131, +- 0,0,100,7,0,100,8,0,133,2,0,25,100,6,0,107, +- 3,0,114,85,0,124,0,0,83,121,16,0,116,3,0,124, +- 0,0,131,1,0,125,4,0,87,110,40,0,4,116,4,0, +- 116,5,0,102,2,0,107,10,0,114,143,0,1,1,1,124, +- 0,0,100,2,0,100,9,0,133,2,0,25,125,4,0,89, +- 110,1,0,88,116,6,0,124,4,0,131,1,0,114,160,0, +- 124,4,0,83,124,0,0,83,41,10,122,188,67,111,110,118, +- 101,114,116,32,97,32,98,121,116,101,99,111,100,101,32,102, +- 105,108,101,32,112,97,116,104,32,116,111,32,97,32,115,111, +- 117,114,99,101,32,112,97,116,104,32,40,105,102,32,112,111, +- 115,115,105,98,108,101,41,46,10,10,32,32,32,32,84,104, +- 105,115,32,102,117,110,99,116,105,111,110,32,101,120,105,115, +- 116,115,32,112,117,114,101,108,121,32,102,111,114,32,98,97, +- 99,107,119,97,114,100,115,45,99,111,109,112,97,116,105,98, +- 105,108,105,116,121,32,102,111,114,10,32,32,32,32,80,121, +- 73,109,112,111,114,116,95,69,120,101,99,67,111,100,101,77, +- 111,100,117,108,101,87,105,116,104,70,105,108,101,110,97,109, +- 101,115,40,41,32,105,110,32,116,104,101,32,67,32,65,80, +- 73,46,10,10,32,32,32,32,114,71,0,0,0,78,114,110, +- 0,0,0,233,3,0,0,0,114,29,0,0,0,90,2,112, +- 121,233,253,255,255,255,233,255,255,255,255,114,132,0,0,0, +- 41,7,114,31,0,0,0,114,32,0,0,0,218,5,108,111, +- 119,101,114,114,129,0,0,0,114,118,0,0,0,114,127,0, +- 0,0,114,44,0,0,0,41,5,218,13,98,121,116,101,99, +- 111,100,101,95,112,97,116,104,90,4,114,101,115,116,114,36, +- 0,0,0,90,9,101,120,116,101,110,115,105,111,110,218,11, +- 115,111,117,114,99,101,95,112,97,116,104,114,4,0,0,0, +- 114,4,0,0,0,114,5,0,0,0,218,15,95,103,101,116, +- 95,115,111,117,114,99,101,102,105,108,101,212,1,0,0,115, +- 20,0,0,0,0,7,18,1,4,1,24,1,35,1,4,1, +- 3,1,16,1,19,1,21,1,114,136,0,0,0,99,1,0, +- 0,0,0,0,0,0,2,0,0,0,11,0,0,0,67,0, +- 0,0,115,60,0,0,0,121,19,0,116,0,0,124,0,0, +- 131,1,0,106,1,0,125,1,0,87,110,24,0,4,116,2, +- 0,107,10,0,114,45,0,1,1,1,100,1,0,125,1,0, +- 89,110,1,0,88,124,1,0,100,2,0,79,125,1,0,124, +- 1,0,83,41,3,122,51,67,97,108,99,117,108,97,116,101, +- 32,116,104,101,32,109,111,100,101,32,112,101,114,109,105,115, +- 115,105,111,110,115,32,102,111,114,32,97,32,98,121,116,101, +- 99,111,100,101,32,102,105,108,101,46,105,182,1,0,0,233, +- 128,0,0,0,41,3,114,39,0,0,0,114,41,0,0,0, +- 114,40,0,0,0,41,2,114,35,0,0,0,114,42,0,0, +- 0,114,4,0,0,0,114,4,0,0,0,114,5,0,0,0, +- 218,10,95,99,97,108,99,95,109,111,100,101,231,1,0,0, +- 115,12,0,0,0,0,2,3,1,19,1,13,1,11,3,10, +- 1,114,138,0,0,0,218,9,118,101,114,98,111,115,105,116, +- 121,114,29,0,0,0,99,1,0,0,0,1,0,0,0,3, +- 0,0,0,4,0,0,0,71,0,0,0,115,81,0,0,0, +- 116,0,0,106,1,0,106,2,0,124,1,0,107,5,0,114, +- 77,0,124,0,0,106,3,0,100,6,0,131,1,0,115,46, +- 0,100,3,0,124,0,0,23,125,0,0,110,0,0,116,4, +- 0,124,0,0,106,5,0,124,2,0,140,0,0,100,4,0, +- 116,0,0,106,6,0,131,1,1,1,110,0,0,100,5,0, +- 83,41,7,122,61,80,114,105,110,116,32,116,104,101,32,109, +- 101,115,115,97,103,101,32,116,111,32,115,116,100,101,114,114, +- 32,105,102,32,45,118,47,80,89,84,72,79,78,86,69,82, +- 66,79,83,69,32,105,115,32,116,117,114,110,101,100,32,111, +- 110,46,250,1,35,250,7,105,109,112,111,114,116,32,122,2, +- 35,32,114,54,0,0,0,78,41,2,114,140,0,0,0,114, +- 141,0,0,0,41,7,114,7,0,0,0,114,111,0,0,0, +- 218,7,118,101,114,98,111,115,101,114,9,0,0,0,218,5, +- 112,114,105,110,116,114,47,0,0,0,218,6,115,116,100,101, +- 114,114,41,3,218,7,109,101,115,115,97,103,101,114,139,0, +- 0,0,114,99,0,0,0,114,4,0,0,0,114,4,0,0, +- 0,114,5,0,0,0,218,16,95,118,101,114,98,111,115,101, +- 95,109,101,115,115,97,103,101,243,1,0,0,115,8,0,0, +- 0,0,2,18,1,15,1,13,1,114,146,0,0,0,99,1, +- 0,0,0,0,0,0,0,2,0,0,0,4,0,0,0,3, +- 0,0,0,115,38,0,0,0,100,1,0,135,0,0,102,1, +- 0,100,2,0,100,3,0,134,1,0,125,1,0,116,0,0, +- 124,1,0,136,0,0,131,2,0,1,124,1,0,83,41,4, +- 122,252,68,101,99,111,114,97,116,111,114,32,116,111,32,118, +- 101,114,105,102,121,32,116,104,97,116,32,116,104,101,32,109, +- 111,100,117,108,101,32,98,101,105,110,103,32,114,101,113,117, +- 101,115,116,101,100,32,109,97,116,99,104,101,115,32,116,104, +- 101,32,111,110,101,32,116,104,101,10,32,32,32,32,108,111, +- 97,100,101,114,32,99,97,110,32,104,97,110,100,108,101,46, +- 10,10,32,32,32,32,84,104,101,32,102,105,114,115,116,32, +- 97,114,103,117,109,101,110,116,32,40,115,101,108,102,41,32, +- 109,117,115,116,32,100,101,102,105,110,101,32,95,110,97,109, +- 101,32,119,104,105,99,104,32,116,104,101,32,115,101,99,111, +- 110,100,32,97,114,103,117,109,101,110,116,32,105,115,10,32, +- 32,32,32,99,111,109,112,97,114,101,100,32,97,103,97,105, +- 110,115,116,46,32,73,102,32,116,104,101,32,99,111,109,112, +- 97,114,105,115,111,110,32,102,97,105,108,115,32,116,104,101, +- 110,32,73,109,112,111,114,116,69,114,114,111,114,32,105,115, +- 32,114,97,105,115,101,100,46,10,10,32,32,32,32,78,99, +- 2,0,0,0,0,0,0,0,4,0,0,0,5,0,0,0, +- 31,0,0,0,115,83,0,0,0,124,1,0,100,0,0,107, +- 8,0,114,24,0,124,0,0,106,0,0,125,1,0,110,40, +- 0,124,0,0,106,0,0,124,1,0,107,3,0,114,64,0, +- 116,1,0,100,1,0,124,1,0,22,100,2,0,124,1,0, +- 131,1,1,130,1,0,110,0,0,136,0,0,124,0,0,124, +- 1,0,124,2,0,124,3,0,142,2,0,83,41,3,78,122, +- 23,108,111,97,100,101,114,32,99,97,110,110,111,116,32,104, +- 97,110,100,108,101,32,37,115,114,67,0,0,0,41,2,114, +- 67,0,0,0,218,11,73,109,112,111,114,116,69,114,114,111, +- 114,41,4,114,78,0,0,0,114,67,0,0,0,114,99,0, +- 0,0,114,100,0,0,0,41,1,218,6,109,101,116,104,111, +- 100,114,4,0,0,0,114,5,0,0,0,218,19,95,99,104, +- 101,99,107,95,110,97,109,101,95,119,114,97,112,112,101,114, +- 3,2,0,0,115,10,0,0,0,0,1,12,1,12,1,15, +- 1,25,1,122,40,95,99,104,101,99,107,95,110,97,109,101, +- 46,60,108,111,99,97,108,115,62,46,95,99,104,101,99,107, +- 95,110,97,109,101,95,119,114,97,112,112,101,114,41,1,114, +- 65,0,0,0,41,2,114,148,0,0,0,114,149,0,0,0, +- 114,4,0,0,0,41,1,114,148,0,0,0,114,5,0,0, +- 0,218,11,95,99,104,101,99,107,95,110,97,109,101,251,1, +- 0,0,115,6,0,0,0,0,8,21,6,13,1,114,150,0, +- 0,0,99,1,0,0,0,0,0,0,0,2,0,0,0,3, +- 0,0,0,3,0,0,0,115,35,0,0,0,135,0,0,102, +- 1,0,100,1,0,100,2,0,134,0,0,125,1,0,116,0, +- 0,124,1,0,136,0,0,131,2,0,1,124,1,0,83,41, +- 3,122,49,68,101,99,111,114,97,116,111,114,32,116,111,32, +- 118,101,114,105,102,121,32,116,104,101,32,110,97,109,101,100, +- 32,109,111,100,117,108,101,32,105,115,32,98,117,105,108,116, +- 45,105,110,46,99,2,0,0,0,0,0,0,0,2,0,0, +- 0,4,0,0,0,19,0,0,0,115,58,0,0,0,124,1, +- 0,116,0,0,106,1,0,107,7,0,114,45,0,116,2,0, +- 100,1,0,106,3,0,124,1,0,131,1,0,100,2,0,124, +- 1,0,131,1,1,130,1,0,110,0,0,136,0,0,124,0, +- 0,124,1,0,131,2,0,83,41,3,78,122,29,123,33,114, +- 125,32,105,115,32,110,111,116,32,97,32,98,117,105,108,116, +- 45,105,110,32,109,111,100,117,108,101,114,67,0,0,0,41, +- 4,114,7,0,0,0,218,20,98,117,105,108,116,105,110,95, +- 109,111,100,117,108,101,95,110,97,109,101,115,114,147,0,0, +- 0,114,47,0,0,0,41,2,114,78,0,0,0,218,8,102, +- 117,108,108,110,97,109,101,41,1,218,3,102,120,110,114,4, +- 0,0,0,114,5,0,0,0,218,25,95,114,101,113,117,105, +- 114,101,115,95,98,117,105,108,116,105,110,95,119,114,97,112, +- 112,101,114,15,2,0,0,115,8,0,0,0,0,1,15,1, +- 18,1,12,1,122,52,95,114,101,113,117,105,114,101,115,95, +- 98,117,105,108,116,105,110,46,60,108,111,99,97,108,115,62, +- 46,95,114,101,113,117,105,114,101,115,95,98,117,105,108,116, +- 105,110,95,119,114,97,112,112,101,114,41,1,114,65,0,0, +- 0,41,2,114,153,0,0,0,114,154,0,0,0,114,4,0, +- 0,0,41,1,114,153,0,0,0,114,5,0,0,0,218,17, +- 95,114,101,113,117,105,114,101,115,95,98,117,105,108,116,105, +- 110,13,2,0,0,115,6,0,0,0,0,2,18,5,13,1, +- 114,155,0,0,0,99,1,0,0,0,0,0,0,0,2,0, +- 0,0,3,0,0,0,3,0,0,0,115,35,0,0,0,135, +- 0,0,102,1,0,100,1,0,100,2,0,134,0,0,125,1, +- 0,116,0,0,124,1,0,136,0,0,131,2,0,1,124,1, +- 0,83,41,3,122,47,68,101,99,111,114,97,116,111,114,32, +- 116,111,32,118,101,114,105,102,121,32,116,104,101,32,110,97, +- 109,101,100,32,109,111,100,117,108,101,32,105,115,32,102,114, +- 111,122,101,110,46,99,2,0,0,0,0,0,0,0,2,0, +- 0,0,4,0,0,0,19,0,0,0,115,58,0,0,0,116, +- 0,0,106,1,0,124,1,0,131,1,0,115,45,0,116,2, +- 0,100,1,0,106,3,0,124,1,0,131,1,0,100,2,0, +- 124,1,0,131,1,1,130,1,0,110,0,0,136,0,0,124, +- 0,0,124,1,0,131,2,0,83,41,3,78,122,27,123,33, +- 114,125,32,105,115,32,110,111,116,32,97,32,102,114,111,122, +- 101,110,32,109,111,100,117,108,101,114,67,0,0,0,41,4, +- 114,96,0,0,0,218,9,105,115,95,102,114,111,122,101,110, +- 114,147,0,0,0,114,47,0,0,0,41,2,114,78,0,0, +- 0,114,152,0,0,0,41,1,114,153,0,0,0,114,4,0, +- 0,0,114,5,0,0,0,218,24,95,114,101,113,117,105,114, +- 101,115,95,102,114,111,122,101,110,95,119,114,97,112,112,101, +- 114,26,2,0,0,115,8,0,0,0,0,1,15,1,18,1, +- 12,1,122,50,95,114,101,113,117,105,114,101,115,95,102,114, +- 111,122,101,110,46,60,108,111,99,97,108,115,62,46,95,114, +- 101,113,117,105,114,101,115,95,102,114,111,122,101,110,95,119, +- 114,97,112,112,101,114,41,1,114,65,0,0,0,41,2,114, +- 153,0,0,0,114,157,0,0,0,114,4,0,0,0,41,1, +- 114,153,0,0,0,114,5,0,0,0,218,16,95,114,101,113, +- 117,105,114,101,115,95,102,114,111,122,101,110,24,2,0,0, +- 115,6,0,0,0,0,2,18,5,13,1,114,158,0,0,0, +- 99,2,0,0,0,0,0,0,0,5,0,0,0,5,0,0, +- 0,67,0,0,0,115,87,0,0,0,124,0,0,106,0,0, +- 124,1,0,131,1,0,92,2,0,125,2,0,125,3,0,124, +- 2,0,100,1,0,107,8,0,114,83,0,116,1,0,124,3, +- 0,131,1,0,114,83,0,100,2,0,125,4,0,116,2,0, +- 106,3,0,124,4,0,106,4,0,124,3,0,100,3,0,25, +- 131,1,0,116,5,0,131,2,0,1,110,0,0,124,2,0, +- 83,41,4,122,86,84,114,121,32,116,111,32,102,105,110,100, +- 32,97,32,108,111,97,100,101,114,32,102,111,114,32,116,104, +- 101,32,115,112,101,99,105,102,105,101,100,32,109,111,100,117, +- 108,101,32,98,121,32,100,101,108,101,103,97,116,105,110,103, +- 32,116,111,10,32,32,32,32,115,101,108,102,46,102,105,110, +- 100,95,108,111,97,100,101,114,40,41,46,78,122,44,78,111, +- 116,32,105,109,112,111,114,116,105,110,103,32,100,105,114,101, +- 99,116,111,114,121,32,123,125,58,32,109,105,115,115,105,110, +- 103,32,95,95,105,110,105,116,95,95,114,71,0,0,0,41, +- 6,218,11,102,105,110,100,95,108,111,97,100,101,114,114,31, +- 0,0,0,218,9,95,119,97,114,110,105,110,103,115,218,4, +- 119,97,114,110,114,47,0,0,0,218,13,73,109,112,111,114, +- 116,87,97,114,110,105,110,103,41,5,114,78,0,0,0,114, +- 152,0,0,0,218,6,108,111,97,100,101,114,218,8,112,111, +- 114,116,105,111,110,115,218,3,109,115,103,114,4,0,0,0, +- 114,4,0,0,0,114,5,0,0,0,218,17,95,102,105,110, +- 100,95,109,111,100,117,108,101,95,115,104,105,109,35,2,0, +- 0,115,10,0,0,0,0,6,21,1,24,1,6,1,32,1, +- 114,166,0,0,0,99,2,0,0,0,0,0,0,0,5,0, +- 0,0,3,0,0,0,67,0,0,0,115,93,0,0,0,116, +- 0,0,124,1,0,124,0,0,131,2,0,125,2,0,116,1, +- 0,124,2,0,131,1,0,125,3,0,124,1,0,116,2,0, +- 106,3,0,107,6,0,114,79,0,116,2,0,106,3,0,124, +- 1,0,25,125,4,0,124,3,0,106,4,0,124,4,0,131, +- 1,0,1,116,2,0,106,3,0,124,1,0,25,83,124,3, +- 0,106,5,0,131,0,0,83,100,1,0,83,41,2,122,57, +- 76,111,97,100,32,116,104,101,32,115,112,101,99,105,102,105, +- 101,100,32,109,111,100,117,108,101,32,105,110,116,111,32,115, +- 121,115,46,109,111,100,117,108,101,115,32,97,110,100,32,114, +- 101,116,117,114,110,32,105,116,46,78,41,6,218,16,115,112, +- 101,99,95,102,114,111,109,95,108,111,97,100,101,114,218,12, +- 95,83,112,101,99,77,101,116,104,111,100,115,114,7,0,0, +- 0,218,7,109,111,100,117,108,101,115,218,4,101,120,101,99, +- 218,4,108,111,97,100,41,5,114,78,0,0,0,114,152,0, +- 0,0,218,4,115,112,101,99,218,7,109,101,116,104,111,100, +- 115,218,6,109,111,100,117,108,101,114,4,0,0,0,114,4, +- 0,0,0,114,5,0,0,0,218,17,95,108,111,97,100,95, +- 109,111,100,117,108,101,95,115,104,105,109,48,2,0,0,115, +- 14,0,0,0,0,3,15,1,12,1,15,1,13,1,13,1, +- 11,2,114,175,0,0,0,99,4,0,0,0,0,0,0,0, +- 11,0,0,0,19,0,0,0,67,0,0,0,115,243,1,0, +- 0,105,0,0,125,4,0,124,2,0,100,1,0,107,9,0, +- 114,31,0,124,2,0,124,4,0,100,2,0,60,110,6,0, +- 100,3,0,125,2,0,124,3,0,100,1,0,107,9,0,114, +- 62,0,124,3,0,124,4,0,100,4,0,60,110,0,0,124, +- 0,0,100,1,0,100,5,0,133,2,0,25,125,5,0,124, +- 0,0,100,5,0,100,6,0,133,2,0,25,125,6,0,124, +- 0,0,100,6,0,100,7,0,133,2,0,25,125,7,0,124, +- 5,0,116,0,0,107,3,0,114,168,0,100,8,0,106,1, +- 0,124,2,0,124,5,0,131,2,0,125,8,0,116,2,0, +- 124,8,0,131,1,0,1,116,3,0,124,8,0,124,4,0, +- 141,1,0,130,1,0,110,116,0,116,4,0,124,6,0,131, +- 1,0,100,5,0,107,3,0,114,226,0,100,9,0,106,1, +- 0,124,2,0,131,1,0,125,8,0,116,2,0,124,8,0, +- 131,1,0,1,116,5,0,124,8,0,131,1,0,130,1,0, +- 110,58,0,116,4,0,124,7,0,131,1,0,100,5,0,107, +- 3,0,114,28,1,100,10,0,106,1,0,124,2,0,131,1, +- 0,125,8,0,116,2,0,124,8,0,131,1,0,1,116,5, +- 0,124,8,0,131,1,0,130,1,0,110,0,0,124,1,0, +- 100,1,0,107,9,0,114,229,1,121,20,0,116,6,0,124, +- 1,0,100,11,0,25,131,1,0,125,9,0,87,110,18,0, +- 4,116,7,0,107,10,0,114,80,1,1,1,1,89,110,62, +- 0,88,116,8,0,124,6,0,131,1,0,124,9,0,107,3, +- 0,114,142,1,100,12,0,106,1,0,124,2,0,131,1,0, +- 125,8,0,116,2,0,124,8,0,131,1,0,1,116,3,0, +- 124,8,0,124,4,0,141,1,0,130,1,0,110,0,0,121, +- 18,0,124,1,0,100,13,0,25,100,14,0,64,125,10,0, +- 87,110,18,0,4,116,7,0,107,10,0,114,180,1,1,1, +- 1,89,113,229,1,88,116,8,0,124,7,0,131,1,0,124, +- 10,0,107,3,0,114,229,1,116,3,0,100,12,0,106,1, +- 0,124,2,0,131,1,0,124,4,0,141,1,0,130,1,0, +- 113,229,1,110,0,0,124,0,0,100,7,0,100,1,0,133, +- 2,0,25,83,41,15,97,122,1,0,0,86,97,108,105,100, +- 97,116,101,32,116,104,101,32,104,101,97,100,101,114,32,111, +- 102,32,116,104,101,32,112,97,115,115,101,100,45,105,110,32, +- 98,121,116,101,99,111,100,101,32,97,103,97,105,110,115,116, +- 32,115,111,117,114,99,101,95,115,116,97,116,115,32,40,105, +- 102,10,32,32,32,32,103,105,118,101,110,41,32,97,110,100, +- 32,114,101,116,117,114,110,105,110,103,32,116,104,101,32,98, +- 121,116,101,99,111,100,101,32,116,104,97,116,32,99,97,110, +- 32,98,101,32,99,111,109,112,105,108,101,100,32,98,121,32, +- 99,111,109,112,105,108,101,40,41,46,10,10,32,32,32,32, +- 65,108,108,32,111,116,104,101,114,32,97,114,103,117,109,101, +- 110,116,115,32,97,114,101,32,117,115,101,100,32,116,111,32, +- 101,110,104,97,110,99,101,32,101,114,114,111,114,32,114,101, +- 112,111,114,116,105,110,103,46,10,10,32,32,32,32,73,109, +- 112,111,114,116,69,114,114,111,114,32,105,115,32,114,97,105, +- 115,101,100,32,119,104,101,110,32,116,104,101,32,109,97,103, +- 105,99,32,110,117,109,98,101,114,32,105,115,32,105,110,99, +- 111,114,114,101,99,116,32,111,114,32,116,104,101,32,98,121, +- 116,101,99,111,100,101,32,105,115,10,32,32,32,32,102,111, +- 117,110,100,32,116,111,32,98,101,32,115,116,97,108,101,46, +- 32,69,79,70,69,114,114,111,114,32,105,115,32,114,97,105, +- 115,101,100,32,119,104,101,110,32,116,104,101,32,100,97,116, +- 97,32,105,115,32,102,111,117,110,100,32,116,111,32,98,101, +- 10,32,32,32,32,116,114,117,110,99,97,116,101,100,46,10, +- 10,32,32,32,32,78,114,67,0,0,0,122,10,60,98,121, +- 116,101,99,111,100,101,62,114,35,0,0,0,114,12,0,0, +- 0,233,8,0,0,0,233,12,0,0,0,122,30,98,97,100, +- 32,109,97,103,105,99,32,110,117,109,98,101,114,32,105,110, +- 32,123,33,114,125,58,32,123,33,114,125,122,43,114,101,97, +- 99,104,101,100,32,69,79,70,32,119,104,105,108,101,32,114, +- 101,97,100,105,110,103,32,116,105,109,101,115,116,97,109,112, +- 32,105,110,32,123,33,114,125,122,48,114,101,97,99,104,101, +- 100,32,69,79,70,32,119,104,105,108,101,32,114,101,97,100, +- 105,110,103,32,115,105,122,101,32,111,102,32,115,111,117,114, +- 99,101,32,105,110,32,123,33,114,125,218,5,109,116,105,109, +- 101,122,26,98,121,116,101,99,111,100,101,32,105,115,32,115, +- 116,97,108,101,32,102,111,114,32,123,33,114,125,218,4,115, +- 105,122,101,108,3,0,0,0,255,127,255,127,3,0,41,9, +- 218,12,77,65,71,73,67,95,78,85,77,66,69,82,114,47, +- 0,0,0,114,146,0,0,0,114,147,0,0,0,114,31,0, +- 0,0,218,8,69,79,70,69,114,114,111,114,114,14,0,0, +- 0,114,104,0,0,0,114,19,0,0,0,41,11,114,53,0, +- 0,0,218,12,115,111,117,114,99,101,95,115,116,97,116,115, +- 114,67,0,0,0,114,35,0,0,0,90,11,101,120,99,95, +- 100,101,116,97,105,108,115,90,5,109,97,103,105,99,90,13, +- 114,97,119,95,116,105,109,101,115,116,97,109,112,90,8,114, +- 97,119,95,115,105,122,101,114,145,0,0,0,218,12,115,111, +- 117,114,99,101,95,109,116,105,109,101,218,11,115,111,117,114, +- 99,101,95,115,105,122,101,114,4,0,0,0,114,4,0,0, +- 0,114,5,0,0,0,218,25,95,118,97,108,105,100,97,116, +- 101,95,98,121,116,101,99,111,100,101,95,104,101,97,100,101, +- 114,61,2,0,0,115,76,0,0,0,0,11,6,1,12,1, +- 13,3,6,1,12,1,13,1,16,1,16,1,16,1,12,1, +- 18,1,10,1,18,1,18,1,15,1,10,1,15,1,18,1, +- 15,1,10,1,15,1,12,1,3,1,20,1,13,1,5,2, +- 18,1,15,1,10,1,18,1,3,1,18,1,13,1,5,2, +- 18,1,15,1,15,1,114,185,0,0,0,99,4,0,0,0, +- 0,0,0,0,5,0,0,0,6,0,0,0,67,0,0,0, +- 115,115,0,0,0,116,0,0,106,1,0,124,0,0,131,1, +- 0,125,4,0,116,2,0,124,4,0,116,3,0,131,2,0, +- 114,78,0,116,4,0,100,1,0,124,2,0,131,2,0,1, +- 124,3,0,100,2,0,107,9,0,114,74,0,116,5,0,106, +- 6,0,124,4,0,124,3,0,131,2,0,1,110,0,0,124, +- 4,0,83,116,7,0,100,3,0,106,8,0,124,2,0,131, +- 1,0,100,4,0,124,1,0,100,5,0,124,2,0,131,1, +- 2,130,1,0,100,2,0,83,41,6,122,60,67,111,109,112, +- 105,108,101,32,98,121,116,101,99,111,100,101,32,97,115,32, +- 114,101,116,117,114,110,101,100,32,98,121,32,95,118,97,108, +- 105,100,97,116,101,95,98,121,116,101,99,111,100,101,95,104, +- 101,97,100,101,114,40,41,46,122,21,99,111,100,101,32,111, +- 98,106,101,99,116,32,102,114,111,109,32,123,33,114,125,78, +- 122,23,78,111,110,45,99,111,100,101,32,111,98,106,101,99, +- 116,32,105,110,32,123,33,114,125,114,67,0,0,0,114,35, +- 0,0,0,41,9,218,7,109,97,114,115,104,97,108,90,5, +- 108,111,97,100,115,218,10,105,115,105,110,115,116,97,110,99, +- 101,218,10,95,99,111,100,101,95,116,121,112,101,114,146,0, +- 0,0,114,96,0,0,0,90,16,95,102,105,120,95,99,111, +- 95,102,105,108,101,110,97,109,101,114,147,0,0,0,114,47, +- 0,0,0,41,5,114,53,0,0,0,114,67,0,0,0,114, +- 134,0,0,0,114,135,0,0,0,218,4,99,111,100,101,114, +- 4,0,0,0,114,4,0,0,0,114,5,0,0,0,218,17, +- 95,99,111,109,112,105,108,101,95,98,121,116,101,99,111,100, +- 101,116,2,0,0,115,16,0,0,0,0,2,15,1,15,1, +- 13,1,12,1,19,1,4,2,18,1,114,190,0,0,0,114, +- 71,0,0,0,99,3,0,0,0,0,0,0,0,4,0,0, +- 0,3,0,0,0,67,0,0,0,115,76,0,0,0,116,0, +- 0,116,1,0,131,1,0,125,3,0,124,3,0,106,2,0, +- 116,3,0,124,1,0,131,1,0,131,1,0,1,124,3,0, +- 106,2,0,116,3,0,124,2,0,131,1,0,131,1,0,1, +- 124,3,0,106,2,0,116,4,0,106,5,0,124,0,0,131, +- 1,0,131,1,0,1,124,3,0,83,41,1,122,80,67,111, +- 109,112,105,108,101,32,97,32,99,111,100,101,32,111,98,106, +- 101,99,116,32,105,110,116,111,32,98,121,116,101,99,111,100, +- 101,32,102,111,114,32,119,114,105,116,105,110,103,32,111,117, +- 116,32,116,111,32,97,32,98,121,116,101,45,99,111,109,112, +- 105,108,101,100,10,32,32,32,32,102,105,108,101,46,41,6, +- 218,9,98,121,116,101,97,114,114,97,121,114,180,0,0,0, +- 218,6,101,120,116,101,110,100,114,17,0,0,0,114,186,0, +- 0,0,90,5,100,117,109,112,115,41,4,114,189,0,0,0, +- 114,178,0,0,0,114,184,0,0,0,114,53,0,0,0,114, +- 4,0,0,0,114,4,0,0,0,114,5,0,0,0,218,17, +- 95,99,111,100,101,95,116,111,95,98,121,116,101,99,111,100, +- 101,128,2,0,0,115,10,0,0,0,0,3,12,1,19,1, +- 19,1,22,1,114,193,0,0,0,99,1,0,0,0,0,0, +- 0,0,5,0,0,0,4,0,0,0,67,0,0,0,115,89, +- 0,0,0,100,1,0,100,2,0,108,0,0,125,1,0,116, +- 1,0,106,2,0,124,0,0,131,1,0,106,3,0,125,2, +- 0,124,1,0,106,4,0,124,2,0,131,1,0,125,3,0, +- 116,1,0,106,5,0,100,2,0,100,3,0,131,2,0,125, +- 4,0,124,4,0,106,6,0,124,0,0,106,6,0,124,3, +- 0,100,1,0,25,131,1,0,131,1,0,83,41,4,122,121, +- 68,101,99,111,100,101,32,98,121,116,101,115,32,114,101,112, +- 114,101,115,101,110,116,105,110,103,32,115,111,117,114,99,101, +- 32,99,111,100,101,32,97,110,100,32,114,101,116,117,114,110, +- 32,116,104,101,32,115,116,114,105,110,103,46,10,10,32,32, +- 32,32,85,110,105,118,101,114,115,97,108,32,110,101,119,108, +- 105,110,101,32,115,117,112,112,111,114,116,32,105,115,32,117, +- 115,101,100,32,105,110,32,116,104,101,32,100,101,99,111,100, +- 105,110,103,46,10,32,32,32,32,114,71,0,0,0,78,84, +- 41,7,218,8,116,111,107,101,110,105,122,101,114,49,0,0, +- 0,90,7,66,121,116,101,115,73,79,90,8,114,101,97,100, +- 108,105,110,101,90,15,100,101,116,101,99,116,95,101,110,99, +- 111,100,105,110,103,90,25,73,110,99,114,101,109,101,110,116, +- 97,108,78,101,119,108,105,110,101,68,101,99,111,100,101,114, +- 218,6,100,101,99,111,100,101,41,5,218,12,115,111,117,114, +- 99,101,95,98,121,116,101,115,114,194,0,0,0,90,21,115, +- 111,117,114,99,101,95,98,121,116,101,115,95,114,101,97,100, +- 108,105,110,101,218,8,101,110,99,111,100,105,110,103,90,15, +- 110,101,119,108,105,110,101,95,100,101,99,111,100,101,114,114, +- 4,0,0,0,114,4,0,0,0,114,5,0,0,0,218,13, +- 100,101,99,111,100,101,95,115,111,117,114,99,101,138,2,0, +- 0,115,10,0,0,0,0,5,12,1,18,1,15,1,18,1, +- 114,198,0,0,0,99,1,0,0,0,0,0,0,0,5,0, +- 0,0,35,0,0,0,67,0,0,0,115,15,1,0,0,116, +- 0,0,124,0,0,100,1,0,100,0,0,131,3,0,125,1, +- 0,116,1,0,124,1,0,100,2,0,131,2,0,114,74,0, +- 121,17,0,124,1,0,106,2,0,124,0,0,131,1,0,83, +- 87,113,74,0,4,116,3,0,107,10,0,114,70,0,1,1, +- 1,89,113,74,0,88,110,0,0,121,13,0,124,0,0,106, +- 4,0,125,2,0,87,110,18,0,4,116,5,0,107,10,0, +- 114,107,0,1,1,1,89,110,29,0,88,124,2,0,100,0, +- 0,107,9,0,114,136,0,116,6,0,124,2,0,131,1,0, +- 106,2,0,131,0,0,83,121,13,0,124,0,0,106,7,0, +- 125,3,0,87,110,24,0,4,116,5,0,107,10,0,114,175, +- 0,1,1,1,100,3,0,125,3,0,89,110,1,0,88,121, +- 13,0,124,0,0,106,8,0,125,4,0,87,110,59,0,4, +- 116,5,0,107,10,0,114,250,0,1,1,1,124,1,0,100, +- 0,0,107,8,0,114,230,0,100,4,0,106,9,0,124,3, +- 0,131,1,0,83,100,5,0,106,9,0,124,3,0,124,1, +- 0,131,2,0,83,89,110,17,0,88,100,6,0,106,9,0, +- 124,3,0,124,4,0,131,2,0,83,100,0,0,83,41,7, +- 78,218,10,95,95,108,111,97,100,101,114,95,95,218,11,109, +- 111,100,117,108,101,95,114,101,112,114,250,1,63,122,13,60, +- 109,111,100,117,108,101,32,123,33,114,125,62,122,20,60,109, +- 111,100,117,108,101,32,123,33,114,125,32,40,123,33,114,125, +- 41,62,122,23,60,109,111,100,117,108,101,32,123,33,114,125, +- 32,102,114,111,109,32,123,33,114,125,62,41,10,114,62,0, +- 0,0,114,60,0,0,0,114,200,0,0,0,218,9,69,120, +- 99,101,112,116,105,111,110,218,8,95,95,115,112,101,99,95, +- 95,218,14,65,116,116,114,105,98,117,116,101,69,114,114,111, +- 114,114,168,0,0,0,114,57,0,0,0,218,8,95,95,102, +- 105,108,101,95,95,114,47,0,0,0,41,5,114,174,0,0, +- 0,114,163,0,0,0,114,172,0,0,0,114,67,0,0,0, +- 114,125,0,0,0,114,4,0,0,0,114,4,0,0,0,114, +- 5,0,0,0,218,12,95,109,111,100,117,108,101,95,114,101, +- 112,114,152,2,0,0,115,46,0,0,0,0,2,18,1,15, +- 2,3,1,17,1,13,1,8,1,3,1,13,1,13,1,5, +- 2,12,1,16,4,3,1,13,1,13,1,11,1,3,1,13, +- 1,13,1,12,1,13,2,21,2,114,206,0,0,0,99,0, +- 0,0,0,0,0,0,0,0,0,0,0,2,0,0,0,64, +- 0,0,0,115,52,0,0,0,101,0,0,90,1,0,100,0, +- 0,90,2,0,100,1,0,100,2,0,132,0,0,90,3,0, +- 100,3,0,100,4,0,132,0,0,90,4,0,100,5,0,100, +- 6,0,132,0,0,90,5,0,100,7,0,83,41,8,218,17, +- 95,105,110,115,116,97,108,108,101,100,95,115,97,102,101,108, +- 121,99,2,0,0,0,0,0,0,0,2,0,0,0,2,0, +- 0,0,67,0,0,0,115,25,0,0,0,124,1,0,124,0, +- 0,95,0,0,124,1,0,106,1,0,124,0,0,95,2,0, +- 100,0,0,83,41,1,78,41,3,218,7,95,109,111,100,117, +- 108,101,114,203,0,0,0,218,5,95,115,112,101,99,41,2, +- 114,78,0,0,0,114,174,0,0,0,114,4,0,0,0,114, +- 4,0,0,0,114,5,0,0,0,114,79,0,0,0,188,2, +- 0,0,115,4,0,0,0,0,1,9,1,122,26,95,105,110, +- 115,116,97,108,108,101,100,95,115,97,102,101,108,121,46,95, ++ 218,11,95,112,97,116,104,95,105,115,100,105,114,92,0,0, ++ 0,115,6,0,0,0,0,2,6,1,15,1,114,46,0,0, ++ 0,105,182,1,0,0,99,3,0,0,0,0,0,0,0,6, ++ 0,0,0,17,0,0,0,67,0,0,0,115,192,0,0,0, ++ 100,1,0,106,0,0,124,0,0,116,1,0,124,0,0,131, ++ 1,0,131,2,0,125,3,0,116,2,0,106,3,0,124,3, ++ 0,116,2,0,106,4,0,116,2,0,106,5,0,66,116,2, ++ 0,106,6,0,66,124,2,0,100,2,0,64,131,3,0,125, ++ 4,0,121,60,0,116,7,0,106,8,0,124,4,0,100,3, ++ 0,131,2,0,143,20,0,125,5,0,124,5,0,106,9,0, ++ 124,1,0,131,1,0,1,87,100,4,0,81,88,116,2,0, ++ 106,10,0,124,3,0,124,0,0,131,2,0,1,87,110,59, ++ 0,4,116,11,0,107,10,0,114,187,0,1,1,1,121,17, ++ 0,116,2,0,106,12,0,124,3,0,131,1,0,1,87,110, ++ 18,0,4,116,11,0,107,10,0,114,179,0,1,1,1,89, ++ 110,1,0,88,130,0,0,89,110,1,0,88,100,4,0,83, ++ 41,5,122,162,66,101,115,116,45,101,102,102,111,114,116,32, ++ 102,117,110,99,116,105,111,110,32,116,111,32,119,114,105,116, ++ 101,32,100,97,116,97,32,116,111,32,97,32,112,97,116,104, ++ 32,97,116,111,109,105,99,97,108,108,121,46,10,32,32,32, ++ 32,66,101,32,112,114,101,112,97,114,101,100,32,116,111,32, ++ 104,97,110,100,108,101,32,97,32,70,105,108,101,69,120,105, ++ 115,116,115,69,114,114,111,114,32,105,102,32,99,111,110,99, ++ 117,114,114,101,110,116,32,119,114,105,116,105,110,103,32,111, ++ 102,32,116,104,101,10,32,32,32,32,116,101,109,112,111,114, ++ 97,114,121,32,102,105,108,101,32,105,115,32,97,116,116,101, ++ 109,112,116,101,100,46,122,5,123,125,46,123,125,105,182,1, ++ 0,0,90,2,119,98,78,41,13,218,6,102,111,114,109,97, ++ 116,218,2,105,100,114,3,0,0,0,90,4,111,112,101,110, ++ 90,6,79,95,69,88,67,76,90,7,79,95,67,82,69,65, ++ 84,90,8,79,95,87,82,79,78,76,89,218,3,95,105,111, ++ 218,6,70,105,108,101,73,79,218,5,119,114,105,116,101,218, ++ 7,114,101,112,108,97,99,101,114,40,0,0,0,90,6,117, ++ 110,108,105,110,107,41,6,114,35,0,0,0,218,4,100,97, ++ 116,97,114,42,0,0,0,90,8,112,97,116,104,95,116,109, ++ 112,90,2,102,100,218,4,102,105,108,101,114,4,0,0,0, ++ 114,4,0,0,0,114,5,0,0,0,218,13,95,119,114,105, ++ 116,101,95,97,116,111,109,105,99,99,0,0,0,115,26,0, ++ 0,0,0,5,24,1,9,1,33,1,3,3,21,1,19,1, ++ 20,1,13,1,3,1,17,1,13,1,5,1,114,55,0,0, ++ 0,99,2,0,0,0,0,0,0,0,3,0,0,0,7,0, ++ 0,0,67,0,0,0,115,95,0,0,0,120,69,0,100,1, ++ 0,100,2,0,100,3,0,100,4,0,103,4,0,68,93,49, ++ 0,125,2,0,116,0,0,124,1,0,124,2,0,131,2,0, ++ 114,19,0,116,1,0,124,0,0,124,2,0,116,2,0,124, ++ 1,0,124,2,0,131,2,0,131,3,0,1,113,19,0,113, ++ 19,0,87,124,0,0,106,3,0,106,4,0,124,1,0,106, ++ 3,0,131,1,0,1,100,5,0,83,41,6,122,47,83,105, ++ 109,112,108,101,32,115,117,98,115,116,105,116,117,116,101,32, ++ 102,111,114,32,102,117,110,99,116,111,111,108,115,46,117,112, ++ 100,97,116,101,95,119,114,97,112,112,101,114,46,218,10,95, ++ 95,109,111,100,117,108,101,95,95,218,8,95,95,110,97,109, ++ 101,95,95,218,12,95,95,113,117,97,108,110,97,109,101,95, ++ 95,218,7,95,95,100,111,99,95,95,78,41,5,218,7,104, ++ 97,115,97,116,116,114,218,7,115,101,116,97,116,116,114,218, ++ 7,103,101,116,97,116,116,114,218,8,95,95,100,105,99,116, ++ 95,95,218,6,117,112,100,97,116,101,41,3,90,3,110,101, ++ 119,90,3,111,108,100,114,52,0,0,0,114,4,0,0,0, ++ 114,4,0,0,0,114,5,0,0,0,218,5,95,119,114,97, ++ 112,121,0,0,0,115,8,0,0,0,0,2,25,1,15,1, ++ 32,1,114,65,0,0,0,99,1,0,0,0,0,0,0,0, ++ 1,0,0,0,2,0,0,0,67,0,0,0,115,16,0,0, ++ 0,116,0,0,116,1,0,131,1,0,124,0,0,131,1,0, ++ 83,41,1,78,41,2,218,4,116,121,112,101,114,7,0,0, ++ 0,41,1,218,4,110,97,109,101,114,4,0,0,0,114,4, ++ 0,0,0,114,5,0,0,0,218,11,95,110,101,119,95,109, ++ 111,100,117,108,101,129,0,0,0,115,2,0,0,0,0,1, ++ 114,68,0,0,0,99,0,0,0,0,0,0,0,0,0,0, ++ 0,0,2,0,0,0,64,0,0,0,115,58,0,0,0,101, ++ 0,0,90,1,0,100,0,0,90,2,0,100,1,0,90,3, ++ 0,100,2,0,100,3,0,132,0,0,90,4,0,100,4,0, ++ 100,5,0,132,0,0,90,5,0,100,6,0,100,7,0,132, ++ 0,0,90,6,0,100,8,0,83,41,9,218,13,95,77,97, ++ 110,97,103,101,82,101,108,111,97,100,122,63,77,97,110,97, ++ 103,101,115,32,116,104,101,32,112,111,115,115,105,98,108,101, ++ 32,99,108,101,97,110,45,117,112,32,111,102,32,115,121,115, ++ 46,109,111,100,117,108,101,115,32,102,111,114,32,108,111,97, ++ 100,95,109,111,100,117,108,101,40,41,46,99,2,0,0,0, ++ 0,0,0,0,2,0,0,0,2,0,0,0,67,0,0,0, ++ 115,13,0,0,0,124,1,0,124,0,0,95,0,0,100,0, ++ 0,83,41,1,78,41,1,218,5,95,110,97,109,101,41,2, ++ 218,4,115,101,108,102,114,67,0,0,0,114,4,0,0,0, ++ 114,4,0,0,0,114,5,0,0,0,218,8,95,95,105,110, ++ 105,116,95,95,141,0,0,0,115,2,0,0,0,0,1,122, ++ 22,95,77,97,110,97,103,101,82,101,108,111,97,100,46,95, + 95,105,110,105,116,95,95,99,1,0,0,0,0,0,0,0, +- 1,0,0,0,3,0,0,0,67,0,0,0,115,38,0,0, +- 0,100,1,0,124,0,0,106,0,0,95,1,0,124,0,0, +- 106,2,0,116,3,0,106,4,0,124,0,0,106,0,0,106, +- 5,0,60,100,0,0,83,41,2,78,84,41,6,114,209,0, +- 0,0,218,13,95,105,110,105,116,105,97,108,105,122,105,110, +- 103,114,208,0,0,0,114,7,0,0,0,114,169,0,0,0, +- 114,67,0,0,0,41,1,114,78,0,0,0,114,4,0,0, +- 0,114,4,0,0,0,114,5,0,0,0,114,98,0,0,0, +- 192,2,0,0,115,4,0,0,0,0,4,12,1,122,27,95, +- 105,110,115,116,97,108,108,101,100,95,115,97,102,101,108,121, +- 46,95,95,101,110,116,101,114,95,95,99,1,0,0,0,0, +- 0,0,0,3,0,0,0,17,0,0,0,71,0,0,0,115, +- 121,0,0,0,122,101,0,124,0,0,106,0,0,125,2,0, +- 116,1,0,100,1,0,100,2,0,132,0,0,124,1,0,68, +- 131,1,0,131,1,0,114,78,0,121,17,0,116,2,0,106, +- 3,0,124,2,0,106,4,0,61,87,113,100,0,4,116,5, +- 0,107,10,0,114,74,0,1,1,1,89,113,100,0,88,110, +- 22,0,116,6,0,100,3,0,124,2,0,106,4,0,124,2, +- 0,106,7,0,131,3,0,1,87,100,0,0,100,4,0,124, +- 0,0,106,0,0,95,8,0,88,100,0,0,83,41,5,78, ++ 1,0,0,0,2,0,0,0,67,0,0,0,115,25,0,0, ++ 0,124,0,0,106,0,0,116,1,0,106,2,0,107,6,0, ++ 124,0,0,95,3,0,100,0,0,83,41,1,78,41,4,114, ++ 70,0,0,0,114,7,0,0,0,218,7,109,111,100,117,108, ++ 101,115,218,10,95,105,115,95,114,101,108,111,97,100,41,1, ++ 114,71,0,0,0,114,4,0,0,0,114,4,0,0,0,114, ++ 5,0,0,0,218,9,95,95,101,110,116,101,114,95,95,144, ++ 0,0,0,115,2,0,0,0,0,1,122,23,95,77,97,110, ++ 97,103,101,82,101,108,111,97,100,46,95,95,101,110,116,101, ++ 114,95,95,99,1,0,0,0,0,0,0,0,2,0,0,0, ++ 12,0,0,0,71,0,0,0,115,80,0,0,0,116,0,0, ++ 100,1,0,100,2,0,132,0,0,124,1,0,68,131,1,0, ++ 131,1,0,114,76,0,124,0,0,106,1,0,12,114,76,0, ++ 121,17,0,116,2,0,106,3,0,124,0,0,106,4,0,61, ++ 87,113,76,0,4,116,5,0,107,10,0,114,72,0,1,1, ++ 1,89,113,76,0,88,110,0,0,100,0,0,83,41,3,78, + 99,1,0,0,0,0,0,0,0,2,0,0,0,3,0,0, + 0,115,0,0,0,115,27,0,0,0,124,0,0,93,17,0, + 125,1,0,124,1,0,100,0,0,107,9,0,86,1,113,3, + 0,100,0,0,83,41,1,78,114,4,0,0,0,41,2,114, +- 22,0,0,0,90,3,97,114,103,114,4,0,0,0,114,4, ++ 22,0,0,0,218,3,97,114,103,114,4,0,0,0,114,4, + 0,0,0,114,5,0,0,0,250,9,60,103,101,110,101,120, +- 112,114,62,202,2,0,0,115,2,0,0,0,6,0,122,45, +- 95,105,110,115,116,97,108,108,101,100,95,115,97,102,101,108, +- 121,46,95,95,101,120,105,116,95,95,46,60,108,111,99,97, +- 108,115,62,46,60,103,101,110,101,120,112,114,62,122,18,105, +- 109,112,111,114,116,32,123,33,114,125,32,35,32,123,33,114, +- 125,70,41,9,114,209,0,0,0,218,3,97,110,121,114,7, +- 0,0,0,114,169,0,0,0,114,67,0,0,0,114,104,0, +- 0,0,114,146,0,0,0,114,163,0,0,0,114,210,0,0, +- 0,41,3,114,78,0,0,0,114,99,0,0,0,114,172,0, ++ 112,114,62,148,0,0,0,115,2,0,0,0,6,0,122,41, ++ 95,77,97,110,97,103,101,82,101,108,111,97,100,46,95,95, ++ 101,120,105,116,95,95,46,60,108,111,99,97,108,115,62,46, ++ 60,103,101,110,101,120,112,114,62,41,6,218,3,97,110,121, ++ 114,74,0,0,0,114,7,0,0,0,114,73,0,0,0,114, ++ 70,0,0,0,218,8,75,101,121,69,114,114,111,114,41,2, ++ 114,71,0,0,0,218,4,97,114,103,115,114,4,0,0,0, ++ 114,4,0,0,0,114,5,0,0,0,218,8,95,95,101,120, ++ 105,116,95,95,147,0,0,0,115,10,0,0,0,0,1,35, ++ 1,3,1,17,1,13,1,122,22,95,77,97,110,97,103,101, ++ 82,101,108,111,97,100,46,95,95,101,120,105,116,95,95,78, ++ 41,7,114,57,0,0,0,114,56,0,0,0,114,58,0,0, ++ 0,114,59,0,0,0,114,72,0,0,0,114,75,0,0,0, ++ 114,81,0,0,0,114,4,0,0,0,114,4,0,0,0,114, ++ 4,0,0,0,114,5,0,0,0,114,69,0,0,0,137,0, ++ 0,0,115,8,0,0,0,12,2,6,2,12,3,12,3,114, ++ 69,0,0,0,99,0,0,0,0,0,0,0,0,0,0,0, ++ 0,1,0,0,0,64,0,0,0,115,16,0,0,0,101,0, ++ 0,90,1,0,100,0,0,90,2,0,100,1,0,83,41,2, ++ 218,14,95,68,101,97,100,108,111,99,107,69,114,114,111,114, ++ 78,41,3,114,57,0,0,0,114,56,0,0,0,114,58,0, ++ 0,0,114,4,0,0,0,114,4,0,0,0,114,4,0,0, ++ 0,114,5,0,0,0,114,82,0,0,0,162,0,0,0,115, ++ 2,0,0,0,12,1,114,82,0,0,0,99,0,0,0,0, ++ 0,0,0,0,0,0,0,0,2,0,0,0,64,0,0,0, ++ 115,82,0,0,0,101,0,0,90,1,0,100,0,0,90,2, ++ 0,100,1,0,90,3,0,100,2,0,100,3,0,132,0,0, ++ 90,4,0,100,4,0,100,5,0,132,0,0,90,5,0,100, ++ 6,0,100,7,0,132,0,0,90,6,0,100,8,0,100,9, ++ 0,132,0,0,90,7,0,100,10,0,100,11,0,132,0,0, ++ 90,8,0,100,12,0,83,41,13,218,11,95,77,111,100,117, ++ 108,101,76,111,99,107,122,169,65,32,114,101,99,117,114,115, ++ 105,118,101,32,108,111,99,107,32,105,109,112,108,101,109,101, ++ 110,116,97,116,105,111,110,32,119,104,105,99,104,32,105,115, ++ 32,97,98,108,101,32,116,111,32,100,101,116,101,99,116,32, ++ 100,101,97,100,108,111,99,107,115,10,32,32,32,32,40,101, ++ 46,103,46,32,116,104,114,101,97,100,32,49,32,116,114,121, ++ 105,110,103,32,116,111,32,116,97,107,101,32,108,111,99,107, ++ 115,32,65,32,116,104,101,110,32,66,44,32,97,110,100,32, ++ 116,104,114,101,97,100,32,50,32,116,114,121,105,110,103,32, ++ 116,111,10,32,32,32,32,116,97,107,101,32,108,111,99,107, ++ 115,32,66,32,116,104,101,110,32,65,41,46,10,32,32,32, ++ 32,99,2,0,0,0,0,0,0,0,2,0,0,0,2,0, ++ 0,0,67,0,0,0,115,70,0,0,0,116,0,0,106,1, ++ 0,131,0,0,124,0,0,95,2,0,116,0,0,106,1,0, ++ 131,0,0,124,0,0,95,3,0,124,1,0,124,0,0,95, ++ 4,0,100,0,0,124,0,0,95,5,0,100,1,0,124,0, ++ 0,95,6,0,100,1,0,124,0,0,95,7,0,100,0,0, ++ 83,41,2,78,233,0,0,0,0,41,8,218,7,95,116,104, ++ 114,101,97,100,90,13,97,108,108,111,99,97,116,101,95,108, ++ 111,99,107,218,4,108,111,99,107,218,6,119,97,107,101,117, ++ 112,114,67,0,0,0,218,5,111,119,110,101,114,218,5,99, ++ 111,117,110,116,218,7,119,97,105,116,101,114,115,41,2,114, ++ 71,0,0,0,114,67,0,0,0,114,4,0,0,0,114,4, ++ 0,0,0,114,5,0,0,0,114,72,0,0,0,172,0,0, ++ 0,115,12,0,0,0,0,1,15,1,15,1,9,1,9,1, ++ 9,1,122,20,95,77,111,100,117,108,101,76,111,99,107,46, ++ 95,95,105,110,105,116,95,95,99,1,0,0,0,0,0,0, ++ 0,4,0,0,0,2,0,0,0,67,0,0,0,115,87,0, ++ 0,0,116,0,0,106,1,0,131,0,0,125,1,0,124,0, ++ 0,106,2,0,125,2,0,120,59,0,116,3,0,106,4,0, ++ 124,2,0,131,1,0,125,3,0,124,3,0,100,0,0,107, ++ 8,0,114,55,0,100,1,0,83,124,3,0,106,2,0,125, ++ 2,0,124,2,0,124,1,0,107,2,0,114,24,0,100,2, ++ 0,83,113,24,0,100,0,0,83,41,3,78,70,84,41,5, ++ 114,85,0,0,0,218,9,103,101,116,95,105,100,101,110,116, ++ 114,88,0,0,0,218,12,95,98,108,111,99,107,105,110,103, ++ 95,111,110,218,3,103,101,116,41,4,114,71,0,0,0,218, ++ 2,109,101,218,3,116,105,100,114,86,0,0,0,114,4,0, ++ 0,0,114,4,0,0,0,114,5,0,0,0,218,12,104,97, ++ 115,95,100,101,97,100,108,111,99,107,180,0,0,0,115,18, ++ 0,0,0,0,2,12,1,9,1,3,1,15,1,12,1,4, ++ 1,9,1,12,1,122,24,95,77,111,100,117,108,101,76,111, ++ 99,107,46,104,97,115,95,100,101,97,100,108,111,99,107,99, ++ 1,0,0,0,0,0,0,0,2,0,0,0,17,0,0,0, ++ 67,0,0,0,115,214,0,0,0,116,0,0,106,1,0,131, ++ 0,0,125,1,0,124,0,0,116,2,0,124,1,0,60,122, ++ 177,0,120,170,0,124,0,0,106,3,0,143,130,0,1,124, ++ 0,0,106,4,0,100,1,0,107,2,0,115,68,0,124,0, ++ 0,106,5,0,124,1,0,107,2,0,114,96,0,124,1,0, ++ 124,0,0,95,5,0,124,0,0,4,106,4,0,100,2,0, ++ 55,2,95,4,0,100,3,0,83,124,0,0,106,6,0,131, ++ 0,0,114,127,0,116,7,0,100,4,0,124,0,0,22,131, ++ 1,0,130,1,0,110,0,0,124,0,0,106,8,0,106,9, ++ 0,100,5,0,131,1,0,114,163,0,124,0,0,4,106,10, ++ 0,100,2,0,55,2,95,10,0,110,0,0,87,100,6,0, ++ 81,88,124,0,0,106,8,0,106,9,0,131,0,0,1,124, ++ 0,0,106,8,0,106,11,0,131,0,0,1,113,28,0,87, ++ 100,6,0,116,2,0,124,1,0,61,88,100,6,0,83,41, ++ 7,122,185,10,32,32,32,32,32,32,32,32,65,99,113,117, ++ 105,114,101,32,116,104,101,32,109,111,100,117,108,101,32,108, ++ 111,99,107,46,32,32,73,102,32,97,32,112,111,116,101,110, ++ 116,105,97,108,32,100,101,97,100,108,111,99,107,32,105,115, ++ 32,100,101,116,101,99,116,101,100,44,10,32,32,32,32,32, ++ 32,32,32,97,32,95,68,101,97,100,108,111,99,107,69,114, ++ 114,111,114,32,105,115,32,114,97,105,115,101,100,46,10,32, ++ 32,32,32,32,32,32,32,79,116,104,101,114,119,105,115,101, ++ 44,32,116,104,101,32,108,111,99,107,32,105,115,32,97,108, ++ 119,97,121,115,32,97,99,113,117,105,114,101,100,32,97,110, ++ 100,32,84,114,117,101,32,105,115,32,114,101,116,117,114,110, ++ 101,100,46,10,32,32,32,32,32,32,32,32,114,84,0,0, ++ 0,114,29,0,0,0,84,122,23,100,101,97,100,108,111,99, ++ 107,32,100,101,116,101,99,116,101,100,32,98,121,32,37,114, ++ 70,78,41,12,114,85,0,0,0,114,91,0,0,0,114,92, ++ 0,0,0,114,86,0,0,0,114,89,0,0,0,114,88,0, ++ 0,0,114,96,0,0,0,114,82,0,0,0,114,87,0,0, ++ 0,218,7,97,99,113,117,105,114,101,114,90,0,0,0,218, ++ 7,114,101,108,101,97,115,101,41,2,114,71,0,0,0,114, ++ 95,0,0,0,114,4,0,0,0,114,4,0,0,0,114,5, ++ 0,0,0,114,97,0,0,0,192,0,0,0,115,32,0,0, ++ 0,0,6,12,1,10,1,3,1,3,1,10,1,30,1,9, ++ 1,15,1,4,1,12,1,19,1,18,1,24,2,13,1,20, ++ 2,122,19,95,77,111,100,117,108,101,76,111,99,107,46,97, ++ 99,113,117,105,114,101,99,1,0,0,0,0,0,0,0,2, ++ 0,0,0,10,0,0,0,67,0,0,0,115,165,0,0,0, ++ 116,0,0,106,1,0,131,0,0,125,1,0,124,0,0,106, ++ 2,0,143,138,0,1,124,0,0,106,3,0,124,1,0,107, ++ 3,0,114,52,0,116,4,0,100,1,0,131,1,0,130,1, ++ 0,110,0,0,124,0,0,106,5,0,100,2,0,107,4,0, ++ 115,73,0,116,6,0,130,1,0,124,0,0,4,106,5,0, ++ 100,3,0,56,2,95,5,0,124,0,0,106,5,0,100,2, ++ 0,107,2,0,114,155,0,100,0,0,124,0,0,95,3,0, ++ 124,0,0,106,7,0,114,155,0,124,0,0,4,106,7,0, ++ 100,3,0,56,2,95,7,0,124,0,0,106,8,0,106,9, ++ 0,131,0,0,1,113,155,0,110,0,0,87,100,0,0,81, ++ 88,100,0,0,83,41,4,78,122,31,99,97,110,110,111,116, ++ 32,114,101,108,101,97,115,101,32,117,110,45,97,99,113,117, ++ 105,114,101,100,32,108,111,99,107,114,84,0,0,0,114,29, ++ 0,0,0,41,10,114,85,0,0,0,114,91,0,0,0,114, ++ 86,0,0,0,114,88,0,0,0,218,12,82,117,110,116,105, ++ 109,101,69,114,114,111,114,114,89,0,0,0,218,14,65,115, ++ 115,101,114,116,105,111,110,69,114,114,111,114,114,90,0,0, ++ 0,114,87,0,0,0,114,98,0,0,0,41,2,114,71,0, ++ 0,0,114,95,0,0,0,114,4,0,0,0,114,4,0,0, ++ 0,114,5,0,0,0,114,98,0,0,0,217,0,0,0,115, ++ 22,0,0,0,0,1,12,1,10,1,15,1,15,1,21,1, ++ 15,1,15,1,9,1,9,1,15,1,122,19,95,77,111,100, ++ 117,108,101,76,111,99,107,46,114,101,108,101,97,115,101,99, ++ 1,0,0,0,0,0,0,0,1,0,0,0,4,0,0,0, ++ 67,0,0,0,115,25,0,0,0,100,1,0,106,0,0,124, ++ 0,0,106,1,0,116,2,0,124,0,0,131,1,0,131,2, ++ 0,83,41,2,78,122,23,95,77,111,100,117,108,101,76,111, ++ 99,107,40,123,33,114,125,41,32,97,116,32,123,125,41,3, ++ 114,47,0,0,0,114,67,0,0,0,114,48,0,0,0,41, ++ 1,114,71,0,0,0,114,4,0,0,0,114,4,0,0,0, ++ 114,5,0,0,0,218,8,95,95,114,101,112,114,95,95,230, ++ 0,0,0,115,2,0,0,0,0,1,122,20,95,77,111,100, ++ 117,108,101,76,111,99,107,46,95,95,114,101,112,114,95,95, ++ 78,41,9,114,57,0,0,0,114,56,0,0,0,114,58,0, ++ 0,0,114,59,0,0,0,114,72,0,0,0,114,96,0,0, ++ 0,114,97,0,0,0,114,98,0,0,0,114,101,0,0,0, ++ 114,4,0,0,0,114,4,0,0,0,114,4,0,0,0,114, ++ 5,0,0,0,114,83,0,0,0,166,0,0,0,115,12,0, ++ 0,0,12,4,6,2,12,8,12,12,12,25,12,13,114,83, ++ 0,0,0,99,0,0,0,0,0,0,0,0,0,0,0,0, ++ 2,0,0,0,64,0,0,0,115,70,0,0,0,101,0,0, ++ 90,1,0,100,0,0,90,2,0,100,1,0,90,3,0,100, ++ 2,0,100,3,0,132,0,0,90,4,0,100,4,0,100,5, ++ 0,132,0,0,90,5,0,100,6,0,100,7,0,132,0,0, ++ 90,6,0,100,8,0,100,9,0,132,0,0,90,7,0,100, ++ 10,0,83,41,11,218,16,95,68,117,109,109,121,77,111,100, ++ 117,108,101,76,111,99,107,122,86,65,32,115,105,109,112,108, ++ 101,32,95,77,111,100,117,108,101,76,111,99,107,32,101,113, ++ 117,105,118,97,108,101,110,116,32,102,111,114,32,80,121,116, ++ 104,111,110,32,98,117,105,108,100,115,32,119,105,116,104,111, ++ 117,116,10,32,32,32,32,109,117,108,116,105,45,116,104,114, ++ 101,97,100,105,110,103,32,115,117,112,112,111,114,116,46,99, ++ 2,0,0,0,0,0,0,0,2,0,0,0,2,0,0,0, ++ 67,0,0,0,115,22,0,0,0,124,1,0,124,0,0,95, ++ 0,0,100,1,0,124,0,0,95,1,0,100,0,0,83,41, ++ 2,78,114,84,0,0,0,41,2,114,67,0,0,0,114,89, ++ 0,0,0,41,2,114,71,0,0,0,114,67,0,0,0,114, ++ 4,0,0,0,114,4,0,0,0,114,5,0,0,0,114,72, ++ 0,0,0,238,0,0,0,115,4,0,0,0,0,1,9,1, ++ 122,25,95,68,117,109,109,121,77,111,100,117,108,101,76,111, ++ 99,107,46,95,95,105,110,105,116,95,95,99,1,0,0,0, ++ 0,0,0,0,1,0,0,0,3,0,0,0,67,0,0,0, ++ 115,19,0,0,0,124,0,0,4,106,0,0,100,1,0,55, ++ 2,95,0,0,100,2,0,83,41,3,78,114,29,0,0,0, ++ 84,41,1,114,89,0,0,0,41,1,114,71,0,0,0,114, ++ 4,0,0,0,114,4,0,0,0,114,5,0,0,0,114,97, ++ 0,0,0,242,0,0,0,115,4,0,0,0,0,1,15,1, ++ 122,24,95,68,117,109,109,121,77,111,100,117,108,101,76,111, ++ 99,107,46,97,99,113,117,105,114,101,99,1,0,0,0,0, ++ 0,0,0,1,0,0,0,3,0,0,0,67,0,0,0,115, ++ 49,0,0,0,124,0,0,106,0,0,100,1,0,107,2,0, ++ 114,30,0,116,1,0,100,2,0,131,1,0,130,1,0,110, ++ 0,0,124,0,0,4,106,0,0,100,3,0,56,2,95,0, ++ 0,100,0,0,83,41,4,78,114,84,0,0,0,122,31,99, ++ 97,110,110,111,116,32,114,101,108,101,97,115,101,32,117,110, ++ 45,97,99,113,117,105,114,101,100,32,108,111,99,107,114,29, ++ 0,0,0,41,2,114,89,0,0,0,114,99,0,0,0,41, ++ 1,114,71,0,0,0,114,4,0,0,0,114,4,0,0,0, ++ 114,5,0,0,0,114,98,0,0,0,246,0,0,0,115,6, ++ 0,0,0,0,1,15,1,15,1,122,24,95,68,117,109,109, ++ 121,77,111,100,117,108,101,76,111,99,107,46,114,101,108,101, ++ 97,115,101,99,1,0,0,0,0,0,0,0,1,0,0,0, ++ 4,0,0,0,67,0,0,0,115,25,0,0,0,100,1,0, ++ 106,0,0,124,0,0,106,1,0,116,2,0,124,0,0,131, ++ 1,0,131,2,0,83,41,2,78,122,28,95,68,117,109,109, ++ 121,77,111,100,117,108,101,76,111,99,107,40,123,33,114,125, ++ 41,32,97,116,32,123,125,41,3,114,47,0,0,0,114,67, ++ 0,0,0,114,48,0,0,0,41,1,114,71,0,0,0,114, ++ 4,0,0,0,114,4,0,0,0,114,5,0,0,0,114,101, ++ 0,0,0,251,0,0,0,115,2,0,0,0,0,1,122,25, ++ 95,68,117,109,109,121,77,111,100,117,108,101,76,111,99,107, ++ 46,95,95,114,101,112,114,95,95,78,41,8,114,57,0,0, ++ 0,114,56,0,0,0,114,58,0,0,0,114,59,0,0,0, ++ 114,72,0,0,0,114,97,0,0,0,114,98,0,0,0,114, ++ 101,0,0,0,114,4,0,0,0,114,4,0,0,0,114,4, ++ 0,0,0,114,5,0,0,0,114,102,0,0,0,234,0,0, ++ 0,115,10,0,0,0,12,2,6,2,12,4,12,4,12,5, ++ 114,102,0,0,0,99,0,0,0,0,0,0,0,0,0,0, ++ 0,0,2,0,0,0,64,0,0,0,115,52,0,0,0,101, ++ 0,0,90,1,0,100,0,0,90,2,0,100,1,0,100,2, ++ 0,132,0,0,90,3,0,100,3,0,100,4,0,132,0,0, ++ 90,4,0,100,5,0,100,6,0,132,0,0,90,5,0,100, ++ 7,0,83,41,8,218,18,95,77,111,100,117,108,101,76,111, ++ 99,107,77,97,110,97,103,101,114,99,2,0,0,0,0,0, ++ 0,0,2,0,0,0,2,0,0,0,67,0,0,0,115,22, ++ 0,0,0,124,1,0,124,0,0,95,0,0,100,0,0,124, ++ 0,0,95,1,0,100,0,0,83,41,1,78,41,2,114,70, ++ 0,0,0,218,5,95,108,111,99,107,41,2,114,71,0,0, ++ 0,114,67,0,0,0,114,4,0,0,0,114,4,0,0,0, ++ 114,5,0,0,0,114,72,0,0,0,1,1,0,0,115,4, ++ 0,0,0,0,1,9,1,122,27,95,77,111,100,117,108,101, ++ 76,111,99,107,77,97,110,97,103,101,114,46,95,95,105,110, ++ 105,116,95,95,99,1,0,0,0,0,0,0,0,1,0,0, ++ 0,10,0,0,0,67,0,0,0,115,53,0,0,0,122,22, ++ 0,116,0,0,124,0,0,106,1,0,131,1,0,124,0,0, ++ 95,2,0,87,100,0,0,116,3,0,106,4,0,131,0,0, ++ 1,88,124,0,0,106,2,0,106,5,0,131,0,0,1,100, ++ 0,0,83,41,1,78,41,6,218,16,95,103,101,116,95,109, ++ 111,100,117,108,101,95,108,111,99,107,114,70,0,0,0,114, ++ 104,0,0,0,218,4,95,105,109,112,218,12,114,101,108,101, ++ 97,115,101,95,108,111,99,107,114,97,0,0,0,41,1,114, ++ 71,0,0,0,114,4,0,0,0,114,4,0,0,0,114,5, ++ 0,0,0,114,75,0,0,0,5,1,0,0,115,8,0,0, ++ 0,0,1,3,1,22,2,11,1,122,28,95,77,111,100,117, ++ 108,101,76,111,99,107,77,97,110,97,103,101,114,46,95,95, ++ 101,110,116,101,114,95,95,99,1,0,0,0,0,0,0,0, ++ 3,0,0,0,1,0,0,0,79,0,0,0,115,17,0,0, ++ 0,124,0,0,106,0,0,106,1,0,131,0,0,1,100,0, ++ 0,83,41,1,78,41,2,114,104,0,0,0,114,98,0,0, ++ 0,41,3,114,71,0,0,0,114,80,0,0,0,218,6,107, ++ 119,97,114,103,115,114,4,0,0,0,114,4,0,0,0,114, ++ 5,0,0,0,114,81,0,0,0,12,1,0,0,115,2,0, ++ 0,0,0,1,122,27,95,77,111,100,117,108,101,76,111,99, ++ 107,77,97,110,97,103,101,114,46,95,95,101,120,105,116,95, ++ 95,78,41,6,114,57,0,0,0,114,56,0,0,0,114,58, ++ 0,0,0,114,72,0,0,0,114,75,0,0,0,114,81,0, ++ 0,0,114,4,0,0,0,114,4,0,0,0,114,4,0,0, ++ 0,114,5,0,0,0,114,103,0,0,0,255,0,0,0,115, ++ 6,0,0,0,12,2,12,4,12,7,114,103,0,0,0,99, ++ 1,0,0,0,0,0,0,0,3,0,0,0,11,0,0,0, ++ 3,0,0,0,115,142,0,0,0,100,1,0,125,1,0,121, ++ 17,0,116,0,0,136,0,0,25,131,0,0,125,1,0,87, ++ 110,18,0,4,116,1,0,107,10,0,114,43,0,1,1,1, ++ 89,110,1,0,88,124,1,0,100,1,0,107,8,0,114,138, ++ 0,116,2,0,100,1,0,107,8,0,114,83,0,116,3,0, ++ 136,0,0,131,1,0,125,1,0,110,12,0,116,4,0,136, ++ 0,0,131,1,0,125,1,0,135,0,0,102,1,0,100,2, ++ 0,100,3,0,134,0,0,125,2,0,116,5,0,106,6,0, ++ 124,1,0,124,2,0,131,2,0,116,0,0,136,0,0,60, ++ 110,0,0,124,1,0,83,41,4,122,109,71,101,116,32,111, ++ 114,32,99,114,101,97,116,101,32,116,104,101,32,109,111,100, ++ 117,108,101,32,108,111,99,107,32,102,111,114,32,97,32,103, ++ 105,118,101,110,32,109,111,100,117,108,101,32,110,97,109,101, ++ 46,10,10,32,32,32,32,83,104,111,117,108,100,32,111,110, ++ 108,121,32,98,101,32,99,97,108,108,101,100,32,119,105,116, ++ 104,32,116,104,101,32,105,109,112,111,114,116,32,108,111,99, ++ 107,32,116,97,107,101,110,46,78,99,1,0,0,0,0,0, ++ 0,0,1,0,0,0,2,0,0,0,19,0,0,0,115,11, ++ 0,0,0,116,0,0,136,0,0,61,100,0,0,83,41,1, ++ 78,41,1,218,13,95,109,111,100,117,108,101,95,108,111,99, ++ 107,115,41,1,114,36,0,0,0,41,1,114,67,0,0,0, ++ 114,4,0,0,0,114,5,0,0,0,218,2,99,98,32,1, ++ 0,0,115,2,0,0,0,0,1,122,28,95,103,101,116,95, ++ 109,111,100,117,108,101,95,108,111,99,107,46,60,108,111,99, ++ 97,108,115,62,46,99,98,41,7,114,109,0,0,0,114,79, ++ 0,0,0,114,85,0,0,0,114,102,0,0,0,114,83,0, ++ 0,0,218,8,95,119,101,97,107,114,101,102,90,3,114,101, ++ 102,41,3,114,67,0,0,0,114,86,0,0,0,114,110,0, ++ 0,0,114,4,0,0,0,41,1,114,67,0,0,0,114,5, ++ 0,0,0,114,105,0,0,0,18,1,0,0,115,24,0,0, ++ 0,0,4,6,1,3,1,17,1,13,1,5,1,12,1,12, ++ 1,15,2,12,1,18,2,25,1,114,105,0,0,0,99,1, ++ 0,0,0,0,0,0,0,2,0,0,0,11,0,0,0,67, ++ 0,0,0,115,71,0,0,0,116,0,0,124,0,0,131,1, ++ 0,125,1,0,116,1,0,106,2,0,131,0,0,1,121,14, ++ 0,124,1,0,106,3,0,131,0,0,1,87,110,18,0,4, ++ 116,4,0,107,10,0,114,56,0,1,1,1,89,110,11,0, ++ 88,124,1,0,106,5,0,131,0,0,1,100,1,0,83,41, ++ 2,97,21,1,0,0,82,101,108,101,97,115,101,32,116,104, ++ 101,32,103,108,111,98,97,108,32,105,109,112,111,114,116,32, ++ 108,111,99,107,44,32,97,110,100,32,97,99,113,117,105,114, ++ 101,115,32,116,104,101,110,32,114,101,108,101,97,115,101,32, ++ 116,104,101,10,32,32,32,32,109,111,100,117,108,101,32,108, ++ 111,99,107,32,102,111,114,32,97,32,103,105,118,101,110,32, ++ 109,111,100,117,108,101,32,110,97,109,101,46,10,32,32,32, ++ 32,84,104,105,115,32,105,115,32,117,115,101,100,32,116,111, ++ 32,101,110,115,117,114,101,32,97,32,109,111,100,117,108,101, ++ 32,105,115,32,99,111,109,112,108,101,116,101,108,121,32,105, ++ 110,105,116,105,97,108,105,122,101,100,44,32,105,110,32,116, ++ 104,101,10,32,32,32,32,101,118,101,110,116,32,105,116,32, ++ 105,115,32,98,101,105,110,103,32,105,109,112,111,114,116,101, ++ 100,32,98,121,32,97,110,111,116,104,101,114,32,116,104,114, ++ 101,97,100,46,10,10,32,32,32,32,83,104,111,117,108,100, ++ 32,111,110,108,121,32,98,101,32,99,97,108,108,101,100,32, ++ 119,105,116,104,32,116,104,101,32,105,109,112,111,114,116,32, ++ 108,111,99,107,32,116,97,107,101,110,46,78,41,6,114,105, ++ 0,0,0,114,106,0,0,0,114,107,0,0,0,114,97,0, ++ 0,0,114,82,0,0,0,114,98,0,0,0,41,2,114,67, ++ 0,0,0,114,86,0,0,0,114,4,0,0,0,114,4,0, ++ 0,0,114,5,0,0,0,218,19,95,108,111,99,107,95,117, ++ 110,108,111,99,107,95,109,111,100,117,108,101,37,1,0,0, ++ 115,14,0,0,0,0,7,12,1,10,1,3,1,14,1,13, ++ 3,5,2,114,112,0,0,0,99,1,0,0,0,0,0,0, ++ 0,3,0,0,0,3,0,0,0,79,0,0,0,115,13,0, ++ 0,0,124,0,0,124,1,0,124,2,0,142,0,0,83,41, ++ 1,97,46,1,0,0,114,101,109,111,118,101,95,105,109,112, ++ 111,114,116,108,105,98,95,102,114,97,109,101,115,32,105,110, ++ 32,105,109,112,111,114,116,46,99,32,119,105,108,108,32,97, ++ 108,119,97,121,115,32,114,101,109,111,118,101,32,115,101,113, ++ 117,101,110,99,101,115,10,32,32,32,32,111,102,32,105,109, ++ 112,111,114,116,108,105,98,32,102,114,97,109,101,115,32,116, ++ 104,97,116,32,101,110,100,32,119,105,116,104,32,97,32,99, ++ 97,108,108,32,116,111,32,116,104,105,115,32,102,117,110,99, ++ 116,105,111,110,10,10,32,32,32,32,85,115,101,32,105,116, ++ 32,105,110,115,116,101,97,100,32,111,102,32,97,32,110,111, ++ 114,109,97,108,32,99,97,108,108,32,105,110,32,112,108,97, ++ 99,101,115,32,119,104,101,114,101,32,105,110,99,108,117,100, ++ 105,110,103,32,116,104,101,32,105,109,112,111,114,116,108,105, ++ 98,10,32,32,32,32,102,114,97,109,101,115,32,105,110,116, ++ 114,111,100,117,99,101,115,32,117,110,119,97,110,116,101,100, ++ 32,110,111,105,115,101,32,105,110,116,111,32,116,104,101,32, ++ 116,114,97,99,101,98,97,99,107,32,40,101,46,103,46,32, ++ 119,104,101,110,32,101,120,101,99,117,116,105,110,103,10,32, ++ 32,32,32,109,111,100,117,108,101,32,99,111,100,101,41,10, ++ 32,32,32,32,114,4,0,0,0,41,3,218,1,102,114,80, ++ 0,0,0,90,4,107,119,100,115,114,4,0,0,0,114,4, ++ 0,0,0,114,5,0,0,0,218,25,95,99,97,108,108,95, ++ 119,105,116,104,95,102,114,97,109,101,115,95,114,101,109,111, ++ 118,101,100,57,1,0,0,115,2,0,0,0,0,8,114,114, ++ 0,0,0,105,228,12,0,0,233,2,0,0,0,114,13,0, ++ 0,0,115,2,0,0,0,13,10,90,11,95,95,112,121,99, ++ 97,99,104,101,95,95,122,3,46,112,121,122,4,46,112,121, ++ 99,122,4,46,112,121,111,78,99,2,0,0,0,0,0,0, ++ 0,11,0,0,0,6,0,0,0,67,0,0,0,115,180,0, ++ 0,0,124,1,0,100,1,0,107,8,0,114,25,0,116,0, ++ 0,106,1,0,106,2,0,12,110,3,0,124,1,0,125,2, ++ 0,124,2,0,114,46,0,116,3,0,125,3,0,110,6,0, ++ 116,4,0,125,3,0,116,5,0,124,0,0,131,1,0,92, ++ 2,0,125,4,0,125,5,0,124,5,0,106,6,0,100,2, ++ 0,131,1,0,92,3,0,125,6,0,125,7,0,125,8,0, ++ 116,0,0,106,7,0,106,8,0,125,9,0,124,9,0,100, ++ 1,0,107,8,0,114,133,0,116,9,0,100,3,0,131,1, ++ 0,130,1,0,110,0,0,100,4,0,106,10,0,124,6,0, ++ 124,7,0,124,9,0,124,3,0,100,5,0,25,103,4,0, ++ 131,1,0,125,10,0,116,11,0,124,4,0,116,12,0,124, ++ 10,0,131,3,0,83,41,6,97,244,1,0,0,71,105,118, ++ 101,110,32,116,104,101,32,112,97,116,104,32,116,111,32,97, ++ 32,46,112,121,32,102,105,108,101,44,32,114,101,116,117,114, ++ 110,32,116,104,101,32,112,97,116,104,32,116,111,32,105,116, ++ 115,32,46,112,121,99,47,46,112,121,111,32,102,105,108,101, ++ 46,10,10,32,32,32,32,84,104,101,32,46,112,121,32,102, ++ 105,108,101,32,100,111,101,115,32,110,111,116,32,110,101,101, ++ 100,32,116,111,32,101,120,105,115,116,59,32,116,104,105,115, ++ 32,115,105,109,112,108,121,32,114,101,116,117,114,110,115,32, ++ 116,104,101,32,112,97,116,104,32,116,111,32,116,104,101,10, ++ 32,32,32,32,46,112,121,99,47,46,112,121,111,32,102,105, ++ 108,101,32,99,97,108,99,117,108,97,116,101,100,32,97,115, ++ 32,105,102,32,116,104,101,32,46,112,121,32,102,105,108,101, ++ 32,119,101,114,101,32,105,109,112,111,114,116,101,100,46,32, ++ 32,84,104,101,32,101,120,116,101,110,115,105,111,110,10,32, ++ 32,32,32,119,105,108,108,32,98,101,32,46,112,121,99,32, ++ 117,110,108,101,115,115,32,115,121,115,46,102,108,97,103,115, ++ 46,111,112,116,105,109,105,122,101,32,105,115,32,110,111,110, ++ 45,122,101,114,111,44,32,116,104,101,110,32,105,116,32,119, ++ 105,108,108,32,98,101,32,46,112,121,111,46,10,10,32,32, ++ 32,32,73,102,32,100,101,98,117,103,95,111,118,101,114,114, ++ 105,100,101,32,105,115,32,110,111,116,32,78,111,110,101,44, ++ 32,116,104,101,110,32,105,116,32,109,117,115,116,32,98,101, ++ 32,97,32,98,111,111,108,101,97,110,32,97,110,100,32,105, ++ 115,32,117,115,101,100,32,105,110,10,32,32,32,32,112,108, ++ 97,99,101,32,111,102,32,115,121,115,46,102,108,97,103,115, ++ 46,111,112,116,105,109,105,122,101,46,10,10,32,32,32,32, ++ 73,102,32,115,121,115,46,105,109,112,108,101,109,101,110,116, ++ 97,116,105,111,110,46,99,97,99,104,101,95,116,97,103,32, ++ 105,115,32,78,111,110,101,32,116,104,101,110,32,78,111,116, ++ 73,109,112,108,101,109,101,110,116,101,100,69,114,114,111,114, ++ 32,105,115,32,114,97,105,115,101,100,46,10,10,32,32,32, ++ 32,78,218,1,46,122,36,115,121,115,46,105,109,112,108,101, ++ 109,101,110,116,97,116,105,111,110,46,99,97,99,104,101,95, ++ 116,97,103,32,105,115,32,78,111,110,101,114,30,0,0,0, ++ 114,84,0,0,0,41,13,114,7,0,0,0,218,5,102,108, ++ 97,103,115,218,8,111,112,116,105,109,105,122,101,218,23,68, ++ 69,66,85,71,95,66,89,84,69,67,79,68,69,95,83,85, ++ 70,70,73,88,69,83,218,27,79,80,84,73,77,73,90,69, ++ 68,95,66,89,84,69,67,79,68,69,95,83,85,70,70,73, ++ 88,69,83,114,38,0,0,0,218,9,112,97,114,116,105,116, ++ 105,111,110,218,14,105,109,112,108,101,109,101,110,116,97,116, ++ 105,111,110,218,9,99,97,99,104,101,95,116,97,103,218,19, ++ 78,111,116,73,109,112,108,101,109,101,110,116,101,100,69,114, ++ 114,111,114,114,26,0,0,0,114,28,0,0,0,218,8,95, ++ 80,89,67,65,67,72,69,41,11,114,35,0,0,0,90,14, ++ 100,101,98,117,103,95,111,118,101,114,114,105,100,101,218,5, ++ 100,101,98,117,103,218,8,115,117,102,102,105,120,101,115,218, ++ 4,104,101,97,100,114,37,0,0,0,218,13,98,97,115,101, ++ 95,102,105,108,101,110,97,109,101,218,3,115,101,112,114,36, ++ 0,0,0,90,3,116,97,103,218,8,102,105,108,101,110,97, ++ 109,101,114,4,0,0,0,114,4,0,0,0,114,5,0,0, ++ 0,218,17,99,97,99,104,101,95,102,114,111,109,95,115,111, ++ 117,114,99,101,180,1,0,0,115,22,0,0,0,0,13,31, ++ 1,6,1,9,2,6,1,18,1,24,1,12,1,12,1,15, ++ 1,31,1,114,132,0,0,0,99,1,0,0,0,0,0,0, ++ 0,5,0,0,0,5,0,0,0,67,0,0,0,115,193,0, ++ 0,0,116,0,0,106,1,0,106,2,0,100,1,0,107,8, ++ 0,114,33,0,116,3,0,100,2,0,131,1,0,130,1,0, ++ 110,0,0,116,4,0,124,0,0,131,1,0,92,2,0,125, ++ 1,0,125,2,0,116,4,0,124,1,0,131,1,0,92,2, ++ 0,125,1,0,125,3,0,124,3,0,116,5,0,107,3,0, ++ 114,108,0,116,6,0,100,3,0,106,7,0,116,5,0,124, ++ 0,0,131,2,0,131,1,0,130,1,0,110,0,0,124,2, ++ 0,106,8,0,100,4,0,131,1,0,100,5,0,107,3,0, ++ 114,153,0,116,6,0,100,6,0,106,7,0,124,2,0,131, ++ 1,0,131,1,0,130,1,0,110,0,0,124,2,0,106,9, ++ 0,100,4,0,131,1,0,100,7,0,25,125,4,0,116,10, ++ 0,124,1,0,124,4,0,116,11,0,100,7,0,25,23,131, ++ 2,0,83,41,8,97,121,1,0,0,71,105,118,101,110,32, ++ 116,104,101,32,112,97,116,104,32,116,111,32,97,32,46,112, ++ 121,99,46,47,46,112,121,111,32,102,105,108,101,44,32,114, ++ 101,116,117,114,110,32,116,104,101,32,112,97,116,104,32,116, ++ 111,32,105,116,115,32,46,112,121,32,102,105,108,101,46,10, ++ 10,32,32,32,32,84,104,101,32,46,112,121,99,47,46,112, ++ 121,111,32,102,105,108,101,32,100,111,101,115,32,110,111,116, ++ 32,110,101,101,100,32,116,111,32,101,120,105,115,116,59,32, ++ 116,104,105,115,32,115,105,109,112,108,121,32,114,101,116,117, ++ 114,110,115,32,116,104,101,32,112,97,116,104,32,116,111,10, ++ 32,32,32,32,116,104,101,32,46,112,121,32,102,105,108,101, ++ 32,99,97,108,99,117,108,97,116,101,100,32,116,111,32,99, ++ 111,114,114,101,115,112,111,110,100,32,116,111,32,116,104,101, ++ 32,46,112,121,99,47,46,112,121,111,32,102,105,108,101,46, ++ 32,32,73,102,32,112,97,116,104,32,100,111,101,115,10,32, ++ 32,32,32,110,111,116,32,99,111,110,102,111,114,109,32,116, ++ 111,32,80,69,80,32,51,49,52,55,32,102,111,114,109,97, ++ 116,44,32,86,97,108,117,101,69,114,114,111,114,32,119,105, ++ 108,108,32,98,101,32,114,97,105,115,101,100,46,32,73,102, ++ 10,32,32,32,32,115,121,115,46,105,109,112,108,101,109,101, ++ 110,116,97,116,105,111,110,46,99,97,99,104,101,95,116,97, ++ 103,32,105,115,32,78,111,110,101,32,116,104,101,110,32,78, ++ 111,116,73,109,112,108,101,109,101,110,116,101,100,69,114,114, ++ 111,114,32,105,115,32,114,97,105,115,101,100,46,10,10,32, ++ 32,32,32,78,122,36,115,121,115,46,105,109,112,108,101,109, ++ 101,110,116,97,116,105,111,110,46,99,97,99,104,101,95,116, ++ 97,103,32,105,115,32,78,111,110,101,122,37,123,125,32,110, ++ 111,116,32,98,111,116,116,111,109,45,108,101,118,101,108,32, ++ 100,105,114,101,99,116,111,114,121,32,105,110,32,123,33,114, ++ 125,114,116,0,0,0,114,115,0,0,0,122,28,101,120,112, ++ 101,99,116,101,100,32,111,110,108,121,32,50,32,100,111,116, ++ 115,32,105,110,32,123,33,114,125,114,84,0,0,0,41,12, ++ 114,7,0,0,0,114,122,0,0,0,114,123,0,0,0,114, ++ 124,0,0,0,114,38,0,0,0,114,125,0,0,0,218,10, ++ 86,97,108,117,101,69,114,114,111,114,114,47,0,0,0,114, ++ 89,0,0,0,114,121,0,0,0,114,28,0,0,0,218,15, ++ 83,79,85,82,67,69,95,83,85,70,70,73,88,69,83,41, ++ 5,114,35,0,0,0,114,128,0,0,0,90,16,112,121,99, ++ 97,99,104,101,95,102,105,108,101,110,97,109,101,90,7,112, ++ 121,99,97,99,104,101,114,129,0,0,0,114,4,0,0,0, ++ 114,4,0,0,0,114,5,0,0,0,218,17,115,111,117,114, ++ 99,101,95,102,114,111,109,95,99,97,99,104,101,207,1,0, ++ 0,115,24,0,0,0,0,9,18,1,15,1,18,1,18,1, ++ 12,1,3,1,24,1,21,1,3,1,21,1,19,1,114,135, ++ 0,0,0,99,1,0,0,0,0,0,0,0,5,0,0,0, ++ 13,0,0,0,67,0,0,0,115,164,0,0,0,116,0,0, ++ 124,0,0,131,1,0,100,1,0,107,2,0,114,22,0,100, ++ 2,0,83,124,0,0,106,1,0,100,3,0,131,1,0,92, ++ 3,0,125,1,0,125,2,0,125,3,0,124,1,0,12,115, ++ 81,0,124,3,0,106,2,0,131,0,0,100,7,0,100,8, ++ 0,133,2,0,25,100,6,0,107,3,0,114,85,0,124,0, ++ 0,83,121,16,0,116,3,0,124,0,0,131,1,0,125,4, ++ 0,87,110,40,0,4,116,4,0,116,5,0,102,2,0,107, ++ 10,0,114,143,0,1,1,1,124,0,0,100,2,0,100,9, ++ 0,133,2,0,25,125,4,0,89,110,1,0,88,116,6,0, ++ 124,4,0,131,1,0,114,160,0,124,4,0,83,124,0,0, ++ 83,41,10,122,188,67,111,110,118,101,114,116,32,97,32,98, ++ 121,116,101,99,111,100,101,32,102,105,108,101,32,112,97,116, ++ 104,32,116,111,32,97,32,115,111,117,114,99,101,32,112,97, ++ 116,104,32,40,105,102,32,112,111,115,115,105,98,108,101,41, ++ 46,10,10,32,32,32,32,84,104,105,115,32,102,117,110,99, ++ 116,105,111,110,32,101,120,105,115,116,115,32,112,117,114,101, ++ 108,121,32,102,111,114,32,98,97,99,107,119,97,114,100,115, ++ 45,99,111,109,112,97,116,105,98,105,108,105,116,121,32,102, ++ 111,114,10,32,32,32,32,80,121,73,109,112,111,114,116,95, ++ 69,120,101,99,67,111,100,101,77,111,100,117,108,101,87,105, ++ 116,104,70,105,108,101,110,97,109,101,115,40,41,32,105,110, ++ 32,116,104,101,32,67,32,65,80,73,46,10,10,32,32,32, ++ 32,114,84,0,0,0,78,114,116,0,0,0,233,3,0,0, ++ 0,114,29,0,0,0,90,2,112,121,233,253,255,255,255,233, ++ 255,255,255,255,114,138,0,0,0,41,7,114,31,0,0,0, ++ 114,32,0,0,0,218,5,108,111,119,101,114,114,135,0,0, ++ 0,114,124,0,0,0,114,133,0,0,0,114,44,0,0,0, ++ 41,5,218,13,98,121,116,101,99,111,100,101,95,112,97,116, ++ 104,90,4,114,101,115,116,114,36,0,0,0,90,9,101,120, ++ 116,101,110,115,105,111,110,218,11,115,111,117,114,99,101,95, ++ 112,97,116,104,114,4,0,0,0,114,4,0,0,0,114,5, ++ 0,0,0,218,15,95,103,101,116,95,115,111,117,114,99,101, ++ 102,105,108,101,230,1,0,0,115,20,0,0,0,0,7,18, ++ 1,4,1,24,1,35,1,4,1,3,1,16,1,19,1,21, ++ 1,114,142,0,0,0,99,1,0,0,0,0,0,0,0,2, ++ 0,0,0,11,0,0,0,67,0,0,0,115,60,0,0,0, ++ 121,19,0,116,0,0,124,0,0,131,1,0,106,1,0,125, ++ 1,0,87,110,24,0,4,116,2,0,107,10,0,114,45,0, ++ 1,1,1,100,1,0,125,1,0,89,110,1,0,88,124,1, ++ 0,100,2,0,79,125,1,0,124,1,0,83,41,3,122,51, ++ 67,97,108,99,117,108,97,116,101,32,116,104,101,32,109,111, ++ 100,101,32,112,101,114,109,105,115,115,105,111,110,115,32,102, ++ 111,114,32,97,32,98,121,116,101,99,111,100,101,32,102,105, ++ 108,101,46,105,182,1,0,0,233,128,0,0,0,41,3,114, ++ 39,0,0,0,114,41,0,0,0,114,40,0,0,0,41,2, ++ 114,35,0,0,0,114,42,0,0,0,114,4,0,0,0,114, ++ 4,0,0,0,114,5,0,0,0,218,10,95,99,97,108,99, ++ 95,109,111,100,101,249,1,0,0,115,12,0,0,0,0,2, ++ 3,1,19,1,13,1,11,3,10,1,114,144,0,0,0,218, ++ 9,118,101,114,98,111,115,105,116,121,114,29,0,0,0,99, ++ 1,0,0,0,1,0,0,0,3,0,0,0,4,0,0,0, ++ 71,0,0,0,115,81,0,0,0,116,0,0,106,1,0,106, ++ 2,0,124,1,0,107,5,0,114,77,0,124,0,0,106,3, ++ 0,100,6,0,131,1,0,115,46,0,100,3,0,124,0,0, ++ 23,125,0,0,110,0,0,116,4,0,124,0,0,106,5,0, ++ 124,2,0,140,0,0,100,4,0,116,0,0,106,6,0,131, ++ 1,1,1,110,0,0,100,5,0,83,41,7,122,61,80,114, ++ 105,110,116,32,116,104,101,32,109,101,115,115,97,103,101,32, ++ 116,111,32,115,116,100,101,114,114,32,105,102,32,45,118,47, ++ 80,89,84,72,79,78,86,69,82,66,79,83,69,32,105,115, ++ 32,116,117,114,110,101,100,32,111,110,46,250,1,35,250,7, ++ 105,109,112,111,114,116,32,122,2,35,32,114,54,0,0,0, ++ 78,41,2,114,146,0,0,0,114,147,0,0,0,41,7,114, ++ 7,0,0,0,114,117,0,0,0,218,7,118,101,114,98,111, ++ 115,101,114,9,0,0,0,218,5,112,114,105,110,116,114,47, ++ 0,0,0,218,6,115,116,100,101,114,114,41,3,218,7,109, ++ 101,115,115,97,103,101,114,145,0,0,0,114,80,0,0,0, ++ 114,4,0,0,0,114,4,0,0,0,114,5,0,0,0,218, ++ 16,95,118,101,114,98,111,115,101,95,109,101,115,115,97,103, ++ 101,5,2,0,0,115,8,0,0,0,0,2,18,1,15,1, ++ 13,1,114,152,0,0,0,99,1,0,0,0,0,0,0,0, ++ 2,0,0,0,4,0,0,0,3,0,0,0,115,38,0,0, ++ 0,100,1,0,135,0,0,102,1,0,100,2,0,100,3,0, ++ 134,1,0,125,1,0,116,0,0,124,1,0,136,0,0,131, ++ 2,0,1,124,1,0,83,41,4,122,252,68,101,99,111,114, ++ 97,116,111,114,32,116,111,32,118,101,114,105,102,121,32,116, ++ 104,97,116,32,116,104,101,32,109,111,100,117,108,101,32,98, ++ 101,105,110,103,32,114,101,113,117,101,115,116,101,100,32,109, ++ 97,116,99,104,101,115,32,116,104,101,32,111,110,101,32,116, ++ 104,101,10,32,32,32,32,108,111,97,100,101,114,32,99,97, ++ 110,32,104,97,110,100,108,101,46,10,10,32,32,32,32,84, ++ 104,101,32,102,105,114,115,116,32,97,114,103,117,109,101,110, ++ 116,32,40,115,101,108,102,41,32,109,117,115,116,32,100,101, ++ 102,105,110,101,32,95,110,97,109,101,32,119,104,105,99,104, ++ 32,116,104,101,32,115,101,99,111,110,100,32,97,114,103,117, ++ 109,101,110,116,32,105,115,10,32,32,32,32,99,111,109,112, ++ 97,114,101,100,32,97,103,97,105,110,115,116,46,32,73,102, ++ 32,116,104,101,32,99,111,109,112,97,114,105,115,111,110,32, ++ 102,97,105,108,115,32,116,104,101,110,32,73,109,112,111,114, ++ 116,69,114,114,111,114,32,105,115,32,114,97,105,115,101,100, ++ 46,10,10,32,32,32,32,78,99,2,0,0,0,0,0,0, ++ 0,4,0,0,0,5,0,0,0,31,0,0,0,115,83,0, ++ 0,0,124,1,0,100,0,0,107,8,0,114,24,0,124,0, ++ 0,106,0,0,125,1,0,110,40,0,124,0,0,106,0,0, ++ 124,1,0,107,3,0,114,64,0,116,1,0,100,1,0,124, ++ 1,0,22,100,2,0,124,1,0,131,1,1,130,1,0,110, ++ 0,0,136,0,0,124,0,0,124,1,0,124,2,0,124,3, ++ 0,142,2,0,83,41,3,78,122,23,108,111,97,100,101,114, ++ 32,99,97,110,110,111,116,32,104,97,110,100,108,101,32,37, ++ 115,114,67,0,0,0,41,2,114,67,0,0,0,218,11,73, ++ 109,112,111,114,116,69,114,114,111,114,41,4,114,71,0,0, ++ 0,114,67,0,0,0,114,80,0,0,0,114,108,0,0,0, ++ 41,1,218,6,109,101,116,104,111,100,114,4,0,0,0,114, ++ 5,0,0,0,218,19,95,99,104,101,99,107,95,110,97,109, ++ 101,95,119,114,97,112,112,101,114,21,2,0,0,115,10,0, ++ 0,0,0,1,12,1,12,1,15,1,25,1,122,40,95,99, ++ 104,101,99,107,95,110,97,109,101,46,60,108,111,99,97,108, ++ 115,62,46,95,99,104,101,99,107,95,110,97,109,101,95,119, ++ 114,97,112,112,101,114,41,1,114,65,0,0,0,41,2,114, ++ 154,0,0,0,114,155,0,0,0,114,4,0,0,0,41,1, ++ 114,154,0,0,0,114,5,0,0,0,218,11,95,99,104,101, ++ 99,107,95,110,97,109,101,13,2,0,0,115,6,0,0,0, ++ 0,8,21,6,13,1,114,156,0,0,0,99,1,0,0,0, ++ 0,0,0,0,2,0,0,0,3,0,0,0,3,0,0,0, ++ 115,35,0,0,0,135,0,0,102,1,0,100,1,0,100,2, ++ 0,134,0,0,125,1,0,116,0,0,124,1,0,136,0,0, ++ 131,2,0,1,124,1,0,83,41,3,122,49,68,101,99,111, ++ 114,97,116,111,114,32,116,111,32,118,101,114,105,102,121,32, ++ 116,104,101,32,110,97,109,101,100,32,109,111,100,117,108,101, ++ 32,105,115,32,98,117,105,108,116,45,105,110,46,99,2,0, ++ 0,0,0,0,0,0,2,0,0,0,4,0,0,0,19,0, ++ 0,0,115,58,0,0,0,124,1,0,116,0,0,106,1,0, ++ 107,7,0,114,45,0,116,2,0,100,1,0,106,3,0,124, ++ 1,0,131,1,0,100,2,0,124,1,0,131,1,1,130,1, ++ 0,110,0,0,136,0,0,124,0,0,124,1,0,131,2,0, ++ 83,41,3,78,122,29,123,33,114,125,32,105,115,32,110,111, ++ 116,32,97,32,98,117,105,108,116,45,105,110,32,109,111,100, ++ 117,108,101,114,67,0,0,0,41,4,114,7,0,0,0,218, ++ 20,98,117,105,108,116,105,110,95,109,111,100,117,108,101,95, ++ 110,97,109,101,115,114,153,0,0,0,114,47,0,0,0,41, ++ 2,114,71,0,0,0,218,8,102,117,108,108,110,97,109,101, ++ 41,1,218,3,102,120,110,114,4,0,0,0,114,5,0,0, ++ 0,218,25,95,114,101,113,117,105,114,101,115,95,98,117,105, ++ 108,116,105,110,95,119,114,97,112,112,101,114,33,2,0,0, ++ 115,8,0,0,0,0,1,15,1,18,1,12,1,122,52,95, ++ 114,101,113,117,105,114,101,115,95,98,117,105,108,116,105,110, ++ 46,60,108,111,99,97,108,115,62,46,95,114,101,113,117,105, ++ 114,101,115,95,98,117,105,108,116,105,110,95,119,114,97,112, ++ 112,101,114,41,1,114,65,0,0,0,41,2,114,159,0,0, ++ 0,114,160,0,0,0,114,4,0,0,0,41,1,114,159,0, ++ 0,0,114,5,0,0,0,218,17,95,114,101,113,117,105,114, ++ 101,115,95,98,117,105,108,116,105,110,31,2,0,0,115,6, ++ 0,0,0,0,2,18,5,13,1,114,161,0,0,0,99,1, ++ 0,0,0,0,0,0,0,2,0,0,0,3,0,0,0,3, ++ 0,0,0,115,35,0,0,0,135,0,0,102,1,0,100,1, ++ 0,100,2,0,134,0,0,125,1,0,116,0,0,124,1,0, ++ 136,0,0,131,2,0,1,124,1,0,83,41,3,122,47,68, ++ 101,99,111,114,97,116,111,114,32,116,111,32,118,101,114,105, ++ 102,121,32,116,104,101,32,110,97,109,101,100,32,109,111,100, ++ 117,108,101,32,105,115,32,102,114,111,122,101,110,46,99,2, ++ 0,0,0,0,0,0,0,2,0,0,0,4,0,0,0,19, ++ 0,0,0,115,58,0,0,0,116,0,0,106,1,0,124,1, ++ 0,131,1,0,115,45,0,116,2,0,100,1,0,106,3,0, ++ 124,1,0,131,1,0,100,2,0,124,1,0,131,1,1,130, ++ 1,0,110,0,0,136,0,0,124,0,0,124,1,0,131,2, ++ 0,83,41,3,78,122,27,123,33,114,125,32,105,115,32,110, ++ 111,116,32,97,32,102,114,111,122,101,110,32,109,111,100,117, ++ 108,101,114,67,0,0,0,41,4,114,106,0,0,0,218,9, ++ 105,115,95,102,114,111,122,101,110,114,153,0,0,0,114,47, ++ 0,0,0,41,2,114,71,0,0,0,114,158,0,0,0,41, ++ 1,114,159,0,0,0,114,4,0,0,0,114,5,0,0,0, ++ 218,24,95,114,101,113,117,105,114,101,115,95,102,114,111,122, ++ 101,110,95,119,114,97,112,112,101,114,44,2,0,0,115,8, ++ 0,0,0,0,1,15,1,18,1,12,1,122,50,95,114,101, ++ 113,117,105,114,101,115,95,102,114,111,122,101,110,46,60,108, ++ 111,99,97,108,115,62,46,95,114,101,113,117,105,114,101,115, ++ 95,102,114,111,122,101,110,95,119,114,97,112,112,101,114,41, ++ 1,114,65,0,0,0,41,2,114,159,0,0,0,114,163,0, ++ 0,0,114,4,0,0,0,41,1,114,159,0,0,0,114,5, ++ 0,0,0,218,16,95,114,101,113,117,105,114,101,115,95,102, ++ 114,111,122,101,110,42,2,0,0,115,6,0,0,0,0,2, ++ 18,5,13,1,114,164,0,0,0,99,2,0,0,0,0,0, ++ 0,0,5,0,0,0,5,0,0,0,67,0,0,0,115,87, ++ 0,0,0,124,0,0,106,0,0,124,1,0,131,1,0,92, ++ 2,0,125,2,0,125,3,0,124,2,0,100,1,0,107,8, ++ 0,114,83,0,116,1,0,124,3,0,131,1,0,114,83,0, ++ 100,2,0,125,4,0,116,2,0,106,3,0,124,4,0,106, ++ 4,0,124,3,0,100,3,0,25,131,1,0,116,5,0,131, ++ 2,0,1,110,0,0,124,2,0,83,41,4,122,86,84,114, ++ 121,32,116,111,32,102,105,110,100,32,97,32,108,111,97,100, ++ 101,114,32,102,111,114,32,116,104,101,32,115,112,101,99,105, ++ 102,105,101,100,32,109,111,100,117,108,101,32,98,121,32,100, ++ 101,108,101,103,97,116,105,110,103,32,116,111,10,32,32,32, ++ 32,115,101,108,102,46,102,105,110,100,95,108,111,97,100,101, ++ 114,40,41,46,78,122,44,78,111,116,32,105,109,112,111,114, ++ 116,105,110,103,32,100,105,114,101,99,116,111,114,121,32,123, ++ 125,58,32,109,105,115,115,105,110,103,32,95,95,105,110,105, ++ 116,95,95,114,84,0,0,0,41,6,218,11,102,105,110,100, ++ 95,108,111,97,100,101,114,114,31,0,0,0,218,9,95,119, ++ 97,114,110,105,110,103,115,218,4,119,97,114,110,114,47,0, ++ 0,0,218,13,73,109,112,111,114,116,87,97,114,110,105,110, ++ 103,41,5,114,71,0,0,0,114,158,0,0,0,218,6,108, ++ 111,97,100,101,114,218,8,112,111,114,116,105,111,110,115,218, ++ 3,109,115,103,114,4,0,0,0,114,4,0,0,0,114,5, ++ 0,0,0,218,17,95,102,105,110,100,95,109,111,100,117,108, ++ 101,95,115,104,105,109,53,2,0,0,115,10,0,0,0,0, ++ 6,21,1,24,1,6,1,32,1,114,172,0,0,0,99,2, ++ 0,0,0,0,0,0,0,5,0,0,0,3,0,0,0,67, ++ 0,0,0,115,93,0,0,0,116,0,0,124,1,0,124,0, ++ 0,131,2,0,125,2,0,116,1,0,124,2,0,131,1,0, ++ 125,3,0,124,1,0,116,2,0,106,3,0,107,6,0,114, ++ 79,0,116,2,0,106,3,0,124,1,0,25,125,4,0,124, ++ 3,0,106,4,0,124,4,0,131,1,0,1,116,2,0,106, ++ 3,0,124,1,0,25,83,124,3,0,106,5,0,131,0,0, ++ 83,100,1,0,83,41,2,122,57,76,111,97,100,32,116,104, ++ 101,32,115,112,101,99,105,102,105,101,100,32,109,111,100,117, ++ 108,101,32,105,110,116,111,32,115,121,115,46,109,111,100,117, ++ 108,101,115,32,97,110,100,32,114,101,116,117,114,110,32,105, ++ 116,46,78,41,6,218,16,115,112,101,99,95,102,114,111,109, ++ 95,108,111,97,100,101,114,218,12,95,83,112,101,99,77,101, ++ 116,104,111,100,115,114,7,0,0,0,114,73,0,0,0,218, ++ 4,101,120,101,99,218,4,108,111,97,100,41,5,114,71,0, ++ 0,0,114,158,0,0,0,218,4,115,112,101,99,218,7,109, ++ 101,116,104,111,100,115,218,6,109,111,100,117,108,101,114,4, ++ 0,0,0,114,4,0,0,0,114,5,0,0,0,218,17,95, ++ 108,111,97,100,95,109,111,100,117,108,101,95,115,104,105,109, ++ 66,2,0,0,115,14,0,0,0,0,3,15,1,12,1,15, ++ 1,13,1,13,1,11,2,114,180,0,0,0,99,4,0,0, ++ 0,0,0,0,0,11,0,0,0,19,0,0,0,67,0,0, ++ 0,115,243,1,0,0,105,0,0,125,4,0,124,2,0,100, ++ 1,0,107,9,0,114,31,0,124,2,0,124,4,0,100,2, ++ 0,60,110,6,0,100,3,0,125,2,0,124,3,0,100,1, ++ 0,107,9,0,114,62,0,124,3,0,124,4,0,100,4,0, ++ 60,110,0,0,124,0,0,100,1,0,100,5,0,133,2,0, ++ 25,125,5,0,124,0,0,100,5,0,100,6,0,133,2,0, ++ 25,125,6,0,124,0,0,100,6,0,100,7,0,133,2,0, ++ 25,125,7,0,124,5,0,116,0,0,107,3,0,114,168,0, ++ 100,8,0,106,1,0,124,2,0,124,5,0,131,2,0,125, ++ 8,0,116,2,0,124,8,0,131,1,0,1,116,3,0,124, ++ 8,0,124,4,0,141,1,0,130,1,0,110,116,0,116,4, ++ 0,124,6,0,131,1,0,100,5,0,107,3,0,114,226,0, ++ 100,9,0,106,1,0,124,2,0,131,1,0,125,8,0,116, ++ 2,0,124,8,0,131,1,0,1,116,5,0,124,8,0,131, ++ 1,0,130,1,0,110,58,0,116,4,0,124,7,0,131,1, ++ 0,100,5,0,107,3,0,114,28,1,100,10,0,106,1,0, ++ 124,2,0,131,1,0,125,8,0,116,2,0,124,8,0,131, ++ 1,0,1,116,5,0,124,8,0,131,1,0,130,1,0,110, ++ 0,0,124,1,0,100,1,0,107,9,0,114,229,1,121,20, ++ 0,116,6,0,124,1,0,100,11,0,25,131,1,0,125,9, ++ 0,87,110,18,0,4,116,7,0,107,10,0,114,80,1,1, ++ 1,1,89,110,62,0,88,116,8,0,124,6,0,131,1,0, ++ 124,9,0,107,3,0,114,142,1,100,12,0,106,1,0,124, ++ 2,0,131,1,0,125,8,0,116,2,0,124,8,0,131,1, ++ 0,1,116,3,0,124,8,0,124,4,0,141,1,0,130,1, ++ 0,110,0,0,121,18,0,124,1,0,100,13,0,25,100,14, ++ 0,64,125,10,0,87,110,18,0,4,116,7,0,107,10,0, ++ 114,180,1,1,1,1,89,113,229,1,88,116,8,0,124,7, ++ 0,131,1,0,124,10,0,107,3,0,114,229,1,116,3,0, ++ 100,12,0,106,1,0,124,2,0,131,1,0,124,4,0,141, ++ 1,0,130,1,0,113,229,1,110,0,0,124,0,0,100,7, ++ 0,100,1,0,133,2,0,25,83,41,15,97,122,1,0,0, ++ 86,97,108,105,100,97,116,101,32,116,104,101,32,104,101,97, ++ 100,101,114,32,111,102,32,116,104,101,32,112,97,115,115,101, ++ 100,45,105,110,32,98,121,116,101,99,111,100,101,32,97,103, ++ 97,105,110,115,116,32,115,111,117,114,99,101,95,115,116,97, ++ 116,115,32,40,105,102,10,32,32,32,32,103,105,118,101,110, ++ 41,32,97,110,100,32,114,101,116,117,114,110,105,110,103,32, ++ 116,104,101,32,98,121,116,101,99,111,100,101,32,116,104,97, ++ 116,32,99,97,110,32,98,101,32,99,111,109,112,105,108,101, ++ 100,32,98,121,32,99,111,109,112,105,108,101,40,41,46,10, ++ 10,32,32,32,32,65,108,108,32,111,116,104,101,114,32,97, ++ 114,103,117,109,101,110,116,115,32,97,114,101,32,117,115,101, ++ 100,32,116,111,32,101,110,104,97,110,99,101,32,101,114,114, ++ 111,114,32,114,101,112,111,114,116,105,110,103,46,10,10,32, ++ 32,32,32,73,109,112,111,114,116,69,114,114,111,114,32,105, ++ 115,32,114,97,105,115,101,100,32,119,104,101,110,32,116,104, ++ 101,32,109,97,103,105,99,32,110,117,109,98,101,114,32,105, ++ 115,32,105,110,99,111,114,114,101,99,116,32,111,114,32,116, ++ 104,101,32,98,121,116,101,99,111,100,101,32,105,115,10,32, ++ 32,32,32,102,111,117,110,100,32,116,111,32,98,101,32,115, ++ 116,97,108,101,46,32,69,79,70,69,114,114,111,114,32,105, ++ 115,32,114,97,105,115,101,100,32,119,104,101,110,32,116,104, ++ 101,32,100,97,116,97,32,105,115,32,102,111,117,110,100,32, ++ 116,111,32,98,101,10,32,32,32,32,116,114,117,110,99,97, ++ 116,101,100,46,10,10,32,32,32,32,78,114,67,0,0,0, ++ 122,10,60,98,121,116,101,99,111,100,101,62,114,35,0,0, ++ 0,114,12,0,0,0,233,8,0,0,0,233,12,0,0,0, ++ 122,30,98,97,100,32,109,97,103,105,99,32,110,117,109,98, ++ 101,114,32,105,110,32,123,33,114,125,58,32,123,33,114,125, ++ 122,43,114,101,97,99,104,101,100,32,69,79,70,32,119,104, ++ 105,108,101,32,114,101,97,100,105,110,103,32,116,105,109,101, ++ 115,116,97,109,112,32,105,110,32,123,33,114,125,122,48,114, ++ 101,97,99,104,101,100,32,69,79,70,32,119,104,105,108,101, ++ 32,114,101,97,100,105,110,103,32,115,105,122,101,32,111,102, ++ 32,115,111,117,114,99,101,32,105,110,32,123,33,114,125,218, ++ 5,109,116,105,109,101,122,26,98,121,116,101,99,111,100,101, ++ 32,105,115,32,115,116,97,108,101,32,102,111,114,32,123,33, ++ 114,125,218,4,115,105,122,101,108,3,0,0,0,255,127,255, ++ 127,3,0,41,9,218,12,77,65,71,73,67,95,78,85,77, ++ 66,69,82,114,47,0,0,0,114,152,0,0,0,114,153,0, ++ 0,0,114,31,0,0,0,218,8,69,79,70,69,114,114,111, ++ 114,114,14,0,0,0,114,79,0,0,0,114,19,0,0,0, ++ 41,11,114,53,0,0,0,218,12,115,111,117,114,99,101,95, ++ 115,116,97,116,115,114,67,0,0,0,114,35,0,0,0,90, ++ 11,101,120,99,95,100,101,116,97,105,108,115,90,5,109,97, ++ 103,105,99,90,13,114,97,119,95,116,105,109,101,115,116,97, ++ 109,112,90,8,114,97,119,95,115,105,122,101,114,151,0,0, ++ 0,218,12,115,111,117,114,99,101,95,109,116,105,109,101,218, ++ 11,115,111,117,114,99,101,95,115,105,122,101,114,4,0,0, ++ 0,114,4,0,0,0,114,5,0,0,0,218,25,95,118,97, ++ 108,105,100,97,116,101,95,98,121,116,101,99,111,100,101,95, ++ 104,101,97,100,101,114,79,2,0,0,115,76,0,0,0,0, ++ 11,6,1,12,1,13,3,6,1,12,1,13,1,16,1,16, ++ 1,16,1,12,1,18,1,10,1,18,1,18,1,15,1,10, ++ 1,15,1,18,1,15,1,10,1,15,1,12,1,3,1,20, ++ 1,13,1,5,2,18,1,15,1,10,1,18,1,3,1,18, ++ 1,13,1,5,2,18,1,15,1,15,1,114,190,0,0,0, ++ 99,4,0,0,0,0,0,0,0,5,0,0,0,6,0,0, ++ 0,67,0,0,0,115,115,0,0,0,116,0,0,106,1,0, ++ 124,0,0,131,1,0,125,4,0,116,2,0,124,4,0,116, ++ 3,0,131,2,0,114,78,0,116,4,0,100,1,0,124,2, ++ 0,131,2,0,1,124,3,0,100,2,0,107,9,0,114,74, ++ 0,116,5,0,106,6,0,124,4,0,124,3,0,131,2,0, ++ 1,110,0,0,124,4,0,83,116,7,0,100,3,0,106,8, ++ 0,124,2,0,131,1,0,100,4,0,124,1,0,100,5,0, ++ 124,2,0,131,1,2,130,1,0,100,2,0,83,41,6,122, ++ 60,67,111,109,112,105,108,101,32,98,121,116,101,99,111,100, ++ 101,32,97,115,32,114,101,116,117,114,110,101,100,32,98,121, ++ 32,95,118,97,108,105,100,97,116,101,95,98,121,116,101,99, ++ 111,100,101,95,104,101,97,100,101,114,40,41,46,122,21,99, ++ 111,100,101,32,111,98,106,101,99,116,32,102,114,111,109,32, ++ 123,33,114,125,78,122,23,78,111,110,45,99,111,100,101,32, ++ 111,98,106,101,99,116,32,105,110,32,123,33,114,125,114,67, ++ 0,0,0,114,35,0,0,0,41,9,218,7,109,97,114,115, ++ 104,97,108,90,5,108,111,97,100,115,218,10,105,115,105,110, ++ 115,116,97,110,99,101,218,10,95,99,111,100,101,95,116,121, ++ 112,101,114,152,0,0,0,114,106,0,0,0,90,16,95,102, ++ 105,120,95,99,111,95,102,105,108,101,110,97,109,101,114,153, ++ 0,0,0,114,47,0,0,0,41,5,114,53,0,0,0,114, ++ 67,0,0,0,114,140,0,0,0,114,141,0,0,0,218,4, ++ 99,111,100,101,114,4,0,0,0,114,4,0,0,0,114,5, ++ 0,0,0,218,17,95,99,111,109,112,105,108,101,95,98,121, ++ 116,101,99,111,100,101,134,2,0,0,115,16,0,0,0,0, ++ 2,15,1,15,1,13,1,12,1,19,1,4,2,18,1,114, ++ 195,0,0,0,114,84,0,0,0,99,3,0,0,0,0,0, ++ 0,0,4,0,0,0,3,0,0,0,67,0,0,0,115,76, ++ 0,0,0,116,0,0,116,1,0,131,1,0,125,3,0,124, ++ 3,0,106,2,0,116,3,0,124,1,0,131,1,0,131,1, ++ 0,1,124,3,0,106,2,0,116,3,0,124,2,0,131,1, ++ 0,131,1,0,1,124,3,0,106,2,0,116,4,0,106,5, ++ 0,124,0,0,131,1,0,131,1,0,1,124,3,0,83,41, ++ 1,122,80,67,111,109,112,105,108,101,32,97,32,99,111,100, ++ 101,32,111,98,106,101,99,116,32,105,110,116,111,32,98,121, ++ 116,101,99,111,100,101,32,102,111,114,32,119,114,105,116,105, ++ 110,103,32,111,117,116,32,116,111,32,97,32,98,121,116,101, ++ 45,99,111,109,112,105,108,101,100,10,32,32,32,32,102,105, ++ 108,101,46,41,6,218,9,98,121,116,101,97,114,114,97,121, ++ 114,185,0,0,0,218,6,101,120,116,101,110,100,114,17,0, ++ 0,0,114,191,0,0,0,90,5,100,117,109,112,115,41,4, ++ 114,194,0,0,0,114,183,0,0,0,114,189,0,0,0,114, ++ 53,0,0,0,114,4,0,0,0,114,4,0,0,0,114,5, ++ 0,0,0,218,17,95,99,111,100,101,95,116,111,95,98,121, ++ 116,101,99,111,100,101,146,2,0,0,115,10,0,0,0,0, ++ 3,12,1,19,1,19,1,22,1,114,198,0,0,0,99,1, ++ 0,0,0,0,0,0,0,5,0,0,0,4,0,0,0,67, ++ 0,0,0,115,89,0,0,0,100,1,0,100,2,0,108,0, ++ 0,125,1,0,116,1,0,106,2,0,124,0,0,131,1,0, ++ 106,3,0,125,2,0,124,1,0,106,4,0,124,2,0,131, ++ 1,0,125,3,0,116,1,0,106,5,0,100,2,0,100,3, ++ 0,131,2,0,125,4,0,124,4,0,106,6,0,124,0,0, ++ 106,6,0,124,3,0,100,1,0,25,131,1,0,131,1,0, ++ 83,41,4,122,121,68,101,99,111,100,101,32,98,121,116,101, ++ 115,32,114,101,112,114,101,115,101,110,116,105,110,103,32,115, ++ 111,117,114,99,101,32,99,111,100,101,32,97,110,100,32,114, ++ 101,116,117,114,110,32,116,104,101,32,115,116,114,105,110,103, ++ 46,10,10,32,32,32,32,85,110,105,118,101,114,115,97,108, ++ 32,110,101,119,108,105,110,101,32,115,117,112,112,111,114,116, ++ 32,105,115,32,117,115,101,100,32,105,110,32,116,104,101,32, ++ 100,101,99,111,100,105,110,103,46,10,32,32,32,32,114,84, ++ 0,0,0,78,84,41,7,218,8,116,111,107,101,110,105,122, ++ 101,114,49,0,0,0,90,7,66,121,116,101,115,73,79,90, ++ 8,114,101,97,100,108,105,110,101,90,15,100,101,116,101,99, ++ 116,95,101,110,99,111,100,105,110,103,90,25,73,110,99,114, ++ 101,109,101,110,116,97,108,78,101,119,108,105,110,101,68,101, ++ 99,111,100,101,114,218,6,100,101,99,111,100,101,41,5,218, ++ 12,115,111,117,114,99,101,95,98,121,116,101,115,114,199,0, ++ 0,0,90,21,115,111,117,114,99,101,95,98,121,116,101,115, ++ 95,114,101,97,100,108,105,110,101,218,8,101,110,99,111,100, ++ 105,110,103,90,15,110,101,119,108,105,110,101,95,100,101,99, ++ 111,100,101,114,114,4,0,0,0,114,4,0,0,0,114,5, ++ 0,0,0,218,13,100,101,99,111,100,101,95,115,111,117,114, ++ 99,101,156,2,0,0,115,10,0,0,0,0,5,12,1,18, ++ 1,15,1,18,1,114,203,0,0,0,99,1,0,0,0,0, ++ 0,0,0,5,0,0,0,35,0,0,0,67,0,0,0,115, ++ 15,1,0,0,116,0,0,124,0,0,100,1,0,100,0,0, ++ 131,3,0,125,1,0,116,1,0,124,1,0,100,2,0,131, ++ 2,0,114,74,0,121,17,0,124,1,0,106,2,0,124,0, ++ 0,131,1,0,83,87,113,74,0,4,116,3,0,107,10,0, ++ 114,70,0,1,1,1,89,113,74,0,88,110,0,0,121,13, ++ 0,124,0,0,106,4,0,125,2,0,87,110,18,0,4,116, ++ 5,0,107,10,0,114,107,0,1,1,1,89,110,29,0,88, ++ 124,2,0,100,0,0,107,9,0,114,136,0,116,6,0,124, ++ 2,0,131,1,0,106,2,0,131,0,0,83,121,13,0,124, ++ 0,0,106,7,0,125,3,0,87,110,24,0,4,116,5,0, ++ 107,10,0,114,175,0,1,1,1,100,3,0,125,3,0,89, ++ 110,1,0,88,121,13,0,124,0,0,106,8,0,125,4,0, ++ 87,110,59,0,4,116,5,0,107,10,0,114,250,0,1,1, ++ 1,124,1,0,100,0,0,107,8,0,114,230,0,100,4,0, ++ 106,9,0,124,3,0,131,1,0,83,100,5,0,106,9,0, ++ 124,3,0,124,1,0,131,2,0,83,89,110,17,0,88,100, ++ 6,0,106,9,0,124,3,0,124,4,0,131,2,0,83,100, ++ 0,0,83,41,7,78,218,10,95,95,108,111,97,100,101,114, ++ 95,95,218,11,109,111,100,117,108,101,95,114,101,112,114,250, ++ 1,63,122,13,60,109,111,100,117,108,101,32,123,33,114,125, ++ 62,122,20,60,109,111,100,117,108,101,32,123,33,114,125,32, ++ 40,123,33,114,125,41,62,122,23,60,109,111,100,117,108,101, ++ 32,123,33,114,125,32,102,114,111,109,32,123,33,114,125,62, ++ 41,10,114,62,0,0,0,114,60,0,0,0,114,205,0,0, ++ 0,218,9,69,120,99,101,112,116,105,111,110,218,8,95,95, ++ 115,112,101,99,95,95,218,14,65,116,116,114,105,98,117,116, ++ 101,69,114,114,111,114,114,174,0,0,0,114,57,0,0,0, ++ 218,8,95,95,102,105,108,101,95,95,114,47,0,0,0,41, ++ 5,114,179,0,0,0,114,169,0,0,0,114,177,0,0,0, ++ 114,67,0,0,0,114,131,0,0,0,114,4,0,0,0,114, ++ 4,0,0,0,114,5,0,0,0,218,12,95,109,111,100,117, ++ 108,101,95,114,101,112,114,170,2,0,0,115,46,0,0,0, ++ 0,2,18,1,15,2,3,1,17,1,13,1,8,1,3,1, ++ 13,1,13,1,5,2,12,1,16,4,3,1,13,1,13,1, ++ 11,1,3,1,13,1,13,1,12,1,13,2,21,2,114,211, ++ 0,0,0,99,0,0,0,0,0,0,0,0,0,0,0,0, ++ 2,0,0,0,64,0,0,0,115,52,0,0,0,101,0,0, ++ 90,1,0,100,0,0,90,2,0,100,1,0,100,2,0,132, ++ 0,0,90,3,0,100,3,0,100,4,0,132,0,0,90,4, ++ 0,100,5,0,100,6,0,132,0,0,90,5,0,100,7,0, ++ 83,41,8,218,17,95,105,110,115,116,97,108,108,101,100,95, ++ 115,97,102,101,108,121,99,2,0,0,0,0,0,0,0,2, ++ 0,0,0,2,0,0,0,67,0,0,0,115,25,0,0,0, ++ 124,1,0,124,0,0,95,0,0,124,1,0,106,1,0,124, ++ 0,0,95,2,0,100,0,0,83,41,1,78,41,3,218,7, ++ 95,109,111,100,117,108,101,114,208,0,0,0,218,5,95,115, ++ 112,101,99,41,2,114,71,0,0,0,114,179,0,0,0,114, ++ 4,0,0,0,114,4,0,0,0,114,5,0,0,0,114,72, ++ 0,0,0,206,2,0,0,115,4,0,0,0,0,1,9,1, ++ 122,26,95,105,110,115,116,97,108,108,101,100,95,115,97,102, ++ 101,108,121,46,95,95,105,110,105,116,95,95,99,1,0,0, ++ 0,0,0,0,0,1,0,0,0,3,0,0,0,67,0,0, ++ 0,115,38,0,0,0,100,1,0,124,0,0,106,0,0,95, ++ 1,0,124,0,0,106,2,0,116,3,0,106,4,0,124,0, ++ 0,106,0,0,106,5,0,60,100,0,0,83,41,2,78,84, ++ 41,6,114,214,0,0,0,218,13,95,105,110,105,116,105,97, ++ 108,105,122,105,110,103,114,213,0,0,0,114,7,0,0,0, ++ 114,73,0,0,0,114,67,0,0,0,41,1,114,71,0,0, ++ 0,114,4,0,0,0,114,4,0,0,0,114,5,0,0,0, ++ 114,75,0,0,0,210,2,0,0,115,4,0,0,0,0,4, ++ 12,1,122,27,95,105,110,115,116,97,108,108,101,100,95,115, ++ 97,102,101,108,121,46,95,95,101,110,116,101,114,95,95,99, ++ 1,0,0,0,0,0,0,0,3,0,0,0,17,0,0,0, ++ 71,0,0,0,115,121,0,0,0,122,101,0,124,0,0,106, ++ 0,0,125,2,0,116,1,0,100,1,0,100,2,0,132,0, ++ 0,124,1,0,68,131,1,0,131,1,0,114,78,0,121,17, ++ 0,116,2,0,106,3,0,124,2,0,106,4,0,61,87,113, ++ 100,0,4,116,5,0,107,10,0,114,74,0,1,1,1,89, ++ 113,100,0,88,110,22,0,116,6,0,100,3,0,124,2,0, ++ 106,4,0,124,2,0,106,7,0,131,3,0,1,87,100,0, ++ 0,100,4,0,124,0,0,106,0,0,95,8,0,88,100,0, ++ 0,83,41,5,78,99,1,0,0,0,0,0,0,0,2,0, ++ 0,0,3,0,0,0,115,0,0,0,115,27,0,0,0,124, ++ 0,0,93,17,0,125,1,0,124,1,0,100,0,0,107,9, ++ 0,86,1,113,3,0,100,0,0,83,41,1,78,114,4,0, ++ 0,0,41,2,114,22,0,0,0,114,76,0,0,0,114,4, ++ 0,0,0,114,4,0,0,0,114,5,0,0,0,114,77,0, ++ 0,0,220,2,0,0,115,2,0,0,0,6,0,122,45,95, ++ 105,110,115,116,97,108,108,101,100,95,115,97,102,101,108,121, ++ 46,95,95,101,120,105,116,95,95,46,60,108,111,99,97,108, ++ 115,62,46,60,103,101,110,101,120,112,114,62,122,18,105,109, ++ 112,111,114,116,32,123,33,114,125,32,35,32,123,33,114,125, ++ 70,41,9,114,214,0,0,0,114,78,0,0,0,114,7,0, ++ 0,0,114,73,0,0,0,114,67,0,0,0,114,79,0,0, ++ 0,114,152,0,0,0,114,169,0,0,0,114,215,0,0,0, ++ 41,3,114,71,0,0,0,114,80,0,0,0,114,177,0,0, ++ 0,114,4,0,0,0,114,4,0,0,0,114,5,0,0,0, ++ 114,81,0,0,0,217,2,0,0,115,18,0,0,0,0,1, ++ 3,1,9,1,25,1,3,1,17,1,13,1,8,2,26,2, ++ 122,26,95,105,110,115,116,97,108,108,101,100,95,115,97,102, ++ 101,108,121,46,95,95,101,120,105,116,95,95,78,41,6,114, ++ 57,0,0,0,114,56,0,0,0,114,58,0,0,0,114,72, ++ 0,0,0,114,75,0,0,0,114,81,0,0,0,114,4,0, + 0,0,114,4,0,0,0,114,4,0,0,0,114,5,0,0, +- 0,114,101,0,0,0,199,2,0,0,115,18,0,0,0,0, +- 1,3,1,9,1,25,1,3,1,17,1,13,1,8,2,26, +- 2,122,26,95,105,110,115,116,97,108,108,101,100,95,115,97, +- 102,101,108,121,46,95,95,101,120,105,116,95,95,78,41,6, +- 114,57,0,0,0,114,56,0,0,0,114,58,0,0,0,114, +- 79,0,0,0,114,98,0,0,0,114,101,0,0,0,114,4, +- 0,0,0,114,4,0,0,0,114,4,0,0,0,114,5,0, +- 0,0,114,207,0,0,0,186,2,0,0,115,6,0,0,0, +- 12,2,12,4,12,7,114,207,0,0,0,99,0,0,0,0, +- 0,0,0,0,0,0,0,0,8,0,0,0,64,0,0,0, +- 115,151,0,0,0,101,0,0,90,1,0,100,0,0,90,2, +- 0,100,1,0,90,3,0,100,2,0,100,3,0,100,4,0, +- 100,3,0,100,5,0,100,3,0,100,6,0,100,7,0,132, +- 0,3,90,4,0,100,8,0,100,9,0,132,0,0,90,5, +- 0,100,10,0,100,11,0,132,0,0,90,6,0,101,7,0, +- 100,12,0,100,13,0,132,0,0,131,1,0,90,8,0,101, +- 8,0,106,9,0,100,14,0,100,13,0,132,0,0,131,1, +- 0,90,8,0,101,7,0,100,15,0,100,16,0,132,0,0, +- 131,1,0,90,10,0,101,7,0,100,17,0,100,18,0,132, +- 0,0,131,1,0,90,11,0,100,3,0,83,41,19,218,10, +- 77,111,100,117,108,101,83,112,101,99,97,208,5,0,0,84, +- 104,101,32,115,112,101,99,105,102,105,99,97,116,105,111,110, +- 32,102,111,114,32,97,32,109,111,100,117,108,101,44,32,117, +- 115,101,100,32,102,111,114,32,108,111,97,100,105,110,103,46, +- 10,10,32,32,32,32,65,32,109,111,100,117,108,101,39,115, +- 32,115,112,101,99,32,105,115,32,116,104,101,32,115,111,117, +- 114,99,101,32,102,111,114,32,105,110,102,111,114,109,97,116, +- 105,111,110,32,97,98,111,117,116,32,116,104,101,32,109,111, +- 100,117,108,101,46,32,32,70,111,114,10,32,32,32,32,100, +- 97,116,97,32,97,115,115,111,99,105,97,116,101,100,32,119, +- 105,116,104,32,116,104,101,32,109,111,100,117,108,101,44,32, +- 105,110,99,108,117,100,105,110,103,32,115,111,117,114,99,101, +- 44,32,117,115,101,32,116,104,101,32,115,112,101,99,39,115, +- 10,32,32,32,32,108,111,97,100,101,114,46,10,10,32,32, +- 32,32,96,110,97,109,101,96,32,105,115,32,116,104,101,32, +- 97,98,115,111,108,117,116,101,32,110,97,109,101,32,111,102, +- 32,116,104,101,32,109,111,100,117,108,101,46,32,32,96,108, +- 111,97,100,101,114,96,32,105,115,32,116,104,101,32,108,111, +- 97,100,101,114,10,32,32,32,32,116,111,32,117,115,101,32, +- 119,104,101,110,32,108,111,97,100,105,110,103,32,116,104,101, +- 32,109,111,100,117,108,101,46,32,32,96,112,97,114,101,110, +- 116,96,32,105,115,32,116,104,101,32,110,97,109,101,32,111, +- 102,32,116,104,101,10,32,32,32,32,112,97,99,107,97,103, +- 101,32,116,104,101,32,109,111,100,117,108,101,32,105,115,32, +- 105,110,46,32,32,84,104,101,32,112,97,114,101,110,116,32, +- 105,115,32,100,101,114,105,118,101,100,32,102,114,111,109,32, +- 116,104,101,32,110,97,109,101,46,10,10,32,32,32,32,96, +- 105,115,95,112,97,99,107,97,103,101,96,32,100,101,116,101, +- 114,109,105,110,101,115,32,105,102,32,116,104,101,32,109,111, +- 100,117,108,101,32,105,115,32,99,111,110,115,105,100,101,114, +- 101,100,32,97,32,112,97,99,107,97,103,101,32,111,114,10, +- 32,32,32,32,110,111,116,46,32,32,79,110,32,109,111,100, +- 117,108,101,115,32,116,104,105,115,32,105,115,32,114,101,102, +- 108,101,99,116,101,100,32,98,121,32,116,104,101,32,96,95, +- 95,112,97,116,104,95,95,96,32,97,116,116,114,105,98,117, +- 116,101,46,10,10,32,32,32,32,96,111,114,105,103,105,110, +- 96,32,105,115,32,116,104,101,32,115,112,101,99,105,102,105, +- 99,32,108,111,99,97,116,105,111,110,32,117,115,101,100,32, +- 98,121,32,116,104,101,32,108,111,97,100,101,114,32,102,114, +- 111,109,32,119,104,105,99,104,32,116,111,10,32,32,32,32, +- 108,111,97,100,32,116,104,101,32,109,111,100,117,108,101,44, +- 32,105,102,32,116,104,97,116,32,105,110,102,111,114,109,97, +- 116,105,111,110,32,105,115,32,97,118,97,105,108,97,98,108, +- 101,46,32,32,87,104,101,110,32,102,105,108,101,110,97,109, +- 101,32,105,115,10,32,32,32,32,115,101,116,44,32,111,114, +- 105,103,105,110,32,119,105,108,108,32,109,97,116,99,104,46, +- 10,10,32,32,32,32,96,104,97,115,95,108,111,99,97,116, +- 105,111,110,96,32,105,110,100,105,99,97,116,101,115,32,116, +- 104,97,116,32,97,32,115,112,101,99,39,115,32,34,111,114, +- 105,103,105,110,34,32,114,101,102,108,101,99,116,115,32,97, +- 32,108,111,99,97,116,105,111,110,46,10,32,32,32,32,87, +- 104,101,110,32,116,104,105,115,32,105,115,32,84,114,117,101, +- 44,32,96,95,95,102,105,108,101,95,95,96,32,97,116,116, +- 114,105,98,117,116,101,32,111,102,32,116,104,101,32,109,111, +- 100,117,108,101,32,105,115,32,115,101,116,46,10,10,32,32, +- 32,32,96,99,97,99,104,101,100,96,32,105,115,32,116,104, +- 101,32,108,111,99,97,116,105,111,110,32,111,102,32,116,104, +- 101,32,99,97,99,104,101,100,32,98,121,116,101,99,111,100, +- 101,32,102,105,108,101,44,32,105,102,32,97,110,121,46,32, +- 32,73,116,10,32,32,32,32,99,111,114,114,101,115,112,111, +- 110,100,115,32,116,111,32,116,104,101,32,96,95,95,99,97, +- 99,104,101,100,95,95,96,32,97,116,116,114,105,98,117,116, +- 101,46,10,10,32,32,32,32,96,115,117,98,109,111,100,117, +- 108,101,95,115,101,97,114,99,104,95,108,111,99,97,116,105, +- 111,110,115,96,32,105,115,32,116,104,101,32,115,101,113,117, +- 101,110,99,101,32,111,102,32,112,97,116,104,32,101,110,116, +- 114,105,101,115,32,116,111,10,32,32,32,32,115,101,97,114, +- 99,104,32,119,104,101,110,32,105,109,112,111,114,116,105,110, +- 103,32,115,117,98,109,111,100,117,108,101,115,46,32,32,73, +- 102,32,115,101,116,44,32,105,115,95,112,97,99,107,97,103, +- 101,32,115,104,111,117,108,100,32,98,101,10,32,32,32,32, +- 84,114,117,101,45,45,97,110,100,32,70,97,108,115,101,32, +- 111,116,104,101,114,119,105,115,101,46,10,10,32,32,32,32, +- 80,97,99,107,97,103,101,115,32,97,114,101,32,115,105,109, +- 112,108,121,32,109,111,100,117,108,101,115,32,116,104,97,116, +- 32,40,109,97,121,41,32,104,97,118,101,32,115,117,98,109, +- 111,100,117,108,101,115,46,32,32,73,102,32,97,32,115,112, +- 101,99,10,32,32,32,32,104,97,115,32,97,32,110,111,110, +- 45,78,111,110,101,32,118,97,108,117,101,32,105,110,32,96, +- 115,117,98,109,111,100,117,108,101,95,115,101,97,114,99,104, +- 95,108,111,99,97,116,105,111,110,115,96,44,32,116,104,101, +- 32,105,109,112,111,114,116,10,32,32,32,32,115,121,115,116, +- 101,109,32,119,105,108,108,32,99,111,110,115,105,100,101,114, +- 32,109,111,100,117,108,101,115,32,108,111,97,100,101,100,32, +- 102,114,111,109,32,116,104,101,32,115,112,101,99,32,97,115, +- 32,112,97,99,107,97,103,101,115,46,10,10,32,32,32,32, +- 79,110,108,121,32,102,105,110,100,101,114,115,32,40,115,101, +- 101,32,105,109,112,111,114,116,108,105,98,46,97,98,99,46, +- 77,101,116,97,80,97,116,104,70,105,110,100,101,114,32,97, +- 110,100,10,32,32,32,32,105,109,112,111,114,116,108,105,98, +- 46,97,98,99,46,80,97,116,104,69,110,116,114,121,70,105, +- 110,100,101,114,41,32,115,104,111,117,108,100,32,109,111,100, +- 105,102,121,32,77,111,100,117,108,101,83,112,101,99,32,105, +- 110,115,116,97,110,99,101,115,46,10,10,32,32,32,32,218, +- 6,111,114,105,103,105,110,78,218,12,108,111,97,100,101,114, +- 95,115,116,97,116,101,218,10,105,115,95,112,97,99,107,97, +- 103,101,99,3,0,0,0,3,0,0,0,6,0,0,0,2, +- 0,0,0,67,0,0,0,115,79,0,0,0,124,1,0,124, +- 0,0,95,0,0,124,2,0,124,0,0,95,1,0,124,3, +- 0,124,0,0,95,2,0,124,4,0,124,0,0,95,3,0, +- 124,5,0,114,48,0,103,0,0,110,3,0,100,0,0,124, +- 0,0,95,4,0,100,1,0,124,0,0,95,5,0,100,0, +- 0,124,0,0,95,6,0,100,0,0,83,41,2,78,70,41, +- 7,114,67,0,0,0,114,163,0,0,0,114,214,0,0,0, +- 114,215,0,0,0,218,26,115,117,98,109,111,100,117,108,101, +- 95,115,101,97,114,99,104,95,108,111,99,97,116,105,111,110, +- 115,218,13,95,115,101,116,95,102,105,108,101,97,116,116,114, +- 218,7,95,99,97,99,104,101,100,41,6,114,78,0,0,0, +- 114,67,0,0,0,114,163,0,0,0,114,214,0,0,0,114, +- 215,0,0,0,114,216,0,0,0,114,4,0,0,0,114,4, +- 0,0,0,114,5,0,0,0,114,79,0,0,0,250,2,0, +- 0,115,14,0,0,0,0,2,9,1,9,1,9,1,9,1, +- 21,3,9,1,122,19,77,111,100,117,108,101,83,112,101,99, +- 46,95,95,105,110,105,116,95,95,99,1,0,0,0,0,0, +- 0,0,2,0,0,0,4,0,0,0,67,0,0,0,115,153, +- 0,0,0,100,1,0,106,0,0,124,0,0,106,1,0,131, +- 1,0,100,2,0,106,0,0,124,0,0,106,2,0,131,1, +- 0,103,2,0,125,1,0,124,0,0,106,3,0,100,0,0, +- 107,9,0,114,79,0,124,1,0,106,4,0,100,3,0,106, +- 0,0,124,0,0,106,3,0,131,1,0,131,1,0,1,110, +- 0,0,124,0,0,106,5,0,100,0,0,107,9,0,114,122, +- 0,124,1,0,106,4,0,100,4,0,106,0,0,124,0,0, +- 106,5,0,131,1,0,131,1,0,1,110,0,0,100,5,0, +- 106,0,0,124,0,0,106,6,0,106,7,0,100,6,0,106, +- 8,0,124,1,0,131,1,0,131,2,0,83,41,7,78,122, +- 9,110,97,109,101,61,123,33,114,125,122,11,108,111,97,100, +- 101,114,61,123,33,114,125,122,11,111,114,105,103,105,110,61, +- 123,33,114,125,122,29,115,117,98,109,111,100,117,108,101,95, +- 115,101,97,114,99,104,95,108,111,99,97,116,105,111,110,115, +- 61,123,125,122,6,123,125,40,123,125,41,122,2,44,32,41, +- 9,114,47,0,0,0,114,67,0,0,0,114,163,0,0,0, +- 114,214,0,0,0,218,6,97,112,112,101,110,100,114,217,0, +- 0,0,218,9,95,95,99,108,97,115,115,95,95,114,57,0, +- 0,0,114,26,0,0,0,41,2,114,78,0,0,0,114,99, +- 0,0,0,114,4,0,0,0,114,4,0,0,0,114,5,0, +- 0,0,114,90,0,0,0,6,3,0,0,115,16,0,0,0, +- 0,1,15,1,21,1,15,1,28,1,15,1,6,1,22,1, +- 122,19,77,111,100,117,108,101,83,112,101,99,46,95,95,114, +- 101,112,114,95,95,99,2,0,0,0,0,0,0,0,3,0, +- 0,0,13,0,0,0,67,0,0,0,115,145,0,0,0,124, +- 0,0,106,0,0,125,2,0,121,107,0,124,0,0,106,1, +- 0,124,1,0,106,1,0,107,2,0,111,114,0,124,0,0, +- 106,2,0,124,1,0,106,2,0,107,2,0,111,114,0,124, +- 0,0,106,3,0,124,1,0,106,3,0,107,2,0,111,114, +- 0,124,2,0,124,1,0,106,0,0,107,2,0,111,114,0, +- 124,0,0,106,4,0,124,1,0,106,4,0,107,2,0,111, +- 114,0,124,0,0,106,5,0,124,1,0,106,5,0,107,2, +- 0,83,87,110,22,0,4,116,6,0,107,10,0,114,140,0, +- 1,1,1,100,1,0,83,89,110,1,0,88,100,0,0,83, +- 41,2,78,70,41,7,114,217,0,0,0,114,67,0,0,0, +- 114,163,0,0,0,114,214,0,0,0,218,6,99,97,99,104, +- 101,100,218,12,104,97,115,95,108,111,99,97,116,105,111,110, +- 114,204,0,0,0,41,3,114,78,0,0,0,90,5,111,116, +- 104,101,114,90,4,115,109,115,108,114,4,0,0,0,114,4, +- 0,0,0,114,5,0,0,0,218,6,95,95,101,113,95,95, +- 16,3,0,0,115,20,0,0,0,0,1,9,1,3,1,18, +- 1,18,1,18,1,15,1,18,1,20,1,13,1,122,17,77, +- 111,100,117,108,101,83,112,101,99,46,95,95,101,113,95,95, +- 99,1,0,0,0,0,0,0,0,2,0,0,0,12,0,0, +- 0,67,0,0,0,115,158,0,0,0,124,0,0,106,0,0, +- 100,0,0,107,8,0,114,151,0,124,0,0,106,1,0,100, +- 0,0,107,9,0,114,151,0,124,0,0,106,2,0,114,151, +- 0,124,0,0,106,1,0,125,1,0,124,1,0,106,3,0, +- 116,4,0,116,5,0,131,1,0,131,1,0,114,112,0,121, +- 19,0,116,6,0,124,1,0,131,1,0,124,0,0,95,0, +- 0,87,113,145,0,4,116,7,0,107,10,0,114,108,0,1, +- 1,1,89,113,145,0,88,113,148,0,124,1,0,106,3,0, +- 116,4,0,116,8,0,131,1,0,131,1,0,114,148,0,124, +- 1,0,124,0,0,95,0,0,113,148,0,113,151,0,110,0, +- 0,124,0,0,106,0,0,83,41,1,78,41,9,114,219,0, +- 0,0,114,214,0,0,0,114,218,0,0,0,218,8,101,110, +- 100,115,119,105,116,104,218,5,116,117,112,108,101,114,128,0, +- 0,0,114,126,0,0,0,114,118,0,0,0,218,17,66,89, +- 84,69,67,79,68,69,95,83,85,70,70,73,88,69,83,41, +- 2,114,78,0,0,0,114,125,0,0,0,114,4,0,0,0, +- 114,4,0,0,0,114,5,0,0,0,114,222,0,0,0,28, +- 3,0,0,115,22,0,0,0,0,2,15,1,24,1,9,1, +- 21,1,3,1,19,1,13,1,8,1,21,1,18,1,122,17, +- 77,111,100,117,108,101,83,112,101,99,46,99,97,99,104,101, +- 100,99,2,0,0,0,0,0,0,0,2,0,0,0,2,0, +- 0,0,67,0,0,0,115,13,0,0,0,124,1,0,124,0, +- 0,95,0,0,100,0,0,83,41,1,78,41,1,114,219,0, +- 0,0,41,2,114,78,0,0,0,114,222,0,0,0,114,4, +- 0,0,0,114,4,0,0,0,114,5,0,0,0,114,222,0, +- 0,0,42,3,0,0,115,2,0,0,0,0,2,99,1,0, +- 0,0,0,0,0,0,1,0,0,0,2,0,0,0,67,0, +- 0,0,115,46,0,0,0,124,0,0,106,0,0,100,1,0, +- 107,8,0,114,35,0,124,0,0,106,1,0,106,2,0,100, +- 2,0,131,1,0,100,3,0,25,83,124,0,0,106,1,0, +- 83,100,1,0,83,41,4,122,32,84,104,101,32,110,97,109, +- 101,32,111,102,32,116,104,101,32,109,111,100,117,108,101,39, +- 115,32,112,97,114,101,110,116,46,78,114,110,0,0,0,114, +- 71,0,0,0,41,3,114,217,0,0,0,114,67,0,0,0, +- 114,32,0,0,0,41,1,114,78,0,0,0,114,4,0,0, +- 0,114,4,0,0,0,114,5,0,0,0,218,6,112,97,114, +- 101,110,116,46,3,0,0,115,6,0,0,0,0,3,15,1, +- 20,2,122,17,77,111,100,117,108,101,83,112,101,99,46,112, +- 97,114,101,110,116,99,1,0,0,0,0,0,0,0,1,0, +- 0,0,1,0,0,0,67,0,0,0,115,7,0,0,0,124, +- 0,0,106,0,0,83,41,1,78,41,1,114,218,0,0,0, +- 41,1,114,78,0,0,0,114,4,0,0,0,114,4,0,0, +- 0,114,5,0,0,0,114,223,0,0,0,54,3,0,0,115, +- 2,0,0,0,0,2,122,23,77,111,100,117,108,101,83,112, +- 101,99,46,104,97,115,95,108,111,99,97,116,105,111,110,41, +- 12,114,57,0,0,0,114,56,0,0,0,114,58,0,0,0, +- 114,59,0,0,0,114,79,0,0,0,114,90,0,0,0,114, +- 224,0,0,0,218,8,112,114,111,112,101,114,116,121,114,222, +- 0,0,0,218,6,115,101,116,116,101,114,114,228,0,0,0, +- 114,223,0,0,0,114,4,0,0,0,114,4,0,0,0,114, +- 4,0,0,0,114,5,0,0,0,114,213,0,0,0,213,2, +- 0,0,115,18,0,0,0,12,35,6,2,15,1,15,11,12, +- 10,12,12,18,14,21,4,18,8,114,213,0,0,0,114,214, +- 0,0,0,114,216,0,0,0,99,2,0,0,0,2,0,0, ++ 0,114,212,0,0,0,204,2,0,0,115,6,0,0,0,12, ++ 2,12,4,12,7,114,212,0,0,0,99,0,0,0,0,0, ++ 0,0,0,0,0,0,0,8,0,0,0,64,0,0,0,115, ++ 172,0,0,0,101,0,0,90,1,0,100,0,0,90,2,0, ++ 100,1,0,90,3,0,100,2,0,100,3,0,100,4,0,100, ++ 3,0,100,5,0,100,3,0,100,6,0,100,7,0,132,0, ++ 3,90,4,0,100,8,0,100,9,0,132,0,0,90,5,0, ++ 100,10,0,100,11,0,132,0,0,90,6,0,101,7,0,100, ++ 12,0,100,13,0,132,0,0,131,1,0,90,8,0,101,8, ++ 0,106,9,0,100,14,0,100,13,0,132,0,0,131,1,0, ++ 90,8,0,101,7,0,100,15,0,100,16,0,132,0,0,131, ++ 1,0,90,10,0,101,7,0,100,17,0,100,18,0,132,0, ++ 0,131,1,0,90,11,0,101,11,0,106,9,0,100,19,0, ++ 100,18,0,132,0,0,131,1,0,90,11,0,100,3,0,83, ++ 41,20,218,10,77,111,100,117,108,101,83,112,101,99,97,208, ++ 5,0,0,84,104,101,32,115,112,101,99,105,102,105,99,97, ++ 116,105,111,110,32,102,111,114,32,97,32,109,111,100,117,108, ++ 101,44,32,117,115,101,100,32,102,111,114,32,108,111,97,100, ++ 105,110,103,46,10,10,32,32,32,32,65,32,109,111,100,117, ++ 108,101,39,115,32,115,112,101,99,32,105,115,32,116,104,101, ++ 32,115,111,117,114,99,101,32,102,111,114,32,105,110,102,111, ++ 114,109,97,116,105,111,110,32,97,98,111,117,116,32,116,104, ++ 101,32,109,111,100,117,108,101,46,32,32,70,111,114,10,32, ++ 32,32,32,100,97,116,97,32,97,115,115,111,99,105,97,116, ++ 101,100,32,119,105,116,104,32,116,104,101,32,109,111,100,117, ++ 108,101,44,32,105,110,99,108,117,100,105,110,103,32,115,111, ++ 117,114,99,101,44,32,117,115,101,32,116,104,101,32,115,112, ++ 101,99,39,115,10,32,32,32,32,108,111,97,100,101,114,46, ++ 10,10,32,32,32,32,96,110,97,109,101,96,32,105,115,32, ++ 116,104,101,32,97,98,115,111,108,117,116,101,32,110,97,109, ++ 101,32,111,102,32,116,104,101,32,109,111,100,117,108,101,46, ++ 32,32,96,108,111,97,100,101,114,96,32,105,115,32,116,104, ++ 101,32,108,111,97,100,101,114,10,32,32,32,32,116,111,32, ++ 117,115,101,32,119,104,101,110,32,108,111,97,100,105,110,103, ++ 32,116,104,101,32,109,111,100,117,108,101,46,32,32,96,112, ++ 97,114,101,110,116,96,32,105,115,32,116,104,101,32,110,97, ++ 109,101,32,111,102,32,116,104,101,10,32,32,32,32,112,97, ++ 99,107,97,103,101,32,116,104,101,32,109,111,100,117,108,101, ++ 32,105,115,32,105,110,46,32,32,84,104,101,32,112,97,114, ++ 101,110,116,32,105,115,32,100,101,114,105,118,101,100,32,102, ++ 114,111,109,32,116,104,101,32,110,97,109,101,46,10,10,32, ++ 32,32,32,96,105,115,95,112,97,99,107,97,103,101,96,32, ++ 100,101,116,101,114,109,105,110,101,115,32,105,102,32,116,104, ++ 101,32,109,111,100,117,108,101,32,105,115,32,99,111,110,115, ++ 105,100,101,114,101,100,32,97,32,112,97,99,107,97,103,101, ++ 32,111,114,10,32,32,32,32,110,111,116,46,32,32,79,110, ++ 32,109,111,100,117,108,101,115,32,116,104,105,115,32,105,115, ++ 32,114,101,102,108,101,99,116,101,100,32,98,121,32,116,104, ++ 101,32,96,95,95,112,97,116,104,95,95,96,32,97,116,116, ++ 114,105,98,117,116,101,46,10,10,32,32,32,32,96,111,114, ++ 105,103,105,110,96,32,105,115,32,116,104,101,32,115,112,101, ++ 99,105,102,105,99,32,108,111,99,97,116,105,111,110,32,117, ++ 115,101,100,32,98,121,32,116,104,101,32,108,111,97,100,101, ++ 114,32,102,114,111,109,32,119,104,105,99,104,32,116,111,10, ++ 32,32,32,32,108,111,97,100,32,116,104,101,32,109,111,100, ++ 117,108,101,44,32,105,102,32,116,104,97,116,32,105,110,102, ++ 111,114,109,97,116,105,111,110,32,105,115,32,97,118,97,105, ++ 108,97,98,108,101,46,32,32,87,104,101,110,32,102,105,108, ++ 101,110,97,109,101,32,105,115,10,32,32,32,32,115,101,116, ++ 44,32,111,114,105,103,105,110,32,119,105,108,108,32,109,97, ++ 116,99,104,46,10,10,32,32,32,32,96,104,97,115,95,108, ++ 111,99,97,116,105,111,110,96,32,105,110,100,105,99,97,116, ++ 101,115,32,116,104,97,116,32,97,32,115,112,101,99,39,115, ++ 32,34,111,114,105,103,105,110,34,32,114,101,102,108,101,99, ++ 116,115,32,97,32,108,111,99,97,116,105,111,110,46,10,32, ++ 32,32,32,87,104,101,110,32,116,104,105,115,32,105,115,32, ++ 84,114,117,101,44,32,96,95,95,102,105,108,101,95,95,96, ++ 32,97,116,116,114,105,98,117,116,101,32,111,102,32,116,104, ++ 101,32,109,111,100,117,108,101,32,105,115,32,115,101,116,46, ++ 10,10,32,32,32,32,96,99,97,99,104,101,100,96,32,105, ++ 115,32,116,104,101,32,108,111,99,97,116,105,111,110,32,111, ++ 102,32,116,104,101,32,99,97,99,104,101,100,32,98,121,116, ++ 101,99,111,100,101,32,102,105,108,101,44,32,105,102,32,97, ++ 110,121,46,32,32,73,116,10,32,32,32,32,99,111,114,114, ++ 101,115,112,111,110,100,115,32,116,111,32,116,104,101,32,96, ++ 95,95,99,97,99,104,101,100,95,95,96,32,97,116,116,114, ++ 105,98,117,116,101,46,10,10,32,32,32,32,96,115,117,98, ++ 109,111,100,117,108,101,95,115,101,97,114,99,104,95,108,111, ++ 99,97,116,105,111,110,115,96,32,105,115,32,116,104,101,32, ++ 115,101,113,117,101,110,99,101,32,111,102,32,112,97,116,104, ++ 32,101,110,116,114,105,101,115,32,116,111,10,32,32,32,32, ++ 115,101,97,114,99,104,32,119,104,101,110,32,105,109,112,111, ++ 114,116,105,110,103,32,115,117,98,109,111,100,117,108,101,115, ++ 46,32,32,73,102,32,115,101,116,44,32,105,115,95,112,97, ++ 99,107,97,103,101,32,115,104,111,117,108,100,32,98,101,10, ++ 32,32,32,32,84,114,117,101,45,45,97,110,100,32,70,97, ++ 108,115,101,32,111,116,104,101,114,119,105,115,101,46,10,10, ++ 32,32,32,32,80,97,99,107,97,103,101,115,32,97,114,101, ++ 32,115,105,109,112,108,121,32,109,111,100,117,108,101,115,32, ++ 116,104,97,116,32,40,109,97,121,41,32,104,97,118,101,32, ++ 115,117,98,109,111,100,117,108,101,115,46,32,32,73,102,32, ++ 97,32,115,112,101,99,10,32,32,32,32,104,97,115,32,97, ++ 32,110,111,110,45,78,111,110,101,32,118,97,108,117,101,32, ++ 105,110,32,96,115,117,98,109,111,100,117,108,101,95,115,101, ++ 97,114,99,104,95,108,111,99,97,116,105,111,110,115,96,44, ++ 32,116,104,101,32,105,109,112,111,114,116,10,32,32,32,32, ++ 115,121,115,116,101,109,32,119,105,108,108,32,99,111,110,115, ++ 105,100,101,114,32,109,111,100,117,108,101,115,32,108,111,97, ++ 100,101,100,32,102,114,111,109,32,116,104,101,32,115,112,101, ++ 99,32,97,115,32,112,97,99,107,97,103,101,115,46,10,10, ++ 32,32,32,32,79,110,108,121,32,102,105,110,100,101,114,115, ++ 32,40,115,101,101,32,105,109,112,111,114,116,108,105,98,46, ++ 97,98,99,46,77,101,116,97,80,97,116,104,70,105,110,100, ++ 101,114,32,97,110,100,10,32,32,32,32,105,109,112,111,114, ++ 116,108,105,98,46,97,98,99,46,80,97,116,104,69,110,116, ++ 114,121,70,105,110,100,101,114,41,32,115,104,111,117,108,100, ++ 32,109,111,100,105,102,121,32,77,111,100,117,108,101,83,112, ++ 101,99,32,105,110,115,116,97,110,99,101,115,46,10,10,32, ++ 32,32,32,218,6,111,114,105,103,105,110,78,218,12,108,111, ++ 97,100,101,114,95,115,116,97,116,101,218,10,105,115,95,112, ++ 97,99,107,97,103,101,99,3,0,0,0,3,0,0,0,6, ++ 0,0,0,2,0,0,0,67,0,0,0,115,79,0,0,0, ++ 124,1,0,124,0,0,95,0,0,124,2,0,124,0,0,95, ++ 1,0,124,3,0,124,0,0,95,2,0,124,4,0,124,0, ++ 0,95,3,0,124,5,0,114,48,0,103,0,0,110,3,0, ++ 100,0,0,124,0,0,95,4,0,100,1,0,124,0,0,95, ++ 5,0,100,0,0,124,0,0,95,6,0,100,0,0,83,41, ++ 2,78,70,41,7,114,67,0,0,0,114,169,0,0,0,114, ++ 217,0,0,0,114,218,0,0,0,218,26,115,117,98,109,111, ++ 100,117,108,101,95,115,101,97,114,99,104,95,108,111,99,97, ++ 116,105,111,110,115,218,13,95,115,101,116,95,102,105,108,101, ++ 97,116,116,114,218,7,95,99,97,99,104,101,100,41,6,114, ++ 71,0,0,0,114,67,0,0,0,114,169,0,0,0,114,217, ++ 0,0,0,114,218,0,0,0,114,219,0,0,0,114,4,0, ++ 0,0,114,4,0,0,0,114,5,0,0,0,114,72,0,0, ++ 0,12,3,0,0,115,14,0,0,0,0,2,9,1,9,1, ++ 9,1,9,1,21,3,9,1,122,19,77,111,100,117,108,101, ++ 83,112,101,99,46,95,95,105,110,105,116,95,95,99,1,0, ++ 0,0,0,0,0,0,2,0,0,0,4,0,0,0,67,0, ++ 0,0,115,153,0,0,0,100,1,0,106,0,0,124,0,0, ++ 106,1,0,131,1,0,100,2,0,106,0,0,124,0,0,106, ++ 2,0,131,1,0,103,2,0,125,1,0,124,0,0,106,3, ++ 0,100,0,0,107,9,0,114,79,0,124,1,0,106,4,0, ++ 100,3,0,106,0,0,124,0,0,106,3,0,131,1,0,131, ++ 1,0,1,110,0,0,124,0,0,106,5,0,100,0,0,107, ++ 9,0,114,122,0,124,1,0,106,4,0,100,4,0,106,0, ++ 0,124,0,0,106,5,0,131,1,0,131,1,0,1,110,0, ++ 0,100,5,0,106,0,0,124,0,0,106,6,0,106,7,0, ++ 100,6,0,106,8,0,124,1,0,131,1,0,131,2,0,83, ++ 41,7,78,122,9,110,97,109,101,61,123,33,114,125,122,11, ++ 108,111,97,100,101,114,61,123,33,114,125,122,11,111,114,105, ++ 103,105,110,61,123,33,114,125,122,29,115,117,98,109,111,100, ++ 117,108,101,95,115,101,97,114,99,104,95,108,111,99,97,116, ++ 105,111,110,115,61,123,125,122,6,123,125,40,123,125,41,122, ++ 2,44,32,41,9,114,47,0,0,0,114,67,0,0,0,114, ++ 169,0,0,0,114,217,0,0,0,218,6,97,112,112,101,110, ++ 100,114,220,0,0,0,218,9,95,95,99,108,97,115,115,95, ++ 95,114,57,0,0,0,114,26,0,0,0,41,2,114,71,0, ++ 0,0,114,80,0,0,0,114,4,0,0,0,114,4,0,0, ++ 0,114,5,0,0,0,114,101,0,0,0,24,3,0,0,115, ++ 16,0,0,0,0,1,15,1,21,1,15,1,28,1,15,1, ++ 6,1,22,1,122,19,77,111,100,117,108,101,83,112,101,99, ++ 46,95,95,114,101,112,114,95,95,99,2,0,0,0,0,0, ++ 0,0,3,0,0,0,13,0,0,0,67,0,0,0,115,145, ++ 0,0,0,124,0,0,106,0,0,125,2,0,121,107,0,124, ++ 0,0,106,1,0,124,1,0,106,1,0,107,2,0,111,114, ++ 0,124,0,0,106,2,0,124,1,0,106,2,0,107,2,0, ++ 111,114,0,124,0,0,106,3,0,124,1,0,106,3,0,107, ++ 2,0,111,114,0,124,2,0,124,1,0,106,0,0,107,2, ++ 0,111,114,0,124,0,0,106,4,0,124,1,0,106,4,0, ++ 107,2,0,111,114,0,124,0,0,106,5,0,124,1,0,106, ++ 5,0,107,2,0,83,87,110,22,0,4,116,6,0,107,10, ++ 0,114,140,0,1,1,1,100,1,0,83,89,110,1,0,88, ++ 100,0,0,83,41,2,78,70,41,7,114,220,0,0,0,114, ++ 67,0,0,0,114,169,0,0,0,114,217,0,0,0,218,6, ++ 99,97,99,104,101,100,218,12,104,97,115,95,108,111,99,97, ++ 116,105,111,110,114,209,0,0,0,41,3,114,71,0,0,0, ++ 90,5,111,116,104,101,114,218,4,115,109,115,108,114,4,0, ++ 0,0,114,4,0,0,0,114,5,0,0,0,218,6,95,95, ++ 101,113,95,95,34,3,0,0,115,20,0,0,0,0,1,9, ++ 1,3,1,18,1,18,1,18,1,15,1,18,1,20,1,13, ++ 1,122,17,77,111,100,117,108,101,83,112,101,99,46,95,95, ++ 101,113,95,95,99,1,0,0,0,0,0,0,0,2,0,0, ++ 0,12,0,0,0,67,0,0,0,115,158,0,0,0,124,0, ++ 0,106,0,0,100,0,0,107,8,0,114,151,0,124,0,0, ++ 106,1,0,100,0,0,107,9,0,114,151,0,124,0,0,106, ++ 2,0,114,151,0,124,0,0,106,1,0,125,1,0,124,1, ++ 0,106,3,0,116,4,0,116,5,0,131,1,0,131,1,0, ++ 114,112,0,121,19,0,116,6,0,124,1,0,131,1,0,124, ++ 0,0,95,0,0,87,113,145,0,4,116,7,0,107,10,0, ++ 114,108,0,1,1,1,89,113,145,0,88,113,148,0,124,1, ++ 0,106,3,0,116,4,0,116,8,0,131,1,0,131,1,0, ++ 114,148,0,124,1,0,124,0,0,95,0,0,113,148,0,113, ++ 151,0,110,0,0,124,0,0,106,0,0,83,41,1,78,41, ++ 9,114,222,0,0,0,114,217,0,0,0,114,221,0,0,0, ++ 218,8,101,110,100,115,119,105,116,104,218,5,116,117,112,108, ++ 101,114,134,0,0,0,114,132,0,0,0,114,124,0,0,0, ++ 218,17,66,89,84,69,67,79,68,69,95,83,85,70,70,73, ++ 88,69,83,41,2,114,71,0,0,0,114,131,0,0,0,114, ++ 4,0,0,0,114,4,0,0,0,114,5,0,0,0,114,225, ++ 0,0,0,46,3,0,0,115,22,0,0,0,0,2,15,1, ++ 24,1,9,1,21,1,3,1,19,1,13,1,8,1,21,1, ++ 18,1,122,17,77,111,100,117,108,101,83,112,101,99,46,99, ++ 97,99,104,101,100,99,2,0,0,0,0,0,0,0,2,0, ++ 0,0,2,0,0,0,67,0,0,0,115,13,0,0,0,124, ++ 1,0,124,0,0,95,0,0,100,0,0,83,41,1,78,41, ++ 1,114,222,0,0,0,41,2,114,71,0,0,0,114,225,0, ++ 0,0,114,4,0,0,0,114,4,0,0,0,114,5,0,0, ++ 0,114,225,0,0,0,60,3,0,0,115,2,0,0,0,0, ++ 2,99,1,0,0,0,0,0,0,0,1,0,0,0,2,0, ++ 0,0,67,0,0,0,115,46,0,0,0,124,0,0,106,0, ++ 0,100,1,0,107,8,0,114,35,0,124,0,0,106,1,0, ++ 106,2,0,100,2,0,131,1,0,100,3,0,25,83,124,0, ++ 0,106,1,0,83,100,1,0,83,41,4,122,32,84,104,101, ++ 32,110,97,109,101,32,111,102,32,116,104,101,32,109,111,100, ++ 117,108,101,39,115,32,112,97,114,101,110,116,46,78,114,116, ++ 0,0,0,114,84,0,0,0,41,3,114,220,0,0,0,114, ++ 67,0,0,0,114,32,0,0,0,41,1,114,71,0,0,0, ++ 114,4,0,0,0,114,4,0,0,0,114,5,0,0,0,218, ++ 6,112,97,114,101,110,116,64,3,0,0,115,6,0,0,0, ++ 0,3,15,1,20,2,122,17,77,111,100,117,108,101,83,112, ++ 101,99,46,112,97,114,101,110,116,99,1,0,0,0,0,0, ++ 0,0,1,0,0,0,1,0,0,0,67,0,0,0,115,7, ++ 0,0,0,124,0,0,106,0,0,83,41,1,78,41,1,114, ++ 221,0,0,0,41,1,114,71,0,0,0,114,4,0,0,0, ++ 114,4,0,0,0,114,5,0,0,0,114,226,0,0,0,72, ++ 3,0,0,115,2,0,0,0,0,2,122,23,77,111,100,117, ++ 108,101,83,112,101,99,46,104,97,115,95,108,111,99,97,116, ++ 105,111,110,99,2,0,0,0,0,0,0,0,2,0,0,0, ++ 2,0,0,0,67,0,0,0,115,19,0,0,0,116,0,0, ++ 124,1,0,131,1,0,124,0,0,95,1,0,100,0,0,83, ++ 41,1,78,41,2,218,4,98,111,111,108,114,221,0,0,0, ++ 41,2,114,71,0,0,0,218,5,118,97,108,117,101,114,4, ++ 0,0,0,114,4,0,0,0,114,5,0,0,0,114,226,0, ++ 0,0,76,3,0,0,115,2,0,0,0,0,2,41,12,114, ++ 57,0,0,0,114,56,0,0,0,114,58,0,0,0,114,59, ++ 0,0,0,114,72,0,0,0,114,101,0,0,0,114,228,0, ++ 0,0,218,8,112,114,111,112,101,114,116,121,114,225,0,0, ++ 0,218,6,115,101,116,116,101,114,114,232,0,0,0,114,226, ++ 0,0,0,114,4,0,0,0,114,4,0,0,0,114,4,0, ++ 0,0,114,5,0,0,0,114,216,0,0,0,231,2,0,0, ++ 115,20,0,0,0,12,35,6,2,15,1,15,11,12,10,12, ++ 12,18,14,21,4,18,8,18,4,114,216,0,0,0,114,217, ++ 0,0,0,114,219,0,0,0,99,2,0,0,0,2,0,0, + 0,5,0,0,0,15,0,0,0,67,0,0,0,115,193,0, + 0,0,116,0,0,124,1,0,100,1,0,131,2,0,114,83, + 0,124,3,0,100,2,0,107,8,0,114,43,0,116,1,0, +@@ -1497,18 +1561,18 @@ + 109,111,100,117,108,101,32,115,112,101,99,32,98,97,115,101, + 100,32,111,110,32,118,97,114,105,111,117,115,32,108,111,97, + 100,101,114,32,109,101,116,104,111,100,115,46,218,12,103,101, +- 116,95,102,105,108,101,110,97,109,101,78,114,163,0,0,0, +- 114,217,0,0,0,114,216,0,0,0,70,114,214,0,0,0, ++ 116,95,102,105,108,101,110,97,109,101,78,114,169,0,0,0, ++ 114,220,0,0,0,114,219,0,0,0,70,114,217,0,0,0, + 41,5,114,60,0,0,0,218,23,115,112,101,99,95,102,114, + 111,109,95,102,105,108,101,95,108,111,99,97,116,105,111,110, +- 114,216,0,0,0,114,147,0,0,0,114,213,0,0,0,41, +- 5,114,67,0,0,0,114,163,0,0,0,114,214,0,0,0, +- 114,216,0,0,0,90,6,115,101,97,114,99,104,114,4,0, +- 0,0,114,4,0,0,0,114,5,0,0,0,114,167,0,0, +- 0,59,3,0,0,115,28,0,0,0,0,2,15,1,12,1, ++ 114,219,0,0,0,114,153,0,0,0,114,216,0,0,0,41, ++ 5,114,67,0,0,0,114,169,0,0,0,114,217,0,0,0, ++ 114,219,0,0,0,90,6,115,101,97,114,99,104,114,4,0, ++ 0,0,114,4,0,0,0,114,5,0,0,0,114,173,0,0, ++ 0,81,3,0,0,115,28,0,0,0,0,2,15,1,12,1, + 16,1,18,1,15,1,7,2,12,1,15,1,3,1,19,1, +- 13,1,14,3,9,2,114,167,0,0,0,114,163,0,0,0, +- 114,217,0,0,0,99,2,0,0,0,2,0,0,0,9,0, ++ 13,1,14,3,9,2,114,173,0,0,0,114,169,0,0,0, ++ 114,220,0,0,0,99,2,0,0,0,2,0,0,0,9,0, + 0,0,19,0,0,0,67,0,0,0,115,110,1,0,0,124, + 1,0,100,1,0,107,8,0,114,79,0,100,2,0,125,1, + 0,116,0,0,124,2,0,100,3,0,131,2,0,114,79,0, +@@ -1553,25 +1617,25 @@ + 117,115,116,32,116,97,107,101,32,97,32,115,112,101,99,32, + 97,115,32,105,116,115,32,111,110,108,121,32,95,95,105,110, + 105,116,95,95,40,41,32,97,114,103,46,10,10,32,32,32, +- 32,78,122,9,60,117,110,107,110,111,119,110,62,114,231,0, +- 0,0,114,214,0,0,0,84,114,216,0,0,0,114,71,0, +- 0,0,41,14,114,60,0,0,0,114,231,0,0,0,114,147, +- 0,0,0,114,213,0,0,0,114,218,0,0,0,218,27,95, ++ 32,78,122,9,60,117,110,107,110,111,119,110,62,114,237,0, ++ 0,0,114,217,0,0,0,84,114,219,0,0,0,114,84,0, ++ 0,0,41,14,114,60,0,0,0,114,237,0,0,0,114,153, ++ 0,0,0,114,216,0,0,0,114,221,0,0,0,218,27,95, + 103,101,116,95,115,117,112,112,111,114,116,101,100,95,102,105, +- 108,101,95,108,111,97,100,101,114,115,114,225,0,0,0,114, +- 226,0,0,0,114,163,0,0,0,218,9,95,80,79,80,85, +- 76,65,84,69,114,216,0,0,0,114,217,0,0,0,114,38, +- 0,0,0,114,220,0,0,0,41,9,114,67,0,0,0,218, +- 8,108,111,99,97,116,105,111,110,114,163,0,0,0,114,217, +- 0,0,0,114,172,0,0,0,218,12,108,111,97,100,101,114, +- 95,99,108,97,115,115,114,121,0,0,0,114,216,0,0,0, ++ 108,101,95,108,111,97,100,101,114,115,114,229,0,0,0,114, ++ 230,0,0,0,114,169,0,0,0,218,9,95,80,79,80,85, ++ 76,65,84,69,114,219,0,0,0,114,220,0,0,0,114,38, ++ 0,0,0,114,223,0,0,0,41,9,114,67,0,0,0,218, ++ 8,108,111,99,97,116,105,111,110,114,169,0,0,0,114,220, ++ 0,0,0,114,177,0,0,0,218,12,108,111,97,100,101,114, ++ 95,99,108,97,115,115,114,127,0,0,0,114,219,0,0,0, + 90,7,100,105,114,110,97,109,101,114,4,0,0,0,114,4, +- 0,0,0,114,5,0,0,0,114,232,0,0,0,84,3,0, ++ 0,0,0,114,5,0,0,0,114,238,0,0,0,106,3,0, + 0,115,60,0,0,0,0,12,12,4,6,1,15,2,3,1, + 19,1,13,1,11,8,21,1,9,3,12,1,22,1,21,1, + 15,1,9,1,8,2,7,3,12,2,15,1,3,1,19,1, + 13,1,5,2,6,1,18,2,9,1,15,1,6,1,16,1, +- 22,2,114,232,0,0,0,99,3,0,0,0,0,0,0,0, ++ 22,2,114,238,0,0,0,99,3,0,0,0,0,0,0,0, + 8,0,0,0,53,0,0,0,67,0,0,0,115,124,1,0, + 0,121,13,0,124,0,0,106,0,0,125,3,0,87,110,18, + 0,4,116,1,0,107,10,0,114,33,0,1,1,1,89,110, +@@ -1597,22 +1661,22 @@ + 0,0,107,8,0,114,93,1,100,2,0,110,3,0,100,3, + 0,124,3,0,95,10,0,124,6,0,124,3,0,95,11,0, + 124,7,0,124,3,0,95,12,0,124,3,0,83,41,4,78, +- 114,214,0,0,0,70,84,41,13,114,203,0,0,0,114,204, +- 0,0,0,114,57,0,0,0,114,199,0,0,0,114,205,0, ++ 114,217,0,0,0,70,84,41,13,114,208,0,0,0,114,209, ++ 0,0,0,114,57,0,0,0,114,204,0,0,0,114,210,0, + 0,0,90,7,95,79,82,73,71,73,78,218,10,95,95,99, + 97,99,104,101,100,95,95,218,4,108,105,115,116,218,8,95, +- 95,112,97,116,104,95,95,114,213,0,0,0,114,218,0,0, +- 0,114,222,0,0,0,114,217,0,0,0,41,8,114,174,0, +- 0,0,114,163,0,0,0,114,214,0,0,0,114,172,0,0, +- 0,114,67,0,0,0,114,235,0,0,0,114,222,0,0,0, +- 114,217,0,0,0,114,4,0,0,0,114,4,0,0,0,114, ++ 95,112,97,116,104,95,95,114,216,0,0,0,114,221,0,0, ++ 0,114,225,0,0,0,114,220,0,0,0,41,8,114,179,0, ++ 0,0,114,169,0,0,0,114,217,0,0,0,114,177,0,0, ++ 0,114,67,0,0,0,114,241,0,0,0,114,225,0,0,0, ++ 114,220,0,0,0,114,4,0,0,0,114,4,0,0,0,114, + 5,0,0,0,218,17,95,115,112,101,99,95,102,114,111,109, +- 95,109,111,100,117,108,101,148,3,0,0,115,72,0,0,0, ++ 95,109,111,100,117,108,101,170,3,0,0,115,72,0,0,0, + 0,2,3,1,13,1,13,1,5,2,12,1,4,2,9,1, + 12,1,3,1,13,1,13,2,8,1,3,1,13,1,13,1, + 11,1,12,1,12,1,3,1,13,1,13,1,14,2,9,1, + 3,1,13,1,13,1,11,1,3,1,19,1,13,1,11,2, +- 21,1,27,1,9,1,9,1,114,240,0,0,0,99,0,0, ++ 21,1,27,1,9,1,9,1,114,246,0,0,0,99,0,0, + 0,0,0,0,0,0,0,0,0,0,6,0,0,0,64,0, + 0,0,115,172,0,0,0,101,0,0,90,1,0,100,0,0, + 90,2,0,100,1,0,90,3,0,100,2,0,100,3,0,132, +@@ -1625,7 +1689,7 @@ + 20,0,100,21,0,132,0,0,90,12,0,100,22,0,100,23, + 0,132,0,0,90,13,0,100,24,0,100,25,0,132,0,0, + 90,14,0,100,26,0,100,27,0,132,0,0,90,15,0,100, +- 28,0,83,41,29,114,168,0,0,0,122,77,67,111,110,118, ++ 28,0,83,41,29,114,174,0,0,0,122,77,67,111,110,118, + 101,110,105,101,110,99,101,32,119,114,97,112,112,101,114,32, + 97,114,111,117,110,100,32,115,112,101,99,32,111,98,106,101, + 99,116,115,32,116,111,32,112,114,111,118,105,100,101,32,115, +@@ -1633,9 +1697,9 @@ + 32,109,101,116,104,111,100,115,46,99,2,0,0,0,0,0, + 0,0,2,0,0,0,2,0,0,0,67,0,0,0,115,13, + 0,0,0,124,1,0,124,0,0,95,0,0,100,0,0,83, +- 41,1,78,41,1,114,172,0,0,0,41,2,114,78,0,0, +- 0,114,172,0,0,0,114,4,0,0,0,114,4,0,0,0, +- 114,5,0,0,0,114,79,0,0,0,198,3,0,0,115,2, ++ 41,1,78,41,1,114,177,0,0,0,41,2,114,71,0,0, ++ 0,114,177,0,0,0,114,4,0,0,0,114,4,0,0,0, ++ 114,5,0,0,0,114,72,0,0,0,220,3,0,0,115,2, + 0,0,0,0,1,122,21,95,83,112,101,99,77,101,116,104, + 111,100,115,46,95,95,105,110,105,116,95,95,99,2,0,0, + 0,0,0,0,0,4,0,0,0,17,0,0,0,67,0,0, +@@ -1651,12 +1715,12 @@ + 2,0,131,1,0,83,41,2,122,41,67,114,101,97,116,101, + 32,97,32,115,112,101,99,32,102,114,111,109,32,97,32,109, + 111,100,117,108,101,39,115,32,97,116,116,114,105,98,117,116, +- 101,115,46,78,41,6,114,203,0,0,0,114,204,0,0,0, +- 114,199,0,0,0,218,10,95,102,105,110,100,95,115,112,101, +- 99,114,57,0,0,0,114,167,0,0,0,41,4,218,3,99, +- 108,115,114,174,0,0,0,114,172,0,0,0,114,163,0,0, ++ 101,115,46,78,41,6,114,208,0,0,0,114,209,0,0,0, ++ 114,204,0,0,0,218,10,95,102,105,110,100,95,115,112,101, ++ 99,114,57,0,0,0,114,173,0,0,0,41,4,218,3,99, ++ 108,115,114,179,0,0,0,114,177,0,0,0,114,169,0,0, + 0,114,4,0,0,0,114,4,0,0,0,114,5,0,0,0, +- 218,11,102,114,111,109,95,109,111,100,117,108,101,201,3,0, ++ 218,11,102,114,111,109,95,109,111,100,117,108,101,223,3,0, + 0,115,22,0,0,0,0,3,3,1,13,1,13,1,3,1, + 13,1,13,1,15,1,12,1,26,2,23,1,122,24,95,83, + 112,101,99,77,101,116,104,111,100,115,46,102,114,111,109,95, +@@ -1674,17 +1738,17 @@ + 124,1,0,106,2,0,131,2,0,83,100,1,0,83,41,7, + 122,38,82,101,116,117,114,110,32,116,104,101,32,114,101,112, + 114,32,116,111,32,117,115,101,32,102,111,114,32,116,104,101, +- 32,109,111,100,117,108,101,46,78,114,201,0,0,0,122,13, ++ 32,109,111,100,117,108,101,46,78,114,206,0,0,0,122,13, + 60,109,111,100,117,108,101,32,123,33,114,125,62,122,20,60, + 109,111,100,117,108,101,32,123,33,114,125,32,40,123,33,114, + 125,41,62,122,23,60,109,111,100,117,108,101,32,123,33,114, + 125,32,102,114,111,109,32,123,33,114,125,62,122,18,60,109, + 111,100,117,108,101,32,123,33,114,125,32,40,123,125,41,62, +- 41,6,114,172,0,0,0,114,67,0,0,0,114,214,0,0, +- 0,114,163,0,0,0,114,47,0,0,0,114,223,0,0,0, +- 41,3,114,78,0,0,0,114,172,0,0,0,114,67,0,0, ++ 41,6,114,177,0,0,0,114,67,0,0,0,114,217,0,0, ++ 0,114,169,0,0,0,114,47,0,0,0,114,226,0,0,0, ++ 41,3,114,71,0,0,0,114,177,0,0,0,114,67,0,0, + 0,114,4,0,0,0,114,4,0,0,0,114,5,0,0,0, +- 114,200,0,0,0,217,3,0,0,115,18,0,0,0,0,3, ++ 114,205,0,0,0,239,3,0,0,115,18,0,0,0,0,3, + 9,1,30,1,15,1,15,1,13,2,22,2,9,1,19,2, + 122,24,95,83,112,101,99,77,101,116,104,111,100,115,46,109, + 111,100,117,108,101,95,114,101,112,114,218,9,95,111,118,101, +@@ -1762,20 +1826,20 @@ + 99,97,116,105,111,110,115,32,45,62,32,109,111,100,117,108, + 101,46,95,95,112,97,116,104,95,95,32,40,105,102,32,115, + 101,116,41,10,10,32,32,32,32,32,32,32,32,114,57,0, +- 0,0,78,114,199,0,0,0,218,11,95,95,112,97,99,107, +- 97,103,101,95,95,114,239,0,0,0,114,205,0,0,0,114, +- 237,0,0,0,41,20,114,172,0,0,0,114,62,0,0,0, +- 114,67,0,0,0,114,57,0,0,0,114,204,0,0,0,114, +- 163,0,0,0,114,217,0,0,0,218,16,95,78,97,109,101, ++ 0,0,78,114,204,0,0,0,218,11,95,95,112,97,99,107, ++ 97,103,101,95,95,114,245,0,0,0,114,210,0,0,0,114, ++ 243,0,0,0,41,20,114,177,0,0,0,114,62,0,0,0, ++ 114,67,0,0,0,114,57,0,0,0,114,209,0,0,0,114, ++ 169,0,0,0,114,220,0,0,0,218,16,95,78,97,109,101, + 115,112,97,99,101,76,111,97,100,101,114,218,7,95,95,110, +- 101,119,95,95,218,5,95,112,97,116,104,114,199,0,0,0, +- 114,228,0,0,0,114,246,0,0,0,114,203,0,0,0,114, +- 239,0,0,0,114,223,0,0,0,114,214,0,0,0,114,205, +- 0,0,0,114,222,0,0,0,114,237,0,0,0,41,6,114, +- 78,0,0,0,114,174,0,0,0,114,244,0,0,0,114,245, +- 0,0,0,114,172,0,0,0,114,163,0,0,0,114,4,0, ++ 101,119,95,95,218,5,95,112,97,116,104,114,204,0,0,0, ++ 114,232,0,0,0,114,252,0,0,0,114,208,0,0,0,114, ++ 245,0,0,0,114,226,0,0,0,114,217,0,0,0,114,210, ++ 0,0,0,114,225,0,0,0,114,243,0,0,0,41,6,114, ++ 71,0,0,0,114,179,0,0,0,114,250,0,0,0,114,251, ++ 0,0,0,114,177,0,0,0,114,169,0,0,0,114,4,0, + 0,0,114,4,0,0,0,114,5,0,0,0,218,17,105,110, +- 105,116,95,109,111,100,117,108,101,95,97,116,116,114,115,233, ++ 105,116,95,109,111,100,117,108,101,95,97,116,116,114,115,255, + 3,0,0,115,88,0,0,0,0,17,9,6,12,1,24,1, + 3,1,16,1,13,1,8,3,30,1,9,1,12,2,15,1, + 15,1,18,1,3,1,13,1,13,1,8,3,30,1,3,1, +@@ -1802,12 +1866,12 @@ + 32,97,112,112,114,111,112,114,105,97,116,101,32,118,97,108, + 117,101,115,32,102,114,111,109,32,116,104,101,32,115,112,101, + 99,46,10,10,32,32,32,32,32,32,32,32,218,13,99,114, +- 101,97,116,101,95,109,111,100,117,108,101,78,41,7,114,172, +- 0,0,0,114,60,0,0,0,114,163,0,0,0,114,251,0, +- 0,0,114,68,0,0,0,114,67,0,0,0,114,250,0,0, +- 0,41,3,114,78,0,0,0,114,172,0,0,0,114,174,0, ++ 101,97,116,101,95,109,111,100,117,108,101,78,41,7,114,177, ++ 0,0,0,114,60,0,0,0,114,169,0,0,0,114,1,1, ++ 0,0,114,68,0,0,0,114,67,0,0,0,114,0,1,0, ++ 0,41,3,114,71,0,0,0,114,177,0,0,0,114,179,0, + 0,0,114,4,0,0,0,114,4,0,0,0,114,5,0,0, +- 0,218,6,99,114,101,97,116,101,57,4,0,0,115,16,0, ++ 0,218,6,99,114,101,97,116,101,79,4,0,0,115,16,0, + 0,0,0,7,9,2,18,3,21,2,6,1,12,4,18,1, + 13,1,122,19,95,83,112,101,99,77,101,116,104,111,100,115, + 46,99,114,101,97,116,101,99,2,0,0,0,0,0,0,0, +@@ -1825,11 +1889,11 @@ + 101,116,104,111,100,32,117,115,101,115,32,116,104,101,32,108, + 111,97,100,101,114,39,115,32,96,101,120,101,99,95,109,111, + 100,117,108,101,40,41,96,32,109,101,116,104,111,100,46,10, +- 10,32,32,32,32,32,32,32,32,78,41,3,114,172,0,0, +- 0,114,163,0,0,0,218,11,101,120,101,99,95,109,111,100, +- 117,108,101,41,2,114,78,0,0,0,114,174,0,0,0,114, ++ 10,32,32,32,32,32,32,32,32,78,41,3,114,177,0,0, ++ 0,114,169,0,0,0,218,11,101,120,101,99,95,109,111,100, ++ 117,108,101,41,2,114,71,0,0,0,114,179,0,0,0,114, + 4,0,0,0,114,4,0,0,0,114,5,0,0,0,218,5, +- 95,101,120,101,99,80,4,0,0,115,2,0,0,0,0,7, ++ 95,101,120,101,99,102,4,0,0,115,2,0,0,0,0,7, + 122,18,95,83,112,101,99,77,101,116,104,111,100,115,46,95, + 101,120,101,99,99,2,0,0,0,0,0,0,0,4,0,0, + 0,11,0,0,0,67,0,0,0,115,17,1,0,0,124,0, +@@ -1856,17 +1920,17 @@ + 115,112,97,99,101,46,122,30,109,111,100,117,108,101,32,123, + 33,114,125,32,110,111,116,32,105,110,32,115,121,115,46,109, + 111,100,117,108,101,115,114,67,0,0,0,78,122,14,109,105, +- 115,115,105,110,103,32,108,111,97,100,101,114,114,244,0,0, +- 0,84,114,253,0,0,0,41,16,114,172,0,0,0,114,67, +- 0,0,0,114,96,0,0,0,218,12,97,99,113,117,105,114, +- 101,95,108,111,99,107,114,92,0,0,0,114,7,0,0,0, +- 114,169,0,0,0,114,82,0,0,0,114,47,0,0,0,114, +- 147,0,0,0,114,163,0,0,0,114,217,0,0,0,114,250, +- 0,0,0,114,60,0,0,0,218,11,108,111,97,100,95,109, +- 111,100,117,108,101,114,254,0,0,0,41,4,114,78,0,0, +- 0,114,174,0,0,0,114,67,0,0,0,114,165,0,0,0, ++ 115,115,105,110,103,32,108,111,97,100,101,114,114,250,0,0, ++ 0,84,114,3,1,0,0,41,16,114,177,0,0,0,114,67, ++ 0,0,0,114,106,0,0,0,218,12,97,99,113,117,105,114, ++ 101,95,108,111,99,107,114,103,0,0,0,114,7,0,0,0, ++ 114,73,0,0,0,114,93,0,0,0,114,47,0,0,0,114, ++ 153,0,0,0,114,169,0,0,0,114,220,0,0,0,114,0, ++ 1,0,0,114,60,0,0,0,218,11,108,111,97,100,95,109, ++ 111,100,117,108,101,114,4,1,0,0,41,4,114,71,0,0, ++ 0,114,179,0,0,0,114,67,0,0,0,114,171,0,0,0, + 114,4,0,0,0,114,4,0,0,0,114,5,0,0,0,114, +- 170,0,0,0,90,4,0,0,115,32,0,0,0,0,2,12, ++ 175,0,0,0,112,4,0,0,115,32,0,0,0,0,2,12, + 1,10,1,13,1,24,1,15,1,21,1,18,1,18,1,27, + 2,19,1,4,1,19,1,21,2,22,2,19,1,122,17,95, + 83,112,101,99,77,101,116,104,111,100,115,46,101,120,101,99, +@@ -1889,17 +1953,17 @@ + 100,0,0,107,8,0,114,20,1,121,13,0,124,1,0,124, + 2,0,95,13,0,87,113,20,1,4,116,8,0,107,10,0, + 114,16,1,1,1,1,89,113,20,1,88,110,0,0,124,2, +- 0,83,41,7,78,114,199,0,0,0,114,246,0,0,0,114, +- 239,0,0,0,114,110,0,0,0,114,71,0,0,0,114,203, +- 0,0,0,41,14,114,172,0,0,0,114,163,0,0,0,114, +- 0,1,0,0,114,67,0,0,0,114,7,0,0,0,114,169, +- 0,0,0,114,62,0,0,0,114,199,0,0,0,114,204,0, +- 0,0,114,57,0,0,0,114,246,0,0,0,114,60,0,0, +- 0,114,32,0,0,0,114,203,0,0,0,41,3,114,78,0, +- 0,0,114,172,0,0,0,114,174,0,0,0,114,4,0,0, ++ 0,83,41,7,78,114,204,0,0,0,114,252,0,0,0,114, ++ 245,0,0,0,114,116,0,0,0,114,84,0,0,0,114,208, ++ 0,0,0,41,14,114,177,0,0,0,114,169,0,0,0,114, ++ 6,1,0,0,114,67,0,0,0,114,7,0,0,0,114,73, ++ 0,0,0,114,62,0,0,0,114,204,0,0,0,114,209,0, ++ 0,0,114,57,0,0,0,114,252,0,0,0,114,60,0,0, ++ 0,114,32,0,0,0,114,208,0,0,0,41,3,114,71,0, ++ 0,0,114,177,0,0,0,114,179,0,0,0,114,4,0,0, + 0,114,4,0,0,0,114,5,0,0,0,218,25,95,108,111, + 97,100,95,98,97,99,107,119,97,114,100,95,99,111,109,112, +- 97,116,105,98,108,101,112,4,0,0,115,42,0,0,0,0, ++ 97,116,105,98,108,101,134,4,0,0,115,42,0,0,0,0, + 2,9,2,19,1,16,1,24,1,3,1,16,1,13,1,8, + 1,24,1,3,4,12,1,15,1,32,1,13,1,8,1,24, + 1,3,1,13,1,13,1,8,1,122,38,95,83,112,101,99, +@@ -1913,11 +1977,11 @@ + 101,99,39,101,100,32,109,111,100,117,108,101,32,105,110,116, + 111,32,97,110,32,101,120,105,115,116,105,110,103,32,109,111, + 100,117,108,101,39,115,32,110,97,109,101,115,112,97,99,101, +- 46,78,41,2,114,207,0,0,0,114,170,0,0,0,41,3, +- 114,78,0,0,0,114,174,0,0,0,90,6,108,111,97,100, ++ 46,78,41,2,114,212,0,0,0,114,175,0,0,0,41,3, ++ 114,71,0,0,0,114,179,0,0,0,90,6,108,111,97,100, + 101,100,114,4,0,0,0,114,4,0,0,0,114,5,0,0, + 0,218,14,95,108,111,97,100,95,101,120,105,115,116,105,110, +- 103,142,4,0,0,115,6,0,0,0,0,3,13,1,21,1, ++ 103,164,4,0,0,115,6,0,0,0,0,3,13,1,21,1, + 122,27,95,83,112,101,99,77,101,116,104,111,100,115,46,95, + 108,111,97,100,95,101,120,105,115,116,105,110,103,99,1,0, + 0,0,0,0,0,0,2,0,0,0,11,0,0,0,67,0, +@@ -1932,16 +1996,16 @@ + 0,124,0,0,106,0,0,106,8,0,131,1,1,130,1,0, + 113,156,0,110,13,0,124,0,0,106,9,0,124,1,0,131, + 1,0,1,87,100,0,0,81,88,116,10,0,106,11,0,124, +- 0,0,106,0,0,106,8,0,25,83,41,4,78,114,253,0, ++ 0,0,106,0,0,106,8,0,25,83,41,4,78,114,3,1, + 0,0,122,14,109,105,115,115,105,110,103,32,108,111,97,100, +- 101,114,114,67,0,0,0,41,12,114,172,0,0,0,114,163, +- 0,0,0,114,60,0,0,0,114,1,1,0,0,114,252,0, +- 0,0,114,207,0,0,0,114,217,0,0,0,114,147,0,0, +- 0,114,67,0,0,0,114,254,0,0,0,114,7,0,0,0, +- 114,169,0,0,0,41,2,114,78,0,0,0,114,174,0,0, ++ 101,114,114,67,0,0,0,41,12,114,177,0,0,0,114,169, ++ 0,0,0,114,60,0,0,0,114,7,1,0,0,114,2,1, ++ 0,0,114,212,0,0,0,114,220,0,0,0,114,153,0,0, ++ 0,114,67,0,0,0,114,4,1,0,0,114,7,0,0,0, ++ 114,73,0,0,0,41,2,114,71,0,0,0,114,179,0,0, + 0,114,4,0,0,0,114,4,0,0,0,114,5,0,0,0, + 218,14,95,108,111,97,100,95,117,110,108,111,99,107,101,100, +- 149,4,0,0,115,20,0,0,0,0,2,18,2,21,1,13, ++ 171,4,0,0,115,20,0,0,0,0,2,18,2,21,1,13, + 2,12,1,13,1,18,1,18,1,30,3,19,5,122,27,95, + 83,112,101,99,77,101,116,104,111,100,115,46,95,108,111,97, + 100,95,117,110,108,111,99,107,101,100,99,1,0,0,0,0, +@@ -1962,2265 +2026,2239 @@ + 44,32,116,104,97,116,32,101,120,105,115,116,105,110,103,32, + 109,111,100,117,108,101,32,103,101,116,115,10,32,32,32,32, + 32,32,32,32,99,108,111,98,98,101,114,101,100,46,10,10, +- 32,32,32,32,32,32,32,32,78,41,6,114,96,0,0,0, +- 114,255,0,0,0,114,92,0,0,0,114,172,0,0,0,114, +- 67,0,0,0,114,3,1,0,0,41,1,114,78,0,0,0, ++ 32,32,32,32,32,32,32,32,78,41,6,114,106,0,0,0, ++ 114,5,1,0,0,114,103,0,0,0,114,177,0,0,0,114, ++ 67,0,0,0,114,9,1,0,0,41,1,114,71,0,0,0, + 114,4,0,0,0,114,4,0,0,0,114,5,0,0,0,114, +- 171,0,0,0,172,4,0,0,115,6,0,0,0,0,9,10, ++ 176,0,0,0,194,4,0,0,115,6,0,0,0,0,9,10, + 1,19,1,122,17,95,83,112,101,99,77,101,116,104,111,100, + 115,46,108,111,97,100,78,41,16,114,57,0,0,0,114,56, +- 0,0,0,114,58,0,0,0,114,59,0,0,0,114,79,0, ++ 0,0,0,114,58,0,0,0,114,59,0,0,0,114,72,0, + 0,0,218,11,99,108,97,115,115,109,101,116,104,111,100,114, +- 243,0,0,0,114,200,0,0,0,114,250,0,0,0,114,252, +- 0,0,0,114,254,0,0,0,114,170,0,0,0,114,1,1, +- 0,0,114,2,1,0,0,114,3,1,0,0,114,171,0,0, ++ 249,0,0,0,114,205,0,0,0,114,0,1,0,0,114,2, ++ 1,0,0,114,4,1,0,0,114,175,0,0,0,114,7,1, ++ 0,0,114,8,1,0,0,114,9,1,0,0,114,176,0,0, + 0,114,4,0,0,0,114,4,0,0,0,114,4,0,0,0, +- 114,5,0,0,0,114,168,0,0,0,193,3,0,0,115,24, ++ 114,5,0,0,0,114,174,0,0,0,215,3,0,0,115,24, + 0,0,0,12,3,6,2,12,3,18,16,12,16,24,80,12, +- 23,12,10,12,22,12,30,12,7,12,23,114,168,0,0,0, ++ 23,12,10,12,22,12,30,12,7,12,23,114,174,0,0,0, + 99,0,0,0,0,0,0,0,0,0,0,0,0,5,0,0, +- 0,64,0,0,0,115,193,0,0,0,101,0,0,90,1,0, ++ 0,64,0,0,0,115,181,0,0,0,101,0,0,90,1,0, + 100,0,0,90,2,0,100,1,0,90,3,0,101,4,0,100, + 2,0,100,3,0,132,0,0,131,1,0,90,5,0,101,6, + 0,100,4,0,100,4,0,100,5,0,100,6,0,132,2,0, + 131,1,0,90,7,0,101,6,0,100,4,0,100,7,0,100, +- 8,0,132,1,0,131,1,0,90,8,0,101,4,0,100,9, +- 0,100,10,0,132,0,0,131,1,0,90,9,0,101,6,0, +- 100,11,0,100,12,0,132,0,0,131,1,0,90,10,0,101, +- 6,0,101,11,0,100,13,0,100,14,0,132,0,0,131,1, +- 0,131,1,0,90,12,0,101,6,0,101,11,0,100,15,0, +- 100,16,0,132,0,0,131,1,0,131,1,0,90,13,0,101, +- 6,0,101,11,0,100,17,0,100,18,0,132,0,0,131,1, +- 0,131,1,0,90,14,0,100,4,0,83,41,19,218,15,66, +- 117,105,108,116,105,110,73,109,112,111,114,116,101,114,122,144, +- 77,101,116,97,32,112,97,116,104,32,105,109,112,111,114,116, +- 32,102,111,114,32,98,117,105,108,116,45,105,110,32,109,111, +- 100,117,108,101,115,46,10,10,32,32,32,32,65,108,108,32, +- 109,101,116,104,111,100,115,32,97,114,101,32,101,105,116,104, +- 101,114,32,99,108,97,115,115,32,111,114,32,115,116,97,116, +- 105,99,32,109,101,116,104,111,100,115,32,116,111,32,97,118, +- 111,105,100,32,116,104,101,32,110,101,101,100,32,116,111,10, +- 32,32,32,32,105,110,115,116,97,110,116,105,97,116,101,32, +- 116,104,101,32,99,108,97,115,115,46,10,10,32,32,32,32, +- 99,1,0,0,0,0,0,0,0,1,0,0,0,2,0,0, +- 0,67,0,0,0,115,16,0,0,0,100,1,0,106,0,0, +- 124,0,0,106,1,0,131,1,0,83,41,2,78,122,24,60, +- 109,111,100,117,108,101,32,123,33,114,125,32,40,98,117,105, +- 108,116,45,105,110,41,62,41,2,114,47,0,0,0,114,57, +- 0,0,0,41,1,114,174,0,0,0,114,4,0,0,0,114, +- 4,0,0,0,114,5,0,0,0,114,200,0,0,0,197,4, +- 0,0,115,2,0,0,0,0,3,122,27,66,117,105,108,116, +- 105,110,73,109,112,111,114,116,101,114,46,109,111,100,117,108, +- 101,95,114,101,112,114,78,99,4,0,0,0,0,0,0,0, +- 4,0,0,0,5,0,0,0,67,0,0,0,115,58,0,0, +- 0,124,2,0,100,0,0,107,9,0,114,16,0,100,0,0, +- 83,116,0,0,106,1,0,124,1,0,131,1,0,114,50,0, +- 116,2,0,124,1,0,124,0,0,100,1,0,100,2,0,131, +- 2,1,83,100,0,0,83,100,0,0,83,41,3,78,114,214, +- 0,0,0,122,8,98,117,105,108,116,45,105,110,41,3,114, +- 96,0,0,0,218,10,105,115,95,98,117,105,108,116,105,110, +- 114,167,0,0,0,41,4,114,242,0,0,0,114,152,0,0, +- 0,114,35,0,0,0,218,6,116,97,114,103,101,116,114,4, +- 0,0,0,114,4,0,0,0,114,5,0,0,0,218,9,102, +- 105,110,100,95,115,112,101,99,202,4,0,0,115,10,0,0, +- 0,0,2,12,1,4,1,15,1,19,2,122,25,66,117,105, +- 108,116,105,110,73,109,112,111,114,116,101,114,46,102,105,110, +- 100,95,115,112,101,99,99,3,0,0,0,0,0,0,0,4, +- 0,0,0,3,0,0,0,67,0,0,0,115,41,0,0,0, +- 124,0,0,106,0,0,124,1,0,124,2,0,131,2,0,125, +- 3,0,124,3,0,100,1,0,107,9,0,114,37,0,124,3, +- 0,106,1,0,83,100,1,0,83,41,2,122,113,70,105,110, +- 100,32,116,104,101,32,98,117,105,108,116,45,105,110,32,109, +- 111,100,117,108,101,46,10,10,32,32,32,32,32,32,32,32, +- 73,102,32,39,112,97,116,104,39,32,105,115,32,101,118,101, +- 114,32,115,112,101,99,105,102,105,101,100,32,116,104,101,110, +- 32,116,104,101,32,115,101,97,114,99,104,32,105,115,32,99, +- 111,110,115,105,100,101,114,101,100,32,97,32,102,97,105,108, +- 117,114,101,46,10,10,32,32,32,32,32,32,32,32,78,41, +- 2,114,8,1,0,0,114,163,0,0,0,41,4,114,242,0, +- 0,0,114,152,0,0,0,114,35,0,0,0,114,172,0,0, +- 0,114,4,0,0,0,114,4,0,0,0,114,5,0,0,0, +- 218,11,102,105,110,100,95,109,111,100,117,108,101,211,4,0, +- 0,115,4,0,0,0,0,7,18,1,122,27,66,117,105,108, +- 116,105,110,73,109,112,111,114,116,101,114,46,102,105,110,100, +- 95,109,111,100,117,108,101,99,1,0,0,0,0,0,0,0, +- 3,0,0,0,4,0,0,0,67,0,0,0,115,109,0,0, +- 0,124,0,0,106,0,0,125,1,0,124,1,0,106,1,0, +- 125,2,0,116,2,0,106,3,0,124,2,0,131,1,0,115, +- 63,0,116,4,0,100,1,0,106,5,0,124,2,0,131,1, +- 0,100,2,0,124,2,0,131,1,1,130,1,0,110,0,0, +- 116,6,0,116,2,0,106,7,0,124,2,0,131,2,0,1, +- 116,8,0,124,1,0,131,1,0,106,9,0,116,10,0,106, +- 11,0,124,2,0,25,131,1,0,1,100,0,0,83,41,3, +- 78,122,29,123,33,114,125,32,105,115,32,110,111,116,32,97, +- 32,98,117,105,108,116,45,105,110,32,109,111,100,117,108,101, +- 114,67,0,0,0,41,12,114,203,0,0,0,114,67,0,0, +- 0,114,96,0,0,0,114,6,1,0,0,114,147,0,0,0, +- 114,47,0,0,0,114,108,0,0,0,90,12,105,110,105,116, +- 95,98,117,105,108,116,105,110,114,168,0,0,0,114,250,0, +- 0,0,114,7,0,0,0,114,169,0,0,0,41,3,114,174, +- 0,0,0,114,172,0,0,0,114,67,0,0,0,114,4,0, +- 0,0,114,4,0,0,0,114,5,0,0,0,114,253,0,0, +- 0,221,4,0,0,115,14,0,0,0,0,2,9,1,9,1, +- 15,1,18,1,12,1,16,4,122,27,66,117,105,108,116,105, +- 110,73,109,112,111,114,116,101,114,46,101,120,101,99,95,109, +- 111,100,117,108,101,99,2,0,0,0,0,0,0,0,2,0, +- 0,0,3,0,0,0,67,0,0,0,115,13,0,0,0,116, +- 0,0,124,0,0,124,1,0,131,2,0,83,41,1,122,23, +- 76,111,97,100,32,97,32,98,117,105,108,116,45,105,110,32, +- 109,111,100,117,108,101,46,41,1,114,175,0,0,0,41,2, +- 114,242,0,0,0,114,152,0,0,0,114,4,0,0,0,114, +- 4,0,0,0,114,5,0,0,0,114,0,1,0,0,234,4, +- 0,0,115,2,0,0,0,0,3,122,27,66,117,105,108,116, +- 105,110,73,109,112,111,114,116,101,114,46,108,111,97,100,95, +- 109,111,100,117,108,101,99,2,0,0,0,0,0,0,0,2, +- 0,0,0,1,0,0,0,67,0,0,0,115,4,0,0,0, +- 100,1,0,83,41,2,122,57,82,101,116,117,114,110,32,78, +- 111,110,101,32,97,115,32,98,117,105,108,116,45,105,110,32, +- 109,111,100,117,108,101,115,32,100,111,32,110,111,116,32,104, +- 97,118,101,32,99,111,100,101,32,111,98,106,101,99,116,115, +- 46,78,114,4,0,0,0,41,2,114,242,0,0,0,114,152, +- 0,0,0,114,4,0,0,0,114,4,0,0,0,114,5,0, +- 0,0,218,8,103,101,116,95,99,111,100,101,239,4,0,0, +- 115,2,0,0,0,0,4,122,24,66,117,105,108,116,105,110, +- 73,109,112,111,114,116,101,114,46,103,101,116,95,99,111,100, +- 101,99,2,0,0,0,0,0,0,0,2,0,0,0,1,0, +- 0,0,67,0,0,0,115,4,0,0,0,100,1,0,83,41, +- 2,122,56,82,101,116,117,114,110,32,78,111,110,101,32,97, +- 115,32,98,117,105,108,116,45,105,110,32,109,111,100,117,108, +- 101,115,32,100,111,32,110,111,116,32,104,97,118,101,32,115, +- 111,117,114,99,101,32,99,111,100,101,46,78,114,4,0,0, +- 0,41,2,114,242,0,0,0,114,152,0,0,0,114,4,0, +- 0,0,114,4,0,0,0,114,5,0,0,0,218,10,103,101, +- 116,95,115,111,117,114,99,101,245,4,0,0,115,2,0,0, +- 0,0,4,122,26,66,117,105,108,116,105,110,73,109,112,111, +- 114,116,101,114,46,103,101,116,95,115,111,117,114,99,101,99, ++ 8,0,132,1,0,131,1,0,90,8,0,101,6,0,101,9, ++ 0,100,9,0,100,10,0,132,0,0,131,1,0,131,1,0, ++ 90,10,0,101,6,0,101,9,0,100,11,0,100,12,0,132, ++ 0,0,131,1,0,131,1,0,90,11,0,101,6,0,101,9, ++ 0,100,13,0,100,14,0,132,0,0,131,1,0,131,1,0, ++ 90,12,0,101,6,0,101,9,0,100,15,0,100,16,0,132, ++ 0,0,131,1,0,131,1,0,90,13,0,100,4,0,83,41, ++ 17,218,15,66,117,105,108,116,105,110,73,109,112,111,114,116, ++ 101,114,122,144,77,101,116,97,32,112,97,116,104,32,105,109, ++ 112,111,114,116,32,102,111,114,32,98,117,105,108,116,45,105, ++ 110,32,109,111,100,117,108,101,115,46,10,10,32,32,32,32, ++ 65,108,108,32,109,101,116,104,111,100,115,32,97,114,101,32, ++ 101,105,116,104,101,114,32,99,108,97,115,115,32,111,114,32, ++ 115,116,97,116,105,99,32,109,101,116,104,111,100,115,32,116, ++ 111,32,97,118,111,105,100,32,116,104,101,32,110,101,101,100, ++ 32,116,111,10,32,32,32,32,105,110,115,116,97,110,116,105, ++ 97,116,101,32,116,104,101,32,99,108,97,115,115,46,10,10, ++ 32,32,32,32,99,1,0,0,0,0,0,0,0,1,0,0, ++ 0,2,0,0,0,67,0,0,0,115,16,0,0,0,100,1, ++ 0,106,0,0,124,0,0,106,1,0,131,1,0,83,41,2, ++ 78,122,24,60,109,111,100,117,108,101,32,123,33,114,125,32, ++ 40,98,117,105,108,116,45,105,110,41,62,41,2,114,47,0, ++ 0,0,114,57,0,0,0,41,1,114,179,0,0,0,114,4, ++ 0,0,0,114,4,0,0,0,114,5,0,0,0,114,205,0, ++ 0,0,219,4,0,0,115,2,0,0,0,0,3,122,27,66, ++ 117,105,108,116,105,110,73,109,112,111,114,116,101,114,46,109, ++ 111,100,117,108,101,95,114,101,112,114,78,99,4,0,0,0, ++ 0,0,0,0,4,0,0,0,5,0,0,0,67,0,0,0, ++ 115,58,0,0,0,124,2,0,100,0,0,107,9,0,114,16, ++ 0,100,0,0,83,116,0,0,106,1,0,124,1,0,131,1, ++ 0,114,50,0,116,2,0,124,1,0,124,0,0,100,1,0, ++ 100,2,0,131,2,1,83,100,0,0,83,100,0,0,83,41, ++ 3,78,114,217,0,0,0,122,8,98,117,105,108,116,45,105, ++ 110,41,3,114,106,0,0,0,90,10,105,115,95,98,117,105, ++ 108,116,105,110,114,173,0,0,0,41,4,114,248,0,0,0, ++ 114,158,0,0,0,114,35,0,0,0,218,6,116,97,114,103, ++ 101,116,114,4,0,0,0,114,4,0,0,0,114,5,0,0, ++ 0,218,9,102,105,110,100,95,115,112,101,99,224,4,0,0, ++ 115,10,0,0,0,0,2,12,1,4,1,15,1,19,2,122, ++ 25,66,117,105,108,116,105,110,73,109,112,111,114,116,101,114, ++ 46,102,105,110,100,95,115,112,101,99,99,3,0,0,0,0, ++ 0,0,0,4,0,0,0,3,0,0,0,67,0,0,0,115, ++ 41,0,0,0,124,0,0,106,0,0,124,1,0,124,2,0, ++ 131,2,0,125,3,0,124,3,0,100,1,0,107,9,0,114, ++ 37,0,124,3,0,106,1,0,83,100,1,0,83,41,2,122, ++ 113,70,105,110,100,32,116,104,101,32,98,117,105,108,116,45, ++ 105,110,32,109,111,100,117,108,101,46,10,10,32,32,32,32, ++ 32,32,32,32,73,102,32,39,112,97,116,104,39,32,105,115, ++ 32,101,118,101,114,32,115,112,101,99,105,102,105,101,100,32, ++ 116,104,101,110,32,116,104,101,32,115,101,97,114,99,104,32, ++ 105,115,32,99,111,110,115,105,100,101,114,101,100,32,97,32, ++ 102,97,105,108,117,114,101,46,10,10,32,32,32,32,32,32, ++ 32,32,78,41,2,114,13,1,0,0,114,169,0,0,0,41, ++ 4,114,248,0,0,0,114,158,0,0,0,114,35,0,0,0, ++ 114,177,0,0,0,114,4,0,0,0,114,4,0,0,0,114, ++ 5,0,0,0,218,11,102,105,110,100,95,109,111,100,117,108, ++ 101,233,4,0,0,115,4,0,0,0,0,7,18,1,122,27, ++ 66,117,105,108,116,105,110,73,109,112,111,114,116,101,114,46, ++ 102,105,110,100,95,109,111,100,117,108,101,99,2,0,0,0, ++ 0,0,0,0,3,0,0,0,10,0,0,0,67,0,0,0, ++ 115,59,0,0,0,116,0,0,124,1,0,131,1,0,143,23, ++ 0,1,116,1,0,116,2,0,106,3,0,124,1,0,131,2, ++ 0,125,2,0,87,100,1,0,81,88,124,0,0,124,2,0, ++ 95,4,0,100,2,0,124,2,0,95,5,0,124,2,0,83, ++ 41,3,122,23,76,111,97,100,32,97,32,98,117,105,108,116, ++ 45,105,110,32,109,111,100,117,108,101,46,78,114,30,0,0, ++ 0,41,6,114,69,0,0,0,114,114,0,0,0,114,106,0, ++ 0,0,90,12,105,110,105,116,95,98,117,105,108,116,105,110, ++ 114,204,0,0,0,114,252,0,0,0,41,3,114,248,0,0, ++ 0,114,158,0,0,0,114,179,0,0,0,114,4,0,0,0, ++ 114,4,0,0,0,114,5,0,0,0,114,6,1,0,0,243, ++ 4,0,0,115,10,0,0,0,0,4,13,1,24,1,9,1, ++ 9,1,122,27,66,117,105,108,116,105,110,73,109,112,111,114, ++ 116,101,114,46,108,111,97,100,95,109,111,100,117,108,101,99, + 2,0,0,0,0,0,0,0,2,0,0,0,1,0,0,0, + 67,0,0,0,115,4,0,0,0,100,1,0,83,41,2,122, +- 52,82,101,116,117,114,110,32,70,97,108,115,101,32,97,115, +- 32,98,117,105,108,116,45,105,110,32,109,111,100,117,108,101, +- 115,32,97,114,101,32,110,101,118,101,114,32,112,97,99,107, +- 97,103,101,115,46,70,114,4,0,0,0,41,2,114,242,0, +- 0,0,114,152,0,0,0,114,4,0,0,0,114,4,0,0, +- 0,114,5,0,0,0,114,216,0,0,0,251,4,0,0,115, +- 2,0,0,0,0,5,122,26,66,117,105,108,116,105,110,73, ++ 57,82,101,116,117,114,110,32,78,111,110,101,32,97,115,32, ++ 98,117,105,108,116,45,105,110,32,109,111,100,117,108,101,115, ++ 32,100,111,32,110,111,116,32,104,97,118,101,32,99,111,100, ++ 101,32,111,98,106,101,99,116,115,46,78,114,4,0,0,0, ++ 41,2,114,248,0,0,0,114,158,0,0,0,114,4,0,0, ++ 0,114,4,0,0,0,114,5,0,0,0,218,8,103,101,116, ++ 95,99,111,100,101,253,4,0,0,115,2,0,0,0,0,4, ++ 122,24,66,117,105,108,116,105,110,73,109,112,111,114,116,101, ++ 114,46,103,101,116,95,99,111,100,101,99,2,0,0,0,0, ++ 0,0,0,2,0,0,0,1,0,0,0,67,0,0,0,115, ++ 4,0,0,0,100,1,0,83,41,2,122,56,82,101,116,117, ++ 114,110,32,78,111,110,101,32,97,115,32,98,117,105,108,116, ++ 45,105,110,32,109,111,100,117,108,101,115,32,100,111,32,110, ++ 111,116,32,104,97,118,101,32,115,111,117,114,99,101,32,99, ++ 111,100,101,46,78,114,4,0,0,0,41,2,114,248,0,0, ++ 0,114,158,0,0,0,114,4,0,0,0,114,4,0,0,0, ++ 114,5,0,0,0,218,10,103,101,116,95,115,111,117,114,99, ++ 101,3,5,0,0,115,2,0,0,0,0,4,122,26,66,117, ++ 105,108,116,105,110,73,109,112,111,114,116,101,114,46,103,101, ++ 116,95,115,111,117,114,99,101,99,2,0,0,0,0,0,0, ++ 0,2,0,0,0,1,0,0,0,67,0,0,0,115,4,0, ++ 0,0,100,1,0,83,41,2,122,52,82,101,116,117,114,110, ++ 32,70,97,108,115,101,32,97,115,32,98,117,105,108,116,45, ++ 105,110,32,109,111,100,117,108,101,115,32,97,114,101,32,110, ++ 101,118,101,114,32,112,97,99,107,97,103,101,115,46,70,114, ++ 4,0,0,0,41,2,114,248,0,0,0,114,158,0,0,0, ++ 114,4,0,0,0,114,4,0,0,0,114,5,0,0,0,114, ++ 219,0,0,0,9,5,0,0,115,2,0,0,0,0,5,122, ++ 26,66,117,105,108,116,105,110,73,109,112,111,114,116,101,114, ++ 46,105,115,95,112,97,99,107,97,103,101,41,14,114,57,0, ++ 0,0,114,56,0,0,0,114,58,0,0,0,114,59,0,0, ++ 0,218,12,115,116,97,116,105,99,109,101,116,104,111,100,114, ++ 205,0,0,0,114,10,1,0,0,114,13,1,0,0,114,14, ++ 1,0,0,114,161,0,0,0,114,6,1,0,0,114,15,1, ++ 0,0,114,16,1,0,0,114,219,0,0,0,114,4,0,0, ++ 0,114,4,0,0,0,114,4,0,0,0,114,5,0,0,0, ++ 114,11,1,0,0,210,4,0,0,115,28,0,0,0,12,7, ++ 6,2,18,5,3,1,21,8,3,1,18,9,3,1,21,9, ++ 3,1,21,5,3,1,21,5,3,1,114,11,1,0,0,99, ++ 0,0,0,0,0,0,0,0,0,0,0,0,5,0,0,0, ++ 64,0,0,0,115,193,0,0,0,101,0,0,90,1,0,100, ++ 0,0,90,2,0,100,1,0,90,3,0,101,4,0,100,2, ++ 0,100,3,0,132,0,0,131,1,0,90,5,0,101,6,0, ++ 100,4,0,100,4,0,100,5,0,100,6,0,132,2,0,131, ++ 1,0,90,7,0,101,6,0,100,4,0,100,7,0,100,8, ++ 0,132,1,0,131,1,0,90,8,0,101,4,0,100,9,0, ++ 100,10,0,132,0,0,131,1,0,90,9,0,101,6,0,100, ++ 11,0,100,12,0,132,0,0,131,1,0,90,10,0,101,6, ++ 0,101,11,0,100,13,0,100,14,0,132,0,0,131,1,0, ++ 131,1,0,90,12,0,101,6,0,101,11,0,100,15,0,100, ++ 16,0,132,0,0,131,1,0,131,1,0,90,13,0,101,6, ++ 0,101,11,0,100,17,0,100,18,0,132,0,0,131,1,0, ++ 131,1,0,90,14,0,100,4,0,83,41,19,218,14,70,114, ++ 111,122,101,110,73,109,112,111,114,116,101,114,122,142,77,101, ++ 116,97,32,112,97,116,104,32,105,109,112,111,114,116,32,102, ++ 111,114,32,102,114,111,122,101,110,32,109,111,100,117,108,101, ++ 115,46,10,10,32,32,32,32,65,108,108,32,109,101,116,104, ++ 111,100,115,32,97,114,101,32,101,105,116,104,101,114,32,99, ++ 108,97,115,115,32,111,114,32,115,116,97,116,105,99,32,109, ++ 101,116,104,111,100,115,32,116,111,32,97,118,111,105,100,32, ++ 116,104,101,32,110,101,101,100,32,116,111,10,32,32,32,32, ++ 105,110,115,116,97,110,116,105,97,116,101,32,116,104,101,32, ++ 99,108,97,115,115,46,10,10,32,32,32,32,99,1,0,0, ++ 0,0,0,0,0,1,0,0,0,2,0,0,0,67,0,0, ++ 0,115,16,0,0,0,100,1,0,106,0,0,124,0,0,106, ++ 1,0,131,1,0,83,41,2,78,122,22,60,109,111,100,117, ++ 108,101,32,123,33,114,125,32,40,102,114,111,122,101,110,41, ++ 62,41,2,114,47,0,0,0,114,57,0,0,0,41,1,218, ++ 1,109,114,4,0,0,0,114,4,0,0,0,114,5,0,0, ++ 0,114,205,0,0,0,26,5,0,0,115,2,0,0,0,0, ++ 3,122,26,70,114,111,122,101,110,73,109,112,111,114,116,101, ++ 114,46,109,111,100,117,108,101,95,114,101,112,114,78,99,4, ++ 0,0,0,0,0,0,0,4,0,0,0,5,0,0,0,67, ++ 0,0,0,115,42,0,0,0,116,0,0,106,1,0,124,1, ++ 0,131,1,0,114,34,0,116,2,0,124,1,0,124,0,0, ++ 100,1,0,100,2,0,131,2,1,83,100,0,0,83,100,0, ++ 0,83,41,3,78,114,217,0,0,0,90,6,102,114,111,122, ++ 101,110,41,3,114,106,0,0,0,114,162,0,0,0,114,173, ++ 0,0,0,41,4,114,248,0,0,0,114,158,0,0,0,114, ++ 35,0,0,0,114,12,1,0,0,114,4,0,0,0,114,4, ++ 0,0,0,114,5,0,0,0,114,13,1,0,0,31,5,0, ++ 0,115,6,0,0,0,0,2,15,1,19,2,122,24,70,114, ++ 111,122,101,110,73,109,112,111,114,116,101,114,46,102,105,110, ++ 100,95,115,112,101,99,99,3,0,0,0,0,0,0,0,3, ++ 0,0,0,2,0,0,0,67,0,0,0,115,23,0,0,0, ++ 116,0,0,106,1,0,124,1,0,131,1,0,114,19,0,124, ++ 0,0,83,100,1,0,83,41,2,122,21,70,105,110,100,32, ++ 97,32,102,114,111,122,101,110,32,109,111,100,117,108,101,46, ++ 78,41,2,114,106,0,0,0,114,162,0,0,0,41,3,114, ++ 248,0,0,0,114,158,0,0,0,114,35,0,0,0,114,4, ++ 0,0,0,114,4,0,0,0,114,5,0,0,0,114,14,1, ++ 0,0,38,5,0,0,115,2,0,0,0,0,3,122,26,70, ++ 114,111,122,101,110,73,109,112,111,114,116,101,114,46,102,105, ++ 110,100,95,109,111,100,117,108,101,99,1,0,0,0,0,0, ++ 0,0,3,0,0,0,4,0,0,0,67,0,0,0,115,95, ++ 0,0,0,124,0,0,106,0,0,106,1,0,125,1,0,116, ++ 2,0,106,3,0,124,1,0,131,1,0,115,57,0,116,4, ++ 0,100,1,0,106,5,0,124,1,0,131,1,0,100,2,0, ++ 124,1,0,131,1,1,130,1,0,110,0,0,116,6,0,116, ++ 2,0,106,7,0,124,1,0,131,2,0,125,2,0,116,8, ++ 0,124,2,0,124,0,0,106,9,0,131,2,0,1,100,0, ++ 0,83,41,3,78,122,27,123,33,114,125,32,105,115,32,110, ++ 111,116,32,97,32,102,114,111,122,101,110,32,109,111,100,117, ++ 108,101,114,67,0,0,0,41,10,114,208,0,0,0,114,67, ++ 0,0,0,114,106,0,0,0,114,162,0,0,0,114,153,0, ++ 0,0,114,47,0,0,0,114,114,0,0,0,218,17,103,101, ++ 116,95,102,114,111,122,101,110,95,111,98,106,101,99,116,114, ++ 175,0,0,0,114,63,0,0,0,41,3,114,179,0,0,0, ++ 114,67,0,0,0,114,194,0,0,0,114,4,0,0,0,114, ++ 4,0,0,0,114,5,0,0,0,114,3,1,0,0,43,5, ++ 0,0,115,12,0,0,0,0,2,12,1,15,1,18,1,12, ++ 1,18,1,122,26,70,114,111,122,101,110,73,109,112,111,114, ++ 116,101,114,46,101,120,101,99,95,109,111,100,117,108,101,99, ++ 2,0,0,0,0,0,0,0,2,0,0,0,3,0,0,0, ++ 67,0,0,0,115,13,0,0,0,116,0,0,124,0,0,124, ++ 1,0,131,2,0,83,41,1,122,21,76,111,97,100,32,97, ++ 32,102,114,111,122,101,110,32,109,111,100,117,108,101,46,41, ++ 1,114,180,0,0,0,41,2,114,248,0,0,0,114,158,0, ++ 0,0,114,4,0,0,0,114,4,0,0,0,114,5,0,0, ++ 0,114,6,1,0,0,52,5,0,0,115,2,0,0,0,0, ++ 3,122,26,70,114,111,122,101,110,73,109,112,111,114,116,101, ++ 114,46,108,111,97,100,95,109,111,100,117,108,101,99,2,0, ++ 0,0,0,0,0,0,2,0,0,0,2,0,0,0,67,0, ++ 0,0,115,13,0,0,0,116,0,0,106,1,0,124,1,0, ++ 131,1,0,83,41,1,122,45,82,101,116,117,114,110,32,116, ++ 104,101,32,99,111,100,101,32,111,98,106,101,99,116,32,102, ++ 111,114,32,116,104,101,32,102,114,111,122,101,110,32,109,111, ++ 100,117,108,101,46,41,2,114,106,0,0,0,114,20,1,0, ++ 0,41,2,114,248,0,0,0,114,158,0,0,0,114,4,0, ++ 0,0,114,4,0,0,0,114,5,0,0,0,114,15,1,0, ++ 0,57,5,0,0,115,2,0,0,0,0,4,122,23,70,114, ++ 111,122,101,110,73,109,112,111,114,116,101,114,46,103,101,116, ++ 95,99,111,100,101,99,2,0,0,0,0,0,0,0,2,0, ++ 0,0,1,0,0,0,67,0,0,0,115,4,0,0,0,100, ++ 1,0,83,41,2,122,54,82,101,116,117,114,110,32,78,111, ++ 110,101,32,97,115,32,102,114,111,122,101,110,32,109,111,100, ++ 117,108,101,115,32,100,111,32,110,111,116,32,104,97,118,101, ++ 32,115,111,117,114,99,101,32,99,111,100,101,46,78,114,4, ++ 0,0,0,41,2,114,248,0,0,0,114,158,0,0,0,114, ++ 4,0,0,0,114,4,0,0,0,114,5,0,0,0,114,16, ++ 1,0,0,63,5,0,0,115,2,0,0,0,0,4,122,25, ++ 70,114,111,122,101,110,73,109,112,111,114,116,101,114,46,103, ++ 101,116,95,115,111,117,114,99,101,99,2,0,0,0,0,0, ++ 0,0,2,0,0,0,2,0,0,0,67,0,0,0,115,13, ++ 0,0,0,116,0,0,106,1,0,124,1,0,131,1,0,83, ++ 41,1,122,46,82,101,116,117,114,110,32,84,114,117,101,32, ++ 105,102,32,116,104,101,32,102,114,111,122,101,110,32,109,111, ++ 100,117,108,101,32,105,115,32,97,32,112,97,99,107,97,103, ++ 101,46,41,2,114,106,0,0,0,90,17,105,115,95,102,114, ++ 111,122,101,110,95,112,97,99,107,97,103,101,41,2,114,248, ++ 0,0,0,114,158,0,0,0,114,4,0,0,0,114,4,0, ++ 0,0,114,5,0,0,0,114,219,0,0,0,69,5,0,0, ++ 115,2,0,0,0,0,4,122,25,70,114,111,122,101,110,73, + 109,112,111,114,116,101,114,46,105,115,95,112,97,99,107,97, + 103,101,41,15,114,57,0,0,0,114,56,0,0,0,114,58, +- 0,0,0,114,59,0,0,0,218,12,115,116,97,116,105,99, +- 109,101,116,104,111,100,114,200,0,0,0,114,4,1,0,0, +- 114,8,1,0,0,114,9,1,0,0,114,253,0,0,0,114, +- 0,1,0,0,114,155,0,0,0,114,10,1,0,0,114,11, +- 1,0,0,114,216,0,0,0,114,4,0,0,0,114,4,0, +- 0,0,114,4,0,0,0,114,5,0,0,0,114,5,1,0, +- 0,188,4,0,0,115,28,0,0,0,12,7,6,2,18,5, +- 3,1,21,8,3,1,18,9,18,13,18,5,3,1,21,5, +- 3,1,21,5,3,1,114,5,1,0,0,99,0,0,0,0, +- 0,0,0,0,0,0,0,0,5,0,0,0,64,0,0,0, +- 115,193,0,0,0,101,0,0,90,1,0,100,0,0,90,2, +- 0,100,1,0,90,3,0,101,4,0,100,2,0,100,3,0, +- 132,0,0,131,1,0,90,5,0,101,6,0,100,4,0,100, +- 4,0,100,5,0,100,6,0,132,2,0,131,1,0,90,7, +- 0,101,6,0,100,4,0,100,7,0,100,8,0,132,1,0, +- 131,1,0,90,8,0,101,4,0,100,9,0,100,10,0,132, +- 0,0,131,1,0,90,9,0,101,6,0,100,11,0,100,12, +- 0,132,0,0,131,1,0,90,10,0,101,6,0,101,11,0, +- 100,13,0,100,14,0,132,0,0,131,1,0,131,1,0,90, +- 12,0,101,6,0,101,11,0,100,15,0,100,16,0,132,0, +- 0,131,1,0,131,1,0,90,13,0,101,6,0,101,11,0, +- 100,17,0,100,18,0,132,0,0,131,1,0,131,1,0,90, +- 14,0,100,4,0,83,41,19,218,14,70,114,111,122,101,110, +- 73,109,112,111,114,116,101,114,122,142,77,101,116,97,32,112, +- 97,116,104,32,105,109,112,111,114,116,32,102,111,114,32,102, +- 114,111,122,101,110,32,109,111,100,117,108,101,115,46,10,10, +- 32,32,32,32,65,108,108,32,109,101,116,104,111,100,115,32, +- 97,114,101,32,101,105,116,104,101,114,32,99,108,97,115,115, +- 32,111,114,32,115,116,97,116,105,99,32,109,101,116,104,111, +- 100,115,32,116,111,32,97,118,111,105,100,32,116,104,101,32, +- 110,101,101,100,32,116,111,10,32,32,32,32,105,110,115,116, +- 97,110,116,105,97,116,101,32,116,104,101,32,99,108,97,115, +- 115,46,10,10,32,32,32,32,99,1,0,0,0,0,0,0, +- 0,1,0,0,0,2,0,0,0,67,0,0,0,115,16,0, +- 0,0,100,1,0,106,0,0,124,0,0,106,1,0,131,1, +- 0,83,41,2,78,122,22,60,109,111,100,117,108,101,32,123, +- 33,114,125,32,40,102,114,111,122,101,110,41,62,41,2,114, +- 47,0,0,0,114,57,0,0,0,41,1,218,1,109,114,4, +- 0,0,0,114,4,0,0,0,114,5,0,0,0,114,200,0, +- 0,0,12,5,0,0,115,2,0,0,0,0,3,122,26,70, +- 114,111,122,101,110,73,109,112,111,114,116,101,114,46,109,111, +- 100,117,108,101,95,114,101,112,114,78,99,4,0,0,0,0, +- 0,0,0,4,0,0,0,5,0,0,0,67,0,0,0,115, +- 42,0,0,0,116,0,0,106,1,0,124,1,0,131,1,0, +- 114,34,0,116,2,0,124,1,0,124,0,0,100,1,0,100, +- 2,0,131,2,1,83,100,0,0,83,100,0,0,83,41,3, +- 78,114,214,0,0,0,90,6,102,114,111,122,101,110,41,3, +- 114,96,0,0,0,114,156,0,0,0,114,167,0,0,0,41, +- 4,114,242,0,0,0,114,152,0,0,0,114,35,0,0,0, +- 114,7,1,0,0,114,4,0,0,0,114,4,0,0,0,114, +- 5,0,0,0,114,8,1,0,0,17,5,0,0,115,6,0, +- 0,0,0,2,15,1,19,2,122,24,70,114,111,122,101,110, +- 73,109,112,111,114,116,101,114,46,102,105,110,100,95,115,112, +- 101,99,99,3,0,0,0,0,0,0,0,3,0,0,0,2, +- 0,0,0,67,0,0,0,115,23,0,0,0,116,0,0,106, +- 1,0,124,1,0,131,1,0,114,19,0,124,0,0,83,100, +- 1,0,83,41,2,122,21,70,105,110,100,32,97,32,102,114, +- 111,122,101,110,32,109,111,100,117,108,101,46,78,41,2,114, +- 96,0,0,0,114,156,0,0,0,41,3,114,242,0,0,0, +- 114,152,0,0,0,114,35,0,0,0,114,4,0,0,0,114, +- 4,0,0,0,114,5,0,0,0,114,9,1,0,0,24,5, +- 0,0,115,2,0,0,0,0,3,122,26,70,114,111,122,101, +- 110,73,109,112,111,114,116,101,114,46,102,105,110,100,95,109, +- 111,100,117,108,101,99,1,0,0,0,0,0,0,0,3,0, +- 0,0,4,0,0,0,67,0,0,0,115,95,0,0,0,124, +- 0,0,106,0,0,106,1,0,125,1,0,116,2,0,106,3, +- 0,124,1,0,131,1,0,115,57,0,116,4,0,100,1,0, +- 106,5,0,124,1,0,131,1,0,100,2,0,124,1,0,131, +- 1,1,130,1,0,110,0,0,116,6,0,116,2,0,106,7, +- 0,124,1,0,131,2,0,125,2,0,116,8,0,124,2,0, +- 124,0,0,106,9,0,131,2,0,1,100,0,0,83,41,3, +- 78,122,27,123,33,114,125,32,105,115,32,110,111,116,32,97, +- 32,102,114,111,122,101,110,32,109,111,100,117,108,101,114,67, +- 0,0,0,41,10,114,203,0,0,0,114,67,0,0,0,114, +- 96,0,0,0,114,156,0,0,0,114,147,0,0,0,114,47, +- 0,0,0,114,108,0,0,0,218,17,103,101,116,95,102,114, +- 111,122,101,110,95,111,98,106,101,99,116,114,170,0,0,0, +- 114,63,0,0,0,41,3,114,174,0,0,0,114,67,0,0, +- 0,114,189,0,0,0,114,4,0,0,0,114,4,0,0,0, +- 114,5,0,0,0,114,253,0,0,0,29,5,0,0,115,12, +- 0,0,0,0,2,12,1,15,1,18,1,12,1,18,1,122, +- 26,70,114,111,122,101,110,73,109,112,111,114,116,101,114,46, +- 101,120,101,99,95,109,111,100,117,108,101,99,2,0,0,0, +- 0,0,0,0,2,0,0,0,3,0,0,0,67,0,0,0, +- 115,13,0,0,0,116,0,0,124,0,0,124,1,0,131,2, +- 0,83,41,1,122,21,76,111,97,100,32,97,32,102,114,111, +- 122,101,110,32,109,111,100,117,108,101,46,41,1,114,175,0, +- 0,0,41,2,114,242,0,0,0,114,152,0,0,0,114,4, +- 0,0,0,114,4,0,0,0,114,5,0,0,0,114,0,1, +- 0,0,38,5,0,0,115,2,0,0,0,0,3,122,26,70, +- 114,111,122,101,110,73,109,112,111,114,116,101,114,46,108,111, +- 97,100,95,109,111,100,117,108,101,99,2,0,0,0,0,0, +- 0,0,2,0,0,0,2,0,0,0,67,0,0,0,115,13, +- 0,0,0,116,0,0,106,1,0,124,1,0,131,1,0,83, +- 41,1,122,45,82,101,116,117,114,110,32,116,104,101,32,99, +- 111,100,101,32,111,98,106,101,99,116,32,102,111,114,32,116, +- 104,101,32,102,114,111,122,101,110,32,109,111,100,117,108,101, +- 46,41,2,114,96,0,0,0,114,15,1,0,0,41,2,114, +- 242,0,0,0,114,152,0,0,0,114,4,0,0,0,114,4, +- 0,0,0,114,5,0,0,0,114,10,1,0,0,43,5,0, +- 0,115,2,0,0,0,0,4,122,23,70,114,111,122,101,110, +- 73,109,112,111,114,116,101,114,46,103,101,116,95,99,111,100, +- 101,99,2,0,0,0,0,0,0,0,2,0,0,0,1,0, +- 0,0,67,0,0,0,115,4,0,0,0,100,1,0,83,41, +- 2,122,54,82,101,116,117,114,110,32,78,111,110,101,32,97, +- 115,32,102,114,111,122,101,110,32,109,111,100,117,108,101,115, +- 32,100,111,32,110,111,116,32,104,97,118,101,32,115,111,117, +- 114,99,101,32,99,111,100,101,46,78,114,4,0,0,0,41, +- 2,114,242,0,0,0,114,152,0,0,0,114,4,0,0,0, +- 114,4,0,0,0,114,5,0,0,0,114,11,1,0,0,49, +- 5,0,0,115,2,0,0,0,0,4,122,25,70,114,111,122, +- 101,110,73,109,112,111,114,116,101,114,46,103,101,116,95,115, +- 111,117,114,99,101,99,2,0,0,0,0,0,0,0,2,0, +- 0,0,2,0,0,0,67,0,0,0,115,13,0,0,0,116, +- 0,0,106,1,0,124,1,0,131,1,0,83,41,1,122,46, +- 82,101,116,117,114,110,32,84,114,117,101,32,105,102,32,116, +- 104,101,32,102,114,111,122,101,110,32,109,111,100,117,108,101, +- 32,105,115,32,97,32,112,97,99,107,97,103,101,46,41,2, +- 114,96,0,0,0,90,17,105,115,95,102,114,111,122,101,110, +- 95,112,97,99,107,97,103,101,41,2,114,242,0,0,0,114, +- 152,0,0,0,114,4,0,0,0,114,4,0,0,0,114,5, +- 0,0,0,114,216,0,0,0,55,5,0,0,115,2,0,0, +- 0,0,4,122,25,70,114,111,122,101,110,73,109,112,111,114, +- 116,101,114,46,105,115,95,112,97,99,107,97,103,101,41,15, ++ 0,0,0,114,59,0,0,0,114,17,1,0,0,114,205,0, ++ 0,0,114,10,1,0,0,114,13,1,0,0,114,14,1,0, ++ 0,114,3,1,0,0,114,6,1,0,0,114,164,0,0,0, ++ 114,15,1,0,0,114,16,1,0,0,114,219,0,0,0,114, ++ 4,0,0,0,114,4,0,0,0,114,4,0,0,0,114,5, ++ 0,0,0,114,18,1,0,0,17,5,0,0,115,28,0,0, ++ 0,12,7,6,2,18,5,3,1,21,6,3,1,18,4,18, ++ 9,18,5,3,1,21,5,3,1,21,5,3,1,114,18,1, ++ 0,0,99,0,0,0,0,0,0,0,0,0,0,0,0,5, ++ 0,0,0,64,0,0,0,115,121,0,0,0,101,0,0,90, ++ 1,0,100,0,0,90,2,0,100,1,0,90,3,0,100,2, ++ 0,90,4,0,100,3,0,90,5,0,100,4,0,90,6,0, ++ 101,7,0,100,5,0,100,6,0,132,0,0,131,1,0,90, ++ 8,0,101,7,0,100,7,0,100,8,0,132,0,0,131,1, ++ 0,90,9,0,101,7,0,100,9,0,100,9,0,100,10,0, ++ 100,11,0,132,2,0,131,1,0,90,10,0,101,7,0,100, ++ 9,0,100,12,0,100,13,0,132,1,0,131,1,0,90,11, ++ 0,100,9,0,83,41,14,218,21,87,105,110,100,111,119,115, ++ 82,101,103,105,115,116,114,121,70,105,110,100,101,114,122,62, ++ 77,101,116,97,32,112,97,116,104,32,102,105,110,100,101,114, ++ 32,102,111,114,32,109,111,100,117,108,101,115,32,100,101,99, ++ 108,97,114,101,100,32,105,110,32,116,104,101,32,87,105,110, ++ 100,111,119,115,32,114,101,103,105,115,116,114,121,46,122,59, ++ 83,111,102,116,119,97,114,101,92,80,121,116,104,111,110,92, ++ 80,121,116,104,111,110,67,111,114,101,92,123,115,121,115,95, ++ 118,101,114,115,105,111,110,125,92,77,111,100,117,108,101,115, ++ 92,123,102,117,108,108,110,97,109,101,125,122,65,83,111,102, ++ 116,119,97,114,101,92,80,121,116,104,111,110,92,80,121,116, ++ 104,111,110,67,111,114,101,92,123,115,121,115,95,118,101,114, ++ 115,105,111,110,125,92,77,111,100,117,108,101,115,92,123,102, ++ 117,108,108,110,97,109,101,125,92,68,101,98,117,103,70,99, ++ 2,0,0,0,0,0,0,0,2,0,0,0,11,0,0,0, ++ 67,0,0,0,115,67,0,0,0,121,23,0,116,0,0,106, ++ 1,0,116,0,0,106,2,0,124,1,0,131,2,0,83,87, ++ 110,37,0,4,116,3,0,107,10,0,114,62,0,1,1,1, ++ 116,0,0,106,1,0,116,0,0,106,4,0,124,1,0,131, ++ 2,0,83,89,110,1,0,88,100,0,0,83,41,1,78,41, ++ 5,218,7,95,119,105,110,114,101,103,90,7,79,112,101,110, ++ 75,101,121,90,17,72,75,69,89,95,67,85,82,82,69,78, ++ 84,95,85,83,69,82,114,40,0,0,0,90,18,72,75,69, ++ 89,95,76,79,67,65,76,95,77,65,67,72,73,78,69,41, ++ 2,114,248,0,0,0,218,3,107,101,121,114,4,0,0,0, ++ 114,4,0,0,0,114,5,0,0,0,218,14,95,111,112,101, ++ 110,95,114,101,103,105,115,116,114,121,88,5,0,0,115,8, ++ 0,0,0,0,2,3,1,23,1,13,1,122,36,87,105,110, ++ 100,111,119,115,82,101,103,105,115,116,114,121,70,105,110,100, ++ 101,114,46,95,111,112,101,110,95,114,101,103,105,115,116,114, ++ 121,99,2,0,0,0,0,0,0,0,6,0,0,0,16,0, ++ 0,0,67,0,0,0,115,142,0,0,0,124,0,0,106,0, ++ 0,114,21,0,124,0,0,106,1,0,125,2,0,110,9,0, ++ 124,0,0,106,2,0,125,2,0,124,2,0,106,3,0,100, ++ 1,0,124,1,0,100,2,0,116,4,0,106,5,0,100,0, ++ 0,100,3,0,133,2,0,25,131,0,2,125,3,0,121,46, ++ 0,124,0,0,106,6,0,124,3,0,131,1,0,143,25,0, ++ 125,4,0,116,7,0,106,8,0,124,4,0,100,4,0,131, ++ 2,0,125,5,0,87,100,0,0,81,88,87,110,22,0,4, ++ 116,9,0,107,10,0,114,137,0,1,1,1,100,0,0,83, ++ 89,110,1,0,88,124,5,0,83,41,5,78,114,158,0,0, ++ 0,90,11,115,121,115,95,118,101,114,115,105,111,110,114,136, ++ 0,0,0,114,30,0,0,0,41,10,218,11,68,69,66,85, ++ 71,95,66,85,73,76,68,218,18,82,69,71,73,83,84,82, ++ 89,95,75,69,89,95,68,69,66,85,71,218,12,82,69,71, ++ 73,83,84,82,89,95,75,69,89,114,47,0,0,0,114,7, ++ 0,0,0,218,7,118,101,114,115,105,111,110,114,24,1,0, ++ 0,114,22,1,0,0,90,10,81,117,101,114,121,86,97,108, ++ 117,101,114,40,0,0,0,41,6,114,248,0,0,0,114,158, ++ 0,0,0,90,12,114,101,103,105,115,116,114,121,95,107,101, ++ 121,114,23,1,0,0,90,4,104,107,101,121,218,8,102,105, ++ 108,101,112,97,116,104,114,4,0,0,0,114,4,0,0,0, ++ 114,5,0,0,0,218,16,95,115,101,97,114,99,104,95,114, ++ 101,103,105,115,116,114,121,95,5,0,0,115,22,0,0,0, ++ 0,2,9,1,12,2,9,1,15,1,22,1,3,1,18,1, ++ 28,1,13,1,9,1,122,38,87,105,110,100,111,119,115,82, ++ 101,103,105,115,116,114,121,70,105,110,100,101,114,46,95,115, ++ 101,97,114,99,104,95,114,101,103,105,115,116,114,121,78,99, ++ 4,0,0,0,0,0,0,0,8,0,0,0,14,0,0,0, ++ 67,0,0,0,115,155,0,0,0,124,0,0,106,0,0,124, ++ 1,0,131,1,0,125,4,0,124,4,0,100,0,0,107,8, ++ 0,114,31,0,100,0,0,83,121,14,0,116,1,0,124,4, ++ 0,131,1,0,1,87,110,22,0,4,116,2,0,107,10,0, ++ 114,69,0,1,1,1,100,0,0,83,89,110,1,0,88,120, ++ 78,0,116,3,0,131,0,0,68,93,67,0,92,2,0,125, ++ 5,0,125,6,0,124,4,0,106,4,0,116,5,0,124,6, ++ 0,131,1,0,131,1,0,114,80,0,116,6,0,124,1,0, ++ 124,5,0,124,1,0,124,4,0,131,2,0,100,1,0,124, ++ 4,0,131,2,1,125,7,0,124,7,0,83,113,80,0,87, ++ 100,0,0,83,41,2,78,114,217,0,0,0,41,7,114,30, ++ 1,0,0,114,39,0,0,0,114,40,0,0,0,114,239,0, ++ 0,0,114,229,0,0,0,114,230,0,0,0,114,173,0,0, ++ 0,41,8,114,248,0,0,0,114,158,0,0,0,114,35,0, ++ 0,0,114,12,1,0,0,114,29,1,0,0,114,169,0,0, ++ 0,114,127,0,0,0,114,177,0,0,0,114,4,0,0,0, ++ 114,4,0,0,0,114,5,0,0,0,114,13,1,0,0,110, ++ 5,0,0,115,24,0,0,0,0,3,15,1,12,1,4,1, ++ 3,1,14,1,13,1,9,1,22,1,21,1,21,1,9,1, ++ 122,31,87,105,110,100,111,119,115,82,101,103,105,115,116,114, ++ 121,70,105,110,100,101,114,46,102,105,110,100,95,115,112,101, ++ 99,99,3,0,0,0,0,0,0,0,4,0,0,0,3,0, ++ 0,0,67,0,0,0,115,45,0,0,0,116,0,0,106,1, ++ 0,124,1,0,124,2,0,131,2,0,125,3,0,124,3,0, ++ 100,1,0,107,9,0,114,37,0,124,3,0,106,2,0,83, ++ 100,1,0,83,100,1,0,83,41,2,122,34,70,105,110,100, ++ 32,109,111,100,117,108,101,32,110,97,109,101,100,32,105,110, ++ 32,116,104,101,32,114,101,103,105,115,116,114,121,46,78,41, ++ 3,114,71,0,0,0,114,13,1,0,0,114,169,0,0,0, ++ 41,4,114,248,0,0,0,114,158,0,0,0,114,35,0,0, ++ 0,114,177,0,0,0,114,4,0,0,0,114,4,0,0,0, ++ 114,5,0,0,0,114,14,1,0,0,126,5,0,0,115,8, ++ 0,0,0,0,3,18,1,12,1,7,2,122,33,87,105,110, ++ 100,111,119,115,82,101,103,105,115,116,114,121,70,105,110,100, ++ 101,114,46,102,105,110,100,95,109,111,100,117,108,101,41,12, + 114,57,0,0,0,114,56,0,0,0,114,58,0,0,0,114, +- 59,0,0,0,114,12,1,0,0,114,200,0,0,0,114,4, +- 1,0,0,114,8,1,0,0,114,9,1,0,0,114,253,0, +- 0,0,114,0,1,0,0,114,158,0,0,0,114,10,1,0, +- 0,114,11,1,0,0,114,216,0,0,0,114,4,0,0,0, +- 114,4,0,0,0,114,4,0,0,0,114,5,0,0,0,114, +- 13,1,0,0,3,5,0,0,115,28,0,0,0,12,7,6, +- 2,18,5,3,1,21,6,3,1,18,4,18,9,18,5,3, +- 1,21,5,3,1,21,5,3,1,114,13,1,0,0,99,0, +- 0,0,0,0,0,0,0,0,0,0,0,5,0,0,0,64, +- 0,0,0,115,121,0,0,0,101,0,0,90,1,0,100,0, +- 0,90,2,0,100,1,0,90,3,0,100,2,0,90,4,0, +- 100,3,0,90,5,0,100,4,0,90,6,0,101,7,0,100, +- 5,0,100,6,0,132,0,0,131,1,0,90,8,0,101,7, +- 0,100,7,0,100,8,0,132,0,0,131,1,0,90,9,0, +- 101,7,0,100,9,0,100,9,0,100,10,0,100,11,0,132, +- 2,0,131,1,0,90,10,0,101,7,0,100,9,0,100,12, +- 0,100,13,0,132,1,0,131,1,0,90,11,0,100,9,0, +- 83,41,14,218,21,87,105,110,100,111,119,115,82,101,103,105, +- 115,116,114,121,70,105,110,100,101,114,122,62,77,101,116,97, +- 32,112,97,116,104,32,102,105,110,100,101,114,32,102,111,114, +- 32,109,111,100,117,108,101,115,32,100,101,99,108,97,114,101, +- 100,32,105,110,32,116,104,101,32,87,105,110,100,111,119,115, +- 32,114,101,103,105,115,116,114,121,46,122,59,83,111,102,116, +- 119,97,114,101,92,80,121,116,104,111,110,92,80,121,116,104, +- 111,110,67,111,114,101,92,123,115,121,115,95,118,101,114,115, +- 105,111,110,125,92,77,111,100,117,108,101,115,92,123,102,117, +- 108,108,110,97,109,101,125,122,65,83,111,102,116,119,97,114, +- 101,92,80,121,116,104,111,110,92,80,121,116,104,111,110,67, +- 111,114,101,92,123,115,121,115,95,118,101,114,115,105,111,110, +- 125,92,77,111,100,117,108,101,115,92,123,102,117,108,108,110, +- 97,109,101,125,92,68,101,98,117,103,70,99,2,0,0,0, +- 0,0,0,0,2,0,0,0,11,0,0,0,67,0,0,0, +- 115,67,0,0,0,121,23,0,116,0,0,106,1,0,116,0, +- 0,106,2,0,124,1,0,131,2,0,83,87,110,37,0,4, +- 116,3,0,107,10,0,114,62,0,1,1,1,116,0,0,106, +- 1,0,116,0,0,106,4,0,124,1,0,131,2,0,83,89, +- 110,1,0,88,100,0,0,83,41,1,78,41,5,218,7,95, +- 119,105,110,114,101,103,90,7,79,112,101,110,75,101,121,90, +- 17,72,75,69,89,95,67,85,82,82,69,78,84,95,85,83, +- 69,82,114,40,0,0,0,90,18,72,75,69,89,95,76,79, +- 67,65,76,95,77,65,67,72,73,78,69,41,2,114,242,0, +- 0,0,218,3,107,101,121,114,4,0,0,0,114,4,0,0, +- 0,114,5,0,0,0,218,14,95,111,112,101,110,95,114,101, +- 103,105,115,116,114,121,74,5,0,0,115,8,0,0,0,0, +- 2,3,1,23,1,13,1,122,36,87,105,110,100,111,119,115, +- 82,101,103,105,115,116,114,121,70,105,110,100,101,114,46,95, +- 111,112,101,110,95,114,101,103,105,115,116,114,121,99,2,0, +- 0,0,0,0,0,0,6,0,0,0,16,0,0,0,67,0, +- 0,0,115,142,0,0,0,124,0,0,106,0,0,114,21,0, +- 124,0,0,106,1,0,125,2,0,110,9,0,124,0,0,106, +- 2,0,125,2,0,124,2,0,106,3,0,100,1,0,124,1, +- 0,100,2,0,116,4,0,106,5,0,100,0,0,100,3,0, +- 133,2,0,25,131,0,2,125,3,0,121,46,0,124,0,0, +- 106,6,0,124,3,0,131,1,0,143,25,0,125,4,0,116, +- 7,0,106,8,0,124,4,0,100,4,0,131,2,0,125,5, +- 0,87,100,0,0,81,88,87,110,22,0,4,116,9,0,107, +- 10,0,114,137,0,1,1,1,100,0,0,83,89,110,1,0, +- 88,124,5,0,83,41,5,78,114,152,0,0,0,90,11,115, +- 121,115,95,118,101,114,115,105,111,110,114,130,0,0,0,114, +- 30,0,0,0,41,10,218,11,68,69,66,85,71,95,66,85, +- 73,76,68,218,18,82,69,71,73,83,84,82,89,95,75,69, +- 89,95,68,69,66,85,71,218,12,82,69,71,73,83,84,82, +- 89,95,75,69,89,114,47,0,0,0,114,7,0,0,0,218, +- 7,118,101,114,115,105,111,110,114,19,1,0,0,114,17,1, +- 0,0,90,10,81,117,101,114,121,86,97,108,117,101,114,40, +- 0,0,0,41,6,114,242,0,0,0,114,152,0,0,0,90, +- 12,114,101,103,105,115,116,114,121,95,107,101,121,114,18,1, +- 0,0,90,4,104,107,101,121,218,8,102,105,108,101,112,97, +- 116,104,114,4,0,0,0,114,4,0,0,0,114,5,0,0, +- 0,218,16,95,115,101,97,114,99,104,95,114,101,103,105,115, +- 116,114,121,81,5,0,0,115,22,0,0,0,0,2,9,1, +- 12,2,9,1,15,1,22,1,3,1,18,1,28,1,13,1, +- 9,1,122,38,87,105,110,100,111,119,115,82,101,103,105,115, +- 116,114,121,70,105,110,100,101,114,46,95,115,101,97,114,99, +- 104,95,114,101,103,105,115,116,114,121,78,99,4,0,0,0, +- 0,0,0,0,8,0,0,0,14,0,0,0,67,0,0,0, +- 115,155,0,0,0,124,0,0,106,0,0,124,1,0,131,1, +- 0,125,4,0,124,4,0,100,0,0,107,8,0,114,31,0, +- 100,0,0,83,121,14,0,116,1,0,124,4,0,131,1,0, +- 1,87,110,22,0,4,116,2,0,107,10,0,114,69,0,1, +- 1,1,100,0,0,83,89,110,1,0,88,120,78,0,116,3, +- 0,131,0,0,68,93,67,0,92,2,0,125,5,0,125,6, +- 0,124,4,0,106,4,0,116,5,0,124,6,0,131,1,0, +- 131,1,0,114,80,0,116,6,0,124,1,0,124,5,0,124, +- 1,0,124,4,0,131,2,0,100,1,0,124,4,0,131,2, +- 1,125,7,0,124,7,0,83,113,80,0,87,100,0,0,83, +- 41,2,78,114,214,0,0,0,41,7,114,25,1,0,0,114, +- 39,0,0,0,114,40,0,0,0,114,233,0,0,0,114,225, +- 0,0,0,114,226,0,0,0,114,167,0,0,0,41,8,114, +- 242,0,0,0,114,152,0,0,0,114,35,0,0,0,114,7, +- 1,0,0,114,24,1,0,0,114,163,0,0,0,114,121,0, +- 0,0,114,172,0,0,0,114,4,0,0,0,114,4,0,0, +- 0,114,5,0,0,0,114,8,1,0,0,96,5,0,0,115, +- 24,0,0,0,0,3,15,1,12,1,4,1,3,1,14,1, +- 13,1,9,1,22,1,21,1,21,1,9,1,122,31,87,105, +- 110,100,111,119,115,82,101,103,105,115,116,114,121,70,105,110, +- 100,101,114,46,102,105,110,100,95,115,112,101,99,99,3,0, +- 0,0,0,0,0,0,4,0,0,0,3,0,0,0,67,0, +- 0,0,115,45,0,0,0,116,0,0,106,1,0,124,1,0, +- 124,2,0,131,2,0,125,3,0,124,3,0,100,1,0,107, +- 9,0,114,37,0,124,3,0,106,2,0,83,100,1,0,83, +- 100,1,0,83,41,2,122,34,70,105,110,100,32,109,111,100, +- 117,108,101,32,110,97,109,101,100,32,105,110,32,116,104,101, +- 32,114,101,103,105,115,116,114,121,46,78,41,3,114,78,0, +- 0,0,114,8,1,0,0,114,163,0,0,0,41,4,114,242, +- 0,0,0,114,152,0,0,0,114,35,0,0,0,114,172,0, ++ 59,0,0,0,114,27,1,0,0,114,26,1,0,0,114,25, ++ 1,0,0,114,10,1,0,0,114,24,1,0,0,114,30,1, ++ 0,0,114,13,1,0,0,114,14,1,0,0,114,4,0,0, ++ 0,114,4,0,0,0,114,4,0,0,0,114,5,0,0,0, ++ 114,21,1,0,0,76,5,0,0,115,20,0,0,0,12,2, ++ 6,3,6,3,6,2,6,2,18,7,18,15,3,1,21,15, ++ 3,1,114,21,1,0,0,99,0,0,0,0,0,0,0,0, ++ 0,0,0,0,2,0,0,0,64,0,0,0,115,52,0,0, ++ 0,101,0,0,90,1,0,100,0,0,90,2,0,100,1,0, ++ 90,3,0,100,2,0,100,3,0,132,0,0,90,4,0,100, ++ 4,0,100,5,0,132,0,0,90,5,0,101,6,0,90,7, ++ 0,100,6,0,83,41,7,218,13,95,76,111,97,100,101,114, ++ 66,97,115,105,99,115,122,83,66,97,115,101,32,99,108,97, ++ 115,115,32,111,102,32,99,111,109,109,111,110,32,99,111,100, ++ 101,32,110,101,101,100,101,100,32,98,121,32,98,111,116,104, ++ 32,83,111,117,114,99,101,76,111,97,100,101,114,32,97,110, ++ 100,10,32,32,32,32,83,111,117,114,99,101,108,101,115,115, ++ 70,105,108,101,76,111,97,100,101,114,46,99,2,0,0,0, ++ 0,0,0,0,5,0,0,0,3,0,0,0,67,0,0,0, ++ 115,88,0,0,0,116,0,0,124,0,0,106,1,0,124,1, ++ 0,131,1,0,131,1,0,100,1,0,25,125,2,0,124,2, ++ 0,106,2,0,100,2,0,100,1,0,131,2,0,100,3,0, ++ 25,125,3,0,124,1,0,106,3,0,100,2,0,131,1,0, ++ 100,4,0,25,125,4,0,124,3,0,100,5,0,107,2,0, ++ 111,87,0,124,4,0,100,5,0,107,3,0,83,41,6,122, ++ 141,67,111,110,99,114,101,116,101,32,105,109,112,108,101,109, ++ 101,110,116,97,116,105,111,110,32,111,102,32,73,110,115,112, ++ 101,99,116,76,111,97,100,101,114,46,105,115,95,112,97,99, ++ 107,97,103,101,32,98,121,32,99,104,101,99,107,105,110,103, ++ 32,105,102,10,32,32,32,32,32,32,32,32,116,104,101,32, ++ 112,97,116,104,32,114,101,116,117,114,110,101,100,32,98,121, ++ 32,103,101,116,95,102,105,108,101,110,97,109,101,32,104,97, ++ 115,32,97,32,102,105,108,101,110,97,109,101,32,111,102,32, ++ 39,95,95,105,110,105,116,95,95,46,112,121,39,46,114,29, ++ 0,0,0,114,116,0,0,0,114,84,0,0,0,114,115,0, ++ 0,0,114,72,0,0,0,41,4,114,38,0,0,0,114,237, ++ 0,0,0,114,34,0,0,0,114,32,0,0,0,41,5,114, ++ 71,0,0,0,114,158,0,0,0,114,131,0,0,0,90,13, ++ 102,105,108,101,110,97,109,101,95,98,97,115,101,90,9,116, ++ 97,105,108,95,110,97,109,101,114,4,0,0,0,114,4,0, ++ 0,0,114,5,0,0,0,114,219,0,0,0,142,5,0,0, ++ 115,8,0,0,0,0,3,25,1,22,1,19,1,122,24,95, ++ 76,111,97,100,101,114,66,97,115,105,99,115,46,105,115,95, ++ 112,97,99,107,97,103,101,99,2,0,0,0,0,0,0,0, ++ 3,0,0,0,4,0,0,0,67,0,0,0,115,80,0,0, ++ 0,124,0,0,106,0,0,124,1,0,106,1,0,131,1,0, ++ 125,2,0,124,2,0,100,1,0,107,8,0,114,57,0,116, ++ 2,0,100,2,0,106,3,0,124,1,0,106,1,0,131,1, ++ 0,131,1,0,130,1,0,110,0,0,116,4,0,116,5,0, ++ 124,2,0,124,1,0,106,6,0,131,3,0,1,100,1,0, ++ 83,41,3,122,19,69,120,101,99,117,116,101,32,116,104,101, ++ 32,109,111,100,117,108,101,46,78,122,52,99,97,110,110,111, ++ 116,32,108,111,97,100,32,109,111,100,117,108,101,32,123,33, ++ 114,125,32,119,104,101,110,32,103,101,116,95,99,111,100,101, ++ 40,41,32,114,101,116,117,114,110,115,32,78,111,110,101,41, ++ 7,114,15,1,0,0,114,57,0,0,0,114,153,0,0,0, ++ 114,47,0,0,0,114,114,0,0,0,114,175,0,0,0,114, ++ 63,0,0,0,41,3,114,71,0,0,0,114,179,0,0,0, ++ 114,194,0,0,0,114,4,0,0,0,114,4,0,0,0,114, ++ 5,0,0,0,114,3,1,0,0,150,5,0,0,115,10,0, ++ 0,0,0,2,18,1,12,1,3,1,24,1,122,25,95,76, ++ 111,97,100,101,114,66,97,115,105,99,115,46,101,120,101,99, ++ 95,109,111,100,117,108,101,78,41,8,114,57,0,0,0,114, ++ 56,0,0,0,114,58,0,0,0,114,59,0,0,0,114,219, ++ 0,0,0,114,3,1,0,0,114,180,0,0,0,114,6,1, ++ 0,0,114,4,0,0,0,114,4,0,0,0,114,4,0,0, ++ 0,114,5,0,0,0,114,31,1,0,0,136,5,0,0,115, ++ 8,0,0,0,12,3,6,3,12,8,12,8,114,31,1,0, ++ 0,99,0,0,0,0,0,0,0,0,0,0,0,0,4,0, ++ 0,0,64,0,0,0,115,106,0,0,0,101,0,0,90,1, ++ 0,100,0,0,90,2,0,100,1,0,100,2,0,132,0,0, ++ 90,3,0,100,3,0,100,4,0,132,0,0,90,4,0,100, ++ 5,0,100,6,0,132,0,0,90,5,0,100,7,0,100,8, ++ 0,132,0,0,90,6,0,100,9,0,100,10,0,132,0,0, ++ 90,7,0,100,11,0,100,18,0,100,13,0,100,14,0,132, ++ 0,1,90,8,0,100,15,0,100,16,0,132,0,0,90,9, ++ 0,100,17,0,83,41,19,218,12,83,111,117,114,99,101,76, ++ 111,97,100,101,114,99,2,0,0,0,0,0,0,0,2,0, ++ 0,0,1,0,0,0,67,0,0,0,115,10,0,0,0,116, ++ 0,0,130,1,0,100,1,0,83,41,2,122,178,79,112,116, ++ 105,111,110,97,108,32,109,101,116,104,111,100,32,116,104,97, ++ 116,32,114,101,116,117,114,110,115,32,116,104,101,32,109,111, ++ 100,105,102,105,99,97,116,105,111,110,32,116,105,109,101,32, ++ 40,97,110,32,105,110,116,41,32,102,111,114,32,116,104,101, ++ 10,32,32,32,32,32,32,32,32,115,112,101,99,105,102,105, ++ 101,100,32,112,97,116,104,44,32,119,104,101,114,101,32,112, ++ 97,116,104,32,105,115,32,97,32,115,116,114,46,10,10,32, ++ 32,32,32,32,32,32,32,82,97,105,115,101,115,32,73,79, ++ 69,114,114,111,114,32,119,104,101,110,32,116,104,101,32,112, ++ 97,116,104,32,99,97,110,110,111,116,32,98,101,32,104,97, ++ 110,100,108,101,100,46,10,32,32,32,32,32,32,32,32,78, ++ 41,1,218,7,73,79,69,114,114,111,114,41,2,114,71,0, ++ 0,0,114,35,0,0,0,114,4,0,0,0,114,4,0,0, ++ 0,114,5,0,0,0,218,10,112,97,116,104,95,109,116,105, ++ 109,101,163,5,0,0,115,2,0,0,0,0,6,122,23,83, ++ 111,117,114,99,101,76,111,97,100,101,114,46,112,97,116,104, ++ 95,109,116,105,109,101,99,2,0,0,0,0,0,0,0,2, ++ 0,0,0,3,0,0,0,67,0,0,0,115,20,0,0,0, ++ 105,1,0,124,0,0,106,0,0,124,1,0,131,1,0,100, ++ 1,0,54,83,41,2,97,170,1,0,0,79,112,116,105,111, ++ 110,97,108,32,109,101,116,104,111,100,32,114,101,116,117,114, ++ 110,105,110,103,32,97,32,109,101,116,97,100,97,116,97,32, ++ 100,105,99,116,32,102,111,114,32,116,104,101,32,115,112,101, ++ 99,105,102,105,101,100,32,112,97,116,104,10,32,32,32,32, ++ 32,32,32,32,116,111,32,98,121,32,116,104,101,32,112,97, ++ 116,104,32,40,115,116,114,41,46,10,32,32,32,32,32,32, ++ 32,32,80,111,115,115,105,98,108,101,32,107,101,121,115,58, ++ 10,32,32,32,32,32,32,32,32,45,32,39,109,116,105,109, ++ 101,39,32,40,109,97,110,100,97,116,111,114,121,41,32,105, ++ 115,32,116,104,101,32,110,117,109,101,114,105,99,32,116,105, ++ 109,101,115,116,97,109,112,32,111,102,32,108,97,115,116,32, ++ 115,111,117,114,99,101,10,32,32,32,32,32,32,32,32,32, ++ 32,99,111,100,101,32,109,111,100,105,102,105,99,97,116,105, ++ 111,110,59,10,32,32,32,32,32,32,32,32,45,32,39,115, ++ 105,122,101,39,32,40,111,112,116,105,111,110,97,108,41,32, ++ 105,115,32,116,104,101,32,115,105,122,101,32,105,110,32,98, ++ 121,116,101,115,32,111,102,32,116,104,101,32,115,111,117,114, ++ 99,101,32,99,111,100,101,46,10,10,32,32,32,32,32,32, ++ 32,32,73,109,112,108,101,109,101,110,116,105,110,103,32,116, ++ 104,105,115,32,109,101,116,104,111,100,32,97,108,108,111,119, ++ 115,32,116,104,101,32,108,111,97,100,101,114,32,116,111,32, ++ 114,101,97,100,32,98,121,116,101,99,111,100,101,32,102,105, ++ 108,101,115,46,10,32,32,32,32,32,32,32,32,82,97,105, ++ 115,101,115,32,73,79,69,114,114,111,114,32,119,104,101,110, ++ 32,116,104,101,32,112,97,116,104,32,99,97,110,110,111,116, ++ 32,98,101,32,104,97,110,100,108,101,100,46,10,32,32,32, ++ 32,32,32,32,32,114,183,0,0,0,41,1,114,34,1,0, ++ 0,41,2,114,71,0,0,0,114,35,0,0,0,114,4,0, ++ 0,0,114,4,0,0,0,114,5,0,0,0,218,10,112,97, ++ 116,104,95,115,116,97,116,115,171,5,0,0,115,2,0,0, ++ 0,0,11,122,23,83,111,117,114,99,101,76,111,97,100,101, ++ 114,46,112,97,116,104,95,115,116,97,116,115,99,4,0,0, ++ 0,0,0,0,0,4,0,0,0,3,0,0,0,67,0,0, ++ 0,115,16,0,0,0,124,0,0,106,0,0,124,2,0,124, ++ 3,0,131,2,0,83,41,1,122,228,79,112,116,105,111,110, ++ 97,108,32,109,101,116,104,111,100,32,119,104,105,99,104,32, ++ 119,114,105,116,101,115,32,100,97,116,97,32,40,98,121,116, ++ 101,115,41,32,116,111,32,97,32,102,105,108,101,32,112,97, ++ 116,104,32,40,97,32,115,116,114,41,46,10,10,32,32,32, ++ 32,32,32,32,32,73,109,112,108,101,109,101,110,116,105,110, ++ 103,32,116,104,105,115,32,109,101,116,104,111,100,32,97,108, ++ 108,111,119,115,32,102,111,114,32,116,104,101,32,119,114,105, ++ 116,105,110,103,32,111,102,32,98,121,116,101,99,111,100,101, ++ 32,102,105,108,101,115,46,10,10,32,32,32,32,32,32,32, ++ 32,84,104,101,32,115,111,117,114,99,101,32,112,97,116,104, ++ 32,105,115,32,110,101,101,100,101,100,32,105,110,32,111,114, ++ 100,101,114,32,116,111,32,99,111,114,114,101,99,116,108,121, ++ 32,116,114,97,110,115,102,101,114,32,112,101,114,109,105,115, ++ 115,105,111,110,115,10,32,32,32,32,32,32,32,32,41,1, ++ 218,8,115,101,116,95,100,97,116,97,41,4,114,71,0,0, ++ 0,114,141,0,0,0,90,10,99,97,99,104,101,95,112,97, ++ 116,104,114,53,0,0,0,114,4,0,0,0,114,4,0,0, ++ 0,114,5,0,0,0,218,15,95,99,97,99,104,101,95,98, ++ 121,116,101,99,111,100,101,184,5,0,0,115,2,0,0,0, ++ 0,8,122,28,83,111,117,114,99,101,76,111,97,100,101,114, ++ 46,95,99,97,99,104,101,95,98,121,116,101,99,111,100,101, ++ 99,3,0,0,0,0,0,0,0,3,0,0,0,1,0,0, ++ 0,67,0,0,0,115,4,0,0,0,100,1,0,83,41,2, ++ 122,150,79,112,116,105,111,110,97,108,32,109,101,116,104,111, ++ 100,32,119,104,105,99,104,32,119,114,105,116,101,115,32,100, ++ 97,116,97,32,40,98,121,116,101,115,41,32,116,111,32,97, ++ 32,102,105,108,101,32,112,97,116,104,32,40,97,32,115,116, ++ 114,41,46,10,10,32,32,32,32,32,32,32,32,73,109,112, ++ 108,101,109,101,110,116,105,110,103,32,116,104,105,115,32,109, ++ 101,116,104,111,100,32,97,108,108,111,119,115,32,102,111,114, ++ 32,116,104,101,32,119,114,105,116,105,110,103,32,111,102,32, ++ 98,121,116,101,99,111,100,101,32,102,105,108,101,115,46,10, ++ 32,32,32,32,32,32,32,32,78,114,4,0,0,0,41,3, ++ 114,71,0,0,0,114,35,0,0,0,114,53,0,0,0,114, ++ 4,0,0,0,114,4,0,0,0,114,5,0,0,0,114,36, ++ 1,0,0,194,5,0,0,115,0,0,0,0,122,21,83,111, ++ 117,114,99,101,76,111,97,100,101,114,46,115,101,116,95,100, ++ 97,116,97,99,2,0,0,0,0,0,0,0,5,0,0,0, ++ 16,0,0,0,67,0,0,0,115,105,0,0,0,124,0,0, ++ 106,0,0,124,1,0,131,1,0,125,2,0,121,19,0,124, ++ 0,0,106,1,0,124,2,0,131,1,0,125,3,0,87,110, ++ 58,0,4,116,2,0,107,10,0,114,94,0,1,125,4,0, ++ 1,122,26,0,116,3,0,100,1,0,100,2,0,124,1,0, ++ 131,1,1,124,4,0,130,2,0,87,89,100,3,0,100,3, ++ 0,125,4,0,126,4,0,88,110,1,0,88,116,4,0,124, ++ 3,0,131,1,0,83,41,4,122,52,67,111,110,99,114,101, ++ 116,101,32,105,109,112,108,101,109,101,110,116,97,116,105,111, ++ 110,32,111,102,32,73,110,115,112,101,99,116,76,111,97,100, ++ 101,114,46,103,101,116,95,115,111,117,114,99,101,46,122,39, ++ 115,111,117,114,99,101,32,110,111,116,32,97,118,97,105,108, ++ 97,98,108,101,32,116,104,114,111,117,103,104,32,103,101,116, ++ 95,100,97,116,97,40,41,114,67,0,0,0,78,41,5,114, ++ 237,0,0,0,218,8,103,101,116,95,100,97,116,97,114,40, ++ 0,0,0,114,153,0,0,0,114,203,0,0,0,41,5,114, ++ 71,0,0,0,114,158,0,0,0,114,35,0,0,0,114,201, ++ 0,0,0,218,3,101,120,99,114,4,0,0,0,114,4,0, ++ 0,0,114,5,0,0,0,114,16,1,0,0,201,5,0,0, ++ 115,14,0,0,0,0,2,15,1,3,1,19,1,18,1,9, ++ 1,31,1,122,23,83,111,117,114,99,101,76,111,97,100,101, ++ 114,46,103,101,116,95,115,111,117,114,99,101,218,9,95,111, ++ 112,116,105,109,105,122,101,114,29,0,0,0,99,3,0,0, ++ 0,1,0,0,0,4,0,0,0,9,0,0,0,67,0,0, ++ 0,115,31,0,0,0,116,0,0,116,1,0,124,1,0,124, ++ 2,0,100,1,0,100,2,0,100,3,0,100,4,0,124,3, ++ 0,131,4,2,83,41,5,122,130,82,101,116,117,114,110,32, ++ 116,104,101,32,99,111,100,101,32,111,98,106,101,99,116,32, ++ 99,111,109,112,105,108,101,100,32,102,114,111,109,32,115,111, ++ 117,114,99,101,46,10,10,32,32,32,32,32,32,32,32,84, ++ 104,101,32,39,100,97,116,97,39,32,97,114,103,117,109,101, ++ 110,116,32,99,97,110,32,98,101,32,97,110,121,32,111,98, ++ 106,101,99,116,32,116,121,112,101,32,116,104,97,116,32,99, ++ 111,109,112,105,108,101,40,41,32,115,117,112,112,111,114,116, ++ 115,46,10,32,32,32,32,32,32,32,32,114,175,0,0,0, ++ 218,12,100,111,110,116,95,105,110,104,101,114,105,116,84,114, ++ 118,0,0,0,41,2,114,114,0,0,0,218,7,99,111,109, ++ 112,105,108,101,41,4,114,71,0,0,0,114,53,0,0,0, ++ 114,35,0,0,0,114,40,1,0,0,114,4,0,0,0,114, ++ 4,0,0,0,114,5,0,0,0,218,14,115,111,117,114,99, ++ 101,95,116,111,95,99,111,100,101,211,5,0,0,115,4,0, ++ 0,0,0,5,18,1,122,27,83,111,117,114,99,101,76,111, ++ 97,100,101,114,46,115,111,117,114,99,101,95,116,111,95,99, ++ 111,100,101,99,2,0,0,0,0,0,0,0,10,0,0,0, ++ 45,0,0,0,67,0,0,0,115,177,1,0,0,124,0,0, ++ 106,0,0,124,1,0,131,1,0,125,2,0,100,1,0,125, ++ 3,0,121,16,0,116,1,0,124,2,0,131,1,0,125,4, ++ 0,87,110,24,0,4,116,2,0,107,10,0,114,63,0,1, ++ 1,1,100,1,0,125,4,0,89,110,202,0,88,121,19,0, ++ 124,0,0,106,3,0,124,2,0,131,1,0,125,5,0,87, ++ 110,18,0,4,116,4,0,107,10,0,114,103,0,1,1,1, ++ 89,110,162,0,88,116,5,0,124,5,0,100,2,0,25,131, ++ 1,0,125,3,0,121,19,0,124,0,0,106,6,0,124,4, ++ 0,131,1,0,125,6,0,87,110,18,0,4,116,7,0,107, ++ 10,0,114,159,0,1,1,1,89,110,106,0,88,121,34,0, ++ 116,8,0,124,6,0,100,3,0,124,5,0,100,4,0,124, ++ 1,0,100,5,0,124,4,0,131,1,3,125,7,0,87,110, ++ 24,0,4,116,9,0,116,10,0,102,2,0,107,10,0,114, ++ 220,0,1,1,1,89,110,45,0,88,116,11,0,100,6,0, ++ 124,4,0,124,2,0,131,3,0,1,116,12,0,124,7,0, ++ 100,4,0,124,1,0,100,7,0,124,4,0,100,8,0,124, ++ 2,0,131,1,3,83,124,0,0,106,6,0,124,2,0,131, ++ 1,0,125,8,0,124,0,0,106,13,0,124,8,0,124,2, ++ 0,131,2,0,125,9,0,116,11,0,100,9,0,124,2,0, ++ 131,2,0,1,116,14,0,106,15,0,12,114,173,1,124,4, ++ 0,100,1,0,107,9,0,114,173,1,124,3,0,100,1,0, ++ 107,9,0,114,173,1,116,16,0,124,9,0,124,3,0,116, ++ 17,0,124,8,0,131,1,0,131,3,0,125,6,0,121,36, ++ 0,124,0,0,106,18,0,124,2,0,124,4,0,124,6,0, ++ 131,3,0,1,116,11,0,100,10,0,124,4,0,131,2,0, ++ 1,87,113,173,1,4,116,2,0,107,10,0,114,169,1,1, ++ 1,1,89,113,173,1,88,110,0,0,124,9,0,83,41,11, ++ 122,190,67,111,110,99,114,101,116,101,32,105,109,112,108,101, ++ 109,101,110,116,97,116,105,111,110,32,111,102,32,73,110,115, ++ 112,101,99,116,76,111,97,100,101,114,46,103,101,116,95,99, ++ 111,100,101,46,10,10,32,32,32,32,32,32,32,32,82,101, ++ 97,100,105,110,103,32,111,102,32,98,121,116,101,99,111,100, ++ 101,32,114,101,113,117,105,114,101,115,32,112,97,116,104,95, ++ 115,116,97,116,115,32,116,111,32,98,101,32,105,109,112,108, ++ 101,109,101,110,116,101,100,46,32,84,111,32,119,114,105,116, ++ 101,10,32,32,32,32,32,32,32,32,98,121,116,101,99,111, ++ 100,101,44,32,115,101,116,95,100,97,116,97,32,109,117,115, ++ 116,32,97,108,115,111,32,98,101,32,105,109,112,108,101,109, ++ 101,110,116,101,100,46,10,10,32,32,32,32,32,32,32,32, ++ 78,114,183,0,0,0,114,187,0,0,0,114,67,0,0,0, ++ 114,35,0,0,0,122,13,123,125,32,109,97,116,99,104,101, ++ 115,32,123,125,114,140,0,0,0,114,141,0,0,0,122,19, ++ 99,111,100,101,32,111,98,106,101,99,116,32,102,114,111,109, ++ 32,123,125,122,10,119,114,111,116,101,32,123,33,114,125,41, ++ 19,114,237,0,0,0,114,132,0,0,0,114,124,0,0,0, ++ 114,35,1,0,0,114,33,1,0,0,114,14,0,0,0,114, ++ 38,1,0,0,114,40,0,0,0,114,190,0,0,0,114,153, ++ 0,0,0,114,186,0,0,0,114,152,0,0,0,114,195,0, ++ 0,0,114,43,1,0,0,114,7,0,0,0,218,19,100,111, ++ 110,116,95,119,114,105,116,101,95,98,121,116,101,99,111,100, ++ 101,114,198,0,0,0,114,31,0,0,0,114,37,1,0,0, ++ 41,10,114,71,0,0,0,114,158,0,0,0,114,141,0,0, ++ 0,114,188,0,0,0,114,140,0,0,0,218,2,115,116,114, ++ 53,0,0,0,218,10,98,121,116,101,115,95,100,97,116,97, ++ 114,201,0,0,0,90,11,99,111,100,101,95,111,98,106,101, ++ 99,116,114,4,0,0,0,114,4,0,0,0,114,5,0,0, ++ 0,114,15,1,0,0,219,5,0,0,115,78,0,0,0,0, ++ 7,15,1,6,1,3,1,16,1,13,1,11,2,3,1,19, ++ 1,13,1,5,2,16,1,3,1,19,1,13,1,5,2,3, ++ 1,9,1,12,1,13,1,19,1,5,2,9,1,7,1,15, ++ 1,6,1,7,1,15,1,18,1,13,1,22,1,12,1,9, ++ 1,15,1,3,1,19,1,17,1,13,1,8,1,122,21,83, ++ 111,117,114,99,101,76,111,97,100,101,114,46,103,101,116,95, ++ 99,111,100,101,78,114,138,0,0,0,41,10,114,57,0,0, ++ 0,114,56,0,0,0,114,58,0,0,0,114,34,1,0,0, ++ 114,35,1,0,0,114,37,1,0,0,114,36,1,0,0,114, ++ 16,1,0,0,114,43,1,0,0,114,15,1,0,0,114,4, ++ 0,0,0,114,4,0,0,0,114,4,0,0,0,114,5,0, ++ 0,0,114,32,1,0,0,161,5,0,0,115,14,0,0,0, ++ 12,2,12,8,12,13,12,10,12,7,12,10,18,8,114,32, ++ 1,0,0,99,0,0,0,0,0,0,0,0,0,0,0,0, ++ 4,0,0,0,0,0,0,0,115,88,0,0,0,101,0,0, ++ 90,1,0,100,0,0,90,2,0,100,1,0,90,3,0,100, ++ 2,0,100,3,0,132,0,0,90,4,0,101,5,0,135,0, ++ 0,102,1,0,100,4,0,100,5,0,134,0,0,131,1,0, ++ 90,6,0,101,5,0,100,6,0,100,7,0,132,0,0,131, ++ 1,0,90,7,0,100,8,0,100,9,0,132,0,0,90,8, ++ 0,135,0,0,83,41,10,218,10,70,105,108,101,76,111,97, ++ 100,101,114,122,103,66,97,115,101,32,102,105,108,101,32,108, ++ 111,97,100,101,114,32,99,108,97,115,115,32,119,104,105,99, ++ 104,32,105,109,112,108,101,109,101,110,116,115,32,116,104,101, ++ 32,108,111,97,100,101,114,32,112,114,111,116,111,99,111,108, ++ 32,109,101,116,104,111,100,115,32,116,104,97,116,10,32,32, ++ 32,32,114,101,113,117,105,114,101,32,102,105,108,101,32,115, ++ 121,115,116,101,109,32,117,115,97,103,101,46,99,3,0,0, ++ 0,0,0,0,0,3,0,0,0,2,0,0,0,67,0,0, ++ 0,115,22,0,0,0,124,1,0,124,0,0,95,0,0,124, ++ 2,0,124,0,0,95,1,0,100,1,0,83,41,2,122,75, ++ 67,97,99,104,101,32,116,104,101,32,109,111,100,117,108,101, ++ 32,110,97,109,101,32,97,110,100,32,116,104,101,32,112,97, ++ 116,104,32,116,111,32,116,104,101,32,102,105,108,101,32,102, ++ 111,117,110,100,32,98,121,32,116,104,101,10,32,32,32,32, ++ 32,32,32,32,102,105,110,100,101,114,46,78,41,2,114,67, ++ 0,0,0,114,35,0,0,0,41,3,114,71,0,0,0,114, ++ 158,0,0,0,114,35,0,0,0,114,4,0,0,0,114,4, ++ 0,0,0,114,5,0,0,0,114,72,0,0,0,20,6,0, ++ 0,115,4,0,0,0,0,3,9,1,122,19,70,105,108,101, ++ 76,111,97,100,101,114,46,95,95,105,110,105,116,95,95,99, ++ 2,0,0,0,0,0,0,0,2,0,0,0,3,0,0,0, ++ 3,0,0,0,115,22,0,0,0,116,0,0,116,1,0,124, ++ 0,0,131,2,0,106,2,0,124,1,0,131,1,0,83,41, ++ 1,122,26,76,111,97,100,32,97,32,109,111,100,117,108,101, ++ 32,102,114,111,109,32,97,32,102,105,108,101,46,41,3,218, ++ 5,115,117,112,101,114,114,47,1,0,0,114,6,1,0,0, ++ 41,2,114,71,0,0,0,114,158,0,0,0,41,1,114,224, ++ 0,0,0,114,4,0,0,0,114,5,0,0,0,114,6,1, ++ 0,0,26,6,0,0,115,2,0,0,0,0,7,122,22,70, ++ 105,108,101,76,111,97,100,101,114,46,108,111,97,100,95,109, ++ 111,100,117,108,101,99,2,0,0,0,0,0,0,0,2,0, ++ 0,0,1,0,0,0,67,0,0,0,115,7,0,0,0,124, ++ 0,0,106,0,0,83,41,1,122,58,82,101,116,117,114,110, ++ 32,116,104,101,32,112,97,116,104,32,116,111,32,116,104,101, ++ 32,115,111,117,114,99,101,32,102,105,108,101,32,97,115,32, ++ 102,111,117,110,100,32,98,121,32,116,104,101,32,102,105,110, ++ 100,101,114,46,41,1,114,35,0,0,0,41,2,114,71,0, ++ 0,0,114,158,0,0,0,114,4,0,0,0,114,4,0,0, ++ 0,114,5,0,0,0,114,237,0,0,0,35,6,0,0,115, ++ 2,0,0,0,0,3,122,23,70,105,108,101,76,111,97,100, ++ 101,114,46,103,101,116,95,102,105,108,101,110,97,109,101,99, ++ 2,0,0,0,0,0,0,0,3,0,0,0,8,0,0,0, ++ 67,0,0,0,115,41,0,0,0,116,0,0,106,1,0,124, ++ 1,0,100,1,0,131,2,0,143,17,0,125,2,0,124,2, ++ 0,106,2,0,131,0,0,83,87,100,2,0,81,88,100,2, ++ 0,83,41,3,122,39,82,101,116,117,114,110,32,116,104,101, ++ 32,100,97,116,97,32,102,114,111,109,32,112,97,116,104,32, ++ 97,115,32,114,97,119,32,98,121,116,101,115,46,218,1,114, ++ 78,41,3,114,49,0,0,0,114,50,0,0,0,90,4,114, ++ 101,97,100,41,3,114,71,0,0,0,114,35,0,0,0,114, ++ 54,0,0,0,114,4,0,0,0,114,4,0,0,0,114,5, ++ 0,0,0,114,38,1,0,0,40,6,0,0,115,4,0,0, ++ 0,0,2,21,1,122,19,70,105,108,101,76,111,97,100,101, ++ 114,46,103,101,116,95,100,97,116,97,41,9,114,57,0,0, ++ 0,114,56,0,0,0,114,58,0,0,0,114,59,0,0,0, ++ 114,72,0,0,0,114,156,0,0,0,114,6,1,0,0,114, ++ 237,0,0,0,114,38,1,0,0,114,4,0,0,0,114,4, ++ 0,0,0,41,1,114,224,0,0,0,114,5,0,0,0,114, ++ 47,1,0,0,15,6,0,0,115,10,0,0,0,12,3,6, ++ 2,12,6,24,9,18,5,114,47,1,0,0,99,0,0,0, ++ 0,0,0,0,0,0,0,0,0,4,0,0,0,64,0,0, ++ 0,115,64,0,0,0,101,0,0,90,1,0,100,0,0,90, ++ 2,0,100,1,0,90,3,0,100,2,0,100,3,0,132,0, ++ 0,90,4,0,100,4,0,100,5,0,132,0,0,90,5,0, ++ 100,6,0,100,7,0,100,8,0,100,9,0,132,0,1,90, ++ 6,0,100,10,0,83,41,11,218,16,83,111,117,114,99,101, ++ 70,105,108,101,76,111,97,100,101,114,122,62,67,111,110,99, ++ 114,101,116,101,32,105,109,112,108,101,109,101,110,116,97,116, ++ 105,111,110,32,111,102,32,83,111,117,114,99,101,76,111,97, ++ 100,101,114,32,117,115,105,110,103,32,116,104,101,32,102,105, ++ 108,101,32,115,121,115,116,101,109,46,99,2,0,0,0,0, ++ 0,0,0,3,0,0,0,3,0,0,0,67,0,0,0,115, ++ 36,0,0,0,116,0,0,124,1,0,131,1,0,125,2,0, ++ 105,2,0,124,2,0,106,1,0,100,1,0,54,124,2,0, ++ 106,2,0,100,2,0,54,83,41,3,122,33,82,101,116,117, ++ 114,110,32,116,104,101,32,109,101,116,97,100,97,116,97,32, ++ 102,111,114,32,116,104,101,32,112,97,116,104,46,114,183,0, ++ 0,0,114,184,0,0,0,41,3,114,39,0,0,0,218,8, ++ 115,116,95,109,116,105,109,101,90,7,115,116,95,115,105,122, ++ 101,41,3,114,71,0,0,0,114,35,0,0,0,114,45,1, + 0,0,114,4,0,0,0,114,4,0,0,0,114,5,0,0, +- 0,114,9,1,0,0,112,5,0,0,115,8,0,0,0,0, +- 3,18,1,12,1,7,2,122,33,87,105,110,100,111,119,115, +- 82,101,103,105,115,116,114,121,70,105,110,100,101,114,46,102, +- 105,110,100,95,109,111,100,117,108,101,41,12,114,57,0,0, +- 0,114,56,0,0,0,114,58,0,0,0,114,59,0,0,0, +- 114,22,1,0,0,114,21,1,0,0,114,20,1,0,0,114, +- 4,1,0,0,114,19,1,0,0,114,25,1,0,0,114,8, +- 1,0,0,114,9,1,0,0,114,4,0,0,0,114,4,0, +- 0,0,114,4,0,0,0,114,5,0,0,0,114,16,1,0, +- 0,62,5,0,0,115,20,0,0,0,12,2,6,3,6,3, +- 6,2,6,2,18,7,18,15,3,1,21,15,3,1,114,16, +- 1,0,0,99,0,0,0,0,0,0,0,0,0,0,0,0, +- 2,0,0,0,64,0,0,0,115,52,0,0,0,101,0,0, +- 90,1,0,100,0,0,90,2,0,100,1,0,90,3,0,100, +- 2,0,100,3,0,132,0,0,90,4,0,100,4,0,100,5, +- 0,132,0,0,90,5,0,101,6,0,90,7,0,100,6,0, +- 83,41,7,218,13,95,76,111,97,100,101,114,66,97,115,105, +- 99,115,122,83,66,97,115,101,32,99,108,97,115,115,32,111, +- 102,32,99,111,109,109,111,110,32,99,111,100,101,32,110,101, +- 101,100,101,100,32,98,121,32,98,111,116,104,32,83,111,117, +- 114,99,101,76,111,97,100,101,114,32,97,110,100,10,32,32, +- 32,32,83,111,117,114,99,101,108,101,115,115,70,105,108,101, +- 76,111,97,100,101,114,46,99,2,0,0,0,0,0,0,0, +- 5,0,0,0,3,0,0,0,67,0,0,0,115,88,0,0, +- 0,116,0,0,124,0,0,106,1,0,124,1,0,131,1,0, +- 131,1,0,100,1,0,25,125,2,0,124,2,0,106,2,0, +- 100,2,0,100,1,0,131,2,0,100,3,0,25,125,3,0, +- 124,1,0,106,3,0,100,2,0,131,1,0,100,4,0,25, +- 125,4,0,124,3,0,100,5,0,107,2,0,111,87,0,124, +- 4,0,100,5,0,107,3,0,83,41,6,122,141,67,111,110, +- 99,114,101,116,101,32,105,109,112,108,101,109,101,110,116,97, +- 116,105,111,110,32,111,102,32,73,110,115,112,101,99,116,76, +- 111,97,100,101,114,46,105,115,95,112,97,99,107,97,103,101, +- 32,98,121,32,99,104,101,99,107,105,110,103,32,105,102,10, +- 32,32,32,32,32,32,32,32,116,104,101,32,112,97,116,104, +- 32,114,101,116,117,114,110,101,100,32,98,121,32,103,101,116, +- 95,102,105,108,101,110,97,109,101,32,104,97,115,32,97,32, +- 102,105,108,101,110,97,109,101,32,111,102,32,39,95,95,105, +- 110,105,116,95,95,46,112,121,39,46,114,29,0,0,0,114, +- 110,0,0,0,114,71,0,0,0,114,109,0,0,0,114,79, +- 0,0,0,41,4,114,38,0,0,0,114,231,0,0,0,114, +- 34,0,0,0,114,32,0,0,0,41,5,114,78,0,0,0, +- 114,152,0,0,0,114,125,0,0,0,90,13,102,105,108,101, +- 110,97,109,101,95,98,97,115,101,90,9,116,97,105,108,95, +- 110,97,109,101,114,4,0,0,0,114,4,0,0,0,114,5, +- 0,0,0,114,216,0,0,0,128,5,0,0,115,8,0,0, +- 0,0,3,25,1,22,1,19,1,122,24,95,76,111,97,100, +- 101,114,66,97,115,105,99,115,46,105,115,95,112,97,99,107, +- 97,103,101,99,2,0,0,0,0,0,0,0,3,0,0,0, +- 4,0,0,0,67,0,0,0,115,80,0,0,0,124,0,0, +- 106,0,0,124,1,0,106,1,0,131,1,0,125,2,0,124, +- 2,0,100,1,0,107,8,0,114,57,0,116,2,0,100,2, +- 0,106,3,0,124,1,0,106,1,0,131,1,0,131,1,0, +- 130,1,0,110,0,0,116,4,0,116,5,0,124,2,0,124, +- 1,0,106,6,0,131,3,0,1,100,1,0,83,41,3,122, +- 19,69,120,101,99,117,116,101,32,116,104,101,32,109,111,100, +- 117,108,101,46,78,122,52,99,97,110,110,111,116,32,108,111, +- 97,100,32,109,111,100,117,108,101,32,123,33,114,125,32,119, +- 104,101,110,32,103,101,116,95,99,111,100,101,40,41,32,114, +- 101,116,117,114,110,115,32,78,111,110,101,41,7,114,10,1, +- 0,0,114,57,0,0,0,114,147,0,0,0,114,47,0,0, +- 0,114,108,0,0,0,114,170,0,0,0,114,63,0,0,0, +- 41,3,114,78,0,0,0,114,174,0,0,0,114,189,0,0, +- 0,114,4,0,0,0,114,4,0,0,0,114,5,0,0,0, +- 114,253,0,0,0,136,5,0,0,115,10,0,0,0,0,2, +- 18,1,12,1,3,1,24,1,122,25,95,76,111,97,100,101, +- 114,66,97,115,105,99,115,46,101,120,101,99,95,109,111,100, +- 117,108,101,78,41,8,114,57,0,0,0,114,56,0,0,0, +- 114,58,0,0,0,114,59,0,0,0,114,216,0,0,0,114, +- 253,0,0,0,114,175,0,0,0,114,0,1,0,0,114,4, ++ 0,114,35,1,0,0,50,6,0,0,115,4,0,0,0,0, ++ 2,12,1,122,27,83,111,117,114,99,101,70,105,108,101,76, ++ 111,97,100,101,114,46,112,97,116,104,95,115,116,97,116,115, ++ 99,4,0,0,0,0,0,0,0,5,0,0,0,5,0,0, ++ 0,67,0,0,0,115,34,0,0,0,116,0,0,124,1,0, ++ 131,1,0,125,4,0,124,0,0,106,1,0,124,2,0,124, ++ 3,0,100,1,0,124,4,0,131,2,1,83,41,2,78,218, ++ 5,95,109,111,100,101,41,2,114,144,0,0,0,114,36,1, ++ 0,0,41,5,114,71,0,0,0,114,141,0,0,0,114,140, ++ 0,0,0,114,53,0,0,0,114,42,0,0,0,114,4,0, ++ 0,0,114,4,0,0,0,114,5,0,0,0,114,37,1,0, ++ 0,55,6,0,0,115,4,0,0,0,0,2,12,1,122,32, ++ 83,111,117,114,99,101,70,105,108,101,76,111,97,100,101,114, ++ 46,95,99,97,99,104,101,95,98,121,116,101,99,111,100,101, ++ 114,52,1,0,0,105,182,1,0,0,99,3,0,0,0,1, ++ 0,0,0,9,0,0,0,18,0,0,0,67,0,0,0,115, ++ 53,1,0,0,116,0,0,124,1,0,131,1,0,92,2,0, ++ 125,4,0,125,5,0,103,0,0,125,6,0,120,54,0,124, ++ 4,0,114,80,0,116,1,0,124,4,0,131,1,0,12,114, ++ 80,0,116,0,0,124,4,0,131,1,0,92,2,0,125,4, ++ 0,125,7,0,124,6,0,106,2,0,124,7,0,131,1,0, ++ 1,113,27,0,87,120,132,0,116,3,0,124,6,0,131,1, ++ 0,68,93,118,0,125,7,0,116,4,0,124,4,0,124,7, ++ 0,131,2,0,125,4,0,121,17,0,116,5,0,106,6,0, ++ 124,4,0,131,1,0,1,87,113,94,0,4,116,7,0,107, ++ 10,0,114,155,0,1,1,1,119,94,0,89,113,94,0,4, ++ 116,8,0,107,10,0,114,211,0,1,125,8,0,1,122,25, ++ 0,116,9,0,100,1,0,124,4,0,124,8,0,131,3,0, ++ 1,100,2,0,83,87,89,100,2,0,100,2,0,125,8,0, ++ 126,8,0,88,113,94,0,88,113,94,0,87,121,33,0,116, ++ 10,0,124,1,0,124,2,0,124,3,0,131,3,0,1,116, ++ 9,0,100,3,0,124,1,0,131,2,0,1,87,110,53,0, ++ 4,116,8,0,107,10,0,114,48,1,1,125,8,0,1,122, ++ 21,0,116,9,0,100,1,0,124,1,0,124,8,0,131,3, ++ 0,1,87,89,100,2,0,100,2,0,125,8,0,126,8,0, ++ 88,110,1,0,88,100,2,0,83,41,4,122,27,87,114,105, ++ 116,101,32,98,121,116,101,115,32,100,97,116,97,32,116,111, ++ 32,97,32,102,105,108,101,46,122,27,99,111,117,108,100,32, ++ 110,111,116,32,99,114,101,97,116,101,32,123,33,114,125,58, ++ 32,123,33,114,125,78,122,12,99,114,101,97,116,101,100,32, ++ 123,33,114,125,41,11,114,38,0,0,0,114,46,0,0,0, ++ 114,223,0,0,0,114,33,0,0,0,114,28,0,0,0,114, ++ 3,0,0,0,90,5,109,107,100,105,114,218,15,70,105,108, ++ 101,69,120,105,115,116,115,69,114,114,111,114,114,40,0,0, ++ 0,114,152,0,0,0,114,55,0,0,0,41,9,114,71,0, ++ 0,0,114,35,0,0,0,114,53,0,0,0,114,52,1,0, ++ 0,114,232,0,0,0,114,131,0,0,0,114,27,0,0,0, ++ 114,23,0,0,0,114,39,1,0,0,114,4,0,0,0,114, ++ 4,0,0,0,114,5,0,0,0,114,36,1,0,0,60,6, ++ 0,0,115,38,0,0,0,0,2,18,1,6,2,22,1,18, ++ 1,17,2,19,1,15,1,3,1,17,1,13,2,7,1,18, ++ 3,16,1,27,1,3,1,16,1,17,1,18,2,122,25,83, ++ 111,117,114,99,101,70,105,108,101,76,111,97,100,101,114,46, ++ 115,101,116,95,100,97,116,97,78,41,7,114,57,0,0,0, ++ 114,56,0,0,0,114,58,0,0,0,114,59,0,0,0,114, ++ 35,1,0,0,114,37,1,0,0,114,36,1,0,0,114,4, + 0,0,0,114,4,0,0,0,114,4,0,0,0,114,5,0, +- 0,0,114,26,1,0,0,122,5,0,0,115,8,0,0,0, +- 12,3,6,3,12,8,12,8,114,26,1,0,0,99,0,0, +- 0,0,0,0,0,0,0,0,0,0,4,0,0,0,64,0, +- 0,0,115,106,0,0,0,101,0,0,90,1,0,100,0,0, +- 90,2,0,100,1,0,100,2,0,132,0,0,90,3,0,100, +- 3,0,100,4,0,132,0,0,90,4,0,100,5,0,100,6, +- 0,132,0,0,90,5,0,100,7,0,100,8,0,132,0,0, +- 90,6,0,100,9,0,100,10,0,132,0,0,90,7,0,100, +- 11,0,100,18,0,100,13,0,100,14,0,132,0,1,90,8, +- 0,100,15,0,100,16,0,132,0,0,90,9,0,100,17,0, +- 83,41,19,218,12,83,111,117,114,99,101,76,111,97,100,101, +- 114,99,2,0,0,0,0,0,0,0,2,0,0,0,1,0, +- 0,0,67,0,0,0,115,10,0,0,0,116,0,0,130,1, +- 0,100,1,0,83,41,2,122,178,79,112,116,105,111,110,97, +- 108,32,109,101,116,104,111,100,32,116,104,97,116,32,114,101, +- 116,117,114,110,115,32,116,104,101,32,109,111,100,105,102,105, +- 99,97,116,105,111,110,32,116,105,109,101,32,40,97,110,32, +- 105,110,116,41,32,102,111,114,32,116,104,101,10,32,32,32, +- 32,32,32,32,32,115,112,101,99,105,102,105,101,100,32,112, +- 97,116,104,44,32,119,104,101,114,101,32,112,97,116,104,32, +- 105,115,32,97,32,115,116,114,46,10,10,32,32,32,32,32, +- 32,32,32,82,97,105,115,101,115,32,73,79,69,114,114,111, +- 114,32,119,104,101,110,32,116,104,101,32,112,97,116,104,32, +- 99,97,110,110,111,116,32,98,101,32,104,97,110,100,108,101, +- 100,46,10,32,32,32,32,32,32,32,32,78,41,1,218,7, +- 73,79,69,114,114,111,114,41,2,114,78,0,0,0,114,35, +- 0,0,0,114,4,0,0,0,114,4,0,0,0,114,5,0, +- 0,0,218,10,112,97,116,104,95,109,116,105,109,101,149,5, +- 0,0,115,2,0,0,0,0,6,122,23,83,111,117,114,99, +- 101,76,111,97,100,101,114,46,112,97,116,104,95,109,116,105, +- 109,101,99,2,0,0,0,0,0,0,0,2,0,0,0,3, +- 0,0,0,67,0,0,0,115,20,0,0,0,105,1,0,124, +- 0,0,106,0,0,124,1,0,131,1,0,100,1,0,54,83, +- 41,2,97,170,1,0,0,79,112,116,105,111,110,97,108,32, +- 109,101,116,104,111,100,32,114,101,116,117,114,110,105,110,103, +- 32,97,32,109,101,116,97,100,97,116,97,32,100,105,99,116, +- 32,102,111,114,32,116,104,101,32,115,112,101,99,105,102,105, +- 101,100,32,112,97,116,104,10,32,32,32,32,32,32,32,32, +- 116,111,32,98,121,32,116,104,101,32,112,97,116,104,32,40, +- 115,116,114,41,46,10,32,32,32,32,32,32,32,32,80,111, +- 115,115,105,98,108,101,32,107,101,121,115,58,10,32,32,32, +- 32,32,32,32,32,45,32,39,109,116,105,109,101,39,32,40, +- 109,97,110,100,97,116,111,114,121,41,32,105,115,32,116,104, +- 101,32,110,117,109,101,114,105,99,32,116,105,109,101,115,116, +- 97,109,112,32,111,102,32,108,97,115,116,32,115,111,117,114, +- 99,101,10,32,32,32,32,32,32,32,32,32,32,99,111,100, +- 101,32,109,111,100,105,102,105,99,97,116,105,111,110,59,10, +- 32,32,32,32,32,32,32,32,45,32,39,115,105,122,101,39, +- 32,40,111,112,116,105,111,110,97,108,41,32,105,115,32,116, +- 104,101,32,115,105,122,101,32,105,110,32,98,121,116,101,115, +- 32,111,102,32,116,104,101,32,115,111,117,114,99,101,32,99, +- 111,100,101,46,10,10,32,32,32,32,32,32,32,32,73,109, +- 112,108,101,109,101,110,116,105,110,103,32,116,104,105,115,32, +- 109,101,116,104,111,100,32,97,108,108,111,119,115,32,116,104, +- 101,32,108,111,97,100,101,114,32,116,111,32,114,101,97,100, +- 32,98,121,116,101,99,111,100,101,32,102,105,108,101,115,46, +- 10,32,32,32,32,32,32,32,32,82,97,105,115,101,115,32, +- 73,79,69,114,114,111,114,32,119,104,101,110,32,116,104,101, +- 32,112,97,116,104,32,99,97,110,110,111,116,32,98,101,32, +- 104,97,110,100,108,101,100,46,10,32,32,32,32,32,32,32, +- 32,114,178,0,0,0,41,1,114,29,1,0,0,41,2,114, +- 78,0,0,0,114,35,0,0,0,114,4,0,0,0,114,4, +- 0,0,0,114,5,0,0,0,218,10,112,97,116,104,95,115, +- 116,97,116,115,157,5,0,0,115,2,0,0,0,0,11,122, +- 23,83,111,117,114,99,101,76,111,97,100,101,114,46,112,97, +- 116,104,95,115,116,97,116,115,99,4,0,0,0,0,0,0, +- 0,4,0,0,0,3,0,0,0,67,0,0,0,115,16,0, +- 0,0,124,0,0,106,0,0,124,2,0,124,3,0,131,2, +- 0,83,41,1,122,228,79,112,116,105,111,110,97,108,32,109, +- 101,116,104,111,100,32,119,104,105,99,104,32,119,114,105,116, +- 101,115,32,100,97,116,97,32,40,98,121,116,101,115,41,32, +- 116,111,32,97,32,102,105,108,101,32,112,97,116,104,32,40, +- 97,32,115,116,114,41,46,10,10,32,32,32,32,32,32,32, +- 32,73,109,112,108,101,109,101,110,116,105,110,103,32,116,104, +- 105,115,32,109,101,116,104,111,100,32,97,108,108,111,119,115, +- 32,102,111,114,32,116,104,101,32,119,114,105,116,105,110,103, +- 32,111,102,32,98,121,116,101,99,111,100,101,32,102,105,108, +- 101,115,46,10,10,32,32,32,32,32,32,32,32,84,104,101, +- 32,115,111,117,114,99,101,32,112,97,116,104,32,105,115,32, +- 110,101,101,100,101,100,32,105,110,32,111,114,100,101,114,32, +- 116,111,32,99,111,114,114,101,99,116,108,121,32,116,114,97, +- 110,115,102,101,114,32,112,101,114,109,105,115,115,105,111,110, +- 115,10,32,32,32,32,32,32,32,32,41,1,218,8,115,101, +- 116,95,100,97,116,97,41,4,114,78,0,0,0,114,135,0, +- 0,0,90,10,99,97,99,104,101,95,112,97,116,104,114,53, +- 0,0,0,114,4,0,0,0,114,4,0,0,0,114,5,0, +- 0,0,218,15,95,99,97,99,104,101,95,98,121,116,101,99, +- 111,100,101,170,5,0,0,115,2,0,0,0,0,8,122,28, +- 83,111,117,114,99,101,76,111,97,100,101,114,46,95,99,97, +- 99,104,101,95,98,121,116,101,99,111,100,101,99,3,0,0, +- 0,0,0,0,0,3,0,0,0,1,0,0,0,67,0,0, +- 0,115,4,0,0,0,100,1,0,83,41,2,122,150,79,112, +- 116,105,111,110,97,108,32,109,101,116,104,111,100,32,119,104, +- 105,99,104,32,119,114,105,116,101,115,32,100,97,116,97,32, +- 40,98,121,116,101,115,41,32,116,111,32,97,32,102,105,108, +- 101,32,112,97,116,104,32,40,97,32,115,116,114,41,46,10, +- 10,32,32,32,32,32,32,32,32,73,109,112,108,101,109,101, +- 110,116,105,110,103,32,116,104,105,115,32,109,101,116,104,111, +- 100,32,97,108,108,111,119,115,32,102,111,114,32,116,104,101, +- 32,119,114,105,116,105,110,103,32,111,102,32,98,121,116,101, +- 99,111,100,101,32,102,105,108,101,115,46,10,32,32,32,32, +- 32,32,32,32,78,114,4,0,0,0,41,3,114,78,0,0, +- 0,114,35,0,0,0,114,53,0,0,0,114,4,0,0,0, +- 114,4,0,0,0,114,5,0,0,0,114,31,1,0,0,180, +- 5,0,0,115,0,0,0,0,122,21,83,111,117,114,99,101, +- 76,111,97,100,101,114,46,115,101,116,95,100,97,116,97,99, +- 2,0,0,0,0,0,0,0,5,0,0,0,16,0,0,0, +- 67,0,0,0,115,105,0,0,0,124,0,0,106,0,0,124, +- 1,0,131,1,0,125,2,0,121,19,0,124,0,0,106,1, +- 0,124,2,0,131,1,0,125,3,0,87,110,58,0,4,116, +- 2,0,107,10,0,114,94,0,1,125,4,0,1,122,26,0, +- 116,3,0,100,1,0,100,2,0,124,1,0,131,1,1,124, +- 4,0,130,2,0,87,89,100,3,0,100,3,0,125,4,0, +- 126,4,0,88,110,1,0,88,116,4,0,124,3,0,131,1, +- 0,83,41,4,122,52,67,111,110,99,114,101,116,101,32,105, +- 109,112,108,101,109,101,110,116,97,116,105,111,110,32,111,102, +- 32,73,110,115,112,101,99,116,76,111,97,100,101,114,46,103, +- 101,116,95,115,111,117,114,99,101,46,122,39,115,111,117,114, +- 99,101,32,110,111,116,32,97,118,97,105,108,97,98,108,101, +- 32,116,104,114,111,117,103,104,32,103,101,116,95,100,97,116, +- 97,40,41,114,67,0,0,0,78,41,5,114,231,0,0,0, +- 218,8,103,101,116,95,100,97,116,97,114,40,0,0,0,114, +- 147,0,0,0,114,198,0,0,0,41,5,114,78,0,0,0, +- 114,152,0,0,0,114,35,0,0,0,114,196,0,0,0,218, +- 3,101,120,99,114,4,0,0,0,114,4,0,0,0,114,5, +- 0,0,0,114,11,1,0,0,187,5,0,0,115,14,0,0, +- 0,0,2,15,1,3,1,19,1,18,1,9,1,31,1,122, +- 23,83,111,117,114,99,101,76,111,97,100,101,114,46,103,101, +- 116,95,115,111,117,114,99,101,218,9,95,111,112,116,105,109, +- 105,122,101,114,29,0,0,0,99,3,0,0,0,1,0,0, +- 0,4,0,0,0,9,0,0,0,67,0,0,0,115,31,0, +- 0,0,116,0,0,116,1,0,124,1,0,124,2,0,100,1, +- 0,100,2,0,100,3,0,100,4,0,124,3,0,131,4,2, +- 83,41,5,122,130,82,101,116,117,114,110,32,116,104,101,32, +- 99,111,100,101,32,111,98,106,101,99,116,32,99,111,109,112, +- 105,108,101,100,32,102,114,111,109,32,115,111,117,114,99,101, +- 46,10,10,32,32,32,32,32,32,32,32,84,104,101,32,39, +- 100,97,116,97,39,32,97,114,103,117,109,101,110,116,32,99, +- 97,110,32,98,101,32,97,110,121,32,111,98,106,101,99,116, +- 32,116,121,112,101,32,116,104,97,116,32,99,111,109,112,105, +- 108,101,40,41,32,115,117,112,112,111,114,116,115,46,10,32, +- 32,32,32,32,32,32,32,114,170,0,0,0,218,12,100,111, +- 110,116,95,105,110,104,101,114,105,116,84,114,112,0,0,0, +- 41,2,114,108,0,0,0,218,7,99,111,109,112,105,108,101, +- 41,4,114,78,0,0,0,114,53,0,0,0,114,35,0,0, +- 0,114,35,1,0,0,114,4,0,0,0,114,4,0,0,0, +- 114,5,0,0,0,218,14,115,111,117,114,99,101,95,116,111, +- 95,99,111,100,101,197,5,0,0,115,4,0,0,0,0,5, +- 18,1,122,27,83,111,117,114,99,101,76,111,97,100,101,114, +- 46,115,111,117,114,99,101,95,116,111,95,99,111,100,101,99, +- 2,0,0,0,0,0,0,0,10,0,0,0,45,0,0,0, +- 67,0,0,0,115,177,1,0,0,124,0,0,106,0,0,124, +- 1,0,131,1,0,125,2,0,100,1,0,125,3,0,121,16, +- 0,116,1,0,124,2,0,131,1,0,125,4,0,87,110,24, +- 0,4,116,2,0,107,10,0,114,63,0,1,1,1,100,1, +- 0,125,4,0,89,110,202,0,88,121,19,0,124,0,0,106, +- 3,0,124,2,0,131,1,0,125,5,0,87,110,18,0,4, +- 116,4,0,107,10,0,114,103,0,1,1,1,89,110,162,0, +- 88,116,5,0,124,5,0,100,2,0,25,131,1,0,125,3, +- 0,121,19,0,124,0,0,106,6,0,124,4,0,131,1,0, +- 125,6,0,87,110,18,0,4,116,7,0,107,10,0,114,159, +- 0,1,1,1,89,110,106,0,88,121,34,0,116,8,0,124, +- 6,0,100,3,0,124,5,0,100,4,0,124,1,0,100,5, +- 0,124,4,0,131,1,3,125,7,0,87,110,24,0,4,116, +- 9,0,116,10,0,102,2,0,107,10,0,114,220,0,1,1, +- 1,89,110,45,0,88,116,11,0,100,6,0,124,4,0,124, +- 2,0,131,3,0,1,116,12,0,124,7,0,100,4,0,124, +- 1,0,100,7,0,124,4,0,100,8,0,124,2,0,131,1, +- 3,83,124,0,0,106,6,0,124,2,0,131,1,0,125,8, +- 0,124,0,0,106,13,0,124,8,0,124,2,0,131,2,0, +- 125,9,0,116,11,0,100,9,0,124,2,0,131,2,0,1, +- 116,14,0,106,15,0,12,114,173,1,124,4,0,100,1,0, +- 107,9,0,114,173,1,124,3,0,100,1,0,107,9,0,114, +- 173,1,116,16,0,124,9,0,124,3,0,116,17,0,124,8, +- 0,131,1,0,131,3,0,125,6,0,121,36,0,124,0,0, +- 106,18,0,124,2,0,124,4,0,124,6,0,131,3,0,1, +- 116,11,0,100,10,0,124,4,0,131,2,0,1,87,113,173, +- 1,4,116,2,0,107,10,0,114,169,1,1,1,1,89,113, +- 173,1,88,110,0,0,124,9,0,83,41,11,122,190,67,111, +- 110,99,114,101,116,101,32,105,109,112,108,101,109,101,110,116, +- 97,116,105,111,110,32,111,102,32,73,110,115,112,101,99,116, +- 76,111,97,100,101,114,46,103,101,116,95,99,111,100,101,46, +- 10,10,32,32,32,32,32,32,32,32,82,101,97,100,105,110, +- 103,32,111,102,32,98,121,116,101,99,111,100,101,32,114,101, +- 113,117,105,114,101,115,32,112,97,116,104,95,115,116,97,116, +- 115,32,116,111,32,98,101,32,105,109,112,108,101,109,101,110, +- 116,101,100,46,32,84,111,32,119,114,105,116,101,10,32,32, +- 32,32,32,32,32,32,98,121,116,101,99,111,100,101,44,32, +- 115,101,116,95,100,97,116,97,32,109,117,115,116,32,97,108, +- 115,111,32,98,101,32,105,109,112,108,101,109,101,110,116,101, +- 100,46,10,10,32,32,32,32,32,32,32,32,78,114,178,0, +- 0,0,114,182,0,0,0,114,67,0,0,0,114,35,0,0, +- 0,122,13,123,125,32,109,97,116,99,104,101,115,32,123,125, +- 114,134,0,0,0,114,135,0,0,0,122,19,99,111,100,101, +- 32,111,98,106,101,99,116,32,102,114,111,109,32,123,125,122, +- 10,119,114,111,116,101,32,123,33,114,125,41,19,114,231,0, +- 0,0,114,126,0,0,0,114,118,0,0,0,114,30,1,0, +- 0,114,28,1,0,0,114,14,0,0,0,114,33,1,0,0, +- 114,40,0,0,0,114,185,0,0,0,114,147,0,0,0,114, +- 181,0,0,0,114,146,0,0,0,114,190,0,0,0,114,38, +- 1,0,0,114,7,0,0,0,218,19,100,111,110,116,95,119, +- 114,105,116,101,95,98,121,116,101,99,111,100,101,114,193,0, +- 0,0,114,31,0,0,0,114,32,1,0,0,41,10,114,78, +- 0,0,0,114,152,0,0,0,114,135,0,0,0,114,183,0, +- 0,0,114,134,0,0,0,218,2,115,116,114,53,0,0,0, +- 218,10,98,121,116,101,115,95,100,97,116,97,114,196,0,0, +- 0,90,11,99,111,100,101,95,111,98,106,101,99,116,114,4, +- 0,0,0,114,4,0,0,0,114,5,0,0,0,114,10,1, +- 0,0,205,5,0,0,115,78,0,0,0,0,7,15,1,6, +- 1,3,1,16,1,13,1,11,2,3,1,19,1,13,1,5, +- 2,16,1,3,1,19,1,13,1,5,2,3,1,9,1,12, +- 1,13,1,19,1,5,2,9,1,7,1,15,1,6,1,7, +- 1,15,1,18,1,13,1,22,1,12,1,9,1,15,1,3, +- 1,19,1,17,1,13,1,8,1,122,21,83,111,117,114,99, +- 101,76,111,97,100,101,114,46,103,101,116,95,99,111,100,101, +- 78,114,132,0,0,0,41,10,114,57,0,0,0,114,56,0, +- 0,0,114,58,0,0,0,114,29,1,0,0,114,30,1,0, +- 0,114,32,1,0,0,114,31,1,0,0,114,11,1,0,0, +- 114,38,1,0,0,114,10,1,0,0,114,4,0,0,0,114, +- 4,0,0,0,114,4,0,0,0,114,5,0,0,0,114,27, +- 1,0,0,147,5,0,0,115,14,0,0,0,12,2,12,8, +- 12,13,12,10,12,7,12,10,18,8,114,27,1,0,0,99, +- 0,0,0,0,0,0,0,0,0,0,0,0,4,0,0,0, +- 0,0,0,0,115,88,0,0,0,101,0,0,90,1,0,100, +- 0,0,90,2,0,100,1,0,90,3,0,100,2,0,100,3, +- 0,132,0,0,90,4,0,101,5,0,135,0,0,102,1,0, +- 100,4,0,100,5,0,134,0,0,131,1,0,90,6,0,101, +- 5,0,100,6,0,100,7,0,132,0,0,131,1,0,90,7, +- 0,100,8,0,100,9,0,132,0,0,90,8,0,135,0,0, +- 83,41,10,218,10,70,105,108,101,76,111,97,100,101,114,122, +- 103,66,97,115,101,32,102,105,108,101,32,108,111,97,100,101, +- 114,32,99,108,97,115,115,32,119,104,105,99,104,32,105,109, +- 112,108,101,109,101,110,116,115,32,116,104,101,32,108,111,97, +- 100,101,114,32,112,114,111,116,111,99,111,108,32,109,101,116, +- 104,111,100,115,32,116,104,97,116,10,32,32,32,32,114,101, +- 113,117,105,114,101,32,102,105,108,101,32,115,121,115,116,101, +- 109,32,117,115,97,103,101,46,99,3,0,0,0,0,0,0, +- 0,3,0,0,0,2,0,0,0,67,0,0,0,115,22,0, +- 0,0,124,1,0,124,0,0,95,0,0,124,2,0,124,0, +- 0,95,1,0,100,1,0,83,41,2,122,75,67,97,99,104, +- 101,32,116,104,101,32,109,111,100,117,108,101,32,110,97,109, +- 101,32,97,110,100,32,116,104,101,32,112,97,116,104,32,116, +- 111,32,116,104,101,32,102,105,108,101,32,102,111,117,110,100, +- 32,98,121,32,116,104,101,10,32,32,32,32,32,32,32,32, +- 102,105,110,100,101,114,46,78,41,2,114,67,0,0,0,114, +- 35,0,0,0,41,3,114,78,0,0,0,114,152,0,0,0, +- 114,35,0,0,0,114,4,0,0,0,114,4,0,0,0,114, +- 5,0,0,0,114,79,0,0,0,6,6,0,0,115,4,0, +- 0,0,0,3,9,1,122,19,70,105,108,101,76,111,97,100, +- 101,114,46,95,95,105,110,105,116,95,95,99,2,0,0,0, +- 0,0,0,0,2,0,0,0,3,0,0,0,3,0,0,0, +- 115,22,0,0,0,116,0,0,116,1,0,124,0,0,131,2, +- 0,106,2,0,124,1,0,131,1,0,83,41,1,122,26,76, +- 111,97,100,32,97,32,109,111,100,117,108,101,32,102,114,111, +- 109,32,97,32,102,105,108,101,46,41,3,218,5,115,117,112, +- 101,114,114,42,1,0,0,114,0,1,0,0,41,2,114,78, +- 0,0,0,114,152,0,0,0,41,1,114,221,0,0,0,114, +- 4,0,0,0,114,5,0,0,0,114,0,1,0,0,12,6, +- 0,0,115,2,0,0,0,0,7,122,22,70,105,108,101,76, +- 111,97,100,101,114,46,108,111,97,100,95,109,111,100,117,108, +- 101,99,2,0,0,0,0,0,0,0,2,0,0,0,1,0, +- 0,0,67,0,0,0,115,7,0,0,0,124,0,0,106,0, +- 0,83,41,1,122,58,82,101,116,117,114,110,32,116,104,101, +- 32,112,97,116,104,32,116,111,32,116,104,101,32,115,111,117, +- 114,99,101,32,102,105,108,101,32,97,115,32,102,111,117,110, +- 100,32,98,121,32,116,104,101,32,102,105,110,100,101,114,46, +- 41,1,114,35,0,0,0,41,2,114,78,0,0,0,114,152, +- 0,0,0,114,4,0,0,0,114,4,0,0,0,114,5,0, +- 0,0,114,231,0,0,0,21,6,0,0,115,2,0,0,0, +- 0,3,122,23,70,105,108,101,76,111,97,100,101,114,46,103, +- 101,116,95,102,105,108,101,110,97,109,101,99,2,0,0,0, +- 0,0,0,0,3,0,0,0,8,0,0,0,67,0,0,0, +- 115,41,0,0,0,116,0,0,106,1,0,124,1,0,100,1, +- 0,131,2,0,143,17,0,125,2,0,124,2,0,106,2,0, +- 131,0,0,83,87,100,2,0,81,88,100,2,0,83,41,3, +- 122,39,82,101,116,117,114,110,32,116,104,101,32,100,97,116, +- 97,32,102,114,111,109,32,112,97,116,104,32,97,115,32,114, +- 97,119,32,98,121,116,101,115,46,218,1,114,78,41,3,114, +- 49,0,0,0,114,50,0,0,0,90,4,114,101,97,100,41, +- 3,114,78,0,0,0,114,35,0,0,0,114,54,0,0,0, +- 114,4,0,0,0,114,4,0,0,0,114,5,0,0,0,114, +- 33,1,0,0,26,6,0,0,115,4,0,0,0,0,2,21, +- 1,122,19,70,105,108,101,76,111,97,100,101,114,46,103,101, +- 116,95,100,97,116,97,41,9,114,57,0,0,0,114,56,0, +- 0,0,114,58,0,0,0,114,59,0,0,0,114,79,0,0, +- 0,114,150,0,0,0,114,0,1,0,0,114,231,0,0,0, +- 114,33,1,0,0,114,4,0,0,0,114,4,0,0,0,41, +- 1,114,221,0,0,0,114,5,0,0,0,114,42,1,0,0, +- 1,6,0,0,115,10,0,0,0,12,3,6,2,12,6,24, +- 9,18,5,114,42,1,0,0,99,0,0,0,0,0,0,0, +- 0,0,0,0,0,4,0,0,0,64,0,0,0,115,64,0, +- 0,0,101,0,0,90,1,0,100,0,0,90,2,0,100,1, +- 0,90,3,0,100,2,0,100,3,0,132,0,0,90,4,0, +- 100,4,0,100,5,0,132,0,0,90,5,0,100,6,0,100, +- 7,0,100,8,0,100,9,0,132,0,1,90,6,0,100,10, +- 0,83,41,11,218,16,83,111,117,114,99,101,70,105,108,101, +- 76,111,97,100,101,114,122,62,67,111,110,99,114,101,116,101, +- 32,105,109,112,108,101,109,101,110,116,97,116,105,111,110,32, +- 111,102,32,83,111,117,114,99,101,76,111,97,100,101,114,32, +- 117,115,105,110,103,32,116,104,101,32,102,105,108,101,32,115, +- 121,115,116,101,109,46,99,2,0,0,0,0,0,0,0,3, +- 0,0,0,3,0,0,0,67,0,0,0,115,36,0,0,0, +- 116,0,0,124,1,0,131,1,0,125,2,0,105,2,0,124, +- 2,0,106,1,0,100,1,0,54,124,2,0,106,2,0,100, +- 2,0,54,83,41,3,122,33,82,101,116,117,114,110,32,116, +- 104,101,32,109,101,116,97,100,97,116,97,32,102,111,114,32, +- 116,104,101,32,112,97,116,104,46,114,178,0,0,0,114,179, +- 0,0,0,41,3,114,39,0,0,0,218,8,115,116,95,109, +- 116,105,109,101,90,7,115,116,95,115,105,122,101,41,3,114, +- 78,0,0,0,114,35,0,0,0,114,40,1,0,0,114,4, +- 0,0,0,114,4,0,0,0,114,5,0,0,0,114,30,1, +- 0,0,36,6,0,0,115,4,0,0,0,0,2,12,1,122, +- 27,83,111,117,114,99,101,70,105,108,101,76,111,97,100,101, +- 114,46,112,97,116,104,95,115,116,97,116,115,99,4,0,0, +- 0,0,0,0,0,5,0,0,0,5,0,0,0,67,0,0, +- 0,115,34,0,0,0,116,0,0,124,1,0,131,1,0,125, +- 4,0,124,0,0,106,1,0,124,2,0,124,3,0,100,1, +- 0,124,4,0,131,2,1,83,41,2,78,218,5,95,109,111, +- 100,101,41,2,114,138,0,0,0,114,31,1,0,0,41,5, +- 114,78,0,0,0,114,135,0,0,0,114,134,0,0,0,114, +- 53,0,0,0,114,42,0,0,0,114,4,0,0,0,114,4, +- 0,0,0,114,5,0,0,0,114,32,1,0,0,41,6,0, +- 0,115,4,0,0,0,0,2,12,1,122,32,83,111,117,114, +- 99,101,70,105,108,101,76,111,97,100,101,114,46,95,99,97, +- 99,104,101,95,98,121,116,101,99,111,100,101,114,47,1,0, +- 0,105,182,1,0,0,99,3,0,0,0,1,0,0,0,9, +- 0,0,0,18,0,0,0,67,0,0,0,115,53,1,0,0, +- 116,0,0,124,1,0,131,1,0,92,2,0,125,4,0,125, +- 5,0,103,0,0,125,6,0,120,54,0,124,4,0,114,80, +- 0,116,1,0,124,4,0,131,1,0,12,114,80,0,116,0, +- 0,124,4,0,131,1,0,92,2,0,125,4,0,125,7,0, +- 124,6,0,106,2,0,124,7,0,131,1,0,1,113,27,0, +- 87,120,132,0,116,3,0,124,6,0,131,1,0,68,93,118, +- 0,125,7,0,116,4,0,124,4,0,124,7,0,131,2,0, +- 125,4,0,121,17,0,116,5,0,106,6,0,124,4,0,131, +- 1,0,1,87,113,94,0,4,116,7,0,107,10,0,114,155, +- 0,1,1,1,119,94,0,89,113,94,0,4,116,8,0,107, +- 10,0,114,211,0,1,125,8,0,1,122,25,0,116,9,0, +- 100,1,0,124,4,0,124,8,0,131,3,0,1,100,2,0, +- 83,87,89,100,2,0,100,2,0,125,8,0,126,8,0,88, +- 113,94,0,88,113,94,0,87,121,33,0,116,10,0,124,1, +- 0,124,2,0,124,3,0,131,3,0,1,116,9,0,100,3, +- 0,124,1,0,131,2,0,1,87,110,53,0,4,116,8,0, +- 107,10,0,114,48,1,1,125,8,0,1,122,21,0,116,9, +- 0,100,1,0,124,1,0,124,8,0,131,3,0,1,87,89, +- 100,2,0,100,2,0,125,8,0,126,8,0,88,110,1,0, +- 88,100,2,0,83,41,4,122,27,87,114,105,116,101,32,98, +- 121,116,101,115,32,100,97,116,97,32,116,111,32,97,32,102, +- 105,108,101,46,122,27,99,111,117,108,100,32,110,111,116,32, +- 99,114,101,97,116,101,32,123,33,114,125,58,32,123,33,114, +- 125,78,122,12,99,114,101,97,116,101,100,32,123,33,114,125, +- 41,11,114,38,0,0,0,114,46,0,0,0,114,220,0,0, +- 0,114,33,0,0,0,114,28,0,0,0,114,3,0,0,0, +- 90,5,109,107,100,105,114,218,15,70,105,108,101,69,120,105, +- 115,116,115,69,114,114,111,114,114,40,0,0,0,114,146,0, +- 0,0,114,55,0,0,0,41,9,114,78,0,0,0,114,35, +- 0,0,0,114,53,0,0,0,114,47,1,0,0,114,228,0, +- 0,0,114,125,0,0,0,114,27,0,0,0,114,23,0,0, +- 0,114,34,1,0,0,114,4,0,0,0,114,4,0,0,0, +- 114,5,0,0,0,114,31,1,0,0,46,6,0,0,115,38, +- 0,0,0,0,2,18,1,6,2,22,1,18,1,17,2,19, +- 1,15,1,3,1,17,1,13,2,7,1,18,3,16,1,27, +- 1,3,1,16,1,17,1,18,2,122,25,83,111,117,114,99, +- 101,70,105,108,101,76,111,97,100,101,114,46,115,101,116,95, +- 100,97,116,97,78,41,7,114,57,0,0,0,114,56,0,0, +- 0,114,58,0,0,0,114,59,0,0,0,114,30,1,0,0, +- 114,32,1,0,0,114,31,1,0,0,114,4,0,0,0,114, +- 4,0,0,0,114,4,0,0,0,114,5,0,0,0,114,45, +- 1,0,0,32,6,0,0,115,8,0,0,0,12,2,6,2, +- 12,5,12,5,114,45,1,0,0,99,0,0,0,0,0,0, +- 0,0,0,0,0,0,2,0,0,0,64,0,0,0,115,46, +- 0,0,0,101,0,0,90,1,0,100,0,0,90,2,0,100, +- 1,0,90,3,0,100,2,0,100,3,0,132,0,0,90,4, +- 0,100,4,0,100,5,0,132,0,0,90,5,0,100,6,0, +- 83,41,7,218,20,83,111,117,114,99,101,108,101,115,115,70, +- 105,108,101,76,111,97,100,101,114,122,45,76,111,97,100,101, +- 114,32,119,104,105,99,104,32,104,97,110,100,108,101,115,32, +- 115,111,117,114,99,101,108,101,115,115,32,102,105,108,101,32, +- 105,109,112,111,114,116,115,46,99,2,0,0,0,0,0,0, +- 0,5,0,0,0,6,0,0,0,67,0,0,0,115,76,0, +- 0,0,124,0,0,106,0,0,124,1,0,131,1,0,125,2, +- 0,124,0,0,106,1,0,124,2,0,131,1,0,125,3,0, +- 116,2,0,124,3,0,100,1,0,124,1,0,100,2,0,124, +- 2,0,131,1,2,125,4,0,116,3,0,124,4,0,100,1, +- 0,124,1,0,100,3,0,124,2,0,131,1,2,83,41,4, +- 78,114,67,0,0,0,114,35,0,0,0,114,134,0,0,0, +- 41,4,114,231,0,0,0,114,33,1,0,0,114,185,0,0, +- 0,114,190,0,0,0,41,5,114,78,0,0,0,114,152,0, +- 0,0,114,35,0,0,0,114,53,0,0,0,114,41,1,0, +- 0,114,4,0,0,0,114,4,0,0,0,114,5,0,0,0, +- 114,10,1,0,0,79,6,0,0,115,8,0,0,0,0,1, +- 15,1,15,1,24,1,122,29,83,111,117,114,99,101,108,101, +- 115,115,70,105,108,101,76,111,97,100,101,114,46,103,101,116, +- 95,99,111,100,101,99,2,0,0,0,0,0,0,0,2,0, +- 0,0,1,0,0,0,67,0,0,0,115,4,0,0,0,100, +- 1,0,83,41,2,122,39,82,101,116,117,114,110,32,78,111, +- 110,101,32,97,115,32,116,104,101,114,101,32,105,115,32,110, +- 111,32,115,111,117,114,99,101,32,99,111,100,101,46,78,114, +- 4,0,0,0,41,2,114,78,0,0,0,114,152,0,0,0, +- 114,4,0,0,0,114,4,0,0,0,114,5,0,0,0,114, +- 11,1,0,0,85,6,0,0,115,2,0,0,0,0,2,122, +- 31,83,111,117,114,99,101,108,101,115,115,70,105,108,101,76, +- 111,97,100,101,114,46,103,101,116,95,115,111,117,114,99,101, +- 78,41,6,114,57,0,0,0,114,56,0,0,0,114,58,0, +- 0,0,114,59,0,0,0,114,10,1,0,0,114,11,1,0, +- 0,114,4,0,0,0,114,4,0,0,0,114,4,0,0,0, +- 114,5,0,0,0,114,49,1,0,0,75,6,0,0,115,6, +- 0,0,0,12,2,6,2,12,6,114,49,1,0,0,99,0, +- 0,0,0,0,0,0,0,0,0,0,0,3,0,0,0,64, +- 0,0,0,115,118,0,0,0,101,0,0,90,1,0,100,0, +- 0,90,2,0,100,1,0,90,3,0,100,2,0,100,3,0, +- 132,0,0,90,4,0,100,4,0,100,5,0,132,0,0,90, +- 5,0,101,6,0,100,6,0,100,7,0,132,0,0,131,1, +- 0,90,7,0,100,8,0,100,9,0,132,0,0,90,8,0, +- 100,10,0,100,11,0,132,0,0,90,9,0,100,12,0,100, +- 13,0,132,0,0,90,10,0,101,6,0,100,14,0,100,15, +- 0,132,0,0,131,1,0,90,11,0,100,16,0,83,41,17, +- 218,19,69,120,116,101,110,115,105,111,110,70,105,108,101,76, +- 111,97,100,101,114,122,93,76,111,97,100,101,114,32,102,111, +- 114,32,101,120,116,101,110,115,105,111,110,32,109,111,100,117, +- 108,101,115,46,10,10,32,32,32,32,84,104,101,32,99,111, +- 110,115,116,114,117,99,116,111,114,32,105,115,32,100,101,115, +- 105,103,110,101,100,32,116,111,32,119,111,114,107,32,119,105, +- 116,104,32,70,105,108,101,70,105,110,100,101,114,46,10,10, +- 32,32,32,32,99,3,0,0,0,0,0,0,0,3,0,0, +- 0,2,0,0,0,67,0,0,0,115,22,0,0,0,124,1, +- 0,124,0,0,95,0,0,124,2,0,124,0,0,95,1,0, +- 100,0,0,83,41,1,78,41,2,114,67,0,0,0,114,35, +- 0,0,0,41,3,114,78,0,0,0,114,67,0,0,0,114, +- 35,0,0,0,114,4,0,0,0,114,4,0,0,0,114,5, +- 0,0,0,114,79,0,0,0,102,6,0,0,115,4,0,0, +- 0,0,1,9,1,122,28,69,120,116,101,110,115,105,111,110, +- 70,105,108,101,76,111,97,100,101,114,46,95,95,105,110,105, +- 116,95,95,99,2,0,0,0,0,0,0,0,4,0,0,0, +- 4,0,0,0,67,0,0,0,115,140,0,0,0,124,1,0, +- 106,0,0,125,2,0,124,2,0,106,1,0,125,3,0,116, +- 2,0,116,3,0,106,4,0,124,3,0,124,0,0,106,5, +- 0,131,3,0,125,1,0,116,6,0,100,1,0,124,0,0, +- 106,5,0,131,2,0,1,124,0,0,106,7,0,124,3,0, +- 131,1,0,114,117,0,116,8,0,124,1,0,100,2,0,131, +- 2,0,12,114,117,0,116,9,0,124,0,0,106,5,0,131, +- 1,0,100,3,0,25,103,1,0,124,1,0,95,10,0,110, +- 0,0,116,11,0,124,2,0,131,1,0,106,12,0,124,1, +- 0,131,1,0,1,100,0,0,83,41,4,78,122,33,101,120, +- 116,101,110,115,105,111,110,32,109,111,100,117,108,101,32,108, +- 111,97,100,101,100,32,102,114,111,109,32,123,33,114,125,114, +- 239,0,0,0,114,71,0,0,0,41,13,114,203,0,0,0, +- 114,67,0,0,0,114,108,0,0,0,114,96,0,0,0,90, +- 12,108,111,97,100,95,100,121,110,97,109,105,99,114,35,0, +- 0,0,114,146,0,0,0,114,216,0,0,0,114,60,0,0, +- 0,114,38,0,0,0,114,239,0,0,0,114,168,0,0,0, +- 114,250,0,0,0,41,4,114,78,0,0,0,114,174,0,0, +- 0,114,172,0,0,0,114,152,0,0,0,114,4,0,0,0, +- 114,4,0,0,0,114,5,0,0,0,114,253,0,0,0,106, +- 6,0,0,115,16,0,0,0,0,2,9,1,9,1,9,1, +- 15,1,16,1,31,1,28,1,122,31,69,120,116,101,110,115, +- 105,111,110,70,105,108,101,76,111,97,100,101,114,46,101,120, +- 101,99,95,109,111,100,117,108,101,99,2,0,0,0,0,0, +- 0,0,2,0,0,0,3,0,0,0,67,0,0,0,115,13, +- 0,0,0,116,0,0,124,0,0,124,1,0,131,2,0,83, +- 41,1,122,25,76,111,97,100,32,97,110,32,101,120,116,101, +- 110,115,105,111,110,32,109,111,100,117,108,101,46,41,1,114, +- 175,0,0,0,41,2,114,78,0,0,0,114,152,0,0,0, +- 114,4,0,0,0,114,4,0,0,0,114,5,0,0,0,114, +- 0,1,0,0,118,6,0,0,115,2,0,0,0,0,3,122, +- 31,69,120,116,101,110,115,105,111,110,70,105,108,101,76,111, +- 97,100,101,114,46,108,111,97,100,95,109,111,100,117,108,101, +- 99,2,0,0,0,0,0,0,0,2,0,0,0,4,0,0, +- 0,3,0,0,0,115,48,0,0,0,116,0,0,124,0,0, +- 106,1,0,131,1,0,100,1,0,25,137,0,0,116,2,0, +- 135,0,0,102,1,0,100,2,0,100,3,0,134,0,0,116, +- 3,0,68,131,1,0,131,1,0,83,41,4,122,49,82,101, +- 116,117,114,110,32,84,114,117,101,32,105,102,32,116,104,101, +- 32,101,120,116,101,110,115,105,111,110,32,109,111,100,117,108, +- 101,32,105,115,32,97,32,112,97,99,107,97,103,101,46,114, +- 29,0,0,0,99,1,0,0,0,0,0,0,0,2,0,0, +- 0,4,0,0,0,51,0,0,0,115,31,0,0,0,124,0, +- 0,93,21,0,125,1,0,136,0,0,100,0,0,124,1,0, +- 23,107,2,0,86,1,113,3,0,100,1,0,83,41,2,114, +- 79,0,0,0,78,114,4,0,0,0,41,2,114,22,0,0, +- 0,218,6,115,117,102,102,105,120,41,1,218,9,102,105,108, +- 101,95,110,97,109,101,114,4,0,0,0,114,5,0,0,0, +- 114,211,0,0,0,126,6,0,0,115,2,0,0,0,6,1, +- 122,49,69,120,116,101,110,115,105,111,110,70,105,108,101,76, +- 111,97,100,101,114,46,105,115,95,112,97,99,107,97,103,101, +- 46,60,108,111,99,97,108,115,62,46,60,103,101,110,101,120, +- 112,114,62,41,4,114,38,0,0,0,114,35,0,0,0,114, +- 212,0,0,0,218,18,69,88,84,69,78,83,73,79,78,95, +- 83,85,70,70,73,88,69,83,41,2,114,78,0,0,0,114, +- 152,0,0,0,114,4,0,0,0,41,1,114,52,1,0,0, +- 114,5,0,0,0,114,216,0,0,0,123,6,0,0,115,6, +- 0,0,0,0,2,19,1,18,1,122,30,69,120,116,101,110, +- 115,105,111,110,70,105,108,101,76,111,97,100,101,114,46,105, +- 115,95,112,97,99,107,97,103,101,99,2,0,0,0,0,0, +- 0,0,2,0,0,0,1,0,0,0,67,0,0,0,115,4, +- 0,0,0,100,1,0,83,41,2,122,63,82,101,116,117,114, +- 110,32,78,111,110,101,32,97,115,32,97,110,32,101,120,116, +- 101,110,115,105,111,110,32,109,111,100,117,108,101,32,99,97, +- 110,110,111,116,32,99,114,101,97,116,101,32,97,32,99,111, +- 100,101,32,111,98,106,101,99,116,46,78,114,4,0,0,0, +- 41,2,114,78,0,0,0,114,152,0,0,0,114,4,0,0, +- 0,114,4,0,0,0,114,5,0,0,0,114,10,1,0,0, +- 129,6,0,0,115,2,0,0,0,0,2,122,28,69,120,116, +- 101,110,115,105,111,110,70,105,108,101,76,111,97,100,101,114, ++ 0,0,114,50,1,0,0,46,6,0,0,115,8,0,0,0, ++ 12,2,6,2,12,5,12,5,114,50,1,0,0,99,0,0, ++ 0,0,0,0,0,0,0,0,0,0,2,0,0,0,64,0, ++ 0,0,115,46,0,0,0,101,0,0,90,1,0,100,0,0, ++ 90,2,0,100,1,0,90,3,0,100,2,0,100,3,0,132, ++ 0,0,90,4,0,100,4,0,100,5,0,132,0,0,90,5, ++ 0,100,6,0,83,41,7,218,20,83,111,117,114,99,101,108, ++ 101,115,115,70,105,108,101,76,111,97,100,101,114,122,45,76, ++ 111,97,100,101,114,32,119,104,105,99,104,32,104,97,110,100, ++ 108,101,115,32,115,111,117,114,99,101,108,101,115,115,32,102, ++ 105,108,101,32,105,109,112,111,114,116,115,46,99,2,0,0, ++ 0,0,0,0,0,5,0,0,0,6,0,0,0,67,0,0, ++ 0,115,76,0,0,0,124,0,0,106,0,0,124,1,0,131, ++ 1,0,125,2,0,124,0,0,106,1,0,124,2,0,131,1, ++ 0,125,3,0,116,2,0,124,3,0,100,1,0,124,1,0, ++ 100,2,0,124,2,0,131,1,2,125,4,0,116,3,0,124, ++ 4,0,100,1,0,124,1,0,100,3,0,124,2,0,131,1, ++ 2,83,41,4,78,114,67,0,0,0,114,35,0,0,0,114, ++ 140,0,0,0,41,4,114,237,0,0,0,114,38,1,0,0, ++ 114,190,0,0,0,114,195,0,0,0,41,5,114,71,0,0, ++ 0,114,158,0,0,0,114,35,0,0,0,114,53,0,0,0, ++ 114,46,1,0,0,114,4,0,0,0,114,4,0,0,0,114, ++ 5,0,0,0,114,15,1,0,0,93,6,0,0,115,8,0, ++ 0,0,0,1,15,1,15,1,24,1,122,29,83,111,117,114, ++ 99,101,108,101,115,115,70,105,108,101,76,111,97,100,101,114, + 46,103,101,116,95,99,111,100,101,99,2,0,0,0,0,0, + 0,0,2,0,0,0,1,0,0,0,67,0,0,0,115,4, +- 0,0,0,100,1,0,83,41,2,122,53,82,101,116,117,114, +- 110,32,78,111,110,101,32,97,115,32,101,120,116,101,110,115, +- 105,111,110,32,109,111,100,117,108,101,115,32,104,97,118,101, +- 32,110,111,32,115,111,117,114,99,101,32,99,111,100,101,46, +- 78,114,4,0,0,0,41,2,114,78,0,0,0,114,152,0, +- 0,0,114,4,0,0,0,114,4,0,0,0,114,5,0,0, +- 0,114,11,1,0,0,133,6,0,0,115,2,0,0,0,0, +- 2,122,30,69,120,116,101,110,115,105,111,110,70,105,108,101, +- 76,111,97,100,101,114,46,103,101,116,95,115,111,117,114,99, +- 101,99,2,0,0,0,0,0,0,0,2,0,0,0,1,0, +- 0,0,67,0,0,0,115,7,0,0,0,124,0,0,106,0, +- 0,83,41,1,122,58,82,101,116,117,114,110,32,116,104,101, +- 32,112,97,116,104,32,116,111,32,116,104,101,32,115,111,117, +- 114,99,101,32,102,105,108,101,32,97,115,32,102,111,117,110, +- 100,32,98,121,32,116,104,101,32,102,105,110,100,101,114,46, +- 41,1,114,35,0,0,0,41,2,114,78,0,0,0,114,152, ++ 0,0,0,100,1,0,83,41,2,122,39,82,101,116,117,114, ++ 110,32,78,111,110,101,32,97,115,32,116,104,101,114,101,32, ++ 105,115,32,110,111,32,115,111,117,114,99,101,32,99,111,100, ++ 101,46,78,114,4,0,0,0,41,2,114,71,0,0,0,114, ++ 158,0,0,0,114,4,0,0,0,114,4,0,0,0,114,5, ++ 0,0,0,114,16,1,0,0,99,6,0,0,115,2,0,0, ++ 0,0,2,122,31,83,111,117,114,99,101,108,101,115,115,70, ++ 105,108,101,76,111,97,100,101,114,46,103,101,116,95,115,111, ++ 117,114,99,101,78,41,6,114,57,0,0,0,114,56,0,0, ++ 0,114,58,0,0,0,114,59,0,0,0,114,15,1,0,0, ++ 114,16,1,0,0,114,4,0,0,0,114,4,0,0,0,114, ++ 4,0,0,0,114,5,0,0,0,114,54,1,0,0,89,6, ++ 0,0,115,6,0,0,0,12,2,6,2,12,6,114,54,1, ++ 0,0,99,0,0,0,0,0,0,0,0,0,0,0,0,3, ++ 0,0,0,64,0,0,0,115,106,0,0,0,101,0,0,90, ++ 1,0,100,0,0,90,2,0,100,1,0,90,3,0,100,2, ++ 0,100,3,0,132,0,0,90,4,0,101,5,0,100,4,0, ++ 100,5,0,132,0,0,131,1,0,90,6,0,100,6,0,100, ++ 7,0,132,0,0,90,7,0,100,8,0,100,9,0,132,0, ++ 0,90,8,0,100,10,0,100,11,0,132,0,0,90,9,0, ++ 101,5,0,100,12,0,100,13,0,132,0,0,131,1,0,90, ++ 10,0,100,14,0,83,41,15,218,19,69,120,116,101,110,115, ++ 105,111,110,70,105,108,101,76,111,97,100,101,114,122,93,76, ++ 111,97,100,101,114,32,102,111,114,32,101,120,116,101,110,115, ++ 105,111,110,32,109,111,100,117,108,101,115,46,10,10,32,32, ++ 32,32,84,104,101,32,99,111,110,115,116,114,117,99,116,111, ++ 114,32,105,115,32,100,101,115,105,103,110,101,100,32,116,111, ++ 32,119,111,114,107,32,119,105,116,104,32,70,105,108,101,70, ++ 105,110,100,101,114,46,10,10,32,32,32,32,99,3,0,0, ++ 0,0,0,0,0,3,0,0,0,2,0,0,0,67,0,0, ++ 0,115,22,0,0,0,124,1,0,124,0,0,95,0,0,124, ++ 2,0,124,0,0,95,1,0,100,0,0,83,41,1,78,41, ++ 2,114,67,0,0,0,114,35,0,0,0,41,3,114,71,0, ++ 0,0,114,67,0,0,0,114,35,0,0,0,114,4,0,0, ++ 0,114,4,0,0,0,114,5,0,0,0,114,72,0,0,0, ++ 116,6,0,0,115,4,0,0,0,0,1,9,1,122,28,69, ++ 120,116,101,110,115,105,111,110,70,105,108,101,76,111,97,100, ++ 101,114,46,95,95,105,110,105,116,95,95,99,2,0,0,0, ++ 0,0,0,0,4,0,0,0,11,0,0,0,67,0,0,0, ++ 115,183,0,0,0,116,0,0,124,1,0,131,1,0,143,29, ++ 0,1,116,1,0,116,2,0,106,3,0,124,1,0,124,0, ++ 0,106,4,0,131,3,0,125,2,0,87,100,1,0,81,88, ++ 116,5,0,100,2,0,124,0,0,106,4,0,131,2,0,1, ++ 124,0,0,106,6,0,124,1,0,131,1,0,125,3,0,124, ++ 3,0,114,124,0,116,7,0,124,2,0,100,3,0,131,2, ++ 0,12,114,124,0,116,8,0,124,0,0,106,4,0,131,1, ++ 0,100,4,0,25,103,1,0,124,2,0,95,9,0,110,0, ++ 0,124,0,0,124,2,0,95,10,0,124,2,0,106,11,0, ++ 124,2,0,95,12,0,124,3,0,115,179,0,124,2,0,106, ++ 12,0,106,13,0,100,5,0,131,1,0,100,4,0,25,124, ++ 2,0,95,12,0,110,0,0,124,2,0,83,41,6,122,25, ++ 76,111,97,100,32,97,110,32,101,120,116,101,110,115,105,111, ++ 110,32,109,111,100,117,108,101,46,78,122,33,101,120,116,101, ++ 110,115,105,111,110,32,109,111,100,117,108,101,32,108,111,97, ++ 100,101,100,32,102,114,111,109,32,123,33,114,125,114,245,0, ++ 0,0,114,84,0,0,0,114,116,0,0,0,41,14,114,69, ++ 0,0,0,114,114,0,0,0,114,106,0,0,0,90,12,108, ++ 111,97,100,95,100,121,110,97,109,105,99,114,35,0,0,0, ++ 114,152,0,0,0,114,219,0,0,0,114,60,0,0,0,114, ++ 38,0,0,0,114,245,0,0,0,114,204,0,0,0,114,57, ++ 0,0,0,114,252,0,0,0,114,32,0,0,0,41,4,114, ++ 71,0,0,0,114,158,0,0,0,114,179,0,0,0,114,219, + 0,0,0,114,4,0,0,0,114,4,0,0,0,114,5,0, +- 0,0,114,231,0,0,0,137,6,0,0,115,2,0,0,0, +- 0,3,122,32,69,120,116,101,110,115,105,111,110,70,105,108, +- 101,76,111,97,100,101,114,46,103,101,116,95,102,105,108,101, +- 110,97,109,101,78,41,12,114,57,0,0,0,114,56,0,0, +- 0,114,58,0,0,0,114,59,0,0,0,114,79,0,0,0, +- 114,253,0,0,0,114,150,0,0,0,114,0,1,0,0,114, +- 216,0,0,0,114,10,1,0,0,114,11,1,0,0,114,231, +- 0,0,0,114,4,0,0,0,114,4,0,0,0,114,4,0, +- 0,0,114,5,0,0,0,114,50,1,0,0,94,6,0,0, +- 115,16,0,0,0,12,6,6,2,12,4,12,12,18,5,12, +- 6,12,4,12,4,114,50,1,0,0,99,0,0,0,0,0, +- 0,0,0,0,0,0,0,2,0,0,0,64,0,0,0,115, +- 130,0,0,0,101,0,0,90,1,0,100,0,0,90,2,0, +- 100,1,0,90,3,0,100,2,0,100,3,0,132,0,0,90, +- 4,0,100,4,0,100,5,0,132,0,0,90,5,0,100,6, +- 0,100,7,0,132,0,0,90,6,0,100,8,0,100,9,0, +- 132,0,0,90,7,0,100,10,0,100,11,0,132,0,0,90, +- 8,0,100,12,0,100,13,0,132,0,0,90,9,0,100,14, +- 0,100,15,0,132,0,0,90,10,0,100,16,0,100,17,0, +- 132,0,0,90,11,0,100,18,0,100,19,0,132,0,0,90, +- 12,0,100,20,0,83,41,21,218,14,95,78,97,109,101,115, +- 112,97,99,101,80,97,116,104,97,38,1,0,0,82,101,112, +- 114,101,115,101,110,116,115,32,97,32,110,97,109,101,115,112, +- 97,99,101,32,112,97,99,107,97,103,101,39,115,32,112,97, +- 116,104,46,32,32,73,116,32,117,115,101,115,32,116,104,101, +- 32,109,111,100,117,108,101,32,110,97,109,101,10,32,32,32, +- 32,116,111,32,102,105,110,100,32,105,116,115,32,112,97,114, +- 101,110,116,32,109,111,100,117,108,101,44,32,97,110,100,32, +- 102,114,111,109,32,116,104,101,114,101,32,105,116,32,108,111, +- 111,107,115,32,117,112,32,116,104,101,32,112,97,114,101,110, +- 116,39,115,10,32,32,32,32,95,95,112,97,116,104,95,95, +- 46,32,32,87,104,101,110,32,116,104,105,115,32,99,104,97, +- 110,103,101,115,44,32,116,104,101,32,109,111,100,117,108,101, +- 39,115,32,111,119,110,32,112,97,116,104,32,105,115,32,114, +- 101,99,111,109,112,117,116,101,100,44,10,32,32,32,32,117, +- 115,105,110,103,32,112,97,116,104,95,102,105,110,100,101,114, +- 46,32,32,70,111,114,32,116,111,112,45,108,101,118,101,108, +- 32,109,111,100,117,108,101,115,44,32,116,104,101,32,112,97, +- 114,101,110,116,32,109,111,100,117,108,101,39,115,32,112,97, +- 116,104,10,32,32,32,32,105,115,32,115,121,115,46,112,97, +- 116,104,46,99,4,0,0,0,0,0,0,0,4,0,0,0, +- 2,0,0,0,67,0,0,0,115,52,0,0,0,124,1,0, +- 124,0,0,95,0,0,124,2,0,124,0,0,95,1,0,116, +- 2,0,124,0,0,106,3,0,131,0,0,131,1,0,124,0, +- 0,95,4,0,124,3,0,124,0,0,95,5,0,100,0,0, +- 83,41,1,78,41,6,114,93,0,0,0,114,249,0,0,0, +- 114,226,0,0,0,218,16,95,103,101,116,95,112,97,114,101, +- 110,116,95,112,97,116,104,218,17,95,108,97,115,116,95,112, +- 97,114,101,110,116,95,112,97,116,104,218,12,95,112,97,116, +- 104,95,102,105,110,100,101,114,41,4,114,78,0,0,0,114, +- 67,0,0,0,114,35,0,0,0,218,11,112,97,116,104,95, +- 102,105,110,100,101,114,114,4,0,0,0,114,4,0,0,0, +- 114,5,0,0,0,114,79,0,0,0,150,6,0,0,115,8, +- 0,0,0,0,1,9,1,9,1,21,1,122,23,95,78,97, +- 109,101,115,112,97,99,101,80,97,116,104,46,95,95,105,110, +- 105,116,95,95,99,1,0,0,0,0,0,0,0,4,0,0, +- 0,3,0,0,0,67,0,0,0,115,53,0,0,0,124,0, +- 0,106,0,0,106,1,0,100,1,0,131,1,0,92,3,0, +- 125,1,0,125,2,0,125,3,0,124,2,0,100,2,0,107, +- 2,0,114,43,0,100,6,0,83,124,1,0,100,5,0,102, +- 2,0,83,41,7,122,62,82,101,116,117,114,110,115,32,97, +- 32,116,117,112,108,101,32,111,102,32,40,112,97,114,101,110, +- 116,45,109,111,100,117,108,101,45,110,97,109,101,44,32,112, +- 97,114,101,110,116,45,112,97,116,104,45,97,116,116,114,45, +- 110,97,109,101,41,114,110,0,0,0,114,30,0,0,0,114, +- 7,0,0,0,114,35,0,0,0,114,239,0,0,0,41,2, +- 122,3,115,121,115,122,4,112,97,116,104,41,2,114,93,0, +- 0,0,114,32,0,0,0,41,4,114,78,0,0,0,114,228, +- 0,0,0,218,3,100,111,116,114,83,0,0,0,114,4,0, +- 0,0,114,4,0,0,0,114,5,0,0,0,218,23,95,102, +- 105,110,100,95,112,97,114,101,110,116,95,112,97,116,104,95, +- 110,97,109,101,115,156,6,0,0,115,8,0,0,0,0,2, +- 27,1,12,2,4,3,122,38,95,78,97,109,101,115,112,97, +- 99,101,80,97,116,104,46,95,102,105,110,100,95,112,97,114, +- 101,110,116,95,112,97,116,104,95,110,97,109,101,115,99,1, +- 0,0,0,0,0,0,0,3,0,0,0,3,0,0,0,67, +- 0,0,0,115,38,0,0,0,124,0,0,106,0,0,131,0, +- 0,92,2,0,125,1,0,125,2,0,116,1,0,116,2,0, +- 106,3,0,124,1,0,25,124,2,0,131,2,0,83,41,1, +- 78,41,4,114,60,1,0,0,114,62,0,0,0,114,7,0, +- 0,0,114,169,0,0,0,41,3,114,78,0,0,0,90,18, +- 112,97,114,101,110,116,95,109,111,100,117,108,101,95,110,97, +- 109,101,90,14,112,97,116,104,95,97,116,116,114,95,110,97, +- 109,101,114,4,0,0,0,114,4,0,0,0,114,5,0,0, +- 0,114,55,1,0,0,166,6,0,0,115,4,0,0,0,0, +- 1,18,1,122,31,95,78,97,109,101,115,112,97,99,101,80, +- 97,116,104,46,95,103,101,116,95,112,97,114,101,110,116,95, +- 112,97,116,104,99,1,0,0,0,0,0,0,0,3,0,0, +- 0,3,0,0,0,67,0,0,0,115,127,0,0,0,116,0, +- 0,124,0,0,106,1,0,131,0,0,131,1,0,125,1,0, +- 124,1,0,124,0,0,106,2,0,107,3,0,114,120,0,124, +- 0,0,106,3,0,124,0,0,106,4,0,124,1,0,131,2, +- 0,125,2,0,124,2,0,100,0,0,107,9,0,114,108,0, +- 124,2,0,106,5,0,100,0,0,107,8,0,114,108,0,124, +- 2,0,106,6,0,114,108,0,124,2,0,106,6,0,124,0, +- 0,95,7,0,113,108,0,110,0,0,124,1,0,124,0,0, +- 95,2,0,110,0,0,124,0,0,106,7,0,83,41,1,78, +- 41,8,114,226,0,0,0,114,55,1,0,0,114,56,1,0, +- 0,114,57,1,0,0,114,93,0,0,0,114,163,0,0,0, +- 114,217,0,0,0,114,249,0,0,0,41,3,114,78,0,0, +- 0,90,11,112,97,114,101,110,116,95,112,97,116,104,114,172, +- 0,0,0,114,4,0,0,0,114,4,0,0,0,114,5,0, +- 0,0,218,12,95,114,101,99,97,108,99,117,108,97,116,101, +- 170,6,0,0,115,16,0,0,0,0,2,18,1,15,1,21, +- 3,27,1,9,1,18,1,12,1,122,27,95,78,97,109,101, +- 115,112,97,99,101,80,97,116,104,46,95,114,101,99,97,108, +- 99,117,108,97,116,101,99,1,0,0,0,0,0,0,0,1, ++ 0,0,114,6,1,0,0,120,6,0,0,115,24,0,0,0, ++ 0,3,13,1,9,1,21,1,16,1,15,1,22,1,28,1, ++ 9,1,12,1,6,1,28,1,122,31,69,120,116,101,110,115, ++ 105,111,110,70,105,108,101,76,111,97,100,101,114,46,108,111, ++ 97,100,95,109,111,100,117,108,101,99,2,0,0,0,0,0, ++ 0,0,2,0,0,0,4,0,0,0,3,0,0,0,115,48, ++ 0,0,0,116,0,0,124,0,0,106,1,0,131,1,0,100, ++ 1,0,25,137,0,0,116,2,0,135,0,0,102,1,0,100, ++ 2,0,100,3,0,134,0,0,116,3,0,68,131,1,0,131, ++ 1,0,83,41,4,122,49,82,101,116,117,114,110,32,84,114, ++ 117,101,32,105,102,32,116,104,101,32,101,120,116,101,110,115, ++ 105,111,110,32,109,111,100,117,108,101,32,105,115,32,97,32, ++ 112,97,99,107,97,103,101,46,114,29,0,0,0,99,1,0, ++ 0,0,0,0,0,0,2,0,0,0,4,0,0,0,51,0, ++ 0,0,115,31,0,0,0,124,0,0,93,21,0,125,1,0, ++ 136,0,0,100,0,0,124,1,0,23,107,2,0,86,1,113, ++ 3,0,100,1,0,83,41,2,114,72,0,0,0,78,114,4, ++ 0,0,0,41,2,114,22,0,0,0,218,6,115,117,102,102, ++ 105,120,41,1,218,9,102,105,108,101,95,110,97,109,101,114, ++ 4,0,0,0,114,5,0,0,0,114,77,0,0,0,139,6, ++ 0,0,115,2,0,0,0,6,1,122,49,69,120,116,101,110, ++ 115,105,111,110,70,105,108,101,76,111,97,100,101,114,46,105, ++ 115,95,112,97,99,107,97,103,101,46,60,108,111,99,97,108, ++ 115,62,46,60,103,101,110,101,120,112,114,62,41,4,114,38, ++ 0,0,0,114,35,0,0,0,114,78,0,0,0,218,18,69, ++ 88,84,69,78,83,73,79,78,95,83,85,70,70,73,88,69, ++ 83,41,2,114,71,0,0,0,114,158,0,0,0,114,4,0, ++ 0,0,41,1,114,57,1,0,0,114,5,0,0,0,114,219, ++ 0,0,0,136,6,0,0,115,6,0,0,0,0,2,19,1, ++ 18,1,122,30,69,120,116,101,110,115,105,111,110,70,105,108, ++ 101,76,111,97,100,101,114,46,105,115,95,112,97,99,107,97, ++ 103,101,99,2,0,0,0,0,0,0,0,2,0,0,0,1, ++ 0,0,0,67,0,0,0,115,4,0,0,0,100,1,0,83, ++ 41,2,122,63,82,101,116,117,114,110,32,78,111,110,101,32, ++ 97,115,32,97,110,32,101,120,116,101,110,115,105,111,110,32, ++ 109,111,100,117,108,101,32,99,97,110,110,111,116,32,99,114, ++ 101,97,116,101,32,97,32,99,111,100,101,32,111,98,106,101, ++ 99,116,46,78,114,4,0,0,0,41,2,114,71,0,0,0, ++ 114,158,0,0,0,114,4,0,0,0,114,4,0,0,0,114, ++ 5,0,0,0,114,15,1,0,0,142,6,0,0,115,2,0, ++ 0,0,0,2,122,28,69,120,116,101,110,115,105,111,110,70, ++ 105,108,101,76,111,97,100,101,114,46,103,101,116,95,99,111, ++ 100,101,99,2,0,0,0,0,0,0,0,2,0,0,0,1, ++ 0,0,0,67,0,0,0,115,4,0,0,0,100,1,0,83, ++ 41,2,122,53,82,101,116,117,114,110,32,78,111,110,101,32, ++ 97,115,32,101,120,116,101,110,115,105,111,110,32,109,111,100, ++ 117,108,101,115,32,104,97,118,101,32,110,111,32,115,111,117, ++ 114,99,101,32,99,111,100,101,46,78,114,4,0,0,0,41, ++ 2,114,71,0,0,0,114,158,0,0,0,114,4,0,0,0, ++ 114,4,0,0,0,114,5,0,0,0,114,16,1,0,0,146, ++ 6,0,0,115,2,0,0,0,0,2,122,30,69,120,116,101, ++ 110,115,105,111,110,70,105,108,101,76,111,97,100,101,114,46, ++ 103,101,116,95,115,111,117,114,99,101,99,2,0,0,0,0, ++ 0,0,0,2,0,0,0,1,0,0,0,67,0,0,0,115, ++ 7,0,0,0,124,0,0,106,0,0,83,41,1,122,58,82, ++ 101,116,117,114,110,32,116,104,101,32,112,97,116,104,32,116, ++ 111,32,116,104,101,32,115,111,117,114,99,101,32,102,105,108, ++ 101,32,97,115,32,102,111,117,110,100,32,98,121,32,116,104, ++ 101,32,102,105,110,100,101,114,46,41,1,114,35,0,0,0, ++ 41,2,114,71,0,0,0,114,158,0,0,0,114,4,0,0, ++ 0,114,4,0,0,0,114,5,0,0,0,114,237,0,0,0, ++ 150,6,0,0,115,2,0,0,0,0,3,122,32,69,120,116, ++ 101,110,115,105,111,110,70,105,108,101,76,111,97,100,101,114, ++ 46,103,101,116,95,102,105,108,101,110,97,109,101,78,41,11, ++ 114,57,0,0,0,114,56,0,0,0,114,58,0,0,0,114, ++ 59,0,0,0,114,72,0,0,0,114,156,0,0,0,114,6, ++ 1,0,0,114,219,0,0,0,114,15,1,0,0,114,16,1, ++ 0,0,114,237,0,0,0,114,4,0,0,0,114,4,0,0, ++ 0,114,4,0,0,0,114,5,0,0,0,114,55,1,0,0, ++ 108,6,0,0,115,14,0,0,0,12,6,6,2,12,4,18, ++ 16,12,6,12,4,12,4,114,55,1,0,0,99,0,0,0, ++ 0,0,0,0,0,0,0,0,0,2,0,0,0,64,0,0, ++ 0,115,130,0,0,0,101,0,0,90,1,0,100,0,0,90, ++ 2,0,100,1,0,90,3,0,100,2,0,100,3,0,132,0, ++ 0,90,4,0,100,4,0,100,5,0,132,0,0,90,5,0, ++ 100,6,0,100,7,0,132,0,0,90,6,0,100,8,0,100, ++ 9,0,132,0,0,90,7,0,100,10,0,100,11,0,132,0, ++ 0,90,8,0,100,12,0,100,13,0,132,0,0,90,9,0, ++ 100,14,0,100,15,0,132,0,0,90,10,0,100,16,0,100, ++ 17,0,132,0,0,90,11,0,100,18,0,100,19,0,132,0, ++ 0,90,12,0,100,20,0,83,41,21,218,14,95,78,97,109, ++ 101,115,112,97,99,101,80,97,116,104,97,38,1,0,0,82, ++ 101,112,114,101,115,101,110,116,115,32,97,32,110,97,109,101, ++ 115,112,97,99,101,32,112,97,99,107,97,103,101,39,115,32, ++ 112,97,116,104,46,32,32,73,116,32,117,115,101,115,32,116, ++ 104,101,32,109,111,100,117,108,101,32,110,97,109,101,10,32, ++ 32,32,32,116,111,32,102,105,110,100,32,105,116,115,32,112, ++ 97,114,101,110,116,32,109,111,100,117,108,101,44,32,97,110, ++ 100,32,102,114,111,109,32,116,104,101,114,101,32,105,116,32, ++ 108,111,111,107,115,32,117,112,32,116,104,101,32,112,97,114, ++ 101,110,116,39,115,10,32,32,32,32,95,95,112,97,116,104, ++ 95,95,46,32,32,87,104,101,110,32,116,104,105,115,32,99, ++ 104,97,110,103,101,115,44,32,116,104,101,32,109,111,100,117, ++ 108,101,39,115,32,111,119,110,32,112,97,116,104,32,105,115, ++ 32,114,101,99,111,109,112,117,116,101,100,44,10,32,32,32, ++ 32,117,115,105,110,103,32,112,97,116,104,95,102,105,110,100, ++ 101,114,46,32,32,70,111,114,32,116,111,112,45,108,101,118, ++ 101,108,32,109,111,100,117,108,101,115,44,32,116,104,101,32, ++ 112,97,114,101,110,116,32,109,111,100,117,108,101,39,115,32, ++ 112,97,116,104,10,32,32,32,32,105,115,32,115,121,115,46, ++ 112,97,116,104,46,99,4,0,0,0,0,0,0,0,4,0, ++ 0,0,2,0,0,0,67,0,0,0,115,52,0,0,0,124, ++ 1,0,124,0,0,95,0,0,124,2,0,124,0,0,95,1, ++ 0,116,2,0,124,0,0,106,3,0,131,0,0,131,1,0, ++ 124,0,0,95,4,0,124,3,0,124,0,0,95,5,0,100, ++ 0,0,83,41,1,78,41,6,114,70,0,0,0,114,255,0, ++ 0,0,114,230,0,0,0,218,16,95,103,101,116,95,112,97, ++ 114,101,110,116,95,112,97,116,104,218,17,95,108,97,115,116, ++ 95,112,97,114,101,110,116,95,112,97,116,104,218,12,95,112, ++ 97,116,104,95,102,105,110,100,101,114,41,4,114,71,0,0, ++ 0,114,67,0,0,0,114,35,0,0,0,218,11,112,97,116, ++ 104,95,102,105,110,100,101,114,114,4,0,0,0,114,4,0, ++ 0,0,114,5,0,0,0,114,72,0,0,0,163,6,0,0, ++ 115,8,0,0,0,0,1,9,1,9,1,21,1,122,23,95, ++ 78,97,109,101,115,112,97,99,101,80,97,116,104,46,95,95, ++ 105,110,105,116,95,95,99,1,0,0,0,0,0,0,0,4, ++ 0,0,0,3,0,0,0,67,0,0,0,115,53,0,0,0, ++ 124,0,0,106,0,0,106,1,0,100,1,0,131,1,0,92, ++ 3,0,125,1,0,125,2,0,125,3,0,124,2,0,100,2, ++ 0,107,2,0,114,43,0,100,6,0,83,124,1,0,100,5, ++ 0,102,2,0,83,41,7,122,62,82,101,116,117,114,110,115, ++ 32,97,32,116,117,112,108,101,32,111,102,32,40,112,97,114, ++ 101,110,116,45,109,111,100,117,108,101,45,110,97,109,101,44, ++ 32,112,97,114,101,110,116,45,112,97,116,104,45,97,116,116, ++ 114,45,110,97,109,101,41,114,116,0,0,0,114,30,0,0, ++ 0,114,7,0,0,0,114,35,0,0,0,114,245,0,0,0, ++ 41,2,122,3,115,121,115,122,4,112,97,116,104,41,2,114, ++ 70,0,0,0,114,32,0,0,0,41,4,114,71,0,0,0, ++ 114,232,0,0,0,218,3,100,111,116,114,94,0,0,0,114, ++ 4,0,0,0,114,4,0,0,0,114,5,0,0,0,218,23, ++ 95,102,105,110,100,95,112,97,114,101,110,116,95,112,97,116, ++ 104,95,110,97,109,101,115,169,6,0,0,115,8,0,0,0, ++ 0,2,27,1,12,2,4,3,122,38,95,78,97,109,101,115, ++ 112,97,99,101,80,97,116,104,46,95,102,105,110,100,95,112, ++ 97,114,101,110,116,95,112,97,116,104,95,110,97,109,101,115, ++ 99,1,0,0,0,0,0,0,0,3,0,0,0,3,0,0, ++ 0,67,0,0,0,115,38,0,0,0,124,0,0,106,0,0, ++ 131,0,0,92,2,0,125,1,0,125,2,0,116,1,0,116, ++ 2,0,106,3,0,124,1,0,25,124,2,0,131,2,0,83, ++ 41,1,78,41,4,114,65,1,0,0,114,62,0,0,0,114, ++ 7,0,0,0,114,73,0,0,0,41,3,114,71,0,0,0, ++ 90,18,112,97,114,101,110,116,95,109,111,100,117,108,101,95, ++ 110,97,109,101,90,14,112,97,116,104,95,97,116,116,114,95, ++ 110,97,109,101,114,4,0,0,0,114,4,0,0,0,114,5, ++ 0,0,0,114,60,1,0,0,179,6,0,0,115,4,0,0, ++ 0,0,1,18,1,122,31,95,78,97,109,101,115,112,97,99, ++ 101,80,97,116,104,46,95,103,101,116,95,112,97,114,101,110, ++ 116,95,112,97,116,104,99,1,0,0,0,0,0,0,0,3, ++ 0,0,0,3,0,0,0,67,0,0,0,115,127,0,0,0, ++ 116,0,0,124,0,0,106,1,0,131,0,0,131,1,0,125, ++ 1,0,124,1,0,124,0,0,106,2,0,107,3,0,114,120, ++ 0,124,0,0,106,3,0,124,0,0,106,4,0,124,1,0, ++ 131,2,0,125,2,0,124,2,0,100,0,0,107,9,0,114, ++ 108,0,124,2,0,106,5,0,100,0,0,107,8,0,114,108, ++ 0,124,2,0,106,6,0,114,108,0,124,2,0,106,6,0, ++ 124,0,0,95,7,0,113,108,0,110,0,0,124,1,0,124, ++ 0,0,95,2,0,110,0,0,124,0,0,106,7,0,83,41, ++ 1,78,41,8,114,230,0,0,0,114,60,1,0,0,114,61, ++ 1,0,0,114,62,1,0,0,114,70,0,0,0,114,169,0, ++ 0,0,114,220,0,0,0,114,255,0,0,0,41,3,114,71, ++ 0,0,0,90,11,112,97,114,101,110,116,95,112,97,116,104, ++ 114,177,0,0,0,114,4,0,0,0,114,4,0,0,0,114, ++ 5,0,0,0,218,12,95,114,101,99,97,108,99,117,108,97, ++ 116,101,183,6,0,0,115,16,0,0,0,0,2,18,1,15, ++ 1,21,3,27,1,9,1,18,1,12,1,122,27,95,78,97, ++ 109,101,115,112,97,99,101,80,97,116,104,46,95,114,101,99, ++ 97,108,99,117,108,97,116,101,99,1,0,0,0,0,0,0, ++ 0,1,0,0,0,2,0,0,0,67,0,0,0,115,16,0, ++ 0,0,116,0,0,124,0,0,106,1,0,131,0,0,131,1, ++ 0,83,41,1,78,41,2,218,4,105,116,101,114,114,66,1, ++ 0,0,41,1,114,71,0,0,0,114,4,0,0,0,114,4, ++ 0,0,0,114,5,0,0,0,218,8,95,95,105,116,101,114, ++ 95,95,196,6,0,0,115,2,0,0,0,0,1,122,23,95, ++ 78,97,109,101,115,112,97,99,101,80,97,116,104,46,95,95, ++ 105,116,101,114,95,95,99,1,0,0,0,0,0,0,0,1, + 0,0,0,2,0,0,0,67,0,0,0,115,16,0,0,0, + 116,0,0,124,0,0,106,1,0,131,0,0,131,1,0,83, +- 41,1,78,41,2,218,4,105,116,101,114,114,61,1,0,0, +- 41,1,114,78,0,0,0,114,4,0,0,0,114,4,0,0, +- 0,114,5,0,0,0,218,8,95,95,105,116,101,114,95,95, +- 183,6,0,0,115,2,0,0,0,0,1,122,23,95,78,97, +- 109,101,115,112,97,99,101,80,97,116,104,46,95,95,105,116, +- 101,114,95,95,99,1,0,0,0,0,0,0,0,1,0,0, +- 0,2,0,0,0,67,0,0,0,115,16,0,0,0,116,0, +- 0,124,0,0,106,1,0,131,0,0,131,1,0,83,41,1, +- 78,41,2,114,31,0,0,0,114,61,1,0,0,41,1,114, +- 78,0,0,0,114,4,0,0,0,114,4,0,0,0,114,5, +- 0,0,0,218,7,95,95,108,101,110,95,95,186,6,0,0, +- 115,2,0,0,0,0,1,122,22,95,78,97,109,101,115,112, +- 97,99,101,80,97,116,104,46,95,95,108,101,110,95,95,99, +- 1,0,0,0,0,0,0,0,1,0,0,0,2,0,0,0, +- 67,0,0,0,115,16,0,0,0,100,1,0,106,0,0,124, +- 0,0,106,1,0,131,1,0,83,41,2,78,122,20,95,78, +- 97,109,101,115,112,97,99,101,80,97,116,104,40,123,33,114, +- 125,41,41,2,114,47,0,0,0,114,249,0,0,0,41,1, +- 114,78,0,0,0,114,4,0,0,0,114,4,0,0,0,114, +- 5,0,0,0,114,90,0,0,0,189,6,0,0,115,2,0, +- 0,0,0,1,122,23,95,78,97,109,101,115,112,97,99,101, +- 80,97,116,104,46,95,95,114,101,112,114,95,95,99,2,0, +- 0,0,0,0,0,0,2,0,0,0,2,0,0,0,67,0, +- 0,0,115,16,0,0,0,124,1,0,124,0,0,106,0,0, +- 131,0,0,107,6,0,83,41,1,78,41,1,114,61,1,0, +- 0,41,2,114,78,0,0,0,218,4,105,116,101,109,114,4, +- 0,0,0,114,4,0,0,0,114,5,0,0,0,218,12,95, +- 95,99,111,110,116,97,105,110,115,95,95,192,6,0,0,115, ++ 41,1,78,41,2,114,31,0,0,0,114,66,1,0,0,41, ++ 1,114,71,0,0,0,114,4,0,0,0,114,4,0,0,0, ++ 114,5,0,0,0,218,7,95,95,108,101,110,95,95,199,6, ++ 0,0,115,2,0,0,0,0,1,122,22,95,78,97,109,101, ++ 115,112,97,99,101,80,97,116,104,46,95,95,108,101,110,95, ++ 95,99,1,0,0,0,0,0,0,0,1,0,0,0,2,0, ++ 0,0,67,0,0,0,115,16,0,0,0,100,1,0,106,0, ++ 0,124,0,0,106,1,0,131,1,0,83,41,2,78,122,20, ++ 95,78,97,109,101,115,112,97,99,101,80,97,116,104,40,123, ++ 33,114,125,41,41,2,114,47,0,0,0,114,255,0,0,0, ++ 41,1,114,71,0,0,0,114,4,0,0,0,114,4,0,0, ++ 0,114,5,0,0,0,114,101,0,0,0,202,6,0,0,115, ++ 2,0,0,0,0,1,122,23,95,78,97,109,101,115,112,97, ++ 99,101,80,97,116,104,46,95,95,114,101,112,114,95,95,99, ++ 2,0,0,0,0,0,0,0,2,0,0,0,2,0,0,0, ++ 67,0,0,0,115,16,0,0,0,124,1,0,124,0,0,106, ++ 0,0,131,0,0,107,6,0,83,41,1,78,41,1,114,66, ++ 1,0,0,41,2,114,71,0,0,0,218,4,105,116,101,109, ++ 114,4,0,0,0,114,4,0,0,0,114,5,0,0,0,218, ++ 12,95,95,99,111,110,116,97,105,110,115,95,95,205,6,0, ++ 0,115,2,0,0,0,0,1,122,27,95,78,97,109,101,115, ++ 112,97,99,101,80,97,116,104,46,95,95,99,111,110,116,97, ++ 105,110,115,95,95,99,2,0,0,0,0,0,0,0,2,0, ++ 0,0,2,0,0,0,67,0,0,0,115,20,0,0,0,124, ++ 0,0,106,0,0,106,1,0,124,1,0,131,1,0,1,100, ++ 0,0,83,41,1,78,41,2,114,255,0,0,0,114,223,0, ++ 0,0,41,2,114,71,0,0,0,114,70,1,0,0,114,4, ++ 0,0,0,114,4,0,0,0,114,5,0,0,0,114,223,0, ++ 0,0,208,6,0,0,115,2,0,0,0,0,1,122,21,95, ++ 78,97,109,101,115,112,97,99,101,80,97,116,104,46,97,112, ++ 112,101,110,100,78,41,13,114,57,0,0,0,114,56,0,0, ++ 0,114,58,0,0,0,114,59,0,0,0,114,72,0,0,0, ++ 114,65,1,0,0,114,60,1,0,0,114,66,1,0,0,114, ++ 68,1,0,0,114,69,1,0,0,114,101,0,0,0,114,71, ++ 1,0,0,114,223,0,0,0,114,4,0,0,0,114,4,0, ++ 0,0,114,4,0,0,0,114,5,0,0,0,114,59,1,0, ++ 0,156,6,0,0,115,20,0,0,0,12,5,6,2,12,6, ++ 12,10,12,4,12,13,12,3,12,3,12,3,12,3,114,59, ++ 1,0,0,99,0,0,0,0,0,0,0,0,0,0,0,0, ++ 3,0,0,0,64,0,0,0,115,94,0,0,0,101,0,0, ++ 90,1,0,100,0,0,90,2,0,100,1,0,100,2,0,132, ++ 0,0,90,3,0,101,4,0,100,3,0,100,4,0,132,0, ++ 0,131,1,0,90,5,0,100,5,0,100,6,0,132,0,0, ++ 90,6,0,100,7,0,100,8,0,132,0,0,90,7,0,100, ++ 9,0,100,10,0,132,0,0,90,8,0,100,11,0,100,12, ++ 0,132,0,0,90,9,0,100,13,0,83,41,14,114,253,0, ++ 0,0,99,4,0,0,0,0,0,0,0,4,0,0,0,4, ++ 0,0,0,67,0,0,0,115,25,0,0,0,116,0,0,124, ++ 1,0,124,2,0,124,3,0,131,3,0,124,0,0,95,1, ++ 0,100,0,0,83,41,1,78,41,2,114,59,1,0,0,114, ++ 255,0,0,0,41,4,114,71,0,0,0,114,67,0,0,0, ++ 114,35,0,0,0,114,63,1,0,0,114,4,0,0,0,114, ++ 4,0,0,0,114,5,0,0,0,114,72,0,0,0,214,6, ++ 0,0,115,2,0,0,0,0,1,122,25,95,78,97,109,101, ++ 115,112,97,99,101,76,111,97,100,101,114,46,95,95,105,110, ++ 105,116,95,95,99,2,0,0,0,0,0,0,0,2,0,0, ++ 0,2,0,0,0,67,0,0,0,115,16,0,0,0,100,1, ++ 0,106,0,0,124,1,0,106,1,0,131,1,0,83,41,2, ++ 78,122,25,60,109,111,100,117,108,101,32,123,33,114,125,32, ++ 40,110,97,109,101,115,112,97,99,101,41,62,41,2,114,47, ++ 0,0,0,114,57,0,0,0,41,2,114,248,0,0,0,114, ++ 179,0,0,0,114,4,0,0,0,114,4,0,0,0,114,5, ++ 0,0,0,114,205,0,0,0,218,6,0,0,115,2,0,0, ++ 0,0,2,122,28,95,78,97,109,101,115,112,97,99,101,76, ++ 111,97,100,101,114,46,109,111,100,117,108,101,95,114,101,112, ++ 114,99,2,0,0,0,0,0,0,0,2,0,0,0,1,0, ++ 0,0,67,0,0,0,115,4,0,0,0,100,1,0,83,41, ++ 2,78,84,114,4,0,0,0,41,2,114,71,0,0,0,114, ++ 158,0,0,0,114,4,0,0,0,114,4,0,0,0,114,5, ++ 0,0,0,114,219,0,0,0,222,6,0,0,115,2,0,0, ++ 0,0,1,122,27,95,78,97,109,101,115,112,97,99,101,76, ++ 111,97,100,101,114,46,105,115,95,112,97,99,107,97,103,101, ++ 99,2,0,0,0,0,0,0,0,2,0,0,0,1,0,0, ++ 0,67,0,0,0,115,4,0,0,0,100,1,0,83,41,2, ++ 78,114,30,0,0,0,114,4,0,0,0,41,2,114,71,0, ++ 0,0,114,158,0,0,0,114,4,0,0,0,114,4,0,0, ++ 0,114,5,0,0,0,114,16,1,0,0,225,6,0,0,115, + 2,0,0,0,0,1,122,27,95,78,97,109,101,115,112,97, +- 99,101,80,97,116,104,46,95,95,99,111,110,116,97,105,110, +- 115,95,95,99,2,0,0,0,0,0,0,0,2,0,0,0, +- 2,0,0,0,67,0,0,0,115,20,0,0,0,124,0,0, +- 106,0,0,106,1,0,124,1,0,131,1,0,1,100,0,0, +- 83,41,1,78,41,2,114,249,0,0,0,114,220,0,0,0, +- 41,2,114,78,0,0,0,114,65,1,0,0,114,4,0,0, +- 0,114,4,0,0,0,114,5,0,0,0,114,220,0,0,0, +- 195,6,0,0,115,2,0,0,0,0,1,122,21,95,78,97, +- 109,101,115,112,97,99,101,80,97,116,104,46,97,112,112,101, +- 110,100,78,41,13,114,57,0,0,0,114,56,0,0,0,114, +- 58,0,0,0,114,59,0,0,0,114,79,0,0,0,114,60, +- 1,0,0,114,55,1,0,0,114,61,1,0,0,114,63,1, +- 0,0,114,64,1,0,0,114,90,0,0,0,114,66,1,0, +- 0,114,220,0,0,0,114,4,0,0,0,114,4,0,0,0, +- 114,4,0,0,0,114,5,0,0,0,114,54,1,0,0,143, +- 6,0,0,115,20,0,0,0,12,5,6,2,12,6,12,10, +- 12,4,12,13,12,3,12,3,12,3,12,3,114,54,1,0, +- 0,99,0,0,0,0,0,0,0,0,0,0,0,0,3,0, +- 0,0,64,0,0,0,115,94,0,0,0,101,0,0,90,1, +- 0,100,0,0,90,2,0,100,1,0,100,2,0,132,0,0, +- 90,3,0,101,4,0,100,3,0,100,4,0,132,0,0,131, +- 1,0,90,5,0,100,5,0,100,6,0,132,0,0,90,6, +- 0,100,7,0,100,8,0,132,0,0,90,7,0,100,9,0, +- 100,10,0,132,0,0,90,8,0,100,11,0,100,12,0,132, +- 0,0,90,9,0,100,13,0,83,41,14,114,247,0,0,0, +- 99,4,0,0,0,0,0,0,0,4,0,0,0,4,0,0, +- 0,67,0,0,0,115,25,0,0,0,116,0,0,124,1,0, +- 124,2,0,124,3,0,131,3,0,124,0,0,95,1,0,100, +- 0,0,83,41,1,78,41,2,114,54,1,0,0,114,249,0, +- 0,0,41,4,114,78,0,0,0,114,67,0,0,0,114,35, +- 0,0,0,114,58,1,0,0,114,4,0,0,0,114,4,0, +- 0,0,114,5,0,0,0,114,79,0,0,0,201,6,0,0, +- 115,2,0,0,0,0,1,122,25,95,78,97,109,101,115,112, +- 97,99,101,76,111,97,100,101,114,46,95,95,105,110,105,116, +- 95,95,99,2,0,0,0,0,0,0,0,2,0,0,0,2, +- 0,0,0,67,0,0,0,115,16,0,0,0,100,1,0,106, +- 0,0,124,1,0,106,1,0,131,1,0,83,41,2,78,122, +- 25,60,109,111,100,117,108,101,32,123,33,114,125,32,40,110, +- 97,109,101,115,112,97,99,101,41,62,41,2,114,47,0,0, +- 0,114,57,0,0,0,41,2,114,242,0,0,0,114,174,0, ++ 99,101,76,111,97,100,101,114,46,103,101,116,95,115,111,117, ++ 114,99,101,99,2,0,0,0,0,0,0,0,2,0,0,0, ++ 6,0,0,0,67,0,0,0,115,22,0,0,0,116,0,0, ++ 100,1,0,100,2,0,100,3,0,100,4,0,100,5,0,131, ++ 3,1,83,41,6,78,114,30,0,0,0,122,8,60,115,116, ++ 114,105,110,103,62,114,175,0,0,0,114,41,1,0,0,84, ++ 41,1,114,42,1,0,0,41,2,114,71,0,0,0,114,158, ++ 0,0,0,114,4,0,0,0,114,4,0,0,0,114,5,0, ++ 0,0,114,15,1,0,0,228,6,0,0,115,2,0,0,0, ++ 0,1,122,25,95,78,97,109,101,115,112,97,99,101,76,111, ++ 97,100,101,114,46,103,101,116,95,99,111,100,101,99,2,0, ++ 0,0,0,0,0,0,2,0,0,0,3,0,0,0,67,0, ++ 0,0,115,29,0,0,0,116,0,0,100,1,0,124,0,0, ++ 106,1,0,131,2,0,1,116,2,0,124,0,0,124,1,0, ++ 131,2,0,83,41,2,122,24,76,111,97,100,32,97,32,110, ++ 97,109,101,115,112,97,99,101,32,109,111,100,117,108,101,46, ++ 122,38,110,97,109,101,115,112,97,99,101,32,109,111,100,117, ++ 108,101,32,108,111,97,100,101,100,32,119,105,116,104,32,112, ++ 97,116,104,32,123,33,114,125,41,3,114,152,0,0,0,114, ++ 255,0,0,0,114,180,0,0,0,41,2,114,71,0,0,0, ++ 114,158,0,0,0,114,4,0,0,0,114,4,0,0,0,114, ++ 5,0,0,0,114,6,1,0,0,232,6,0,0,115,4,0, ++ 0,0,0,2,16,1,122,28,95,78,97,109,101,115,112,97, ++ 99,101,76,111,97,100,101,114,46,108,111,97,100,95,109,111, ++ 100,117,108,101,78,41,10,114,57,0,0,0,114,56,0,0, ++ 0,114,58,0,0,0,114,72,0,0,0,114,10,1,0,0, ++ 114,205,0,0,0,114,219,0,0,0,114,16,1,0,0,114, ++ 15,1,0,0,114,6,1,0,0,114,4,0,0,0,114,4, ++ 0,0,0,114,4,0,0,0,114,5,0,0,0,114,253,0, ++ 0,0,213,6,0,0,115,12,0,0,0,12,1,12,4,18, ++ 4,12,3,12,3,12,4,114,253,0,0,0,99,0,0,0, ++ 0,0,0,0,0,0,0,0,0,5,0,0,0,64,0,0, ++ 0,115,160,0,0,0,101,0,0,90,1,0,100,0,0,90, ++ 2,0,100,1,0,90,3,0,101,4,0,100,2,0,100,3, ++ 0,132,0,0,131,1,0,90,5,0,101,4,0,100,4,0, ++ 100,5,0,132,0,0,131,1,0,90,6,0,101,4,0,100, ++ 6,0,100,7,0,132,0,0,131,1,0,90,7,0,101,4, ++ 0,100,8,0,100,9,0,132,0,0,131,1,0,90,8,0, ++ 101,4,0,100,10,0,100,11,0,100,12,0,132,1,0,131, ++ 1,0,90,9,0,101,4,0,100,10,0,100,10,0,100,13, ++ 0,100,14,0,132,2,0,131,1,0,90,10,0,101,4,0, ++ 100,10,0,100,15,0,100,16,0,132,1,0,131,1,0,90, ++ 11,0,100,10,0,83,41,17,218,10,80,97,116,104,70,105, ++ 110,100,101,114,122,62,77,101,116,97,32,112,97,116,104,32, ++ 102,105,110,100,101,114,32,102,111,114,32,115,121,115,46,112, ++ 97,116,104,32,97,110,100,32,112,97,99,107,97,103,101,32, ++ 95,95,112,97,116,104,95,95,32,97,116,116,114,105,98,117, ++ 116,101,115,46,99,1,0,0,0,0,0,0,0,2,0,0, ++ 0,4,0,0,0,67,0,0,0,115,58,0,0,0,120,51, ++ 0,116,0,0,106,1,0,106,2,0,131,0,0,68,93,34, ++ 0,125,1,0,116,3,0,124,1,0,100,1,0,131,2,0, ++ 114,16,0,124,1,0,106,4,0,131,0,0,1,113,16,0, ++ 113,16,0,87,100,2,0,83,41,3,122,125,67,97,108,108, ++ 32,116,104,101,32,105,110,118,97,108,105,100,97,116,101,95, ++ 99,97,99,104,101,115,40,41,32,109,101,116,104,111,100,32, ++ 111,110,32,97,108,108,32,112,97,116,104,32,101,110,116,114, ++ 121,32,102,105,110,100,101,114,115,10,32,32,32,32,32,32, ++ 32,32,115,116,111,114,101,100,32,105,110,32,115,121,115,46, ++ 112,97,116,104,95,105,109,112,111,114,116,101,114,95,99,97, ++ 99,104,101,115,32,40,119,104,101,114,101,32,105,109,112,108, ++ 101,109,101,110,116,101,100,41,46,218,17,105,110,118,97,108, ++ 105,100,97,116,101,95,99,97,99,104,101,115,78,41,5,114, ++ 7,0,0,0,218,19,112,97,116,104,95,105,109,112,111,114, ++ 116,101,114,95,99,97,99,104,101,218,6,118,97,108,117,101, ++ 115,114,60,0,0,0,114,73,1,0,0,41,2,114,248,0, ++ 0,0,218,6,102,105,110,100,101,114,114,4,0,0,0,114, ++ 4,0,0,0,114,5,0,0,0,114,73,1,0,0,244,6, ++ 0,0,115,6,0,0,0,0,4,22,1,15,1,122,28,80, ++ 97,116,104,70,105,110,100,101,114,46,105,110,118,97,108,105, ++ 100,97,116,101,95,99,97,99,104,101,115,99,2,0,0,0, ++ 0,0,0,0,3,0,0,0,12,0,0,0,67,0,0,0, ++ 115,94,0,0,0,116,0,0,106,1,0,115,28,0,116,2, ++ 0,106,3,0,100,1,0,116,4,0,131,2,0,1,110,0, ++ 0,120,59,0,116,0,0,106,1,0,68,93,44,0,125,2, ++ 0,121,14,0,124,2,0,124,1,0,131,1,0,83,87,113, ++ 38,0,4,116,5,0,107,10,0,114,81,0,1,1,1,119, ++ 38,0,89,113,38,0,88,113,38,0,87,100,2,0,83,100, ++ 2,0,83,41,3,122,113,83,101,97,114,99,104,32,115,101, ++ 113,117,101,110,99,101,32,111,102,32,104,111,111,107,115,32, ++ 102,111,114,32,97,32,102,105,110,100,101,114,32,102,111,114, ++ 32,39,112,97,116,104,39,46,10,10,32,32,32,32,32,32, ++ 32,32,73,102,32,39,104,111,111,107,115,39,32,105,115,32, ++ 102,97,108,115,101,32,116,104,101,110,32,117,115,101,32,115, ++ 121,115,46,112,97,116,104,95,104,111,111,107,115,46,10,10, ++ 32,32,32,32,32,32,32,32,122,23,115,121,115,46,112,97, ++ 116,104,95,104,111,111,107,115,32,105,115,32,101,109,112,116, ++ 121,78,41,6,114,7,0,0,0,218,10,112,97,116,104,95, ++ 104,111,111,107,115,114,166,0,0,0,114,167,0,0,0,114, ++ 168,0,0,0,114,153,0,0,0,41,3,114,248,0,0,0, ++ 114,35,0,0,0,90,4,104,111,111,107,114,4,0,0,0, ++ 114,4,0,0,0,114,5,0,0,0,218,11,95,112,97,116, ++ 104,95,104,111,111,107,115,252,6,0,0,115,16,0,0,0, ++ 0,7,9,1,19,1,16,1,3,1,14,1,13,1,12,2, ++ 122,22,80,97,116,104,70,105,110,100,101,114,46,95,112,97, ++ 116,104,95,104,111,111,107,115,99,2,0,0,0,0,0,0, ++ 0,3,0,0,0,11,0,0,0,67,0,0,0,115,97,0, ++ 0,0,124,1,0,100,1,0,107,2,0,114,27,0,116,0, ++ 0,106,1,0,131,0,0,125,1,0,110,0,0,121,17,0, ++ 116,2,0,106,3,0,124,1,0,25,125,2,0,87,110,46, ++ 0,4,116,4,0,107,10,0,114,92,0,1,1,1,124,0, ++ 0,106,5,0,124,1,0,131,1,0,125,2,0,124,2,0, ++ 116,2,0,106,3,0,124,1,0,60,89,110,1,0,88,124, ++ 2,0,83,41,2,122,210,71,101,116,32,116,104,101,32,102, ++ 105,110,100,101,114,32,102,111,114,32,116,104,101,32,112,97, ++ 116,104,32,101,110,116,114,121,32,102,114,111,109,32,115,121, ++ 115,46,112,97,116,104,95,105,109,112,111,114,116,101,114,95, ++ 99,97,99,104,101,46,10,10,32,32,32,32,32,32,32,32, ++ 73,102,32,116,104,101,32,112,97,116,104,32,101,110,116,114, ++ 121,32,105,115,32,110,111,116,32,105,110,32,116,104,101,32, ++ 99,97,99,104,101,44,32,102,105,110,100,32,116,104,101,32, ++ 97,112,112,114,111,112,114,105,97,116,101,32,102,105,110,100, ++ 101,114,10,32,32,32,32,32,32,32,32,97,110,100,32,99, ++ 97,99,104,101,32,105,116,46,32,73,102,32,110,111,32,102, ++ 105,110,100,101,114,32,105,115,32,97,118,97,105,108,97,98, ++ 108,101,44,32,115,116,111,114,101,32,78,111,110,101,46,10, ++ 10,32,32,32,32,32,32,32,32,114,30,0,0,0,41,6, ++ 114,3,0,0,0,114,45,0,0,0,114,7,0,0,0,114, ++ 74,1,0,0,114,79,0,0,0,114,78,1,0,0,41,3, ++ 114,248,0,0,0,114,35,0,0,0,114,76,1,0,0,114, ++ 4,0,0,0,114,4,0,0,0,114,5,0,0,0,218,20, ++ 95,112,97,116,104,95,105,109,112,111,114,116,101,114,95,99, ++ 97,99,104,101,13,7,0,0,115,16,0,0,0,0,8,12, ++ 1,15,1,3,1,17,1,13,1,15,1,18,1,122,31,80, ++ 97,116,104,70,105,110,100,101,114,46,95,112,97,116,104,95, ++ 105,109,112,111,114,116,101,114,95,99,97,99,104,101,99,3, ++ 0,0,0,0,0,0,0,6,0,0,0,3,0,0,0,67, ++ 0,0,0,115,113,0,0,0,116,0,0,124,2,0,100,1, ++ 0,131,2,0,114,39,0,124,2,0,106,1,0,124,1,0, ++ 131,1,0,92,2,0,125,3,0,125,4,0,110,21,0,124, ++ 2,0,106,2,0,124,1,0,131,1,0,125,3,0,100,0, ++ 0,125,4,0,124,3,0,100,0,0,107,9,0,114,85,0, ++ 116,3,0,124,1,0,124,3,0,131,2,0,83,116,4,0, ++ 124,1,0,100,0,0,131,2,0,125,5,0,124,4,0,124, ++ 5,0,95,5,0,124,5,0,83,41,2,78,114,165,0,0, ++ 0,41,6,114,60,0,0,0,114,165,0,0,0,114,14,1, ++ 0,0,114,173,0,0,0,114,216,0,0,0,114,220,0,0, ++ 0,41,6,114,248,0,0,0,114,158,0,0,0,114,76,1, ++ 0,0,114,169,0,0,0,114,170,0,0,0,114,177,0,0, ++ 0,114,4,0,0,0,114,4,0,0,0,114,5,0,0,0, ++ 218,16,95,108,101,103,97,99,121,95,103,101,116,95,115,112, ++ 101,99,30,7,0,0,115,18,0,0,0,0,2,15,1,24, ++ 2,15,1,6,1,12,1,13,1,15,1,9,1,122,27,80, ++ 97,116,104,70,105,110,100,101,114,46,95,108,101,103,97,99, ++ 121,95,103,101,116,95,115,112,101,99,78,99,4,0,0,0, ++ 0,0,0,0,9,0,0,0,5,0,0,0,67,0,0,0, ++ 115,252,0,0,0,103,0,0,125,4,0,120,239,0,124,2, ++ 0,68,93,203,0,125,5,0,116,0,0,124,5,0,116,1, ++ 0,116,2,0,102,2,0,131,2,0,115,46,0,113,13,0, ++ 110,0,0,124,0,0,106,3,0,124,5,0,131,1,0,125, ++ 6,0,124,6,0,100,1,0,107,9,0,114,13,0,116,4, ++ 0,124,6,0,100,2,0,131,2,0,114,109,0,124,6,0, ++ 106,5,0,124,1,0,124,3,0,131,2,0,125,7,0,110, ++ 18,0,124,0,0,106,6,0,124,1,0,124,6,0,131,2, ++ 0,125,7,0,124,7,0,100,1,0,107,8,0,114,145,0, ++ 113,13,0,110,0,0,124,7,0,106,7,0,100,1,0,107, ++ 9,0,114,164,0,124,7,0,83,124,7,0,106,8,0,125, ++ 8,0,124,8,0,100,1,0,107,8,0,114,200,0,116,9, ++ 0,100,3,0,131,1,0,130,1,0,110,0,0,124,4,0, ++ 106,10,0,124,8,0,131,1,0,1,113,13,0,113,13,0, ++ 87,116,11,0,124,1,0,100,1,0,131,2,0,125,7,0, ++ 124,4,0,124,7,0,95,8,0,124,7,0,83,100,1,0, ++ 83,41,4,122,63,70,105,110,100,32,116,104,101,32,108,111, ++ 97,100,101,114,32,111,114,32,110,97,109,101,115,112,97,99, ++ 101,95,112,97,116,104,32,102,111,114,32,116,104,105,115,32, ++ 109,111,100,117,108,101,47,112,97,99,107,97,103,101,32,110, ++ 97,109,101,46,78,114,13,1,0,0,122,19,115,112,101,99, ++ 32,109,105,115,115,105,110,103,32,108,111,97,100,101,114,41, ++ 12,114,192,0,0,0,218,3,115,116,114,218,5,98,121,116, ++ 101,115,114,79,1,0,0,114,60,0,0,0,114,13,1,0, ++ 0,114,80,1,0,0,114,169,0,0,0,114,220,0,0,0, ++ 114,153,0,0,0,114,197,0,0,0,114,216,0,0,0,41, ++ 9,114,248,0,0,0,114,158,0,0,0,114,35,0,0,0, ++ 114,12,1,0,0,218,14,110,97,109,101,115,112,97,99,101, ++ 95,112,97,116,104,90,5,101,110,116,114,121,114,76,1,0, ++ 0,114,177,0,0,0,114,170,0,0,0,114,4,0,0,0, ++ 114,4,0,0,0,114,5,0,0,0,218,9,95,103,101,116, ++ 95,115,112,101,99,43,7,0,0,115,40,0,0,0,0,5, ++ 6,1,13,1,21,1,6,1,15,1,12,1,15,1,21,2, ++ 18,1,12,1,6,1,15,1,4,1,9,1,12,1,15,5, ++ 20,2,15,1,9,1,122,20,80,97,116,104,70,105,110,100, ++ 101,114,46,95,103,101,116,95,115,112,101,99,99,4,0,0, ++ 0,0,0,0,0,6,0,0,0,4,0,0,0,67,0,0, ++ 0,115,143,0,0,0,124,2,0,100,1,0,107,8,0,114, ++ 24,0,116,0,0,106,1,0,125,2,0,110,0,0,124,0, ++ 0,106,2,0,124,1,0,124,2,0,124,3,0,131,3,0, ++ 125,4,0,124,4,0,100,1,0,107,8,0,114,61,0,100, ++ 1,0,83,124,4,0,106,3,0,100,1,0,107,8,0,114, ++ 135,0,124,4,0,106,4,0,125,5,0,124,5,0,114,128, ++ 0,100,2,0,124,4,0,95,5,0,116,6,0,124,1,0, ++ 124,5,0,124,0,0,106,2,0,131,3,0,124,4,0,95, ++ 4,0,124,4,0,83,100,1,0,83,110,4,0,124,4,0, ++ 83,100,1,0,83,41,3,122,98,102,105,110,100,32,116,104, ++ 101,32,109,111,100,117,108,101,32,111,110,32,115,121,115,46, ++ 112,97,116,104,32,111,114,32,39,112,97,116,104,39,32,98, ++ 97,115,101,100,32,111,110,32,115,121,115,46,112,97,116,104, ++ 95,104,111,111,107,115,32,97,110,100,10,32,32,32,32,32, ++ 32,32,32,115,121,115,46,112,97,116,104,95,105,109,112,111, ++ 114,116,101,114,95,99,97,99,104,101,46,78,90,9,110,97, ++ 109,101,115,112,97,99,101,41,7,114,7,0,0,0,114,35, ++ 0,0,0,114,84,1,0,0,114,169,0,0,0,114,220,0, ++ 0,0,114,217,0,0,0,114,59,1,0,0,41,6,114,248, ++ 0,0,0,114,158,0,0,0,114,35,0,0,0,114,12,1, ++ 0,0,114,177,0,0,0,114,83,1,0,0,114,4,0,0, ++ 0,114,4,0,0,0,114,5,0,0,0,114,13,1,0,0, ++ 75,7,0,0,115,26,0,0,0,0,4,12,1,12,1,21, ++ 1,12,1,4,1,15,1,9,1,6,3,9,1,24,1,4, ++ 2,7,2,122,20,80,97,116,104,70,105,110,100,101,114,46, ++ 102,105,110,100,95,115,112,101,99,99,3,0,0,0,0,0, ++ 0,0,4,0,0,0,3,0,0,0,67,0,0,0,115,41, ++ 0,0,0,124,0,0,106,0,0,124,1,0,124,2,0,131, ++ 2,0,125,3,0,124,3,0,100,1,0,107,8,0,114,34, ++ 0,100,1,0,83,124,3,0,106,1,0,83,41,2,122,98, ++ 102,105,110,100,32,116,104,101,32,109,111,100,117,108,101,32, ++ 111,110,32,115,121,115,46,112,97,116,104,32,111,114,32,39, ++ 112,97,116,104,39,32,98,97,115,101,100,32,111,110,32,115, ++ 121,115,46,112,97,116,104,95,104,111,111,107,115,32,97,110, ++ 100,10,32,32,32,32,32,32,32,32,115,121,115,46,112,97, ++ 116,104,95,105,109,112,111,114,116,101,114,95,99,97,99,104, ++ 101,46,78,41,2,114,13,1,0,0,114,169,0,0,0,41, ++ 4,114,248,0,0,0,114,158,0,0,0,114,35,0,0,0, ++ 114,177,0,0,0,114,4,0,0,0,114,4,0,0,0,114, ++ 5,0,0,0,114,14,1,0,0,97,7,0,0,115,8,0, ++ 0,0,0,5,18,1,12,1,4,1,122,22,80,97,116,104, ++ 70,105,110,100,101,114,46,102,105,110,100,95,109,111,100,117, ++ 108,101,41,12,114,57,0,0,0,114,56,0,0,0,114,58, ++ 0,0,0,114,59,0,0,0,114,10,1,0,0,114,73,1, ++ 0,0,114,78,1,0,0,114,79,1,0,0,114,80,1,0, ++ 0,114,84,1,0,0,114,13,1,0,0,114,14,1,0,0, ++ 114,4,0,0,0,114,4,0,0,0,114,4,0,0,0,114, ++ 5,0,0,0,114,72,1,0,0,240,6,0,0,115,22,0, ++ 0,0,12,2,6,2,18,8,18,17,18,17,18,13,3,1, ++ 18,31,3,1,21,21,3,1,114,72,1,0,0,99,0,0, ++ 0,0,0,0,0,0,0,0,0,0,3,0,0,0,64,0, ++ 0,0,115,133,0,0,0,101,0,0,90,1,0,100,0,0, ++ 90,2,0,100,1,0,90,3,0,100,2,0,100,3,0,132, ++ 0,0,90,4,0,100,4,0,100,5,0,132,0,0,90,5, ++ 0,101,6,0,90,7,0,100,6,0,100,7,0,132,0,0, ++ 90,8,0,100,8,0,100,9,0,132,0,0,90,9,0,100, ++ 10,0,100,11,0,100,12,0,132,1,0,90,10,0,100,13, ++ 0,100,14,0,132,0,0,90,11,0,101,12,0,100,15,0, ++ 100,16,0,132,0,0,131,1,0,90,13,0,100,17,0,100, ++ 18,0,132,0,0,90,14,0,100,10,0,83,41,19,218,10, ++ 70,105,108,101,70,105,110,100,101,114,122,172,70,105,108,101, ++ 45,98,97,115,101,100,32,102,105,110,100,101,114,46,10,10, ++ 32,32,32,32,73,110,116,101,114,97,99,116,105,111,110,115, ++ 32,119,105,116,104,32,116,104,101,32,102,105,108,101,32,115, ++ 121,115,116,101,109,32,97,114,101,32,99,97,99,104,101,100, ++ 32,102,111,114,32,112,101,114,102,111,114,109,97,110,99,101, ++ 44,32,98,101,105,110,103,10,32,32,32,32,114,101,102,114, ++ 101,115,104,101,100,32,119,104,101,110,32,116,104,101,32,100, ++ 105,114,101,99,116,111,114,121,32,116,104,101,32,102,105,110, ++ 100,101,114,32,105,115,32,104,97,110,100,108,105,110,103,32, ++ 104,97,115,32,98,101,101,110,32,109,111,100,105,102,105,101, ++ 100,46,10,10,32,32,32,32,99,2,0,0,0,0,0,0, ++ 0,5,0,0,0,5,0,0,0,7,0,0,0,115,122,0, ++ 0,0,103,0,0,125,3,0,120,52,0,124,2,0,68,93, ++ 44,0,92,2,0,137,0,0,125,4,0,124,3,0,106,0, ++ 0,135,0,0,102,1,0,100,1,0,100,2,0,134,0,0, ++ 124,4,0,68,131,1,0,131,1,0,1,113,13,0,87,124, ++ 3,0,124,0,0,95,1,0,124,1,0,112,79,0,100,3, ++ 0,124,0,0,95,2,0,100,6,0,124,0,0,95,3,0, ++ 116,4,0,131,0,0,124,0,0,95,5,0,116,4,0,131, ++ 0,0,124,0,0,95,6,0,100,5,0,83,41,7,122,154, ++ 73,110,105,116,105,97,108,105,122,101,32,119,105,116,104,32, ++ 116,104,101,32,112,97,116,104,32,116,111,32,115,101,97,114, ++ 99,104,32,111,110,32,97,110,100,32,97,32,118,97,114,105, ++ 97,98,108,101,32,110,117,109,98,101,114,32,111,102,10,32, ++ 32,32,32,32,32,32,32,50,45,116,117,112,108,101,115,32, ++ 99,111,110,116,97,105,110,105,110,103,32,116,104,101,32,108, ++ 111,97,100,101,114,32,97,110,100,32,116,104,101,32,102,105, ++ 108,101,32,115,117,102,102,105,120,101,115,32,116,104,101,32, ++ 108,111,97,100,101,114,10,32,32,32,32,32,32,32,32,114, ++ 101,99,111,103,110,105,122,101,115,46,99,1,0,0,0,0, ++ 0,0,0,2,0,0,0,3,0,0,0,51,0,0,0,115, ++ 27,0,0,0,124,0,0,93,17,0,125,1,0,124,1,0, ++ 136,0,0,102,2,0,86,1,113,3,0,100,0,0,83,41, ++ 1,78,114,4,0,0,0,41,2,114,22,0,0,0,114,56, ++ 1,0,0,41,1,114,169,0,0,0,114,4,0,0,0,114, ++ 5,0,0,0,114,77,0,0,0,123,7,0,0,115,2,0, ++ 0,0,6,0,122,38,70,105,108,101,70,105,110,100,101,114, ++ 46,95,95,105,110,105,116,95,95,46,60,108,111,99,97,108, ++ 115,62,46,60,103,101,110,101,120,112,114,62,114,116,0,0, ++ 0,114,29,0,0,0,78,114,138,0,0,0,41,7,114,197, ++ 0,0,0,218,8,95,108,111,97,100,101,114,115,114,35,0, ++ 0,0,218,11,95,112,97,116,104,95,109,116,105,109,101,218, ++ 3,115,101,116,218,11,95,112,97,116,104,95,99,97,99,104, ++ 101,218,19,95,114,101,108,97,120,101,100,95,112,97,116,104, ++ 95,99,97,99,104,101,41,5,114,71,0,0,0,114,35,0, ++ 0,0,218,14,108,111,97,100,101,114,95,100,101,116,97,105, ++ 108,115,90,7,108,111,97,100,101,114,115,114,127,0,0,0, ++ 114,4,0,0,0,41,1,114,169,0,0,0,114,5,0,0, ++ 0,114,72,0,0,0,117,7,0,0,115,16,0,0,0,0, ++ 4,6,1,19,1,36,1,9,2,15,1,9,1,12,1,122, ++ 19,70,105,108,101,70,105,110,100,101,114,46,95,95,105,110, ++ 105,116,95,95,99,1,0,0,0,0,0,0,0,1,0,0, ++ 0,2,0,0,0,67,0,0,0,115,13,0,0,0,100,3, ++ 0,124,0,0,95,0,0,100,2,0,83,41,4,122,31,73, ++ 110,118,97,108,105,100,97,116,101,32,116,104,101,32,100,105, ++ 114,101,99,116,111,114,121,32,109,116,105,109,101,46,114,29, ++ 0,0,0,78,114,138,0,0,0,41,1,114,87,1,0,0, ++ 41,1,114,71,0,0,0,114,4,0,0,0,114,4,0,0, ++ 0,114,5,0,0,0,114,73,1,0,0,131,7,0,0,115, ++ 2,0,0,0,0,2,122,28,70,105,108,101,70,105,110,100, ++ 101,114,46,105,110,118,97,108,105,100,97,116,101,95,99,97, ++ 99,104,101,115,99,2,0,0,0,0,0,0,0,3,0,0, ++ 0,3,0,0,0,67,0,0,0,115,59,0,0,0,124,0, ++ 0,106,0,0,124,1,0,131,1,0,125,2,0,124,2,0, ++ 100,1,0,107,8,0,114,37,0,100,1,0,103,0,0,102, ++ 2,0,83,124,2,0,106,1,0,124,2,0,106,2,0,112, ++ 55,0,103,0,0,102,2,0,83,41,2,122,125,84,114,121, ++ 32,116,111,32,102,105,110,100,32,97,32,108,111,97,100,101, ++ 114,32,102,111,114,32,116,104,101,32,115,112,101,99,105,102, ++ 105,101,100,32,109,111,100,117,108,101,44,32,111,114,32,116, ++ 104,101,32,110,97,109,101,115,112,97,99,101,10,32,32,32, ++ 32,32,32,32,32,112,97,99,107,97,103,101,32,112,111,114, ++ 116,105,111,110,115,46,32,82,101,116,117,114,110,115,32,40, ++ 108,111,97,100,101,114,44,32,108,105,115,116,45,111,102,45, ++ 112,111,114,116,105,111,110,115,41,46,78,41,3,114,13,1, ++ 0,0,114,169,0,0,0,114,220,0,0,0,41,3,114,71, ++ 0,0,0,114,158,0,0,0,114,177,0,0,0,114,4,0, ++ 0,0,114,4,0,0,0,114,5,0,0,0,114,165,0,0, ++ 0,137,7,0,0,115,8,0,0,0,0,3,15,1,12,1, ++ 10,1,122,22,70,105,108,101,70,105,110,100,101,114,46,102, ++ 105,110,100,95,108,111,97,100,101,114,99,6,0,0,0,0, ++ 0,0,0,7,0,0,0,7,0,0,0,67,0,0,0,115, ++ 40,0,0,0,124,1,0,124,2,0,124,3,0,131,2,0, ++ 125,6,0,116,0,0,124,2,0,124,3,0,100,1,0,124, ++ 6,0,100,2,0,124,4,0,131,2,2,83,41,3,78,114, ++ 169,0,0,0,114,220,0,0,0,41,1,114,238,0,0,0, ++ 41,7,114,71,0,0,0,114,242,0,0,0,114,158,0,0, ++ 0,114,35,0,0,0,114,227,0,0,0,114,12,1,0,0, ++ 114,169,0,0,0,114,4,0,0,0,114,4,0,0,0,114, ++ 5,0,0,0,114,84,1,0,0,145,7,0,0,115,6,0, ++ 0,0,0,1,15,1,18,1,122,20,70,105,108,101,70,105, ++ 110,100,101,114,46,95,103,101,116,95,115,112,101,99,78,99, ++ 3,0,0,0,0,0,0,0,14,0,0,0,15,0,0,0, ++ 67,0,0,0,115,240,1,0,0,100,1,0,125,3,0,124, ++ 1,0,106,0,0,100,2,0,131,1,0,100,3,0,25,125, ++ 4,0,121,34,0,116,1,0,124,0,0,106,2,0,112,49, ++ 0,116,3,0,106,4,0,131,0,0,131,1,0,106,5,0, ++ 125,5,0,87,110,24,0,4,116,6,0,107,10,0,114,85, ++ 0,1,1,1,100,10,0,125,5,0,89,110,1,0,88,124, ++ 5,0,124,0,0,106,7,0,107,3,0,114,123,0,124,0, ++ 0,106,8,0,131,0,0,1,124,5,0,124,0,0,95,7, ++ 0,110,0,0,116,9,0,131,0,0,114,156,0,124,0,0, ++ 106,10,0,125,6,0,124,4,0,106,11,0,131,0,0,125, ++ 7,0,110,15,0,124,0,0,106,12,0,125,6,0,124,4, ++ 0,125,7,0,124,7,0,124,6,0,107,6,0,114,51,1, ++ 116,13,0,124,0,0,106,2,0,124,4,0,131,2,0,125, ++ 8,0,120,103,0,124,0,0,106,14,0,68,93,77,0,92, ++ 2,0,125,9,0,125,10,0,100,5,0,124,9,0,23,125, ++ 11,0,116,13,0,124,8,0,124,11,0,131,2,0,125,12, ++ 0,116,15,0,124,12,0,131,1,0,114,211,0,124,0,0, ++ 106,16,0,124,10,0,124,1,0,124,12,0,124,8,0,103, ++ 1,0,124,2,0,131,5,0,83,113,211,0,87,116,17,0, ++ 124,8,0,131,1,0,125,3,0,110,0,0,120,126,0,124, ++ 0,0,106,14,0,68,93,115,0,92,2,0,125,9,0,125, ++ 10,0,116,13,0,124,0,0,106,2,0,124,4,0,124,9, ++ 0,23,131,2,0,125,12,0,116,18,0,100,6,0,106,19, ++ 0,124,12,0,131,1,0,100,7,0,100,3,0,131,1,1, ++ 1,124,7,0,124,9,0,23,124,6,0,107,6,0,114,61, ++ 1,116,15,0,124,12,0,131,1,0,114,176,1,124,0,0, ++ 106,16,0,124,10,0,124,1,0,124,12,0,100,8,0,124, ++ 2,0,131,5,0,83,113,61,1,113,61,1,87,124,3,0, ++ 114,236,1,116,18,0,100,9,0,106,19,0,124,8,0,131, ++ 1,0,131,1,0,1,116,20,0,124,1,0,100,8,0,131, ++ 2,0,125,13,0,124,8,0,103,1,0,124,13,0,95,21, ++ 0,124,13,0,83,100,8,0,83,41,11,122,125,84,114,121, ++ 32,116,111,32,102,105,110,100,32,97,32,108,111,97,100,101, ++ 114,32,102,111,114,32,116,104,101,32,115,112,101,99,105,102, ++ 105,101,100,32,109,111,100,117,108,101,44,32,111,114,32,116, ++ 104,101,32,110,97,109,101,115,112,97,99,101,10,32,32,32, ++ 32,32,32,32,32,112,97,99,107,97,103,101,32,112,111,114, ++ 116,105,111,110,115,46,32,82,101,116,117,114,110,115,32,40, ++ 108,111,97,100,101,114,44,32,108,105,115,116,45,111,102,45, ++ 112,111,114,116,105,111,110,115,41,46,70,114,116,0,0,0, ++ 114,115,0,0,0,114,29,0,0,0,114,72,0,0,0,122, ++ 9,116,114,121,105,110,103,32,123,125,114,145,0,0,0,78, ++ 122,25,112,111,115,115,105,98,108,101,32,110,97,109,101,115, ++ 112,97,99,101,32,102,111,114,32,123,125,114,138,0,0,0, ++ 41,22,114,32,0,0,0,114,39,0,0,0,114,35,0,0, ++ 0,114,3,0,0,0,114,45,0,0,0,114,51,1,0,0, ++ 114,40,0,0,0,114,87,1,0,0,218,11,95,102,105,108, ++ 108,95,99,97,99,104,101,114,6,0,0,0,114,90,1,0, ++ 0,114,139,0,0,0,114,89,1,0,0,114,28,0,0,0, ++ 114,86,1,0,0,114,44,0,0,0,114,84,1,0,0,114, ++ 46,0,0,0,114,152,0,0,0,114,47,0,0,0,114,216, ++ 0,0,0,114,220,0,0,0,41,14,114,71,0,0,0,114, ++ 158,0,0,0,114,12,1,0,0,90,12,105,115,95,110,97, ++ 109,101,115,112,97,99,101,90,11,116,97,105,108,95,109,111, ++ 100,117,108,101,114,183,0,0,0,90,5,99,97,99,104,101, ++ 90,12,99,97,99,104,101,95,109,111,100,117,108,101,90,9, ++ 98,97,115,101,95,112,97,116,104,114,56,1,0,0,114,242, ++ 0,0,0,90,13,105,110,105,116,95,102,105,108,101,110,97, ++ 109,101,90,9,102,117,108,108,95,112,97,116,104,114,177,0, + 0,0,114,4,0,0,0,114,4,0,0,0,114,5,0,0, +- 0,114,200,0,0,0,205,6,0,0,115,2,0,0,0,0, +- 2,122,28,95,78,97,109,101,115,112,97,99,101,76,111,97, +- 100,101,114,46,109,111,100,117,108,101,95,114,101,112,114,99, +- 2,0,0,0,0,0,0,0,2,0,0,0,1,0,0,0, +- 67,0,0,0,115,4,0,0,0,100,1,0,83,41,2,78, +- 84,114,4,0,0,0,41,2,114,78,0,0,0,114,152,0, +- 0,0,114,4,0,0,0,114,4,0,0,0,114,5,0,0, +- 0,114,216,0,0,0,209,6,0,0,115,2,0,0,0,0, +- 1,122,27,95,78,97,109,101,115,112,97,99,101,76,111,97, +- 100,101,114,46,105,115,95,112,97,99,107,97,103,101,99,2, +- 0,0,0,0,0,0,0,2,0,0,0,1,0,0,0,67, +- 0,0,0,115,4,0,0,0,100,1,0,83,41,2,78,114, +- 30,0,0,0,114,4,0,0,0,41,2,114,78,0,0,0, +- 114,152,0,0,0,114,4,0,0,0,114,4,0,0,0,114, +- 5,0,0,0,114,11,1,0,0,212,6,0,0,115,2,0, +- 0,0,0,1,122,27,95,78,97,109,101,115,112,97,99,101, +- 76,111,97,100,101,114,46,103,101,116,95,115,111,117,114,99, +- 101,99,2,0,0,0,0,0,0,0,2,0,0,0,6,0, +- 0,0,67,0,0,0,115,22,0,0,0,116,0,0,100,1, +- 0,100,2,0,100,3,0,100,4,0,100,5,0,131,3,1, +- 83,41,6,78,114,30,0,0,0,122,8,60,115,116,114,105, +- 110,103,62,114,170,0,0,0,114,36,1,0,0,84,41,1, +- 114,37,1,0,0,41,2,114,78,0,0,0,114,152,0,0, ++ 0,114,13,1,0,0,150,7,0,0,115,68,0,0,0,0, ++ 3,6,1,19,1,3,1,34,1,13,1,11,1,15,1,10, ++ 1,12,2,9,1,9,1,15,2,9,1,6,2,12,1,18, ++ 1,22,1,10,1,15,1,12,1,32,4,15,2,22,1,22, ++ 1,25,1,16,1,12,1,32,1,6,1,19,1,15,1,12, ++ 1,4,1,122,20,70,105,108,101,70,105,110,100,101,114,46, ++ 102,105,110,100,95,115,112,101,99,99,1,0,0,0,0,0, ++ 0,0,9,0,0,0,13,0,0,0,67,0,0,0,115,14, ++ 1,0,0,124,0,0,106,0,0,125,1,0,121,31,0,116, ++ 1,0,106,2,0,124,1,0,112,33,0,116,1,0,106,3, ++ 0,131,0,0,131,1,0,125,2,0,87,110,33,0,4,116, ++ 4,0,116,5,0,116,6,0,102,3,0,107,10,0,114,75, ++ 0,1,1,1,103,0,0,125,2,0,89,110,1,0,88,116, ++ 7,0,106,8,0,106,9,0,100,1,0,131,1,0,115,112, ++ 0,116,10,0,124,2,0,131,1,0,124,0,0,95,11,0, ++ 110,111,0,116,10,0,131,0,0,125,3,0,120,90,0,124, ++ 2,0,68,93,82,0,125,4,0,124,4,0,106,12,0,100, ++ 2,0,131,1,0,92,3,0,125,5,0,125,6,0,125,7, ++ 0,124,6,0,114,191,0,100,3,0,106,13,0,124,5,0, ++ 124,7,0,106,14,0,131,0,0,131,2,0,125,8,0,110, ++ 6,0,124,5,0,125,8,0,124,3,0,106,15,0,124,8, ++ 0,131,1,0,1,113,128,0,87,124,3,0,124,0,0,95, ++ 11,0,116,7,0,106,8,0,106,9,0,116,16,0,131,1, ++ 0,114,10,1,100,4,0,100,5,0,132,0,0,124,2,0, ++ 68,131,1,0,124,0,0,95,17,0,110,0,0,100,6,0, ++ 83,41,7,122,68,70,105,108,108,32,116,104,101,32,99,97, ++ 99,104,101,32,111,102,32,112,111,116,101,110,116,105,97,108, ++ 32,109,111,100,117,108,101,115,32,97,110,100,32,112,97,99, ++ 107,97,103,101,115,32,102,111,114,32,116,104,105,115,32,100, ++ 105,114,101,99,116,111,114,121,46,114,0,0,0,0,114,116, ++ 0,0,0,122,5,123,125,46,123,125,99,1,0,0,0,0, ++ 0,0,0,2,0,0,0,3,0,0,0,83,0,0,0,115, ++ 28,0,0,0,104,0,0,124,0,0,93,18,0,125,1,0, ++ 124,1,0,106,0,0,131,0,0,146,2,0,113,6,0,83, ++ 114,4,0,0,0,41,1,114,139,0,0,0,41,2,114,22, ++ 0,0,0,90,2,102,110,114,4,0,0,0,114,4,0,0, ++ 0,114,5,0,0,0,250,9,60,115,101,116,99,111,109,112, ++ 62,224,7,0,0,115,2,0,0,0,9,0,122,41,70,105, ++ 108,101,70,105,110,100,101,114,46,95,102,105,108,108,95,99, ++ 97,99,104,101,46,60,108,111,99,97,108,115,62,46,60,115, ++ 101,116,99,111,109,112,62,78,41,18,114,35,0,0,0,114, ++ 3,0,0,0,90,7,108,105,115,116,100,105,114,114,45,0, ++ 0,0,218,17,70,105,108,101,78,111,116,70,111,117,110,100, ++ 69,114,114,111,114,218,15,80,101,114,109,105,115,115,105,111, ++ 110,69,114,114,111,114,218,18,78,111,116,65,68,105,114,101, ++ 99,116,111,114,121,69,114,114,111,114,114,7,0,0,0,114, ++ 8,0,0,0,114,9,0,0,0,114,88,1,0,0,114,89, ++ 1,0,0,114,121,0,0,0,114,47,0,0,0,114,139,0, ++ 0,0,218,3,97,100,100,114,10,0,0,0,114,90,1,0, ++ 0,41,9,114,71,0,0,0,114,35,0,0,0,90,8,99, ++ 111,110,116,101,110,116,115,90,21,108,111,119,101,114,95,115, ++ 117,102,102,105,120,95,99,111,110,116,101,110,116,115,114,70, ++ 1,0,0,114,67,0,0,0,114,64,1,0,0,114,56,1, ++ 0,0,90,8,110,101,119,95,110,97,109,101,114,4,0,0, ++ 0,114,4,0,0,0,114,5,0,0,0,114,92,1,0,0, ++ 195,7,0,0,115,34,0,0,0,0,2,9,1,3,1,31, ++ 1,22,3,11,3,18,1,18,7,9,1,13,1,24,1,6, ++ 1,27,2,6,1,17,1,9,1,18,1,122,22,70,105,108, ++ 101,70,105,110,100,101,114,46,95,102,105,108,108,95,99,97, ++ 99,104,101,99,1,0,0,0,0,0,0,0,3,0,0,0, ++ 3,0,0,0,7,0,0,0,115,25,0,0,0,135,0,0, ++ 135,1,0,102,2,0,100,1,0,100,2,0,134,0,0,125, ++ 2,0,124,2,0,83,41,3,97,20,1,0,0,65,32,99, ++ 108,97,115,115,32,109,101,116,104,111,100,32,119,104,105,99, ++ 104,32,114,101,116,117,114,110,115,32,97,32,99,108,111,115, ++ 117,114,101,32,116,111,32,117,115,101,32,111,110,32,115,121, ++ 115,46,112,97,116,104,95,104,111,111,107,10,32,32,32,32, ++ 32,32,32,32,119,104,105,99,104,32,119,105,108,108,32,114, ++ 101,116,117,114,110,32,97,110,32,105,110,115,116,97,110,99, ++ 101,32,117,115,105,110,103,32,116,104,101,32,115,112,101,99, ++ 105,102,105,101,100,32,108,111,97,100,101,114,115,32,97,110, ++ 100,32,116,104,101,32,112,97,116,104,10,32,32,32,32,32, ++ 32,32,32,99,97,108,108,101,100,32,111,110,32,116,104,101, ++ 32,99,108,111,115,117,114,101,46,10,10,32,32,32,32,32, ++ 32,32,32,73,102,32,116,104,101,32,112,97,116,104,32,99, ++ 97,108,108,101,100,32,111,110,32,116,104,101,32,99,108,111, ++ 115,117,114,101,32,105,115,32,110,111,116,32,97,32,100,105, ++ 114,101,99,116,111,114,121,44,32,73,109,112,111,114,116,69, ++ 114,114,111,114,32,105,115,10,32,32,32,32,32,32,32,32, ++ 114,97,105,115,101,100,46,10,10,32,32,32,32,32,32,32, ++ 32,99,1,0,0,0,0,0,0,0,1,0,0,0,4,0, ++ 0,0,19,0,0,0,115,46,0,0,0,116,0,0,124,0, ++ 0,131,1,0,115,33,0,116,1,0,100,1,0,100,2,0, ++ 124,0,0,131,1,1,130,1,0,110,0,0,136,0,0,124, ++ 0,0,136,1,0,140,1,0,83,41,3,122,45,80,97,116, ++ 104,32,104,111,111,107,32,102,111,114,32,105,109,112,111,114, ++ 116,108,105,98,46,109,97,99,104,105,110,101,114,121,46,70, ++ 105,108,101,70,105,110,100,101,114,46,122,30,111,110,108,121, ++ 32,100,105,114,101,99,116,111,114,105,101,115,32,97,114,101, ++ 32,115,117,112,112,111,114,116,101,100,114,35,0,0,0,41, ++ 2,114,46,0,0,0,114,153,0,0,0,41,1,114,35,0, ++ 0,0,41,2,114,248,0,0,0,114,91,1,0,0,114,4, ++ 0,0,0,114,5,0,0,0,218,24,112,97,116,104,95,104, ++ 111,111,107,95,102,111,114,95,70,105,108,101,70,105,110,100, ++ 101,114,236,7,0,0,115,6,0,0,0,0,2,12,1,21, ++ 1,122,54,70,105,108,101,70,105,110,100,101,114,46,112,97, ++ 116,104,95,104,111,111,107,46,60,108,111,99,97,108,115,62, ++ 46,112,97,116,104,95,104,111,111,107,95,102,111,114,95,70, ++ 105,108,101,70,105,110,100,101,114,114,4,0,0,0,41,3, ++ 114,248,0,0,0,114,91,1,0,0,114,98,1,0,0,114, ++ 4,0,0,0,41,2,114,248,0,0,0,114,91,1,0,0, ++ 114,5,0,0,0,218,9,112,97,116,104,95,104,111,111,107, ++ 226,7,0,0,115,4,0,0,0,0,10,21,6,122,20,70, ++ 105,108,101,70,105,110,100,101,114,46,112,97,116,104,95,104, ++ 111,111,107,99,1,0,0,0,0,0,0,0,1,0,0,0, ++ 2,0,0,0,67,0,0,0,115,16,0,0,0,100,1,0, ++ 106,0,0,124,0,0,106,1,0,131,1,0,83,41,2,78, ++ 122,16,70,105,108,101,70,105,110,100,101,114,40,123,33,114, ++ 125,41,41,2,114,47,0,0,0,114,35,0,0,0,41,1, ++ 114,71,0,0,0,114,4,0,0,0,114,4,0,0,0,114, ++ 5,0,0,0,114,101,0,0,0,244,7,0,0,115,2,0, ++ 0,0,0,1,122,19,70,105,108,101,70,105,110,100,101,114, ++ 46,95,95,114,101,112,114,95,95,41,15,114,57,0,0,0, ++ 114,56,0,0,0,114,58,0,0,0,114,59,0,0,0,114, ++ 72,0,0,0,114,73,1,0,0,114,172,0,0,0,114,14, ++ 1,0,0,114,165,0,0,0,114,84,1,0,0,114,13,1, ++ 0,0,114,92,1,0,0,114,10,1,0,0,114,99,1,0, ++ 0,114,101,0,0,0,114,4,0,0,0,114,4,0,0,0, ++ 114,4,0,0,0,114,5,0,0,0,114,85,1,0,0,108, ++ 7,0,0,115,20,0,0,0,12,7,6,2,12,14,12,4, ++ 6,2,12,8,12,5,15,45,12,31,18,18,114,85,1,0, ++ 0,99,0,0,0,0,0,0,0,0,0,0,0,0,2,0, ++ 0,0,64,0,0,0,115,46,0,0,0,101,0,0,90,1, ++ 0,100,0,0,90,2,0,100,1,0,90,3,0,100,2,0, ++ 100,3,0,132,0,0,90,4,0,100,4,0,100,5,0,132, ++ 0,0,90,5,0,100,6,0,83,41,7,218,18,95,73,109, ++ 112,111,114,116,76,111,99,107,67,111,110,116,101,120,116,122, ++ 36,67,111,110,116,101,120,116,32,109,97,110,97,103,101,114, ++ 32,102,111,114,32,116,104,101,32,105,109,112,111,114,116,32, ++ 108,111,99,107,46,99,1,0,0,0,0,0,0,0,1,0, ++ 0,0,1,0,0,0,67,0,0,0,115,14,0,0,0,116, ++ 0,0,106,1,0,131,0,0,1,100,1,0,83,41,2,122, ++ 24,65,99,113,117,105,114,101,32,116,104,101,32,105,109,112, ++ 111,114,116,32,108,111,99,107,46,78,41,2,114,106,0,0, ++ 0,114,5,1,0,0,41,1,114,71,0,0,0,114,4,0, ++ 0,0,114,4,0,0,0,114,5,0,0,0,114,75,0,0, ++ 0,254,7,0,0,115,2,0,0,0,0,2,122,28,95,73, ++ 109,112,111,114,116,76,111,99,107,67,111,110,116,101,120,116, ++ 46,95,95,101,110,116,101,114,95,95,99,4,0,0,0,0, ++ 0,0,0,4,0,0,0,1,0,0,0,67,0,0,0,115, ++ 14,0,0,0,116,0,0,106,1,0,131,0,0,1,100,1, ++ 0,83,41,2,122,60,82,101,108,101,97,115,101,32,116,104, ++ 101,32,105,109,112,111,114,116,32,108,111,99,107,32,114,101, ++ 103,97,114,100,108,101,115,115,32,111,102,32,97,110,121,32, ++ 114,97,105,115,101,100,32,101,120,99,101,112,116,105,111,110, ++ 115,46,78,41,2,114,106,0,0,0,114,107,0,0,0,41, ++ 4,114,71,0,0,0,90,8,101,120,99,95,116,121,112,101, ++ 90,9,101,120,99,95,118,97,108,117,101,90,13,101,120,99, ++ 95,116,114,97,99,101,98,97,99,107,114,4,0,0,0,114, ++ 4,0,0,0,114,5,0,0,0,114,81,0,0,0,2,8, ++ 0,0,115,2,0,0,0,0,2,122,27,95,73,109,112,111, ++ 114,116,76,111,99,107,67,111,110,116,101,120,116,46,95,95, ++ 101,120,105,116,95,95,78,41,6,114,57,0,0,0,114,56, ++ 0,0,0,114,58,0,0,0,114,59,0,0,0,114,75,0, ++ 0,0,114,81,0,0,0,114,4,0,0,0,114,4,0,0, ++ 0,114,4,0,0,0,114,5,0,0,0,114,100,1,0,0, ++ 250,7,0,0,115,6,0,0,0,12,2,6,2,12,4,114, ++ 100,1,0,0,99,3,0,0,0,0,0,0,0,5,0,0, ++ 0,4,0,0,0,67,0,0,0,115,91,0,0,0,124,1, ++ 0,106,0,0,100,1,0,124,2,0,100,2,0,24,131,2, ++ 0,125,3,0,116,1,0,124,3,0,131,1,0,124,2,0, ++ 107,0,0,114,55,0,116,2,0,100,3,0,131,1,0,130, ++ 1,0,110,0,0,124,3,0,100,4,0,25,125,4,0,124, ++ 0,0,114,87,0,100,5,0,106,3,0,124,4,0,124,0, ++ 0,131,2,0,83,124,4,0,83,41,6,122,50,82,101,115, ++ 111,108,118,101,32,97,32,114,101,108,97,116,105,118,101,32, ++ 109,111,100,117,108,101,32,110,97,109,101,32,116,111,32,97, ++ 110,32,97,98,115,111,108,117,116,101,32,111,110,101,46,114, ++ 116,0,0,0,114,29,0,0,0,122,50,97,116,116,101,109, ++ 112,116,101,100,32,114,101,108,97,116,105,118,101,32,105,109, ++ 112,111,114,116,32,98,101,121,111,110,100,32,116,111,112,45, ++ 108,101,118,101,108,32,112,97,99,107,97,103,101,114,84,0, ++ 0,0,122,5,123,125,46,123,125,41,4,114,34,0,0,0, ++ 114,31,0,0,0,114,133,0,0,0,114,47,0,0,0,41, ++ 5,114,67,0,0,0,218,7,112,97,99,107,97,103,101,218, ++ 5,108,101,118,101,108,90,4,98,105,116,115,90,4,98,97, ++ 115,101,114,4,0,0,0,114,4,0,0,0,114,5,0,0, ++ 0,218,13,95,114,101,115,111,108,118,101,95,110,97,109,101, ++ 7,8,0,0,115,10,0,0,0,0,2,22,1,18,1,15, ++ 1,10,1,114,103,1,0,0,99,3,0,0,0,0,0,0, ++ 0,10,0,0,0,27,0,0,0,67,0,0,0,115,49,1, ++ 0,0,116,0,0,106,1,0,115,28,0,116,2,0,106,3, ++ 0,100,1,0,116,4,0,131,2,0,1,110,0,0,124,0, ++ 0,116,0,0,106,5,0,107,6,0,125,3,0,120,255,0, ++ 116,0,0,106,1,0,68,93,240,0,125,4,0,116,6,0, ++ 131,0,0,143,108,0,1,121,13,0,124,4,0,106,7,0, ++ 125,5,0,87,110,69,0,4,116,8,0,107,10,0,114,153, ++ 0,1,1,1,124,4,0,106,9,0,124,0,0,124,1,0, ++ 131,2,0,125,6,0,124,6,0,100,2,0,107,8,0,114, ++ 134,0,119,53,0,110,0,0,116,10,0,124,0,0,124,6, ++ 0,131,2,0,125,7,0,89,110,19,0,88,124,5,0,124, ++ 0,0,124,1,0,124,2,0,131,3,0,125,7,0,87,100, ++ 2,0,81,88,124,7,0,100,2,0,107,9,0,114,53,0, ++ 124,3,0,12,114,30,1,124,0,0,116,0,0,106,5,0, ++ 107,6,0,114,30,1,116,0,0,106,5,0,124,0,0,25, ++ 125,8,0,121,13,0,124,8,0,106,11,0,125,9,0,87, ++ 110,22,0,4,116,8,0,107,10,0,114,6,1,1,1,1, ++ 124,7,0,83,89,113,34,1,88,124,9,0,100,2,0,107, ++ 8,0,114,23,1,124,7,0,83,124,9,0,83,113,37,1, ++ 124,7,0,83,113,53,0,113,53,0,87,100,2,0,83,100, ++ 2,0,83,41,3,122,23,70,105,110,100,32,97,32,109,111, ++ 100,117,108,101,39,115,32,108,111,97,100,101,114,46,122,22, ++ 115,121,115,46,109,101,116,97,95,112,97,116,104,32,105,115, ++ 32,101,109,112,116,121,78,41,12,114,7,0,0,0,218,9, ++ 109,101,116,97,95,112,97,116,104,114,166,0,0,0,114,167, ++ 0,0,0,114,168,0,0,0,114,73,0,0,0,114,100,1, ++ 0,0,114,13,1,0,0,114,209,0,0,0,114,14,1,0, ++ 0,114,173,0,0,0,114,208,0,0,0,41,10,114,67,0, ++ 0,0,114,35,0,0,0,114,12,1,0,0,90,9,105,115, ++ 95,114,101,108,111,97,100,114,76,1,0,0,114,13,1,0, ++ 0,114,169,0,0,0,114,177,0,0,0,114,179,0,0,0, ++ 114,208,0,0,0,114,4,0,0,0,114,4,0,0,0,114, ++ 5,0,0,0,114,247,0,0,0,16,8,0,0,115,50,0, ++ 0,0,0,2,9,1,19,4,15,1,16,1,10,1,3,1, ++ 13,1,13,1,18,1,12,1,6,1,20,2,24,1,12,2, ++ 22,1,13,1,3,1,13,1,13,4,9,2,12,1,4,2, ++ 7,2,11,2,114,247,0,0,0,99,3,0,0,0,0,0, ++ 0,0,4,0,0,0,4,0,0,0,67,0,0,0,115,194, ++ 0,0,0,116,0,0,124,0,0,116,1,0,131,2,0,115, ++ 45,0,116,2,0,100,1,0,106,3,0,116,4,0,124,0, ++ 0,131,1,0,131,1,0,131,1,0,130,1,0,110,0,0, ++ 124,2,0,100,2,0,107,0,0,114,72,0,116,5,0,100, ++ 3,0,131,1,0,130,1,0,110,0,0,124,1,0,114,156, ++ 0,116,0,0,124,1,0,116,1,0,131,2,0,115,108,0, ++ 116,2,0,100,4,0,131,1,0,130,1,0,113,156,0,124, ++ 1,0,116,6,0,106,7,0,107,7,0,114,156,0,100,5, ++ 0,125,3,0,116,8,0,124,3,0,106,3,0,124,1,0, ++ 131,1,0,131,1,0,130,1,0,113,156,0,110,0,0,124, ++ 0,0,12,114,190,0,124,2,0,100,2,0,107,2,0,114, ++ 190,0,116,5,0,100,6,0,131,1,0,130,1,0,110,0, ++ 0,100,7,0,83,41,8,122,28,86,101,114,105,102,121,32, ++ 97,114,103,117,109,101,110,116,115,32,97,114,101,32,34,115, ++ 97,110,101,34,46,122,31,109,111,100,117,108,101,32,110,97, ++ 109,101,32,109,117,115,116,32,98,101,32,115,116,114,44,32, ++ 110,111,116,32,123,125,114,84,0,0,0,122,18,108,101,118, ++ 101,108,32,109,117,115,116,32,98,101,32,62,61,32,48,122, ++ 31,95,95,112,97,99,107,97,103,101,95,95,32,110,111,116, ++ 32,115,101,116,32,116,111,32,97,32,115,116,114,105,110,103, ++ 122,61,80,97,114,101,110,116,32,109,111,100,117,108,101,32, ++ 123,33,114,125,32,110,111,116,32,108,111,97,100,101,100,44, ++ 32,99,97,110,110,111,116,32,112,101,114,102,111,114,109,32, ++ 114,101,108,97,116,105,118,101,32,105,109,112,111,114,116,122, ++ 17,69,109,112,116,121,32,109,111,100,117,108,101,32,110,97, ++ 109,101,78,41,9,114,192,0,0,0,114,81,1,0,0,218, ++ 9,84,121,112,101,69,114,114,111,114,114,47,0,0,0,114, ++ 66,0,0,0,114,133,0,0,0,114,7,0,0,0,114,73, ++ 0,0,0,218,11,83,121,115,116,101,109,69,114,114,111,114, ++ 41,4,114,67,0,0,0,114,101,1,0,0,114,102,1,0, ++ 0,114,171,0,0,0,114,4,0,0,0,114,4,0,0,0, ++ 114,5,0,0,0,218,13,95,115,97,110,105,116,121,95,99, ++ 104,101,99,107,57,8,0,0,115,24,0,0,0,0,2,15, ++ 1,30,1,12,1,15,1,6,1,15,1,15,1,15,1,6, ++ 2,27,1,19,1,114,107,1,0,0,122,16,78,111,32,109, ++ 111,100,117,108,101,32,110,97,109,101,100,32,122,4,123,33, ++ 114,125,99,2,0,0,0,0,0,0,0,8,0,0,0,12, ++ 0,0,0,67,0,0,0,115,52,1,0,0,100,0,0,125, ++ 2,0,124,0,0,106,0,0,100,1,0,131,1,0,100,2, ++ 0,25,125,3,0,124,3,0,114,178,0,124,3,0,116,1, ++ 0,106,2,0,107,7,0,114,62,0,116,3,0,124,1,0, ++ 124,3,0,131,2,0,1,110,0,0,124,0,0,116,1,0, ++ 106,2,0,107,6,0,114,88,0,116,1,0,106,2,0,124, ++ 0,0,25,83,116,1,0,106,2,0,124,3,0,25,125,4, ++ 0,121,13,0,124,4,0,106,4,0,125,2,0,87,113,178, ++ 0,4,116,5,0,107,10,0,114,174,0,1,1,1,116,6, ++ 0,100,3,0,23,106,7,0,124,0,0,124,3,0,131,2, ++ 0,125,5,0,116,8,0,124,5,0,100,4,0,124,0,0, ++ 131,1,1,130,1,0,89,113,178,0,88,110,0,0,116,9, ++ 0,124,0,0,124,2,0,131,2,0,125,6,0,124,6,0, ++ 100,0,0,107,8,0,114,235,0,116,8,0,116,6,0,106, ++ 7,0,124,0,0,131,1,0,100,4,0,124,0,0,131,1, ++ 1,130,1,0,110,18,0,116,10,0,124,6,0,131,1,0, ++ 106,11,0,131,0,0,125,7,0,124,3,0,114,48,1,116, ++ 1,0,106,2,0,124,3,0,25,125,4,0,116,12,0,124, ++ 4,0,124,0,0,106,0,0,100,1,0,131,1,0,100,5, ++ 0,25,124,7,0,131,3,0,1,110,0,0,124,7,0,83, ++ 41,6,78,114,116,0,0,0,114,84,0,0,0,122,23,59, ++ 32,123,33,114,125,32,105,115,32,110,111,116,32,97,32,112, ++ 97,99,107,97,103,101,114,67,0,0,0,114,115,0,0,0, ++ 41,13,114,32,0,0,0,114,7,0,0,0,114,73,0,0, ++ 0,114,114,0,0,0,114,245,0,0,0,114,209,0,0,0, ++ 218,8,95,69,82,82,95,77,83,71,114,47,0,0,0,114, ++ 153,0,0,0,114,247,0,0,0,114,174,0,0,0,114,9, ++ 1,0,0,114,61,0,0,0,41,8,114,67,0,0,0,218, ++ 7,105,109,112,111,114,116,95,114,35,0,0,0,114,232,0, ++ 0,0,90,13,112,97,114,101,110,116,95,109,111,100,117,108, ++ 101,114,171,0,0,0,114,177,0,0,0,114,179,0,0,0, ++ 114,4,0,0,0,114,4,0,0,0,114,5,0,0,0,218, ++ 23,95,102,105,110,100,95,97,110,100,95,108,111,97,100,95, ++ 117,110,108,111,99,107,101,100,77,8,0,0,115,42,0,0, ++ 0,0,1,6,1,19,1,6,1,15,1,16,2,15,1,11, ++ 1,13,1,3,1,13,1,13,1,22,1,26,1,15,1,12, ++ 1,30,2,18,1,6,2,13,1,32,1,114,110,1,0,0, ++ 99,2,0,0,0,0,0,0,0,2,0,0,0,10,0,0, ++ 0,67,0,0,0,115,36,0,0,0,116,0,0,124,0,0, ++ 131,1,0,143,18,0,1,116,1,0,124,0,0,124,1,0, ++ 131,2,0,83,87,100,1,0,81,88,100,1,0,83,41,2, ++ 122,54,70,105,110,100,32,97,110,100,32,108,111,97,100,32, ++ 116,104,101,32,109,111,100,117,108,101,44,32,97,110,100,32, ++ 114,101,108,101,97,115,101,32,116,104,101,32,105,109,112,111, ++ 114,116,32,108,111,99,107,46,78,41,2,114,103,0,0,0, ++ 114,110,1,0,0,41,2,114,67,0,0,0,114,109,1,0, + 0,114,4,0,0,0,114,4,0,0,0,114,5,0,0,0, +- 114,10,1,0,0,215,6,0,0,115,2,0,0,0,0,1, +- 122,25,95,78,97,109,101,115,112,97,99,101,76,111,97,100, +- 101,114,46,103,101,116,95,99,111,100,101,99,2,0,0,0, +- 0,0,0,0,2,0,0,0,3,0,0,0,67,0,0,0, +- 115,29,0,0,0,116,0,0,100,1,0,124,0,0,106,1, +- 0,131,2,0,1,116,2,0,124,0,0,124,1,0,131,2, +- 0,83,41,2,122,24,76,111,97,100,32,97,32,110,97,109, +- 101,115,112,97,99,101,32,109,111,100,117,108,101,46,122,38, +- 110,97,109,101,115,112,97,99,101,32,109,111,100,117,108,101, +- 32,108,111,97,100,101,100,32,119,105,116,104,32,112,97,116, +- 104,32,123,33,114,125,41,3,114,146,0,0,0,114,249,0, +- 0,0,114,175,0,0,0,41,2,114,78,0,0,0,114,152, ++ 218,14,95,102,105,110,100,95,97,110,100,95,108,111,97,100, ++ 104,8,0,0,115,4,0,0,0,0,2,13,1,114,111,1, ++ 0,0,99,3,0,0,0,0,0,0,0,5,0,0,0,4, ++ 0,0,0,67,0,0,0,115,172,0,0,0,116,0,0,124, ++ 0,0,124,1,0,124,2,0,131,3,0,1,124,2,0,100, ++ 1,0,107,4,0,114,49,0,116,1,0,124,0,0,124,1, ++ 0,124,2,0,131,3,0,125,0,0,110,0,0,116,2,0, ++ 106,3,0,131,0,0,1,124,0,0,116,4,0,106,5,0, ++ 107,7,0,114,87,0,116,6,0,124,0,0,116,7,0,131, ++ 2,0,83,116,4,0,106,5,0,124,0,0,25,125,3,0, ++ 124,3,0,100,2,0,107,8,0,114,158,0,116,2,0,106, ++ 8,0,131,0,0,1,100,3,0,106,9,0,124,0,0,131, ++ 1,0,125,4,0,116,10,0,124,4,0,100,4,0,124,0, ++ 0,131,1,1,130,1,0,110,0,0,116,11,0,124,0,0, ++ 131,1,0,1,124,3,0,83,41,5,97,50,1,0,0,73, ++ 109,112,111,114,116,32,97,110,100,32,114,101,116,117,114,110, ++ 32,116,104,101,32,109,111,100,117,108,101,32,98,97,115,101, ++ 100,32,111,110,32,105,116,115,32,110,97,109,101,44,32,116, ++ 104,101,32,112,97,99,107,97,103,101,32,116,104,101,32,99, ++ 97,108,108,32,105,115,10,32,32,32,32,98,101,105,110,103, ++ 32,109,97,100,101,32,102,114,111,109,44,32,97,110,100,32, ++ 116,104,101,32,108,101,118,101,108,32,97,100,106,117,115,116, ++ 109,101,110,116,46,10,10,32,32,32,32,84,104,105,115,32, ++ 102,117,110,99,116,105,111,110,32,114,101,112,114,101,115,101, ++ 110,116,115,32,116,104,101,32,103,114,101,97,116,101,115,116, ++ 32,99,111,109,109,111,110,32,100,101,110,111,109,105,110,97, ++ 116,111,114,32,111,102,32,102,117,110,99,116,105,111,110,97, ++ 108,105,116,121,10,32,32,32,32,98,101,116,119,101,101,110, ++ 32,105,109,112,111,114,116,95,109,111,100,117,108,101,32,97, ++ 110,100,32,95,95,105,109,112,111,114,116,95,95,46,32,84, ++ 104,105,115,32,105,110,99,108,117,100,101,115,32,115,101,116, ++ 116,105,110,103,32,95,95,112,97,99,107,97,103,101,95,95, ++ 32,105,102,10,32,32,32,32,116,104,101,32,108,111,97,100, ++ 101,114,32,100,105,100,32,110,111,116,46,10,10,32,32,32, ++ 32,114,84,0,0,0,78,122,40,105,109,112,111,114,116,32, ++ 111,102,32,123,125,32,104,97,108,116,101,100,59,32,78,111, ++ 110,101,32,105,110,32,115,121,115,46,109,111,100,117,108,101, ++ 115,114,67,0,0,0,41,12,114,107,1,0,0,114,103,1, ++ 0,0,114,106,0,0,0,114,5,1,0,0,114,7,0,0, ++ 0,114,73,0,0,0,114,111,1,0,0,218,11,95,103,99, ++ 100,95,105,109,112,111,114,116,114,107,0,0,0,114,47,0, ++ 0,0,114,153,0,0,0,114,112,0,0,0,41,5,114,67, ++ 0,0,0,114,101,1,0,0,114,102,1,0,0,114,179,0, ++ 0,0,114,151,0,0,0,114,4,0,0,0,114,4,0,0, ++ 0,114,5,0,0,0,114,112,1,0,0,110,8,0,0,115, ++ 26,0,0,0,0,9,16,1,12,1,21,1,10,1,15,1, ++ 13,1,13,1,12,1,10,2,15,1,21,1,10,1,114,112, ++ 1,0,0,99,3,0,0,0,0,0,0,0,6,0,0,0, ++ 17,0,0,0,67,0,0,0,115,1,1,0,0,116,0,0, ++ 124,0,0,100,1,0,131,2,0,114,253,0,100,2,0,124, ++ 1,0,107,6,0,114,89,0,116,1,0,124,1,0,131,1, ++ 0,125,1,0,124,1,0,106,2,0,100,2,0,131,1,0, ++ 1,116,0,0,124,0,0,100,3,0,131,2,0,114,89,0, ++ 124,1,0,106,3,0,124,0,0,106,4,0,131,1,0,1, ++ 113,89,0,110,0,0,120,161,0,124,1,0,68,93,150,0, ++ 125,3,0,116,0,0,124,0,0,124,3,0,131,2,0,115, ++ 96,0,100,4,0,106,5,0,124,0,0,106,6,0,124,3, ++ 0,131,2,0,125,4,0,121,17,0,116,7,0,124,2,0, ++ 124,4,0,131,2,0,1,87,113,246,0,4,116,8,0,107, ++ 10,0,114,242,0,1,125,5,0,1,122,53,0,116,9,0, ++ 124,5,0,131,1,0,106,10,0,116,11,0,131,1,0,114, ++ 221,0,124,5,0,106,12,0,124,4,0,107,2,0,114,221, ++ 0,119,96,0,113,221,0,110,0,0,130,0,0,87,89,100, ++ 5,0,100,5,0,125,5,0,126,5,0,88,113,246,0,88, ++ 113,96,0,113,96,0,87,110,0,0,124,0,0,83,41,6, ++ 122,238,70,105,103,117,114,101,32,111,117,116,32,119,104,97, ++ 116,32,95,95,105,109,112,111,114,116,95,95,32,115,104,111, ++ 117,108,100,32,114,101,116,117,114,110,46,10,10,32,32,32, ++ 32,84,104,101,32,105,109,112,111,114,116,95,32,112,97,114, ++ 97,109,101,116,101,114,32,105,115,32,97,32,99,97,108,108, ++ 97,98,108,101,32,119,104,105,99,104,32,116,97,107,101,115, ++ 32,116,104,101,32,110,97,109,101,32,111,102,32,109,111,100, ++ 117,108,101,32,116,111,10,32,32,32,32,105,109,112,111,114, ++ 116,46,32,73,116,32,105,115,32,114,101,113,117,105,114,101, ++ 100,32,116,111,32,100,101,99,111,117,112,108,101,32,116,104, ++ 101,32,102,117,110,99,116,105,111,110,32,102,114,111,109,32, ++ 97,115,115,117,109,105,110,103,32,105,109,112,111,114,116,108, ++ 105,98,39,115,10,32,32,32,32,105,109,112,111,114,116,32, ++ 105,109,112,108,101,109,101,110,116,97,116,105,111,110,32,105, ++ 115,32,100,101,115,105,114,101,100,46,10,10,32,32,32,32, ++ 114,245,0,0,0,250,1,42,218,7,95,95,97,108,108,95, ++ 95,122,5,123,125,46,123,125,78,41,13,114,60,0,0,0, ++ 114,244,0,0,0,218,6,114,101,109,111,118,101,114,197,0, ++ 0,0,114,114,1,0,0,114,47,0,0,0,114,57,0,0, ++ 0,114,114,0,0,0,114,153,0,0,0,114,81,1,0,0, ++ 114,9,0,0,0,218,15,95,69,82,82,95,77,83,71,95, ++ 80,82,69,70,73,88,114,67,0,0,0,41,6,114,179,0, ++ 0,0,218,8,102,114,111,109,108,105,115,116,114,109,1,0, ++ 0,114,16,0,0,0,90,9,102,114,111,109,95,110,97,109, ++ 101,114,39,1,0,0,114,4,0,0,0,114,4,0,0,0, ++ 114,5,0,0,0,218,16,95,104,97,110,100,108,101,95,102, ++ 114,111,109,108,105,115,116,134,8,0,0,115,34,0,0,0, ++ 0,10,15,1,12,1,12,1,13,1,15,1,22,1,13,1, ++ 15,1,21,1,3,1,17,1,18,4,21,1,15,1,9,1, ++ 32,1,114,118,1,0,0,99,1,0,0,0,0,0,0,0, ++ 2,0,0,0,2,0,0,0,67,0,0,0,115,78,0,0, ++ 0,124,0,0,106,0,0,100,1,0,131,1,0,125,1,0, ++ 124,1,0,100,2,0,107,8,0,114,74,0,124,0,0,100, ++ 3,0,25,125,1,0,100,4,0,124,0,0,107,7,0,114, ++ 74,0,124,1,0,106,1,0,100,5,0,131,1,0,100,6, ++ 0,25,125,1,0,113,74,0,110,0,0,124,1,0,83,41, ++ 7,122,167,67,97,108,99,117,108,97,116,101,32,119,104,97, ++ 116,32,95,95,112,97,99,107,97,103,101,95,95,32,115,104, ++ 111,117,108,100,32,98,101,46,10,10,32,32,32,32,95,95, ++ 112,97,99,107,97,103,101,95,95,32,105,115,32,110,111,116, ++ 32,103,117,97,114,97,110,116,101,101,100,32,116,111,32,98, ++ 101,32,100,101,102,105,110,101,100,32,111,114,32,99,111,117, ++ 108,100,32,98,101,32,115,101,116,32,116,111,32,78,111,110, ++ 101,10,32,32,32,32,116,111,32,114,101,112,114,101,115,101, ++ 110,116,32,116,104,97,116,32,105,116,115,32,112,114,111,112, ++ 101,114,32,118,97,108,117,101,32,105,115,32,117,110,107,110, ++ 111,119,110,46,10,10,32,32,32,32,114,252,0,0,0,78, ++ 114,57,0,0,0,114,245,0,0,0,114,116,0,0,0,114, ++ 84,0,0,0,41,2,114,93,0,0,0,114,32,0,0,0, ++ 41,2,218,7,103,108,111,98,97,108,115,114,101,1,0,0, ++ 114,4,0,0,0,114,4,0,0,0,114,5,0,0,0,218, ++ 17,95,99,97,108,99,95,95,95,112,97,99,107,97,103,101, ++ 95,95,166,8,0,0,115,12,0,0,0,0,7,15,1,12, ++ 1,10,1,12,1,25,1,114,120,1,0,0,99,0,0,0, ++ 0,0,0,0,0,3,0,0,0,3,0,0,0,67,0,0, ++ 0,115,55,0,0,0,116,0,0,116,1,0,106,2,0,131, ++ 0,0,102,2,0,125,0,0,116,3,0,116,4,0,102,2, ++ 0,125,1,0,116,5,0,116,6,0,102,2,0,125,2,0, ++ 124,0,0,124,1,0,124,2,0,103,3,0,83,41,1,122, ++ 95,82,101,116,117,114,110,115,32,97,32,108,105,115,116,32, ++ 111,102,32,102,105,108,101,45,98,97,115,101,100,32,109,111, ++ 100,117,108,101,32,108,111,97,100,101,114,115,46,10,10,32, ++ 32,32,32,69,97,99,104,32,105,116,101,109,32,105,115,32, ++ 97,32,116,117,112,108,101,32,40,108,111,97,100,101,114,44, ++ 32,115,117,102,102,105,120,101,115,41,46,10,32,32,32,32, ++ 41,7,114,55,1,0,0,114,106,0,0,0,218,18,101,120, ++ 116,101,110,115,105,111,110,95,115,117,102,102,105,120,101,115, ++ 114,50,1,0,0,114,134,0,0,0,114,54,1,0,0,114, ++ 231,0,0,0,41,3,90,10,101,120,116,101,110,115,105,111, ++ 110,115,90,6,115,111,117,114,99,101,90,8,98,121,116,101, ++ 99,111,100,101,114,4,0,0,0,114,4,0,0,0,114,5, ++ 0,0,0,114,239,0,0,0,181,8,0,0,115,8,0,0, ++ 0,0,5,18,1,12,1,12,1,114,239,0,0,0,99,5, ++ 0,0,0,0,0,0,0,9,0,0,0,5,0,0,0,67, ++ 0,0,0,115,227,0,0,0,124,4,0,100,1,0,107,2, ++ 0,114,27,0,116,0,0,124,0,0,131,1,0,125,5,0, ++ 110,54,0,124,1,0,100,2,0,107,9,0,114,45,0,124, ++ 1,0,110,3,0,105,0,0,125,6,0,116,1,0,124,6, ++ 0,131,1,0,125,7,0,116,0,0,124,0,0,124,7,0, ++ 124,4,0,131,3,0,125,5,0,124,3,0,115,207,0,124, ++ 4,0,100,1,0,107,2,0,114,122,0,116,0,0,124,0, ++ 0,106,2,0,100,3,0,131,1,0,100,1,0,25,131,1, ++ 0,83,124,0,0,115,132,0,124,5,0,83,116,3,0,124, ++ 0,0,131,1,0,116,3,0,124,0,0,106,2,0,100,3, ++ 0,131,1,0,100,1,0,25,131,1,0,24,125,8,0,116, ++ 4,0,106,5,0,124,5,0,106,6,0,100,2,0,116,3, ++ 0,124,5,0,106,6,0,131,1,0,124,8,0,24,133,2, ++ 0,25,25,83,110,16,0,116,7,0,124,5,0,124,3,0, ++ 116,0,0,131,3,0,83,100,2,0,83,41,4,97,214,1, ++ 0,0,73,109,112,111,114,116,32,97,32,109,111,100,117,108, ++ 101,46,10,10,32,32,32,32,84,104,101,32,39,103,108,111, ++ 98,97,108,115,39,32,97,114,103,117,109,101,110,116,32,105, ++ 115,32,117,115,101,100,32,116,111,32,105,110,102,101,114,32, ++ 119,104,101,114,101,32,116,104,101,32,105,109,112,111,114,116, ++ 32,105,115,32,111,99,99,117,114,105,110,103,32,102,114,111, ++ 109,10,32,32,32,32,116,111,32,104,97,110,100,108,101,32, ++ 114,101,108,97,116,105,118,101,32,105,109,112,111,114,116,115, ++ 46,32,84,104,101,32,39,108,111,99,97,108,115,39,32,97, ++ 114,103,117,109,101,110,116,32,105,115,32,105,103,110,111,114, ++ 101,100,46,32,84,104,101,10,32,32,32,32,39,102,114,111, ++ 109,108,105,115,116,39,32,97,114,103,117,109,101,110,116,32, ++ 115,112,101,99,105,102,105,101,115,32,119,104,97,116,32,115, ++ 104,111,117,108,100,32,101,120,105,115,116,32,97,115,32,97, ++ 116,116,114,105,98,117,116,101,115,32,111,110,32,116,104,101, ++ 32,109,111,100,117,108,101,10,32,32,32,32,98,101,105,110, ++ 103,32,105,109,112,111,114,116,101,100,32,40,101,46,103,46, ++ 32,96,96,102,114,111,109,32,109,111,100,117,108,101,32,105, ++ 109,112,111,114,116,32,60,102,114,111,109,108,105,115,116,62, ++ 96,96,41,46,32,32,84,104,101,32,39,108,101,118,101,108, ++ 39,10,32,32,32,32,97,114,103,117,109,101,110,116,32,114, ++ 101,112,114,101,115,101,110,116,115,32,116,104,101,32,112,97, ++ 99,107,97,103,101,32,108,111,99,97,116,105,111,110,32,116, ++ 111,32,105,109,112,111,114,116,32,102,114,111,109,32,105,110, ++ 32,97,32,114,101,108,97,116,105,118,101,10,32,32,32,32, ++ 105,109,112,111,114,116,32,40,101,46,103,46,32,96,96,102, ++ 114,111,109,32,46,46,112,107,103,32,105,109,112,111,114,116, ++ 32,109,111,100,96,96,32,119,111,117,108,100,32,104,97,118, ++ 101,32,97,32,39,108,101,118,101,108,39,32,111,102,32,50, ++ 41,46,10,10,32,32,32,32,114,84,0,0,0,78,114,116, ++ 0,0,0,41,8,114,112,1,0,0,114,120,1,0,0,114, ++ 121,0,0,0,114,31,0,0,0,114,7,0,0,0,114,73, ++ 0,0,0,114,57,0,0,0,114,118,1,0,0,41,9,114, ++ 67,0,0,0,114,119,1,0,0,218,6,108,111,99,97,108, ++ 115,114,117,1,0,0,114,102,1,0,0,114,179,0,0,0, ++ 90,8,103,108,111,98,97,108,115,95,114,101,1,0,0,90, ++ 7,99,117,116,95,111,102,102,114,4,0,0,0,114,4,0, ++ 0,0,114,5,0,0,0,218,10,95,95,105,109,112,111,114, ++ 116,95,95,192,8,0,0,115,26,0,0,0,0,11,12,1, ++ 15,2,24,1,12,1,18,1,6,3,12,1,23,1,6,1, ++ 4,4,35,3,40,2,114,123,1,0,0,99,1,0,0,0, ++ 0,0,0,0,3,0,0,0,3,0,0,0,67,0,0,0, ++ 115,68,0,0,0,116,0,0,106,1,0,124,0,0,131,1, ++ 0,125,1,0,124,1,0,100,0,0,107,8,0,114,46,0, ++ 116,2,0,100,1,0,124,0,0,23,131,1,0,130,1,0, ++ 110,0,0,116,3,0,124,1,0,131,1,0,125,2,0,124, ++ 2,0,106,4,0,131,0,0,83,41,2,78,122,25,110,111, ++ 32,98,117,105,108,116,45,105,110,32,109,111,100,117,108,101, ++ 32,110,97,109,101,100,32,41,5,114,11,1,0,0,114,13, ++ 1,0,0,114,153,0,0,0,114,174,0,0,0,114,9,1, ++ 0,0,41,3,114,67,0,0,0,114,177,0,0,0,114,178, + 0,0,0,114,4,0,0,0,114,4,0,0,0,114,5,0, +- 0,0,114,0,1,0,0,219,6,0,0,115,4,0,0,0, +- 0,2,16,1,122,28,95,78,97,109,101,115,112,97,99,101, +- 76,111,97,100,101,114,46,108,111,97,100,95,109,111,100,117, +- 108,101,78,41,10,114,57,0,0,0,114,56,0,0,0,114, +- 58,0,0,0,114,79,0,0,0,114,4,1,0,0,114,200, +- 0,0,0,114,216,0,0,0,114,11,1,0,0,114,10,1, +- 0,0,114,0,1,0,0,114,4,0,0,0,114,4,0,0, +- 0,114,4,0,0,0,114,5,0,0,0,114,247,0,0,0, +- 200,6,0,0,115,12,0,0,0,12,1,12,4,18,4,12, +- 3,12,3,12,4,114,247,0,0,0,99,0,0,0,0,0, +- 0,0,0,0,0,0,0,5,0,0,0,64,0,0,0,115, +- 160,0,0,0,101,0,0,90,1,0,100,0,0,90,2,0, +- 100,1,0,90,3,0,101,4,0,100,2,0,100,3,0,132, +- 0,0,131,1,0,90,5,0,101,4,0,100,4,0,100,5, +- 0,132,0,0,131,1,0,90,6,0,101,4,0,100,6,0, +- 100,7,0,132,0,0,131,1,0,90,7,0,101,4,0,100, +- 8,0,100,9,0,132,0,0,131,1,0,90,8,0,101,4, +- 0,100,10,0,100,11,0,100,12,0,132,1,0,131,1,0, +- 90,9,0,101,4,0,100,10,0,100,10,0,100,13,0,100, +- 14,0,132,2,0,131,1,0,90,10,0,101,4,0,100,10, +- 0,100,15,0,100,16,0,132,1,0,131,1,0,90,11,0, +- 100,10,0,83,41,17,218,10,80,97,116,104,70,105,110,100, +- 101,114,122,62,77,101,116,97,32,112,97,116,104,32,102,105, +- 110,100,101,114,32,102,111,114,32,115,121,115,46,112,97,116, +- 104,32,97,110,100,32,112,97,99,107,97,103,101,32,95,95, +- 112,97,116,104,95,95,32,97,116,116,114,105,98,117,116,101, +- 115,46,99,1,0,0,0,0,0,0,0,2,0,0,0,4, +- 0,0,0,67,0,0,0,115,58,0,0,0,120,51,0,116, +- 0,0,106,1,0,106,2,0,131,0,0,68,93,34,0,125, +- 1,0,116,3,0,124,1,0,100,1,0,131,2,0,114,16, +- 0,124,1,0,106,4,0,131,0,0,1,113,16,0,113,16, +- 0,87,100,2,0,83,41,3,122,125,67,97,108,108,32,116, +- 104,101,32,105,110,118,97,108,105,100,97,116,101,95,99,97, +- 99,104,101,115,40,41,32,109,101,116,104,111,100,32,111,110, +- 32,97,108,108,32,112,97,116,104,32,101,110,116,114,121,32, +- 102,105,110,100,101,114,115,10,32,32,32,32,32,32,32,32, +- 115,116,111,114,101,100,32,105,110,32,115,121,115,46,112,97, +- 116,104,95,105,109,112,111,114,116,101,114,95,99,97,99,104, +- 101,115,32,40,119,104,101,114,101,32,105,109,112,108,101,109, +- 101,110,116,101,100,41,46,218,17,105,110,118,97,108,105,100, +- 97,116,101,95,99,97,99,104,101,115,78,41,5,114,7,0, +- 0,0,218,19,112,97,116,104,95,105,109,112,111,114,116,101, +- 114,95,99,97,99,104,101,218,6,118,97,108,117,101,115,114, +- 60,0,0,0,114,68,1,0,0,41,2,114,242,0,0,0, +- 218,6,102,105,110,100,101,114,114,4,0,0,0,114,4,0, +- 0,0,114,5,0,0,0,114,68,1,0,0,231,6,0,0, +- 115,6,0,0,0,0,4,22,1,15,1,122,28,80,97,116, +- 104,70,105,110,100,101,114,46,105,110,118,97,108,105,100,97, +- 116,101,95,99,97,99,104,101,115,99,2,0,0,0,0,0, +- 0,0,3,0,0,0,12,0,0,0,67,0,0,0,115,94, +- 0,0,0,116,0,0,106,1,0,115,28,0,116,2,0,106, +- 3,0,100,1,0,116,4,0,131,2,0,1,110,0,0,120, +- 59,0,116,0,0,106,1,0,68,93,44,0,125,2,0,121, +- 14,0,124,2,0,124,1,0,131,1,0,83,87,113,38,0, +- 4,116,5,0,107,10,0,114,81,0,1,1,1,119,38,0, +- 89,113,38,0,88,113,38,0,87,100,2,0,83,100,2,0, +- 83,41,3,122,113,83,101,97,114,99,104,32,115,101,113,117, +- 101,110,99,101,32,111,102,32,104,111,111,107,115,32,102,111, +- 114,32,97,32,102,105,110,100,101,114,32,102,111,114,32,39, +- 112,97,116,104,39,46,10,10,32,32,32,32,32,32,32,32, +- 73,102,32,39,104,111,111,107,115,39,32,105,115,32,102,97, +- 108,115,101,32,116,104,101,110,32,117,115,101,32,115,121,115, +- 46,112,97,116,104,95,104,111,111,107,115,46,10,10,32,32, +- 32,32,32,32,32,32,122,23,115,121,115,46,112,97,116,104, +- 95,104,111,111,107,115,32,105,115,32,101,109,112,116,121,78, +- 41,6,114,7,0,0,0,218,10,112,97,116,104,95,104,111, +- 111,107,115,114,160,0,0,0,114,161,0,0,0,114,162,0, +- 0,0,114,147,0,0,0,41,3,114,242,0,0,0,114,35, +- 0,0,0,90,4,104,111,111,107,114,4,0,0,0,114,4, +- 0,0,0,114,5,0,0,0,218,11,95,112,97,116,104,95, +- 104,111,111,107,115,239,6,0,0,115,16,0,0,0,0,7, +- 9,1,19,1,16,1,3,1,14,1,13,1,12,2,122,22, +- 80,97,116,104,70,105,110,100,101,114,46,95,112,97,116,104, +- 95,104,111,111,107,115,99,2,0,0,0,0,0,0,0,3, +- 0,0,0,11,0,0,0,67,0,0,0,115,97,0,0,0, +- 124,1,0,100,1,0,107,2,0,114,27,0,116,0,0,106, +- 1,0,131,0,0,125,1,0,110,0,0,121,17,0,116,2, +- 0,106,3,0,124,1,0,25,125,2,0,87,110,46,0,4, +- 116,4,0,107,10,0,114,92,0,1,1,1,124,0,0,106, +- 5,0,124,1,0,131,1,0,125,2,0,124,2,0,116,2, +- 0,106,3,0,124,1,0,60,89,110,1,0,88,124,2,0, +- 83,41,2,122,210,71,101,116,32,116,104,101,32,102,105,110, +- 100,101,114,32,102,111,114,32,116,104,101,32,112,97,116,104, +- 32,101,110,116,114,121,32,102,114,111,109,32,115,121,115,46, +- 112,97,116,104,95,105,109,112,111,114,116,101,114,95,99,97, +- 99,104,101,46,10,10,32,32,32,32,32,32,32,32,73,102, +- 32,116,104,101,32,112,97,116,104,32,101,110,116,114,121,32, +- 105,115,32,110,111,116,32,105,110,32,116,104,101,32,99,97, +- 99,104,101,44,32,102,105,110,100,32,116,104,101,32,97,112, +- 112,114,111,112,114,105,97,116,101,32,102,105,110,100,101,114, +- 10,32,32,32,32,32,32,32,32,97,110,100,32,99,97,99, +- 104,101,32,105,116,46,32,73,102,32,110,111,32,102,105,110, +- 100,101,114,32,105,115,32,97,118,97,105,108,97,98,108,101, +- 44,32,115,116,111,114,101,32,78,111,110,101,46,10,10,32, +- 32,32,32,32,32,32,32,114,30,0,0,0,41,6,114,3, +- 0,0,0,114,45,0,0,0,114,7,0,0,0,114,69,1, +- 0,0,114,104,0,0,0,114,73,1,0,0,41,3,114,242, +- 0,0,0,114,35,0,0,0,114,71,1,0,0,114,4,0, +- 0,0,114,4,0,0,0,114,5,0,0,0,218,20,95,112, +- 97,116,104,95,105,109,112,111,114,116,101,114,95,99,97,99, +- 104,101,0,7,0,0,115,16,0,0,0,0,8,12,1,15, +- 1,3,1,17,1,13,1,15,1,18,1,122,31,80,97,116, +- 104,70,105,110,100,101,114,46,95,112,97,116,104,95,105,109, +- 112,111,114,116,101,114,95,99,97,99,104,101,99,3,0,0, +- 0,0,0,0,0,6,0,0,0,3,0,0,0,67,0,0, +- 0,115,113,0,0,0,116,0,0,124,2,0,100,1,0,131, +- 2,0,114,39,0,124,2,0,106,1,0,124,1,0,131,1, +- 0,92,2,0,125,3,0,125,4,0,110,21,0,124,2,0, +- 106,2,0,124,1,0,131,1,0,125,3,0,100,0,0,125, +- 4,0,124,3,0,100,0,0,107,9,0,114,85,0,116,3, +- 0,124,1,0,124,3,0,131,2,0,83,116,4,0,124,1, +- 0,100,0,0,131,2,0,125,5,0,124,4,0,124,5,0, +- 95,5,0,124,5,0,83,41,2,78,114,159,0,0,0,41, +- 6,114,60,0,0,0,114,159,0,0,0,114,9,1,0,0, +- 114,167,0,0,0,114,213,0,0,0,114,217,0,0,0,41, +- 6,114,242,0,0,0,114,152,0,0,0,114,71,1,0,0, +- 114,163,0,0,0,114,164,0,0,0,114,172,0,0,0,114, +- 4,0,0,0,114,4,0,0,0,114,5,0,0,0,218,16, +- 95,108,101,103,97,99,121,95,103,101,116,95,115,112,101,99, +- 17,7,0,0,115,18,0,0,0,0,2,15,1,24,2,15, +- 1,6,1,12,1,13,1,15,1,9,1,122,27,80,97,116, +- 104,70,105,110,100,101,114,46,95,108,101,103,97,99,121,95, +- 103,101,116,95,115,112,101,99,78,99,4,0,0,0,0,0, +- 0,0,9,0,0,0,5,0,0,0,67,0,0,0,115,252, +- 0,0,0,103,0,0,125,4,0,120,239,0,124,2,0,68, +- 93,203,0,125,5,0,116,0,0,124,5,0,116,1,0,116, +- 2,0,102,2,0,131,2,0,115,46,0,113,13,0,110,0, +- 0,124,0,0,106,3,0,124,5,0,131,1,0,125,6,0, +- 124,6,0,100,1,0,107,9,0,114,13,0,116,4,0,124, +- 6,0,100,2,0,131,2,0,114,109,0,124,6,0,106,5, +- 0,124,1,0,124,3,0,131,2,0,125,7,0,110,18,0, +- 124,0,0,106,6,0,124,1,0,124,6,0,131,2,0,125, +- 7,0,124,7,0,100,1,0,107,8,0,114,145,0,113,13, +- 0,110,0,0,124,7,0,106,7,0,100,1,0,107,9,0, +- 114,164,0,124,7,0,83,124,7,0,106,8,0,125,8,0, +- 124,8,0,100,1,0,107,8,0,114,200,0,116,9,0,100, +- 3,0,131,1,0,130,1,0,110,0,0,124,4,0,106,10, +- 0,124,8,0,131,1,0,1,113,13,0,113,13,0,87,116, +- 11,0,124,1,0,100,1,0,131,2,0,125,7,0,124,4, +- 0,124,7,0,95,8,0,124,7,0,83,100,1,0,83,41, +- 4,122,63,70,105,110,100,32,116,104,101,32,108,111,97,100, +- 101,114,32,111,114,32,110,97,109,101,115,112,97,99,101,95, +- 112,97,116,104,32,102,111,114,32,116,104,105,115,32,109,111, +- 100,117,108,101,47,112,97,99,107,97,103,101,32,110,97,109, +- 101,46,78,114,8,1,0,0,122,19,115,112,101,99,32,109, +- 105,115,115,105,110,103,32,108,111,97,100,101,114,41,12,114, +- 187,0,0,0,218,3,115,116,114,218,5,98,121,116,101,115, +- 114,74,1,0,0,114,60,0,0,0,114,8,1,0,0,114, +- 75,1,0,0,114,163,0,0,0,114,217,0,0,0,114,147, +- 0,0,0,114,192,0,0,0,114,213,0,0,0,41,9,114, +- 242,0,0,0,114,152,0,0,0,114,35,0,0,0,114,7, +- 1,0,0,218,14,110,97,109,101,115,112,97,99,101,95,112, +- 97,116,104,90,5,101,110,116,114,121,114,71,1,0,0,114, +- 172,0,0,0,114,164,0,0,0,114,4,0,0,0,114,4, +- 0,0,0,114,5,0,0,0,218,9,95,103,101,116,95,115, +- 112,101,99,30,7,0,0,115,40,0,0,0,0,5,6,1, +- 13,1,21,1,6,1,15,1,12,1,15,1,21,2,18,1, +- 12,1,6,1,15,1,4,1,9,1,12,1,15,5,20,2, +- 15,1,9,1,122,20,80,97,116,104,70,105,110,100,101,114, +- 46,95,103,101,116,95,115,112,101,99,99,4,0,0,0,0, +- 0,0,0,6,0,0,0,4,0,0,0,67,0,0,0,115, +- 143,0,0,0,124,2,0,100,1,0,107,8,0,114,24,0, +- 116,0,0,106,1,0,125,2,0,110,0,0,124,0,0,106, +- 2,0,124,1,0,124,2,0,124,3,0,131,3,0,125,4, +- 0,124,4,0,100,1,0,107,8,0,114,61,0,100,1,0, +- 83,124,4,0,106,3,0,100,1,0,107,8,0,114,135,0, +- 124,4,0,106,4,0,125,5,0,124,5,0,114,128,0,100, +- 2,0,124,4,0,95,5,0,116,6,0,124,1,0,124,5, +- 0,124,0,0,106,2,0,131,3,0,124,4,0,95,4,0, +- 124,4,0,83,100,1,0,83,110,4,0,124,4,0,83,100, +- 1,0,83,41,3,122,98,102,105,110,100,32,116,104,101,32, +- 109,111,100,117,108,101,32,111,110,32,115,121,115,46,112,97, +- 116,104,32,111,114,32,39,112,97,116,104,39,32,98,97,115, +- 101,100,32,111,110,32,115,121,115,46,112,97,116,104,95,104, +- 111,111,107,115,32,97,110,100,10,32,32,32,32,32,32,32, +- 32,115,121,115,46,112,97,116,104,95,105,109,112,111,114,116, +- 101,114,95,99,97,99,104,101,46,78,90,9,110,97,109,101, +- 115,112,97,99,101,41,7,114,7,0,0,0,114,35,0,0, +- 0,114,79,1,0,0,114,163,0,0,0,114,217,0,0,0, +- 114,214,0,0,0,114,54,1,0,0,41,6,114,242,0,0, +- 0,114,152,0,0,0,114,35,0,0,0,114,7,1,0,0, +- 114,172,0,0,0,114,78,1,0,0,114,4,0,0,0,114, +- 4,0,0,0,114,5,0,0,0,114,8,1,0,0,62,7, +- 0,0,115,26,0,0,0,0,4,12,1,12,1,21,1,12, +- 1,4,1,15,1,9,1,6,3,9,1,24,1,4,2,7, +- 2,122,20,80,97,116,104,70,105,110,100,101,114,46,102,105, +- 110,100,95,115,112,101,99,99,3,0,0,0,0,0,0,0, +- 4,0,0,0,3,0,0,0,67,0,0,0,115,41,0,0, +- 0,124,0,0,106,0,0,124,1,0,124,2,0,131,2,0, +- 125,3,0,124,3,0,100,1,0,107,8,0,114,34,0,100, +- 1,0,83,124,3,0,106,1,0,83,41,2,122,98,102,105, +- 110,100,32,116,104,101,32,109,111,100,117,108,101,32,111,110, +- 32,115,121,115,46,112,97,116,104,32,111,114,32,39,112,97, +- 116,104,39,32,98,97,115,101,100,32,111,110,32,115,121,115, +- 46,112,97,116,104,95,104,111,111,107,115,32,97,110,100,10, +- 32,32,32,32,32,32,32,32,115,121,115,46,112,97,116,104, +- 95,105,109,112,111,114,116,101,114,95,99,97,99,104,101,46, +- 78,41,2,114,8,1,0,0,114,163,0,0,0,41,4,114, +- 242,0,0,0,114,152,0,0,0,114,35,0,0,0,114,172, +- 0,0,0,114,4,0,0,0,114,4,0,0,0,114,5,0, +- 0,0,114,9,1,0,0,84,7,0,0,115,8,0,0,0, +- 0,5,18,1,12,1,4,1,122,22,80,97,116,104,70,105, +- 110,100,101,114,46,102,105,110,100,95,109,111,100,117,108,101, +- 41,12,114,57,0,0,0,114,56,0,0,0,114,58,0,0, +- 0,114,59,0,0,0,114,4,1,0,0,114,68,1,0,0, +- 114,73,1,0,0,114,74,1,0,0,114,75,1,0,0,114, +- 79,1,0,0,114,8,1,0,0,114,9,1,0,0,114,4, +- 0,0,0,114,4,0,0,0,114,4,0,0,0,114,5,0, +- 0,0,114,67,1,0,0,227,6,0,0,115,22,0,0,0, +- 12,2,6,2,18,8,18,17,18,17,18,13,3,1,18,31, +- 3,1,21,21,3,1,114,67,1,0,0,99,0,0,0,0, +- 0,0,0,0,0,0,0,0,3,0,0,0,64,0,0,0, +- 115,133,0,0,0,101,0,0,90,1,0,100,0,0,90,2, +- 0,100,1,0,90,3,0,100,2,0,100,3,0,132,0,0, +- 90,4,0,100,4,0,100,5,0,132,0,0,90,5,0,101, +- 6,0,90,7,0,100,6,0,100,7,0,132,0,0,90,8, +- 0,100,8,0,100,9,0,132,0,0,90,9,0,100,10,0, +- 100,11,0,100,12,0,132,1,0,90,10,0,100,13,0,100, +- 14,0,132,0,0,90,11,0,101,12,0,100,15,0,100,16, +- 0,132,0,0,131,1,0,90,13,0,100,17,0,100,18,0, +- 132,0,0,90,14,0,100,10,0,83,41,19,218,10,70,105, +- 108,101,70,105,110,100,101,114,122,172,70,105,108,101,45,98, +- 97,115,101,100,32,102,105,110,100,101,114,46,10,10,32,32, +- 32,32,73,110,116,101,114,97,99,116,105,111,110,115,32,119, +- 105,116,104,32,116,104,101,32,102,105,108,101,32,115,121,115, +- 116,101,109,32,97,114,101,32,99,97,99,104,101,100,32,102, +- 111,114,32,112,101,114,102,111,114,109,97,110,99,101,44,32, +- 98,101,105,110,103,10,32,32,32,32,114,101,102,114,101,115, +- 104,101,100,32,119,104,101,110,32,116,104,101,32,100,105,114, +- 101,99,116,111,114,121,32,116,104,101,32,102,105,110,100,101, +- 114,32,105,115,32,104,97,110,100,108,105,110,103,32,104,97, +- 115,32,98,101,101,110,32,109,111,100,105,102,105,101,100,46, +- 10,10,32,32,32,32,99,2,0,0,0,0,0,0,0,5, +- 0,0,0,5,0,0,0,7,0,0,0,115,122,0,0,0, +- 103,0,0,125,3,0,120,52,0,124,2,0,68,93,44,0, +- 92,2,0,137,0,0,125,4,0,124,3,0,106,0,0,135, +- 0,0,102,1,0,100,1,0,100,2,0,134,0,0,124,4, +- 0,68,131,1,0,131,1,0,1,113,13,0,87,124,3,0, +- 124,0,0,95,1,0,124,1,0,112,79,0,100,3,0,124, +- 0,0,95,2,0,100,6,0,124,0,0,95,3,0,116,4, +- 0,131,0,0,124,0,0,95,5,0,116,4,0,131,0,0, +- 124,0,0,95,6,0,100,5,0,83,41,7,122,154,73,110, +- 105,116,105,97,108,105,122,101,32,119,105,116,104,32,116,104, +- 101,32,112,97,116,104,32,116,111,32,115,101,97,114,99,104, +- 32,111,110,32,97,110,100,32,97,32,118,97,114,105,97,98, +- 108,101,32,110,117,109,98,101,114,32,111,102,10,32,32,32, +- 32,32,32,32,32,50,45,116,117,112,108,101,115,32,99,111, +- 110,116,97,105,110,105,110,103,32,116,104,101,32,108,111,97, +- 100,101,114,32,97,110,100,32,116,104,101,32,102,105,108,101, +- 32,115,117,102,102,105,120,101,115,32,116,104,101,32,108,111, +- 97,100,101,114,10,32,32,32,32,32,32,32,32,114,101,99, +- 111,103,110,105,122,101,115,46,99,1,0,0,0,0,0,0, +- 0,2,0,0,0,3,0,0,0,51,0,0,0,115,27,0, +- 0,0,124,0,0,93,17,0,125,1,0,124,1,0,136,0, +- 0,102,2,0,86,1,113,3,0,100,0,0,83,41,1,78, +- 114,4,0,0,0,41,2,114,22,0,0,0,114,51,1,0, +- 0,41,1,114,163,0,0,0,114,4,0,0,0,114,5,0, +- 0,0,114,211,0,0,0,110,7,0,0,115,2,0,0,0, +- 6,0,122,38,70,105,108,101,70,105,110,100,101,114,46,95, +- 95,105,110,105,116,95,95,46,60,108,111,99,97,108,115,62, +- 46,60,103,101,110,101,120,112,114,62,114,110,0,0,0,114, +- 29,0,0,0,78,114,132,0,0,0,41,7,114,192,0,0, +- 0,218,8,95,108,111,97,100,101,114,115,114,35,0,0,0, +- 218,11,95,112,97,116,104,95,109,116,105,109,101,218,3,115, +- 101,116,218,11,95,112,97,116,104,95,99,97,99,104,101,218, +- 19,95,114,101,108,97,120,101,100,95,112,97,116,104,95,99, +- 97,99,104,101,41,5,114,78,0,0,0,114,35,0,0,0, +- 218,14,108,111,97,100,101,114,95,100,101,116,97,105,108,115, +- 90,7,108,111,97,100,101,114,115,114,121,0,0,0,114,4, +- 0,0,0,41,1,114,163,0,0,0,114,5,0,0,0,114, +- 79,0,0,0,104,7,0,0,115,16,0,0,0,0,4,6, +- 1,19,1,36,1,9,2,15,1,9,1,12,1,122,19,70, +- 105,108,101,70,105,110,100,101,114,46,95,95,105,110,105,116, +- 95,95,99,1,0,0,0,0,0,0,0,1,0,0,0,2, +- 0,0,0,67,0,0,0,115,13,0,0,0,100,3,0,124, +- 0,0,95,0,0,100,2,0,83,41,4,122,31,73,110,118, +- 97,108,105,100,97,116,101,32,116,104,101,32,100,105,114,101, +- 99,116,111,114,121,32,109,116,105,109,101,46,114,29,0,0, +- 0,78,114,132,0,0,0,41,1,114,82,1,0,0,41,1, +- 114,78,0,0,0,114,4,0,0,0,114,4,0,0,0,114, +- 5,0,0,0,114,68,1,0,0,118,7,0,0,115,2,0, +- 0,0,0,2,122,28,70,105,108,101,70,105,110,100,101,114, +- 46,105,110,118,97,108,105,100,97,116,101,95,99,97,99,104, +- 101,115,99,2,0,0,0,0,0,0,0,3,0,0,0,3, +- 0,0,0,67,0,0,0,115,59,0,0,0,124,0,0,106, +- 0,0,124,1,0,131,1,0,125,2,0,124,2,0,100,1, +- 0,107,8,0,114,37,0,100,1,0,103,0,0,102,2,0, +- 83,124,2,0,106,1,0,124,2,0,106,2,0,112,55,0, +- 103,0,0,102,2,0,83,41,2,122,125,84,114,121,32,116, +- 111,32,102,105,110,100,32,97,32,108,111,97,100,101,114,32, +- 102,111,114,32,116,104,101,32,115,112,101,99,105,102,105,101, +- 100,32,109,111,100,117,108,101,44,32,111,114,32,116,104,101, +- 32,110,97,109,101,115,112,97,99,101,10,32,32,32,32,32, +- 32,32,32,112,97,99,107,97,103,101,32,112,111,114,116,105, +- 111,110,115,46,32,82,101,116,117,114,110,115,32,40,108,111, +- 97,100,101,114,44,32,108,105,115,116,45,111,102,45,112,111, +- 114,116,105,111,110,115,41,46,78,41,3,114,8,1,0,0, +- 114,163,0,0,0,114,217,0,0,0,41,3,114,78,0,0, +- 0,114,152,0,0,0,114,172,0,0,0,114,4,0,0,0, +- 114,4,0,0,0,114,5,0,0,0,114,159,0,0,0,124, +- 7,0,0,115,8,0,0,0,0,3,15,1,12,1,10,1, +- 122,22,70,105,108,101,70,105,110,100,101,114,46,102,105,110, +- 100,95,108,111,97,100,101,114,99,6,0,0,0,0,0,0, +- 0,8,0,0,0,13,0,0,0,67,0,0,0,115,97,0, +- 0,0,124,1,0,124,2,0,124,3,0,131,2,0,125,6, +- 0,121,13,0,124,6,0,106,0,0,125,7,0,87,110,43, +- 0,4,116,1,0,107,10,0,114,73,0,1,1,1,116,2, +- 0,124,2,0,124,3,0,100,1,0,124,6,0,100,2,0, +- 124,4,0,131,2,2,83,89,110,20,0,88,124,7,0,124, +- 2,0,124,3,0,124,4,0,124,5,0,131,4,0,83,100, +- 0,0,83,41,3,78,114,163,0,0,0,114,217,0,0,0, +- 41,3,114,79,1,0,0,114,204,0,0,0,114,232,0,0, +- 0,41,8,114,78,0,0,0,114,236,0,0,0,114,152,0, +- 0,0,114,35,0,0,0,114,217,0,0,0,114,7,1,0, +- 0,114,163,0,0,0,90,8,103,101,116,95,115,112,101,99, +- 114,4,0,0,0,114,4,0,0,0,114,5,0,0,0,114, +- 79,1,0,0,132,7,0,0,115,14,0,0,0,0,1,15, +- 1,3,1,13,1,13,1,18,1,12,2,122,20,70,105,108, +- 101,70,105,110,100,101,114,46,95,103,101,116,95,115,112,101, +- 99,78,99,3,0,0,0,0,0,0,0,14,0,0,0,15, +- 0,0,0,67,0,0,0,115,240,1,0,0,100,1,0,125, +- 3,0,124,1,0,106,0,0,100,2,0,131,1,0,100,3, +- 0,25,125,4,0,121,34,0,116,1,0,124,0,0,106,2, +- 0,112,49,0,116,3,0,106,4,0,131,0,0,131,1,0, +- 106,5,0,125,5,0,87,110,24,0,4,116,6,0,107,10, +- 0,114,85,0,1,1,1,100,10,0,125,5,0,89,110,1, +- 0,88,124,5,0,124,0,0,106,7,0,107,3,0,114,123, +- 0,124,0,0,106,8,0,131,0,0,1,124,5,0,124,0, +- 0,95,7,0,110,0,0,116,9,0,131,0,0,114,156,0, +- 124,0,0,106,10,0,125,6,0,124,4,0,106,11,0,131, +- 0,0,125,7,0,110,15,0,124,0,0,106,12,0,125,6, +- 0,124,4,0,125,7,0,124,7,0,124,6,0,107,6,0, +- 114,51,1,116,13,0,124,0,0,106,2,0,124,4,0,131, +- 2,0,125,8,0,120,103,0,124,0,0,106,14,0,68,93, +- 77,0,92,2,0,125,9,0,125,10,0,100,5,0,124,9, +- 0,23,125,11,0,116,13,0,124,8,0,124,11,0,131,2, +- 0,125,12,0,116,15,0,124,12,0,131,1,0,114,211,0, +- 124,0,0,106,16,0,124,10,0,124,1,0,124,12,0,124, +- 8,0,103,1,0,124,2,0,131,5,0,83,113,211,0,87, +- 116,17,0,124,8,0,131,1,0,125,3,0,110,0,0,120, +- 126,0,124,0,0,106,14,0,68,93,115,0,92,2,0,125, +- 9,0,125,10,0,116,13,0,124,0,0,106,2,0,124,4, +- 0,124,9,0,23,131,2,0,125,12,0,116,18,0,100,6, +- 0,106,19,0,124,12,0,131,1,0,100,7,0,100,3,0, +- 131,1,1,1,124,7,0,124,9,0,23,124,6,0,107,6, +- 0,114,61,1,116,15,0,124,12,0,131,1,0,114,176,1, +- 124,0,0,106,16,0,124,10,0,124,1,0,124,12,0,100, +- 8,0,124,2,0,131,5,0,83,113,61,1,113,61,1,87, +- 124,3,0,114,236,1,116,18,0,100,9,0,106,19,0,124, +- 8,0,131,1,0,131,1,0,1,116,20,0,124,1,0,100, +- 8,0,131,2,0,125,13,0,124,8,0,103,1,0,124,13, +- 0,95,21,0,124,13,0,83,100,8,0,83,41,11,122,125, +- 84,114,121,32,116,111,32,102,105,110,100,32,97,32,108,111, +- 97,100,101,114,32,102,111,114,32,116,104,101,32,115,112,101, +- 99,105,102,105,101,100,32,109,111,100,117,108,101,44,32,111, +- 114,32,116,104,101,32,110,97,109,101,115,112,97,99,101,10, +- 32,32,32,32,32,32,32,32,112,97,99,107,97,103,101,32, +- 112,111,114,116,105,111,110,115,46,32,82,101,116,117,114,110, +- 115,32,40,108,111,97,100,101,114,44,32,108,105,115,116,45, +- 111,102,45,112,111,114,116,105,111,110,115,41,46,70,114,110, +- 0,0,0,114,109,0,0,0,114,29,0,0,0,114,79,0, +- 0,0,122,9,116,114,121,105,110,103,32,123,125,114,139,0, +- 0,0,78,122,25,112,111,115,115,105,98,108,101,32,110,97, +- 109,101,115,112,97,99,101,32,102,111,114,32,123,125,114,132, +- 0,0,0,41,22,114,32,0,0,0,114,39,0,0,0,114, +- 35,0,0,0,114,3,0,0,0,114,45,0,0,0,114,46, +- 1,0,0,114,40,0,0,0,114,82,1,0,0,218,11,95, +- 102,105,108,108,95,99,97,99,104,101,114,6,0,0,0,114, +- 85,1,0,0,114,133,0,0,0,114,84,1,0,0,114,28, +- 0,0,0,114,81,1,0,0,114,44,0,0,0,114,79,1, +- 0,0,114,46,0,0,0,114,146,0,0,0,114,47,0,0, +- 0,114,213,0,0,0,114,217,0,0,0,41,14,114,78,0, +- 0,0,114,152,0,0,0,114,7,1,0,0,90,12,105,115, +- 95,110,97,109,101,115,112,97,99,101,90,11,116,97,105,108, +- 95,109,111,100,117,108,101,114,178,0,0,0,90,5,99,97, +- 99,104,101,90,12,99,97,99,104,101,95,109,111,100,117,108, +- 101,90,9,98,97,115,101,95,112,97,116,104,114,51,1,0, +- 0,114,236,0,0,0,90,13,105,110,105,116,95,102,105,108, +- 101,110,97,109,101,90,9,102,117,108,108,95,112,97,116,104, +- 114,172,0,0,0,114,4,0,0,0,114,4,0,0,0,114, +- 5,0,0,0,114,8,1,0,0,142,7,0,0,115,68,0, +- 0,0,0,3,6,1,19,1,3,1,34,1,13,1,11,1, +- 15,1,10,1,12,2,9,1,9,1,15,2,9,1,6,2, +- 12,1,18,1,22,1,10,1,15,1,12,1,32,4,15,2, +- 22,1,22,1,25,1,16,1,12,1,32,1,6,1,19,1, +- 15,1,12,1,4,1,122,20,70,105,108,101,70,105,110,100, +- 101,114,46,102,105,110,100,95,115,112,101,99,99,1,0,0, +- 0,0,0,0,0,9,0,0,0,13,0,0,0,67,0,0, +- 0,115,14,1,0,0,124,0,0,106,0,0,125,1,0,121, +- 31,0,116,1,0,106,2,0,124,1,0,112,33,0,116,1, +- 0,106,3,0,131,0,0,131,1,0,125,2,0,87,110,33, +- 0,4,116,4,0,116,5,0,116,6,0,102,3,0,107,10, +- 0,114,75,0,1,1,1,103,0,0,125,2,0,89,110,1, +- 0,88,116,7,0,106,8,0,106,9,0,100,1,0,131,1, +- 0,115,112,0,116,10,0,124,2,0,131,1,0,124,0,0, +- 95,11,0,110,111,0,116,10,0,131,0,0,125,3,0,120, +- 90,0,124,2,0,68,93,82,0,125,4,0,124,4,0,106, +- 12,0,100,2,0,131,1,0,92,3,0,125,5,0,125,6, +- 0,125,7,0,124,6,0,114,191,0,100,3,0,106,13,0, +- 124,5,0,124,7,0,106,14,0,131,0,0,131,2,0,125, +- 8,0,110,6,0,124,5,0,125,8,0,124,3,0,106,15, +- 0,124,8,0,131,1,0,1,113,128,0,87,124,3,0,124, +- 0,0,95,11,0,116,7,0,106,8,0,106,9,0,116,16, +- 0,131,1,0,114,10,1,100,4,0,100,5,0,132,0,0, +- 124,2,0,68,131,1,0,124,0,0,95,17,0,110,0,0, +- 100,6,0,83,41,7,122,68,70,105,108,108,32,116,104,101, +- 32,99,97,99,104,101,32,111,102,32,112,111,116,101,110,116, +- 105,97,108,32,109,111,100,117,108,101,115,32,97,110,100,32, +- 112,97,99,107,97,103,101,115,32,102,111,114,32,116,104,105, +- 115,32,100,105,114,101,99,116,111,114,121,46,114,0,0,0, +- 0,114,110,0,0,0,122,5,123,125,46,123,125,99,1,0, +- 0,0,0,0,0,0,2,0,0,0,3,0,0,0,83,0, +- 0,0,115,28,0,0,0,104,0,0,124,0,0,93,18,0, +- 125,1,0,124,1,0,106,0,0,131,0,0,146,2,0,113, +- 6,0,83,114,4,0,0,0,41,1,114,133,0,0,0,41, +- 2,114,22,0,0,0,90,2,102,110,114,4,0,0,0,114, +- 4,0,0,0,114,5,0,0,0,250,9,60,115,101,116,99, +- 111,109,112,62,216,7,0,0,115,2,0,0,0,9,0,122, +- 41,70,105,108,101,70,105,110,100,101,114,46,95,102,105,108, +- 108,95,99,97,99,104,101,46,60,108,111,99,97,108,115,62, +- 46,60,115,101,116,99,111,109,112,62,78,41,18,114,35,0, +- 0,0,114,3,0,0,0,90,7,108,105,115,116,100,105,114, +- 114,45,0,0,0,218,17,70,105,108,101,78,111,116,70,111, +- 117,110,100,69,114,114,111,114,218,15,80,101,114,109,105,115, +- 115,105,111,110,69,114,114,111,114,218,18,78,111,116,65,68, +- 105,114,101,99,116,111,114,121,69,114,114,111,114,114,7,0, +- 0,0,114,8,0,0,0,114,9,0,0,0,114,83,1,0, +- 0,114,84,1,0,0,114,115,0,0,0,114,47,0,0,0, +- 114,133,0,0,0,218,3,97,100,100,114,10,0,0,0,114, +- 85,1,0,0,41,9,114,78,0,0,0,114,35,0,0,0, +- 90,8,99,111,110,116,101,110,116,115,90,21,108,111,119,101, +- 114,95,115,117,102,102,105,120,95,99,111,110,116,101,110,116, +- 115,114,65,1,0,0,114,67,0,0,0,114,59,1,0,0, +- 114,51,1,0,0,90,8,110,101,119,95,110,97,109,101,114, +- 4,0,0,0,114,4,0,0,0,114,5,0,0,0,114,87, +- 1,0,0,187,7,0,0,115,34,0,0,0,0,2,9,1, +- 3,1,31,1,22,3,11,3,18,1,18,7,9,1,13,1, +- 24,1,6,1,27,2,6,1,17,1,9,1,18,1,122,22, +- 70,105,108,101,70,105,110,100,101,114,46,95,102,105,108,108, +- 95,99,97,99,104,101,99,1,0,0,0,0,0,0,0,3, +- 0,0,0,3,0,0,0,7,0,0,0,115,25,0,0,0, +- 135,0,0,135,1,0,102,2,0,100,1,0,100,2,0,134, +- 0,0,125,2,0,124,2,0,83,41,3,97,20,1,0,0, +- 65,32,99,108,97,115,115,32,109,101,116,104,111,100,32,119, +- 104,105,99,104,32,114,101,116,117,114,110,115,32,97,32,99, +- 108,111,115,117,114,101,32,116,111,32,117,115,101,32,111,110, +- 32,115,121,115,46,112,97,116,104,95,104,111,111,107,10,32, +- 32,32,32,32,32,32,32,119,104,105,99,104,32,119,105,108, +- 108,32,114,101,116,117,114,110,32,97,110,32,105,110,115,116, +- 97,110,99,101,32,117,115,105,110,103,32,116,104,101,32,115, +- 112,101,99,105,102,105,101,100,32,108,111,97,100,101,114,115, +- 32,97,110,100,32,116,104,101,32,112,97,116,104,10,32,32, +- 32,32,32,32,32,32,99,97,108,108,101,100,32,111,110,32, +- 116,104,101,32,99,108,111,115,117,114,101,46,10,10,32,32, +- 32,32,32,32,32,32,73,102,32,116,104,101,32,112,97,116, +- 104,32,99,97,108,108,101,100,32,111,110,32,116,104,101,32, +- 99,108,111,115,117,114,101,32,105,115,32,110,111,116,32,97, +- 32,100,105,114,101,99,116,111,114,121,44,32,73,109,112,111, +- 114,116,69,114,114,111,114,32,105,115,10,32,32,32,32,32, +- 32,32,32,114,97,105,115,101,100,46,10,10,32,32,32,32, +- 32,32,32,32,99,1,0,0,0,0,0,0,0,1,0,0, +- 0,4,0,0,0,19,0,0,0,115,46,0,0,0,116,0, +- 0,124,0,0,131,1,0,115,33,0,116,1,0,100,1,0, +- 100,2,0,124,0,0,131,1,1,130,1,0,110,0,0,136, +- 0,0,124,0,0,136,1,0,140,1,0,83,41,3,122,45, +- 80,97,116,104,32,104,111,111,107,32,102,111,114,32,105,109, +- 112,111,114,116,108,105,98,46,109,97,99,104,105,110,101,114, +- 121,46,70,105,108,101,70,105,110,100,101,114,46,122,30,111, +- 110,108,121,32,100,105,114,101,99,116,111,114,105,101,115,32, +- 97,114,101,32,115,117,112,112,111,114,116,101,100,114,35,0, +- 0,0,41,2,114,46,0,0,0,114,147,0,0,0,41,1, +- 114,35,0,0,0,41,2,114,242,0,0,0,114,86,1,0, +- 0,114,4,0,0,0,114,5,0,0,0,218,24,112,97,116, +- 104,95,104,111,111,107,95,102,111,114,95,70,105,108,101,70, +- 105,110,100,101,114,228,7,0,0,115,6,0,0,0,0,2, +- 12,1,21,1,122,54,70,105,108,101,70,105,110,100,101,114, +- 46,112,97,116,104,95,104,111,111,107,46,60,108,111,99,97, +- 108,115,62,46,112,97,116,104,95,104,111,111,107,95,102,111, +- 114,95,70,105,108,101,70,105,110,100,101,114,114,4,0,0, +- 0,41,3,114,242,0,0,0,114,86,1,0,0,114,93,1, +- 0,0,114,4,0,0,0,41,2,114,242,0,0,0,114,86, +- 1,0,0,114,5,0,0,0,218,9,112,97,116,104,95,104, +- 111,111,107,218,7,0,0,115,4,0,0,0,0,10,21,6, +- 122,20,70,105,108,101,70,105,110,100,101,114,46,112,97,116, +- 104,95,104,111,111,107,99,1,0,0,0,0,0,0,0,1, +- 0,0,0,2,0,0,0,67,0,0,0,115,16,0,0,0, +- 100,1,0,106,0,0,124,0,0,106,1,0,131,1,0,83, +- 41,2,78,122,16,70,105,108,101,70,105,110,100,101,114,40, +- 123,33,114,125,41,41,2,114,47,0,0,0,114,35,0,0, +- 0,41,1,114,78,0,0,0,114,4,0,0,0,114,4,0, +- 0,0,114,5,0,0,0,114,90,0,0,0,236,7,0,0, +- 115,2,0,0,0,0,1,122,19,70,105,108,101,70,105,110, +- 100,101,114,46,95,95,114,101,112,114,95,95,41,15,114,57, +- 0,0,0,114,56,0,0,0,114,58,0,0,0,114,59,0, +- 0,0,114,79,0,0,0,114,68,1,0,0,114,166,0,0, +- 0,114,9,1,0,0,114,159,0,0,0,114,79,1,0,0, +- 114,8,1,0,0,114,87,1,0,0,114,4,1,0,0,114, +- 94,1,0,0,114,90,0,0,0,114,4,0,0,0,114,4, +- 0,0,0,114,4,0,0,0,114,5,0,0,0,114,80,1, +- 0,0,95,7,0,0,115,20,0,0,0,12,7,6,2,12, +- 14,12,4,6,2,12,8,12,10,15,45,12,31,18,18,114, +- 80,1,0,0,99,0,0,0,0,0,0,0,0,0,0,0, +- 0,2,0,0,0,64,0,0,0,115,46,0,0,0,101,0, +- 0,90,1,0,100,0,0,90,2,0,100,1,0,90,3,0, +- 100,2,0,100,3,0,132,0,0,90,4,0,100,4,0,100, +- 5,0,132,0,0,90,5,0,100,6,0,83,41,7,218,18, +- 95,73,109,112,111,114,116,76,111,99,107,67,111,110,116,101, +- 120,116,122,36,67,111,110,116,101,120,116,32,109,97,110,97, +- 103,101,114,32,102,111,114,32,116,104,101,32,105,109,112,111, +- 114,116,32,108,111,99,107,46,99,1,0,0,0,0,0,0, +- 0,1,0,0,0,1,0,0,0,67,0,0,0,115,14,0, +- 0,0,116,0,0,106,1,0,131,0,0,1,100,1,0,83, +- 41,2,122,24,65,99,113,117,105,114,101,32,116,104,101,32, +- 105,109,112,111,114,116,32,108,111,99,107,46,78,41,2,114, +- 96,0,0,0,114,255,0,0,0,41,1,114,78,0,0,0, +- 114,4,0,0,0,114,4,0,0,0,114,5,0,0,0,114, +- 98,0,0,0,246,7,0,0,115,2,0,0,0,0,2,122, +- 28,95,73,109,112,111,114,116,76,111,99,107,67,111,110,116, +- 101,120,116,46,95,95,101,110,116,101,114,95,95,99,4,0, +- 0,0,0,0,0,0,4,0,0,0,1,0,0,0,67,0, +- 0,0,115,14,0,0,0,116,0,0,106,1,0,131,0,0, +- 1,100,1,0,83,41,2,122,60,82,101,108,101,97,115,101, +- 32,116,104,101,32,105,109,112,111,114,116,32,108,111,99,107, +- 32,114,101,103,97,114,100,108,101,115,115,32,111,102,32,97, +- 110,121,32,114,97,105,115,101,100,32,101,120,99,101,112,116, +- 105,111,110,115,46,78,41,2,114,96,0,0,0,114,97,0, +- 0,0,41,4,114,78,0,0,0,90,8,101,120,99,95,116, +- 121,112,101,90,9,101,120,99,95,118,97,108,117,101,90,13, +- 101,120,99,95,116,114,97,99,101,98,97,99,107,114,4,0, +- 0,0,114,4,0,0,0,114,5,0,0,0,114,101,0,0, +- 0,250,7,0,0,115,2,0,0,0,0,2,122,27,95,73, +- 109,112,111,114,116,76,111,99,107,67,111,110,116,101,120,116, +- 46,95,95,101,120,105,116,95,95,78,41,6,114,57,0,0, +- 0,114,56,0,0,0,114,58,0,0,0,114,59,0,0,0, +- 114,98,0,0,0,114,101,0,0,0,114,4,0,0,0,114, +- 4,0,0,0,114,4,0,0,0,114,5,0,0,0,114,95, +- 1,0,0,242,7,0,0,115,6,0,0,0,12,2,6,2, +- 12,4,114,95,1,0,0,99,3,0,0,0,0,0,0,0, +- 5,0,0,0,4,0,0,0,67,0,0,0,115,91,0,0, +- 0,124,1,0,106,0,0,100,1,0,124,2,0,100,2,0, +- 24,131,2,0,125,3,0,116,1,0,124,3,0,131,1,0, +- 124,2,0,107,0,0,114,55,0,116,2,0,100,3,0,131, +- 1,0,130,1,0,110,0,0,124,3,0,100,4,0,25,125, +- 4,0,124,0,0,114,87,0,100,5,0,106,3,0,124,4, +- 0,124,0,0,131,2,0,83,124,4,0,83,41,6,122,50, +- 82,101,115,111,108,118,101,32,97,32,114,101,108,97,116,105, +- 118,101,32,109,111,100,117,108,101,32,110,97,109,101,32,116, +- 111,32,97,110,32,97,98,115,111,108,117,116,101,32,111,110, +- 101,46,114,110,0,0,0,114,29,0,0,0,122,50,97,116, +- 116,101,109,112,116,101,100,32,114,101,108,97,116,105,118,101, +- 32,105,109,112,111,114,116,32,98,101,121,111,110,100,32,116, +- 111,112,45,108,101,118,101,108,32,112,97,99,107,97,103,101, +- 114,71,0,0,0,122,5,123,125,46,123,125,41,4,114,34, +- 0,0,0,114,31,0,0,0,114,127,0,0,0,114,47,0, +- 0,0,41,5,114,67,0,0,0,218,7,112,97,99,107,97, +- 103,101,218,5,108,101,118,101,108,90,4,98,105,116,115,90, +- 4,98,97,115,101,114,4,0,0,0,114,4,0,0,0,114, +- 5,0,0,0,218,13,95,114,101,115,111,108,118,101,95,110, +- 97,109,101,255,7,0,0,115,10,0,0,0,0,2,22,1, +- 18,1,15,1,10,1,114,98,1,0,0,99,3,0,0,0, +- 0,0,0,0,10,0,0,0,27,0,0,0,67,0,0,0, +- 115,49,1,0,0,116,0,0,106,1,0,115,28,0,116,2, +- 0,106,3,0,100,1,0,116,4,0,131,2,0,1,110,0, +- 0,124,0,0,116,0,0,106,5,0,107,6,0,125,3,0, +- 120,255,0,116,0,0,106,1,0,68,93,240,0,125,4,0, +- 116,6,0,131,0,0,143,108,0,1,121,13,0,124,4,0, +- 106,7,0,125,5,0,87,110,69,0,4,116,8,0,107,10, +- 0,114,153,0,1,1,1,124,4,0,106,9,0,124,0,0, +- 124,1,0,131,2,0,125,6,0,124,6,0,100,2,0,107, +- 8,0,114,134,0,119,53,0,110,0,0,116,10,0,124,0, +- 0,124,6,0,131,2,0,125,7,0,89,110,19,0,88,124, +- 5,0,124,0,0,124,1,0,124,2,0,131,3,0,125,7, +- 0,87,100,2,0,81,88,124,7,0,100,2,0,107,9,0, +- 114,53,0,124,3,0,12,114,30,1,124,0,0,116,0,0, +- 106,5,0,107,6,0,114,30,1,116,0,0,106,5,0,124, +- 0,0,25,125,8,0,121,13,0,124,8,0,106,11,0,125, +- 9,0,87,110,22,0,4,116,8,0,107,10,0,114,6,1, +- 1,1,1,124,7,0,83,89,113,34,1,88,124,9,0,100, +- 2,0,107,8,0,114,23,1,124,7,0,83,124,9,0,83, +- 113,37,1,124,7,0,83,113,53,0,113,53,0,87,100,2, +- 0,83,100,2,0,83,41,3,122,23,70,105,110,100,32,97, +- 32,109,111,100,117,108,101,39,115,32,108,111,97,100,101,114, +- 46,122,22,115,121,115,46,109,101,116,97,95,112,97,116,104, +- 32,105,115,32,101,109,112,116,121,78,41,12,114,7,0,0, +- 0,218,9,109,101,116,97,95,112,97,116,104,114,160,0,0, +- 0,114,161,0,0,0,114,162,0,0,0,114,169,0,0,0, +- 114,95,1,0,0,114,8,1,0,0,114,204,0,0,0,114, +- 9,1,0,0,114,167,0,0,0,114,203,0,0,0,41,10, +- 114,67,0,0,0,114,35,0,0,0,114,7,1,0,0,90, +- 9,105,115,95,114,101,108,111,97,100,114,71,1,0,0,114, +- 8,1,0,0,114,163,0,0,0,114,172,0,0,0,114,174, +- 0,0,0,114,203,0,0,0,114,4,0,0,0,114,4,0, +- 0,0,114,5,0,0,0,114,241,0,0,0,8,8,0,0, +- 115,50,0,0,0,0,2,9,1,19,4,15,1,16,1,10, +- 1,3,1,13,1,13,1,18,1,12,1,6,1,20,2,24, +- 1,12,2,22,1,13,1,3,1,13,1,13,4,9,2,12, +- 1,4,2,7,2,11,2,114,241,0,0,0,99,3,0,0, +- 0,0,0,0,0,4,0,0,0,4,0,0,0,67,0,0, +- 0,115,194,0,0,0,116,0,0,124,0,0,116,1,0,131, +- 2,0,115,45,0,116,2,0,100,1,0,106,3,0,116,4, +- 0,124,0,0,131,1,0,131,1,0,131,1,0,130,1,0, +- 110,0,0,124,2,0,100,2,0,107,0,0,114,72,0,116, +- 5,0,100,3,0,131,1,0,130,1,0,110,0,0,124,1, +- 0,114,156,0,116,0,0,124,1,0,116,1,0,131,2,0, +- 115,108,0,116,2,0,100,4,0,131,1,0,130,1,0,113, +- 156,0,124,1,0,116,6,0,106,7,0,107,7,0,114,156, +- 0,100,5,0,125,3,0,116,8,0,124,3,0,106,3,0, +- 124,1,0,131,1,0,131,1,0,130,1,0,113,156,0,110, +- 0,0,124,0,0,12,114,190,0,124,2,0,100,2,0,107, +- 2,0,114,190,0,116,5,0,100,6,0,131,1,0,130,1, +- 0,110,0,0,100,7,0,83,41,8,122,28,86,101,114,105, +- 102,121,32,97,114,103,117,109,101,110,116,115,32,97,114,101, +- 32,34,115,97,110,101,34,46,122,31,109,111,100,117,108,101, +- 32,110,97,109,101,32,109,117,115,116,32,98,101,32,115,116, +- 114,44,32,110,111,116,32,123,125,114,71,0,0,0,122,18, +- 108,101,118,101,108,32,109,117,115,116,32,98,101,32,62,61, +- 32,48,122,31,95,95,112,97,99,107,97,103,101,95,95,32, +- 110,111,116,32,115,101,116,32,116,111,32,97,32,115,116,114, +- 105,110,103,122,61,80,97,114,101,110,116,32,109,111,100,117, +- 108,101,32,123,33,114,125,32,110,111,116,32,108,111,97,100, +- 101,100,44,32,99,97,110,110,111,116,32,112,101,114,102,111, +- 114,109,32,114,101,108,97,116,105,118,101,32,105,109,112,111, +- 114,116,122,17,69,109,112,116,121,32,109,111,100,117,108,101, +- 32,110,97,109,101,78,41,9,114,187,0,0,0,114,76,1, +- 0,0,218,9,84,121,112,101,69,114,114,111,114,114,47,0, +- 0,0,114,66,0,0,0,114,127,0,0,0,114,7,0,0, +- 0,114,169,0,0,0,218,11,83,121,115,116,101,109,69,114, +- 114,111,114,41,4,114,67,0,0,0,114,96,1,0,0,114, +- 97,1,0,0,114,165,0,0,0,114,4,0,0,0,114,4, +- 0,0,0,114,5,0,0,0,218,13,95,115,97,110,105,116, +- 121,95,99,104,101,99,107,49,8,0,0,115,24,0,0,0, +- 0,2,15,1,30,1,12,1,15,1,6,1,15,1,15,1, +- 15,1,6,2,27,1,19,1,114,102,1,0,0,122,16,78, +- 111,32,109,111,100,117,108,101,32,110,97,109,101,100,32,122, +- 4,123,33,114,125,99,2,0,0,0,0,0,0,0,8,0, +- 0,0,12,0,0,0,67,0,0,0,115,52,1,0,0,100, +- 0,0,125,2,0,124,0,0,106,0,0,100,1,0,131,1, +- 0,100,2,0,25,125,3,0,124,3,0,114,178,0,124,3, +- 0,116,1,0,106,2,0,107,7,0,114,62,0,116,3,0, +- 124,1,0,124,3,0,131,2,0,1,110,0,0,124,0,0, +- 116,1,0,106,2,0,107,6,0,114,88,0,116,1,0,106, +- 2,0,124,0,0,25,83,116,1,0,106,2,0,124,3,0, +- 25,125,4,0,121,13,0,124,4,0,106,4,0,125,2,0, +- 87,113,178,0,4,116,5,0,107,10,0,114,174,0,1,1, +- 1,116,6,0,100,3,0,23,106,7,0,124,0,0,124,3, +- 0,131,2,0,125,5,0,116,8,0,124,5,0,100,4,0, +- 124,0,0,131,1,1,130,1,0,89,113,178,0,88,110,0, +- 0,116,9,0,124,0,0,124,2,0,131,2,0,125,6,0, +- 124,6,0,100,0,0,107,8,0,114,235,0,116,8,0,116, +- 6,0,106,7,0,124,0,0,131,1,0,100,4,0,124,0, +- 0,131,1,1,130,1,0,110,18,0,116,10,0,124,6,0, +- 131,1,0,106,11,0,131,0,0,125,7,0,124,3,0,114, +- 48,1,116,1,0,106,2,0,124,3,0,25,125,4,0,116, +- 12,0,124,4,0,124,0,0,106,0,0,100,1,0,131,1, +- 0,100,5,0,25,124,7,0,131,3,0,1,110,0,0,124, +- 7,0,83,41,6,78,114,110,0,0,0,114,71,0,0,0, +- 122,23,59,32,123,33,114,125,32,105,115,32,110,111,116,32, +- 97,32,112,97,99,107,97,103,101,114,67,0,0,0,114,109, +- 0,0,0,41,13,114,32,0,0,0,114,7,0,0,0,114, +- 169,0,0,0,114,108,0,0,0,114,239,0,0,0,114,204, +- 0,0,0,218,8,95,69,82,82,95,77,83,71,114,47,0, +- 0,0,114,147,0,0,0,114,241,0,0,0,114,168,0,0, +- 0,114,3,1,0,0,114,61,0,0,0,41,8,114,67,0, +- 0,0,218,7,105,109,112,111,114,116,95,114,35,0,0,0, +- 114,228,0,0,0,90,13,112,97,114,101,110,116,95,109,111, +- 100,117,108,101,114,165,0,0,0,114,172,0,0,0,114,174, +- 0,0,0,114,4,0,0,0,114,4,0,0,0,114,5,0, +- 0,0,218,23,95,102,105,110,100,95,97,110,100,95,108,111, +- 97,100,95,117,110,108,111,99,107,101,100,69,8,0,0,115, +- 42,0,0,0,0,1,6,1,19,1,6,1,15,1,16,2, +- 15,1,11,1,13,1,3,1,13,1,13,1,22,1,26,1, +- 15,1,12,1,30,2,18,1,6,2,13,1,32,1,114,105, +- 1,0,0,99,2,0,0,0,0,0,0,0,2,0,0,0, +- 10,0,0,0,67,0,0,0,115,36,0,0,0,116,0,0, +- 124,0,0,131,1,0,143,18,0,1,116,1,0,124,0,0, +- 124,1,0,131,2,0,83,87,100,1,0,81,88,100,1,0, +- 83,41,2,122,54,70,105,110,100,32,97,110,100,32,108,111, +- 97,100,32,116,104,101,32,109,111,100,117,108,101,44,32,97, +- 110,100,32,114,101,108,101,97,115,101,32,116,104,101,32,105, +- 109,112,111,114,116,32,108,111,99,107,46,78,41,2,114,92, +- 0,0,0,114,105,1,0,0,41,2,114,67,0,0,0,114, +- 104,1,0,0,114,4,0,0,0,114,4,0,0,0,114,5, +- 0,0,0,218,14,95,102,105,110,100,95,97,110,100,95,108, +- 111,97,100,96,8,0,0,115,4,0,0,0,0,2,13,1, +- 114,106,1,0,0,99,3,0,0,0,0,0,0,0,5,0, +- 0,0,4,0,0,0,67,0,0,0,115,172,0,0,0,116, +- 0,0,124,0,0,124,1,0,124,2,0,131,3,0,1,124, +- 2,0,100,1,0,107,4,0,114,49,0,116,1,0,124,0, +- 0,124,1,0,124,2,0,131,3,0,125,0,0,110,0,0, +- 116,2,0,106,3,0,131,0,0,1,124,0,0,116,4,0, +- 106,5,0,107,7,0,114,87,0,116,6,0,124,0,0,116, +- 7,0,131,2,0,83,116,4,0,106,5,0,124,0,0,25, +- 125,3,0,124,3,0,100,2,0,107,8,0,114,158,0,116, +- 2,0,106,8,0,131,0,0,1,100,3,0,106,9,0,124, +- 0,0,131,1,0,125,4,0,116,10,0,124,4,0,100,4, +- 0,124,0,0,131,1,1,130,1,0,110,0,0,116,11,0, +- 124,0,0,131,1,0,1,124,3,0,83,41,5,97,50,1, +- 0,0,73,109,112,111,114,116,32,97,110,100,32,114,101,116, +- 117,114,110,32,116,104,101,32,109,111,100,117,108,101,32,98, +- 97,115,101,100,32,111,110,32,105,116,115,32,110,97,109,101, +- 44,32,116,104,101,32,112,97,99,107,97,103,101,32,116,104, +- 101,32,99,97,108,108,32,105,115,10,32,32,32,32,98,101, +- 105,110,103,32,109,97,100,101,32,102,114,111,109,44,32,97, +- 110,100,32,116,104,101,32,108,101,118,101,108,32,97,100,106, +- 117,115,116,109,101,110,116,46,10,10,32,32,32,32,84,104, +- 105,115,32,102,117,110,99,116,105,111,110,32,114,101,112,114, +- 101,115,101,110,116,115,32,116,104,101,32,103,114,101,97,116, +- 101,115,116,32,99,111,109,109,111,110,32,100,101,110,111,109, +- 105,110,97,116,111,114,32,111,102,32,102,117,110,99,116,105, +- 111,110,97,108,105,116,121,10,32,32,32,32,98,101,116,119, +- 101,101,110,32,105,109,112,111,114,116,95,109,111,100,117,108, +- 101,32,97,110,100,32,95,95,105,109,112,111,114,116,95,95, +- 46,32,84,104,105,115,32,105,110,99,108,117,100,101,115,32, +- 115,101,116,116,105,110,103,32,95,95,112,97,99,107,97,103, +- 101,95,95,32,105,102,10,32,32,32,32,116,104,101,32,108, +- 111,97,100,101,114,32,100,105,100,32,110,111,116,46,10,10, +- 32,32,32,32,114,71,0,0,0,78,122,40,105,109,112,111, +- 114,116,32,111,102,32,123,125,32,104,97,108,116,101,100,59, +- 32,78,111,110,101,32,105,110,32,115,121,115,46,109,111,100, +- 117,108,101,115,114,67,0,0,0,41,12,114,102,1,0,0, +- 114,98,1,0,0,114,96,0,0,0,114,255,0,0,0,114, +- 7,0,0,0,114,169,0,0,0,114,106,1,0,0,218,11, +- 95,103,99,100,95,105,109,112,111,114,116,114,97,0,0,0, +- 114,47,0,0,0,114,147,0,0,0,114,106,0,0,0,41, +- 5,114,67,0,0,0,114,96,1,0,0,114,97,1,0,0, +- 114,174,0,0,0,114,145,0,0,0,114,4,0,0,0,114, +- 4,0,0,0,114,5,0,0,0,114,107,1,0,0,102,8, +- 0,0,115,26,0,0,0,0,9,16,1,12,1,21,1,10, +- 1,15,1,13,1,13,1,12,1,10,2,15,1,21,1,10, +- 1,114,107,1,0,0,99,3,0,0,0,0,0,0,0,6, +- 0,0,0,17,0,0,0,67,0,0,0,115,1,1,0,0, +- 116,0,0,124,0,0,100,1,0,131,2,0,114,253,0,100, +- 2,0,124,1,0,107,6,0,114,89,0,116,1,0,124,1, +- 0,131,1,0,125,1,0,124,1,0,106,2,0,100,2,0, +- 131,1,0,1,116,0,0,124,0,0,100,3,0,131,2,0, +- 114,89,0,124,1,0,106,3,0,124,0,0,106,4,0,131, +- 1,0,1,113,89,0,110,0,0,120,161,0,124,1,0,68, +- 93,150,0,125,3,0,116,0,0,124,0,0,124,3,0,131, +- 2,0,115,96,0,100,4,0,106,5,0,124,0,0,106,6, +- 0,124,3,0,131,2,0,125,4,0,121,17,0,116,7,0, +- 124,2,0,124,4,0,131,2,0,1,87,113,246,0,4,116, +- 8,0,107,10,0,114,242,0,1,125,5,0,1,122,53,0, +- 116,9,0,124,5,0,131,1,0,106,10,0,116,11,0,131, +- 1,0,114,221,0,124,5,0,106,12,0,124,4,0,107,2, +- 0,114,221,0,119,96,0,113,221,0,110,0,0,130,0,0, +- 87,89,100,5,0,100,5,0,125,5,0,126,5,0,88,113, +- 246,0,88,113,96,0,113,96,0,87,110,0,0,124,0,0, +- 83,41,6,122,238,70,105,103,117,114,101,32,111,117,116,32, +- 119,104,97,116,32,95,95,105,109,112,111,114,116,95,95,32, +- 115,104,111,117,108,100,32,114,101,116,117,114,110,46,10,10, +- 32,32,32,32,84,104,101,32,105,109,112,111,114,116,95,32, +- 112,97,114,97,109,101,116,101,114,32,105,115,32,97,32,99, +- 97,108,108,97,98,108,101,32,119,104,105,99,104,32,116,97, +- 107,101,115,32,116,104,101,32,110,97,109,101,32,111,102,32, +- 109,111,100,117,108,101,32,116,111,10,32,32,32,32,105,109, +- 112,111,114,116,46,32,73,116,32,105,115,32,114,101,113,117, +- 105,114,101,100,32,116,111,32,100,101,99,111,117,112,108,101, +- 32,116,104,101,32,102,117,110,99,116,105,111,110,32,102,114, +- 111,109,32,97,115,115,117,109,105,110,103,32,105,109,112,111, +- 114,116,108,105,98,39,115,10,32,32,32,32,105,109,112,111, +- 114,116,32,105,109,112,108,101,109,101,110,116,97,116,105,111, +- 110,32,105,115,32,100,101,115,105,114,101,100,46,10,10,32, +- 32,32,32,114,239,0,0,0,250,1,42,218,7,95,95,97, +- 108,108,95,95,122,5,123,125,46,123,125,78,41,13,114,60, +- 0,0,0,114,238,0,0,0,218,6,114,101,109,111,118,101, +- 114,192,0,0,0,114,109,1,0,0,114,47,0,0,0,114, +- 57,0,0,0,114,108,0,0,0,114,147,0,0,0,114,76, +- 1,0,0,114,9,0,0,0,218,15,95,69,82,82,95,77, +- 83,71,95,80,82,69,70,73,88,114,67,0,0,0,41,6, +- 114,174,0,0,0,218,8,102,114,111,109,108,105,115,116,114, +- 104,1,0,0,114,16,0,0,0,90,9,102,114,111,109,95, +- 110,97,109,101,114,34,1,0,0,114,4,0,0,0,114,4, +- 0,0,0,114,5,0,0,0,218,16,95,104,97,110,100,108, +- 101,95,102,114,111,109,108,105,115,116,126,8,0,0,115,34, +- 0,0,0,0,10,15,1,12,1,12,1,13,1,15,1,22, +- 1,13,1,15,1,21,1,3,1,17,1,18,4,21,1,15, +- 1,9,1,32,1,114,113,1,0,0,99,1,0,0,0,0, +- 0,0,0,2,0,0,0,2,0,0,0,67,0,0,0,115, +- 78,0,0,0,124,0,0,106,0,0,100,1,0,131,1,0, +- 125,1,0,124,1,0,100,2,0,107,8,0,114,74,0,124, +- 0,0,100,3,0,25,125,1,0,100,4,0,124,0,0,107, +- 7,0,114,74,0,124,1,0,106,1,0,100,5,0,131,1, +- 0,100,6,0,25,125,1,0,113,74,0,110,0,0,124,1, +- 0,83,41,7,122,167,67,97,108,99,117,108,97,116,101,32, +- 119,104,97,116,32,95,95,112,97,99,107,97,103,101,95,95, +- 32,115,104,111,117,108,100,32,98,101,46,10,10,32,32,32, +- 32,95,95,112,97,99,107,97,103,101,95,95,32,105,115,32, +- 110,111,116,32,103,117,97,114,97,110,116,101,101,100,32,116, +- 111,32,98,101,32,100,101,102,105,110,101,100,32,111,114,32, +- 99,111,117,108,100,32,98,101,32,115,101,116,32,116,111,32, +- 78,111,110,101,10,32,32,32,32,116,111,32,114,101,112,114, +- 101,115,101,110,116,32,116,104,97,116,32,105,116,115,32,112, +- 114,111,112,101,114,32,118,97,108,117,101,32,105,115,32,117, +- 110,107,110,111,119,110,46,10,10,32,32,32,32,114,246,0, +- 0,0,78,114,57,0,0,0,114,239,0,0,0,114,110,0, +- 0,0,114,71,0,0,0,41,2,114,82,0,0,0,114,32, +- 0,0,0,41,2,218,7,103,108,111,98,97,108,115,114,96, +- 1,0,0,114,4,0,0,0,114,4,0,0,0,114,5,0, +- 0,0,218,17,95,99,97,108,99,95,95,95,112,97,99,107, +- 97,103,101,95,95,158,8,0,0,115,12,0,0,0,0,7, +- 15,1,12,1,10,1,12,1,25,1,114,115,1,0,0,99, +- 0,0,0,0,0,0,0,0,3,0,0,0,3,0,0,0, +- 67,0,0,0,115,55,0,0,0,116,0,0,116,1,0,106, +- 2,0,131,0,0,102,2,0,125,0,0,116,3,0,116,4, +- 0,102,2,0,125,1,0,116,5,0,116,6,0,102,2,0, +- 125,2,0,124,0,0,124,1,0,124,2,0,103,3,0,83, +- 41,1,122,95,82,101,116,117,114,110,115,32,97,32,108,105, +- 115,116,32,111,102,32,102,105,108,101,45,98,97,115,101,100, +- 32,109,111,100,117,108,101,32,108,111,97,100,101,114,115,46, +- 10,10,32,32,32,32,69,97,99,104,32,105,116,101,109,32, +- 105,115,32,97,32,116,117,112,108,101,32,40,108,111,97,100, +- 101,114,44,32,115,117,102,102,105,120,101,115,41,46,10,32, +- 32,32,32,41,7,114,50,1,0,0,114,96,0,0,0,218, +- 18,101,120,116,101,110,115,105,111,110,95,115,117,102,102,105, +- 120,101,115,114,45,1,0,0,114,128,0,0,0,114,49,1, +- 0,0,114,227,0,0,0,41,3,90,10,101,120,116,101,110, +- 115,105,111,110,115,90,6,115,111,117,114,99,101,90,8,98, +- 121,116,101,99,111,100,101,114,4,0,0,0,114,4,0,0, +- 0,114,5,0,0,0,114,233,0,0,0,173,8,0,0,115, +- 8,0,0,0,0,5,18,1,12,1,12,1,114,233,0,0, +- 0,99,5,0,0,0,0,0,0,0,9,0,0,0,5,0, +- 0,0,67,0,0,0,115,227,0,0,0,124,4,0,100,1, +- 0,107,2,0,114,27,0,116,0,0,124,0,0,131,1,0, +- 125,5,0,110,54,0,124,1,0,100,2,0,107,9,0,114, +- 45,0,124,1,0,110,3,0,105,0,0,125,6,0,116,1, +- 0,124,6,0,131,1,0,125,7,0,116,0,0,124,0,0, +- 124,7,0,124,4,0,131,3,0,125,5,0,124,3,0,115, +- 207,0,124,4,0,100,1,0,107,2,0,114,122,0,116,0, +- 0,124,0,0,106,2,0,100,3,0,131,1,0,100,1,0, +- 25,131,1,0,83,124,0,0,115,132,0,124,5,0,83,116, +- 3,0,124,0,0,131,1,0,116,3,0,124,0,0,106,2, +- 0,100,3,0,131,1,0,100,1,0,25,131,1,0,24,125, +- 8,0,116,4,0,106,5,0,124,5,0,106,6,0,100,2, +- 0,116,3,0,124,5,0,106,6,0,131,1,0,124,8,0, +- 24,133,2,0,25,25,83,110,16,0,116,7,0,124,5,0, +- 124,3,0,116,0,0,131,3,0,83,100,2,0,83,41,4, +- 97,214,1,0,0,73,109,112,111,114,116,32,97,32,109,111, +- 100,117,108,101,46,10,10,32,32,32,32,84,104,101,32,39, +- 103,108,111,98,97,108,115,39,32,97,114,103,117,109,101,110, +- 116,32,105,115,32,117,115,101,100,32,116,111,32,105,110,102, +- 101,114,32,119,104,101,114,101,32,116,104,101,32,105,109,112, +- 111,114,116,32,105,115,32,111,99,99,117,114,105,110,103,32, +- 102,114,111,109,10,32,32,32,32,116,111,32,104,97,110,100, +- 108,101,32,114,101,108,97,116,105,118,101,32,105,109,112,111, +- 114,116,115,46,32,84,104,101,32,39,108,111,99,97,108,115, +- 39,32,97,114,103,117,109,101,110,116,32,105,115,32,105,103, +- 110,111,114,101,100,46,32,84,104,101,10,32,32,32,32,39, +- 102,114,111,109,108,105,115,116,39,32,97,114,103,117,109,101, +- 110,116,32,115,112,101,99,105,102,105,101,115,32,119,104,97, +- 116,32,115,104,111,117,108,100,32,101,120,105,115,116,32,97, +- 115,32,97,116,116,114,105,98,117,116,101,115,32,111,110,32, +- 116,104,101,32,109,111,100,117,108,101,10,32,32,32,32,98, +- 101,105,110,103,32,105,109,112,111,114,116,101,100,32,40,101, +- 46,103,46,32,96,96,102,114,111,109,32,109,111,100,117,108, +- 101,32,105,109,112,111,114,116,32,60,102,114,111,109,108,105, +- 115,116,62,96,96,41,46,32,32,84,104,101,32,39,108,101, +- 118,101,108,39,10,32,32,32,32,97,114,103,117,109,101,110, +- 116,32,114,101,112,114,101,115,101,110,116,115,32,116,104,101, +- 32,112,97,99,107,97,103,101,32,108,111,99,97,116,105,111, +- 110,32,116,111,32,105,109,112,111,114,116,32,102,114,111,109, +- 32,105,110,32,97,32,114,101,108,97,116,105,118,101,10,32, +- 32,32,32,105,109,112,111,114,116,32,40,101,46,103,46,32, +- 96,96,102,114,111,109,32,46,46,112,107,103,32,105,109,112, +- 111,114,116,32,109,111,100,96,96,32,119,111,117,108,100,32, +- 104,97,118,101,32,97,32,39,108,101,118,101,108,39,32,111, +- 102,32,50,41,46,10,10,32,32,32,32,114,71,0,0,0, +- 78,114,110,0,0,0,41,8,114,107,1,0,0,114,115,1, +- 0,0,114,115,0,0,0,114,31,0,0,0,114,7,0,0, +- 0,114,169,0,0,0,114,57,0,0,0,114,113,1,0,0, +- 41,9,114,67,0,0,0,114,114,1,0,0,218,6,108,111, +- 99,97,108,115,114,112,1,0,0,114,97,1,0,0,114,174, +- 0,0,0,90,8,103,108,111,98,97,108,115,95,114,96,1, +- 0,0,90,7,99,117,116,95,111,102,102,114,4,0,0,0, +- 114,4,0,0,0,114,5,0,0,0,218,10,95,95,105,109, +- 112,111,114,116,95,95,184,8,0,0,115,26,0,0,0,0, +- 11,12,1,15,2,24,1,12,1,18,1,6,3,12,1,23, +- 1,6,1,4,4,35,3,40,2,114,118,1,0,0,99,1, +- 0,0,0,0,0,0,0,3,0,0,0,3,0,0,0,67, +- 0,0,0,115,68,0,0,0,116,0,0,106,1,0,124,0, +- 0,131,1,0,125,1,0,124,1,0,100,0,0,107,8,0, +- 114,46,0,116,2,0,100,1,0,124,0,0,23,131,1,0, +- 130,1,0,110,0,0,116,3,0,124,1,0,131,1,0,125, +- 2,0,124,2,0,106,4,0,131,0,0,83,41,2,78,122, +- 25,110,111,32,98,117,105,108,116,45,105,110,32,109,111,100, +- 117,108,101,32,110,97,109,101,100,32,41,5,114,5,1,0, +- 0,114,8,1,0,0,114,147,0,0,0,114,168,0,0,0, +- 114,3,1,0,0,41,3,114,67,0,0,0,114,172,0,0, +- 0,114,173,0,0,0,114,4,0,0,0,114,4,0,0,0, +- 114,5,0,0,0,218,18,95,98,117,105,108,116,105,110,95, +- 102,114,111,109,95,110,97,109,101,219,8,0,0,115,10,0, +- 0,0,0,1,15,1,12,1,19,1,12,1,114,119,1,0, +- 0,99,2,0,0,0,0,0,0,0,19,0,0,0,12,0, +- 0,0,67,0,0,0,115,232,2,0,0,124,1,0,97,0, +- 0,124,0,0,97,1,0,116,1,0,106,2,0,106,3,0, +- 114,33,0,116,4,0,97,5,0,110,6,0,116,6,0,97, +- 5,0,116,7,0,116,1,0,131,1,0,125,2,0,120,138, +- 0,116,1,0,106,8,0,106,9,0,131,0,0,68,93,121, +- 0,92,2,0,125,3,0,125,4,0,116,10,0,124,4,0, +- 124,2,0,131,2,0,114,67,0,124,3,0,116,1,0,106, +- 11,0,107,6,0,114,118,0,116,12,0,125,5,0,110,27, +- 0,116,0,0,106,13,0,124,3,0,131,1,0,114,67,0, +- 116,14,0,125,5,0,110,3,0,113,67,0,116,15,0,124, +- 4,0,124,5,0,131,2,0,125,6,0,116,16,0,124,6, +- 0,131,1,0,125,7,0,124,7,0,106,17,0,124,4,0, +- 131,1,0,1,113,67,0,113,67,0,87,116,1,0,106,8, +- 0,116,18,0,25,125,8,0,120,73,0,100,26,0,68,93, +- 65,0,125,9,0,124,9,0,116,1,0,106,8,0,107,7, +- 0,114,248,0,116,19,0,124,9,0,131,1,0,125,10,0, +- 110,13,0,116,1,0,106,8,0,124,9,0,25,125,10,0, +- 116,20,0,124,8,0,124,9,0,124,10,0,131,3,0,1, +- 113,212,0,87,100,5,0,100,6,0,103,1,0,102,2,0, +- 100,7,0,100,8,0,100,6,0,103,2,0,102,2,0,102, +- 2,0,125,11,0,120,146,0,124,11,0,68,93,126,0,92, +- 2,0,125,12,0,125,13,0,116,21,0,100,9,0,100,10, +- 0,132,0,0,124,13,0,68,131,1,0,131,1,0,115,108, +- 1,116,22,0,130,1,0,124,13,0,100,11,0,25,125,14, +- 0,124,12,0,116,1,0,106,8,0,107,6,0,114,150,1, +- 116,1,0,106,8,0,124,12,0,25,125,15,0,80,113,65, +- 1,121,17,0,116,19,0,124,12,0,131,1,0,125,15,0, +- 80,87,113,65,1,4,116,23,0,107,10,0,114,190,1,1, +- 1,1,119,65,1,89,113,65,1,88,113,65,1,87,116,23, +- 0,100,12,0,131,1,0,130,1,0,116,20,0,124,8,0, +- 100,13,0,124,15,0,131,3,0,1,116,20,0,124,8,0, +- 100,14,0,124,14,0,131,3,0,1,116,20,0,124,8,0, +- 100,15,0,100,16,0,106,24,0,124,13,0,131,1,0,131, +- 3,0,1,121,16,0,116,19,0,100,17,0,131,1,0,125, +- 16,0,87,110,24,0,4,116,23,0,107,10,0,114,50,2, +- 1,1,1,100,18,0,125,16,0,89,110,1,0,88,116,20, +- 0,124,8,0,100,17,0,124,16,0,131,3,0,1,116,19, +- 0,100,19,0,131,1,0,125,17,0,116,20,0,124,8,0, +- 100,19,0,124,17,0,131,3,0,1,124,12,0,100,7,0, +- 107,2,0,114,138,2,116,19,0,100,20,0,131,1,0,125, +- 18,0,116,20,0,124,8,0,100,21,0,124,18,0,131,3, +- 0,1,110,0,0,116,20,0,124,8,0,100,22,0,116,25, +- 0,131,0,0,131,3,0,1,116,26,0,106,27,0,116,0, +- 0,106,28,0,131,0,0,131,1,0,1,124,12,0,100,7, +- 0,107,2,0,114,228,2,116,29,0,106,30,0,100,23,0, +- 131,1,0,1,100,24,0,116,26,0,107,6,0,114,228,2, +- 100,25,0,116,31,0,95,32,0,113,228,2,110,0,0,100, +- 18,0,83,41,27,122,250,83,101,116,117,112,32,105,109,112, +- 111,114,116,108,105,98,32,98,121,32,105,109,112,111,114,116, +- 105,110,103,32,110,101,101,100,101,100,32,98,117,105,108,116, +- 45,105,110,32,109,111,100,117,108,101,115,32,97,110,100,32, +- 105,110,106,101,99,116,105,110,103,32,116,104,101,109,10,32, +- 32,32,32,105,110,116,111,32,116,104,101,32,103,108,111,98, +- 97,108,32,110,97,109,101,115,112,97,99,101,46,10,10,32, +- 32,32,32,65,115,32,115,121,115,32,105,115,32,110,101,101, +- 100,101,100,32,102,111,114,32,115,121,115,46,109,111,100,117, +- 108,101,115,32,97,99,99,101,115,115,32,97,110,100,32,95, +- 105,109,112,32,105,115,32,110,101,101,100,101,100,32,116,111, +- 32,108,111,97,100,32,98,117,105,108,116,45,105,110,10,32, +- 32,32,32,109,111,100,117,108,101,115,44,32,116,104,111,115, +- 101,32,116,119,111,32,109,111,100,117,108,101,115,32,109,117, +- 115,116,32,98,101,32,101,120,112,108,105,99,105,116,108,121, +- 32,112,97,115,115,101,100,32,105,110,46,10,10,32,32,32, +- 32,114,49,0,0,0,114,160,0,0,0,218,8,98,117,105, +- 108,116,105,110,115,114,186,0,0,0,90,5,112,111,115,105, +- 120,250,1,47,218,2,110,116,250,1,92,99,1,0,0,0, +- 0,0,0,0,2,0,0,0,3,0,0,0,115,0,0,0, +- 115,33,0,0,0,124,0,0,93,23,0,125,1,0,116,0, +- 0,124,1,0,131,1,0,100,0,0,107,2,0,86,1,113, +- 3,0,100,1,0,83,41,2,114,29,0,0,0,78,41,1, +- 114,31,0,0,0,41,2,114,22,0,0,0,114,124,0,0, +- 0,114,4,0,0,0,114,4,0,0,0,114,5,0,0,0, +- 114,211,0,0,0,15,9,0,0,115,2,0,0,0,6,0, +- 122,25,95,115,101,116,117,112,46,60,108,111,99,97,108,115, +- 62,46,60,103,101,110,101,120,112,114,62,114,71,0,0,0, +- 122,30,105,109,112,111,114,116,108,105,98,32,114,101,113,117, +- 105,114,101,115,32,112,111,115,105,120,32,111,114,32,110,116, +- 114,3,0,0,0,114,25,0,0,0,114,21,0,0,0,114, +- 30,0,0,0,114,72,0,0,0,78,114,105,0,0,0,90, +- 6,119,105,110,114,101,103,114,17,1,0,0,114,6,0,0, +- 0,122,4,46,112,121,119,122,6,95,100,46,112,121,100,84, +- 41,4,122,3,95,105,111,122,9,95,119,97,114,110,105,110, +- 103,115,122,8,98,117,105,108,116,105,110,115,122,7,109,97, +- 114,115,104,97,108,41,33,114,96,0,0,0,114,7,0,0, +- 0,114,111,0,0,0,114,112,0,0,0,114,114,0,0,0, +- 114,227,0,0,0,114,113,0,0,0,114,66,0,0,0,114, +- 169,0,0,0,218,5,105,116,101,109,115,114,187,0,0,0, +- 114,151,0,0,0,114,5,1,0,0,114,156,0,0,0,114, +- 13,1,0,0,114,240,0,0,0,114,168,0,0,0,114,250, +- 0,0,0,114,57,0,0,0,114,119,1,0,0,114,61,0, +- 0,0,218,3,97,108,108,114,89,0,0,0,114,147,0,0, +- 0,114,26,0,0,0,114,11,0,0,0,114,53,1,0,0, +- 114,192,0,0,0,114,116,1,0,0,114,128,0,0,0,114, +- 220,0,0,0,114,16,1,0,0,114,20,1,0,0,41,19, +- 218,10,115,121,115,95,109,111,100,117,108,101,218,11,95,105, +- 109,112,95,109,111,100,117,108,101,90,11,109,111,100,117,108, +- 101,95,116,121,112,101,114,67,0,0,0,114,174,0,0,0, +- 114,163,0,0,0,114,172,0,0,0,114,173,0,0,0,90, +- 11,115,101,108,102,95,109,111,100,117,108,101,90,12,98,117, +- 105,108,116,105,110,95,110,97,109,101,90,14,98,117,105,108, +- 116,105,110,95,109,111,100,117,108,101,90,10,111,115,95,100, +- 101,116,97,105,108,115,90,10,98,117,105,108,116,105,110,95, +- 111,115,114,21,0,0,0,114,25,0,0,0,90,9,111,115, +- 95,109,111,100,117,108,101,90,13,116,104,114,101,97,100,95, +- 109,111,100,117,108,101,90,14,119,101,97,107,114,101,102,95, +- 109,111,100,117,108,101,90,13,119,105,110,114,101,103,95,109, +- 111,100,117,108,101,114,4,0,0,0,114,4,0,0,0,114, +- 5,0,0,0,218,6,95,115,101,116,117,112,227,8,0,0, +- 115,108,0,0,0,0,9,6,1,6,2,12,1,9,2,6, +- 3,12,1,28,1,15,1,15,1,9,1,15,1,9,2,3, +- 1,15,1,12,1,20,3,13,1,13,1,15,1,15,2,13, +- 1,20,3,33,1,19,2,31,1,10,1,15,1,13,1,4, +- 2,3,1,12,1,5,1,13,1,12,2,12,1,16,1,16, +- 1,25,3,3,1,16,1,13,2,11,1,16,3,12,1,16, +- 3,12,1,12,1,19,3,19,1,19,1,12,1,13,1,12, +- 1,114,128,1,0,0,99,2,0,0,0,0,0,0,0,3, +- 0,0,0,3,0,0,0,67,0,0,0,115,136,0,0,0, +- 116,0,0,124,0,0,124,1,0,131,2,0,1,116,1,0, +- 131,0,0,125,2,0,116,2,0,106,3,0,106,4,0,116, +- 5,0,106,6,0,124,2,0,140,0,0,103,1,0,131,1, +- 0,1,116,2,0,106,7,0,106,8,0,116,9,0,131,1, +- 0,1,116,2,0,106,7,0,106,8,0,116,10,0,131,1, +- 0,1,116,11,0,106,12,0,100,1,0,107,2,0,114,116, +- 0,116,2,0,106,7,0,106,8,0,116,13,0,131,1,0, +- 1,110,0,0,116,2,0,106,7,0,106,8,0,116,14,0, +- 131,1,0,1,100,2,0,83,41,3,122,50,73,110,115,116, +- 97,108,108,32,105,109,112,111,114,116,108,105,98,32,97,115, +- 32,116,104,101,32,105,109,112,108,101,109,101,110,116,97,116, +- 105,111,110,32,111,102,32,105,109,112,111,114,116,46,114,122, +- 1,0,0,78,41,15,114,128,1,0,0,114,233,0,0,0, +- 114,7,0,0,0,114,72,1,0,0,114,192,0,0,0,114, +- 80,1,0,0,114,94,1,0,0,114,99,1,0,0,114,220, +- 0,0,0,114,5,1,0,0,114,13,1,0,0,114,3,0, +- 0,0,114,57,0,0,0,114,16,1,0,0,114,67,1,0, +- 0,41,3,114,126,1,0,0,114,127,1,0,0,90,17,115, +- 117,112,112,111,114,116,101,100,95,108,111,97,100,101,114,115, +- 114,4,0,0,0,114,4,0,0,0,114,5,0,0,0,218, +- 8,95,105,110,115,116,97,108,108,58,9,0,0,115,16,0, +- 0,0,0,2,13,1,9,1,28,1,16,1,16,1,15,1, +- 19,1,114,129,1,0,0,41,3,122,3,119,105,110,114,1, +- 0,0,0,114,2,0,0,0,41,89,114,59,0,0,0,114, +- 10,0,0,0,114,11,0,0,0,114,17,0,0,0,114,19, +- 0,0,0,114,28,0,0,0,114,38,0,0,0,114,39,0, +- 0,0,114,43,0,0,0,114,44,0,0,0,114,46,0,0, +- 0,114,55,0,0,0,114,65,0,0,0,114,68,0,0,0, +- 114,66,0,0,0,218,8,95,95,99,111,100,101,95,95,114, +- 188,0,0,0,114,102,0,0,0,114,81,0,0,0,114,88, +- 0,0,0,114,69,0,0,0,114,70,0,0,0,114,91,0, +- 0,0,114,92,0,0,0,114,95,0,0,0,114,106,0,0, +- 0,114,108,0,0,0,114,15,0,0,0,114,180,0,0,0, +- 114,14,0,0,0,114,18,0,0,0,90,17,95,82,65,87, +- 95,77,65,71,73,67,95,78,85,77,66,69,82,114,119,0, +- 0,0,114,128,0,0,0,114,113,0,0,0,114,114,0,0, +- 0,114,126,0,0,0,114,129,0,0,0,114,136,0,0,0, +- 114,138,0,0,0,114,146,0,0,0,114,150,0,0,0,114, +- 155,0,0,0,114,158,0,0,0,114,166,0,0,0,114,175, +- 0,0,0,114,185,0,0,0,114,190,0,0,0,114,193,0, +- 0,0,114,198,0,0,0,114,206,0,0,0,114,207,0,0, +- 0,114,213,0,0,0,114,167,0,0,0,218,6,111,98,106, +- 101,99,116,114,234,0,0,0,114,232,0,0,0,114,240,0, +- 0,0,114,168,0,0,0,114,5,1,0,0,114,13,1,0, +- 0,114,16,1,0,0,114,26,1,0,0,114,27,1,0,0, +- 114,42,1,0,0,114,45,1,0,0,114,49,1,0,0,114, +- 53,1,0,0,114,50,1,0,0,114,54,1,0,0,114,247, +- 0,0,0,114,67,1,0,0,114,80,1,0,0,114,95,1, +- 0,0,114,98,1,0,0,114,241,0,0,0,114,102,1,0, +- 0,114,111,1,0,0,114,103,1,0,0,114,105,1,0,0, +- 114,106,1,0,0,114,107,1,0,0,114,113,1,0,0,114, +- 115,1,0,0,114,233,0,0,0,114,118,1,0,0,114,119, +- 1,0,0,114,128,1,0,0,114,129,1,0,0,114,4,0, +- 0,0,114,4,0,0,0,114,4,0,0,0,114,5,0,0, +- 0,218,8,60,109,111,100,117,108,101,62,8,0,0,0,115, +- 164,0,0,0,6,17,6,3,12,12,12,5,12,5,12,6, +- 12,12,12,10,12,9,12,5,12,7,15,22,12,8,12,4, +- 15,6,6,2,6,3,22,4,19,68,19,21,19,19,12,19, +- 12,20,12,113,22,1,18,2,6,2,9,2,9,1,9,2, +- 15,27,12,23,12,19,12,12,18,8,12,18,12,11,12,11, +- 12,13,12,13,21,55,21,12,18,10,12,14,12,34,19,27, +- 19,102,24,22,9,3,12,1,15,63,18,45,19,251,19,71, +- 19,59,19,60,19,25,22,110,19,31,25,43,25,16,6,3, +- 19,49,19,57,19,27,19,124,19,147,19,13,12,9,15,41, +- 12,17,6,1,10,2,12,27,12,6,18,24,12,32,12,15, +- 12,11,24,35,12,8,12,87, ++ 0,0,218,18,95,98,117,105,108,116,105,110,95,102,114,111, ++ 109,95,110,97,109,101,227,8,0,0,115,10,0,0,0,0, ++ 1,15,1,12,1,19,1,12,1,114,124,1,0,0,99,2, ++ 0,0,0,0,0,0,0,19,0,0,0,12,0,0,0,67, ++ 0,0,0,115,232,2,0,0,124,1,0,97,0,0,124,0, ++ 0,97,1,0,116,1,0,106,2,0,106,3,0,114,33,0, ++ 116,4,0,97,5,0,110,6,0,116,6,0,97,5,0,116, ++ 7,0,116,1,0,131,1,0,125,2,0,120,138,0,116,1, ++ 0,106,8,0,106,9,0,131,0,0,68,93,121,0,92,2, ++ 0,125,3,0,125,4,0,116,10,0,124,4,0,124,2,0, ++ 131,2,0,114,67,0,124,3,0,116,1,0,106,11,0,107, ++ 6,0,114,118,0,116,12,0,125,5,0,110,27,0,116,0, ++ 0,106,13,0,124,3,0,131,1,0,114,67,0,116,14,0, ++ 125,5,0,110,3,0,113,67,0,116,15,0,124,4,0,124, ++ 5,0,131,2,0,125,6,0,116,16,0,124,6,0,131,1, ++ 0,125,7,0,124,7,0,106,17,0,124,4,0,131,1,0, ++ 1,113,67,0,113,67,0,87,116,1,0,106,8,0,116,18, ++ 0,25,125,8,0,120,73,0,100,26,0,68,93,65,0,125, ++ 9,0,124,9,0,116,1,0,106,8,0,107,7,0,114,248, ++ 0,116,19,0,124,9,0,131,1,0,125,10,0,110,13,0, ++ 116,1,0,106,8,0,124,9,0,25,125,10,0,116,20,0, ++ 124,8,0,124,9,0,124,10,0,131,3,0,1,113,212,0, ++ 87,100,5,0,100,6,0,103,1,0,102,2,0,100,7,0, ++ 100,8,0,100,6,0,103,2,0,102,2,0,102,2,0,125, ++ 11,0,120,146,0,124,11,0,68,93,126,0,92,2,0,125, ++ 12,0,125,13,0,116,21,0,100,9,0,100,10,0,132,0, ++ 0,124,13,0,68,131,1,0,131,1,0,115,108,1,116,22, ++ 0,130,1,0,124,13,0,100,11,0,25,125,14,0,124,12, ++ 0,116,1,0,106,8,0,107,6,0,114,150,1,116,1,0, ++ 106,8,0,124,12,0,25,125,15,0,80,113,65,1,121,17, ++ 0,116,19,0,124,12,0,131,1,0,125,15,0,80,87,113, ++ 65,1,4,116,23,0,107,10,0,114,190,1,1,1,1,119, ++ 65,1,89,113,65,1,88,113,65,1,87,116,23,0,100,12, ++ 0,131,1,0,130,1,0,116,20,0,124,8,0,100,13,0, ++ 124,15,0,131,3,0,1,116,20,0,124,8,0,100,14,0, ++ 124,14,0,131,3,0,1,116,20,0,124,8,0,100,15,0, ++ 100,16,0,106,24,0,124,13,0,131,1,0,131,3,0,1, ++ 121,16,0,116,19,0,100,17,0,131,1,0,125,16,0,87, ++ 110,24,0,4,116,23,0,107,10,0,114,50,2,1,1,1, ++ 100,18,0,125,16,0,89,110,1,0,88,116,20,0,124,8, ++ 0,100,17,0,124,16,0,131,3,0,1,116,19,0,100,19, ++ 0,131,1,0,125,17,0,116,20,0,124,8,0,100,19,0, ++ 124,17,0,131,3,0,1,124,12,0,100,7,0,107,2,0, ++ 114,138,2,116,19,0,100,20,0,131,1,0,125,18,0,116, ++ 20,0,124,8,0,100,21,0,124,18,0,131,3,0,1,110, ++ 0,0,116,20,0,124,8,0,100,22,0,116,25,0,131,0, ++ 0,131,3,0,1,116,26,0,106,27,0,116,0,0,106,28, ++ 0,131,0,0,131,1,0,1,124,12,0,100,7,0,107,2, ++ 0,114,228,2,116,29,0,106,30,0,100,23,0,131,1,0, ++ 1,100,24,0,116,26,0,107,6,0,114,228,2,100,25,0, ++ 116,31,0,95,32,0,113,228,2,110,0,0,100,18,0,83, ++ 41,27,122,250,83,101,116,117,112,32,105,109,112,111,114,116, ++ 108,105,98,32,98,121,32,105,109,112,111,114,116,105,110,103, ++ 32,110,101,101,100,101,100,32,98,117,105,108,116,45,105,110, ++ 32,109,111,100,117,108,101,115,32,97,110,100,32,105,110,106, ++ 101,99,116,105,110,103,32,116,104,101,109,10,32,32,32,32, ++ 105,110,116,111,32,116,104,101,32,103,108,111,98,97,108,32, ++ 110,97,109,101,115,112,97,99,101,46,10,10,32,32,32,32, ++ 65,115,32,115,121,115,32,105,115,32,110,101,101,100,101,100, ++ 32,102,111,114,32,115,121,115,46,109,111,100,117,108,101,115, ++ 32,97,99,99,101,115,115,32,97,110,100,32,95,105,109,112, ++ 32,105,115,32,110,101,101,100,101,100,32,116,111,32,108,111, ++ 97,100,32,98,117,105,108,116,45,105,110,10,32,32,32,32, ++ 109,111,100,117,108,101,115,44,32,116,104,111,115,101,32,116, ++ 119,111,32,109,111,100,117,108,101,115,32,109,117,115,116,32, ++ 98,101,32,101,120,112,108,105,99,105,116,108,121,32,112,97, ++ 115,115,101,100,32,105,110,46,10,10,32,32,32,32,114,49, ++ 0,0,0,114,166,0,0,0,218,8,98,117,105,108,116,105, ++ 110,115,114,191,0,0,0,90,5,112,111,115,105,120,250,1, ++ 47,218,2,110,116,250,1,92,99,1,0,0,0,0,0,0, ++ 0,2,0,0,0,3,0,0,0,115,0,0,0,115,33,0, ++ 0,0,124,0,0,93,23,0,125,1,0,116,0,0,124,1, ++ 0,131,1,0,100,0,0,107,2,0,86,1,113,3,0,100, ++ 1,0,83,41,2,114,29,0,0,0,78,41,1,114,31,0, ++ 0,0,41,2,114,22,0,0,0,114,130,0,0,0,114,4, ++ 0,0,0,114,4,0,0,0,114,5,0,0,0,114,77,0, ++ 0,0,23,9,0,0,115,2,0,0,0,6,0,122,25,95, ++ 115,101,116,117,112,46,60,108,111,99,97,108,115,62,46,60, ++ 103,101,110,101,120,112,114,62,114,84,0,0,0,122,30,105, ++ 109,112,111,114,116,108,105,98,32,114,101,113,117,105,114,101, ++ 115,32,112,111,115,105,120,32,111,114,32,110,116,114,3,0, ++ 0,0,114,25,0,0,0,114,21,0,0,0,114,30,0,0, ++ 0,114,85,0,0,0,78,114,111,0,0,0,90,6,119,105, ++ 110,114,101,103,114,22,1,0,0,114,6,0,0,0,122,4, ++ 46,112,121,119,122,6,95,100,46,112,121,100,84,41,4,122, ++ 3,95,105,111,122,9,95,119,97,114,110,105,110,103,115,122, ++ 8,98,117,105,108,116,105,110,115,122,7,109,97,114,115,104, ++ 97,108,41,33,114,106,0,0,0,114,7,0,0,0,114,117, ++ 0,0,0,114,118,0,0,0,114,120,0,0,0,114,231,0, ++ 0,0,114,119,0,0,0,114,66,0,0,0,114,73,0,0, ++ 0,218,5,105,116,101,109,115,114,192,0,0,0,114,157,0, ++ 0,0,114,11,1,0,0,114,162,0,0,0,114,18,1,0, ++ 0,114,246,0,0,0,114,174,0,0,0,114,0,1,0,0, ++ 114,57,0,0,0,114,124,1,0,0,114,61,0,0,0,218, ++ 3,97,108,108,114,100,0,0,0,114,153,0,0,0,114,26, ++ 0,0,0,114,11,0,0,0,114,58,1,0,0,114,197,0, ++ 0,0,114,121,1,0,0,114,134,0,0,0,114,223,0,0, ++ 0,114,21,1,0,0,114,25,1,0,0,41,19,218,10,115, ++ 121,115,95,109,111,100,117,108,101,218,11,95,105,109,112,95, ++ 109,111,100,117,108,101,90,11,109,111,100,117,108,101,95,116, ++ 121,112,101,114,67,0,0,0,114,179,0,0,0,114,169,0, ++ 0,0,114,177,0,0,0,114,178,0,0,0,90,11,115,101, ++ 108,102,95,109,111,100,117,108,101,90,12,98,117,105,108,116, ++ 105,110,95,110,97,109,101,90,14,98,117,105,108,116,105,110, ++ 95,109,111,100,117,108,101,90,10,111,115,95,100,101,116,97, ++ 105,108,115,90,10,98,117,105,108,116,105,110,95,111,115,114, ++ 21,0,0,0,114,25,0,0,0,90,9,111,115,95,109,111, ++ 100,117,108,101,90,13,116,104,114,101,97,100,95,109,111,100, ++ 117,108,101,90,14,119,101,97,107,114,101,102,95,109,111,100, ++ 117,108,101,90,13,119,105,110,114,101,103,95,109,111,100,117, ++ 108,101,114,4,0,0,0,114,4,0,0,0,114,5,0,0, ++ 0,218,6,95,115,101,116,117,112,235,8,0,0,115,108,0, ++ 0,0,0,9,6,1,6,2,12,1,9,2,6,3,12,1, ++ 28,1,15,1,15,1,9,1,15,1,9,2,3,1,15,1, ++ 12,1,20,3,13,1,13,1,15,1,15,2,13,1,20,3, ++ 33,1,19,2,31,1,10,1,15,1,13,1,4,2,3,1, ++ 12,1,5,1,13,1,12,2,12,1,16,1,16,1,25,3, ++ 3,1,16,1,13,2,11,1,16,3,12,1,16,3,12,1, ++ 12,1,19,3,19,1,19,1,12,1,13,1,12,1,114,133, ++ 1,0,0,99,2,0,0,0,0,0,0,0,3,0,0,0, ++ 3,0,0,0,67,0,0,0,115,136,0,0,0,116,0,0, ++ 124,0,0,124,1,0,131,2,0,1,116,1,0,131,0,0, ++ 125,2,0,116,2,0,106,3,0,106,4,0,116,5,0,106, ++ 6,0,124,2,0,140,0,0,103,1,0,131,1,0,1,116, ++ 2,0,106,7,0,106,8,0,116,9,0,131,1,0,1,116, ++ 2,0,106,7,0,106,8,0,116,10,0,131,1,0,1,116, ++ 11,0,106,12,0,100,1,0,107,2,0,114,116,0,116,2, ++ 0,106,7,0,106,8,0,116,13,0,131,1,0,1,110,0, ++ 0,116,2,0,106,7,0,106,8,0,116,14,0,131,1,0, ++ 1,100,2,0,83,41,3,122,50,73,110,115,116,97,108,108, ++ 32,105,109,112,111,114,116,108,105,98,32,97,115,32,116,104, ++ 101,32,105,109,112,108,101,109,101,110,116,97,116,105,111,110, ++ 32,111,102,32,105,109,112,111,114,116,46,114,127,1,0,0, ++ 78,41,15,114,133,1,0,0,114,239,0,0,0,114,7,0, ++ 0,0,114,77,1,0,0,114,197,0,0,0,114,85,1,0, ++ 0,114,99,1,0,0,114,104,1,0,0,114,223,0,0,0, ++ 114,11,1,0,0,114,18,1,0,0,114,3,0,0,0,114, ++ 57,0,0,0,114,21,1,0,0,114,72,1,0,0,41,3, ++ 114,131,1,0,0,114,132,1,0,0,90,17,115,117,112,112, ++ 111,114,116,101,100,95,108,111,97,100,101,114,115,114,4,0, ++ 0,0,114,4,0,0,0,114,5,0,0,0,218,8,95,105, ++ 110,115,116,97,108,108,66,9,0,0,115,16,0,0,0,0, ++ 2,13,1,9,1,28,1,16,1,16,1,15,1,19,1,114, ++ 134,1,0,0,41,3,122,3,119,105,110,114,1,0,0,0, ++ 114,2,0,0,0,41,90,114,59,0,0,0,114,10,0,0, ++ 0,114,11,0,0,0,114,17,0,0,0,114,19,0,0,0, ++ 114,28,0,0,0,114,38,0,0,0,114,39,0,0,0,114, ++ 43,0,0,0,114,44,0,0,0,114,46,0,0,0,114,55, ++ 0,0,0,114,65,0,0,0,114,68,0,0,0,114,66,0, ++ 0,0,218,8,95,95,99,111,100,101,95,95,114,193,0,0, ++ 0,114,69,0,0,0,114,109,0,0,0,114,92,0,0,0, ++ 114,99,0,0,0,114,82,0,0,0,114,83,0,0,0,114, ++ 102,0,0,0,114,103,0,0,0,114,105,0,0,0,114,112, ++ 0,0,0,114,114,0,0,0,114,15,0,0,0,114,185,0, ++ 0,0,114,14,0,0,0,114,18,0,0,0,90,17,95,82, ++ 65,87,95,77,65,71,73,67,95,78,85,77,66,69,82,114, ++ 125,0,0,0,114,134,0,0,0,114,119,0,0,0,114,120, ++ 0,0,0,114,132,0,0,0,114,135,0,0,0,114,142,0, ++ 0,0,114,144,0,0,0,114,152,0,0,0,114,156,0,0, ++ 0,114,161,0,0,0,114,164,0,0,0,114,172,0,0,0, ++ 114,180,0,0,0,114,190,0,0,0,114,195,0,0,0,114, ++ 198,0,0,0,114,203,0,0,0,114,211,0,0,0,114,212, ++ 0,0,0,114,216,0,0,0,114,173,0,0,0,218,6,111, ++ 98,106,101,99,116,114,240,0,0,0,114,238,0,0,0,114, ++ 246,0,0,0,114,174,0,0,0,114,11,1,0,0,114,18, ++ 1,0,0,114,21,1,0,0,114,31,1,0,0,114,32,1, ++ 0,0,114,47,1,0,0,114,50,1,0,0,114,54,1,0, ++ 0,114,58,1,0,0,114,55,1,0,0,114,59,1,0,0, ++ 114,253,0,0,0,114,72,1,0,0,114,85,1,0,0,114, ++ 100,1,0,0,114,103,1,0,0,114,247,0,0,0,114,107, ++ 1,0,0,114,116,1,0,0,114,108,1,0,0,114,110,1, ++ 0,0,114,111,1,0,0,114,112,1,0,0,114,118,1,0, ++ 0,114,120,1,0,0,114,239,0,0,0,114,123,1,0,0, ++ 114,124,1,0,0,114,133,1,0,0,114,134,1,0,0,114, ++ 4,0,0,0,114,4,0,0,0,114,4,0,0,0,114,5, ++ 0,0,0,218,8,60,109,111,100,117,108,101,62,8,0,0, ++ 0,115,166,0,0,0,6,17,6,3,12,12,12,5,12,5, ++ 12,6,12,12,12,10,12,9,12,5,12,7,15,22,12,8, ++ 12,4,15,4,19,20,6,2,6,3,22,4,19,68,19,21, ++ 19,19,12,19,12,20,12,113,22,1,18,2,6,2,9,2, ++ 9,1,9,2,15,27,12,23,12,19,12,12,18,8,12,18, ++ 12,11,12,11,12,13,12,13,21,55,21,12,18,10,12,14, ++ 12,34,19,27,19,106,24,22,9,3,12,1,15,63,18,45, ++ 19,251,19,63,19,59,19,60,19,25,22,110,19,31,25,43, ++ 25,16,6,3,19,48,19,57,19,27,19,124,19,142,19,13, ++ 12,9,15,41,12,17,6,1,10,2,12,27,12,6,18,24, ++ 12,32,12,15,12,11,24,35,12,8,12,87, + }; +diff -r 3405dc9a6afa Python/pystate.c +--- a/Python/pystate.c ++++ b/Python/pystate.c +@@ -723,18 +723,18 @@ + + The only situation where you can legitimately have more than one + thread state for an OS level thread is when there are multiple +- interpreters, when: ++ interpreters. + +- a) You shouldn't really be using the PyGILState_ APIs anyway, +- and: ++ You shouldn't really be using the PyGILState_ APIs anyway (see issues ++ #10915 and #15751). + +- b) The slightly odd way PyThread_set_key_value works (see +- comments by its implementation) means that the first thread +- state created for that given OS level thread will "win", +- which seems reasonable behaviour. ++ The first thread state created for that given OS level thread will ++ "win", which seems reasonable behaviour. + */ +- if (PyThread_set_key_value(autoTLSkey, (void *)tstate) < 0) +- Py_FatalError("Couldn't create autoTLSkey mapping"); ++ if (PyThread_get_key_value(autoTLSkey) == NULL) { ++ if (PyThread_set_key_value(autoTLSkey, (void *)tstate) < 0) ++ Py_FatalError("Couldn't create autoTLSkey mapping"); ++ } + + /* PyGILState_Release must not try to delete this thread state. */ + tstate->gilstate_counter = 1; +@@ -771,6 +771,11 @@ + assert(autoInterpreterState); /* Py_Initialize() hasn't been called! */ + tcur = (PyThreadState *)PyThread_get_key_value(autoTLSkey); + if (tcur == NULL) { ++ /* At startup, Python has no concrete GIL. If PyGILState_Ensure() is ++ called from a new thread for the first time, we need the create the ++ GIL. */ ++ PyEval_InitThreads(); ++ + /* Create a new thread state for this thread */ + tcur = PyThreadState_New(autoInterpreterState); + if (tcur == NULL) +diff -r 3405dc9a6afa Python/pythonrun.c +--- a/Python/pythonrun.c ++++ b/Python/pythonrun.c +@@ -106,6 +106,7 @@ + extern void _PyFaulthandler_Fini(void); + extern void _PyHash_Fini(void); + extern int _PyTraceMalloc_Init(void); ++extern int _PyTraceMalloc_Fini(void); + + #ifdef WITH_THREAD + extern void _PyGILState_Init(PyInterpreterState *, PyThreadState *); +@@ -642,6 +643,10 @@ + PyGC_Collect(); + #endif + ++ /* Disable tracemalloc after all Python objects have been destroyed, ++ so it is possible to use tracemalloc in objects destructor. */ ++ _PyTraceMalloc_Fini(); ++ + /* Destroy the database used by _PyImport_{Fixup,Find}Extension */ + _PyImport_Fini(); + +@@ -1883,9 +1888,11 @@ + _Py_IDENTIFIER(print_file_and_line); + + if (!PyExceptionInstance_Check(value)) { +- PyFile_WriteString("TypeError: print_exception(): Exception expected for value, ", f); +- PyFile_WriteString(Py_TYPE(value)->tp_name, f); +- PyFile_WriteString(" found\n", f); ++ err = PyFile_WriteString("TypeError: print_exception(): Exception expected for value, ", f); ++ err += PyFile_WriteString(Py_TYPE(value)->tp_name, f); ++ err += PyFile_WriteString(" found\n", f); ++ if (err) ++ PyErr_Clear(); + return; + } + +diff -r 3405dc9a6afa Python/random.c +--- a/Python/random.c ++++ b/Python/random.c +@@ -68,28 +68,7 @@ + #endif /* MS_WINDOWS */ + + +-#ifdef __VMS +-/* Use openssl random routine */ +-#include +-static int +-vms_urandom(unsigned char *buffer, Py_ssize_t size, int raise) +-{ +- if (RAND_pseudo_bytes(buffer, size) < 0) { +- if (raise) { +- PyErr_Format(PyExc_ValueError, +- "RAND_pseudo_bytes"); +- } else { +- Py_FatalError("Failed to initialize the randomized hash " +- "secret using RAND_pseudo_bytes"); +- } +- return -1; +- } +- return 0; +-} +-#endif /* __VMS */ +- +- +-#if !defined(MS_WINDOWS) && !defined(__VMS) ++#ifndef MS_WINDOWS + static int urandom_fd = -1; + + /* Read size bytes from /dev/urandom into buffer. +@@ -195,7 +174,7 @@ + } + } + +-#endif /* !defined(MS_WINDOWS) && !defined(__VMS) */ ++#endif /* MS_WINDOWS */ + + /* Fill buffer with pseudo-random bytes generated by a linear congruent + generator (LCG): +@@ -237,11 +216,7 @@ + #ifdef MS_WINDOWS + return win32_urandom((unsigned char *)buffer, size, 1); + #else +-# ifdef __VMS +- return vms_urandom((unsigned char *)buffer, size, 1); +-# else + return dev_urandom_python((char*)buffer, size); +-# endif + #endif + } + +@@ -285,12 +260,8 @@ + else { + #ifdef MS_WINDOWS + (void)win32_urandom(secret, secret_size, 0); +-#else /* #ifdef MS_WINDOWS */ +-# ifdef __VMS +- vms_urandom(secret, secret_size, 0); +-# else ++#else + dev_urandom_noraise(secret, secret_size); +-# endif + #endif + } + } +@@ -298,7 +269,7 @@ + void + _PyRandom_Fini(void) + { +-#if !defined(MS_WINDOWS) && !defined(__VMS) ++#ifndef MS_WINDOWS + dev_urandom_close(); + #endif + } +diff -r 3405dc9a6afa Python/sysmodule.c +--- a/Python/sysmodule.c ++++ b/Python/sysmodule.c +@@ -32,10 +32,6 @@ + extern const char *PyWin_DLLVersionString; + #endif + +-#ifdef __VMS +-#include +-#endif +- + #ifdef HAVE_LANGINFO_H + #include + #include +@@ -367,7 +363,7 @@ + + + static PyObject * +-call_trampoline(PyThreadState *tstate, PyObject* callback, ++call_trampoline(PyObject* callback, + PyFrameObject *frame, int what, PyObject *arg) + { + PyObject *args; +@@ -405,12 +401,11 @@ + profile_trampoline(PyObject *self, PyFrameObject *frame, + int what, PyObject *arg) + { +- PyThreadState *tstate = frame->f_tstate; + PyObject *result; + + if (arg == NULL) + arg = Py_None; +- result = call_trampoline(tstate, self, frame, what, arg); ++ result = call_trampoline(self, frame, what, arg); + if (result == NULL) { + PyEval_SetProfile(NULL, NULL); + return -1; +@@ -423,7 +418,6 @@ + trace_trampoline(PyObject *self, PyFrameObject *frame, + int what, PyObject *arg) + { +- PyThreadState *tstate = frame->f_tstate; + PyObject *callback; + PyObject *result; + +@@ -433,7 +427,7 @@ + callback = frame->f_trace; + if (callback == NULL) + return 0; +- result = call_trampoline(tstate, callback, frame, what, arg); ++ result = call_trampoline(callback, frame, what, arg); + if (result == NULL) { + PyEval_SetTrace(NULL, NULL); + Py_XDECREF(frame->f_trace); +@@ -803,6 +797,10 @@ + PyStructSequence_SET_ITEM(version, pos++, PyLong_FromLong(ver.wSuiteMask)); + PyStructSequence_SET_ITEM(version, pos++, PyLong_FromLong(ver.wProductType)); + ++ if (PyErr_Occurred()) { ++ Py_DECREF(version); ++ return NULL; ++ } + return version; + } + +@@ -1184,7 +1182,7 @@ + {"settrace", sys_settrace, METH_O, settrace_doc}, + {"gettrace", sys_gettrace, METH_NOARGS, gettrace_doc}, + {"call_tracing", sys_call_tracing, METH_VARARGS, call_tracing_doc}, +- {"_debugmallocstats", sys_debugmallocstats, METH_VARARGS, ++ {"_debugmallocstats", sys_debugmallocstats, METH_NOARGS, + debugmallocstats_doc}, + {NULL, NULL} /* sentinel */ + }; +@@ -1467,6 +1465,7 @@ + #undef SetFlag + + if (PyErr_Occurred()) { ++ Py_DECREF(seq); + return NULL; + } + return seq; +@@ -1864,22 +1863,7 @@ + if (av != NULL) { + int i; + for (i = 0; i < argc; i++) { +-#ifdef __VMS +- PyObject *v; +- +- /* argv[0] is the script pathname if known */ +- if (i == 0) { +- char* fn = decc$translate_vms(argv[0]); +- if ((fn == (char *)0) || fn == (char *)-1) +- v = PyUnicode_FromString(argv[0]); +- else +- v = PyUnicode_FromString( +- decc$translate_vms(argv[0])); +- } else +- v = PyUnicode_FromString(argv[i]); +-#else + PyObject *v = PyUnicode_FromWideChar(argv[i], -1); +-#endif + if (v == NULL) { + Py_DECREF(av); + av = NULL; +diff -r 3405dc9a6afa Python/thread.c +--- a/Python/thread.c ++++ b/Python/thread.c +@@ -205,7 +205,7 @@ + * segfaults. Now we lock the whole routine. + */ + static struct key * +-find_key(int key, void *value) ++find_key(int set_value, int key, void *value) + { + struct key *p, *prev_p; + long id = PyThread_get_thread_ident(); +@@ -215,8 +215,11 @@ + PyThread_acquire_lock(keymutex, 1); + prev_p = NULL; + for (p = keyhead; p != NULL; p = p->next) { +- if (p->id == id && p->key == key) ++ if (p->id == id && p->key == key) { ++ if (set_value) ++ p->value = value; + goto Done; ++ } + /* Sanity check. These states should never happen but if + * they do we must abort. Otherwise we'll end up spinning in + * in a tight loop with the lock held. A similar check is done +@@ -227,7 +230,7 @@ + if (p->next == keyhead) + Py_FatalError("tls find_key: circular list(!)"); + } +- if (value == NULL) { ++ if (!set_value && value == NULL) { + assert(p == NULL); + goto Done; + } +@@ -279,19 +282,12 @@ + PyThread_release_lock(keymutex); + } + +-/* Confusing: If the current thread has an association for key, +- * value is ignored, and 0 is returned. Else an attempt is made to create +- * an association of key to value for the current thread. 0 is returned +- * if that succeeds, but -1 is returned if there's not enough memory +- * to create the association. value must not be NULL. +- */ + int + PyThread_set_key_value(int key, void *value) + { + struct key *p; + +- assert(value != NULL); +- p = find_key(key, value); ++ p = find_key(1, key, value); + if (p == NULL) + return -1; + else +@@ -304,7 +300,7 @@ + void * + PyThread_get_key_value(int key) + { +- struct key *p = find_key(key, NULL); ++ struct key *p = find_key(0, key, NULL); + + if (p == NULL) + return NULL; +diff -r 3405dc9a6afa Python/thread_nt.h +--- a/Python/thread_nt.h ++++ b/Python/thread_nt.h +@@ -389,20 +389,11 @@ + TlsFree(key); + } + +-/* We must be careful to emulate the strange semantics implemented in thread.c, +- * where the value is only set if it hasn't been set before. +- */ + int + PyThread_set_key_value(int key, void *value) + { + BOOL ok; +- void *oldvalue; + +- assert(value != NULL); +- oldvalue = TlsGetValue(key); +- if (oldvalue != NULL) +- /* ignore value if already set */ +- return 0; + ok = TlsSetValue(key, value); + if (!ok) + return -1; +diff -r 3405dc9a6afa Python/thread_pthread.h +--- a/Python/thread_pthread.h ++++ b/Python/thread_pthread.h +@@ -627,9 +627,6 @@ + PyThread_set_key_value(int key, void *value) + { + int fail; +- void *oldValue = pthread_getspecific(key); +- if (oldValue != NULL) +- return 0; + fail = pthread_setspecific(key, value); + return fail ? -1 : 0; + } +diff -r 3405dc9a6afa Python/traceback.c +--- a/Python/traceback.c ++++ b/Python/traceback.c +@@ -264,6 +264,8 @@ + return 0; + } + found_encoding = PyTokenizer_FindEncodingFilename(fd, filename); ++ if (found_encoding == NULL) ++ PyErr_Clear(); + encoding = (found_encoding != NULL) ? found_encoding : "utf-8"; + /* Reset position */ + if (lseek(fd, 0, SEEK_SET) == (off_t)-1) { +diff -r 3405dc9a6afa Tools/buildbot/build-amd64.bat +--- a/Tools/buildbot/build-amd64.bat ++++ b/Tools/buildbot/build-amd64.bat +@@ -2,6 +2,5 @@ + cmd /c Tools\buildbot\external-amd64.bat + call "%VS100COMNTOOLS%\..\..\VC\vcvarsall.bat" x86_amd64 + cmd /c Tools\buildbot\clean-amd64.bat +-msbuild PCbuild\kill_python.vcxproj /p:Configuration=Debug /p:PlatformTarget=x64 +-PCbuild\amd64\kill_python_d.exe ++ + msbuild PCbuild\pcbuild.sln /p:Configuration=Debug /p:Platform=x64 +diff -r 3405dc9a6afa Tools/buildbot/build.bat +--- a/Tools/buildbot/build.bat ++++ b/Tools/buildbot/build.bat +@@ -2,7 +2,6 @@ + cmd /c Tools\buildbot\external.bat + call "%VS100COMNTOOLS%vsvars32.bat" + cmd /c Tools\buildbot\clean.bat +-msbuild PCbuild\kill_python.vcxproj /p:Configuration=Debug /p:PlatformTarget=x86 +-PCbuild\kill_python_d.exe ++ + msbuild PCbuild\pcbuild.sln /p:Configuration=Debug /p:Platform=Win32 + +diff -r 3405dc9a6afa Tools/i18n/makelocalealias.py +--- a/Tools/i18n/makelocalealias.py ++++ b/Tools/i18n/makelocalealias.py +@@ -7,14 +7,15 @@ + + """ + import locale ++import sys + + # Location of the alias file + LOCALE_ALIAS = '/usr/share/X11/locale/locale.alias' + + def parse(filename): + +- f = open(filename) +- lines = f.read().splitlines() ++ with open(filename, encoding='latin1') as f: ++ lines = list(f) + data = {} + for line in lines: + line = line.strip() +@@ -23,6 +24,12 @@ + if line[:1] == '#': + continue + locale, alias = line.split() ++ # Fix non-standard locale names, e.g. ks_IN@devanagari.UTF-8 ++ if '@' in alias: ++ alias_lang, _, alias_mod = alias.partition('@') ++ if '.' in alias_mod: ++ alias_mod, _, alias_enc = alias_mod.partition('.') ++ alias = alias_lang + '.' + alias_enc + '@' + alias_mod + # Strip ':' + if locale[-1] == ':': + locale = locale[:-1] +@@ -47,21 +54,47 @@ + def pprint(data): + items = sorted(data.items()) + for k, v in items: +- print(' %-40s%r,' % ('%r:' % k, v)) ++ print(' %-40s%a,' % ('%a:' % k, v)) + + def print_differences(data, olddata): + items = sorted(olddata.items()) + for k, v in items: + if k not in data: +- print('# removed %r' % k) ++ print('# removed %a' % k) + elif olddata[k] != data[k]: +- print('# updated %r -> %r to %r' % \ ++ print('# updated %a -> %a to %a' % \ + (k, olddata[k], data[k])) + # Additions are not mentioned + ++def optimize(data): ++ locale_alias = locale.locale_alias ++ locale.locale_alias = data.copy() ++ for k, v in data.items(): ++ del locale.locale_alias[k] ++ if locale.normalize(k) != v: ++ locale.locale_alias[k] = v ++ newdata = locale.locale_alias ++ errors = check(data) ++ locale.locale_alias = locale_alias ++ if errors: ++ sys.exit(1) ++ return newdata ++ ++def check(data): ++ # Check that all alias definitions from the X11 file ++ # are actually mapped to the correct alias locales. ++ errors = 0 ++ for k, v in data.items(): ++ if locale.normalize(k) != v: ++ print('ERROR: %a -> %a != %a' % (k, locale.normalize(k), v), ++ file=sys.stderr) ++ errors += 1 ++ return errors ++ + if __name__ == '__main__': + data = locale.locale_alias.copy() + data.update(parse(LOCALE_ALIAS)) ++ data = optimize(data) + print_differences(data, locale.locale_alias) + print() + print('locale_alias = {') +diff -r 3405dc9a6afa Tools/i18n/pygettext.py +--- a/Tools/i18n/pygettext.py ++++ b/Tools/i18n/pygettext.py +@@ -1,6 +1,6 @@ + #! /usr/bin/env python3 + # -*- coding: iso-8859-1 -*- +-# Originally written by Barry Warsaw ++# Originally written by Barry Warsaw + # + # Minimally patched to make it even more xgettext compatible + # by Peter Funk +diff -r 3405dc9a6afa Tools/ssl/test_multiple_versions.py +--- /dev/null ++++ b/Tools/ssl/test_multiple_versions.py +@@ -0,0 +1,241 @@ ++#./python ++"""Run Python tests with multiple installations of OpenSSL ++ ++The script ++ ++ (1) downloads OpenSSL tar bundle ++ (2) extracts it to ../openssl/src/openssl-VERSION/ ++ (3) compiles OpenSSL ++ (4) installs OpenSSL into ../openssl/VERSION/ ++ (5) forces a recompilation of Python modules using the ++ header and library files from ../openssl/VERSION/ ++ (6) runs Python's test suite ++ ++The script must be run with Python's build directory as current working ++directory: ++ ++ ./python Tools/ssl/test_multiple_versions.py ++ ++The script uses LD_RUN_PATH, LD_LIBRARY_PATH, CPPFLAGS and LDFLAGS to bend ++search paths for header files and shared libraries. It's known to work on ++Linux with GCC 4.x. ++ ++(c) 2013 Christian Heimes ++""" ++import logging ++import os ++import tarfile ++import shutil ++import subprocess ++import sys ++from urllib.request import urlopen ++ ++log = logging.getLogger("multissl") ++ ++OPENSSL_VERSIONS = [ ++ "0.9.7m", "0.9.8i", "0.9.8l", "0.9.8m", "0.9.8y", "1.0.0k", "1.0.1e" ++] ++FULL_TESTS = [ ++ "test_asyncio", "test_ftplib", "test_hashlib", "test_httplib", ++ "test_imaplib", "test_nntplib", "test_poplib", "test_smtplib", ++ "test_smtpnet", "test_urllib2_localnet", "test_venv" ++] ++MINIMAL_TESTS = ["test_ssl", "test_hashlib"] ++CADEFAULT = True ++HERE = os.path.abspath(os.getcwd()) ++DEST_DIR = os.path.abspath(os.path.join(HERE, os.pardir, "openssl")) ++ ++ ++class BuildSSL: ++ url_template = "https://www.openssl.org/source/openssl-{}.tar.gz" ++ ++ module_files = ["Modules/_ssl.c", ++ "Modules/socketmodule.c", ++ "Modules/_hashopenssl.c"] ++ ++ def __init__(self, version, openssl_compile_args=(), destdir=DEST_DIR): ++ self._check_python_builddir() ++ self.version = version ++ self.openssl_compile_args = openssl_compile_args ++ # installation directory ++ self.install_dir = os.path.join(destdir, version) ++ # source file ++ self.src_file = os.path.join(destdir, "src", ++ "openssl-{}.tar.gz".format(version)) ++ # build directory (removed after install) ++ self.build_dir = os.path.join(destdir, "src", ++ "openssl-{}".format(version)) ++ ++ @property ++ def openssl_cli(self): ++ """openssl CLI binary""" ++ return os.path.join(self.install_dir, "bin", "openssl") ++ ++ @property ++ def openssl_version(self): ++ """output of 'bin/openssl version'""" ++ env = os.environ.copy() ++ env["LD_LIBRARY_PATH"] = self.lib_dir ++ cmd = [self.openssl_cli, "version"] ++ return self._subprocess_output(cmd, env=env) ++ ++ @property ++ def pyssl_version(self): ++ """Value of ssl.OPENSSL_VERSION""" ++ env = os.environ.copy() ++ env["LD_LIBRARY_PATH"] = self.lib_dir ++ cmd = ["./python", "-c", "import ssl; print(ssl.OPENSSL_VERSION)"] ++ return self._subprocess_output(cmd, env=env) ++ ++ @property ++ def include_dir(self): ++ return os.path.join(self.install_dir, "include") ++ ++ @property ++ def lib_dir(self): ++ return os.path.join(self.install_dir, "lib") ++ ++ @property ++ def has_openssl(self): ++ return os.path.isfile(self.openssl_cli) ++ ++ @property ++ def has_src(self): ++ return os.path.isfile(self.src_file) ++ ++ def _subprocess_call(self, cmd, stdout=subprocess.DEVNULL, env=None, ++ **kwargs): ++ log.debug("Call '{}'".format(" ".join(cmd))) ++ return subprocess.check_call(cmd, stdout=stdout, env=env, **kwargs) ++ ++ def _subprocess_output(self, cmd, env=None, **kwargs): ++ log.debug("Call '{}'".format(" ".join(cmd))) ++ out = subprocess.check_output(cmd, env=env) ++ return out.strip().decode("utf-8") ++ ++ def _check_python_builddir(self): ++ if not os.path.isfile("python") or not os.path.isfile("setup.py"): ++ raise ValueError("Script must be run in Python build directory") ++ ++ def _download_openssl(self): ++ """Download OpenSSL source dist""" ++ src_dir = os.path.dirname(self.src_file) ++ if not os.path.isdir(src_dir): ++ os.makedirs(src_dir) ++ url = self.url_template.format(self.version) ++ log.info("Downloading OpenSSL from {}".format(url)) ++ req = urlopen(url, cadefault=CADEFAULT) ++ # KISS, read all, write all ++ data = req.read() ++ log.info("Storing {}".format(self.src_file)) ++ with open(self.src_file, "wb") as f: ++ f.write(data) ++ ++ def _unpack_openssl(self): ++ """Unpack tar.gz bundle""" ++ # cleanup ++ if os.path.isdir(self.build_dir): ++ shutil.rmtree(self.build_dir) ++ os.makedirs(self.build_dir) ++ ++ tf = tarfile.open(self.src_file) ++ base = "openssl-{}/".format(self.version) ++ # force extraction into build dir ++ members = tf.getmembers() ++ for member in members: ++ if not member.name.startswith(base): ++ raise ValueError(member.name) ++ member.name = member.name[len(base):] ++ log.info("Unpacking files to {}".format(self.build_dir)) ++ tf.extractall(self.build_dir, members) ++ ++ def _build_openssl(self): ++ """Now build openssl""" ++ log.info("Running build in {}".format(self.install_dir)) ++ cwd = self.build_dir ++ cmd = ["./config", "shared", "--prefix={}".format(self.install_dir)] ++ cmd.extend(self.openssl_compile_args) ++ self._subprocess_call(cmd, cwd=cwd) ++ self._subprocess_call(["make"], cwd=cwd) ++ ++ def _install_openssl(self, remove=True): ++ self._subprocess_call(["make", "install"], cwd=self.build_dir) ++ if remove: ++ shutil.rmtree(self.build_dir) ++ ++ def install_openssl(self): ++ if not self.has_openssl: ++ if not self.has_src: ++ self._download_openssl() ++ else: ++ log.debug("Already has src {}".format(self.src_file)) ++ self._unpack_openssl() ++ self._build_openssl() ++ self._install_openssl() ++ else: ++ log.info("Already has installation {}".format(self.install_dir)) ++ # validate installation ++ version = self.openssl_version ++ if self.version not in version: ++ raise ValueError(version) ++ ++ def touch_pymods(self): ++ # force a rebuild of all modules that use OpenSSL APIs ++ for fname in self.module_files: ++ os.utime(fname) ++ ++ def recompile_pymods(self): ++ log.info("Using OpenSSL build from {}".format(self.build_dir)) ++ # overwrite header and library search paths ++ env = os.environ.copy() ++ env["CPPFLAGS"] = "-I{}".format(self.include_dir) ++ env["LDFLAGS"] = "-L{}".format(self.lib_dir) ++ # set rpath ++ env["LD_RUN_PATH"] = self.lib_dir ++ ++ log.info("Rebuilding Python modules") ++ self.touch_pymods() ++ cmd = ["./python", "setup.py", "build"] ++ self._subprocess_call(cmd, env=env) ++ ++ def check_pyssl(self): ++ version = self.pyssl_version ++ if self.version not in version: ++ raise ValueError(version) ++ ++ def run_pytests(self, *args): ++ cmd = ["./python", "-m", "test"] ++ cmd.extend(args) ++ self._subprocess_call(cmd, stdout=None) ++ ++ def run_python_tests(self, *args): ++ self.recompile_pymods() ++ self.check_pyssl() ++ self.run_pytests(*args) ++ ++ ++def main(*args): ++ builders = [] ++ for version in OPENSSL_VERSIONS: ++ if version in ("0.9.8i", "0.9.8l"): ++ openssl_compile_args = ("no-asm",) ++ else: ++ openssl_compile_args = () ++ builder = BuildSSL(version, openssl_compile_args) ++ builder.install_openssl() ++ builders.append(builder) ++ ++ for builder in builders: ++ builder.run_python_tests(*args) ++ # final touch ++ builder.touch_pymods() ++ ++ ++if __name__ == "__main__": ++ logging.basicConfig(level=logging.INFO, ++ format="*** %(levelname)s %(message)s") ++ args = sys.argv[1:] ++ if not args: ++ args = ["-unetwork", "-v"] ++ args.extend(FULL_TESTS) ++ main(*args) +diff -r 3405dc9a6afa configure.ac +--- a/configure.ac ++++ b/configure.ac +@@ -522,6 +522,19 @@ + AC_DEFINE(_POSIX_C_SOURCE, 200809L, Define to activate features from IEEE Stds 1003.1-2008) + fi + ++# On HP-UX mbstate_t requires _INCLUDE__STDC_A1_SOURCE ++case $ac_sys_system in ++ hp*|HP*) ++ define_stdc_a1=yes;; ++ *) ++ define_stdc_a1=no;; ++esac ++ ++if test $define_stdc_a1 = yes ++then ++ AC_DEFINE(_INCLUDE__STDC_A1_SOURCE, 1, Define to include mbstate_t for mbrtowc) ++fi ++ + # + # SGI compilers allow the specification of the both the ABI and the + # ISA on the command line. Depending on the values of these switches, +diff -r 3405dc9a6afa pyconfig.h.in +--- a/pyconfig.h.in ++++ b/pyconfig.h.in +@@ -1382,6 +1382,9 @@ + /* Define on Linux to activate all library features */ + #undef _GNU_SOURCE + ++/* Define to include mbstate_t for mbrtowc */ ++#undef _INCLUDE__STDC_A1_SOURCE ++ + /* This must be defined on some systems to enable large file support. */ + #undef _LARGEFILE_SOURCE + +diff -r 3405dc9a6afa setup.py +--- a/setup.py ++++ b/setup.py +@@ -1956,7 +1956,7 @@ + undef_macros = [] + if '--with-system-libmpdec' in sysconfig.get_config_var("CONFIG_ARGS"): + include_dirs = [] +- libraries = ['mpdec'] ++ libraries = [':libmpdec.so.2'] + sources = ['_decimal/_decimal.c'] + depends = ['_decimal/docstrings.h'] + else: --- python3.4-3.4~b1.orig/debian/patches/hurd-disable-nonworking-constants.diff +++ python3.4-3.4~b1/debian/patches/hurd-disable-nonworking-constants.diff @@ -0,0 +1,38 @@ +# DP: Comment out constant exposed on the API which are not implemented on +# DP: GNU/Hurd. They would not work at runtime anyway. + +Index: b/Modules/socketmodule.c +=================================================================== +--- a/Modules/socketmodule.c ++++ b/Modules/socketmodule.c +@@ -6199,9 +6199,11 @@ + #ifdef SO_OOBINLINE + PyModule_AddIntMacro(m, SO_OOBINLINE); + #endif ++#ifndef __GNU__ + #ifdef SO_REUSEPORT + PyModule_AddIntMacro(m, SO_REUSEPORT); + #endif ++#endif + #ifdef SO_SNDBUF + PyModule_AddIntMacro(m, SO_SNDBUF); + #endif +Index: b/Modules/posixmodule.c +=================================================================== +--- a/Modules/posixmodule.c ++++ b/Modules/posixmodule.c +@@ -11693,12 +11693,14 @@ + #ifdef O_LARGEFILE + if (PyModule_AddIntMacro(m, O_LARGEFILE)) return -1; + #endif ++#ifndef __GNU__ + #ifdef O_SHLOCK + if (PyModule_AddIntMacro(m, O_SHLOCK)) return -1; + #endif + #ifdef O_EXLOCK + if (PyModule_AddIntMacro(m, O_EXLOCK)) return -1; + #endif ++#endif + #ifdef O_EXEC + if (PyModule_AddIntMacro(m, O_EXEC)) return -1; + #endif --- python3.4-3.4~b1.orig/debian/patches/hurd-path_max.diff +++ python3.4-3.4~b1/debian/patches/hurd-path_max.diff @@ -0,0 +1,15 @@ +Index: b/Python/pythonrun.c +=================================================================== +--- a/Python/pythonrun.c ++++ b/Python/pythonrun.c +@@ -67,6 +67,10 @@ + } + #endif + ++#ifdef __gnu_hurd__ ++#define PATH_MAX MAXPATHLEN ++#endif ++ + #ifndef Py_REF_DEBUG + #define PRINT_TOTAL_REFS() + #else /* Py_REF_DEBUG */ --- python3.4-3.4~b1.orig/debian/patches/installed-testsuite.diff +++ python3.4-3.4~b1/debian/patches/installed-testsuite.diff @@ -0,0 +1,17 @@ +# DP: Changes needed to run the installed testsuite. +# DP: Also removed: +# DP: - ctypes/test/test_macholib.py +# DP: - distutils/tests/test_bdist_wininst.py + +Index: b/Lib/test/test_sysconfig.py +=================================================================== +--- a/Lib/test/test_sysconfig.py ++++ b/Lib/test/test_sysconfig.py +@@ -338,6 +338,7 @@ + self.assertEqual(status, 0) + self.assertEqual(my_platform, test_platform) + ++ @unittest.skipUnless(sysconfig.is_python_build(), "test only in build location") + def test_srcdir(self): + # See Issues #15322, #15364. + srcdir = sysconfig.get_config_var('srcdir') --- python3.4-3.4~b1.orig/debian/patches/kfreebsd-testsuite.diff +++ python3.4-3.4~b1/debian/patches/kfreebsd-testsuite.diff @@ -0,0 +1,13 @@ +Index: b/Lib/test/test_socket.py +=================================================================== +--- a/Lib/test/test_socket.py ++++ b/Lib/test/test_socket.py +@@ -870,7 +870,7 @@ + # Find one service that exists, then check all the related interfaces. + # I've ordered this by protocols that have both a tcp and udp + # protocol, at least for modern Linuxes. +- if (sys.platform.startswith(('freebsd', 'netbsd')) ++ if (sys.platform.startswith(('freebsd', 'netbsd', 'gnukfreebsd')) + or sys.platform in ('linux', 'darwin')): + # avoid the 'echo' service on this platform, as there is an + # assumption breaking non-standard port/protocol entry --- python3.4-3.4~b1.orig/debian/patches/kfreebsd-xattrs.diff +++ python3.4-3.4~b1/debian/patches/kfreebsd-xattrs.diff @@ -0,0 +1,15 @@ +# DP: Don't define USE_XATTRS on kfreebsd and the Hurd. + +Index: b/Modules/posixmodule.c +=================================================================== +--- a/Modules/posixmodule.c ++++ b/Modules/posixmodule.c +@@ -97,7 +97,7 @@ + #undef HAVE_SCHED_SETAFFINITY + #endif + +-#if defined(HAVE_SYS_XATTR_H) && defined(__GLIBC__) ++#if defined(HAVE_SYS_XATTR_H) && defined(__GLIBC__) && !defined(__FreeBSD_kernel__) && !defined(__GNU__) + #define USE_XATTRS + #endif + --- python3.4-3.4~b1.orig/debian/patches/langpack-gettext.diff +++ python3.4-3.4~b1/debian/patches/langpack-gettext.diff @@ -0,0 +1,36 @@ +# DP: Description: support alternative gettext tree in +# DP: /usr/share/locale-langpack; if a file is present in both trees, +# DP: prefer the newer one +# DP: Upstream status: Ubuntu-Specific + +Index: b/Lib/gettext.py +=================================================================== +--- a/Lib/gettext.py ++++ b/Lib/gettext.py +@@ -378,11 +378,26 @@ + if lang == 'C': + break + mofile = os.path.join(localedir, lang, 'LC_MESSAGES', '%s.mo' % domain) ++ mofile_lp = os.path.join("/usr/share/locale-langpack", lang, ++ 'LC_MESSAGES', '%s.mo' % domain) ++ ++ # first look into the standard locale dir, then into the ++ # langpack locale dir ++ ++ # standard mo file + if os.path.exists(mofile): + if all: + result.append(mofile) + else: + return mofile ++ ++ # langpack mofile -> use it ++ if os.path.exists(mofile_lp): ++ if all: ++ result.append(mofile_lp) ++ else: ++ return mofile_lp ++ + return result + + --- python3.4-3.4~b1.orig/debian/patches/lib-argparse.diff +++ python3.4-3.4~b1/debian/patches/lib-argparse.diff @@ -0,0 +1,22 @@ +# DP: argparse.py: Make the gettext import conditional + +--- a/Lib/argparse.py ++++ b/Lib/argparse.py +@@ -90,7 +90,16 @@ + import sys as _sys + import textwrap as _textwrap + +-from gettext import gettext as _, ngettext ++try: ++ from gettext import gettext as _, ngettext ++except ImportError: ++ def _(message): ++ return message ++ def ngettext(singular,plural,n): ++ if n == 1: ++ return singular ++ else: ++ return plural + + + SUPPRESS = '==SUPPRESS==' --- python3.4-3.4~b1.orig/debian/patches/lib2to3-no-pickled-grammar.diff +++ python3.4-3.4~b1/debian/patches/lib2to3-no-pickled-grammar.diff @@ -0,0 +1,14 @@ +--- a/Lib/lib2to3/pgen2/driver.py ++++ b/Lib/lib2to3/pgen2/driver.py +@@ -119,7 +119,10 @@ + if force or not _newer(gp, gt): + logger.info("Generating grammar tables from %s", gt) + g = pgen.generate_grammar(gt) +- if save: ++ # the pickle files mismatch, when built on different architectures. ++ # don't save these for now. An alternative solution might be to ++ # include the multiarch triplet into the file name ++ if False: + logger.info("Writing grammar tables to %s", gp) + try: + g.dump(gp) --- python3.4-3.4~b1.orig/debian/patches/libffi-shared.diff +++ python3.4-3.4~b1/debian/patches/libffi-shared.diff @@ -0,0 +1,13 @@ +Index: b/setup.py +=================================================================== +--- a/setup.py ++++ b/setup.py +@@ -1939,7 +1939,7 @@ + break + ffi_lib = None + if ffi_inc is not None: +- for lib_name in ('ffi_convenience', 'ffi_pic', 'ffi'): ++ for lib_name in ('ffi', 'ffi_convenience', 'ffi_pic', 'ffi'): + if (self.compiler.find_library_file(lib_dirs, lib_name)): + ffi_lib = lib_name + break --- python3.4-3.4~b1.orig/debian/patches/linecache.diff +++ python3.4-3.4~b1/debian/patches/linecache.diff @@ -0,0 +1,18 @@ +# DP: Proper handling of packages in linecache.py + +Index: b/Lib/linecache.py +=================================================================== +--- a/Lib/linecache.py ++++ b/Lib/linecache.py +@@ -109,6 +109,11 @@ + if os.path.isabs(filename): + return [] + ++ # Take care to handle packages. ++ if basename == '__init__.py': ++ # filename referes to a package ++ basename = filename ++ + for dirname in sys.path: + try: + fullname = os.path.join(dirname, basename) --- python3.4-3.4~b1.orig/debian/patches/link-opt.diff +++ python3.4-3.4~b1/debian/patches/link-opt.diff @@ -0,0 +1,26 @@ +# DP: Call the linker with -O1 -Bsymbolic-functions + +Index: b/configure.ac +=================================================================== +--- a/configure.ac ++++ b/configure.ac +@@ -2037,8 +2037,8 @@ + fi + ;; + Linux*|GNU*|QNX*) +- LDSHARED='$(CC) -shared' +- LDCXXSHARED='$(CXX) -shared';; ++ LDSHARED='$(CC) -shared -Wl,-O1 -Wl,-Bsymbolic-functions' ++ LDCXXSHARED='$(CXX) -shared -Wl,-O1 -Wl,-Bsymbolic-functions';; + BSD/OS*/4*) + LDSHARED="gcc -shared" + LDCXXSHARED="g++ -shared";; +@@ -2136,7 +2136,7 @@ + LINKFORSHARED="-Wl,-E -Wl,+s";; + # LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";; + BSD/OS/4*) LINKFORSHARED="-Xlinker -export-dynamic";; +- Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";; ++ Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic -Wl,-O1 -Wl,-Bsymbolic-functions";; + # -u libsys_s pulls in all symbols in libsys + Darwin/*) + LINKFORSHARED="$extra_undefs -framework CoreFoundation" --- python3.4-3.4~b1.orig/debian/patches/link-timemodule.diff +++ python3.4-3.4~b1/debian/patches/link-timemodule.diff @@ -0,0 +1,13 @@ +Index: b/Modules/Setup.dist +=================================================================== +--- a/Modules/Setup.dist ++++ b/Modules/Setup.dist +@@ -171,7 +171,7 @@ + #cmath cmathmodule.c _math.c # -lm # complex math library functions + #math mathmodule.c _math.c # -lm # math library functions, e.g. sin() + #_struct _struct.c # binary structure packing/unpacking +-#time timemodule.c # -lm # time operations and variables ++#time timemodule.c -lrt # -lm # time operations and variables + #_weakref _weakref.c # basic weak reference support + #_testcapi _testcapimodule.c # Python C API test module + #_random _randommodule.c # Random number generator --- python3.4-3.4~b1.orig/debian/patches/locale-module.diff +++ python3.4-3.4~b1/debian/patches/locale-module.diff @@ -0,0 +1,19 @@ +# DP: * Lib/locale.py: +# DP: - Don't map 'utf8', 'utf-8' to 'utf', which is not a known encoding +# DP: for glibc. + +Index: b/Lib/locale.py +=================================================================== +--- a/Lib/locale.py ++++ b/Lib/locale.py +@@ -1222,8 +1222,8 @@ + 'turkish': 'tr_TR.ISO8859-9', + 'uk': 'uk_UA.KOI8-U', + 'uk_ua': 'uk_UA.KOI8-U', +- 'univ': 'en_US.utf', +- 'universal': 'en_US.utf', ++ 'univ': 'en_US.UTF-8', ++ 'universal': 'en_US.UTF-8', + 'universal.utf8@ucs4': 'en_US.UTF-8', + 'ur': 'ur_PK.CP1256', + 'ur_in': 'ur_IN.UTF-8', --- python3.4-3.4~b1.orig/debian/patches/lto-link-flags.diff +++ python3.4-3.4~b1/debian/patches/lto-link-flags.diff @@ -0,0 +1,22 @@ +Index: b/Makefile.pre.in +=================================================================== +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -128,7 +128,7 @@ + SHLIB_SUFFIX= @SHLIB_SUFFIX@ + EXT_SUFFIX= @EXT_SUFFIX@ + LDSHARED= @LDSHARED@ $(PY_LDFLAGS) +-BLDSHARED= @BLDSHARED@ $(PY_LDFLAGS) ++BLDSHARED= @BLDSHARED@ $(PY_LDFLAGS) $(PY_CFLAGS) + LDCXXSHARED= @LDCXXSHARED@ + DESTSHARED= $(BINLIBDEST)/lib-dynload + +@@ -528,7 +528,7 @@ + + # Build the interpreter + $(BUILDPYTHON): Modules/python.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY) +- $(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Modules/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) ++ $(LINKCC) $(PY_LDFLAGS) $(PY_CFLAGS) $(LINKFORSHARED) -o $@ Modules/python.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) + + platform: $(BUILDPYTHON) pybuilddir.txt + $(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import get_platform ; print(get_platform()+"-"+sys.version[0:3])' >platform --- python3.4-3.4~b1.orig/debian/patches/makesetup-bashism.diff +++ python3.4-3.4~b1/debian/patches/makesetup-bashism.diff @@ -0,0 +1,13 @@ +# DP: Fix bashism in makesetup shell script + +--- a/Modules/makesetup ++++ b/Modules/makesetup +@@ -281,7 +281,7 @@ + -) ;; + *) sedf="@sed.in.$$" + trap 'rm -f $sedf' 0 1 2 3 +- echo "1i\\" >$sedf ++ printf "1i\\" >$sedf + str="# Generated automatically from $makepre by makesetup." + echo "$str" >>$sedf + echo "s%_MODOBJS_%$OBJS%" >>$sedf --- python3.4-3.4~b1.orig/debian/patches/multiarch-extname.diff +++ python3.4-3.4~b1/debian/patches/multiarch-extname.diff @@ -0,0 +1,84 @@ +Index: b/Lib/distutils/dir_util.py +=================================================================== +--- a/Lib/distutils/dir_util.py ++++ b/Lib/distutils/dir_util.py +@@ -96,6 +96,9 @@ + for dir in sorted(need_dir): + mkpath(dir, mode, verbose=verbose, dry_run=dry_run) + ++import sysconfig ++_multiarch = None ++ + def copy_tree(src, dst, preserve_mode=1, preserve_times=1, + preserve_symlinks=0, update=0, verbose=1, dry_run=0): + """Copy an entire directory tree 'src' to a new location 'dst'. +@@ -132,6 +135,9 @@ + raise DistutilsFileError( + "error listing files in '%s': %s" % (src, errstr)) + ++ ext_suffix = sysconfig.get_config_var ('EXT_SUFFIX') ++ new_suffix = "%s-%s%s" % (ext_suffix[:-3], _multiarch, ext_suffix[-3:]) ++ + if not dry_run: + mkpath(dst, verbose=verbose) + +@@ -140,6 +146,9 @@ + for n in names: + src_name = os.path.join(src, n) + dst_name = os.path.join(dst, n) ++ if _multiarch and n.endswith(ext_suffix) and not n.endswith(new_suffix): ++ dst_name = os.path.join(dst, n.replace(ext_suffix, new_suffix)) ++ log.info("renaming extension %s -> %s", n, n.replace(ext_suffix, new_suffix)) + + if n.startswith('.nfs'): + # skip NFS rename files +Index: b/Lib/distutils/command/install_lib.py +=================================================================== +--- a/Lib/distutils/command/install_lib.py ++++ b/Lib/distutils/command/install_lib.py +@@ -56,6 +56,7 @@ + self.compile = None + self.optimize = None + self.skip_build = None ++ self.multiarch = None # if we should rename the extensions + + def finalize_options(self): + # Get all the information we need to install pure Python modules +@@ -68,6 +69,7 @@ + ('compile', 'compile'), + ('optimize', 'optimize'), + ('skip_build', 'skip_build'), ++ ('multiarch', 'multiarch'), + ) + + if self.compile is None: +@@ -108,6 +110,8 @@ + + def install(self): + if os.path.isdir(self.build_dir): ++ import distutils.dir_util ++ distutils.dir_util._multiarch = self.multiarch + outfiles = self.copy_tree(self.build_dir, self.install_dir) + else: + self.warn("'%s' does not exist -- no Python modules to install" % +Index: b/Lib/distutils/command/install.py +=================================================================== +--- a/Lib/distutils/command/install.py ++++ b/Lib/distutils/command/install.py +@@ -207,6 +207,7 @@ + + # enable custom installation, known values: deb + self.install_layout = None ++ self.multiarch = None + + self.compile = None + self.optimize = None +@@ -464,6 +465,8 @@ + self.install_platbase = self.exec_prefix + if self.install_layout: + if self.install_layout.lower() in ['deb']: ++ import sysconfig ++ self.multiarch = sysconfig.get_config_var('MULTIARCH') + self.select_scheme("deb_system") + elif self.install_layout.lower() in ['unix']: + self.select_scheme("unix_prefix") --- python3.4-3.4~b1.orig/debian/patches/multiarch.diff +++ python3.4-3.4~b1/debian/patches/multiarch.diff @@ -0,0 +1,162 @@ +Index: b/Lib/sysconfig.py +=================================================================== +--- a/Lib/sysconfig.py ++++ b/Lib/sysconfig.py +@@ -339,6 +339,8 @@ + config_dir_name = 'config-%s%s' % (_PY_VERSION_SHORT, sys.abiflags) + else: + config_dir_name = 'config' ++ if hasattr(sys.implementation, '_multiarch'): ++ config_dir_name += '-%s' % sys.implementation._multiarch + return os.path.join(get_path('stdlib'), config_dir_name, 'Makefile') + + def _generate_posix_vars(): +@@ -545,6 +547,12 @@ + # the init-function. + _CONFIG_VARS['userbase'] = _getuserbase() + ++ multiarch = get_config_var('MULTIARCH') ++ if multiarch: ++ _CONFIG_VARS['multiarchsubdir'] = '/' + multiarch ++ else: ++ _CONFIG_VARS['multiarchsubdir'] = '' ++ + # Always convert srcdir to an absolute path + srcdir = _CONFIG_VARS.get('srcdir', _PROJECT_BASE) + if os.name == 'posix': +Index: b/Lib/distutils/sysconfig.py +=================================================================== +--- a/Lib/distutils/sysconfig.py ++++ b/Lib/distutils/sysconfig.py +@@ -111,6 +111,9 @@ + incdir = os.path.join(get_config_var('srcdir'), 'Include') + return os.path.normpath(incdir) + python_dir = 'python' + get_python_version() + build_flags ++ if not python_build and plat_specific: ++ import sysconfig ++ return sysconfig.get_path('platinclude') + return os.path.join(prefix, "include", python_dir) + elif os.name == "nt": + return os.path.join(prefix, "include") +@@ -271,6 +274,8 @@ + return os.path.join(_sys_home or project_base, "Makefile") + lib_dir = get_python_lib(plat_specific=0, standard_lib=1) + config_file = 'config-{}{}'.format(get_python_version(), build_flags) ++ if hasattr(sys.implementation, '_multiarch'): ++ config_file += '-%s' % sys.implementation._multiarch + return os.path.join(lib_dir, config_file, 'Makefile') + + +Index: b/Makefile.pre.in +=================================================================== +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -716,6 +716,7 @@ + + Python/dynload_shlib.o: $(srcdir)/Python/dynload_shlib.c Makefile + $(CC) -c $(PY_CORE_CFLAGS) \ ++ $(if $(MULTIARCH),-DMULTIARCH='"$(MULTIARCH)"') \ + -DSOABI='"$(SOABI)"' \ + -o $@ $(srcdir)/Python/dynload_shlib.c + +@@ -727,6 +728,7 @@ + Python/sysmodule.o: $(srcdir)/Python/sysmodule.c Makefile + $(CC) -c $(PY_CORE_CFLAGS) \ + -DABIFLAGS='"$(ABIFLAGS)"' \ ++ -DMULTIARCH='"$(MULTIARCH)"' \ + -o $@ $(srcdir)/Python/sysmodule.c + + $(IO_OBJS): $(IO_H) +@@ -1108,7 +1110,7 @@ + (cd $(DESTDIR)$(MANDIR)/man1; $(LN) -s python$(VERSION).1 python3.1) + + # Install the library +-PLATDIR= plat-$(MACHDEP) ++PLATDIR= plat-$(MULTIARCH) + EXTRAPLATDIR= @EXTRAPLATDIR@ + MACHDEPS= $(PLATDIR) $(EXTRAPLATDIR) + XMLLIBSUBDIRS= xml xml/dom xml/etree xml/parsers xml/sax +@@ -1248,6 +1250,10 @@ + $(srcdir)/Lib/$(PLATDIR): + mkdir $(srcdir)/Lib/$(PLATDIR) + cp $(srcdir)/Lib/plat-generic/regen $(srcdir)/Lib/$(PLATDIR)/regen ++ if [ -n "$(MULTIARCH)" ]; then \ ++ cp -p $(srcdir)/Lib/plat-linux/*.py $(srcdir)/Lib/$(PLATDIR)/.; \ ++ rm -f $(srcdir)/Lib/$(PLATDIR)/IN.py; \ ++ fi + export PATH; PATH="`pwd`:$$PATH"; \ + export PYTHONPATH; PYTHONPATH="`pwd`/Lib"; \ + export DYLD_FRAMEWORK_PATH; DYLD_FRAMEWORK_PATH="`pwd`"; \ +@@ -1295,10 +1301,10 @@ + + # Install the library and miscellaneous stuff needed for extending/embedding + # This goes into $(exec_prefix) +-LIBPL= $(LIBDEST)/config-$(LDVERSION) ++LIBPL= $(LIBDEST)/config-$(LDVERSION)-$(MULTIARCH) + + # pkgconfig directory +-LIBPC= $(LIBDIR)/pkgconfig ++LIBPC= $(LIBDIR)/$(MULTIARCH)/pkgconfig + + libainstall: all python-config + @for i in $(LIBDIR) $(LIBPL) $(LIBPC); \ +Index: b/Python/dynload_shlib.c +=================================================================== +--- a/Python/dynload_shlib.c ++++ b/Python/dynload_shlib.c +@@ -36,6 +36,9 @@ + #ifdef __CYGWIN__ + ".dll", + #else /* !__CYGWIN__ */ ++#ifdef MULTIARCH ++ "." SOABI "-" MULTIARCH ".so", ++#endif + "." SOABI ".so", + ".abi" PYTHON_ABI_STRING ".so", + ".so", +Index: b/Modules/Setup.dist +=================================================================== +--- a/Modules/Setup.dist ++++ b/Modules/Setup.dist +@@ -91,7 +91,7 @@ + TESTPATH= + + # Path components for machine- or system-dependent modules and shared libraries +-MACHDEPPATH=:plat-$(MACHDEP) ++MACHDEPPATH=:plat-$(MULTIARCH) + EXTRAMACHDEPPATH= + + COREPYTHONPATH=$(DESTPATH)$(SITEPATH)$(TESTPATH)$(MACHDEPPATH)$(EXTRAMACHDEPPATH) +Index: b/Python/sysmodule.c +=================================================================== +--- a/Python/sysmodule.c ++++ b/Python/sysmodule.c +@@ -1596,6 +1596,15 @@ + if (res < 0) + goto error; + ++ /* For Debian multiarch support. */ ++ value = PyUnicode_FromString(MULTIARCH); ++ if (value == NULL) ++ goto error; ++ res = PyDict_SetItemString(impl_info, "_multiarch", value); ++ Py_DECREF(value); ++ if (res < 0) ++ goto error; ++ + /* dict ready */ + + ns = _PyNamespace_New(impl_info); +Index: b/configure.ac +=================================================================== +--- a/configure.ac ++++ b/configure.ac +@@ -4109,7 +4109,7 @@ + + dnl define LIBPL after ABIFLAGS and LDVERSION is defined. + AC_SUBST(PY_ENABLE_SHARED) +-LIBPL="${prefix}/lib/python${VERSION}/config-${LDVERSION}" ++LIBPL="${prefix}/lib/python${VERSION}/config-${LDVERSION}-${MULTIARCH}" + AC_SUBST(LIBPL) + + # Check whether right shifting a negative integer extends the sign bit --- python3.4-3.4~b1.orig/debian/patches/ncurses-configure.diff +++ python3.4-3.4~b1/debian/patches/ncurses-configure.diff @@ -0,0 +1,63 @@ +# DP: Fix ncurses configure checks + +Index: b/configure.ac +=================================================================== +--- a/configure.ac ++++ b/configure.ac +@@ -1533,11 +1533,9 @@ + + # checks for header files + AC_HEADER_STDC +-ac_save_cppflags="$CPPFLAGS" +-CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw" +-AC_CHECK_HEADERS(asm/types.h conio.h curses.h direct.h dlfcn.h errno.h \ ++AC_CHECK_HEADERS(asm/types.h conio.h direct.h dlfcn.h errno.h \ + fcntl.h grp.h \ +-ieeefp.h io.h langinfo.h libintl.h ncurses.h process.h pthread.h \ ++ieeefp.h io.h langinfo.h libintl.h process.h pthread.h \ + sched.h shadow.h signal.h stdint.h stropts.h termios.h \ + unistd.h utime.h \ + poll.h sys/devpoll.h sys/epoll.h sys/poll.h \ +@@ -1549,7 +1547,6 @@ + libutil.h sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \ + bluetooth/bluetooth.h linux/tipc.h spawn.h util.h alloca.h endian.h \ + sys/endian.h) +-CPPFLAGS=$ac_save_cppflags + AC_HEADER_DIRENT + AC_HEADER_MAJOR + +@@ -1569,14 +1566,6 @@ + #endif + ]) + +- +-# On Solaris, term.h requires curses.h +-AC_CHECK_HEADERS(term.h,,,[ +-#ifdef HAVE_CURSES_H +-#include +-#endif +-]) +- + # On Linux, netlink.h requires asm/types.h + AC_CHECK_HEADERS(linux/netlink.h,,,[ + #ifdef HAVE_ASM_TYPES_H +@@ -4388,8 +4377,19 @@ + [Define if you have struct stat.st_mtimensec]) + fi + ++# first curses header check + ac_save_cppflags="$CPPFLAGS" + CPPFLAGS="$CPPFLAGS -I/usr/include/ncursesw" ++ ++AC_CHECK_HEADERS(curses.h ncurses.h) ++ ++# On Solaris, term.h requires curses.h ++AC_CHECK_HEADERS(term.h,,,[ ++#ifdef HAVE_CURSES_H ++#include ++#endif ++]) ++ + # On HP/UX 11.0, mvwdelch is a block with a return statement + AC_MSG_CHECKING(whether mvwdelch is an expression) + AC_CACHE_VAL(ac_cv_mvwdelch_is_expression, --- python3.4-3.4~b1.orig/debian/patches/no-large-file-support.diff +++ python3.4-3.4~b1/debian/patches/no-large-file-support.diff @@ -0,0 +1,14 @@ +# DP: disable large file support for GNU/Hurd + +--- a/configure.ac ++++ b/configure.ac +@@ -1402,6 +1402,9 @@ + use_lfs=no + fi + ++# Don't use largefile support anyway. ++use_lfs=no ++ + if test "$use_lfs" = "yes"; then + # Two defines needed to enable largefile support on various platforms + # These may affect some typedefs --- python3.4-3.4~b1.orig/debian/patches/no-zip-on-sys.path.diff +++ python3.4-3.4~b1/debian/patches/no-zip-on-sys.path.diff @@ -0,0 +1,54 @@ +# DP: Do not add /usr/lib/pythonXY.zip on sys.path. + +Index: b/Modules/getpath.c +=================================================================== +--- a/Modules/getpath.c ++++ b/Modules/getpath.c +@@ -474,7 +474,9 @@ + wchar_t *path = NULL; + wchar_t *prog = Py_GetProgramName(); + wchar_t argv0_path[MAXPATHLEN+1]; ++#ifdef WITH_ZIP_PATH + wchar_t zip_path[MAXPATHLEN+1]; ++#endif + int pfound, efound; /* 1 if found; -1 if found build directory */ + wchar_t *buf; + size_t bufsz; +@@ -679,6 +681,7 @@ + else + reduce(prefix); + ++#ifdef WITH_ZIP_PATH + wcsncpy(zip_path, prefix, MAXPATHLEN); + zip_path[MAXPATHLEN] = L'\0'; + if (pfound > 0) { /* Use the reduced prefix returned by Py_GetPrefix() */ +@@ -691,6 +694,7 @@ + bufsz = wcslen(zip_path); /* Replace "00" with version */ + zip_path[bufsz - 6] = VERSION[0]; + zip_path[bufsz - 5] = VERSION[2]; ++#endif + + efound = search_for_exec_prefix(argv0_path, home, + _exec_prefix, lib_python); +@@ -736,7 +740,9 @@ + defpath = delim + 1; + } + ++#ifdef WITH_ZIP_PATH + bufsz += wcslen(zip_path) + 1; ++#endif + bufsz += wcslen(exec_prefix) + 1; + + buf = (wchar_t *)PyMem_Malloc(bufsz * sizeof(wchar_t)); +@@ -753,9 +759,11 @@ + else + buf[0] = '\0'; + ++#ifdef WITH_ZIP_PATH + /* Next is the default zip path */ + wcscat(buf, zip_path); + wcscat(buf, delimiter); ++#endif + + /* Next goes merge of compile-time $PYTHONPATH with + * dynamically located prefix. --- python3.4-3.4~b1.orig/debian/patches/platform-lsbrelease.diff +++ python3.4-3.4~b1/debian/patches/platform-lsbrelease.diff @@ -0,0 +1,52 @@ +# DP: Use /etc/lsb-release to identify the platform. + +Index: b/Lib/platform.py +=================================================================== +--- a/Lib/platform.py ++++ b/Lib/platform.py +@@ -261,7 +261,7 @@ + _supported_dists = ( + 'SuSE', 'debian', 'fedora', 'redhat', 'centos', + 'mandrake', 'mandriva', 'rocks', 'slackware', 'yellowdog', 'gentoo', +- 'UnitedLinux', 'turbolinux', 'arch', 'mageia') ++ 'UnitedLinux', 'turbolinux', 'arch', 'mageia', 'Ubuntu') + + def _parse_release_file(firstline): + +@@ -290,6 +290,10 @@ + id = l[1] + return '', version, id + ++_distributor_id_file_re = re.compile("(?:DISTRIB_ID\s*=)\s*(.*)", re.I) ++_release_file_re = re.compile("(?:DISTRIB_RELEASE\s*=)\s*(.*)", re.I) ++_codename_file_re = re.compile("(?:DISTRIB_CODENAME\s*=)\s*(.*)", re.I) ++ + def linux_distribution(distname='', version='', id='', + + supported_dists=_supported_dists, +@@ -314,6 +318,25 @@ + args given as parameters. + + """ ++ # check for the Debian/Ubuntu /etc/lsb-release file first, needed so ++ # that the distribution doesn't get identified as Debian. ++ try: ++ with open("/etc/lsb-release", "r") as etclsbrel: ++ for line in etclsbrel: ++ m = _distributor_id_file_re.search(line) ++ if m: ++ _u_distname = m.group(1).strip() ++ m = _release_file_re.search(line) ++ if m: ++ _u_version = m.group(1).strip() ++ m = _codename_file_re.search(line) ++ if m: ++ _u_id = m.group(1).strip() ++ if _u_distname and _u_version: ++ return (_u_distname, _u_version, _u_id) ++ except (EnvironmentError, UnboundLocalError): ++ pass ++ + try: + etc = os.listdir('/etc') + except OSError: --- python3.4-3.4~b1.orig/debian/patches/profiled-build.diff +++ python3.4-3.4~b1/debian/patches/profiled-build.diff @@ -0,0 +1,82 @@ +# DP: Ignore errors in the profile task. + +--- a/Makefile.pre.in ++++ b/Makefile.pre.in +@@ -463,7 +463,20 @@ + + run_profile_task: + : # FIXME: can't run for a cross build +- $(RUNSHARED) ./$(BUILDPYTHON) $(PROFILE_TASK) ++ task="$(PROFILE_TASK)"; \ ++ case "$$task" in \ ++ *--next=*) \ ++ maxruns=500; \ ++ batch=$$(echo $$task | sed -n 's/.*--next=\([^ ]*\) .*/\1/p'); \ ++ while [ $$maxruns -gt 0 ]; do \ ++ $(RUNSHARED) ./$(BUILDPYTHON) $$task; \ ++ maxruns=$$(expr $$maxruns - $$batch); \ ++ [ -f $(srcdir)/build/pynexttest ] && continue; \ ++ break; \ ++ done;; \ ++ *) \ ++ $(RUNSHARED) ./$(BUILDPYTHON) $$task; \ ++ esac + + build_all_use_profile: + $(MAKE) all CFLAGS="$(CFLAGS) -fprofile-use -fprofile-correction" +--- a/Lib/test/regrtest.py ++++ b/Lib/test/regrtest.py +@@ -255,7 +255,7 @@ + + + def main(tests=None, testdir=None, verbose=0, quiet=False, +- exclude=False, single=False, randomize=False, fromfile=None, ++ exclude=False, single=0, randomize=False, fromfile=None, + findleaks=False, use_resources=None, trace=False, coverdir='coverage', + runleaks=False, huntrleaks=False, verbose2=False, print_slow=False, + random_seed=None, use_mp=None, verbose3=False, forever=False, +@@ -306,7 +306,7 @@ + 'runleaks', 'huntrleaks=', 'memlimit=', 'randseed=', + 'multiprocess=', 'coverage', 'slaveargs=', 'forever', 'debug', + 'start=', 'nowindows', 'header', 'testdir=', 'timeout=', 'wait', +- 'failfast', 'match=']) ++ 'failfast', 'match=', 'next=']) + except getopt.error as msg: + usage(msg) + +@@ -340,7 +340,9 @@ + elif o in ('-S', '--start'): + start = a + elif o in ('-s', '--single'): +- single = True ++ single = 1 ++ elif o == '--next': ++ single = int(a) + elif o in ('-o', '--slow'): + print_slow = True + elif o in ('-r', '--randomize'): +@@ -535,7 +537,7 @@ + args = [] + + # For a partial run, we do not need to clutter the output. +- if verbose or header or not (quiet or single or tests or args): ++ if verbose or header or not (quiet or single != 1 or tests or args): + # Print basic platform information + print("==", platform.python_implementation(), *sys.version.split()) + print("== ", platform.platform(aliased=True), +@@ -552,9 +554,13 @@ + + selected = tests or args or alltests + if single: +- selected = selected[:1] ++ first_selected = selected[0] ++ index_selected = alltests.index(first_selected) ++ if index_selected + single > len(alltests): ++ single = len(alltests) - index_selected ++ selected = alltests[index_selected:index_selected+single] + try: +- next_single_test = alltests[alltests.index(selected[0])+1] ++ next_single_test = alltests[index_selected+single] + except IndexError: + next_single_test = None + # Remove all the selected tests that precede start if it's set. --- python3.4-3.4~b1.orig/debian/patches/revert-r83234.diff +++ python3.4-3.4~b1/debian/patches/revert-r83234.diff @@ -0,0 +1,227 @@ +--- a/Doc/conf.py ++++ b/Doc/conf.py +@@ -13,7 +13,7 @@ + # --------------------- + + extensions = ['sphinx.ext.refcounting', 'sphinx.ext.coverage', +- 'sphinx.ext.doctest', 'pyspecific'] ++ 'sphinx.ext.doctest'] + templates_path = ['tools/sphinxext'] + + # General substitutions. +--- a/Doc/tools/sphinxext/pyspecific.py ++++ b/Doc/tools/sphinxext/pyspecific.py +@@ -84,32 +84,6 @@ + return [pnode] + + +-# Support for documenting decorators +- +-from sphinx import addnodes +-from sphinx.domains.python import PyModulelevel, PyClassmember +- +-class PyDecoratorMixin(object): +- def handle_signature(self, sig, signode): +- ret = super(PyDecoratorMixin, self).handle_signature(sig, signode) +- signode.insert(0, addnodes.desc_addname('@', '@')) +- return ret +- +- def needs_arglist(self): +- return False +- +-class PyDecoratorFunction(PyDecoratorMixin, PyModulelevel): +- def run(self): +- # a decorator function is a function after all +- self.name = 'py:function' +- return PyModulelevel.run(self) +- +-class PyDecoratorMethod(PyDecoratorMixin, PyClassmember): +- def run(self): +- self.name = 'py:method' +- return PyClassmember.run(self) +- +- + # Support for documenting version of removal in deprecations + + from sphinx.locale import versionlabels +@@ -227,6 +201,7 @@ + # Support for documenting Opcodes + + import re ++from sphinx import addnodes + + opcode_sig_re = re.compile(r'(\w+(?:\+\d)?)(?:\s*\((.*)\))?') + +@@ -280,5 +255,3 @@ + app.add_description_unit('pdbcommand', 'pdbcmd', '%s (pdb command)', + parse_pdb_command) + app.add_description_unit('2to3fixer', '2to3fixer', '%s (2to3 fixer)') +- app.add_directive_to_domain('py', 'decorator', PyDecoratorFunction) +- app.add_directive_to_domain('py', 'decoratormethod', PyDecoratorMethod) +--- a/Doc/library/contextlib.rst ++++ b/Doc/library/contextlib.rst +@@ -15,7 +15,7 @@ + Functions provided: + + +-.. decorator:: contextmanager ++.. function:: contextmanager(func) + + This function is a :term:`decorator` that can be used to define a factory + function for :keyword:`with` statement context managers, without needing to +--- a/Doc/library/abc.rst ++++ b/Doc/library/abc.rst +@@ -126,7 +126,7 @@ + + It also provides the following decorators: + +-.. decorator:: abstractmethod(function) ++.. function:: abstractmethod(function) + + A decorator indicating abstract methods. + +--- a/Doc/library/unittest.rst ++++ b/Doc/library/unittest.rst +@@ -666,20 +666,20 @@ + + The following decorators implement test skipping and expected failures: + +-.. decorator:: skip(reason) ++.. function:: skip(reason) + + Unconditionally skip the decorated test. *reason* should describe why the + test is being skipped. + +-.. decorator:: skipIf(condition, reason) ++.. function:: skipIf(condition, reason) + + Skip the decorated test if *condition* is true. + +-.. decorator:: skipUnless(condition, reason) ++.. function:: skipUnless(condition, reason) + + Skip the decorated test unless *condition* is true. + +-.. decorator:: expectedFailure ++.. function:: expectedFailure + + Mark the test as an expected failure. If the test fails when run, the test + is not counted as a failure. +@@ -973,11 +973,11 @@ + :attr:`exception` attribute. This can be useful if the intention + is to perform additional checks on the exception raised:: + +- with self.assertRaises(SomeException) as cm: +- do_something() ++ with self.assertRaises(SomeException) as cm: ++ do_something() + +- the_exception = cm.exception +- self.assertEqual(the_exception.error_code, 3) ++ the_exception = cm.exception ++ self.assertEqual(the_exception.error_code, 3) + + .. versionchanged:: 3.1 + Added the ability to use :meth:`assertRaises` as a context manager. +--- a/Doc/library/importlib.rst ++++ b/Doc/library/importlib.rst +@@ -469,7 +469,7 @@ + This module contains the various objects that help in the construction of + an :term:`importer`. + +-.. decorator:: module_for_loader ++.. function:: module_for_loader(method) + + A :term:`decorator` for a :term:`loader` method, + to handle selecting the proper +@@ -494,7 +494,7 @@ + Use of this decorator handles all the details of which module object a + loader should initialize as specified by :pep:`302`. + +-.. decorator:: set_loader ++.. function:: set_loader(fxn) + + A :term:`decorator` for a :term:`loader` method, + to set the :attr:`__loader__` +@@ -502,7 +502,7 @@ + does nothing. It is assumed that the first positional argument to the + wrapped method is what :attr:`__loader__` should be set to. + +-.. decorator:: set_package ++.. function:: set_package(fxn) + + A :term:`decorator` for a :term:`loader` to set the :attr:`__package__` + attribute on the module returned by the loader. If :attr:`__package__` is +--- a/Doc/library/functools.rst ++++ b/Doc/library/functools.rst +@@ -111,7 +111,7 @@ + + .. versionadded:: 3.2 + +-.. decorator:: total_ordering ++.. function:: total_ordering(cls) + + Given a class defining one or more rich comparison ordering methods, this + class decorator supplies the rest. This simplifies the effort involved +@@ -217,7 +217,7 @@ + Missing attributes no longer trigger an :exc:`AttributeError`. + + +-.. decorator:: wraps(wrapped, assigned=WRAPPER_ASSIGNMENTS, updated=WRAPPER_UPDATES) ++.. function:: wraps(wrapped, assigned=WRAPPER_ASSIGNMENTS, updated=WRAPPER_UPDATES) + + This is a convenience function for invoking ``partial(update_wrapper, + wrapped=wrapped, assigned=assigned, updated=updated)`` as a function decorator +--- a/Doc/documenting/markup.rst ++++ b/Doc/documenting/markup.rst +@@ -177,37 +177,6 @@ + are modified), side effects, and possible exceptions. A small example may be + provided. + +-.. describe:: decorator +- +- Describes a decorator function. The signature should *not* represent the +- signature of the actual function, but the usage as a decorator. For example, +- given the functions +- +- .. code-block:: python +- +- def removename(func): +- func.__name__ = '' +- return func +- +- def setnewname(name): +- def decorator(func): +- func.__name__ = name +- return func +- return decorator +- +- the descriptions should look like this:: +- +- .. decorator:: removename +- +- Remove name of the decorated function. +- +- .. decorator:: setnewname(name) +- +- Set name of the decorated function to *name*. +- +- There is no ``deco`` role to link to a decorator that is marked up with +- this directive; rather, use the ``:func:`` role. +- + .. describe:: class + + Describes a class. The signature can include parentheses with parameters +@@ -225,12 +194,6 @@ + parameter. The description should include similar information to that + described for ``function``. + +-.. describe:: decoratormethod +- +- Same as ``decorator``, but for decorators that are methods. +- +- Refer to a decorator method using the ``:meth:`` role. +- + .. describe:: opcode + + Describes a Python :term:`bytecode` instruction. --- python3.4-3.4~b1.orig/debian/patches/revert-r83274.diff +++ python3.4-3.4~b1/debian/patches/revert-r83274.diff @@ -0,0 +1,12 @@ +--- a/Doc/conf.py ++++ b/Doc/conf.py +@@ -65,9 +65,6 @@ + # Options for HTML output + # ----------------------- + +-html_theme = 'default' +-html_theme_options = {'collapsiblesidebar': True} +- + # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, + # using the given strftime format. + html_last_updated_fmt = '%b %d, %Y' --- python3.4-3.4~b1.orig/debian/patches/series.in +++ python3.4-3.4~b1/debian/patches/series.in @@ -0,0 +1,55 @@ +hg-updates.diff +deb-setup.diff +deb-locations.diff +site-locations.diff +distutils-install-layout.diff +locale-module.diff +distutils-link.diff +distutils-sysconfig.diff +tkinter-import.diff +gdbm-import.diff +link-opt.diff +linecache.diff +setup-modules.diff +platform-lsbrelease.diff +bdist-wininst-notfound.diff +no-zip-on-sys.path.diff +doc-nodownload.diff +#profiled-build.diff FIXME for 3.4 +makesetup-bashism.diff +hurd-disable-nonworking-constants.diff +enable-fpectl.diff +statvfs-f_flag-constants.diff +#if defined (BROKEN_UTIMES) +disable-utimes.diff +#endif +#if defined (Ubuntu) +langpack-gettext.diff +#endif +#if defined (arch_os_hurd) +no-large-file-support.diff +#endif +hurd-path_max.diff +#ifdef OLD_SPHINX +doc-build.diff +revert-r83234.diff +revert-r83274.diff +#endif +#link-system-expat.diff +disable-sem-check.diff +lib-argparse.diff +ctypes-arm.diff +link-timemodule.diff +lto-link-flags.diff +libffi-shared.diff +avoid-rpath.diff +multiarch.diff +ncurses-configure.diff +distutils-init.diff +lib2to3-no-pickled-grammar.diff +ext-no-libpython-link.diff +kfreebsd-xattrs.diff +installed-testsuite.diff +test-no-random-order.diff +kfreebsd-testsuite.diff +multiarch-extname.diff --- python3.4-3.4~b1.orig/debian/patches/setup-modules.diff +++ python3.4-3.4~b1/debian/patches/setup-modules.diff @@ -0,0 +1,52 @@ +# DP: Modules/Setup.dist: patches to build some extensions statically + +Index: b/Modules/Setup.dist +=================================================================== +--- a/Modules/Setup.dist ++++ b/Modules/Setup.dist +@@ -175,7 +175,7 @@ + #_weakref _weakref.c # basic weak reference support + #_testcapi _testcapimodule.c # Python C API test module + #_random _randommodule.c # Random number generator +-#_elementtree -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI _elementtree.c # elementtree accelerator ++#_elementtree _elementtree.c -lexpat # elementtree accelerator + #_pickle _pickle.c # pickle accelerator + #_datetime _datetimemodule.c # datetime accelerator + #_bisect _bisectmodule.c # Bisection algorithms +@@ -204,10 +204,7 @@ + + # Socket module helper for SSL support; you must comment out the other + # socket line above, and possibly edit the SSL variable: +-#SSL=/usr/local/ssl +-#_ssl _ssl.c \ +-# -DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \ +-# -L$(SSL)/lib -lssl -lcrypto ++#_ssl _ssl.c -lssl -lcrypto + + # The crypt module is now disabled by default because it breaks builds + # on many systems (where -lcrypt is needed), e.g. Linux (I believe). +@@ -249,6 +246,7 @@ + #_sha256 sha256module.c + #_sha512 sha512module.c + ++#_hashlib _hashopenssl.c -lssl -lcrypto + + # The _tkinter module. + # +@@ -337,6 +335,7 @@ + # Fred Drake's interface to the Python parser + #parser parsermodule.c + ++#_ctypes _ctypes/_ctypes.c _ctypes/callbacks.c _ctypes/callproc.c _ctypes/stgdict.c _ctypes/cfield.c _ctypes/malloc_closure.c -lffi + + # Lee Busby's SIGFPE modules. + # The library to link fpectl with is platform specific. +@@ -371,7 +370,7 @@ + # + # More information on Expat can be found at www.libexpat.org. + # +-#pyexpat expat/xmlparse.c expat/xmlrole.c expat/xmltok.c pyexpat.c -I$(srcdir)/Modules/expat -DHAVE_EXPAT_CONFIG_H -DUSE_PYEXPAT_CAPI ++#pyexpat pyexpat.c -lexpat + + # Hye-Shik Chang's CJKCodecs + --- python3.4-3.4~b1.orig/debian/patches/site-locations.diff +++ python3.4-3.4~b1/debian/patches/site-locations.diff @@ -0,0 +1,51 @@ +# DP: Set site-packages/dist-packages + +Index: b/Lib/site.py +=================================================================== +--- a/Lib/site.py ++++ b/Lib/site.py +@@ -7,12 +7,18 @@ + This will append site-specific paths to the module search path. On + Unix (including Mac OSX), it starts with sys.prefix and + sys.exec_prefix (if different) and appends +-lib/python/site-packages as well as lib/site-python. ++lib/python3/dist-packages as well as lib/site-python. + On other platforms (such as Windows), it tries each of the + prefixes directly, as well as with lib/site-packages appended. The + resulting directories, if they exist, are appended to sys.path, and + also inspected for path configuration files. + ++For Debian and derivatives, this sys.path is augmented with directories ++for packages distributed within the distribution. Local addons go ++into /usr/local/lib/python/dist-packages, Debian addons ++install into /usr/lib/python3/dist-packages. ++/usr/lib/python/site-packages is not used. ++ + If a file named "pyvenv.cfg" exists one directory above sys.executable, + sys.prefix and sys.exec_prefix are set to that directory and + it is also checked for site-packages and site-python (sys.base_prefix and +@@ -304,10 +310,21 @@ + seen.add(prefix) + + if os.sep == '/': ++ if 'VIRTUAL_ENV' in os.environ: ++ sitepackages.append(os.path.join(prefix, "lib", ++ "python" + sys.version[:3], ++ "site-packages")) ++ sitepackages.append(os.path.join(prefix, "local/lib", ++ "python" + sys.version[:3], ++ "dist-packages")) ++ sitepackages.append(os.path.join(prefix, "lib", ++ "python3", ++ "dist-packages")) ++ # this one is deprecated for Debian + sitepackages.append(os.path.join(prefix, "lib", +- "python" + sys.version[:3], +- "site-packages")) +- sitepackages.append(os.path.join(prefix, "lib", "site-python")) ++ "python" + sys.version[:3], ++ "dist-packages")) ++ sitepackages.append(os.path.join(prefix, "lib", "dist-python")) + else: + sitepackages.append(prefix) + sitepackages.append(os.path.join(prefix, "lib", "site-packages")) --- python3.4-3.4~b1.orig/debian/patches/statvfs-f_flag-constants.diff +++ python3.4-3.4~b1/debian/patches/statvfs-f_flag-constants.diff @@ -0,0 +1,57 @@ +# DP: Modules/posixmodule.c: Add flags for statvfs.f_flag to constant list. + +From: Peter Jones +Date: Wed, 6 Jan 2010 15:22:38 -0500 +Subject: [PATCH] Add flags for statvfs.f_flag to constant list. + + Modules/posixmodule.c | 37 +++++++++++++++++++++++++++++++++++++ + 1 files changed, 37 insertions(+), 0 deletions(-) + +Index: b/Modules/posixmodule.c +=================================================================== +--- a/Modules/posixmodule.c ++++ b/Modules/posixmodule.c +@@ -11924,6 +11924,43 @@ + if (PyModule_AddIntMacro(m, F_TEST)) return -1; + #endif + ++ /* These came from statvfs.h */ ++#ifdef ST_RDONLY ++ if (PyModule_AddIntMacro(m, ST_RDONLY)) return -1; ++#endif /* ST_RDONLY */ ++#ifdef ST_NOSUID ++ if (PyModule_AddIntMacro(m, ST_NOSUID)) return -1; ++#endif /* ST_NOSUID */ ++ ++ /* GNU extensions */ ++#ifdef ST_NODEV ++ if (PyModule_AddIntMacro(m, ST_NODEV)) return -1; ++#endif /* ST_NODEV */ ++#ifdef ST_NOEXEC ++ if (PyModule_AddIntMacro(m, ST_NOEXEC)) return -1; ++#endif /* ST_NOEXEC */ ++#ifdef ST_SYNCHRONOUS ++ if (PyModule_AddIntMacro(m, ST_SYNCHRONOUS)) return -1; ++#endif /* ST_SYNCHRONOUS */ ++#ifdef ST_MANDLOCK ++ if (PyModule_AddIntMacro(m, ST_MANDLOCK)) return -1; ++#endif /* ST_MANDLOCK */ ++#ifdef ST_WRITE ++ if (PyModule_AddIntMacro(m, ST_WRITE)) return -1; ++#endif /* ST_WRITE */ ++#ifdef ST_APPEND ++ if (PyModule_AddIntMacro(m, ST_APPEND)) return -1; ++#endif /* ST_APPEND */ ++#ifdef ST_NOATIME ++ if (PyModule_AddIntMacro(m, ST_NOATIME)) return -1; ++#endif /* ST_NOATIME */ ++#ifdef ST_NODIRATIME ++ if (PyModule_AddIntMacro(m, ST_NODIRATIME)) return -1; ++#endif /* ST_NODIRATIME */ ++#ifdef ST_RELATIME ++ if (PyModule_AddIntMacro(m, ST_RELATIME)) return -1; ++#endif /* ST_RELATIME */ ++ + #ifdef HAVE_SPAWNV + if (PyModule_AddIntConstant(m, "P_WAIT", _P_WAIT)) return -1; + if (PyModule_AddIntConstant(m, "P_NOWAIT", _P_NOWAIT)) return -1; --- python3.4-3.4~b1.orig/debian/patches/sysconfig-debian-schemes.diff +++ python3.4-3.4~b1/debian/patches/sysconfig-debian-schemes.diff @@ -0,0 +1,67 @@ +# DP: Add schemes 'deb_system' and 'posix_local', make the latter the default + +--- a/Lib/sysconfig.py ++++ b/Lib/sysconfig.py +@@ -32,6 +32,30 @@ + 'scripts': '{base}/bin', + 'data': '{base}', + }, ++ 'deb_system': { ++ 'stdlib': '{installed_base}/lib/python{py_version_short}', ++ 'platstdlib': '{platbase}/lib/python{py_version_short}', ++ 'purelib': '{base}/lib/python3/dist-packages', ++ 'platlib': '{platbase}/lib/python3/dist-packages', ++ 'include': ++ '{installed_base}/include/python{py_version_short}{abiflags}', ++ 'platinclude': ++ '{installed_platbase}/include/python{py_version_short}{abiflags}', ++ 'scripts': '{base}/bin', ++ 'data': '{base}', ++ }, ++ 'posix_local': { ++ 'stdlib': '{installed_base}/lib/python{py_version_short}', ++ 'platstdlib': '{platbase}/lib/python{py_version_short}', ++ 'purelib': '{base}/local/lib/python{py_version_short}/dist-packages', ++ 'platlib': '{platbase}/local/lib/python{py_version_short}/dist-packages', ++ 'include': ++ '{installed_base}/local/include/python{py_version_short}{abiflags}', ++ 'platinclude': ++ '{installed_platbase}/local/include/python{py_version_short}{abiflags}', ++ 'scripts': '{base}/local/bin', ++ 'data': '{base}', ++ }, + 'posix_home': { + 'stdlib': '{installed_base}/lib/python', + 'platstdlib': '{base}/lib/python', +@@ -162,7 +186,7 @@ + _PYTHON_BUILD = is_python_build(True) + + if _PYTHON_BUILD: +- for scheme in ('posix_prefix', 'posix_home'): ++ for scheme in ('posix_prefix', 'posix_home', 'posix_local', 'deb_system'): + _INSTALL_SCHEMES[scheme]['include'] = '{srcdir}/Include' + _INSTALL_SCHEMES[scheme]['platinclude'] = '{projectbase}/.' + +@@ -200,7 +224,12 @@ + def _get_default_scheme(): + if os.name == 'posix': + # the default scheme for posix is posix_prefix +- return 'posix_prefix' ++ if 'real_prefix' in sys.__dict__ or 'VIRTUAL_ENV' in os.environ: ++ # virtual environments ++ return 'posix_prefix' ++ else: ++ # Debian default ++ return 'posix_local' + return os.name + + +@@ -485,7 +514,7 @@ + else: + inc_dir = _sys_home or _PROJECT_BASE + else: +- inc_dir = get_path('platinclude') ++ inc_dir = get_path('platinclude', 'posix_prefix') + return os.path.join(inc_dir, 'pyconfig.h') + + --- python3.4-3.4~b1.orig/debian/patches/sysconfigdata.diff +++ python3.4-3.4~b1/debian/patches/sysconfigdata.diff @@ -0,0 +1,76 @@ +# DP: Issue #15298: Generate _sysconfigdata.py in the build dir, not the source dir. + +diff -r 2ecdda96f970 Lib/sysconfig.py +--- a/Lib/sysconfig.py Tue Jul 10 18:27:54 2012 +0200 ++++ b/Lib/sysconfig.py Tue Jul 10 22:06:43 2012 +0200 +@@ -390,7 +390,7 @@ + if _PYTHON_BUILD: + vars['LDSHARED'] = vars['BLDSHARED'] + +- destfile = os.path.join(os.path.dirname(__file__), '_sysconfigdata.py') ++ destfile = '_sysconfigdata.py' + with open(destfile, 'w', encoding='utf8') as f: + f.write('# system configuration generated and used by' + ' the sysconfig module\n') +diff -r 2ecdda96f970 Makefile.pre.in +--- a/Makefile.pre.in Tue Jul 10 18:27:54 2012 +0200 ++++ b/Makefile.pre.in Tue Jul 10 22:06:43 2012 +0200 +@@ -410,7 +410,7 @@ + Objects/unicodectype.o \ + Objects/weakrefobject.o + +-SYSCONFIGDATA=$(srcdir)/Lib/_sysconfigdata.py ++SYSCONFIGDATA=_sysconfigdata.py + + ########################################################################## + # objects that get linked into the Python library +@@ -472,6 +472,9 @@ + # Generate the sysconfig build-time data + $(SYSCONFIGDATA): $(BUILDPYTHON) + $(RUNSHARED) $(PYTHON_FOR_BUILD) -S -m sysconfig --generate-posix-vars ++ $(RUNSHARED) $(PYTHON_FOR_BUILD) -S -c 'import os,sys ; from distutils.util import get_platform ; d=os.path.join("build", "lib."+get_platform()+"-"+sys.version[0:3]+("-pydebug" if hasattr(sys, "gettotalrefcount") else "")); print(d, end="")' > pybuilddir.txt ++ mkdir -p `cat pybuilddir.txt` ++ cp $(SYSCONFIGDATA) `cat pybuilddir.txt`/. + + # Build the shared modules + sharedmods: $(BUILDPYTHON) $(SYSCONFIGDATA) +@@ -1036,7 +1039,7 @@ + else true; \ + fi; \ + done +- @for i in $(srcdir)/Lib/*.py ; \ ++ @for i in $(srcdir)/Lib/*.py $(SYSCONFIGDATA); \ + do \ + if test -x $$i; then \ + $(INSTALL_SCRIPT) $$i $(DESTDIR)$(LIBDEST); \ +diff -r 2ecdda96f970 setup.py +--- a/setup.py Tue Jul 10 18:27:54 2012 +0200 ++++ b/setup.py Tue Jul 10 22:06:43 2012 +0200 +@@ -33,10 +33,6 @@ + # This global variable is used to hold the list of modules to be disabled. + disabled_module_list = [] + +-# File which contains the directory for shared mods (for sys.path fixup +-# when running from the build dir, see Modules/getpath.c) +-_BUILDDIR_COOKIE = "pybuilddir.txt" +- + def add_dir_to_list(dirlist, dir): + """Add the directory 'dir' to the list 'dirlist' (after any relative + directories) if: +@@ -250,12 +246,9 @@ + args['compiler_so'] = compiler + ' ' + ccshared + ' ' + cflags + self.compiler.set_executables(**args) + +- # Not only do we write the builddir cookie, but we manually install +- # the shared modules directory if it isn't already in sys.path. +- # Otherwise trying to import the extensions after building them +- # will fail. +- with open(_BUILDDIR_COOKIE, "wb") as f: +- f.write(self.build_lib.encode('utf-8', 'surrogateescape')) ++ # We manually install the shared modules directory if it isn't ++ # already in sys.path. Otherwise trying to import the ++ # extensions after building them will fail. + abs_build_lib = os.path.join(os.getcwd(), self.build_lib) + if abs_build_lib not in sys.path: + sys.path.append(abs_build_lib) + --- python3.4-3.4~b1.orig/debian/patches/test-no-random-order.diff +++ python3.4-3.4~b1/debian/patches/test-no-random-order.diff @@ -0,0 +1,12 @@ +# DP: Don't run the test suite in random order. + +--- a/Tools/scripts/run_tests.py ++++ b/Tools/scripts/run_tests.py +@@ -33,7 +33,6 @@ + # Allow user-specified interpreter options to override our defaults. + args.extend(test.support.args_from_interpreter_flags()) + args.extend(['-m', 'test', # Run the test suite +- '-r', # Randomize test order + '-w', # Re-run failed tests in verbose mode + ]) + if sys.platform == 'win32': --- python3.4-3.4~b1.orig/debian/patches/tkinter-import.diff +++ python3.4-3.4~b1/debian/patches/tkinter-import.diff @@ -0,0 +1,16 @@ +# DP: suggest installation of python-tk package on failing _tkinter import + +--- a/Lib/tkinter/__init__.py ++++ b/Lib/tkinter/__init__.py +@@ -37,7 +37,10 @@ + + import warnings + +-import _tkinter # If this fails your Python may not be configured for Tk ++try: ++ import _tkinter ++except ImportError as msg: ++ raise ImportError(str(msg) + ', please install the python3-tk package') + TclError = _tkinter.TclError + from tkinter.constants import * + import re --- python3.4-3.4~b1.orig/debian/pdb.1.in +++ python3.4-3.4~b1/debian/pdb.1.in @@ -0,0 +1,16 @@ +.TH PDB@VER@ 1 +.SH NAME +pdb@VER@ \- the Python debugger +.SH SYNOPSIS +.PP +.B pdb@VER@ +.I script [...] +.SH DESCRIPTION +.PP +See /usr/lib/python@VER@/pdb.doc for more information on the use +of pdb. When the debugger is started, help is available via the +help command. +.SH SEE ALSO +python@VER@(1). Chapter 9 of the Python Library Reference +(The Python Debugger). Available in the python@VER@-doc package at +/usr/share/doc/python@VER@/html/lib/module-pdb.html. --- python3.4-3.4~b1.orig/debian/pydoc.1.in +++ python3.4-3.4~b1/debian/pydoc.1.in @@ -0,0 +1,53 @@ +.TH PYDOC@VER@ 1 +.SH NAME +pydoc@VER@ \- the Python documentation tool +.SH SYNOPSIS +.PP +.B pydoc@VER@ +.I name +.PP +.B pydoc@VER@ -k +.I keyword +.PP +.B pydoc@VER@ -p +.I port +.PP +.B pydoc@VER@ -g +.PP +.B pydoc@VER@ -w +.I module [...] +.SH DESCRIPTION +.PP +.B pydoc@VER@ +.I name +Show text documentation on something. +.I name +may be the name of a +Python keyword, topic, function, module, or package, or a dotted +reference to a class or function within a module or module in a +package. If +.I name +contains a '/', it is used as the path to a +Python source file to document. If name is 'keywords', 'topics', +or 'modules', a listing of these things is displayed. +.PP +.B pydoc@VER@ -k +.I keyword +Search for a keyword in the synopsis lines of all available modules. +.PP +.B pydoc@VER@ -p +.I port +Start an HTTP server on the given port on the local machine. +.PP +.B pydoc@VER@ -g +Pop up a graphical interface for finding and serving documentation. +.PP +.B pydoc@VER@ -w +.I name [...] +Write out the HTML documentation for a module to a file in the current +directory. If +.I name +contains a '/', it is treated as a filename; if +it names a directory, documentation is written for all the contents. +.SH AUTHOR +Moshe Zadka, based on "pydoc --help" --- python3.4-3.4~b1.orig/debian/pygettext.1 +++ python3.4-3.4~b1/debian/pygettext.1 @@ -0,0 +1,108 @@ +.TH PYGETTEXT 1 "" "pygettext 1.4" +.SH NAME +pygettext \- Python equivalent of xgettext(1) +.SH SYNOPSIS +.B pygettext +[\fIOPTIONS\fR] \fIINPUTFILE \fR... +.SH DESCRIPTION +pygettext is deprecated. The current version of xgettext supports +many languages, including Python. + +pygettext uses Python's standard tokenize module to scan Python +source code, generating .pot files identical to what GNU xgettext generates +for C and C++ code. From there, the standard GNU tools can be used. +.PP +pygettext searches only for _() by default, even though GNU xgettext +recognizes the following keywords: gettext, dgettext, dcgettext, +and gettext_noop. See the \fB\-k\fR/\fB\--keyword\fR flag below for how to +augment this. +.PP +.SH OPTIONS +.TP +\fB\-a\fR, \fB\-\-extract\-all\fR +Extract all strings. +.TP +\fB\-d\fR, \fB\-\-default\-domain\fR=\fINAME\fR +Rename the default output file from messages.pot to name.pot. +.TP +\fB\-E\fR, \fB\-\-escape\fR +Replace non-ASCII characters with octal escape sequences. +.TP +\fB\-D\fR, \fB\-\-docstrings\fR +Extract module, class, method, and function docstrings. +These do not need to be wrapped in _() markers, and in fact cannot +be for Python to consider them docstrings. (See also the \fB\-X\fR option). +.TP +\fB\-h\fR, \fB\-\-help\fR +Print this help message and exit. +.TP +\fB\-k\fR, \fB\-\-keyword\fR=\fIWORD\fR +Keywords to look for in addition to the default set, which are: _ +.IP +You can have multiple \fB\-k\fR flags on the command line. +.TP +\fB\-K\fR, \fB\-\-no\-default\-keywords\fR +Disable the default set of keywords (see above). +Any keywords explicitly added with the \fB\-k\fR/\fB\--keyword\fR option +are still recognized. +.TP +\fB\-\-no\-location\fR +Do not write filename/lineno location comments. +.TP +\fB\-n\fR, \fB\-\-add\-location\fR +Write filename/lineno location comments indicating where each +extracted string is found in the source. These lines appear before +each msgid. The style of comments is controlled by the +\fB\-S\fR/\fB\--style\fR option. This is the default. +.TP +\fB\-o\fR, \fB\-\-output\fR=\fIFILENAME\fR +Rename the default output file from messages.pot to FILENAME. +If FILENAME is `-' then the output is sent to standard out. +.TP +\fB\-p\fR, \fB\-\-output\-dir\fR=\fIDIR\fR +Output files will be placed in directory DIR. +.TP +\fB\-S\fR, \fB\-\-style\fR=\fISTYLENAME\fR +Specify which style to use for location comments. +Two styles are supported: +.RS +.IP \(bu 4 +Solaris # File: filename, line: line-number +.IP \(bu 4 +GNU #: filename:line +.RE +.IP +The style name is case insensitive. +GNU style is the default. +.TP +\fB\-v\fR, \fB\-\-verbose\fR +Print the names of the files being processed. +.TP +\fB\-V\fR, \fB\-\-version\fR +Print the version of pygettext and exit. +.TP +\fB\-w\fR, \fB\-\-width\fR=\fICOLUMNS\fR +Set width of output to columns. +.TP +\fB\-x\fR, \fB\-\-exclude\-file\fR=\fIFILENAME\fR +Specify a file that contains a list of strings that are not be +extracted from the input files. Each string to be excluded must +appear on a line by itself in the file. +.TP +\fB\-X\fR, \fB\-\-no\-docstrings\fR=\fIFILENAME\fR +Specify a file that contains a list of files (one per line) that +should not have their docstrings extracted. This is only useful in +conjunction with the \fB\-D\fR option above. +.PP +If `INPUTFILE' is -, standard input is read. +.SH BUGS +pygettext attempts to be option and feature compatible with GNU xgettext +where ever possible. However some options are still missing or are not fully +implemented. Also, xgettext's use of command line switches with option +arguments is broken, and in these cases, pygettext just defines additional +switches. +.SH AUTHOR +pygettext is written by Barry Warsaw . +.PP +Joonas Paalasmaa put this manual page together +based on "pygettext --help". --- python3.4-3.4~b1.orig/debian/pyhtml2devhelp.py +++ python3.4-3.4~b1/debian/pyhtml2devhelp.py @@ -0,0 +1,273 @@ +#! /usr/bin/python3 + +from html.parser import HTMLParser +import formatter +import os, sys, re + +class PyHTMLParser(HTMLParser): + pages_to_include = set(('whatsnew/index.html', 'tutorial/index.html', 'using/index.html', + 'reference/index.html', 'library/index.html', 'howto/index.html', + 'extending/index.html', 'c-api/index.html', 'install/index.html', + 'distutils/index.html')) + + def __init__(self, formatter, basedir, fn, indent, parents=set()): + HTMLParser.__init__(self, formatter) + self.basedir = basedir + self.dir, self.fn = os.path.split(fn) + self.data = '' + self.parents = parents + self.link = {} + self.indent = indent + self.last_indent = indent - 1 + self.sub_indent = 0 + self.sub_count = 0 + self.next_link = False + + def process_link(self): + new_href = os.path.join(self.dir, self.link['href']) + text = self.link['text'] + indent = self.indent + self.sub_indent + if self.last_indent == indent: + print('%s' % (' ' * self.last_indent)) + self.sub_count -= 1 + print('%s' % (' ' * indent, new_href, text)) + self.sub_count += 1 + self.last_indent = self.indent + self.sub_indent + + def handle_starttag(self, tag, attrs): + if tag == 'a': + self.start_a(attrs) + elif tag == 'li': + self.start_li(attrs) + + def handle_endtag(self, tag): + if tag == 'a': + self.end_a() + elif tag == 'li': + self.end_li() + + def start_li(self, attrs): + self.sub_indent += 1 + self.next_link = True + + def end_li(self): + indent = self.indent + self.sub_indent + if self.sub_count > 0: + print('%s' % (' ' * self.last_indent)) + self.sub_count -= 1 + self.last_indent -= 1 + self.sub_indent -= 1 + + def start_a(self, attrs): + self.link = {} + for attr in attrs: + self.link[attr[0]] = attr[1] + self.data = '' + + def end_a(self): + process = False + text = self.data.replace('\t', '').replace('\n', ' ').replace('&', '&').replace('<', '<').replace('>', '>') + self.link['text'] = text + # handle a tag without href attribute + try: + href = self.link['href'] + except KeyError: + return + + abs_href = os.path.join(self.basedir, href) + if abs_href in self.parents: + return + if href.startswith('..') or href.startswith('http:') \ + or href.startswith('mailto:') or href.startswith('news:'): + return + if href in ('', 'about.html', 'modindex.html', 'genindex.html', 'glossary.html', + 'search.html', 'contents.html', 'download.html', 'bugs.html', + 'license.html', 'copyright.html'): + return + + if 'class' in self.link: + if self.link['class'] in ('biglink'): + process = True + if self.link['class'] in ('reference external'): + if self.next_link: + process = True + next_link = False + + if process == True: + self.process_link() + if href in self.pages_to_include: + self.parse_file(os.path.join(self.dir, href)) + + def finish(self): + if self.sub_count > 0: + print('%s' % (' ' * self.last_indent)) + + def handle_data(self, data): + self.data += data + + def parse_file(self, href): + # TODO basedir bestimmen + parent = os.path.join(self.basedir, self.fn) + self.parents.add(parent) + parser = PyHTMLParser(formatter.NullFormatter(), + self.basedir, href, self.indent + 1, + self.parents) + text = open(self.basedir + '/' + href, encoding='latin_1').read() + parser.feed(text) + parser.finish() + parser.close() + if parent in self.parents: + self.parents.remove(parent) + +class PyIdxHTMLParser(HTMLParser): + def __init__(self, formatter, basedir, fn, indent): + HTMLParser.__init__(self, formatter) + self.basedir = basedir + self.dir, self.fn = os.path.split(fn) + self.data = '' + self.link = {} + self.indent = indent + self.active = False + self.indented = False + self.nolink = False + self.header = '' + self.last_letter = 'Z' + self.last_text = '' + + def process_link(self): + new_href = os.path.join(self.dir, self.link['href']) + text = self.link['text'] + if not self.active: + return + if text.startswith('['): + return + if self.link.get('rel', None) in ('prev', 'parent', 'next', 'contents', 'index'): + return + if self.indented: + text = self.last_text + ' ' + text + else: + # Save it in case we need it again + self.last_text = re.sub(' \([\w\-\.\s]+\)', '', text) + indent = self.indent + print('%s' % (' ' * indent, new_href, text)) + + def handle_starttag(self, tag, attrs): + if tag == 'a': + self.start_a(attrs) + elif tag == 'dl': + self.start_dl(attrs) + elif tag == 'dt': + self.start_dt(attrs) + elif tag == 'h2': + self.start_h2(attrs) + elif tag == 'td': + self.start_td(attrs) + elif tag == 'table': + self.start_table(attrs) + + def handle_endtag(self, tag): + if tag == 'a': + self.end_a() + elif tag == 'dl': + self.end_dl() + elif tag == 'dt': + self.end_dt() + elif tag == 'h2': + self.end_h2() + elif tag == 'td': + self.end_td() + elif tag == 'table': + self.end_table() + + def start_dl(self, attrs): + if self.last_text: + # Looks like we found the second part to a command + self.indented = True + + def end_dl(self): + self.indented = False + + def start_dt(self, attrs): + self.data = '' + self.nolink = True + + def end_dt(self): + if not self.active: + return + if self.nolink == True: + # Looks like we found the first part to a command + self.last_text = re.sub(' \([\w\-\.\s]+\)', '', self.data) + self.nolink = False + + def start_h2(self, attrs): + for k, v in attrs: + if k == 'id': + self.header = v + if v == '_': + self.active = True + + def end_h2(self): + pass + + def start_td(self, attrs): + self.indented = False + self.last_text = '' + + def end_td(self): + pass + + def start_table(self, attrs): + pass + + def end_table(self): + if self.header == self.last_letter: + self.active = False + + def start_a(self, attrs): + self.nolink = False + self.link = {} + for attr in attrs: + self.link[attr[0]] = attr[1] + self.data = '' + + def end_a(self): + text = self.data.replace('\t', '').replace('\n', ' ') + text = text.replace("Whats ", "What's ") + self.link['text'] = text + # handle a tag without href attribute + try: + href = self.link['href'] + except KeyError: + return + self.process_link() + + def handle_data(self, data): + self.data += data + + def handle_entityref(self, name): + self.data += '&%s;' % name + +def main(): + base = sys.argv[1] + fn = sys.argv[2] + version = sys.argv[3] + + parser = PyHTMLParser(formatter.NullFormatter(), base, fn, indent=0) + print('') + print('' % (version, version, version)) + print('') + parser.parse_file(fn) + print('') + + print('') + + fn = 'genindex-all.html' + parser = PyIdxHTMLParser(formatter.NullFormatter(), base, fn, indent=1) + text = open(base + '/' + fn, encoding='latin_1').read() + parser.feed(text) + parser.close() + + print('') + print('') + +main() --- python3.4-3.4~b1.orig/debian/pylogo.xpm +++ python3.4-3.4~b1/debian/pylogo.xpm @@ -0,0 +1,351 @@ +/* XPM */ +static char * pylogo_xpm[] = { +"32 32 316 2", +" c None", +". c #8DB0CE", +"+ c #6396BF", +"@ c #4985B7", +"# c #4181B5", +"$ c #417EB2", +"% c #417EB1", +"& c #4D83B0", +"* c #6290B6", +"= c #94B2CA", +"- c #70A1C8", +"; c #3D83BC", +"> c #3881BD", +", c #387DB6", +"' c #387CB5", +") c #387BB3", +"! c #3779B0", +"~ c #3778AE", +"{ c #3776AB", +"] c #3776AA", +"^ c #3775A9", +"/ c #4A7FAC", +"( c #709FC5", +"_ c #3A83BE", +": c #5795C7", +"< c #94B9DB", +"[ c #73A4CE", +"} c #3D80B7", +"| c #387CB4", +"1 c #377AB2", +"2 c #377AB0", +"3 c #3777AC", +"4 c #3774A7", +"5 c #3773A5", +"6 c #3C73A5", +"7 c #4586BB", +"8 c #4489C1", +"9 c #A7C7E1", +"0 c #F7F9FD", +"a c #E1E9F1", +"b c #4C89BC", +"c c #3779AF", +"d c #3778AD", +"e c #3873A5", +"f c #4B7CA4", +"g c #3982BE", +"h c #4389C1", +"i c #A6C6E1", +"j c #F6F9FC", +"k c #D6E4F0", +"l c #4A88BB", +"m c #3773A6", +"n c #366F9F", +"o c #366E9D", +"p c #376E9C", +"q c #4A8BC0", +"r c #79A7CD", +"s c #548EBD", +"t c #387AB0", +"u c #3773A4", +"v c #366D9C", +"w c #387FBA", +"x c #387DB7", +"y c #387BB4", +"z c #3775A8", +"A c #366FA0", +"B c #4981AF", +"C c #427BAA", +"D c #3772A4", +"E c #376B97", +"F c #77A3C8", +"G c #4586BC", +"H c #3882BE", +"I c #3B76A7", +"J c #3B76A6", +"K c #366E9E", +"L c #376B98", +"M c #376B96", +"N c #5681A3", +"O c #F5EEB8", +"P c #FFED60", +"Q c #FFE85B", +"R c #FFE659", +"S c #FDE55F", +"T c #5592C4", +"U c #3A83BF", +"V c #3882BD", +"W c #387FB9", +"X c #3779AE", +"Y c #366F9E", +"Z c #366C98", +"` c #376A94", +" . c #5D85A7", +".. c #F5EDB7", +"+. c #FFEA5D", +"@. c #FFE75A", +"#. c #FFE354", +"$. c #FDDD56", +"%. c #669DC8", +"&. c #3885C3", +"*. c #3884C2", +"=. c #387EB8", +"-. c #387CB6", +";. c #377AB1", +">. c #3772A3", +",. c #366D9B", +"'. c #F5EBB5", +"). c #FFE557", +"!. c #FFE455", +"~. c #FFDF50", +"{. c #FFDB4C", +"]. c #FAD862", +"^. c #8EB4D2", +"/. c #3C86C1", +"(. c #3883C0", +"_. c #3882BF", +":. c #3881BC", +"<. c #3880BB", +"[. c #3775AA", +"}. c #F5EAB3", +"|. c #FFE051", +"1. c #FFDE4F", +"2. c #FFDA4A", +"3. c #FED446", +"4. c #F5DF9D", +"5. c #77A5CA", +"6. c #3885C2", +"7. c #387BB2", +"8. c #6B8EA8", +"9. c #F8E7A1", +"0. c #FFE153", +"a. c #FFDD4E", +"b. c #FFDB4B", +"c. c #FFD746", +"d. c #FFD645", +"e. c #FFD342", +"f. c #F6DB8D", +"g. c #508DBE", +"h. c #3771A3", +"i. c #376A95", +"j. c #3D6F97", +"k. c #C3CBC2", +"l. c #FBD964", +"m. c #FFDC4D", +"n. c #FFD544", +"o. c #FFD040", +"p. c #F9CF58", +"q. c #3F83BB", +"r. c #376B95", +"s. c #3A6C95", +"t. c #4E7BA0", +"u. c #91AABC", +"v. c #F6E4A3", +"w. c #FFDA4B", +"x. c #FFD646", +"y. c #FFD443", +"z. c #FFD241", +"A. c #FFCE3D", +"B. c #FFCC3B", +"C. c #FCC83E", +"D. c #3880BC", +"E. c #3C79AC", +"F. c #5F8DB4", +"G. c #7AA0C0", +"H. c #82A6C3", +"I. c #82A3BF", +"J. c #82A2BE", +"K. c #82A1BB", +"L. c #82A1B9", +"M. c #8BA4B5", +"N. c #C1C5AE", +"O. c #F2E19F", +"P. c #FDD74C", +"Q. c #FFD94A", +"R. c #FFD343", +"S. c #FFCE3E", +"T. c #FFCB39", +"U. c #FFC937", +"V. c #FEC636", +"W. c #3D79AB", +"X. c #9DB6C6", +"Y. c #D0CFA2", +"Z. c #EFE598", +"`. c #F8EE9B", +" + c #F8EB97", +".+ c #F8E996", +"++ c #F8E894", +"@+ c #FAE489", +"#+ c #FCDB64", +"$+ c #FFDA4D", +"%+ c #FFCF3E", +"&+ c #FFCB3A", +"*+ c #FFC734", +"=+ c #FFC532", +"-+ c #3F82B7", +";+ c #387EB9", +">+ c #9EB9D0", +",+ c #F2E287", +"'+ c #FDEB69", +")+ c #FEEC60", +"!+ c #FFEB5E", +"~+ c #FFE254", +"{+ c #FFE152", +"]+ c #FFD747", +"^+ c #FFC633", +"/+ c #FCC235", +"(+ c #578FBE", +"_+ c #6996BC", +":+ c #DED9A8", +"<+ c #FEEC62", +"[+ c #FFE658", +"}+ c #FFDF51", +"|+ c #FFDE50", +"1+ c #FFD03F", +"2+ c #FFCD3C", +"3+ c #FFC431", +"4+ c #FFBF2C", +"5+ c #FAC244", +"6+ c #85AACA", +"7+ c #A1BBD2", +"8+ c #F7E47C", +"9+ c #FFE456", +"0+ c #FFC735", +"a+ c #FFBC29", +"b+ c #F7D280", +"c+ c #9DBAD2", +"d+ c #3B7CB2", +"e+ c #ABC2D6", +"f+ c #FDEB7B", +"g+ c #FFC12E", +"h+ c #FDBD30", +"i+ c #F4DEA8", +"j+ c #5F91BA", +"k+ c #ABC1D4", +"l+ c #FDEE7E", +"m+ c #FFE253", +"n+ c #FFCC3C", +"o+ c #FFBA27", +"p+ c #FAC75B", +"q+ c #4A82B0", +"r+ c #3877AB", +"s+ c #3774A6", +"t+ c #AAC0D4", +"u+ c #FDEE7D", +"v+ c #FFEC5F", +"w+ c #FFE255", +"x+ c #FFD848", +"y+ c #FFD444", +"z+ c #FFCF3F", +"A+ c #FFBC2A", +"B+ c #FFBB28", +"C+ c #FDBA32", +"D+ c #447AA8", +"E+ c #4379A7", +"F+ c #FFE95C", +"G+ c #FFE558", +"H+ c #FFE355", +"I+ c #FED84B", +"J+ c #FCD149", +"K+ c #FBCE47", +"L+ c #FBCD46", +"M+ c #FBC840", +"N+ c #FBC63E", +"O+ c #FBC037", +"P+ c #FAC448", +"Q+ c #FDD44C", +"R+ c #FCD14E", +"S+ c #FFC836", +"T+ c #FFC22F", +"U+ c #FFC02D", +"V+ c #FFE052", +"W+ c #FFC636", +"X+ c #FFCF5C", +"Y+ c #FFD573", +"Z+ c #FFC33E", +"`+ c #FEBD2D", +" @ c #FFDB4D", +".@ c #FFD949", +"+@ c #FFD545", +"@@ c #FFD140", +"#@ c #FFCB48", +"$@ c #FFF7E4", +"%@ c #FFFCF6", +"&@ c #FFE09D", +"*@ c #FFBA2E", +"=@ c #FDBE2F", +"-@ c #FFD748", +";@ c #FFCA38", +">@ c #FFC844", +",@ c #FFF2D7", +"'@ c #FFF9EC", +")@ c #FFDB94", +"!@ c #FFB92D", +"~@ c #FAC54D", +"{@ c #FDD54E", +"]@ c #FFBD2D", +"^@ c #FFC858", +"/@ c #FFD174", +"(@ c #FFBF3E", +"_@ c #FCBD3C", +":@ c #FAD66A", +"<@ c #FECD3F", +"[@ c #FFC330", +"}@ c #FFBD2A", +"|@ c #FFB724", +"1@ c #FFB521", +"2@ c #FFB526", +"3@ c #FBC457", +"4@ c #F7E09E", +"5@ c #F8D781", +"6@ c #FAC349", +"7@ c #FCC134", +"8@ c #FEBE2C", +"9@ c #FBBE3F", +"0@ c #F7CF79", +"a@ c #F5D795", +" . + @ # $ % % & * = ", +" - ; > > , ' ) ! ~ { ] ^ / ", +" ( _ : < [ } | 1 2 ~ 3 4 5 5 6 ", +" 7 8 9 0 a b 2 c d 3 { 5 5 5 e f ", +" g h i j k l c ~ { { m 5 5 n o p ", +" > > q r s t c c d 4 5 u n v v v ", +" w x ' y 2 c d d z 5 u A v v v v ", +" B C 5 D v v v v E ", +" F G H H H x ' ) c c c d I J 5 K v v L M N O P Q R S ", +" T U H V V W ' ) c c X ~ 5 5 5 Y v v Z ` ` ...+.@.#.#.$. ", +" %.&.*.> w W =.-.;.c 3 { ^ 5 5 >.o v ,.E ` ` .'.).!.#.~.{.]. ", +"^./.(._.:.<., ' ) ;.X d [.5 5 >.K v ,.E ` ` ` .}.#.|.1.{.2.3.4.", +"5.6.(.H H x ' 7.c c 3 3 4 5 D K v v ,.` ` ` ` 8.9.0.a.b.c.d.e.f.", +"g._.> <.w ' ' | 2 3 { z 5 5 h.v v v i.` ` ` j.k.l.m.{.d.n.e.o.p.", +"q.> > :.-.' 1 c c c ] 5 5 >.v v ,.r.` ` s.t.u.v.{.w.x.y.z.A.B.C.", +"D.D.w -.' 1 c c c E.F.G.H.I.J.J.K.L.L.L.M.N.O.P.Q.c.R.S.B.T.U.V.", +"D.D.=.' ' 1 c c W.X.Y.Z.`.`.`.`.`. +.+++@+#+$+Q.d.R.%+B.&+*+=+=+", +"-+;+-.' ;.2 c c >+,+'+)+P P P !+Q R ~+{+1.{.]+d.y.%+B.&+^+=+=+/+", +"(+' ' ;.c X X _+:+<+P P P P !+R [+~+}+|+{.]+n.R.1+2+&+^+=+3+4+5+", +"6+' ) ! ~ { { 7+8+P P P P !+R 9+#.{+{.w.]+y.z.S.&+0+=+=+3+4+a+b+", +"c+d+7.! d 3 z e+f+P P P !+R 9+#.{+m.{.]+y.1+B.&+0+=+=+g+4+a+h+i+", +" j+c d 3 { 4 k+l+P P !+@.9+m+1.m.{.]+y.1+n+B.*+=+=+g+a+a+o+p+ ", +" q+r+{ s+m t+u+v+@.R w+{+}+{.x+d.y+z+n+B.0+=+=+g+A+a+B+C+ ", +" * D+E+E+ +.F+G+H+}+}+{.I+J+K+L+M+M+M+M+N+O+O+O+O+P+ ", +" ).).#.{+a.{.x+Q+R+ ", +" #.m+1.a.{.x+y.o.2+B.S+=+=+T+U+O+ ", +" 0.V+{.{.x+n.o.2+B.B.W+X+Y+Z+a+`+ ", +" @{..@+@n.@@B.B.S+^+#@$@%@&@*@=@ ", +" ].-@x.y.o.%+;@S+=+=+>@,@'@)@!@~@ ", +" {@z.z+2+U.=+=+=+T+]@^@/@(@_@ ", +" :@<@U.=+=+[@4+}@|@1@2@3@ ", +" 4@5@6@7@8@a+a+9@0@a@ "}; --- python3.4-3.4~b1.orig/debian/pymindeps.py +++ python3.4-3.4~b1/debian/pymindeps.py @@ -0,0 +1,178 @@ +#! /usr/bin/python3 + +# Matthias Klose +# Modified to only exclude module imports from a given module. + +# Copyright 2004 Toby Dickenson +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject +# to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +import os, sys, pprint +import modulefinder +import imp + +class mymf(modulefinder.ModuleFinder): + def __init__(self,*args,**kwargs): + self._depgraph = {} + self._types = {} + self._last_caller = None + modulefinder.ModuleFinder.__init__(self, *args, **kwargs) + + def import_hook(self, name, caller=None, fromlist=None, level=-1): + old_last_caller = self._last_caller + try: + self._last_caller = caller + return modulefinder.ModuleFinder.import_hook(self, name, caller, + fromlist, level) + finally: + self._last_caller = old_last_caller + + def import_module(self, partnam, fqname, parent): + m = modulefinder.ModuleFinder.import_module(self, + partnam, fqname, parent) + if m is not None and self._last_caller: + caller = self._last_caller.__name__ + if '.' in caller: + caller = caller[:caller.index('.')] + callee = m.__name__ + if '.' in callee: + callee = callee[:callee.index('.')] + #print "XXX last_caller", caller, "MOD", callee + #self._depgraph.setdefault(self._last_caller.__name__,{})[r.__name__] = 1 + #if caller in ('pdb', 'doctest') or callee in ('pdb', 'doctest'): + # print caller, "-->", callee + if caller != callee: + self._depgraph.setdefault(caller,{})[callee] = 1 + return m + + def find_module(self, name, path, parent=None): + if parent is not None: + # assert path is not None + fullname = parent.__name__+'.'+name + elif name == "__init__": + fullname = os.path.basename(path[0]) + else: + fullname = name + if self._last_caller: + caller = self._last_caller.__name__ + if fullname in excluded_imports.get(caller, []): + #self.msgout(3, "find_module -> Excluded", fullname) + raise ImportError(name) + + if fullname in self.excludes: + #self.msgout(3, "find_module -> Excluded", fullname) + raise ImportError(name) + + if path is None: + if name in sys.builtin_module_names: + return (None, None, ("", "", imp.C_BUILTIN)) + + path = self.path + return imp.find_module(name, path) + + def load_module(self, fqname, fp, pathname, file_info): + suffix, mode, type = file_info + m = modulefinder.ModuleFinder.load_module(self, fqname, + fp, pathname, file_info) + if m is not None: + self._types[m.__name__] = type + return m + + def load_package(self, fqname, pathname): + m = modulefinder.ModuleFinder.load_package(self, fqname,pathname) + if m is not None: + self._types[m.__name__] = imp.PKG_DIRECTORY + return m + +def reduce_depgraph(dg): + pass + +# guarded imports, which don't need to be included in python-minimal +excluded_imports = { + 'argparse': set(('gettext',)), + 'codecs': set(('encodings',)), + 'collections': set(('cPickle', 'pickle', 'doctest')), + 'copy': set(('reprlib',)), + 'functools': set(('_dummy_thread',)), + 'hashlib': set(('logging', '_hashlib')), + #'hashlib': set(('_hashlib', '_md5', '_sha', '_sha256','_sha512',)), + 'heapq': set(('doctest',)), + 'io': set(('_dummy_thread',)), + 'logging': set(('multiprocessing',)), + 'os': set(('nt', 'ntpath', 'os2', 'os2emxpath', 'mac', 'macpath', + 'riscos', 'riscospath', 'riscosenviron')), + 'optparse': set(('gettext',)), + 'pickle': set(('argparse', 'doctest', 'pprint')), + 'platform': set(('plistlib', 'tempfile')), + 'reprlib': set(('_dummy_thread',)), + #'socket': set(('_ssl',)), + '_sitebuiltins': set(('pydoc',)), + 'subprocess': set(('threading',)), + 'sysconfig': set(('pprint','_osx_support')), + 'tempfile': set(('_dummy_thread',)), + } + +def main(argv): + # Parse command line + import getopt + try: + opts, args = getopt.getopt(sys.argv[1:], "dmp:qx:") + except getopt.error as msg: + print(msg) + return + + # Process options + debug = 1 + domods = 0 + addpath = [] + exclude = [] + for o, a in opts: + if o == '-d': + debug = debug + 1 + if o == '-m': + domods = 1 + if o == '-p': + addpath = addpath + a.split(os.pathsep) + if o == '-q': + debug = 0 + if o == '-x': + exclude.append(a) + + path = sys.path[:] + path = addpath + path + + if debug > 1: + print(("version:", sys.version)) + print("path:") + for item in path: + print((" ", repr(item))) + + #exclude = ['__builtin__', 'sys', 'os'] + exclude = [] + mf = mymf(path, debug, exclude) + for arg in args: + mf.run_script(arg) + + depgraph = reduce_depgraph(mf._depgraph) + + pprint.pprint({'depgraph':mf._depgraph, 'types':mf._types}) + +if __name__=='__main__': + main(sys.argv[1:]) --- python3.4-3.4~b1.orig/debian/pysetup3.1 +++ python3.4-3.4~b1/debian/pysetup3.1 @@ -0,0 +1,42 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.40.4. +.TH PYSETUP3.3 "1" "January 2012" "pysetup3.3 3.3" "User Commands" +.SH NAME +pysetup3.3 \- pysetup tool +.SH SYNOPSIS +.B pysetup +[\fIoptions\fR] \fIaction \fR[\fIaction_options\fR] +.SH DESCRIPTION +.SS "Actions:" +.IP +run: Run one or several commands +metadata: Display the metadata of a project +install: Install a project +remove: Remove a project +search: Search for a project in the indexes +list: List installed projects +graph: Display a graph +create: Create a project +generate\-setup: Generate a backward\-compatible setup.py +.PP +To get more help on an action, use: +.IP +pysetup action \fB\-\-help\fR +.SS "Global options:" +.TP +\fB\-\-verbose\fR (\fB\-v\fR) +run verbosely (default) +.TP +\fB\-\-quiet\fR (\fB\-q\fR) +run quietly (turns verbosity off) +.TP +\fB\-\-dry\-run\fR (\fB\-n\fR) +don't actually do anything +.TP +\fB\-\-help\fR (\fB\-h\fR) +show detailed help message +.TP +\fB\-\-no\-user\-cfg\fR +ignore pydistutils.cfg in your home directory +.TP +\fB\-\-version\fR +Display the version --- python3.4-3.4~b1.orig/debian/python3-config.1 +++ python3.4-3.4~b1/debian/python3-config.1 @@ -0,0 +1,102 @@ +.TH PYTHON\-CONFIG 1 "November 27, 2011" +.SH NAME +python\-config \- output build options for python C/C++ extensions or embedding +.SH SYNOPSIS +.BI "python\-config" +[ +.BI "\-\-prefix" +] +[ +.BI "\-\-exec\-prefix" +] +[ +.BI "\-\-includes" +] +[ +.BI "\-\-libs" +] +[ +.BI "\-\-cflags" +] +[ +.BI "\-\-ldflags" +] +[ +.BI "\-\-extension\-suffix" +] +[ +.BI "\-\-abiflags" +] +[ +.BI "\-\-help" +] +.SH DESCRIPTION +.B python\-config +helps compiling and linking programs, which embed the Python interpreter, or +extension modules that can be loaded dynamically (at run time) into +the interpreter. +.SH OPTIONS +.TP +.BI "\-\-abiflags" +print the the ABI flags as specified by PEP 3149. +.TP +.BI "\-\-cflags" +print the C compiler flags. +.TP +.BI "\-\-ldflags" +print the flags that should be passed to the linker. +.TP +.BI "\-\-includes" +similar to \fI\-\-cflags\fP but only with \-I options (path to python header files). +.TP +.BI "\-\-libs" +similar to \fI\-\-ldflags\fP but only with \-l options (used libraries). +.TP +.BI "\-\-prefix" +prints the prefix (base directory) under which python can be found. +.TP +.BI "\-\-exec\-prefix" +print the prefix used for executable program directories (such as bin, sbin, etc). +.TP +.BI "\-\-extension\-suffix" +print the extension suffix used for binary extensions. +.TP +.BI "\-\-help" +print the usage message. +.PP + +.SH EXAMPLES +To build the singe\-file c program \fIprog\fP against the python library, use +.PP +.RS +gcc $(python\-config \-\-cflags \-\-ldflags) progr.cpp \-o progr.cpp +.RE +.PP +The same in a makefile: +.PP +.RS +CFLAGS+=$(shell python\-config \-\-cflags) +.RE +.RS +LDFLAGS+=$(shell python\-config \-\-ldflags) +.RE +.RS +all: progr +.RE + +To build a dynamically loadable python module, use +.PP +.RS +gcc $(python\-config \-\-cflags \-\-ldflags) \-shared \-fPIC progr.cpp \-o progr.so +.RE + +.SH "SEE ALSO" +python (1) +.br +http://docs.python.org/extending/extending.html +.br +/usr/share/doc/python/faq/extending.html + +.SH AUTHORS +This manual page was written by Johann Felix Soden +for the Debian project (and may be used by others). --- python3.4-3.4~b1.orig/debian/pyvenv3.1 +++ python3.4-3.4~b1/debian/pyvenv3.1 @@ -0,0 +1,34 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.40.10. +.TH PYVENV-3.3 "1" "June 2012" "pyvenv-3.3 3.3" "User Commands" +.SH NAME +pyvenv-3.3 \- create virtual python environments +.SH DESCRIPTION +usage: venv [\-h] [\-\-system\-site\-packages] [\-\-symlinks] [\-\-clear] [\-\-upgrade] +.IP +ENV_DIR [ENV_DIR ...] +.PP +Creates virtual Python environments in one or more target directories. +.SS "positional arguments:" +.TP +ENV_DIR +A directory to create the environment in. +.SS "optional arguments:" +.TP +\fB\-h\fR, \fB\-\-help\fR +show this help message and exit +.TP +\fB\-\-system\-site\-packages\fR +Give the virtual environment access to the system +site\-packages dir. +.TP +\fB\-\-symlinks\fR +Attempt to symlink rather than copy. +.TP +\fB\-\-clear\fR +Delete the environment directory if it already exists. +If not specified and the directory exists, an error is +raised. +.TP +\fB\-\-upgrade\fR +Upgrade the environment directory to use this version +of Python, assuming Python has been upgraded in\-place. --- python3.4-3.4~b1.orig/debian/rules +++ python3.4-3.4~b1/debian/rules @@ -0,0 +1,1394 @@ +#!/usr/bin/make -f + +unexport LANG LC_ALL LC_CTYPE LC_COLLATE LC_TIME LC_NUMERIC LC_MESSAGES +unexport CFLAGS CXXFLAGS LDFLAGS CPPFLAGS + +export SHELL = /bin/bash + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +vafilt = $(subst $(2)=,,$(filter $(2)=%,$(1))) +DPKG_VARS := $(shell dpkg-architecture) +DEB_BUILD_ARCH ?= $(call vafilt,$(DPKG_VARS),DEB_BUILD_ARCH) +DEB_BUILD_GNU_TYPE ?= $(call vafilt,$(DPKG_VARS),DEB_BUILD_GNU_TYPE) +DEB_HOST_ARCH ?= $(call vafilt,$(DPKG_VARS),DEB_HOST_ARCH) +DEB_HOST_ARCH_ENDIAN ?= $(call vafilt,$(DPKG_VARS),DEB_HOST_ARCH_ENDIAN) +DEB_HOST_ARCH_OS ?= $(call vafilt,$(DPKG_VARS),DEB_HOST_ARCH_OS) +DEB_HOST_GNU_TYPE ?= $(call vafilt,$(DPKG_VARS),DEB_HOST_GNU_TYPE) +DEB_HOST_MULTIARCH ?= $(call vafilt,$(DPKG_VARS),DEB_HOST_MULTIARCH) + +CHANGELOG_VARS := $(shell dpkg-parsechangelog | \ + sed -n 's/ /_/g;/^[^_]/s/^\([^:]*\):_\(.*\)/\1=\2/p') +PKGSOURCE := $(call vafilt,$(CHANGELOG_VARS),Source) +PKGVERSION := $(call vafilt,$(CHANGELOG_VARS),Version) + +on_buildd := $(shell [ -f /CurrentlyBuilding -o "$$LOGNAME" = buildd -o "$$USER" = buildd ] && echo yes) + +ifneq (,$(findstring nocheck, $(DEB_BUILD_OPTIONS))) + WITHOUT_CHECK := yes +endif +WITHOUT_BENCH := +ifneq (,$(findstring nobench, $(DEB_BUILD_OPTIONS))) + WITHOUT_BENCH := yes +endif +ifeq ($(on_buildd),yes) + ifneq (,$(filter $(DEB_HOST_ARCH), armel hppa mips mipsel mips64 mips64el s390 hurd-i386 kfreebsd-amd64 kfreebsd-i386)) + WITHOUT_CHECK := yes + endif + ifneq (,$(filter $(DEB_HOST_ARCH), armel hppa mips mipsel mips64 mips64el s390 hurd-i386)) + WITHOUT_BENCH := yes + endif +endif +ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE)) + WITHOUT_BENCH := yes + WITHOUT_CHECK := yes +endif + +COMMA = , +ifneq (,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS)))) + NJOBS := -j $(subst parallel=,,$(filter parallel=%,$(subst $(COMMA), ,$(DEB_BUILD_OPTIONS)))) +endif + +distribution := $(shell lsb_release -is) +distrelease := $(shell lsb_release -cs) + +VER=3.4 +SVER=3.4~b1 +NVER=3.5 +PVER=python3.4 +PRIORITY=$(shell echo $(VER) | tr -d '.')0 + +PREVVER := $(shell awk '/^python/ && NR > 1 {print substr($$2,2,length($$2)-2); exit}' debian/changelog) + +# default versions are built from the python-defaults source package +# keep the definition to adjust package priorities. +DEFAULT_VERSION = no +STATIC_PYTHON=yes + +MIN_MODS := $(shell awk '/^ / && $$2 == "module" { print $$1 }' \ + debian/PVER-minimal.README.Debian.in) +MIN_EXTS := $(shell awk '/^ / && $$2 ~ /^extension/ { print $$1 }' \ + debian/PVER-minimal.README.Debian.in) +MIN_BUILTINS := $(shell awk '/^ / && $$2 == "builtin" { print $$1 }' \ + debian/PVER-minimal.README.Debian.in) +MIN_PACKAGES := $(shell awk '/^ / && $$2 == "package" { print $$1 }' \ + debian/PVER-minimal.README.Debian.in) +MIN_ENCODINGS := $(foreach i, \ + $(filter-out \ + big5% bz2% cp932.py cp949.py cp950.py euc_% \ + gb% iso2022% johab.py shift_jis% , \ + $(shell cd Lib/encodings && echo *.py)), \ + encodings/$(i)) \ + codecs.py stringprep.py + +with_tk := no +with_interp := static +#with_interp := shared + +PY_INTERPRETER = /usr/bin/python$(VER) + +ifeq ($(DEFAULT_VERSION),yes) + PY_PRIO = standard + #PYSTDDEP = , python (>= $(VER)) +else + PY_PRIO = optional +endif +ifeq ($(distribution),Ubuntu) + PY_MINPRIO = required + PY_MINPRIO = optional + with_fpectl = yes + #with_udeb = yes +else + PY_MINPRIO = $(PY_PRIO) + with_fpectl = yes +endif +ifeq (,$(filter $(distrelease),lenny etch squeeze wheezy lucid maverick natty oneiric)) + bd_qual = :any +endif +ifeq (,$(filter $(distrelease),lenny etch squeeze wheezy lucid maverick natty oneiric)) + ma_filter = cat +else + ma_filter = grep -v '^Multi-Arch:' +endif + +CC=$(DEB_HOST_GNU_TYPE)-gcc +CXX=$(DEB_HOST_GNU_TYPE)-g++ + +DPKG_CPPFLAGS:= $(shell dpkg-buildflags --get CPPFLAGS) +DPKG_CFLAGS := $(shell dpkg-buildflags --get CFLAGS) +DPKG_LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS) +OPT_CFLAGS := $(filter-out -O%,$(DPKG_CFLAGS)) # default is -O3 +DEBUG_CFLAGS := $(patsubst -O%,-O0,$(DPKG_CFLAGS)) + +# on alpha, use -O2 only, use -mieee +ifeq ($(DEB_HOST_ARCH),alpha) + OPT_CFLAGS += -mieee + DEBUG_CFLAGS += -mieee + EXTRA_OPT_FLAGS += -O2 +endif +ifeq ($(DEB_HOST_ARCH),m68k) + EXTRA_OPT_FLAGS += -O2 +endif + +ifeq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE)) + ifeq ($(DEB_HOST_ARCH_OS),linux) + ifneq (,$(findstring $(DEB_HOST_ARCH), amd64 armel armhf i386 powerpc ppc64)) + with_pgo := yes + endif + endif +endif + +ifneq (,$(findstring $(DEB_HOST_ARCH), amd64 armel i386)) + with_lto := yes +endif + +ifneq (,$(findstring noopt, $(DEB_BUILD_OPTIONS))) + OPT_CFLAGS := $(filter-out -O%, $(OPT_CFLAGS)) + EXTRA_OPT_CFLAGS = -O0 + with_pgo = + with_lto = +endif + with_pgo = + with_lto = + +ifeq ($(with_lto),yes) + LTO_CFLAGS = -g -flto -fuse-linker-plugin + EXTRA_OPT_CFLAGS += $(LTO_CFLAGS) +endif + +make_build_target = $(if $(with_pgo),profile-opt) + +buildd_static := $(CURDIR)/build-static +buildd_shared := $(CURDIR)/build-shared +buildd_debug := $(CURDIR)/build-debug +buildd_shdebug := $(CURDIR)/build-shdebug + +d := debian/tmp +scriptdir = usr/share/lib/python$(VER) +scriptdir = usr/share/python$(VER) +scriptdir = usr/lib/python$(VER) + +# package names and directories +p_base := $(PVER) +p_min := $(PVER)-minimal +p_lib := lib$(PVER) +p_tk := $(PVER)-tk +p_dev := $(PVER)-dev +p_exam := $(PVER)-examples +p_idle := idle-$(PVER) +p_doc := $(PVER)-doc +p_dbg := $(PVER)-dbg +p_udeb := $(PVER)-udeb + +p_lbase := lib$(PVER)-stdlib +p_lmin := lib$(PVER)-minimal +p_ldev := lib$(PVER)-dev +p_ldbg := lib$(PVER)-dbg +p_ltst := lib$(PVER)-testsuite + +d_base := debian/$(p_base) +d_min := debian/$(p_min) +d_lib := debian/$(p_lib) +d_tk := debian/$(p_tk) +d_dev := debian/$(p_dev) +d_exam := debian/$(p_exam) +d_idle := debian/$(p_idle) +d_doc := debian/$(p_doc) +d_dbg := debian/$(p_dbg) +d_udeb := debian/$(p_udeb) + +d_lbase := debian/$(p_lbase) +d_lmin := debian/$(p_lmin) +d_ldev := debian/$(p_ldev) +d_ldbg := debian/$(p_ldbg) +d_ltst := debian/$(p_ltst) + +build-arch: stamps/stamp-build +build-indep: stamps/stamp-build-doc +build: build-arch +stamps/stamp-build: stamps/stamp-build-static stamps/stamp-mincheck \ + stamps/stamp-build-shared stamps/stamp-build-debug \ + stamps/stamp-build-shared-debug \ + stamps/stamp-check stamps/stamp-pystone stamps/stamp-pybench + touch $@ + +PROFILE_EXCLUDES = test_compiler test_distutils test_platform test_subprocess \ + test_multiprocessing test_socketserver \ + test_thread test_threaded_import test_threadedtempfile \ + test_threading test_threading_local test_threadsignals \ + test_concurrent_futures test_ctypes \ + test_dbm_dumb test_dbm_ndbm test_pydoc test_sundry \ + test_signal test_ioctl test_gdb + +PROFILE_TASK = ../Lib/test/regrtest.py \ + -j 1 --next=20 -unone,decimal \ + -x $(sort $(TEST_EXCLUDES) $(PROFILE_EXCLUDES)) + +stamps/stamp-build-static: stamps/stamp-configure-static + dh_testdir + $(MAKE) $(NJOBS) -C $(buildd_static) \ + EXTRA_CFLAGS="$(EXTRA_OPT_CFLAGS)" \ + PROFILE_TASK='$(PROFILE_TASK)' $(make_build_target) + + : # check that things are correctly built +ifeq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE)) + ifneq (,$(filter $(DEB_HOST_ARCH_OS), linux)) + cd $(buildd_static) && ./python -c 'from _multiprocessing import SemLock' + endif +endif + + touch stamps/stamp-build-static + +run-profile-task: + $(MAKE) -C $(buildd_static) \ + PROFILE_TASK='$(PROFILE_TASK)' run_profile_task + +stamps/stamp-build-shared: stamps/stamp-configure-shared + dh_testdir + $(MAKE) $(NJOBS) -C $(buildd_shared) \ + EXTRA_CFLAGS="$(EXTRA_OPT_CFLAGS)" + : # build a static library with PIC objects + $(MAKE) $(NJOBS) -C $(buildd_shared) \ + EXTRA_CFLAGS="$(EXTRA_OPT_CFLAGS)" \ + LIBRARY=libpython$(VER)m-pic.a libpython$(VER)m-pic.a + touch stamps/stamp-build-shared + +stamps/stamp-build-debug: stamps/stamp-configure-debug + dh_testdir + $(MAKE) $(NJOBS) -C $(buildd_debug) \ + EXTRA_CFLAGS="$(DEBUG_CFLAGS)" + touch stamps/stamp-build-debug + +stamps/stamp-build-shared-debug: stamps/stamp-configure-shared-debug + dh_testdir + : # build the shared debug library + $(MAKE) $(NJOBS) -C $(buildd_shdebug) \ + EXTRA_CFLAGS="$(DEBUG_CFLAGS)" \ + libpython$(VER)dm.so pybuilddir.txt + touch stamps/stamp-build-shared-debug + +common_configure_args = \ + --prefix=/usr \ + --enable-ipv6 \ + --enable-loadable-sqlite-extensions \ + --with-dbmliborder=bdb:gdbm \ + --with-computed-gotos \ + --without-ensurepip \ + --with-system-expat \ + +# --with-system-libmpdec \ + +ifeq ($(DEB_HOST_ARCH), avr32) + common_configure_args += --without-ffi +else + common_configure_args += --with-system-ffi +endif + +ifeq ($(with_fpectl),yes) + common_configure_args += \ + --with-fpectl +endif + +ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE)) + common_configure_args += --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) + config_site = ac_cv_file__dev_ptmx=yes ac_cv_file__dev_ptc=yes + ifeq (,$(filter $(DEB_HOST_ARCH),arm m68k)) + ifeq ($(DEB_HOST_ARCH_ENDIAN),little) + config_site += ac_cv_little_endian_double=yes + else + config_site += ac_cv_big_endian_double=yes + endif + endif +endif + +stamps/stamp-configure-shared: stamps/stamp-patch + rm -rf $(buildd_shared) + mkdir -p $(buildd_shared) + cd $(buildd_shared) && \ + CC="$(CC)" CXX="$(CXX)" CFLAGS="$(OPT_CFLAGS)" \ + CPPFLAGS="$(DPKG_CPPFLAGS)" LDFLAGS="$(DPKG_LDFLAGS)" \ + $(config_site) \ + ../configure \ + --enable-shared \ + $(common_configure_args) + + $(call __post_configure,$(buildd_shared)) + + @echo XXXXXXX pyconfig.h + -cat $(buildd_shared)/pyconfig.h + + touch $@ + +stamps/stamp-configure-static: stamps/stamp-patch + rm -rf $(buildd_static) + mkdir -p $(buildd_static) + cd $(buildd_static) && \ + CC="$(CC)" CXX="$(CXX)" CFLAGS="$(OPT_CFLAGS)" \ + CPPFLAGS="$(DPKG_CPPFLAGS)" LDFLAGS="$(DPKG_LDFLAGS)" \ + $(config_site) \ + ../configure \ + $(common_configure_args) + + $(call __post_configure,$(buildd_static)) + touch $@ + +stamps/stamp-configure-debug: stamps/stamp-patch + rm -rf $(buildd_debug) + mkdir -p $(buildd_debug) + cd $(buildd_debug) && \ + CC="$(CC)" CXX="$(CXX)" CFLAGS="$(DEBUG_CFLAGS)" \ + CPPFLAGS="$(DPKG_CPPFLAGS)" LDFLAGS="$(DPKG_LDFLAGS)" \ + $(config_site) \ + ../configure \ + $(common_configure_args) \ + --with-pydebug + + $(call __post_configure,$(buildd_debug)) + touch $@ + +stamps/stamp-configure-shared-debug: stamps/stamp-patch + rm -rf $(buildd_shdebug) + mkdir -p $(buildd_shdebug) + cd $(buildd_shdebug) && \ + CC="$(CC)" CXX="$(CXX)" CFLAGS="$(DEBUG_CFLAGS)" \ + CPPFLAGS="$(DPKG_CPPFLAGS)" LDFLAGS="$(DPKG_LDFLAGS)" \ + $(config_site) \ + ../configure \ + $(common_configure_args) \ + --enable-shared \ + --with-pydebug + + $(call __post_configure,$(buildd_shdebug)) + touch $@ + +define __post_configure + egrep \ + "^#($$(awk -v ORS='|' '$$2 ~ /^extension$$/ {print $$1}' debian/PVER-minimal.README.Debian.in)XX)" \ + Modules/Setup.dist \ + | sed -e 's/^#//' -e 's/-Wl,-Bdynamic//;s/-Wl,-Bstatic//' \ + >> $(1)/Modules/Setup.local + + : # unconditionally run makesetup + cd $(1) && \ + ../Modules/makesetup -c ../Modules/config.c.in -s Modules \ + Modules/Setup.config Modules/Setup.local Modules/Setup + mv $(1)/config.c $(1)/Modules/ + + : # and fix the timestamps + $(MAKE) -C $(1) Makefile Modules/config.c +endef + +stamps/stamp-mincheck: stamps/stamp-build-static debian/PVER-minimal.README.Debian.in +ifeq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE)) + for m in $(MIN_MODS) $(MIN_PACKAGES) $(MIN_EXTS) $(MIN_BUILTINS); do \ + echo "import $$m"; \ + done > $(buildd_static)/minmods.py + cd $(buildd_static) && ./python ../debian/pymindeps.py minmods.py \ + > $(buildd_static)/mindeps.txt + -if [ -x /usr/bin/dot ]; then \ + cd $(buildd_static) && ./python ../debian/depgraph.py \ + < $(buildd_static)/mindeps.txt > $(buildd_static)/mindeps.dot; \ + dot -Tpng -o $(buildd_static)/mindeps.png \ + $(buildd_static)/mindeps.dot; \ + else true; fi + cd $(buildd_static) && ./python ../debian/mincheck.py \ + minmods.py mindeps.txt +endif + touch stamps/stamp-mincheck + +TEST_RESOURCES = all +ifeq ($(on_buildd),yes) + TEST_RESOURCES := $(TEST_RESOURCES),-network,-urlfetch +endif +TESTOPTS = -j 1 -w -u$(TEST_RESOURCES) +TEST_EXCLUDES = +ifeq ($(on_buildd),yes) + TEST_EXCLUDES += test_tcl test_codecmaps_cn test_codecmaps_hk \ + test_codecmaps_jp test_codecmaps_kr test_codecmaps_tw \ + test_normalization test_ossaudiodev +endif +ifeq (,$(wildcard /dev/dsp)) + TEST_EXCLUDES += test_linuxaudiodev test_ossaudiodev +endif +ifneq (,$(filter $(DEB_HOST_ARCH), hppa)) + TEST_EXCLUDES += test_fork1 test_multiprocessing test_socketserver test_threading test_wait3 test_wait4 test_gdb +endif +# hangs on Aarch64, see LP: #1264354 +ifneq (,$(filter $(DEB_HOST_ARCH),arm64)) + TEST_EXCLUDES += test_faulthandler +endif +ifneq (,$(filter $(DEB_HOST_ARCH), arm avr32)) + TEST_EXCLUDES += test_ctypes +endif +ifneq (,$(filter $(DEB_HOST_ARCH), arm armel avr32 m68k)) + ifeq ($(on_buildd),yes) + TEST_EXCLUDES += test_compiler + endif +endif +ifneq (,$(filter $(DEB_HOST_ARCH), sparc sparc64)) + TEST_EXCLUDES += test_gdb +endif + +# FIXME: re-enable once fixed, see #708652 +ifneq (,$(filter $(DEB_HOST_ARCH_OS), hurd)) + TEST_EXCLUDES += test_asyncore test_curses test_exceptions \ + test_faulthandler test_imaplib test_io test_logging test_mmap \ + test_random test_signal test_socket test_socketserver test_ssl \ + test_threading test_pydoc test_runpy test_telnetlib test_tk +endif + +# FIXME: re-enable once fixed, see #708653 +ifneq (,$(filter $(DEB_HOST_ARCH_OS), kfreebsd)) + TEST_EXCLUDES += test_io test_signal test_socket test_socketserver \ + test_threading test_threadsignals test_threaded_import \ + test_time test_pty test_curses +endif + +# for debug builds only +TEST_EXCLUDES += test_gdb + +ifneq (,$(TEST_EXCLUDES)) + TESTOPTS += -x $(sort $(TEST_EXCLUDES)) +endif + +ifneq (,$(wildcard /usr/bin/localedef)) + SET_LOCPATH = LOCPATH=$(CURDIR)/locales +endif + +stamps/stamp-check: +ifeq ($(WITHOUT_CHECK),yes) + echo "check run disabled for this build" > $(buildd_static)/test_results +else + : # build locales needed by the testsuite + rm -rf locales + mkdir locales + if which localedef >/dev/null 2>&1; then \ + sh debian/locale-gen; \ + fi + + @echo ========== test environment ============ + @env + @echo ======================================== + + ifeq (,$(findstring $(DEB_HOST_ARCH), alpha)) + ( \ + echo '#! /bin/sh'; \ + echo 'set -x'; \ + echo 'export $(SET_LOCPATH)'; \ + echo '$(buildd_static)/python $(CURDIR)/debian/script.py test_results '\''make test TESTOPTS="$(filter-out test_gdb,$(TESTOPTS))"'\'; \ + echo 'echo DONE'; \ + ) > $(buildd_debug)/run_tests + chmod 755 $(buildd_debug)/run_tests + @echo "BEGIN test debug" + -cd $(buildd_debug) && time xvfb-run -a -e xvfb-run.log ./run_tests + @echo "END test debug" + endif + + ( \ + echo '#! /bin/sh'; \ + echo 'set -x'; \ + echo 'export $(SET_LOCPATH)'; \ + echo '$(buildd_static)/python $(CURDIR)/debian/script.py test_results '\''make test EXTRA_CFLAGS="$(EXTRA_OPT_CFLAGS)" TESTOPTS="$(TESTOPTS)"'\'; \ + echo 'echo DONE'; \ + ) > $(buildd_static)/run_tests + chmod 755 $(buildd_static)/run_tests + @echo "BEGIN test static" + -cd $(buildd_static) && time xvfb-run -a -e xvfb-run.log ./run_tests + @echo "END test static" + + ( \ + echo '#! /bin/sh'; \ + echo 'set -x'; \ + echo 'export $(SET_LOCPATH)'; \ + echo '$(buildd_static)/python $(CURDIR)/debian/script.py test_results '\''make test EXTRA_CFLAGS="$(EXTRA_OPT_CFLAGS)" TESTOPTS="$(TESTOPTS)"'\'; \ + echo 'echo DONE'; \ + ) > $(buildd_shared)/run_tests + chmod 755 $(buildd_shared)/run_tests + @echo "BEGIN test shared" + -cd $(buildd_shared) && time xvfb-run -a -e xvfb-run.log ./run_tests + @echo "END test shared" +endif + cp -p $(buildd_static)/test_results debian/ + touch stamps/stamp-check + +stamps/stamp-pystone: +ifeq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE)) + @echo "BEGIN pystone static" + cd $(buildd_static) && ./python ../Lib/test/pystone.py + cd $(buildd_static) && ./python ../Lib/test/pystone.py + @echo "END pystone static" + @echo "BEGIN pystone shared" + cd $(buildd_shared) \ + && LD_LIBRARY_PATH=. ./python ../Lib/test/pystone.py + cd $(buildd_shared) \ + && LD_LIBRARY_PATH=. ./python ../Lib/test/pystone.py + @echo "END pystone shared" + @echo "BEGIN pystone debug" + cd $(buildd_debug) && ./python ../Lib/test/pystone.py + cd $(buildd_debug) && ./python ../Lib/test/pystone.py + @echo "END pystone debug" +endif + touch stamps/stamp-pystone + +stamps/stamp-pybench: + echo "pybench run disabled for this build" > $(buildd_static)/pybench.log + +#ifeq (,$(filter $(DEB_HOST_ARCH), arm armel avr32 hppa mips mipsel mips64 mips64el m68k)) + pybench_options = -C 2 -n 5 -w 4 +#endif + +stamps/stamp-pybenchx: +ifeq ($(WITHOUT_BENCH),yes) + echo "pybench run disabled for this build" > $(buildd_static)/pybench.log +else + @echo "BEGIN pybench static" + cd $(buildd_static) \ + && time ./python ../Tools/pybench/pybench.py -f run1.pybench $(pybench_options) + cd $(buildd_static) \ + && ./python ../Tools/pybench/pybench.py -f run2.pybench -c run1.pybench $(pybench_options) + @echo "END pybench static" + @echo "BEGIN pybench shared" + cd $(buildd_shared) \ + && LD_LIBRARY_PATH=. ./python ../Tools/pybench/pybench.py -f run1.pybench $(pybench_options) + cd $(buildd_shared) \ + && LD_LIBRARY_PATH=. ./python ../Tools/pybench/pybench.py -f run2.pybench -c run1.pybench $(pybench_options) + @echo "END pybench shared" + @echo "BEGIN shared/static comparision" + $(buildd_static)/python Tools/pybench/pybench.py \ + -s $(buildd_static)/run2.pybench -c $(buildd_shared)/run2.pybench \ + | tee $(buildd_static)/pybench.log + @echo "END shared/static comparision" +endif + touch stamps/stamp-pybench + +minimal-test: + rm -rf mintest + mkdir -p mintest/lib mintest/dynlib mintest/testlib mintest/all-lib + cp -p $(buildd_static)/python mintest/ + cp -p $(foreach i,$(MIN_MODS),Lib/$(i).py) \ + mintest/lib/ + cp -a $(foreach i,$(MIN_PACKAGES),Lib/$(i)) \ + mintest/lib/ + cp -p $(wildcard $(foreach i,$(MIN_EXTS),$(buildd_static)/build/lib*/$(i).*.so)) \ + mintest/dynlib/ + cp -p Lib/unittest.py mintest/lib/ + cp -pr Lib/test mintest/lib/ + cp -pr Lib mintest/all-lib + cp -p $(buildd_static)/build/lib*/*.so mintest/all-lib/ + ( \ + echo "import sys"; \ + echo "sys.path = ["; \ + echo " '$(CURDIR)/mintest/lib',"; \ + echo " '$(CURDIR)/mintest/dynlib',"; \ + echo "]"; \ + cat Lib/test/regrtest.py; \ + ) > mintest/lib/test/mintest.py + cd mintest && ./python -E -S lib/test/mintest.py \ + -x test_codecencodings_cn test_codecencodings_hk \ + test_codecencodings_jp test_codecencodings_kr \ + test_codecencodings_tw test_codecs test_multibytecodec \ + +stamps/stamp-doc-html: + dh_testdir + $(MAKE) -C Doc html + touch stamps/stamp-doc-html + +build-doc: stamps/stamp-patch stamps/stamp-build-doc +stamps/stamp-build-doc: stamps/stamp-doc-html + touch stamps/stamp-build-doc + +control-file: + sed -e "s/@PVER@/$(PVER)/g" \ + -e "s/@VER@/$(VER)/g" \ + -e "s/@PYSTDDEP@/$(PYSTDDEP)/g" \ + -e "s/@PRIO@/$(PY_PRIO)/g" \ + -e "s/@MINPRIO@/$(PY_MINPRIO)/g" \ + -e "s/@bd_qual@/$(bd_qual)/g" \ + debian/control.in \ + $(if $(with_udeb),debian/control.udeb) \ + | $(ma_filter) \ + > debian/control.tmp +ifeq ($(distribution),Ubuntu) + ifneq (,$(findstring ubuntu, $(PKGVERSION))) + m='Ubuntu Core Developers '; \ + sed -i "/^Maintainer:/s/\(.*\)/Maintainer: $$m\nXSBC-Original-\1/" \ + debian/control.tmp + endif +endif + [ -e debian/control ] \ + && cmp -s debian/control debian/control.tmp \ + && rm -f debian/control.tmp && exit 0; \ + mv debian/control.tmp debian/control + + + +clean: control-file + dh_testdir + dh_testroot + $(MAKE) -f debian/rules unpatch + rm -rf stamps .pc + rm -f debian/test_results + + $(MAKE) -C Doc clean + sed 's/^@/#/' Makefile.pre.in | $(MAKE) -f - srcdir=. distclean + rm -rf $(buildd_static) $(buildd_shared) $(buildd_debug) $(buildd_shdebug) + find -name '*.py[co]' | xargs -r rm -f + rm -f Lib/lib2to3/*.pickle + rm -f Lib/dist-packages + rm -rf Lib/plat-$(DEB_HOST_MULTIARCH) + rm -rf locales + rm -rf $(d)-dbg + + for f in debian/*.in; do \ + f2=`echo $$f | sed "s,PVER,$(PVER),g;s/@VER@/$(VER)/g;s,\.in$$,,"`; \ + if [ $$f2 != debian/control ] && [ $$f2 != debian/source.lintian-overrides ]; then \ + rm -f $$f2; \ + fi; \ + done + dh_clean + +stamps/stamp-control: + : # We have to prepare the various control files + + for f in debian/*.in; do \ + f2=`echo $$f | sed "s,PVER,$(PVER),g;s/@VER@/$(VER)/g;s,\.in$$,,"`; \ + if [ $$f2 != debian/control ]; then \ + sed -e "s/@PVER@/$(PVER)/g;s/@VER@/$(VER)/g;s/@SVER@/$(SVER)/g" \ + -e "s/@PRIORITY@/$(PRIORITY)/g" \ + -e "s,@SCRIPTDIR@,/$(scriptdir),g" \ + -e "s,@INFO@,$(info_docs),g" \ + <$$f >$$f2; \ + fi; \ + done + +2to3-man: + help2man --no-info --version-string=$(VER) --no-discard-stderr \ + --name 'Python2 to Python3 converter' \ + 2to3-$(VER) > debian/2to3-3.1 + help2man --no-info --version-string=$(VER) --no-discard-stderr \ + --name 'pysetup tool' \ + pysetup$(VER) > debian/pysetup3.1 + help2man --no-info --version-string=$(VER) --no-discard-stderr \ + --name 'create virtual python environments' \ + pyvenv-$(VER) > debian/pyvenv3.1 + +install: build-arch stamps/stamp-install +stamps/stamp-install: stamps/stamp-build control-file stamps/stamp-control + dh_testdir + dh_testroot + dh_clean -k + dh_installdirs + + : # make install into tmp and subsequently move the files into + : # their packages' directories. + install -d $(d)/usr +ifeq ($(with_interp),static) + $(MAKE) -C $(buildd_static) install prefix=$(CURDIR)/$(d)/usr + sed -e '/^OPT/s,-O3,-O2,' \ + -e 's/$(LTO_CFLAGS)//g' \ + -e 's,^RUNSHARED *=.*,RUNSHARED=,' \ + -e '/BLDLIBRARY/s/-L\. //' \ + $(buildd_shared)/$(shell cat $(buildd_shared)/pybuilddir.txt)/_sysconfigdata.py \ + > $(d)/$(scriptdir)/_sysconfigdata.py +else + $(MAKE) -C $(buildd_shared) install prefix=$(CURDIR)/$(d)/usr +endif + mkdir -p $(d)/usr/include/$(DEB_HOST_MULTIARCH)/$(PVER)m + mv $(d)/usr/include/$(PVER)m/pyconfig.h \ + $(d)/usr/include/$(DEB_HOST_MULTIARCH)/$(PVER)m/. + rm -f $(d)/$(scriptdir)/lib-dynload/*.py + sed -i 's/ -O3 / -O2 /g;s/$(LTO_CFLAGS)//g;s/-fprofile-use *-fprofile-correction//g' \ + $(d)/$(scriptdir)/_sysconfigdata.py + mv $(d)/$(scriptdir)/_sysconfigdata.py \ + $(d)/$(scriptdir)/plat-$(DEB_HOST_MULTIARCH)/_sysconfigdata_m.py + cp -p debian/_sysconfigdata.py $(d)/$(scriptdir)/ + + -find $(d)/usr/lib/python$(VER) -name '*_failed*.so' + find $(d)/usr/lib/python$(VER) -name '*_failed*.so' | xargs -r rm -f + + : # FIXME: don't ship ensurepip for now + rm -rf $(d)/usr/lib/python$(VER)/ensurepip + + for i in $(d)/$(scriptdir)/lib-dynload/*.so; do \ + b=$$(basename $$i .cpython-34m.so); \ + d=$${b}.cpython-34m-$(DEB_HOST_MULTIARCH).so; \ + mv $$i $(d)/$(scriptdir)/lib-dynload/$$d; \ + done + + mv $(d)/usr/lib/libpython*.a $(d)/usr/lib/$(DEB_HOST_MULTIARCH)/ + + mkdir -p $(d)/usr/lib/python3 + mv $(d)/usr/lib/python$(VER)/site-packages \ + $(d)/usr/lib/python3/dist-packages + rm -f $(d)/usr/lib/python3/dist-packages/README + + : # remove files, which are not packaged + rm -rf $(d)/usr/lib/python$(VER)/ctypes/macholib + rm -f $(d)/$(scriptdir)/plat-*/regen + rm -f $(d)/$(scriptdir)/lib2to3/*.pickle + rm -f $(d)/usr/share/man/man1/python3.1 + + : # cannot build it, zlib maintainer won't provide a mingw build + find $(d) -name 'wininst*.exe' | xargs -r rm -f + + : # fix some file permissions + chmod a-x $(d)/$(scriptdir)/{runpy,fractions,lib2to3/refactor,tkinter/tix}.py + chmod a-x $(d)/$(scriptdir)/test/test_pathlib.py + +# : # move manpages to new names +# if [ -d $(d)/usr/man/man1 ]; then \ +# mkdir -p $(d)/usr/share/man +# mv $(d)/usr/man/man1/* $(d)/usr/share/man/man1/; \ +# rm -rf $(d)/usr/man/; \ +# fi + + mkdir -p $(d)/usr/share/man/man1 + cp -p Misc/python.man $(d)/usr/share/man/man1/python$(VER).1 + ln -sf python$(VER).1 $(d)/usr/share/man/man1/python$(VER)m.1 + cp -p debian/pydoc.1 $(d)/usr/share/man/man1/pydoc$(VER).1 + + : # Symlinks to /usr/bin for some tools + ln -sf ../lib/python$(VER)/pdb.py $(d)/usr/bin/pdb$(VER) + cp -p debian/pdb.1 $(d)/usr/share/man/man1/pdb$(VER).1 + cp -p debian/2to3-3.1 $(d)/usr/share/man/man1/2to3-$(VER).1 + cp -p debian/pysetup3.1 $(d)/usr/share/man/man1/pysetup$(VER).1 + cp -p debian/pyvenv3.1 $(d)/usr/share/man/man1/pyvenv-$(VER).1 + + : # versioned install only + rm -f $(d)/usr/bin/{2to3,idle3,pydoc3,pysetup3,python3,python3-config} + rm -f $(d)/usr/lib/*/pkgconfig/python3.pc + + dh_installdirs -p$(p_lib) \ + usr/lib/$(DEB_HOST_MULTIARCH) \ + $(scriptdir)/config-$(VER)m-$(DEB_HOST_MULTIARCH) \ + usr/share/doc + : # install the shared library + cp -p $(buildd_shared)/libpython$(VER)m.so.1.0 \ + $(d_lib)/usr/lib/$(DEB_HOST_MULTIARCH)/ + dh_link -p$(p_lib) \ + /usr/lib/$(DEB_HOST_MULTIARCH)/libpython$(VER)m.so.1.0 \ + /usr/lib/$(DEB_HOST_MULTIARCH)/libpython$(VER)m.so.1 \ + /usr/lib/$(DEB_HOST_MULTIARCH)/libpython$(VER)m.so.1 \ + /$(scriptdir)/config-$(VER)m-$(DEB_HOST_MULTIARCH)/libpython$(VER)m.so \ + /usr/lib/$(DEB_HOST_MULTIARCH)/libpython$(VER)m.so.1 \ + /$(scriptdir)/config-$(VER)m-$(DEB_HOST_MULTIARCH)/libpython$(VER).so + + ln -sf $(p_base) $(d_lib)/usr/share/doc/$(p_lib) + + ln -sf libpython$(VER)m.so.1 $(d)/usr/lib/$(DEB_HOST_MULTIARCH)/libpython$(VER)m.so + +ifeq ($(with_interp),shared) + : # install the statically linked runtime + install -m755 $(buildd_static)/python $(d)/usr/bin/python$(VER)-static +endif + + cp -p Tools/i18n/pygettext.py $(d)/usr/bin/pygettext$(VER) + cp -p debian/pygettext.1 $(d)/usr/share/man/man1/pygettext$(VER).1 + + : # install the Makefile of the shared python build + sed -e '/^OPT/s,-O3,-O2,' \ + -e 's/$(LTO_CFLAGS)//g' \ + -e 's,^RUNSHARED *=.*,RUNSHARED=,' \ + -e '/BLDLIBRARY/s/-L\. //' \ + $(buildd_shared)/Makefile \ + > $(d)/$(scriptdir)/config-$(VER)m-$(DEB_HOST_MULTIARCH)/Makefile + + : # Move the minimal libraries into $(p_lmin). + dh_installdirs -p$(p_lmin) \ + etc/$(PVER) \ + usr/bin \ + usr/share/man/man1 \ + $(scriptdir)/lib-dynload + -cd $(d); for i in $(MIN_EXTS); do \ + test -e $(scriptdir)/lib-dynload/$$i.*.so \ + && echo $(scriptdir)/lib-dynload/$$i.*.so; \ + done + + DH_COMPAT=2 dh_movefiles -p$(p_lmin) --sourcedir=$(d) \ + $(foreach i,$(MIN_MODS),$(scriptdir)/$(i).py) \ + $(foreach i,$(MIN_PACKAGES),$(scriptdir)/$(i)) \ + $(foreach i,$(MIN_ENCODINGS),$(scriptdir)/$(i)) \ + $(scriptdir)/site.py \ + $(scriptdir)/_sysconfigdata.py \ + $(scriptdir)/plat-$(DEB_HOST_MULTIARCH)/_sysconfigdata_m.py \ + `cd $(d); for i in $(MIN_EXTS); do \ + test -e $(scriptdir)/lib-dynload/$$i.*.so \ + && echo $(scriptdir)/lib-dynload/$$i.*.so; \ + done` + ls -l $(d_lmin)/$(scriptdir)/lib-dynload/*.so + + : # Move the binary into $(p_min). + dh_installdirs -p$(p_min) \ + usr/bin \ + usr/share/man/man1 + DH_COMPAT=2 dh_movefiles -p$(p_min) --sourcedir=$(d) \ + usr/bin/python$(VER) \ + usr/bin/python$(VER)m \ + usr/share/man/man1/python$(VER).1 \ + usr/share/man/man1/python$(VER)m.1 + + rv=0; \ + for i in $(MIN_EXTS); do \ + if [ -f $(d)/$(scriptdir)/lib-dynload/$$i.so ]; then \ + echo >&2 "extension $$i not mentioned in Setup.dist"; \ + rv=1; \ + fi; \ + done; \ + exit $$rv; + + : # Install sitecustomize.py + cp -p debian/sitecustomize.py $(d_lmin)/etc/$(PVER)/ + dh_link -p$(p_lmin) \ + /etc/$(PVER)/sitecustomize.py /$(scriptdir)/sitecustomize.py + + : # Move the static library and the header files into $(p_dev). +# mv $(d)/usr/share/include/python$(VER)/* $(d)/usr/include/python$(VER)/. +# rm -rf $(d)/usr/share/include + + cp $(d)/usr/bin/$(PVER)m-config $(d)/usr/bin/$(DEB_HOST_MULTIARCH)-$(PVER)m-config + ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)m-config $(d)/usr/bin/$(DEB_HOST_MULTIARCH)-$(PVER)-config + + dh_installdirs -p$(p_ldev) \ + usr/bin \ + $(scriptdir) \ + usr/include \ + usr/share/man/man1 + + DH_COMPAT=2 dh_movefiles -p$(p_ldev) --sourcedir=$(d) \ + usr/bin/$(DEB_HOST_MULTIARCH)-$(PVER)*-config \ + usr/lib/python$(VER)/config-$(VER)m-$(DEB_HOST_MULTIARCH) \ + usr/include \ + usr/lib/$(DEB_HOST_MULTIARCH)/libpython$(VER)m.{a,so} \ + usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig/python-$(VER)*.pc \ + usr/lib/python$(VER)/distutils/command/wininst-*.exe + + sed 's/@subdir@/$(PVER)m/;s/@header@/pyconfig.h/' \ + debian/multiarch.h.in > $(d_ldev)/usr/include/$(PVER)m/pyconfig.h + + sed -i '/^Cflags:/s,$$, -I$${includedir}/$(DEB_HOST_MULTIARCH)/python$(VER)m,' \ + $(d_ldev)/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig/python-$(VER).pc + + dh_link -p$(p_ldev) \ + /usr/lib/$(PVER)/config-$(VER)m-$(DEB_HOST_MULTIARCH)/libpython$(VER)m.a \ + /usr/lib/$(DEB_HOST_MULTIARCH)/libpython$(VER)m.a + + cp -p $(buildd_shared)/libpython$(VER)m-pic.a \ + $(d_ldev)/usr/lib/python$(VER)/config-$(VER)m-$(DEB_HOST_MULTIARCH)/ + + : # symlinks for the "old" include directory name + ln -sf python$(VER)m $(d_ldev)/usr/include/python$(VER) + + dh_installdirs -p$(p_dev) \ + usr/share/doc/python$(VER) \ + usr/share/man/man1 \ + $(scriptdir) \ + $(scriptdir)/doc/html + cp -p Misc/HISTORY Misc/README.valgrind Misc/gdbinit \ + debian/README.maintainers \ + debian/test_results $(buildd_static)/pybench.log \ + $(d_dev)/usr/share/doc/python$(VER)/ + + DH_COMPAT=2 dh_movefiles -p$(p_dev) --sourcedir=$(d) \ + usr/bin/python$(VER)*-config + + : # in $(p_ldev), prefix python-config with triplets + cp -p debian/python3-config.1 \ + $(d_ldev)/usr/share/man/man1/$(DEB_HOST_MULTIARCH)-$(PVER)m-config.1 + ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)m-config.1.gz \ + $(d_ldev)/usr/share/man/man1/$(DEB_HOST_MULTIARCH)-$(PVER)-config.1.gz +ifneq ($(DEB_HOST_MULTIARCH),$(DEB_HOST_GNU_TYPE)) + ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)m-config \ + $(d_ldev)/usr/bin/$(DEB_HOST_GNU_TYPE)-$(PVER)m-config + ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)-config \ + $(d_ldev)/usr/bin/$(DEB_HOST_GNU_TYPE)-$(PVER)-config + ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)-config.1.gz \ + $(d_ldev)/usr/share/man/man1/$(DEB_HOST_GNU_TYPE)-$(PVER)-config.1.gz + ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)-config.1.gz \ + $(d_ldev)/usr/share/man/man1/$(DEB_HOST_GNU_TYPE)-$(PVER)m-config.1.gz +endif + ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)m-config $(d_dev)/usr/bin/$(PVER)m-config + ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)m-config.1.gz $(d_dev)/usr/share/man/man1/$(PVER)m-config.1.gz + + ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)-config $(d_dev)/usr/bin/$(PVER)-config + ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)-config.1.gz $(d_dev)/usr/share/man/man1/$(PVER)-config.1.gz + +ifeq ($(with_tk),yes) + : # Move the Tkinter files into $(p_tk). + dh_installdirs -p$(p_tk) \ + $(scriptdir) \ + usr/lib/python$(VER)/lib-dynload + DH_COMPAT=2 dh_movefiles -p$(p_tk) --sourcedir=$(d) \ + usr/lib/python$(VER)/lib-dynload/_tkinter*.so +endif + + : # The test framework into $(p_lbase) + DH_COMPAT=2 dh_movefiles -p$(p_lbase) --sourcedir=$(d) \ + $(scriptdir)/test/{regrtest.py,support,__init__.py,pystone.py} + + : # The complete testsuite into $(p_lbase) + DH_COMPAT=2 dh_movefiles -p$(p_ltst) --sourcedir=$(d) \ + $(scriptdir)/test \ + $(scriptdir)/ctypes/test \ + $(scriptdir)/distutils/tests \ + $(scriptdir)/lib2to3/tests \ + $(scriptdir)/sqlite3/test \ + $(scriptdir)/idlelib/idle_test \ + $(scriptdir)/tkinter/test \ + $(scriptdir)/unittest/test + : # test_ctypes fails with test_macholib.py installed + rm -f $(d_ltst)/$(scriptdir)/ctypes/test/test_macholib.py + : # test_bdist_wininst fails, '*.exe' files are not installed + rm -f $(d_ltst)/$(scriptdir)/distutils/tests/test_bdist_wininst.py + + : # fixed upstream ... + chmod -x $(d_ltst)/$(scriptdir)/test/{test_dbm_gnu,test_dbm_ndbm}.py + + : # Move the demos and tools into $(p_exam)'s doc directory + dh_installdirs -p$(p_exam) \ + usr/share/doc/python$(VER)/examples + DH_COMPAT=2 dh_movefiles -p$(p_ltst) --sourcedir=$(d) \ + $(scriptdir)/turtledemo + + cp -rp Tools/* $(d_exam)/usr/share/doc/python$(VER)/examples/ + rm -rf $(d_exam)/usr/share/doc/python$(VER)/examples/Tools/{buildbot,msi} + : # XXX: We don't need rgb.txt, we'll use our own: + rm -rf $(d_exam)/usr/share/doc/python$(VER)/examples/Tools/pynche/X + + : # IDLE + mv $(d)/usr/bin/idle$(VER) $(d)/usr/bin/idle-python$(VER) + rm -f $(d)/usr/lib/python$(VER)/idlelib/idle.bat + dh_installdirs -p$(p_idle) \ + usr/bin \ + usr/share/man/man1 + DH_COMPAT=2 dh_movefiles -p$(p_idle) --sourcedir=$(d) \ + usr/bin/idle-python$(VER) + cp -p debian/idle-$(PVER).1 $(d_idle)/usr/share/man/man1/ + + : # Replace all '#!' calls to python with $(PY_INTERPRETER) + : # and make them executable + for i in `find debian -mindepth 3 -type f ! -name '*.dpatch'`; do \ + sed '1s,#!.*python[^ ]*\(.*\),#! $(PY_INTERPRETER)\1,' \ + $$i > $$i.temp; \ + if cmp --quiet $$i $$i.temp; then \ + rm -f $$i.temp; \ + else \ + mv -f $$i.temp $$i; \ + chmod 755 $$i; \ + echo "fixed interpreter: $$i"; \ + fi; \ + done + + : # Move the docs into $(p_base)'s /usr/share/doc/$(PVER) directory, + : # all other packages only have a copyright file. + dh_installdocs -p$(p_base) \ + README Misc/NEWS Misc/ACKS + ln -sf NEWS.gz $(d_base)/usr/share/doc/$(p_base)/changelog.gz + dh_installdocs --all -N$(p_base) -N$(p_dev) -N$(p_dbg) -N$(p_lib) debian/README.Debian + + : # IDLE has its own changelogs, docs... + dh_installchangelogs -p$(p_idle) Lib/idlelib/ChangeLog + dh_installdocs -p$(p_idle) Lib/idlelib/{NEWS,README,TODO,extend}.txt + + mkdir -p $(d_idle)/usr/share/applications + cp -p debian/idle.desktop \ + $(d_idle)/usr/share/applications/idle-$(PVER).desktop + + : # those packages have own README.Debian's + install -m 644 -p debian/README.$(p_base) \ + $(d_base)/usr/share/doc/$(PVER)/README.Debian + install -m 644 -p debian/README.$(p_idle) \ + $(d_idle)/usr/share/doc/$(p_idle)/README.Debian +ifeq ($(with_tk),yes) + cp -p debian/README.Tk $(d_tk)/usr/share/doc/$(p_tk)/ +endif + + : # library files into $(p_lbase) + dh_installdirs -p$(p_lbase) \ + usr/lib + dh_movefiles -p$(p_lbase) \ + usr/lib/python$(VER) + + : # The rest goes into $(p_base) + mkdir -p $(d)/usr/lib/python3/dist-packages + (cd $(d) && tar cf - .) | (cd $(d_base) && tar xpf -) + rm -f $(d_base)/usr/bin/python + rm -f $(d_base)/usr/bin/pyvenv + + : # Install menu icon + dh_installdirs -p$(p_base) usr/share/pixmaps + cp -p debian/pylogo.xpm $(d_base)/usr/share/pixmaps/$(PVER).xpm + + : # generate binfmt file + mkdir -p $(d_min)/usr/share/binfmts +ifeq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE)) + $(buildd_static)/python debian/mkbinfmt.py $(PVER) \ + > $(d_min)/usr/share/binfmts/$(PVER) +else + $(PVER) debian/mkbinfmt.py $(PVER) > $(d_min)/usr/share/binfmts/$(PVER) +endif + + : # desktop entry + mkdir -p $(d_base)/usr/share/applications + cp -p debian/$(PVER).desktop \ + $(d_base)/usr/share/applications/$(PVER).desktop + + : # remove some things + -find debian -name .cvsignore | xargs rm -f + -find debian -name '*.py[co]' | xargs rm -f + + : # remove empty directories, when all components are in place + -find debian ! -name lib-dynload ! -name dist-packages -type d -empty -delete + + : # install debug package + rm -rf $(d)-dbg + $(MAKE) -C $(buildd_debug) install DESTDIR=$(CURDIR)/$(d)-dbg + : # install the Makefile of the shared python debug build + sed -e '/^OPT/s,-O3,-O2,' \ + -e 's/$(LTO_CFLAGS)//g' \ + -e 's,^RUNSHARED *=.*,RUNSHARED=,' \ + -e '/BLDLIBRARY/s/-L\. //' \ + $(buildd_shdebug)/Makefile \ + > $(d)-dbg/$(scriptdir)/config-$(VER)dm-$(DEB_HOST_MULTIARCH)/Makefile + sed -e 's,^RUNSHARED *=.*,RUNSHARED=,' \ + -e '/BLDLIBRARY/s/-L\. //' \ + $(buildd_shdebug)/$(shell cat $(buildd_shdebug)/pybuilddir.txt)/_sysconfigdata.py \ + > $(d)-dbg/$(scriptdir)/_sysconfigdata.py + rm -f $(d)-dbg/$(scriptdir)/lib-dynload/_sysconfigdata.py + sed -i 's/ -O3 / -O2 /g;s/$(LTO_CFLAGS)//g;s/-fprofile-use *-fprofile-correction//g' \ + $(d)-dbg/$(scriptdir)/_sysconfigdata.py + mv $(d)-dbg/$(scriptdir)/_sysconfigdata.py \ + $(d)-dbg/$(scriptdir)/plat-$(DEB_HOST_MULTIARCH)/_sysconfigdata_dm.py + + mv $(d)-dbg/usr/lib/libpython*.a $(d)-dbg/usr/lib/$(DEB_HOST_MULTIARCH)/ + + for i in $(d)-dbg/$(scriptdir)/lib-dynload/*.so; do \ + b=$$(basename $$i .cpython-34dm.so); \ + d=$${b}.cpython-34dm-$(DEB_HOST_MULTIARCH).so; \ + mv $$i $(d)-dbg/$(scriptdir)/lib-dynload/$$d; \ + done + + dh_installdirs -p$(p_ldbg) \ + usr/bin \ + usr/share/man/man1 \ + $(scriptdir)/lib-dynload \ + $(scriptdir)/plat-$(DEB_HOST_MULTIARCH) \ + usr/include/$(PVER)dm \ + usr/include/$(DEB_HOST_MULTIARCH)/$(PVER)dm \ + usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig + + cp -p $(d)-dbg/$(scriptdir)/lib-dynload/*.so \ + $(d_ldbg)/$(scriptdir)/lib-dynload/ + cp -p $(d)-dbg/$(scriptdir)/plat-$(DEB_HOST_MULTIARCH)/_sysconfigdata_dm.py \ + $(d_ldbg)/$(scriptdir)/plat-$(DEB_HOST_MULTIARCH)/ + cp -p $(buildd_shdebug)/libpython$(VER)dm.so.1.0 \ + $(d_ldbg)/usr/lib/$(DEB_HOST_MULTIARCH)/ + dh_link -p$(p_ldbg) \ + /usr/lib/$(DEB_HOST_MULTIARCH)/libpython$(VER)dm.so.1.0 \ + /usr/lib/$(DEB_HOST_MULTIARCH)/libpython$(VER)dm.so.1 \ + /usr/lib/$(DEB_HOST_MULTIARCH)/libpython$(VER)dm.so.1 \ + /usr/lib/$(DEB_HOST_MULTIARCH)/libpython$(VER)dm.so + sed -e '/^Libs:/s,-lpython$(VER),-lpython$(VER)dm,' \ + -e '/^Cflags:/s,$$, -I$${includedir}/$(DEB_HOST_MULTIARCH)/python$(VER)dm,' \ + $(d)-dbg/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig/python-$(VER).pc \ + > $(d_ldbg)/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig/python-$(VER)-dbg.pc + + dh_installdirs -p$(p_dbg) \ + usr/bin \ + usr/share/man/man1 \ + usr/share/doc/$(p_base) + cp -p Misc/SpecialBuilds.txt $(d_dbg)/usr/share/doc/$(p_base)/ + cp -p debian/$(PVER)-dbg.README.Debian \ + $(d_dbg)/usr/share/doc/$(p_base)/README.debug + cp -p $(buildd_debug)/python $(d_dbg)/usr/bin/$(PVER)dm + ln -sf python$(VER)dm $(d_dbg)/usr/bin/$(PVER)-dbg + +ifneq ($(with_tk),yes) + rm -f $(d_ldbg)/$(scriptdir)/lib-dynload/_tkinter*.so + rm -f $(d_ldbg)/usr/lib/debug/$(scriptdir)/lib-dynload/_tkinter*.so +endif +ifneq ($(with_gdbm),yes) + rm -f $(d_ldbg)/$(scriptdir)/lib-dynload/_gdbm*.so + rm -f $(d_ldbg)/usr/lib/debug/$(scriptdir)/lib-dynload/_gdbm*.so +endif + + cp -a $(d)-dbg/$(scriptdir)/config-$(VER)dm-$(DEB_HOST_MULTIARCH) \ + $(d_ldbg)/$(scriptdir)/ + dh_link -p$(p_ldbg) \ + /usr/lib/$(DEB_HOST_MULTIARCH)/libpython$(VER)dm.so \ + /$(scriptdir)/config-$(VER)dm-$(DEB_HOST_MULTIARCH)/libpython$(VER)dm.so \ + /usr/lib/$(DEB_HOST_MULTIARCH)/libpython$(VER)dm.so \ + /$(scriptdir)/config-$(VER)dm-$(DEB_HOST_MULTIARCH)/libpython$(VER).so \ + /$(scriptdir)/config-$(VER)dm-$(DEB_HOST_MULTIARCH)/libpython$(VER)dm.a \ + /usr/lib/$(DEB_HOST_MULTIARCH)/libpython$(VER)dm.a + + for i in $(d_ldev)/usr/include/$(PVER)m/*; do \ + i=$$(basename $$i); \ + case $$i in pyconfig.h) continue; esac; \ + ln -sf ../$(PVER)m/$$i $(d_ldbg)/usr/include/$(PVER)dm/$$i; \ + done + cp -p $(buildd_debug)/pyconfig.h $(d_ldbg)/usr/include/$(DEB_HOST_MULTIARCH)/$(PVER)dm/ + sed 's/@subdir@/$(PVER)dm/;s/@header@/pyconfig.h/' \ + debian/multiarch.h.in > $(d_ldbg)/usr/include/$(PVER)dm/pyconfig.h + + ln -sf $(PVER).1.gz $(d_dbg)/usr/share/man/man1/$(PVER)-dbg.1.gz + + : # in $(p_ldbg), prefix python-config with triplets + cp $(d)-dbg/usr/bin/$(PVER)dm-config \ + $(d_ldbg)/usr/bin/$(DEB_HOST_MULTIARCH)-$(PVER)dm-config + ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)dm-config \ + $(d_ldbg)/usr/bin/$(DEB_HOST_MULTIARCH)-$(PVER)-dbg-config + ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)m-config.1.gz \ + $(d_ldbg)/usr/share/man/man1/$(DEB_HOST_MULTIARCH)-$(PVER)dm-config.1.gz + ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)m-config.1.gz \ + $(d_ldbg)/usr/share/man/man1/$(DEB_HOST_MULTIARCH)-$(PVER)-dbg-config.1.gz +ifneq ($(DEB_HOST_MULTIARCH),$(DEB_HOST_GNU_TYPE)) + ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)dm-config \ + $(d_ldbg)/usr/bin/$(DEB_HOST_GNU_TYPE)-$(PVER)dm-config + ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)-config.1.gz \ + $(d_ldbg)/usr/share/man/man1/$(DEB_HOST_GNU_TYPE)-$(PVER)dm-config.1.gz + ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)dm-config \ + $(d_ldbg)/usr/bin/$(DEB_HOST_GNU_TYPE)-$(PVER)-dbg-config + ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)dm-config.1.gz \ + $(d_ldbg)/usr/share/man/man1/$(DEB_HOST_GNU_TYPE)-$(PVER)-dbg-config.1.gz +endif + ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)dm-config $(d_dbg)/usr/bin/$(PVER)dm-config + ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)dm-config.1.gz $(d_dbg)/usr/share/man/man1/$(PVER)dm-config.1.gz + + ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)-dbg-config $(d_dbg)/usr/bin/$(PVER)-dbg-config + ln -sf $(DEB_HOST_MULTIARCH)-$(PVER)-dbg-config.1.gz $(d_dbg)/usr/share/man/man1/$(PVER)-dbg-config.1.gz + + : # symlinks for the "old" include / config directory names + ln -sf $(PVER)-config.1.gz $(d_dbg)/usr/share/man/man1/$(PVER)-dbg-config.1.gz + ln -sf $(PVER).1.gz $(d_dbg)/usr/share/man/man1/$(PVER)dm.1.gz + ln -sf $(PVER)-config.1.gz $(d_dbg)/usr/share/man/man1/$(PVER)dm-config.1.gz + +ifeq ($(with_udeb),yes) + : # Copy the most important files from $(p_min) into $(p_udeb). + dh_installdirs -p$(p_udeb) \ + etc/$(PVER) \ + usr/bin \ + usr/include/$(PVER)mu \ + $(scriptdir)/lib-dynload \ + $(scriptdir)/config-$(VER)m-$(DEB_HOST_MULTIARCH) + cp -p $(d_min)/usr/bin/python$(VER) $(d_udeb)/usr/bin/ + ln -sf python$(VER)mu $(d_udeb)/usr/bin/python$(VER) + ln -sf python$(VER) $(d_udeb)/usr/bin/python3 + cp -p $(foreach i,$(MIN_MODS),$(d_min)/$(scriptdir)/$(i).py) \ + $(d_udeb)/$(scriptdir)/ + cp -a $(foreach i,$(MIN_PACKAGES),$(d_min)/$(scriptdir)/$(i)) \ + $(d_udeb)/$(scriptdir)/ + cp -p $(foreach i,$(MIN_ENCODINGS),$(d_min)/$(scriptdir)/$(i)) \ + $(d_udeb)/$(scriptdir)/ + cp -p $(d_min)/$(scriptdir)/config-$(VER)m-$(DEB_HOST_MULTIARCH)/Makefile \ + $(d_udeb)/$(scriptdir)/config-$(VER)m-$(DEB_HOST_MULTIARCH)/ + cp -p $(d_min)/usr/include/$(DEB_HOST_MULTIARCH)/$(PVER)m/pyconfig.h \ + $(d_udeb)/usr/include/$(DEB_HOST_MULTIARCH)/$(PVER)m/ + cp -p $(d_min)/$(scriptdir)/site.py $(d_udeb)/$(scriptdir)/ + cp -p debian/sitecustomize.py $(d_udeb)/etc/$(PVER)/ + dh_link -p$(p_udeb) /etc/$(PVER)/sitecustomize.py \ + /$(scriptdir)/sitecustomize.py +endif + + for i in debian/*.overrides; do \ + b=$$(basename $$i .overrides); \ + install -D -m 644 $$i debian/$$b/usr/share/lintian/overrides/$$b; \ + done + + touch stamps/stamp-install + +# Build architecture-independent files here. +binary-indep: build-indep install stamps/stamp-control + dh_testdir -i + dh_testroot -i + + : # $(p_doc) package + dh_installdirs -p$(p_doc) \ + usr/share/doc/$(p_base) \ + usr/share/doc/$(p_doc) + dh_installdocs -p$(p_doc) + cp -a Doc/build/html $(d_doc)/usr/share/doc/$(p_base)/ + rm -f $(d_doc)/usr/share/doc/$(p_base)/html/_static/jquery.js + dh_link -p$(p_doc) \ + /usr/share/doc/$(p_base)/html /usr/share/doc/$(p_doc)/html \ + /usr/share/javascript/jquery/jquery.js /usr/share/doc/$(p_base)/html/_static/jquery.js \ + /usr/share/javascript/underscore/underscore.js /usr/share/doc/$(p_base)/html/_static/underscore.js + + : # devhelp docs + cd $(buildd_static) && ./python ../debian/pyhtml2devhelp.py \ + ../$(d_doc)/usr/share/doc/$(p_base)/html index.html $(VER) \ + > ../$(d_doc)/usr/share/doc/$(p_base)/html/$(PVER).devhelp + gzip -9v $(d_doc)/usr/share/doc/$(p_base)/html/$(PVER).devhelp + dh_link -p$(p_doc) \ + /usr/share/doc/$(p_base)/html /usr/share/devhelp/books/$(PVER) + + for i in $(p_ltst); do \ + rm -rf debian/$$i/usr/share/doc/$$i; \ + ln -s $(p_lbase) debian/$$i/usr/share/doc/$$i; \ + done + + dh_installdebconf -i $(dh_args) + dh_installexamples -i $(dh_args) + dh_installmenu -i $(dh_args) + -dh_icons -i $(dh_args) || dh_iconcache -i $(dh_args) + dh_installchangelogs -i $(dh_args) + dh_link -i $(dh_args) + dh_compress -i $(dh_args) -X.py -X.cls -X.css -X.txt -X.json -X.js -Xobjects.inv -Xgdbinit + dh_fixperms -i $(dh_args) + + : # make python scripts starting with '#!' executable + for i in `find debian -mindepth 3 -type f ! -name '*.dpatch' ! -perm 755`; do \ + if head -1 $$i | grep -q '^#!'; then \ + chmod 755 $$i; \ + echo "make executable: $$i"; \ + fi; \ + done + -find $(d_doc) -name '*.txt' -perm 755 -exec chmod 644 {} \; + + dh_installdeb -i $(dh_args) + dh_gencontrol -i $(dh_args) + dh_md5sums -i $(dh_args) + dh_builddeb -i $(dh_args) + +# Build architecture-dependent files here. +binary-arch: build-arch install + dh_testdir -a + dh_testroot -a +# dh_installdebconf -a + dh_installexamples -a + dh_installmenu -a + -dh_icons -a || dh_iconcache -a +# dh_installmime -a + dh_installchangelogs -a + for i in $(p_dev) $(p_dbg); do \ + rm -rf debian/$$i/usr/share/doc/$$i; \ + ln -s $(p_base) debian/$$i/usr/share/doc/$$i; \ + done + for i in $(p_lbase); do \ + rm -rf debian/$$i/usr/share/doc/$$i; \ + ln -s $(p_lmin) debian/$$i/usr/share/doc/$$i; \ + done + for i in $(p_ldev) $(p_ldbg) $(p_lib); do \ + rm -rf debian/$$i/usr/share/doc/$$i; \ + ln -s $(p_lbase) debian/$$i/usr/share/doc/$$i; \ + done + -find debian ! -perm -200 -print -exec chmod +w {} \; +ifneq ($(with_tk),yes) + rm -f $(d_lbase)/$(scriptdir)/lib-dynload/_tkinter*.so +endif +ifneq ($(with_gdbm),yes) + rm -f $(d_lbase)/$(scriptdir)/lib-dynload/_gdbm*.so +endif + + dh_strip -a -N$(p_dbg) -Xdebug -Xdbg --dbg-package=$(p_dbg) + cp Tools/gdb/libpython.py $(d_dbg)/usr/lib/debug/usr/bin/$(PVER)m-gdb.py + ln -sf $(PVER)m-gdb.py $(d_dbg)/usr/lib/debug/usr/bin/$(PVER)dm-gdb.py + ln -sf $(PVER)m-gdb.py $(d_dbg)/usr/lib/debug/usr/bin/$(PVER)-dbg-gdb.py + ln -sf ../bin/$(PVER)m-gdb.py \ + $(d_dbg)/usr/lib/debug/usr/lib/lib$(PVER)m.so.1.0-gdb.py + ln -sf ../bin/$(PVER)m-gdb.py \ + $(d_dbg)/usr/lib/lib$(PVER)dm.so.1.0-gdb.py + dh_link -a + dh_compress -a -X.py + dh_fixperms -a + chmod 644 $(d_lmin)/$(scriptdir)/token.py + + : # make python scripts starting with '#!' executable + for i in `find debian -mindepth 3 -type f ! -name '*.dpatch' ! -perm 755`; do \ + if head -1 $$i | grep -q '^#!'; then \ + chmod 755 $$i; \ + echo "make executable: $$i"; \ + fi; \ + done + + dh_makeshlibs -p$(p_lib) -V '$(p_lib)' + dh_makeshlibs -p$(p_ldbg) -V '$(p_ldbg)' +# don't include the following symbols, found in extensions +# which either can be built as builtin or extension. + sed -ri \ + -e '/^ (PyInit_|_add_one_to_index|asdl_)/d' \ + -e '/^ (PyExpat_XML_|PyExpat_Xml)/d' \ + -e '/^ (ffi_type_|_ctypes_)/d' \ + $(d_lib)/DEBIAN/symbols $(d_ldbg)/DEBIAN/symbols + dh_installdeb -a + dh_shlibdeps -a + dep=`sed -n '/^shlibs:Depends/s/.*\(libc6[^,]*\).*/\1/p' $(d_min).substvars`; \ + echo "shlibs:Pre-Depends=$$dep" >> $(d_min).substvars + sed -i '/^shlibs:Depends/s/libc6[^,]*[, ]*//' $(d_min).substvars + dh_gencontrol -a + dh_md5sums -a + dh_builddeb -a + +# rules to patch the unpacked files in the source directory +# --------------------------------------------------------------------------- +# various rules to unpack addons and (un)apply patches. +# - patch / apply-patches +# - unpatch / reverse-patches + +patchdir = debian/patches + +glibc_version := $(shell dpkg -s locales | awk '/^Version:/ {print $$2}') +broken_utimes := $(shell dpkg --compare-versions $(glibc_version) lt 2.3.5 && echo yes || echo no) +old_sphinx := $(shell dpkg --compare-versions $$(dpkg -l python-sphinx | awk '/^ii *python-sphinx/ {print $$3}') lt 1 && echo yes || echo no) + +$(patchdir)/series: $(patchdir)/series.in + cpp -E \ + -D$(distribution) \ + $(if $(filter $(broken_utimes),yes),-DBROKEN_UTIMES) \ + $(if $(filter $(old_sphinx),yes),-DOLD_SPHINX) \ + -Darch_os_$(DEB_HOST_ARCH_OS) -Darch_$(DEB_HOST_ARCH) \ + -o - $(patchdir)/series.in \ + | egrep -v '^(#.*|$$)' > $(patchdir)/series + +patch-stamp: stamps/stamp-patch +patch: stamps/stamp-patch +stamps/stamp-patch: $(patchdir)/series + dh_testdir + uname -a + @echo USER=$$USER, LOGNAME=$$LOGNAME + QUILT_PATCHES=$(patchdir) quilt push -a || test $$? = 2 + rm -rf autom4te.cache configure + autoconf + mkdir -p stamps + echo ""; echo "Patches applied in this version:" > stamps/pxx + for i in $$(cat $(patchdir)/series); do \ + echo ""; echo "$$i:"; \ + sed -n 's/^# *DP: */ /p' $(patchdir)/$$i; \ + done >> stamps/pxx + + touch Parser/acceler.c Parser/grammar1.c Parser/listnode.c \ + Parser/node.c Parser/parser.c Parser/bitset.c Parser/metagrammar.c \ + Parser/firstsets.c Parser/grammar.c Parser/pgen.c + touch Objects/obmalloc.c Python/dynamic_annotations.c \ + Python/mysnprintf.c Python/pyctype.c Parser/tokenizer_pgen.c \ + Parser/printgrammar.c Parser/parsetok_pgen.c Parser/pgenmain.c + @sleep 1 + touch Grammar/Grammar + @sleep 1 + touch Include/graminit.h + @sleep 1 + touch Python/graminit.c + + ln -sf site-packages Lib/dist-packages + + mv stamps/pxx $@ + +reverse-patches: unpatch +unpatch: + QUILT_PATCHES=$(patchdir) quilt pop -a -R || test $$? = 2 + rm -f stamps/stamp-patch $(patchdir)/series + rm -rf configure autom4te.cache + +update-patches: $(patchdir)/series + export QUILT_PATCHES=$(patchdir); \ + export QUILT_REFRESH_ARGS="--no-timestamps --no-index -pab"; \ + export QUILT_DIFF_ARGS="--no-timestamps --no-index -pab"; \ + while quilt push; do quilt refresh; done + +binary: binary-indep binary-arch + +.PHONY: control-file configure build clean binary-indep binary-arch binary install + +# Local Variables: +# mode: makefile +# end: --- python3.4-3.4~b1.orig/debian/script.py +++ python3.4-3.4~b1/debian/script.py @@ -0,0 +1,61 @@ +#! /usr/bin/python3 + +# Copyright (C) 2012 Colin Watson . +# +# Permission is hereby granted, free of charge, to any person obtaining +# a copy of this software and associated documentation files (the +# "Software"), to deal in the Software without restriction, including +# without limitation the rights to use, copy, modify, merge, publish, +# distribute, sublicense, and/or sell copies of the Software, and to +# permit persons to whom the Software is furnished to do so, subject +# to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +"""Trivial script(1) workalike, but without reading from standard input.""" + +import os +import pty +import select +import sys + +filename = sys.argv[1] +command = sys.argv[2] + +pid, master = pty.fork() +if pid == 0: # child + os.execlp("sh", "sh", "-c", command) + +# parent +with open(filename, "wb") as logfile: + try: + while True: + rfds, _, _ = select.select([master], [], []) + if master in rfds: + data = os.read(master, 65536) + os.write(1, data) + logfile.write(data) + logfile.flush() + except (IOError, OSError): + pass + +pid, status = os.wait() +returncode = 0 +if os.WIFSIGNALED(status): + returncode = -os.WTERMSIG(status) +elif os.WIFEXITED(status): + returncode = os.WEXITSTATUS(status) +else: + # Should never happen + raise RuntimeError("Unknown child exit status!") +os.close(master) +sys.exit(returncode) --- python3.4-3.4~b1.orig/debian/sitecustomize.py.in +++ python3.4-3.4~b1/debian/sitecustomize.py.in @@ -0,0 +1,7 @@ +# install the apport exception handler if available +try: + import apport_python_hook +except ImportError: + pass +else: + apport_python_hook.install() --- python3.4-3.4~b1.orig/debian/source.lintian-overrides +++ python3.4-3.4~b1/debian/source.lintian-overrides @@ -0,0 +1,2 @@ +# generated during the build +python3.4 source: quilt-build-dep-but-no-series-file --- python3.4-3.4~b1.orig/debian/source.lintian-overrides.in +++ python3.4-3.4~b1/debian/source.lintian-overrides.in @@ -0,0 +1,2 @@ +# generated during the build +@PVER@ source: quilt-build-dep-but-no-series-file --- python3.4-3.4~b1.orig/debian/source/format +++ python3.4-3.4~b1/debian/source/format @@ -0,0 +1 @@ +1.0 --- python3.4-3.4~b1.orig/debian/tests/control +++ python3.4-3.4~b1/debian/tests/control @@ -0,0 +1,9 @@ +Tests: testsuite +Depends: build-essential, locales, python3.4-dev, libpython3.4-testsuite, python3-gdbm +# need to turn off apport +Restrictions: needs-root + +Tests: testsuite-dbg +Depends: build-essential, locales, python3.4-dev, python3.4-dbg, libpython3.4-testsuite, python3-gdbm-dbg, gdb +# need to turn off apport +Restrictions: needs-root --- python3.4-3.4~b1.orig/debian/tests/testsuite +++ python3.4-3.4~b1/debian/tests/testsuite @@ -0,0 +1,113 @@ +#!/bin/sh + +set -e + +if [ "$(whoami)" = root ]; then + # stop apport + stop apport 2>/dev/null || true + sed -i '/^enabled=/s/=.*/=0/' /etc/default/apport 2>/dev/null + # don't change anything when runnning as nobody + if [ -n "$SUDO_USER" ]; then + if [ -n "$TMPDIR" ] && [ -d "$TMPDIR" ]; then + chown -R $SUDO_USER $TMPDIR + fi + if [ -n "$ADTTMP" ] && [ -d "$ADTTMP" ]; then + chown -R $SUDO_USER $ADTTMP + fi + fi + su_user=${SUDO_USER:-nobody} +fi +# no root access needed after this point + +if status apport | grep -q start; then + echo >&2 "apport is running. needs to be disabled before running the tests" + exit 1 +fi + +debian_dir=$(dirname $(dirname $0)) + +export LOCPATH=$(pwd)/locales +sh $debian_dir/locale-gen + +export LANG=C + +TESTPYTHON="python3.4 -W default -bb -E -R -m test" +TESTOPTS="-j 1 -w -uall,-network,-urlfetch,-gui" +TESTEXCLUSIONS="-x" + +# test_cmd_line_script: FIXME, https://launchpad.net/bugs/1264554 +TESTEXCLUSIONS="$TESTEXCLUSIONS test_cmd_line_script" + +# test_code_module: Issue 17756, reason unknown +TESTEXCLUSIONS="$TESTEXCLUSIONS test_code_module" + +# test_compileall: FIXME, https://launchpad.net/bugs/1264554 +TESTEXCLUSIONS="$TESTEXCLUSIONS test_compileall" + +# test_curses: Don't run for now, issue with new curses? +TESTEXCLUSIONS="$TESTEXCLUSIONS test_curses" + +# test_dbm: Fails from time to time ... +TESTEXCLUSIONS="$TESTEXCLUSIONS test_dbm" + +# test_distutils: Issue 17752, many failures in installed location +TESTEXCLUSIONS="$TESTEXCLUSIONS test_distutils" + +# test_ensurepip: not yet installed, http://bugs.debian.org/732703 +# ... and then test_venv fails too +TESTEXCLUSIONS="$TESTEXCLUSIONS test_ensurepip test_venv " + +# test_gdb: not run for the optimized build +TESTEXCLUSIONS="$TESTEXCLUSIONS test_gdb" + +# test_platform: Issue 17762 needs upstreaming +TESTEXCLUSIONS="$TESTEXCLUSIONS test_platform " + +# test_pydoc: Issue 17763, interfers with packages in dist-packages +TESTEXCLUSIONS="$TESTEXCLUSIONS test_pydoc" + +# test_site: FIXME, https://launchpad.net/bugs/1264554 +TESTEXCLUSIONS="$TESTEXCLUSIONS test_site " + +# test_tools: not relevant for installed version +TESTEXCLUSIONS="$TESTEXCLUSIONS test_tools" + +# test_zipfile: Issue 17753, requires write access to test and email.test +TESTEXCLUSIONS="$TESTEXCLUSIONS test_zipfile" + +# test_zipimport_support: FIXME, https://launchpad.net/bugs/1264554 +TESTEXCLUSIONS="$TESTEXCLUSIONS test_zipimport_support" + +# test_subprocess: Issue 17757, two failing tests +TESTEXCLUSIONS="$TESTEXCLUSIONS test_subprocess" + +# test_uuid: fails, but not on the buildd. need to investigate +TESTEXCLUSIONS="$TESTEXCLUSIONS test_uuid" + +if [ "$(whoami)" = root ]; then + su_user=${SUDO_USER:-nobody} +fi + +if [ "$su_user" = nobody ]; then + log=/dev/null + # test_site: Issue 17758, fails to create HOME + TESTEXCLUSIONS="$TESTEXCLUSIONS test_site" +else + log=testsuite.log +fi + +script=$debian_dir/script.py +if [ -f "$script" ]; then + cmd="python3.4 $script \"$log\" \"$TESTPYTHON $TESTOPTS $TESTEXCLUSIONS\"" +else + cmd="$TESTPYTHON $TESTOPTS $TESTEXCLUSIONS" +fi + +echo "Running the python testsuite with the standard interpreter:" +if [ "$(whoami)" = root ]; then + echo "su -c $cmd $su_user" + su -c "$cmd" $su_user +else + echo "$cmd" + eval $cmd +fi --- python3.4-3.4~b1.orig/debian/tests/testsuite-dbg +++ python3.4-3.4~b1/debian/tests/testsuite-dbg @@ -0,0 +1,110 @@ +#!/bin/sh + +set -e + +if [ "$(whoami)" = root ]; then + # stop apport + stop apport 2>/dev/null || true + sed -i '/^enabled=/s/=.*/=0/' /etc/default/apport 2>/dev/null + # don't change anything when runnning as nobody + if [ -n "$SUDO_USER" ]; then + if [ -n "$TMPDIR" ] && [ -d "$TMPDIR" ]; then + chown -R $SUDO_USER $TMPDIR + fi + if [ -n "$ADTTMP" ] && [ -d "$ADTTMP" ]; then + chown -R $SUDO_USER $ADTTMP + fi + fi + su_user=${SUDO_USER:-nobody} +fi +# no root access needed after this point + +if status apport | grep -q start; then + echo >&2 "apport is running. needs to be disabled before running the tests" + exit 1 +fi + +debian_dir=$(dirname $(dirname $0)) + +export LOCPATH=$(pwd)/locales +sh $debian_dir/locale-gen + +export LANG=C + +TESTPYTHON="python3.4dm -W default -bb -E -R -m test" +TESTOPTS="-j 1 -w -uall,-network,-urlfetch,-gui" +TESTEXCLUSIONS="-x" + +# test_cmd_line_script: FIXME, https://launchpad.net/bugs/1264554 +TESTEXCLUSIONS="$TESTEXCLUSIONS test_cmd_line_script" + +# test_code_module: Issue 17756, reason unknown +TESTEXCLUSIONS="$TESTEXCLUSIONS test_code_module" + +# test_compileall: FIXME, https://launchpad.net/bugs/1264554 +TESTEXCLUSIONS="$TESTEXCLUSIONS test_compileall" + +# test_curses: Don't run for now, issue with new curses? +TESTEXCLUSIONS="$TESTEXCLUSIONS test_curses" + +# test_dbm: Fails from time to time ... +TESTEXCLUSIONS="$TESTEXCLUSIONS test_dbm" + +# test_distutils: Issue 17752, many failures in installed location +TESTEXCLUSIONS="$TESTEXCLUSIONS test_distutils" + +# test_ensurepip: not yet installed, http://bugs.debian.org/732703 +# ... and then test_venv fails too +TESTEXCLUSIONS="$TESTEXCLUSIONS test_ensurepip test_venv " + +# test_platform: Issue 17762 needs upstreaming +TESTEXCLUSIONS="$TESTEXCLUSIONS test_platform " + +# test_pydoc: Issue 17763, interfers with packages in dist-packages +TESTEXCLUSIONS="$TESTEXCLUSIONS test_pydoc" + +# test_site: FIXME, https://launchpad.net/bugs/1264554 +TESTEXCLUSIONS="$TESTEXCLUSIONS test_site " + +# test_tools: not relevant for installed version +TESTEXCLUSIONS="$TESTEXCLUSIONS test_tools" + +# test_zipfile: Issue 17753, requires write access to test and email.test +TESTEXCLUSIONS="$TESTEXCLUSIONS test_zipfile" + +# test_zipimport_support: FIXME, https://launchpad.net/bugs/1264554 +TESTEXCLUSIONS="$TESTEXCLUSIONS test_zipimport_support" + +# test_subprocess: Issue 17757, two failing tests +TESTEXCLUSIONS="$TESTEXCLUSIONS test_subprocess" + +# test_uuid: fails, but not on the buildd. need to investigate +TESTEXCLUSIONS="$TESTEXCLUSIONS test_uuid" + +if [ "$(whoami)" = root ]; then + su_user=${SUDO_USER:-nobody} +fi + +if [ "$su_user" = nobody ]; then + log=/dev/null + # test_site: Issue 17758, fails to create HOME + TESTEXCLUSIONS="$TESTEXCLUSIONS test_site" +else + log=testsuite-dbg.log +fi + +script=$debian_dir/script.py +if [ -f "$script" ]; then + cmd="python3.4 $script \"$log\" \"$TESTPYTHON $TESTOPTS $TESTEXCLUSIONS\"" +else + cmd="$TESTPYTHON $TESTOPTS $TESTEXCLUSIONS" +fi + +echo "Running the python testsuite with the debug enabled interpreter:" +if [ "$(whoami)" = root ]; then + echo "su -c $cmd $su_user" + su -c "$cmd" $su_user +else + echo "$cmd" + eval $cmd +fi --- python3.4-3.4~b1.orig/debian/watch +++ python3.4-3.4~b1/debian/watch @@ -0,0 +1,3 @@ +version=3 +opts=dversionmangle=s/.*\+//,uversionmangle=s/([abcr]+[1-9])$/~$1/ \ + http://www.python.org/ftp/python/3\.2(\.\d)?/Python-(3\.2[.\dabcr]*)\.tgz