Commit Graph

92970 Commits

Author SHA1 Message Date
Victor Stinner 60387e032b Null merge 3.5 2016-01-28 18:14:38 +01:00
Victor Stinner 8f475effbc Backport fixes on test_eintr
* Issue #25234: Skip test_eintr.test_open() under OS X to avoid hanging
* Issue #25868: Try to make test_eintr.test_sigwaitinfo() more reliable
  especially on slow buildbots. Use a pipe to synchronize the parent and the
  child processes.
2016-01-28 18:13:45 +01:00
Berker Peksag c661e1d10d Issue #24705: Add a test case for ef84d21f5292 2016-01-28 16:58:23 +02:00
Berker Peksag ad13edb6fd Issue #24705: Add a test case for ef84d21f5292 2016-01-28 16:58:00 +02:00
Victor Stinner c8d2fb4112 Merge 3.5: Issue #26227 2016-01-28 15:44:10 +01:00
Victor Stinner 7240030c52 Windows: Decode hostname from ANSI code page
Issue #26227: On Windows, getnameinfo(), gethostbyaddr() and gethostbyname_ex()
functions of the socket module now decode the hostname from the ANSI code page
rather than UTF-8.
2016-01-28 15:41:01 +01:00
Berker Peksag 68df686954 Add a link to PEP 384 in stable.rst 2016-01-28 12:42:45 +02:00
Martin Panter 9d48869fcc Issue #19023: Merge ctypes doc and tests from 3.5 2016-01-29 10:25:40 +00:00
Martin Panter 34360c8e09 Issue #19023: Document ctypes array and pointer classes
Also add some more tests. Based on patch by Sye van der Veen.
2016-01-29 10:12:19 +00:00
Berker Peksag 806cb0f2b6 Add a link to PEP 384 in stable.rst 2016-01-28 12:42:26 +02:00
Berker Peksag 81a5092285 Issue #26034: Improve wording of clear parameter 2016-01-28 09:13:32 +02:00
Berker Peksag 22532ac2eb Issue #26034: Improve wording of clear parameter 2016-01-28 09:13:14 +02:00
Berker Peksag 1b95517337 Issue #26034: Sync documentation of --clear with its behavior
Most of the docs has already been updated in c3c188a0325a.
2016-01-28 09:01:49 +02:00
Berker Peksag 547f66f599 Issue #26034: Sync documentation of --clear with its behavior
Most of the docs has already been updated in c3c188a0325a.
2016-01-28 09:01:26 +02:00
Berker Peksag 0fe1b472ab Issue #26199: Fix broken link in unittest.mock-examples.rst
Patch by Raphael Das Gupta.
2016-01-28 08:40:21 +02:00
Martin Panter 5da4e86bc0 Issue #26220: Merge Unicode how-to from 3.5 2016-01-29 04:06:49 +00:00
Martin Panter 4942870471 Issue #26220: Remove outdated comment about a question mark 2016-01-29 04:01:16 +00:00
Berker Peksag a370a4271e Issue #26199: Fix broken link in unittest.mock-examples.rst
Patch by Raphael Das Gupta.
2016-01-28 08:40:03 +02:00
Terry Jan Reedy 0110dfc523 Merge with 3.5 2016-01-27 11:52:13 -05:00
Terry Jan Reedy b31a2849da Issue #25507: revert incorrect movement of idleConf import in c548ad75160c.
Augment htest to include all major IOBinding functions.
2016-01-27 11:51:50 -05:00
Victor Stinner 5b96f17b1c Merge 3.5 2016-01-27 17:01:13 +01:00
Victor Stinner 5bc03a6d4d Fix resize_compact()
Issue #26217: resize_compact() must set wstr_length to 0 after freeing the wstr
string. Otherwise, an assertion fails in _PyUnicode_CheckConsistency().
2016-01-27 16:56:53 +01:00
Raymond Hettinger 0ef0423cb2 merge 2016-01-26 21:46:03 -08:00
Raymond Hettinger 3743432302 Issue #26194: Fix undefined behavior for deque.insert() when len(d) == maxlen 2016-01-26 21:44:16 -08:00
Victor Stinner be59d1489b Issue #26146: enhance ast.Constant error message
Mention the name of the invalid type in error message of AST validation for
constants.

Suggestion made by Joseph Jevnik on a review.
2016-01-27 00:39:12 +01:00
Victor Stinner 25219f596a Issue #26146: remove useless code
obj2ast_constant() code is baesd on obj2ast_object() which has a special case
for Py_None. But in practice, we don't need to have a special case for
constants.

Issue noticed by Joseph Jevnik on a review.
2016-01-27 00:37:59 +01:00
Victor Stinner 726f6902ce Fix a refleak in validate_constant()
Issue #26146.
2016-01-27 00:11:47 +01:00
Raymond Hettinger 906d82db6d Fix typo 2016-01-25 23:00:21 -08:00
Senthil Kumaran 0b57f0adde merge from 3.5
Remove unnecessary test case comment in urllib.parse.py. These are asserted as test cases.
2016-01-25 18:54:37 -08:00
Senthil Kumaran d4e51f45a9 Remove unnecessary test case comment in urllib.parse.py. These are asserted as test cases. 2016-01-25 18:53:34 -08:00
Victor Stinner f2c1aa1661 Add ast.Constant
Issue #26146: Add a new kind of AST node: ast.Constant. It can be used by
external AST optimizers, but the compiler does not emit directly such node.

An optimizer can replace the following AST nodes with ast.Constant:

* ast.NameConstant: None, False, True
* ast.Num: int, float, complex
* ast.Str: str
* ast.Bytes: bytes
* ast.Tuple if items are constants too: tuple
* frozenset

Update code to accept ast.Constant instead of ast.Num and/or ast.Str:

* compiler
* docstrings
* ast.literal_eval()
* Tools/parser/unparse.py
2016-01-26 00:40:57 +01:00
Raymond Hettinger 0dceb91866 Tests versus zero are more compact than tests versus -1. 2016-01-25 10:33:30 -08:00
Raymond Hettinger 1ce6885f8a Fix compiler warning about obviously unreachable code. 2016-01-24 22:15:20 -08:00
Raymond Hettinger 306d6b1ea6 Convert another post-decrement while-loop to pre-decrement for consistency
and better generated code (on both GCC and CLang).
2016-01-24 12:40:42 -08:00
Raymond Hettinger 165eee214b Convert two other post-decrement while-loops to pre-decrements for consistency
and for better code generation.
2016-01-24 11:32:07 -08:00
Raymond Hettinger d84ec225bd Miscellaneous refactorings
* Add comment to the maxlen structure entry about the meaning of maxlen == -1
* Factor-out code common to deque_append(left) and deque_extend(left)
* Factor inner-loop in deque_clear() to use only 1 test per loop instead of 2
* Tighten inner-loops for deque_item() and deque_ass_item() so that the
  compiler can combine the decrement and test into a single step.
2016-01-24 09:12:06 -08:00
Victor Stinner 1aa78938b0 Issue #26146: marshal.loads() now uses the empty frozenset singleton 2016-01-23 14:15:48 +01:00
Victor Stinner 5ebe2c89fe Cleanup test_dict
* Write one import per line
* Sort imports by name
* Add an empty line: 2 empty lines between code blocks at the module level (PEP 8)
2016-01-23 13:52:05 +01:00
Victor Stinner 843a1fb1e7 test_gc: remove unused imports 2016-01-23 13:29:02 +01:00
Brett Cannon 9fa812668f Issue #18018: Raise an ImportError if a relative import is attempted
with no known parent package.

Previously SystemError was raised if the parent package didn't exist
(e.g., __package__ was set to '').
Thanks to Florent Xicluna and Yongzhi Pan for reporting the issue.
2016-01-22 16:39:02 -08:00
Brett Cannon 4b18dd339a Issue #25234: Skip test_eintr.test_open() under OS X to avoid hanging 2016-01-22 15:55:56 -08:00
Brett Cannon b0db3718d4 whitespace cleanup 2016-01-22 15:26:56 -08:00
Brett Cannon 849113af6b Issue #25791: Warn when __package__ != __spec__.parent.
In a previous change, __spec__.parent was prioritized over
__package__. That is a backwards-compatibility break, but we do
eventually want __spec__ to be the ground truth for module details. So
this change reverts the change in semantics and instead raises an
ImportWarning when __package__ != __spec__.parent to give people time
to adjust to using spec objects.
2016-01-22 15:25:50 -08:00
Brett Cannon 52c854a838 Merge from 3.5 2016-01-22 14:05:41 -08:00
Brett Cannon 3bf1d87bbd Fix a typo in a code example 2016-01-22 14:03:27 -08:00
Victor Stinner bf980797af Merge 3.5 (i18n doc, issue #25907) 2016-01-22 18:00:31 +01:00
Victor Stinner 875f29aa69 doc: i18n HTML templates
Issue #25907: Use {% trans %} tags in HTML templates to ease the translation of
the documentation. The tag comes from Jinja templating system, used by Sphinx.

Patch written by Julien Palard.
2016-01-22 18:00:05 +01:00
Victor Stinner fd9ccaea03 Null merge 3.5 (change already applied to default) 2016-01-22 15:59:02 +01:00
Victor Stinner 5a701f0304 Issue #25876: Fix also test_set() of test_gdb when -E command line is used 2016-01-22 15:04:27 +01:00
Victor Stinner 22756f18bc Issue #25876: test_gdb: use subprocess._args_from_interpreter_flags() to test
Python with more options.
2016-01-22 14:16:47 +01:00