Commit Graph

42499 Commits

Author SHA1 Message Date
Benjamin Peterson b0125892e6 account for different ref counting semantics of _PyObject_LookupSpecial 2010-07-02 13:35:17 +00:00
Georg Brandl 8971f74c55 Merged revisions 82433 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r82433 | georg.brandl | 2010-07-02 09:33:50 +0200 (Fr, 02 Jul 2010) | 1 line

  Grammar and markup fixes.
........
2010-07-02 07:41:51 +00:00
Benjamin Peterson 963babcd05 Blocked revisions 82429 via svnmerge
........
  r82429 | benjamin.peterson | 2010-07-01 18:35:37 -0500 (Thu, 01 Jul 2010) | 1 line

  trunc does use the special method, though
........
2010-07-01 23:39:26 +00:00
Benjamin Peterson b51b5c4be7 Merged revisions 82420 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r82420 | benjamin.peterson | 2010-07-01 12:45:52 -0500 (Thu, 01 Jul 2010) | 1 line

  fix fixer name
........
2010-07-01 17:49:01 +00:00
Benjamin Peterson 8bb9cde6c0 correctly lookup __trunc__ and __floor__ 2010-07-01 15:16:55 +00:00
Benjamin Peterson 6e73b19747 Blocked revisions 82415 via svnmerge
........
  r82415 | benjamin.peterson | 2010-07-01 10:07:15 -0500 (Thu, 01 Jul 2010) | 1 line

  remove docs about delegating to special methods; it does no such thing
........
2010-07-01 15:09:14 +00:00
Ezio Melotti 57221d02ba Update PyUnicode_DecodeUTF8 from RFC 2279 to RFC 3629.
1) #8271: when a byte sequence is invalid, only the start byte and all the
   valid continuation bytes are now replaced by U+FFFD, instead of replacing
   the number of bytes specified by the start byte.
   See http://www.unicode.org/versions/Unicode5.2.0/ch03.pdf (pages 94-95);
2) 5- and 6-bytes-long UTF-8 sequences are now considered invalid (no changes
   in behavior);
3) Change the error messages "unexpected code byte" to "invalid start byte"
   and "invalid data" to "invalid continuation byte";
4) Add an extensive set of tests in test_unicode;
5) Fix test_codeccallbacks because it was failing after this change.
2010-07-01 07:32:02 +00:00
Benjamin Peterson ead3c83ea9 Merged revisions 82409 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r82409 | benjamin.peterson | 2010-06-30 13:41:08 -0500 (Wed, 30 Jun 2010) | 1 line

  an AttributeError is perfectly acceptable here
........
2010-06-30 18:44:04 +00:00
Giampaolo Rodolà 610aa4f07f Merged revisions 82404 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r82404 | giampaolo.rodola | 2010-06-30 19:38:28 +0200 (mer, 30 giu 2010) | 1 line

  fix issue #6589: cleanup asyncore.socket_map if smtpd.SMTPServer constructor raises an exception
........
2010-06-30 17:47:39 +00:00
Benjamin Peterson 1cc6df97bc Merged revisions 82403 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r82403 | benjamin.peterson | 2010-06-30 12:11:08 -0500 (Wed, 30 Jun 2010) | 1 line

  mark test depending on ref counting
........
2010-06-30 17:39:45 +00:00
Mark Dickinson d24305489b Blocked revisions 82399-82400 via svnmerge
........
  r82399 | mark.dickinson | 2010-06-30 15:19:56 +0100 (Wed, 30 Jun 2010) | 1 line

  Update Demo/parser directory; backport unparse fixes from py3k.
........
  r82400 | mark.dickinson | 2010-06-30 17:27:57 +0100 (Wed, 30 Jun 2010) | 2 lines

  Issue #9125:  Update parser module for "except ... as ..." syntax.
........
2010-06-30 16:36:12 +00:00
Michael Foord b3a8984488 Issue 9110. Adding ContextDecorator to contextlib. This enables the creation of APIs that act as decorators as well as context managers. contextlib.contextmanager changed to use ContextDecorator. 2010-06-30 12:17:50 +00:00
Mark Dickinson cba8c10b5c Unparse infinite imaginary literals correctly. Add some more numeric tests. 2010-06-30 11:45:53 +00:00
Mark Dickinson abe52d749c Revert accidental extra changes included in r82391. 2010-06-30 11:14:30 +00:00
Mark Dickinson 50b79a80bd Issue #9011: Tests for Python 3.2's treatment of negated imaginary literals. 2010-06-30 11:13:36 +00:00
Mark Dickinson af0e1544bf Remove backtick syntax for repr. 2010-06-30 09:14:43 +00:00
Mark Dickinson b67e15c53c Better solution for attribute access on integer literals. 2010-06-30 09:05:47 +00:00
Mark Dickinson 81ad8ccdfb Output try-except-finally statements where appropriate. 2010-06-30 08:46:53 +00:00
Mark Dickinson 8d6d760422 Collapse else: if: ... into elif: 2010-06-30 08:32:11 +00:00
Mark Dickinson 719e4e3ba5 Merged revisions 82379 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r82379 | mark.dickinson | 2010-06-29 21:09:12 +0100 (Tue, 29 Jun 2010) | 1 line

  Issue #1789:  clarify that the 'size' column in struct docs refers to standard size.
........
2010-06-29 20:10:42 +00:00
Mark Dickinson 578aa56f9a Fix typo in unparsing of a class definition. 2010-06-29 18:38:59 +00:00
Benjamin Peterson 927ccd257f update for nonlocal keyword 2010-06-29 18:36:39 +00:00
Brett Cannon 0e13c9451e Make a sentence a little less awkward. 2010-06-29 18:26:11 +00:00
Benjamin Peterson 162dd7484e note that byte strings can be raw, too #9114 2010-06-29 15:57:57 +00:00
Benjamin Peterson ac16bdec57 Blocked revisions 82368 via svnmerge
........
  r82368 | benjamin.peterson | 2010-06-29 10:18:02 -0500 (Tue, 29 Jun 2010) | 1 line

  group cStringIO docs under its factory function
........
2010-06-29 15:32:34 +00:00
Vinay Sajip d31f363b48 Added information about pickle security and SocketHandler, and some cross-reference targets. 2010-06-29 15:31:15 +00:00
Mark Dickinson d751c2eafc test_unparse.py: Do roundtrip testing for all Python files in Lib and Lib/test. 2010-06-29 14:08:23 +00:00
Mark Dickinson 8042e28192 More unparse.py fixes:
- parenthesize lambdas, to avoid turning (lambda : int)() into lambda: int()
 - unparse an infinite float literals in the AST as an overflowing finite value

unparse.py now successfully round-trips on all valid Lib/*.py and Lib/test/*.py files.
2010-06-29 10:01:48 +00:00
Mark Dickinson 3eb0290346 Add parentheses around numeric literals, to avoid turning 3 .bit_length() into 3.bit_length(). 2010-06-29 08:52:36 +00:00
Mark Dickinson 82c8d93357 unparse.py: respect coding cookie in input files 2010-06-29 07:48:23 +00:00
Mark Dickinson 3c0b317e36 Merged revisions 82356 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r82356 | mark.dickinson | 2010-06-29 08:37:25 +0100 (Tue, 29 Jun 2010) | 1 line

  Spelling.
........
2010-06-29 07:38:37 +00:00
Benjamin Peterson fb288dac9d rephrase and remove uneeded statement 2010-06-29 01:27:35 +00:00
Brian Curtin 3778db7b51 Update md5driver.py for 3.x.
Changed an import, replaced md5.new() with md5(), and added an encode where needed.
2010-06-29 00:14:28 +00:00
Mark Dickinson 3d1bfbf9a6 unparse.py: Typo fix. 2010-06-28 21:39:51 +00:00
Mark Dickinson fa2e4e9d04 Update Demo/parser/unparse.py to current Python 3.x syntax. Additions:
- relative imports
 - keyword-only arguments
 - function annotations
 - class decorators
 - raise ... from ...
 - except ... as ...
 - nonlocal
 - bytes literals
 - set literals
 - set comprehensions
 - dict comprehensions
Removals:
 - print statement.

Some of this should be backported to 2.x.
2010-06-28 21:14:17 +00:00
Mark Dickinson f5451e546a Merged revisions 82345 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r82345 | mark.dickinson | 2010-06-28 20:54:19 +0100 (Mon, 28 Jun 2010) | 1 line

  unparse.py:  fix mispaced parentheses in chained comparisons
........
2010-06-28 20:09:18 +00:00
Mark Dickinson ae1000533a Merged revisions 82338,82340-82341 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r82338 | mark.dickinson | 2010-06-28 20:31:41 +0100 (Mon, 28 Jun 2010) | 9 lines

  Fix some shallow bugs in Demo/parser/unparse.py, and add tests:

    - insert commas between entries in del statement
    - left and right shifts were represented as >> and << (respectively); reverse
    - unindent properly after for: else:  or while: else:
    - add parens around the result of an unary operation
    - add parens around negative numbers, to avoid turning (-1)**2 into -1**2.
........
  r82340 | mark.dickinson | 2010-06-28 20:34:15 +0100 (Mon, 28 Jun 2010) | 1 line

  Fix typo in test_unparse.py.
........
  r82341 | mark.dickinson | 2010-06-28 20:38:19 +0100 (Mon, 28 Jun 2010) | 1 line

  Set svn:eol-style on test_unparse.py.
........
2010-06-28 19:44:20 +00:00
Benjamin Peterson e893af5ab7 update error message 2010-06-28 19:43:42 +00:00
Senthil Kumaran 13a7eb4529 Merged revisions 82334 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r82334 | senthil.kumaran | 2010-06-28 22:37:40 +0530 (Mon, 28 Jun 2010) | 3 lines

  Documentation correction. urllib2.urlopen.info returns a mimetools.Message instance not HTTPMessage object.
........
2010-06-28 17:31:40 +00:00
Benjamin Peterson 902d2bd64d Merged revisions 82332 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r82332 | benjamin.peterson | 2010-06-28 10:41:06 -0500 (Mon, 28 Jun 2010) | 1 line

  fix skipping condition
........
2010-06-28 15:43:25 +00:00
Benjamin Peterson 17e0bbc30c Merged revisions 82330 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r82330 | benjamin.peterson | 2010-06-28 10:36:40 -0500 (Mon, 28 Jun 2010) | 1 line

  testcapi tests are definitely cpython only
........
2010-06-28 15:39:55 +00:00
Alexander Belopolsky 311d2a93a1 Added missing white space 2010-06-28 14:36:55 +00:00
Senthil Kumaran 8749a63473 Merged revisions 82324 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r82324 | senthil.kumaran | 2010-06-28 19:26:46 +0530 (Mon, 28 Jun 2010) | 3 lines

  Fix Issue8653 - Docstring for urlunsplit function.
........
2010-06-28 14:08:00 +00:00
Brett Cannon b7183d8c1f Add an inheritance test for importlib.abc.SourceLoader. 2010-06-28 05:46:25 +00:00
Brett Cannon 0cf9e6a621 Move importlib.abc.SourceLoader to _bootstrap.
Required updating code relying on other modules to switch to _bootstrap's
unique module requirements. This led to the realization that
get_code was being too liberal in its exception catching when calling set_data
by blindly grabbing IOError. Shifted the responsibility of safely ignoring
writes to a read-only path to set_data.

Importlib is still not relying on SourceLoader yet; requires creating a
SourcelessLoader and updating the source finder.
2010-06-28 04:57:24 +00:00
Benjamin Peterson 9396483ba4 Merged revisions 82317 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r82317 | benjamin.peterson | 2010-06-27 21:58:25 -0500 (Sun, 27 Jun 2010) | 1 line

  remove unused last argument to property_copy
........
2010-06-28 03:07:10 +00:00
Benjamin Peterson 2215c14f03 fix test with more obviously incorrect bytecode 2010-06-28 00:24:13 +00:00
Benjamin Peterson 56894b501a fix versionchanged 2010-06-28 00:16:12 +00:00
Benjamin Peterson 7ab4b8d3a2 Merged revisions 77402,77505,77510 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r77402 | brett.cannon | 2010-01-09 20:56:19 -0600 (Sat, 09 Jan 2010) | 12 lines

  DeprecationWarning is now silent by default.

  This was originally suggested by Guido, discussed on the stdlib-sig mailing
  list, and given the OK by Guido directly to me. What this change essentially
  means is that Python has taken a policy of silencing warnings that are only
  of interest to developers by default. This should prevent users from seeing
  warnings which are triggered by an application being run against a new
  interpreter before the app developer has a chance to update their code.

  Closes issue #7319. Thanks to Antoine Pitrou, Ezio Melotti, and Brian Curtin
  for helping with the issue.
........
  r77505 | brett.cannon | 2010-01-14 14:00:28 -0600 (Thu, 14 Jan 2010) | 7 lines

  The silencing of DeprecationWarning was not taking -3 into consideration. Since
  Py3K warnings are DeprecationWarning by default this was causing -3 to
  essentially be a no-op. Now DeprecationWarning is only silenced if -3 is not
  used.

  Closes issue #7700. Thanks Ezio Melotti and Florent Xicluna for patch help.
........
  r77510 | brett.cannon | 2010-01-14 19:31:45 -0600 (Thu, 14 Jan 2010) | 1 line

  Remove C++/C99-style comments.
........
2010-06-28 00:01:59 +00:00
Brett Cannon f23e374441 Implement importlib.abc.SourceLoader and deprecate PyLoader and PyPycLoader.
SourceLoader is a simplification of both PyLoader and PyPycLoader. If one only
wants to use source, then they need to only implement get_data and
get_filename. To also use bytecode -- sourceless loading is not supported --
then two abstract methods -- path_mtime and set_data -- need to be implemented.
Compared to PyLoader and PyPycLoader, there are less abstract methods
introduced and bytecode files become an optimization controlled by the ABC and
hidden from the user (this need came about as PEP 3147 showed that not treating
bytecode as an optimization can cause problems for compatibility).

PyLoader is deprecated in favor of SourceLoader. To be compatible from Python
3.1 onwards, a subclass need only use simple methods for source_path and
is_package. Otherwise conditional subclassing based on whether Python 3.1 or
Python 3.2 is being is the only change. The documentation and docstring for
PyLoader explain what is exactly needed.

PyPycLoader is deprecated also in favor of SourceLoader. Because PEP 3147
shifted bytecode path details so much, there is no foolproof way to provide
backwards-compatibility with SourceLoader. Because of this the class is simply
deprecated and users should move to SourceLoader (and optionally PyLoader for
Python 3.1). This does lead to a loss of support for sourceless loading
unfortunately.

At some point before Python 3.2 is released, SourceLoader will be moved over to
importlib._bootstrap so that the core code of importlib relies on the new code
instead of the old PyPycLoader code. This commit is being done now so that
there is no issue in having the API in Python 3.1a1.
2010-06-27 23:57:46 +00:00