Commit Graph

4817 Commits

Author SHA1 Message Date
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 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 9b0d46db11 #1178141: add addinfourl.code to get http status code from urllib. 2008-01-20 11:43:03 +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
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 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
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
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
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
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
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
Raymond Hettinger cbf8f6cffb Temporarily revert 59967 until GC can be added. 2008-01-15 05:39:59 +00:00
Raymond Hettinger c216df9288 Issue 1820: structseq objects did not work with the % formatting operator or isinstance(t, tuple).
Orignal patch (without tests) by Leif Walsh.
2008-01-15 03:02:37 +00:00
Andrew M. Kuchling 7ce9b18460 Typo fixes 2008-01-15 01:29:16 +00:00
Christian Heimes c94e2b5c12 Now that I've learnt about structseq objects I felt like converting sys.float_info to a structseq. It's
readonly and help(sys.float_info) explains the attributes nicely.
2008-01-14 04:13:37 +00:00
Christian Heimes f31b69f9db Applied patch #1816: sys.flags patch 2008-01-14 03:42:48 +00:00
Christian Heimes 9c2019632b Added new an better structseq representation. E.g. repr(time.gmtime(0)) now returns 'time.struct_time(tm_year=1970, tm_mon=1, tm_mday=1, tm_hour=0, tm_min=0, tm_sec=0, tm_wday=3, tm_yday=1, tm_isdst=0)' instead of '(1970, 1, 1, 0, 0, 0, 3, 1, 0)'. The feature is part of #1816: sys.flags 2008-01-14 03:33:52 +00:00
Mark Dickinson 59bc20bb27 Issue 1780: Allow leading and trailing whitespace in Decimal constructor,
when constructing from a string. Disallow trailing newlines in
Context.create_decimal.
2008-01-12 01:56:00 +00:00
Raymond Hettinger fff4e6e171 Doctest results return a named tuple for readability 2008-01-11 01:25:54 +00:00
Raymond Hettinger d1ef85420f Run doctests on the collections module 2008-01-11 00:23:13 +00:00
Amaury Forgeot d'Arc d08a8ebf2a Closing issue1761.
Surprising behaviour of the "$" regexp: it matches the
end of the string, AND just before the newline at the end
of the string::

    re.sub('$', '#', 'foo\n') == 'foo#\n#'

Python is consistent with Perl and the pcre library, so
we just document it.
Guido prefers "\Z" to match only the end of the string.
2008-01-10 21:59:42 +00:00
Christian Heimes 3403f1589d Fixed #1776. __import__() no longer imports modules by file name 2008-01-09 19:56:33 +00:00
Christian Heimes b39a756afd Added __enter__ and __exit__ functions to HKEY object
Added ExpandEnvironmentStrings to the _winreg module.
2008-01-08 15:46:10 +00:00
Andrew M. Kuchling e0a49b6e05 Patch 1137: allow assigning to .buffer_size attribute of PyExpat.parser objects 2008-01-08 14:30:55 +00:00
Facundo Batista 52b25795c0 Issue #1757: The hash of a Decimal instance is no longer affected
by the current context.  Thanks Mark Dickinson.
2008-01-08 12:25:20 +00:00
Christian Heimes f66f95d419 It's verbose, not debug 2008-01-08 03:40:04 +00:00
Christian Heimes 4d7e6702e9 Fixed indention problem that caused the second TIPC test to run on systems without TIPC 2008-01-07 19:58:41 +00:00
Georg Brandl 62416bcf5a #467924, patch by Alan McIntyre: Add ZipFile.extract and ZipFile.extractall. 2008-01-07 18:47:44 +00:00
Christian Heimes fb2d25a154 Issue #1646: Make socket support TIPC. The socket module now has support
for TIPC under Linux, see http://tipc.sf.net/ for more information.
Thanks to Alberto Bertogli for the patch
2008-01-07 16:12:44 +00:00
Jeffrey Yasskin fd1c24518b Fix issue 1747: allow classic classes to be checked for being subclasses of
ABCs.
2008-01-07 06:09:40 +00:00
Georg Brandl e260ba2d33 #1325: Add docs and tests for zipimporter.archive and zipimporter.prefix. 2008-01-06 16:49:50 +00:00
Georg Brandl 183a084da3 #1742: don't raise exception on os.path.relpath("a", "a"), but return os.curdir.
Reported by Jesse Towner.
2008-01-06 14:27:15 +00:00
Guido van Rossum c6a04c2629 Patch #1637: fix urlparse for URLs like 'http://x.com?arg=/foo'.
Fix by John Nagle.
2008-01-05 22:19:06 +00:00
Georg Brandl f725b9587c Doc patch #1730 from Robin Stocker; minor corrections mostly to os.rst. 2008-01-05 19:44:22 +00:00
Andrew M. Kuchling 0589914e60 Fix comment typo 2008-01-05 15:13:49 +00:00
Jeffrey Yasskin 9871d8fe22 Continue rolling back pep-3141 changes that changed behavior from 2.5. This
round included:
 * Revert round to its 2.6 behavior (half away from 0).
 * Because round, floor, and ceil always return float again, it's no
   longer necessary to have them delegate to __xxx___, so I've ripped
   that out of their implementations and the Real ABC. This also helps
   in implementing types that work in both 2.6 and 3.0: you return int
   from the __xxx__ methods, and let it get enabled by the version
   upgrade.
 * Make pow(-1, .5) raise a ValueError again.
2008-01-05 08:47:13 +00:00