Charles-François Natali
c8ce715a82
Issue #14087 : multiprocessing: add Condition.wait_for(). Patch by sbt.
2012-04-17 18:45:57 +02:00
Ezio Melotti
006917ec7f
#14603 : use a listcomp in ZipFile.namelist.
2012-04-16 21:34:24 -06:00
Brett Cannon
578393b286
Properly guard against special-casing.
2012-04-16 23:11:28 -04:00
Brett Cannon
16475adcbb
Issue #13959 : Re-implement imp.load_source() in imp.py.
2012-04-16 22:11:25 -04:00
Brett Cannon
4132368d0a
Issue #14599 : Fix an import caching race condition.
2012-04-16 20:50:33 -04:00
Brett Cannon
ceffda822f
Issue #14599 : Make test_reprlib robust against import cache race
...
conditions when regrtest is run with its -j option.
2012-04-16 20:48:50 -04:00
Brett Cannon
de10bf4f4d
Issue #13959 : Fix a logic bug.
2012-04-16 20:44:21 -04:00
Antoine Pitrou
de3c73b57c
pep8-ize test names
2012-04-16 21:29:58 +02:00
Antoine Pitrou
6b64fc6bff
Fix refleak in test_gc
2012-04-16 21:29:02 +02:00
Vinay Sajip
7706d9ae4f
Closes #14452 : brought tests in line with removal of BOM insertion code.
2012-04-16 16:22:38 +01:00
Vinay Sajip
b4e59e9dc1
Closes #14452 : remove BOM insertion code.
2012-04-16 14:44:31 +01:00
Vinay Sajip
ee9e485c21
Closes #14452 : remove BOM insertion code.
2012-04-16 14:39:53 +01:00
Brian Curtin
b206a80dab
Fix #10854 . Make use of the new path and name attributes on ImportError
...
for extension modules on Windows.
2012-04-16 00:10:17 -05:00
Brett Cannon
15439817bf
merge
2012-04-15 22:28:45 -04:00
Brett Cannon
2ee61422ed
Issue #13959 : Re-implement imp.load_package() in imp.py.
...
Thanks to Eric Snow for helping with imp.load_module() (previous
commit) which led to the removal of a bunch of C code.
2012-04-15 22:28:28 -04:00
Antoine Pitrou
d15e6a32c4
Issue #14589 : Update certificate chain for sha256.tbs-internet.com, fixing a test failure in test_ssl.
2012-04-16 03:37:35 +02:00
Antoine Pitrou
aa292f91bb
Issue #14589 : Update certificate chain for sha256.tbs-internet.com, fixing a test failure in test_ssl.
2012-04-16 03:34:44 +02:00
Brett Cannon
01a76171a0
Issue #13959 : Re-implement imp.load_module() in imp.py.
2012-04-15 20:25:23 -04:00
Brett Cannon
7c3e150d06
merge
2012-04-15 19:06:40 -04:00
Brett Cannon
2fef4d2e6b
Consider load_dynamic() something to keep in _imp.
2012-04-15 19:06:23 -04:00
Victor Stinner
0db176f8f6
Issue #14386 : Expose the dict_proxy internal type as types.MappingProxyType
2012-04-16 00:16:30 +02:00
Brett Cannon
6f44d66bc4
Issue #13959 : Rename imp to _imp and add Lib/imp.py and begin
...
rewriting functionality in pure Python.
To start, imp.new_module() has been rewritten in pure Python, put into
importlib (privately) and then publicly exposed in imp.
2012-04-15 16:08:47 -04:00
Brett Cannon
7788838473
merge
2012-04-15 15:25:10 -04:00
Brett Cannon
881535b726
Issue #14582 : Import returns the module returned by a loader instead
...
of sys.modules when possible.
This is being done for two reasons. One is to gain a little bit of
performance by skipping an unnecessary dict lookup in sys.modules. But
the other (and main) reason is to be a little bit more clear in how
things should work from the perspective of import's interactions with
loaders. Otherwise loaders can easily forget to return the module even
though PEP 302 explicitly states they are expected to return the module
they loaded.
2012-04-15 15:24:04 -04:00
Philip Jenvey
f8f3190d32
utilize startswith(tuple)
2012-04-15 12:21:32 -07:00
Mark Dickinson
da4210f77d
Issue #13496 : Merge from 3.2
2012-04-15 16:32:04 +01:00
Mark Dickinson
a13b109bc0
Issue 13496: Fix bisect.bisect overflow bug for large collections.
2012-04-15 16:30:35 +01:00
Kristján Valur Jónsson
69c635266e
Issue #10576 : Add a progress callback to gcmodule
2012-04-15 11:41:32 +00:00
Brett Cannon
49f8d8b016
Handle importing pkg.mod by executing
...
__import__('mod', {'__packaging__': 'pkg', level=1) w/o properly (and
thus not segfaulting).
2012-04-14 21:50:00 -04:00
Brett Cannon
aef82d3d1e
IDLE was relying on implicit relative imports which have gone away in
...
Python 3.3 thanks to importlib finishing the work in PEP 328 that
accidently got carried forward.
2012-04-14 20:44:23 -04:00
Brett Cannon
44590e4786
Add some comments.
2012-04-14 18:37:07 -04:00
Brett Cannon
afbdc13c1b
Fix an import race condition.
2012-04-14 15:06:17 -04:00
Brett Cannon
73def61edd
Try to fix a sporadic test failure from what is probably a caching race condition.
2012-04-14 14:38:19 -04:00
Brett Cannon
fd0741555b
Issue #2377 : Make importlib the implementation of __import__().
...
importlib._bootstrap is now frozen into Python/importlib.h and stored
as _frozen_importlib in sys.modules. Py_Initialize() loads the frozen
code along with sys and imp and then uses _frozen_importlib._install()
to set builtins.__import__() w/ _frozen_importlib.__import__().
2012-04-14 14:10:13 -04:00
Michael Foord
0682a0c0a9
Minor docstring / docs corrections for unittest.mock
2012-04-13 20:51:20 +01:00
Michael Foord
656319e58d
Make unittest.mock.create_autospec resilient against AttributeError on original object
2012-04-13 17:39:16 +01:00
Michael Foord
c287062fcf
unittest.mock.PropertyMock return value and attributes are now standard MagicMocks
2012-04-13 16:57:22 +01:00
Brett Cannon
bbb6680ee5
Have importlib take advantage of ImportError's new 'name' and 'path'
...
attributes.
2012-04-12 21:09:01 -04:00
Brett Cannon
79ec55e980
Issue #1559549 : Add 'name' and 'path' attributes to ImportError.
...
Currently import does not use these attributes as they are planned
for use by importlib (which will be another commit).
Thanks to Filip Gruszczyński for the initial patch and Brian Curtin
for refining it.
2012-04-12 20:24:54 -04:00
R David Murray
f50b38a11f
Merge #14399 : zipfile now correctly handles comments added to empty zipfiles.
...
Patch by Serhiy Storchaka.
This also moves the TypeError that results from trying to use a unicode
comment from the 'close' step to the point at which the comment is added to
the zipfile.
2012-04-12 18:44:58 -04:00
R David Murray
51804e9725
#14399 : zipfile now correctly handles comments added to empty zipfiles.
...
Patch by Serhiy Storchaka.
This also moves the TypeError that results from trying to use a unicode
comment from the 'close' step to the point at which the comment is added to
the zipfile.
2012-04-12 18:44:42 -04:00
Senthil Kumaran
80a133b91c
code improvement. 'as cm' not required when not used. Review comment by Georg Brandl
2012-04-12 19:28:07 +08:00
R David Murray
ea169801e1
#14508 : make gprof2html script runnable under python3
...
Not that I haven't tested it to make sure it works, just that it
can run against an empty source file.
Initial patch by Popa.Claudiu.
Here we also add a test (which uses mock, which is why I didn't
check it in on 3.2).
2012-04-11 15:17:37 -04:00
Senthil Kumaran
690598aba2
merge to default - Issue 10484 - Incorporate improvements to CGI module - Suggested by Glenn Linderman. Refactor code and tests
2012-04-12 02:37:11 +08:00
Senthil Kumaran
d70846b1b1
3.2 - Issue 10484 - Incorporate improvements to CGI module - Suggested by Glenn Linderman. Refactor code and tests
2012-04-12 02:34:32 +08:00
Senthil Kumaran
08bd4aaaf9
use assertWarns instead of check_warnings - Issue14341
2012-04-11 23:05:49 +08:00
Georg Brandl
a51497ab86
Merge 3.2.3 release clone.
2012-04-11 12:46:24 +02:00
Brett Cannon
9fe92d1de5
Make the trace module ignore modules whose names start with "<" and
...
end with ">", i.e. follow convention.
2012-04-10 21:05:53 -04:00
Senthil Kumaran
d05853da97
merge - fix the incorrect changes made for PATH_INFO value - Issue10484
2012-04-11 03:16:16 +08:00
Senthil Kumaran
dbb369d0ef
3.2- fix the incorrect changes made for PATH_INFO value - Issue10484
2012-04-11 03:15:28 +08:00
Georg Brandl
44036016b9
Bump to 3.2.3 final.
2012-04-10 19:28:09 +02:00
R David Murray
75d9aca97a
Rename test_ file that is really a support file to remove test_ prefix.
...
I thought I had run the full test suite before the last checkin, but
obviously I didn't. test_multibytecodec_support.py isn't really a test file,
it is a support file that contains a base test class. Rename it to
multibytecodec_support so that regrtest test discovery doesn't think it is a
test file that should be run.
2012-04-09 09:37:52 -04:00
R David Murray
78fc25c77f
#14533 : if a test has no test_main, use loadTestsFromModule.
...
This moves us further in the direction of using normal unittest facilities
instead of specialized regrtest ones. Any test module that can be correctly
run currently using 'python unittest -m test.test_xxx' can now be converted to
use normal unittest test loading by simply deleting its test_main, thus no
longer requiring manual maintenance of the list of tests to run. (Not all
tests can be converted that easily, since test_main sometimes does some
additional things (such as reap_children or reap_threads). In those cases the
extra code may be moved to setUpModule/tearDownModule methods, or perhaps the
same ends can be achieved in a different way, such as moving the decorators to
the test classes that need them, etc.)
I don't advocate going through and making this change wholesale, but any time
a list of tests in test_main would otherwise need to be updated, consideration
should instead be given to deleting test_main.
2012-04-09 08:55:42 -04:00
R David Murray
b019ee752a
#12537 : in mailbox avoid depending on knowledge of email package internals
...
Previously mailbox was copying a list of attributes from one message object to
another in order to "copy the message data". This means that any time new
attributes were added to email.message.Message, mailbox broke. Now instead it
copies all attributes from the source object to the target object, skipping
any mailbox-object-specific attributes to produce the same clean initial
state it was previously getting by copying only the "known" attributes.
David Lam assisted in the development of this patch.
2012-04-08 22:36:07 -04:00
R David Murray
c988e24240
Remove redundancy in listing of all mailbox classes in test_mailbox.
2012-04-08 21:00:27 -04:00
Antoine Pitrou
c0aa9eeb90
Fix the patch for issue #7978 : select() raises select.error before 3.3, not OSError.
2012-04-09 01:37:19 +02:00
Antoine Pitrou
0ec2c075a2
Fix flakiness in test_socketserver
2012-04-09 01:18:07 +02:00
Antoine Pitrou
f18d6f3f44
Fix flakiness in test_socketserver
2012-04-09 01:16:47 +02:00
Antoine Pitrou
c9e8e3c4dd
Issue #7978 : socketserver now restarts the select() call when EINTR is returned.
...
This avoids crashing the server loop when a signal is received.
Patch by Jerzy Kozera.
2012-04-09 00:49:17 +02:00
Antoine Pitrou
b0a9c66a49
Issue #7978 : socketserver now restarts the select() call when EINTR is returned.
...
This avoids crashing the server loop when a signal is received.
Patch by Jerzy Kozera.
2012-04-09 00:47:24 +02:00
R David Murray
f998810deb
Merge: Make test_mailbox runnable via python -m unittest.
2012-04-08 18:35:35 -04:00
R David Murray
317c8d257e
Make test_mailbox runnable via python -m unittest.
2012-04-08 16:46:18 -04:00
Antoine Pitrou
df97cbe7a1
Issue #14522 : Avoid duplicating socket handles in multiprocessing.connection.
...
Patch by sbt.
2012-04-07 22:38:52 +02:00
Kristján Valur Jónsson
52a11f1f46
Issue #14310 : Catch testing errors when trying to create unsupported socket
...
types on some platforms.
2012-04-07 20:38:44 +00:00
Kristján Valur Jónsson
10f383a937
Issue #14310 : inter-process socket duplication for windows
2012-04-07 11:23:31 +00:00
Brett Cannon
d62cd5627f
Issue #14500 : Fix importlib.test.import_.test_packages to clean up
...
after itself properly.
2012-04-06 13:13:08 -04:00
Brett Cannon
83c02ee8e8
merge
2012-04-06 12:54:57 -04:00
Kristján Valur Jónsson
b2e58185e5
Set a time threshold in test_asyncore.capture_server so that tests don't
...
deadlock if the main thread fails before sending all the data.
2012-04-06 14:37:45 +00:00
R David Murray
3861a322b9
Merge #14492 : fix some bugs in Tools/scripts/pdeps.py.
...
Initial patch by Popa Claudiu.
2012-04-05 23:01:13 -04:00
R David Murray
d3af6344ef
#14492 : fix some bugs in Tools/scripts/pdeps.py.
...
Initial patch by Popa Claudiu.
2012-04-05 22:59:13 -04:00
Raymond Hettinger
02184282c7
Clarify that the purpose of computing all the miscellaneous collection types is to register them with the appropriate ABCs.
2012-04-05 13:31:12 -07:00
Andrew Svetlov
dfe980bb82
Issue #8515 : Set __file__ when run file in IDLE.
2012-04-05 21:54:39 +03:00
Stefan Krah
0130ad14dd
Merge.
2012-04-05 16:25:21 +02:00
Andrew Svetlov
73d2da4209
Merge from 3.2
2012-04-05 17:04:28 +03:00
Andrew Svetlov
1024541a0d
Issue #14496 : Fix wrong name in idlelib/tabbedpages.py.
...
Patch by Popa Claudiu.
2012-04-05 16:58:05 +03:00
Stefan Krah
ff3eca0cc3
Allow printing a leading '-' and the maximum number of exponent digits
...
rather than raising RuntimeError (allocated space is sufficient for the
additional character).
2012-04-05 15:46:19 +02:00
Stefan Krah
0774e9b9f5
Raise InvalidOperation if exponents of zeros are clamped during exact
...
conversion in the Decimal constructor. Exact here refers to the
representation and not to the value (clamping does not change the value).
2012-04-05 15:21:58 +02:00
Andrew Svetlov
20bbf54f5e
Issue #3033 : Add displayof parameter to tkinter font.
...
Patch by Guilherme Polo.
2012-04-05 12:41:20 +03:00
R David Murray
b5ebf271de
Merge: test_tools fix: don't import analyze_dxp if no _thread module
2012-04-04 22:38:26 -04:00
R David Murray
ca60b36735
test_tools fix: don't import analyze_dxp if no _thread module
2012-04-04 22:37:50 -04:00
R David Murray
ce9806215b
Merge #14490 , #14491 : add 'sundry'-style import tests for Tools/scripts.
...
This patch changes a few of the scripts to have __name__=='__main__'
clauses so that they are importable without running. Also fixes the
syntax errors revealed by the tests.
2012-04-04 21:29:03 -04:00
R David Murray
54ac832a24
#14490 , #14491 : add 'sundry'-style import tests for Tools/scripts.
...
This patch changes a few of the scripts to have __name__=='__main__'
clauses so that they are importable without running. Also fixes the
syntax errors revealed by the tests.
2012-04-04 21:28:14 -04:00
Brett Cannon
8ac95ee62a
Fix test_site from modifying sysconfig._CONFIG_VARS.
2012-04-04 17:31:16 -04:00
Georg Brandl
d4dc6dc9e7
merge with 3.2
2012-04-04 20:17:27 +02:00
Georg Brandl
b6046301ef
Closes #14495 : fix typo.
2012-04-04 20:17:06 +02:00
Matthias Klose
da80b1eb2f
- Issue #14493 : Use gvfs-open/xdg-open in Lib/webbrowser.py.
2012-04-04 14:19:04 +02:00
Eli Bendersky
ebf37a2ffb
Fixes and enhancements to _elementtree:
...
* Fixed refleak problems when GC collection is run (see messages in
issue #14065 )
* Added weakref support to Element objects
2012-04-03 22:02:37 +03:00
Antoine Pitrou
5c73e8eaf4
Issue #14482 : Raise a ValueError, not a NameError, when trying to create
...
a multiprocessing Client or Listener with an AF_UNIX type address under
Windows. Patch by Popa Claudiu.
2012-04-03 20:13:45 +02:00
Antoine Pitrou
6d20cba8d6
Issue #14482 : Raise a ValueError, not a NameError, when trying to create
...
a multiprocessing Client or Listener with an AF_UNIX type address under
Windows. Patch by Popa Claudiu.
2012-04-03 20:12:23 +02:00
Kristján Valur Jónsson
31668b8f7a
Issue #14288 : Serialization support for builtin iterators.
2012-04-03 10:49:41 +00:00
Andrew Svetlov
39f0037735
Issue #802310 : Generate always unique tkinter font names if not directly passed
2012-04-03 09:48:07 +03:00
Andrew Svetlov
5af3e1afb0
reformat code to follow PEP8
2012-04-03 09:39:47 +03:00
Brett Cannon
5ceef131d4
merge
2012-04-02 20:34:20 -04:00
Brett Cannon
927d87470a
If a module injects something into sys.modules as a side-effect of
...
importation, then respect that injection.
Discovered thanks to Lib/xml/parsers/expat.py injecting
xml.parsers.expat.errors and etree now importing that directly as a
module.
2012-04-02 20:33:56 -04:00
Victor Stinner
30d79471bb
Expose clock_settime() as time.clock_settime()
2012-04-03 00:45:07 +02:00
Benjamin Peterson
cbb290af08
merge 3.2
2012-04-02 14:25:55 -04:00
Benjamin Peterson
6215444a0a
remove uneeded line
2012-04-02 14:22:50 -04:00
Stefan Krah
9d2801095f
Testing the implicit initialization of the thread local context on first
...
access fails (expectedly) if other modules have already used decimal. The
only option is to remove the test.
2012-04-02 19:10:20 +02:00
Benjamin Peterson
dba1b40b60
merge 3.2
2012-04-02 11:28:49 -04:00
Benjamin Peterson
e900096dc4
prevent writing to stderr from messing up the exception state ( closes #14474 )
2012-04-02 11:15:17 -04:00
Stefan Krah
38548ad006
Whitespace.
2012-04-02 15:10:36 +02:00
Stefan Krah
5100171d81
Clear the context flags if a context is initialized from the DefaultContext.
2012-04-02 15:02:21 +02:00
Antoine Pitrou
93bba8fb8a
Issue #14151 : Raise a ValueError, not a NameError, when trying to create
...
a multiprocessing Client or Listener with an AF_PIPE type address under
non-Windows platforms. Patch by Popa Claudiu.
2012-04-01 17:25:49 +02:00
Antoine Pitrou
709176f10c
Issue #14151 : Raise a ValueError, not a NameError, when trying to create
...
a multiprocessing Client or Listener with an AF_PIPE type address under
non-Windows platforms. Patch by Popa Claudiu.
2012-04-01 17:19:09 +02:00
Eli Bendersky
0261d754cd
Removing the test of Element that causes ref-leak in GC (issue #14464 ).
...
I will now continue investigating the cause of the ref-leak, but I wanted
to remove the test so that the refcount test in the buildbots could be clean.
The whole change (adding GC to Element) is not reverted because it improved
the situation (GC works for immediate cycles) and didn't cause regressions
(the test is new and was added together with the fix).
2012-04-01 17:40:17 +03:00
Georg Brandl
50af011ca6
Bump to 3.3.0a2.
2012-04-01 13:49:21 +02:00
Georg Brandl
3f4a1b30e4
Update pydoc topics.
2012-04-01 13:46:44 +02:00
Antoine Pitrou
8315f96764
Issue #13872 : socket.detach() now marks the socket closed (as mirrored in the socket repr()).
...
Patch by Matt Joiner.
2012-04-01 01:00:55 +02:00
Antoine Pitrou
70deb3de39
Issue #13872 : socket.detach() now marks the socket closed (as mirrored in the socket repr()).
...
Patch by Matt Joiner.
2012-04-01 01:00:17 +02:00
Antoine Pitrou
8b34b53c52
Issue #14406 : Fix a race condition when using `concurrent.futures.wait(return_when=ALL_COMPLETED)`.
...
Patch by Matt Joiner.
2012-03-31 20:25:22 +02:00
Antoine Pitrou
f70401e842
Issue #14406 : Fix a race condition when using `concurrent.futures.wait(return_when=ALL_COMPLETED)`.
...
Patch by Matt Joiner.
2012-03-31 20:23:30 +02:00
R David Murray
8613b0dea4
Merge #14434 : make tutorial link in 'help' banner version-specific
...
Without this fix, both 2.7 and 3.x would always point to the "current"
docs...which means that before this fix python 3.2 'help' pointed to the 2.7
tutorial.
2012-03-31 12:08:59 -04:00
R David Murray
de0f6297a7
#14434 : make tutorial link in 'help' banner version-specific
...
Without this fix, both 2.7 and 3.x would always point to the "current"
docs...which means that before this fix python 3.2 'help' pointed to the 2.7
tutorial.
2012-03-31 12:06:35 -04:00
Andrew Svetlov
69c2ffa3f3
issue #3035 : update PendingDeprecationWarning to DeprectionWarning, point deprecation in tkinter doc
2012-03-31 14:55:55 +03:00
Andrew Svetlov
78a0f208cc
Merge from 3.2
2012-03-31 14:20:19 +03:00
Andrew Svetlov
f3c297675d
update NEWS as Terry Reedy proposed
2012-03-31 14:10:10 +03:00
Eli Bendersky
a5e822045c
Fix the tests of GC collection in ET.Element according to Benjamin's recommendations
2012-03-31 13:55:38 +03:00
Raymond Hettinger
c6897854f8
Fix-up a comment
2012-03-31 02:19:06 -07:00
Raymond Hettinger
7f7a5a7b87
Fix-up comments and add a sentinel variable for clarity.
2012-03-30 21:50:40 -07:00
Raymond Hettinger
41eb79a016
No need to create and destroy links when updating a fixed-sized circular queue.
2012-03-30 19:15:18 -07:00
Raymond Hettinger
1ff50df8bc
Minor cleanup: add whitespace, add comments, bring function attribute updates together.
2012-03-30 13:15:48 -07:00
Eli Bendersky
0192ba33b4
Issue #14065 : Added cyclic GC support to ET.Element
2012-03-30 16:38:33 +03:00
Vinay Sajip
b4f6da8265
Closes #14436 : merged fix from 3.2.
2012-03-29 20:18:21 +01:00
Vinay Sajip
6f5e54e769
Closes #14436 : Convert msg + args to string before pickling.
2012-03-29 20:17:18 +01:00
Andrew Svetlov
d3cebd790d
Merge with 3.2
2012-03-29 19:50:46 +03:00
Ross Lagerwall
86407432d5
Issue #14442 : Add missing errno import in test_smtplib.
2012-03-29 18:08:48 +02:00
Andrew Svetlov
67ac079203
Issue #14409 : IDLE doesn't not execute commands from shell with default keybinding for <Return>.
...
Patch by Roger Serwy.
2012-03-29 19:01:28 +03:00
Michael Foord
aa8ec7e076
Fix unittest.mock.patch docstring
2012-03-28 15:41:28 +01:00
Michael Foord
54b3db8c84
Minor unittest.mock.patch doc / docstring improvement
2012-03-28 15:08:08 +01:00
Georg Brandl
dc5a4e1611
merge with 3.2
2012-03-27 07:46:54 +02:00
Georg Brandl
d86440750f
Closes #14411 : remove outdated comment in rlcompleter docstring.
2012-03-27 07:46:46 +02:00
Éric Araujo
1641bb7669
Fix typo
2012-03-26 23:35:31 -04:00
Andrew Svetlov
a5cf6c4913
Update missed idlelib/NEWS.txt
2012-03-26 22:14:13 +03:00
Andrew Svetlov
d543f2b8b0
IDLE can be launched as python -m ildelib
2012-03-26 22:11:46 +03:00
Andrew Svetlov
753445a425
Issue #989712 : update the code to process tkinter messages in IDLE
...
without mainloop.
Thanks to Roger Serwy for patch.
2012-03-26 21:56:44 +03:00
Michael Foord
0340ea77d1
unittest.mock: removed another bit of Python 2 only code
2012-03-25 23:27:12 +01:00
Michael Foord
944e02d055
Adding unittest.mock documentation
2012-03-25 23:12:55 +01:00
Michael Foord
e58a562d93
unittest.mock: a mock created by patch with a spec as the list argument will be callable if __call__ is in the spec
2012-03-25 19:53:18 +01:00
Michael Foord
fb5d0a78cf
unittest.mock: remove another piece of Python 2 specific code
2012-03-25 19:35:22 +01:00
Michael Foord
1ab27c6fde
Remove more Python 2 code from unittest.mock (obsolete function attributes)
2012-03-25 19:16:10 +01:00
Michael Foord
0dccf657b5
Minor changes to the unittest.mock.mock_open helper
2012-03-25 19:11:50 +01:00
Michael Foord
99254730b2
Addition of docstrings to unittest.mock helpers
2012-03-25 19:07:33 +01:00
Michael Foord
a74561a56d
unittest.mock: set file_spec on first use
2012-03-25 19:03:13 +01:00
Michael Foord
50a8c0ef5d
Support subclassing unittest.mock._patch and fix various obscure bugs around patcher spec arguments
2012-03-25 18:57:58 +01:00
Michael Foord
a3eabb6f8e
Merge
2012-03-25 18:16:26 +01:00
Michael Foord
313f85f0ca
unittest.mock.MagicMock objects are now unorderable by default
2012-03-25 18:16:07 +01:00
Stefan Krah
fe17b2bc77
Raise MemoryError instead of InvalidOperation/MallocError for compatibility
...
with decimal.py. The standard specifies InsufficientStorage (MallocError) as
a sub-condition of InvalidOperation. This allows a calculation to continue
with NaN results when allocation fails.
2012-03-25 18:59:21 +02:00
Andrew Svetlov
cd49d53238
Issue #14200 — now displayhook for IDLE works in non-subprocess mode as well as subprecess.
2012-03-25 11:43:02 +03:00
Charles-François Natali
9384c7ddab
Issue #13902 : Fix a random test_threading failure on FreeBSD 6 buildbots (due
...
to a known bug in pthread implementation on FreeBSD < 7).
2012-03-24 20:37:01 +01:00
Charles-François Natali
8e6fe648cc
Issue #13902 : Fix a random test_threading failure on FreeBSD 6 buildbots (due
...
to a known bug in pthread implementation on FreeBSD < 7).
2012-03-24 20:36:09 +01:00
Charles-François Natali
55bce63ea0
Issue #14154 : Reimplement the bigmem test memory watchdog as a subprocess.
2012-03-24 10:06:23 +01:00
Vinay Sajip
ee64b28cf4
Closes #14314 : backported fix.
2012-03-23 14:36:22 +00:00
Giampaolo Rodola'
c7ea19fee8
attempt to fix asyncore buildbot failure
2012-03-23 15:09:58 +01:00
Giampaolo Rodola'
a3481e70d1
attempt to fix asyncore buildbot failure
2012-03-23 15:07:07 +01:00
Stefan Krah
b6405efd1b
Use the same exception hierarchy as decimal.py. FloatOperation now also
...
inherits from TypeError. Cleanup in module initialization to make repeated
import failures robust.
2012-03-23 14:46:48 +01:00
Giampaolo Rodola'
4164ac1f27
merge
2012-03-23 13:29:49 +01:00
Giampaolo Rodola'
466a54f4dc
fix failing asyncore test as per http://bugs.python.org/issue10340#msg156586
2012-03-23 13:29:01 +01:00
Eli Bendersky
396e8fcf36
Issue #13782 : streamline argument type-checking in ET.Element
...
append, extend and insert now consistently type-check their argument in both
the C and Python implementations, and raise TypeError for non-Element
argument.
Added tests
2012-03-23 14:24:20 +02:00
R David Murray
42243c4dca
#14380 : Make actual default match docs, fix __init__ order.
...
Éric pointed out that given that the default was documented as None, someone
would reasonably pass that to get the default behavior. In fixing the code to
use None, I noticed that the change to _charset was being done after it had
already been passed to MIMENonMultipart. The change to the test verifies that
the order is now correct.
2012-03-22 22:40:44 -04:00
R David Murray
8680bcc5db
#14380 : Have MIMEText defaults to utf-8 when passed non-ASCII unicode
...
Previously it would just accept the unicode, which would wind up as unicode in
the transfer-encoded message object, which is just wrong.
Patch by Jeff Knupp.
2012-03-22 22:17:51 -04:00
Giampaolo Rodola'
3539ef3d21
merge 79422b3684f1 in 3.3 branch (issue 10340)
2012-03-22 16:19:45 +01:00
Giampaolo Rodola'
350c94b900
fix #10340 : properly handle EINVAL on OSX and also avoid to call handle_connect() in case of a disconnetected socket which is not meant to connect.
2012-03-22 16:17:43 +01:00
Benjamin Peterson
98ba753432
merge 3.2 ( #14378 )
2012-03-22 08:19:50 -04:00
Benjamin Peterson
a4e4e35783
check by equality for __future__ not identity ( closes #14378 )
2012-03-22 08:19:04 -04:00
Antoine Pitrou
d5d17eb653
Issue #14204 : The ssl module now has support for the Next Protocol Negotiation extension, if available in the underlying OpenSSL library.
...
Patch by Colin Marc.
2012-03-22 00:23:03 +01:00
Andrew Svetlov
a966c6fddb
Issue #3035 : Unused functions from tkinter are marked as pending peprecated.
2012-03-21 23:52:59 +02:00
R David Murray
1da08e77df
Merge #12757 : Make doctest skipping in -OO mode work with unittest/regrtest -v
2012-03-21 14:55:04 -04:00
R David Murray
e112153727
#12757 : Make doctest skipping in -OO mode work with unittest/regrtest -v
2012-03-21 14:53:42 -04:00
Benjamin Peterson
65e32d1f1a
merge heads
2012-03-21 14:26:09 -04:00
Stefan Krah
1919b7e72b
Issue #7652 : Integrate the decimal floating point libmpdec library to speed
...
up the decimal module. Performance gains of the new C implementation are
between 12x and 80x, depending on the application.
2012-03-21 18:25:23 +01:00
Andrew Svetlov
206d2a43a3
Merge from 3.2 for issue #3573 , fix Misc/NEWS as Ned Deily guess.
2012-03-21 13:31:12 +02:00
Andrew Svetlov
0f71f44156
#3573 : idle now doesn't hungs if launched as: idle -e <directory>
...
Patch by Guilherme Polo.
2012-03-21 13:23:41 +02:00
Benjamin Peterson
1b1a8e7cb5
correctly lookup __trunc__ in int() constructor
2012-03-20 23:48:11 -04:00
Andrew Svetlov
6b6e437626
#3573 : idle now doesn't hungs if launched as: idle -e <directory>
...
Patch by Guilherme Polo.
2012-03-20 23:03:26 +02:00
R David Murray
669b755c92
#14269 : smtpd now conforms to the RFC and requires HELO before MAIL.
...
This is a backward incompatible change, but since it is an RFC conformance bug
and all real mail servers that I know of do conform to the RFC in this regard,
I believe it is an acceptable change for a feature release.
Patch by Jason Killen.
2012-03-20 16:16:29 -04:00
Larry Hastings
83a9f48699
Issue #14328 : Add keyword-only parameters to PyArg_ParseTupleAndKeywords.
...
They're optional-only for now (unlike in pure Python) but that's all
I needed. The syntax can easily be relaxed if we want to support
required keyword-only arguments for extension types in the future.
2012-03-20 20:06:16 +00:00
Giampaolo Rodola'
7941736ddb
Fix issue #13694 : asynchronous connect in asyncore.dispatcher does not set addr.
2012-03-20 16:49:55 +01:00
Giampaolo Rodola'
2a886412ba
Fix issue #13694 : asynchronous connect in asyncore.dispatcher does not set addr.
2012-03-20 16:44:24 +01:00
Benjamin Peterson
4ca5661669
all OSErrors should indicate there are no extended attributes ( closes #14358 )
2012-03-18 22:26:05 -04:00
Georg Brandl
3187749646
Merge 3.2.3rc2 from release clone.
2012-03-18 20:37:43 +01:00
Georg Brandl
226af70a59
Bump to 3.2.3rc2.
2012-03-18 07:34:49 +01:00
Raymond Hettinger
7dabfede34
Fix whitespace
2012-03-17 15:11:09 -07:00
Raymond Hettinger
7e0c581c49
Low overhead path for maxsize==0
2012-03-17 15:10:24 -07:00
R David Murray
0863d7106c
Merge #14333 : fix test_queue so it can be run via standard unittest test discovery.
2012-03-17 16:39:44 -04:00
R David Murray
c6bfce9871
#14333 : fix test_queue so it can be run via standard unittest test discovery.
2012-03-17 16:38:39 -04:00
R David Murray
bd53809ee7
#14344 : fixed the repr of email.policy objects.
2012-03-17 15:11:59 -04:00
Raymond Hettinger
bc8e81dcc3
Section-off the source for better readability.
2012-03-17 00:24:09 -07:00
Raymond Hettinger
dce583e0bd
Minor beautification.
2012-03-16 22:12:20 -07:00
Benjamin Peterson
96384b93aa
make extra arguments to object.__init__/__new__ to errors in most cases (finishes #1683368 )
2012-03-17 00:05:44 -05:00
R David Murray
80e22b56d3
Merge #11686 : add missing entries to email __all__ lists.
...
Original patch by Steffen Daode Nurpmeso
2012-03-16 22:46:14 -04:00
R David Murray
1b6c724df0
#11686 : add missing entries to email __all__ lists.
...
Original patch by Steffen Daode Nurpmeso
2012-03-16 22:43:05 -04:00
R David Murray
7104c7295c
#12788 : fix error in test_policy when run under refleak detection
2012-03-16 21:39:57 -04:00
Raymond Hettinger
4f5139ba20
Root variable is not changed.
2012-03-16 17:08:37 -07:00
Raymond Hettinger
202d1ad3f6
Fix whitespace
2012-03-16 17:05:17 -07:00
Raymond Hettinger
d37fb55910
Unique sentinel value for cache.get()
2012-03-16 17:04:11 -07:00
Raymond Hettinger
6e8c817687
Refactor calculation of the cache key. Minor code cleanups.
2012-03-16 16:53:05 -07:00
Antoine Pitrou
020bf28200
Merge
2012-03-17 00:24:12 +01:00
Antoine Pitrou
846fd302a0
Issue #14335 : multiprocessing's custom Pickler subclass now inherits from the C-accelerated implementation.
...
Patch by sbt.
2012-03-17 00:23:04 +01:00
Benjamin Peterson
29a837d857
merge heads
2012-03-16 18:22:53 -05:00
Benjamin Peterson
954cf578c7
clear the root with the cache
2012-03-16 18:22:26 -05:00
Raymond Hettinger
d656958915
Minor code cleanup.
2012-03-16 11:48:12 -07:00
Raymond Hettinger
57b2959d26
Eliminate duplicate link lookup. Minor cleanup.
2012-03-16 11:21:39 -07:00
Benjamin Peterson
de394543b4
merge 3.2 ( #14334 )
2012-03-16 09:35:38 -05:00
Benjamin Peterson
16d84ac355
check to make sure the attribute is a string ( #14334 )
2012-03-16 09:32:59 -05:00
Eli Bendersky
6e33525098
fix trailing whitespace
2012-03-16 15:32:04 +02:00
Eli Bendersky
2b711409c7
Add a test that makes sure TreeBuilder can be passed element_factory in the
...
constructor. Marked as expectedFailure since it currently fails for the C
implementation.
2012-03-16 15:29:50 +02:00
Raymond Hettinger
e60d2d9911
merge
2012-03-16 01:18:33 -07:00
Raymond Hettinger
ec0e91045e
Improve the memory utilization (and speed) of functools.lru_cache().
2012-03-16 01:16:31 -07:00
Senthil Kumaran
209d70e579
closes issue10484 - Fix the http.server's cgi PATH_INFO handling problem
2012-03-16 01:14:51 -07:00
Senthil Kumaran
be3f851411
closes issue10484 - Fix the http.server's cgi PATH_INFO handling problem
2012-03-16 01:13:50 -07:00
Eli Bendersky
5b77d81314
Issue #14207 : the ParseError exception raised by _elementtree was made
...
consistent to the one raised by the Python module (the 'code' attribute
was added).
In addition, the exception is now documented.
Added a test to check that ParseError has the required attributes, and
threw away the equivalent doctest which is no longer required.
2012-03-16 08:20:05 +02:00
Eli Bendersky
f996e775ea
Closes Issue #14246 : _elementtree parser will now handle io.StringIO
2012-03-16 05:53:30 +02:00
Senthil Kumaran
e53d977e80
Explain the use of charset parameter with Content-Type header: issue11082
2012-03-15 18:15:34 -07:00
Senthil Kumaran
6b3434ae04
Explain the use of charset parameter with Content-Type header. Issue11082
2012-03-15 18:11:16 -07:00
Benjamin Peterson
2afe6aeae8
perform yield from delegation by repeating YIELD_FROM opcode ( closes #14230 )
...
This allows generators that are using yield from to be seen by debuggers. It
also kills the f_yieldfrom field on frame objects.
Patch mostly from Mark Shannon with a few tweaks by me.
2012-03-15 15:37:39 -05:00
Senthil Kumaran
3270d11d8a
port from 3.2 - Fix the urllib closing issue which hangs on particular ftp urls/ftp servers. closes issue11199
2012-03-15 13:28:27 -07:00
Senthil Kumaran
73277fe0eb
closes Issue #11199 : Fix the with urllib which hangs on particular ftp urls.
2012-03-15 13:26:12 -07:00
Giampaolo Rodola'
a4e018889a
(sched) when run() is invoked with blocking=False return the deadline of the next scheduled call in the scheduler; this use case was suggested in http://bugs.python.org/issue1641#msg149453
2012-03-15 13:05:41 +01:00
Vinay Sajip
17160fd6d6
Fixes #14314 : Improved SMTP timeout handling.
2012-03-15 12:02:08 +00:00
Victor Stinner
3d7c878fe3
Issue #14222 : Use the new time.steady() function instead of time.time() for
...
timeout in queue and threading modules to not be affected of system time
update.
2012-03-15 01:22:16 +01:00
Victor Stinner
071eca3f5c
Issue #10278 : Add an optional strict argument to time.steady(), False by default
2012-03-15 01:17:09 +01:00
Victor Stinner
ec919cc74d
Issue #10278 : Drop time.monotonic() function, rename time.wallclock() to time.steady()
...
* On Mac OS X, time.steady() now uses mach_absolute_time(), a monotonic clock
* Optimistic change: bet that CLOCK_MONOTONIC and CLOCK_REALTIME are available
when clock_gettime() is available
* Rewrite time.steady() documentation
2012-03-15 00:58:32 +01:00
Benjamin Peterson
1a5e5de818
remove get_prefix and set_prefix ( #13248 )
2012-03-14 17:41:15 -05:00
Michael Foord
d7c65e2807
Removed XXX from unittest.mock docstring and switch to a nicer try...except...finally
2012-03-14 14:56:54 -07:00
Michael Foord
a74b3aa0cc
Remove more Python 2 compatibility cruft from unittest.mock
2012-03-14 14:40:22 -07:00
Senthil Kumaran
e7c8fdee18
merge heads
2012-03-14 14:00:31 -07:00
Senthil Kumaran
2f9bf35007
Fix the buildbot breakdown - issue 10050
2012-03-14 13:59:56 -07:00
Andrew Svetlov
8247b188f3
Megre from tip
2012-03-14 13:46:08 -07:00
Andrew Svetlov
b53da6e374
Merge from tip
2012-03-14 13:44:02 -07:00
Senthil Kumaran
38b968b913
deprecated the old urllib primitives in 3.3 urllib package - issue 10050
2012-03-14 13:43:53 -07:00
Michael Foord
c17adf4151
Remove Python 2 compatibility cruft from unittest.mock
2012-03-14 13:30:29 -07:00
Andrew Svetlov
05bab93339
Issue #14200 : Idle shell crash on printing non-BMP unicode character.
...
UnicodeEncodeError is raised for strings contains non-BMP characters.
For eval results unicode escaping is used, print() calls display
exception with traceback as usual.
2012-03-14 13:22:12 -07:00
Michael Foord
ebff097937
And another one... mock import fix.
2012-03-14 13:01:31 -07:00
Michael Foord
83a16856ee
Fix another mock import
2012-03-14 12:58:46 -07:00
Michael Foord
0ca9acd1dd
Fix import failure in mock test
2012-03-14 12:38:06 -07:00
R David Murray
b53319f509
#12818 : remove escaping of () in quoted strings in formataddr
...
The quoting of ()s inside quoted strings is allowed by the RFC, but is not
needed. There seems to be no reason to add needless escapes.
2012-03-14 15:31:47 -04:00
Michael Foord
345266aa7e
PEP 417: Adding unittest.mock
2012-03-14 12:24:34 -07:00
R David Murray
8d8f110492
#14062 : fix BytesParser handling of Header objects
...
This is a different fix than the 3.2 fix, but the new tests are the same.
This also affected smtplib.SMTP.send_message, which calls BytesParser.
2012-03-14 14:24:22 -04:00
R David Murray
9fd170e2d0
#14062 : fix BytesParser handling of linesep for Header objects
...
This also affected smtplib.SMTP.send_message, which calls BytesParser.
2012-03-14 14:05:03 -04:00
Antoine Pitrou
9d8c186650
Issue #13839 : When invoked on the command-line, the pstats module now accepts several filenames of profile stat files and merges them all.
...
Patch by Matt Joiner.
2012-03-14 17:47:11 +01:00
R David Murray
e2922835b0
Merge #14291 : if a header has non-ascii unicode, default to CTE using utf-8
...
In Python2, if a unicode string was assigned as the value of a header,
email would automatically CTE encode it using the UTF8 charset.
This capability was lost in the Python3 translation, and this patch
restores it.
Patch by Ali Ikinci, assisted by R. David Murray.
I also added a fix for the mailbox test that was depending (with a comment
that it was a bad idea to so depend) on non-ASCII causing message_from_string
to raise an error. It now uses support.patch to induce an error during
message serialization.
2012-03-14 03:03:27 -04:00
R David Murray
7441a7aedd
#14291 : if a header has non-ascii unicode, default to CTE using utf-8
...
In Python2, if a unicode string was assigned as the value of a header,
email would automatically CTE encode it using the UTF8 charset.
This capability was lost in the Python3 translation, and this patch
restores it.
Patch by Ali Ikinci, assisted by R. David Murray.
I also added a fix for the mailbox test that was depending (with a comment
that it was a bad idea to so depend) on non-ASCII causing message_from_string
to raise an error. It now uses support.patch to induce an error during
message serialization.
2012-03-14 02:59:51 -04:00
Senthil Kumaran
e24f96a059
Issue10050 - urlretrieve uses newer urlopen. reporthook of urlretrieve takes, block number, block read size, file_size
2012-03-13 19:29:33 -07:00
Andrew Svetlov
a2251aadaa
Issue #989712 : Support using Tk without a mainloop.
2012-03-13 18:36:13 -07:00
Victor Stinner
8050ca9c6f
Issue #14180 : TestDateTime.test_microsecond_rounding() handles localtime() and
...
gmtime() failure on Windows
2012-03-14 00:17:05 +01:00
R David Murray
910df329fd
#8315 : add automatic unittest test discovery in test.test_email
2012-03-13 18:02:22 -04:00
Martin v. Löwis
eb945a938d
Issue #5219 : Prevent event handler cascade in IDLE.
...
Patch by Roger Serwy.
2012-03-13 14:32:29 -07:00
Martin v. Löwis
ee381a0c36
Issue #5219 : Prevent event handler cascade in IDLE.
...
Patch by Roger Serwy.
2012-03-13 14:18:36 -07:00
Martin v. Löwis
5c3c424237
Issue #2843 : Add new Tk API to Tkinter.
...
Patch by Guilherme Polo and Andrew Svetlov.
2012-03-13 13:40:42 -07:00
Victor Stinner
5d272cc6a2
Close #14180 : Factorize code to convert a number of seconds to time_t, timeval or timespec
...
time.ctime(), gmtime(), time.localtime(), datetime.date.fromtimestamp(),
datetime.datetime.fromtimestamp() and datetime.datetime.utcfromtimestamp() now
raises an OverflowError, instead of a ValueError, if the timestamp does not fit
in time_t.
datetime.datetime.fromtimestamp() and datetime.datetime.utcfromtimestamp() now
round microseconds towards zero instead of rounding to nearest with ties going
away from zero.
2012-03-13 13:35:55 +01:00