Neal Norwitz
960efe9c2d
Fix exception in tearDown on ppc buildbot. If there's no directory,
...
that shouldn't cause the test to fail. Just like it setUp.
2008-01-26 07:38:03 +00:00
Neal Norwitz
653272f0cf
Use a condition variable (threading.Event) rather than sleeps and checking a
...
global to determine when the server is ready to be used. This slows the test
down, but should make it correct. There was a race condition before where the
server could have assigned a port, yet it wasn't ready to serve requests. If
the client sent a request before the server was completely ready, it would get
an exception. There was machinery to try to handle this condition. All of
that should be unnecessary and removed if this change works. A NOTE was
added as a comment about what needs to be fixed.
The buildbots will tell us if there are more errors or
if this test is now stable.
2008-01-26 07:26:12 +00:00
Neal Norwitz
5be3067742
Prevent this test from failing if there are transient network problems
...
by retrying the host for up to 3 times.
2008-01-26 05:54:48 +00:00
Raymond Hettinger
3dbd4c536d
Changes 54857 and 54840 broke code and were reverted in Py2.5 just before
...
it was released, but that reversion never made it to the Py2.6 head.
2008-01-25 19:24:46 +00:00
Neal Norwitz
769d0eefd7
Make the test more robust by trying to reconnect up to 3 times
...
in case there were transient failures. This will hopefully silence
the buildbots for this test. As we find other tests that have a problem,
we can fix with a similar strategy assuming it is successful. It worked
on my box in a loop for 10+ runs where it would have an exception otherwise.
2008-01-25 06:37:23 +00:00
Raymond Hettinger
9ec7bc36fe
More design notes
2008-01-25 01:46:33 +00:00
Raymond Hettinger
9c6d81f5dd
Fix-up signature for approximation.
2008-01-25 01:23:38 +00:00
Raymond Hettinger
7ea82253ea
Add one other review comment.
2008-01-25 01:13:12 +00:00
Raymond Hettinger
921cb5d3a3
Mark todos and review comments.
2008-01-25 00:33:45 +00:00
Raymond Hettinger
a6216749fb
Add support for copy, deepcopy, and pickle.
2008-01-25 00:21:54 +00:00
Raymond Hettinger
909e334e8a
More code cleanup. Remove unnecessary indirection to useless class methods.
2008-01-24 23:50:26 +00:00
Amaury Forgeot d'Arc
16570f59ca
#1920 : when considering a block starting by "while 0", the compiler optimized the
...
whole construct away, even when an 'else' clause is present::
while 0:
print("no")
else:
print("yes")
did not generate any code at all.
Now the compiler emits the 'else' block, like it already does for 'if' statements.
Will backport.
2008-01-24 22:51:18 +00:00
Raymond Hettinger
5310b69419
Shorter pprint's for empty sets and frozensets. Fix indentation of frozensets. Add tests including two complex data structures.
2008-01-24 21:47:56 +00:00
Raymond Hettinger
6170874f9c
Expand tests to include nested graph structures.
2008-01-24 21:23:58 +00:00
Raymond Hettinger
5b0e27e50d
Add support for int(r) just like the other numeric classes.
2008-01-24 19:30:19 +00:00
Thomas Heller
5ca924038d
Invert the checks in get_[u]long and get_[u]longlong. The intent was
...
to not accept float types; the result was that integer-like objects
were not accepted.
Ported from release25-maint.
2008-01-24 19:15:02 +00:00
Raymond Hettinger
5a05364049
Add support for trunc().
2008-01-24 19:05:29 +00:00
Raymond Hettinger
70ec29d0f4
Revert 60189 and restore performance.
2008-01-24 18:12:23 +00:00
Raymond Hettinger
7a6eacd2ca
Clean-up and speed-up code by accessing numerator/denominator directly. There's no reason to enforce readonliness
2008-01-24 18:05:54 +00:00
Guido van Rossum
37edeab778
Fix test67.py from issue #1303614 .
2008-01-24 17:58:05 +00:00
Guido van Rossum
4e3f12486f
Fi debug turd -- a call accidentally left out.
2008-01-24 15:53:22 +00:00
Vinay Sajip
92aa2f8d6b
Added optional delay argument to FileHandler and subclasses.
2008-01-24 12:37:33 +00:00
Vinay Sajip
97ef165a1d
Added optional delay argument to FileHandler and subclasses.
2008-01-24 12:37:08 +00:00
Gregory P. Smith
7b7ce7854c
Fix issue1789: The tutorial contained a misuse of the struct module.
...
(also remove an unneeded import struct from test_largefile)
2008-01-24 09:38:26 +00:00
Neal Norwitz
7070094d7f
Fix the test_urllib2net failures that were caused by r58067.
...
I'm not sure this is the correct fix, but at least the test passes
now and should be closer to correct.
2008-01-24 07:40:51 +00:00
Neal Norwitz
bf839e2efa
Fix the tests by restoring __import__. I think the test is still valid.
2008-01-24 04:14:50 +00:00
Raymond Hettinger
f336c8b7e9
Cleanup
2008-01-24 02:05:06 +00:00
Raymond Hettinger
eb461904eb
Minor clean-up and more tests.
2008-01-24 02:00:25 +00:00
Raymond Hettinger
cf10926088
Add first-cut at an approximation function (still needs rounding tweaks). Add continued fraction conversions.
2008-01-24 00:54:21 +00:00
Guido van Rossum
9acc387bcf
Turn three recently fixed crashers into regular tests.
2008-01-23 23:23:43 +00:00
Kurt B. Kaiser
f30ba3dd66
There was an error on exit if no sys.exitfunc was defined. Issue 1647.
2008-01-23 22:55:26 +00:00
Kurt B. Kaiser
b4aaa76053
Could not open files in .idlerc directory if latter was hidden on Windows.
...
Issue 1743, Issue 1862.
2008-01-23 22:19:23 +00:00
Guido van Rossum
1d9a9eaa89
Fix two crashers.
2008-01-23 20:19:01 +00:00
Christian Heimes
082c9b0267
Fixed bug #1915 : Python compiles with --enable-unicode=no again. However several extension methods and modules do not work without unicode support.
2008-01-23 14:20:50 +00:00
Guido van Rossum
66b4ab701b
I'm tired of these tests breaking at Google due to our large number of
...
users and groups in LDAP/NIS. So I'm limiting the extra-heavy part of
the tests to passwd/group files with at most 1000 entries.
2008-01-23 01:18:27 +00:00
Raymond Hettinger
c226c31139
Let pprint() support sets and frozensets (suggested by David Mertz).
2008-01-23 00:04:40 +00:00
Gregory P. Smith
2230bcfe24
docstring and comment updates suggested by Giampaolo Rodola'
2008-01-22 23:15:34 +00:00
Georg Brandl
d02fc48f67
Fix for #1087741 patch.
2008-01-22 19:56:03 +00:00
Gregory P. Smith
95cd5c0b72
- Fix Issue #1703448 : A joined thread could show up in the
...
threading.enumerate() list after the join() for a brief period until
it actually exited.
2008-01-22 01:20:42 +00:00
Gregory P. Smith
64c5677de4
Replace spam.acquire() try: ... finally: spam.release() with "with spam:"
2008-01-22 01:12:02 +00:00
Gregory P. Smith
c64386b595
accepts and closes issue #1221598 : adds an optional callback to ftplib.FTP
...
storbinary() and storlines() methods.
2008-01-22 00:19:41 +00:00
Georg Brandl
c09b94e063
Reformat some ugly code.
2008-01-21 21:28:32 +00:00
Georg Brandl
32a3fb5ec9
Patch #1720595 : add T_BOOL to the range of structmember types.
...
Patch by Angelo Mottola, reviewed by MvL, tests by me.
2008-01-21 21:23:15 +00:00
Georg Brandl
f00b38e08c
Add the correct build dir when building with pydebug.
2008-01-21 21:19:07 +00:00
Georg Brandl
f2dae0e14a
#1715 : include sub-extension modules in pydoc text output.
2008-01-21 21:05:49 +00:00
Walter Dörwald
4a11a06d12
Follow PEP 8 in module docstring.
2008-01-21 20:18:04 +00:00
Georg Brandl
38d1715b0d
Issue #1882 : when compiling code from a string, encoding cookies in the
...
second line of code were not always recognized correctly.
2008-01-21 18:35:49 +00:00
Georg Brandl
501601591b
#1530959 : change distutils build dir for --with-pydebug python builds.
2008-01-21 17:42:40 +00:00
Georg Brandl
e42169124f
Clarify $ behavior in re docstring. #1631394 .
2008-01-21 17:29:23 +00:00
Georg Brandl
1ea8cb49ed
#1726198 : replace while 1: fp.readline() with file iteration.
2008-01-21 17:22:06 +00:00
Georg Brandl
0751d1ad2a
Adapt pydoc to new doc URLs.
2008-01-21 17:13:03 +00:00
Vinay Sajip
ae747dccab
Fix : #1836 : Off-by-one bug in TimedRotatingFileHandler rollover calculation. Patch thanks to Kathryn M. Kowalski.
2008-01-21 17:02:26 +00:00
Georg Brandl
864de8274c
#1555501 : document plistlib and move it to the general library.
2008-01-21 16:34:07 +00:00
Georg Brandl
66e7363c10
#1269 : fix a bug in pstats.add_callers() and add a unit test file for pstats.
2008-01-21 10:24:59 +00:00
Georg Brandl
6f7e2d0a30
#1876 : fix typos in test_operator.
2008-01-20 14:31:27 +00:00
Georg Brandl
858493251f
Fix test_pyclbr after urllib change.
2008-01-20 14:20:02 +00:00
Georg Brandl
5235398323
#1669 : don't allow shutil.rmtree() to be called on a symlink.
2008-01-20 14:17:42 +00:00
Georg Brandl
56112895d6
#1648 : add sys.gettrace() and sys.getprofile().
2008-01-20 13:59:46 +00:00
Georg Brandl
d5e6cf2b15
#1664522 : in urllib, don't read non-existing directories in ftp mode,
...
returning a 0-byte file -- raise an IOError instead.
Original patch from Phil Knirsch.
2008-01-20 12:18:17 +00:00
Georg Brandl
2235011d49
#856047 : respect the ``no_proxy`` env var when checking for proxies
...
in urllib and using the other ``_proxy`` env vars.
Original patch by Donovan Baarda.
2008-01-20 12:05:43 +00:00
Georg Brandl
9b0d46db11
#1178141 : add addinfourl.code to get http status code from urllib.
2008-01-20 11:43:03 +00:00
Georg Brandl
dcd6b52206
#1351692 : in pprint, always call format() for dict and list items to enable
...
custom formatting of contents via subclassing PrettyPrinter.
2008-01-20 11:13:29 +00:00
Gregory P. Smith
da407232e0
Document that zipfile decryption is insanely slow and fix a typo and
...
blatant lie in a docstring (it is not useful for security regardless of
how you spell it).
2008-01-20 01:32:00 +00:00
Gregory P. Smith
0c63fc23c4
Fix zipfile decryption. The check for validity only worked on one
...
type of encrypted zip files. Files using extended local headers
needed to compare the check byte against different values. (according
to reading the infozip unzip crypt.c source code)
Fixes issue1003.
2008-01-20 01:21:03 +00:00
Andrew M. Kuchling
88fbcf82ab
Add an interactive test script for exercising curses
2008-01-20 00:12:19 +00:00
Andrew M. Kuchling
4a2762d146
Patch #1048820 from Stefan Wehr: add insert-mode editing to Textbox.
...
Fix an off-by-one error I noticed.
2008-01-20 00:00:38 +00:00
Gregory P. Smith
350d03b18a
Fixes/Accepts Patch for issue1189216 - Work properly with archives
...
that have file headers past the 2**31 byte boundary.
2008-01-19 23:10:52 +00:00
Gregory P. Smith
70eb2f91b4
Fix issue 1300: Quote command line arguments that contain a '|' character in
...
subprocess.list2cmdline (windows).
2008-01-19 22:49:37 +00:00
Gregory P. Smith
92ffc634e4
Undo an unnecessary else: and indentation that r60104 added.
...
try:
...
except:
...
raise
else:
...
the else: is unecessary due to the blind except: with a raise.
2008-01-19 22:23:56 +00:00
Gregory P. Smith
87d49792b5
Fixes issue1336 - a race condition could occur when forking if the gc
...
kicked in during the critical section. solution: disable gc during
that section. Patch contributed by jpa and updated by me to cover the
race condition still existing what therve from twistedmatrix pointed
out (already seen and fixed in twisted's own subprocess code).
2008-01-19 20:57:59 +00:00
Gregory P. Smith
e047e6dd09
fix comment typos, use not arg instead of arg == "", add test coverage
...
for inside of the final if needquotes: within subprocess.list2cmdline().
2008-01-19 20:49:02 +00:00
Georg Brandl
309501a617
#1663329 : add os.closerange() to close a range of fds,
...
ignoring errors, and use this in subprocess to speed up
subprocess creation in close_fds mode. Patch by Mike Klaas.
2008-01-19 20:22:13 +00:00
Andrew M. Kuchling
15ce880cc8
Bug 1277: make Maildir use the user-provided factory instead of hard-wiring MaildirMessage.
...
2.5.2 bugfix candidate.
2008-01-19 20:12:04 +00:00
Georg Brandl
c6fde7293e
Fix #1146 : TextWrap vs words 1-character shorter than the width.
...
Patch by Quentin Gallet-Gilles.
2008-01-19 19:48:19 +00:00
Georg Brandl
14404b68d8
Fix #1679 : "0x" was taken as a valid integer literal.
...
Fixes the tokenizer, tokenize.py and int() to reject this.
Patches by Malte Helmert.
2008-01-19 19:27:05 +00:00
Facundo Batista
873c9857b7
Fix #1693149 . Now you can pass several modules separated by
...
coma to trace.py in the same --ignore-module option.
Thanks Raghuram Devarakonda.
2008-01-19 18:38:19 +00:00
Andrew M. Kuchling
5c60bfcfbf
Patch #976880 : add mmap .rfind() method, and 'end' paramter to .find().
...
Contributed by John Lenton.
2008-01-19 18:18:41 +00:00
Christian Heimes
6c29be54a5
Disabled test_xmlrpc:test_404. It's causing lots of false alarms.
...
I also disabled a test in test_ssl which requires network access to svn.python.org. This fixes a bug Skip has reported a while ago.
2008-01-19 16:39:27 +00:00
Andrew M. Kuchling
e45a77adbe
Patch #742598 from Michael Pomraning: add .timeout attribute to SocketServer that will call
...
.handle_timeout() method when no requests are received within the timeout period.
2008-01-19 16:26:13 +00:00
Christian Heimes
95016e71ea
Update for threading.local test.
2008-01-19 15:06:09 +00:00
Christian Heimes
71a0451f67
Added unit test to verify that threading.local doesn't cause ref leaks. It seems that the thread local storage always keeps the storage of the last stopped thread alive. Can anybody comment on it, please?
2008-01-19 13:46:06 +00:00
Facundo Batista
2b1b195d39
Fix issue #1822 : MIMEMultipart.is_multipart() behaves correctly for a
...
just-created (and empty) instance. Added tests for this. Thanks
Jonathan Share.
2008-01-19 12:32:27 +00:00
Jeffrey Yasskin
45169fbc80
Several tweaks: add construction from strings and .from_decimal(), change
...
__init__ to __new__ to enforce immutability, and remove "rational." from repr
and the parens from str.
2008-01-19 09:56:06 +00:00
Guido van Rossum
bf4c7c8c0d
This got fixed for classic classes in r60057,
...
and backported to 2.5.2 in 60056.
2008-01-18 23:05:40 +00:00
Christian Heimes
288e89acfc
Added bytes and b'' as aliases for str and ''
2008-01-18 18:24:07 +00:00
Vinay Sajip
a26c73ed55
Added LoggerAdapter class, changed copyright dates, made check for extra parameter passed to logging methods explicitly against None rather than a truth value.
2008-01-18 15:55:57 +00:00
Raymond Hettinger
44bd6c0a4f
Issue #1861 : Add read-only attribute listing upcoming events in the order they will be run.
2008-01-17 19:31:38 +00:00
Gregory P. Smith
bde4ae4bde
Fixes (accepts patch) issue1339 - http://bugs.python.org/issue1339
...
- Factor out the duplication of EHLO/HELO in login() and sendmail() to
a new function, ehlo_or_helo_if_needed().
- Use ehlo_or_helo_if_needed() in starttls()
- Check for the starttls exception in starttls() in the same way as
login() checks for the auth extension.
Contributed by Bill Fenner.
2008-01-17 08:35:49 +00:00
Gregory P. Smith
63bfc1d19f
Comply with RFC 3207.
...
Fixes issue 829951 - http://bugs.python.org/issue829951
2008-01-17 07:43:20 +00:00
Raymond Hettinger
473170908e
Make starmap() match its pure python definition and accept any itertable input (not just tuples).
2008-01-17 03:02:14 +00:00
Raymond Hettinger
9e1bc982ff
Add queues will alternative fetch orders (priority based and stack based).
2008-01-16 23:40:45 +00:00
Thomas Heller
0f75f9847a
Use 'g' instead of 'D' as the ctypes typecode for c_longdouble, for
...
compliance with PEP 3118.
2008-01-16 20:34:37 +00:00
Thomas Heller
415c1e36a9
Raise a TypeError instead of a ValueError when too many initializers
...
are used in a Structure or Union constructor.
2008-01-16 19:45:51 +00:00
Thomas Heller
02ec289f3e
Raise a TypeError if conflicting positional and named arguments are
...
passed to a Structure or Union constructor.
2008-01-16 19:37:33 +00:00
Thomas Heller
902d30752f
Convert the internal ctypes array type cache to a WeakValueDict so
...
that array types do not live longer than needed.
2008-01-16 19:16:27 +00:00
Andrew M. Kuchling
c8acc882a9
Docstring typos
2008-01-16 00:32:03 +00:00
Amaury Forgeot d'Arc
ff0f2670ff
test_doctest fails since r59984.
...
Not sure if these are the correct values, but save_stdout has to be set before its usage...
2008-01-15 21:25:11 +00:00
Raymond Hettinger
f59e962b49
Refactor if/elif chain for clarity and speed. Remove dependency on subclasses having to implement _empty and _full.
2008-01-15 20:52:42 +00:00
Guido van Rossum
cad3724352
Issue #1786 (by myself): pdb should use its own stdin/stdout around an
...
exec call and when creating a recursive instance.
2008-01-15 17:59:29 +00:00
Jeffrey Yasskin
d7b00334f3
Add rational.Rational as an implementation of numbers.Rational with infinite
...
precision. This has been discussed at http://bugs.python.org/issue1682 . It's
useful primarily for teaching, but it also demonstrates how to implement a
member of the numeric tower, including fallbacks for mixed-mode arithmetic.
I expect to write a couple more patches in this area:
* Rational.from_decimal()
* Rational.trim/approximate() (maybe with different names)
* Maybe remove the parentheses from Rational.__str__()
* Maybe rename one of the Rational classes
* Maybe make Rational('3/2') work.
2008-01-15 07:46:24 +00:00