Eric Smith
e4d6317c87
Issue 7994: Make object.__format__() raise a PendingDeprecationWarning
...
if the format string is not empty. Manually merge r79596 and r84772
from 2.x.
Also, apparently test_format() from test_builtin never made it into
3.x. I've added it as well. It tests the basic format()
infrastructure.
2010-09-13 20:48:43 +00:00
Vinay Sajip
af9d10aa30
logging: enhanced HTTPHandler
2010-09-13 20:40:30 +00:00
Vinay Sajip
9907918174
Removed unused, commented-out code.
2010-09-13 20:28:57 +00:00
Victor Stinner
ccb706cf0a
Issue #767645 : Set os.path.supports_unicode_filenames to True on Mac OS X
...
(macpath module).
2010-09-13 19:41:36 +00:00
Alexander Belopolsky
d8642c3274
Removed debugging setting
2010-09-13 18:15:33 +00:00
Alexander Belopolsky
4d7701729c
Issue #9315 : Fix for the trace module to record correct class name
...
when tracing methods. Unit tests. Patch by Eli Bendersky.
2010-09-13 18:14:34 +00:00
Florent Xicluna
dc69e7217a
Make test.regrtest.__file__ absolute, this was not always the case when running profile or trace, for example. (issue #9323 )
2010-09-13 16:35:02 +00:00
Hirokazu Yamamoto
bea8ae7948
get_build_version() is needed even where sys.platform != "win32".
...
Try to fix buildbot error in other way.
2010-09-13 07:18:30 +00:00
Hirokazu Yamamoto
68201bdb6d
Issue #9313 : Use unittest.skipUnless to skip old MSVC.
2010-09-13 05:36:21 +00:00
Florent Xicluna
a87b383ac1
Reenable test_ucs4 and remove some duplicated lines.
2010-09-13 02:28:18 +00:00
Hirokazu Yamamoto
f28f0d92cd
Issue #9313 : Skips test_remove_visual_c_ref on old MSVC.
2010-09-12 22:55:40 +00:00
Raymond Hettinger
f1725296cc
Put tests in more logical order.
2010-09-12 18:16:01 +00:00
Raymond Hettinger
c5c29c0ac0
Use weakrefs for both forward and backward links.
2010-09-12 18:13:46 +00:00
Antoine Pitrou
6464d5ffdc
Issue #9837 : The read() method of ZipExtFile objects (as returned by
...
ZipFile.open()) could return more bytes than requested.
2010-09-12 14:51:20 +00:00
Benjamin Peterson
0b9489d21d
reenable test_nis on solaris #3402
2010-09-12 13:55:02 +00:00
Victor Stinner
4c7db315df
Issue #9738 , #9836 : Fix refleak introduced by r84704
2010-09-12 07:51:18 +00:00
Raymond Hettinger
dc08a143e0
Issue #9826 : Handle recursive repr in collections.OrderedDict.
2010-09-12 05:15:22 +00:00
Raymond Hettinger
fa11db0a02
Issue #9825 : Replace OrderedDict.__del__() with weakrefs.
2010-09-12 04:12:42 +00:00
Éric Araujo
e861598dcb
Fix typo in option name
2010-09-11 15:28:56 +00:00
Victor Stinner
ca6525afba
Issue #9819 : don't try to encode TESTFN_UNICODE on Windows
...
mbcs (Windows default filesystem encoding) is now strict by default, and
depending on the code page, TESTFN_UNICODE may not be encodable to bytes.
Remove also unused "encoded" argument from _do_directory() method.
2010-09-11 12:52:30 +00:00
Raymond Hettinger
bd88802c1f
Revert r84700 which had an unfortunate performance cost.
2010-09-11 08:07:42 +00:00
Victor Stinner
1205f2774e
Issue #9738 : PyUnicode_FromFormat() and PyErr_Format() raise an error on
...
a non-ASCII byte in the format string.
Document also the encoding.
2010-09-11 00:54:47 +00:00
Raymond Hettinger
22b46e0ba9
Separate positional arguments from localized globals.
2010-09-11 00:05:44 +00:00
Benjamin Peterson
1017ae5253
add reduce and partial to __all__
2010-09-10 23:35:52 +00:00
Victor Stinner
b4ba986a71
Issue #9402 : pyexpat uses Py_DECREF() instead of PyObject_DEL()
...
Fix a crash if Python is compiled in pydebug mode.
2010-09-10 22:25:19 +00:00
Victor Stinner
3d75d0cc92
Issue #8603 : Environ.data is now protected -> Environ._data
...
os.environ.data was a str dict in Python 3.1. In Python 3.2 on UNIX/BSD,
os.environ.data is now a bytes dict: mark it as protected to avoid confusion.
2010-09-10 22:18:16 +00:00
Victor Stinner
5b519e0201
Issue #9632 : Remove sys.setfilesystemencoding() function: use PYTHONFSENCODING
...
environment variable to set the filesystem encoding at Python startup.
sys.setfilesystemencoding() creates inconsistencies because it is unable to
reencode all filenames in all objects.
2010-09-10 21:57:59 +00:00
Amaury Forgeot d'Arc
ba117ef7e9
#4617 : Previously it was illegal to delete a name from the local
...
namespace if it occurs as a free variable in a nested block. This limitation
of the compiler has been lifted, and a new opcode introduced (DELETE_DEREF).
This sample was valid in 2.6, but fails to compile in 3.x without this change::
>>> def f():
... def print_error():
... print(e)
... try:
... something
... except Exception as e:
... print_error()
... # implicit "del e" here
This sample has always been invalid in Python, and now works::
>>> def outer(x):
... def inner():
... return x
... inner()
... del x
There is no need to bump the PYC magic number: the new opcode is used
for code that did not compile before.
2010-09-10 21:39:53 +00:00
Amaury Forgeot d'Arc
fe7b40533c
The "if 1": trick seems cleaner that the one with regular expressions.
...
Use it here again.
2010-09-10 19:47:43 +00:00
Antoine Pitrou
8e6b407d6f
Issue #941346 : Improve the build process under AIX and allow Python to
...
be built as a shared library. Patch by Sébastien Sablé.
2010-09-10 19:44:44 +00:00
Amaury Forgeot d'Arc
dfa9b294fa
Use the "if 1:" prefix so that quoted code appears nicely
...
nested inside the test suite.
def test_me():
exec("""if 1:
...code...
""")
No other change here.
2010-09-10 19:40:52 +00:00
Nick Coghlan
e8814fbb32
As per python-dev discussion with Eli, properly document and publish dis.show_code
2010-09-10 14:08:04 +00:00
Nick Coghlan
c02adca999
Leave show_code out of __all__ and make it clear that its lack of documentation is deliberate
2010-09-10 12:32:58 +00:00
Nick Coghlan
7646f7ef4a
Fix dis.__all__ for new additions to module in 3.2(spotted by Eli Bendersky)
2010-09-10 12:24:24 +00:00
Victor Stinner
8ce7df67de
Issue #9819 : fix TESTFN_UNENCODABLE for japanese code page
2010-09-10 11:19:59 +00:00
Vinay Sajip
2314fc729b
logging: Added threading interlock in basicConfig().
2010-09-10 08:25:13 +00:00
Daniel Stutzbach
460ff3dd1c
Skip socket tests that require the network, if the network resource is not enabled
2010-09-09 21:17:58 +00:00
Antoine Pitrou
4c7c421944
Remove workaround
2010-09-09 20:40:28 +00:00
Antoine Pitrou
e4a189274f
Issue #9804 : ascii() now always represents unicode surrogate pairs as
...
a single `\UXXXXXXXX`, regardless of whether the character is printable
or not. Also, the "backslashreplace" error handler now joins surrogate
pairs into a single character on UCS-2 builds.
2010-09-09 20:30:23 +00:00
Antoine Pitrou
ea99c5c949
Issue #9410 : Various optimizations to the pickle module, leading to
...
speedups up to 4x (depending on the benchmark). Mostly ported from
Unladen Swallow; initial patch by Alexandre Vassalotti.
2010-09-09 18:33:21 +00:00
Antoine Pitrou
350c7229be
Use transient_internet() where appropriate in test_ssl
...
(svn.python.org is sometimes unavailable)
2010-09-09 13:31:46 +00:00
Antoine Pitrou
6e6cc830c4
Issue #9757 : memoryview objects get a release() method to release the
...
underlying buffer (previously this was only done when deallocating the
memoryview), and gain support for the context management protocol.
2010-09-09 12:59:39 +00:00
Raymond Hettinger
bad3c88094
Have pprint() respect the order in an OrderedDict.
2010-09-09 12:31:00 +00:00
Raymond Hettinger
a0e79408bc
A little bit more readable repr method.
2010-09-09 08:29:05 +00:00
Raymond Hettinger
3fb79c747b
Experiment: Let collections.namedtuple() do the work. This should work now that _collections is pre-built. The buildbots will tell us shortly.
2010-09-09 07:15:18 +00:00
Raymond Hettinger
6c60d099e5
Improve the repr for the TokenInfo named tuple.
2010-09-09 04:32:39 +00:00
Raymond Hettinger
44d7b6ad60
Add docstring to cmd.Cmd.do_help()
2010-09-09 03:53:22 +00:00
Giampaolo Rodolà
b383dbb45e
Fix issue 9794: adds context manager protocol to socket.socket so that socket.create_connection() can be used with the 'with' statement.
2010-09-08 22:44:12 +00:00
Antoine Pitrou
7c9cf01238
gdb: fix representation of non-printable surrogate pairs, and workaround
...
a bug in ascii().
2010-09-08 21:57:37 +00:00
Raymond Hettinger
63b17671f0
Improve variable name (don't shadow a builtin).
2010-09-08 19:27:59 +00:00