Commit Graph

13632 Commits

Author SHA1 Message Date
Eric Smith f032a00271 Fix issue 3411: default float format spec fails on negative numbers. 2008-07-19 00:24:05 +00:00
Brett Cannon 1e8fba729e Deprecate the sunaudio module for removal in Python 3.0. The sunau module can provide similar functionality. 2008-07-18 19:30:22 +00:00
Georg Brandl 56af5fcab7 #3390: replace a remaining has_key(). 2008-07-18 19:30:10 +00:00
Georg Brandl 74bbc79d10 Replace all map(None, a) with list(a). 2008-07-18 19:06:13 +00:00
Benjamin Peterson e2886fd3ca now that test_lib2to3 actually works and isn't extremely slow, we don't need the lib2to3 resource 2008-07-18 14:26:35 +00:00
Benjamin Peterson 0e3a6cf2cb backport test_fileio 2008-07-18 14:14:41 +00:00
Georg Brandl 730c8185b9 Correct attribute name. 2008-07-18 10:29:30 +00:00
Georg Brandl 9334d02ff5 Remove duplicate entry in __all__. 2008-07-18 10:20:59 +00:00
Vinay Sajip 70fdc95b96 Issue #3389: Allow resolving dotted names for handlers in logging configuration files. Thanks to Philip Jenvey for the patch. 2008-07-18 09:00:00 +00:00
Vinay Sajip bc7e34f692 Issue #3389: Allow resolving dotted names for handlers in logging configuration files. Thanks to Philip Jenvey for the patch. 2008-07-18 08:59:06 +00:00
Barry Warsaw daddf03f77 Bumping to 2.6b2 2008-07-18 03:20:07 +00:00
Jesse Noller 7fb9640d57 Fix issue 3395, update _debugInfo to be _debug_info 2008-07-17 21:01:05 +00:00
Eric Smith d6c393ab2b Backed out r65069, pending fixing it in Windows. 2008-07-17 19:49:47 +00:00
Bill Janssen 0c1dbf8792 catch socket.error errors in badCertTest 2008-07-17 18:01:57 +00:00
Eric Smith 454816d8bd Issue 3382: Make '%F' and float.__format__('F') convert results to upper case. 2008-07-17 17:48:39 +00:00
Benjamin Peterson f5668f13c8 try to fix test_threading on the Windows bot 2008-07-17 12:57:22 +00:00
Benjamin Peterson 1ab3149063 Merged revisions 65053-65054 via svnmerge from
svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3

........
  r65053 | benjamin.peterson | 2008-07-16 21:04:12 -0500 (Wed, 16 Jul 2008) | 1 line

  massive optimizations for 2to3 (especially fix_imports) from Nick Edds
........
  r65054 | benjamin.peterson | 2008-07-16 21:05:09 -0500 (Wed, 16 Jul 2008) | 1 line

  normalize whitespace
........
2008-07-17 02:07:46 +00:00
Georg Brandl 0a34baf1fc Byte items *can* be chars in 2.6. 2008-07-16 23:18:51 +00:00
Georg Brandl 3e483f643d #3156: fix consistency in what type bytearray methods accept as items.
Also rename confusing "item" parameters to "index".
2008-07-16 22:57:41 +00:00
Georg Brandl a24869ada7 #3312: fix two sqlite3 crashes. 2008-07-16 22:33:18 +00:00
Georg Brandl 4ed9be733b #3345: fix docstring. 2008-07-16 22:09:17 +00:00
Georg Brandl b9b68ae7a5 #3305: self->stream can be NULL. 2008-07-16 22:04:20 +00:00
Georg Brandl b32dea5a3e #3045: fix pydoc behavior for TEMP path with spaces. 2008-07-16 21:19:28 +00:00
Jesse Noller 5e62ca4fea Apply patch for 874900: threading module can deadlock after fork 2008-07-16 20:03:47 +00:00
Benjamin Peterson 1bbf4ea553 Merged revisions 65025 via svnmerge from
svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3

........
  r65025 | benjamin.peterson | 2008-07-16 13:46:30 -0500 (Wed, 16 Jul 2008) | 1 line

  remove use of has_key
........
2008-07-16 18:48:35 +00:00
Benjamin Peterson 4b4f0ebf19 lib2to3 isn't broken anymore, so we can run the test 2008-07-16 17:03:06 +00:00
Benjamin Peterson 699b09010f Merged revisions 64863,64868,64870,64942,65001-65002,65017-65018 via svnmerge from
svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3

........
  r64863 | brett.cannon | 2008-07-10 19:42:32 -0500 (Thu, 10 Jul 2008) | 1 line

  Add urlparse -> urllib.parse to fix_imports.
........
  r64868 | brett.cannon | 2008-07-10 20:00:10 -0500 (Thu, 10 Jul 2008) | 1 line

  Add robotparser -> urllib.robotparser to fix_imports.
........
  r64870 | brett.cannon | 2008-07-11 00:56:27 -0500 (Fri, 11 Jul 2008) | 6 lines

  Fix the fixers for the new dbm package.

  Had to create a new fixer (fix_imports2) which did fixes in post-order. This
  because ``import anydbm`` was being translated into ``import dbm`` which was
  then subsequently changed into ``import dbm.ndbm``; one transform too many.
........
  r64942 | collin.winter | 2008-07-13 20:19:05 -0500 (Sun, 13 Jul 2008) | 1 line

  Add a comment explaining part of fix_imports.py
........
  r65001 | brett.cannon | 2008-07-16 00:11:12 -0500 (Wed, 16 Jul 2008) | 2 lines

  Remove some extraneous whitespace.
........
  r65002 | brett.cannon | 2008-07-16 00:12:04 -0500 (Wed, 16 Jul 2008) | 4 lines

  Implement a fixer for urllib(2).

  Thanks Nick Edds for the patch.
........
  r65017 | benjamin.peterson | 2008-07-16 11:04:19 -0500 (Wed, 16 Jul 2008) | 1 line

  fix 2to3 in Python 2.6
........
  r65018 | benjamin.peterson | 2008-07-16 11:55:21 -0500 (Wed, 16 Jul 2008) | 1 line

  normalize whitespace
........
2008-07-16 17:01:46 +00:00
Jesse Noller 13e9d582fd Apply Amaury's patch to multiprocessing for issue 3125, removes the copy_reg and replaces it with ForkingPickler.register(), which should resolve the conflict with the global registry/ctypes 2008-07-16 14:32:36 +00:00
Jesse Noller a6c5dc07f4 Apply patch for issue 3090: ARCHFLAGS parsing incorrect 2008-07-16 13:24:06 +00:00
Mark Dickinson 64b7e501f4 Issue #3360: Fix incorrect parsing of "020000000000.0". 2008-07-16 09:40:03 +00:00
Benjamin Peterson a736a28702 disable lib2to3 in the trunk. It's broken just for 2.6 2008-07-16 00:44:02 +00:00
Eric Smith a5fa5a218d Complete issue 3083: add alternate (#) formatting to bin, oct, hex in str.format(). 2008-07-16 00:11:49 +00:00
Mark Dickinson 62764566e8 Fix float.from_hex tests. It appears that Linux/ia64 doesn't like
computing 2.0**-1074 accurately.  Using ldexp(1.0, -1074) should be
safer.
2008-07-15 21:55:23 +00:00
Thomas Heller 2affb40e70 Fix test on 64-bit platforms. 2008-07-15 20:18:46 +00:00
Mark Dickinson 7103aa42c0 Issue #3008: add instance method float.hex and class method float.fromhex
to convert floats to and from hexadecimal strings respectively.
2008-07-15 19:08:33 +00:00
Jesse Noller 9949d6ed4b Revert 3270 patch: self._address is in pretty widespread use, need to revisit 2008-07-15 18:29:18 +00:00
Thomas Heller c0b2a807ff Issue #3258: Fix an assertion error (in debug build) and a crash (in
release build) when the format string of a pointer to an incomplete
structure is created.
2008-07-15 17:03:08 +00:00
Nick Coghlan 53663a695e Issue 2235: __hash__ is once again inherited by default, but inheritance can be blocked explicitly so that collections.Hashable remains meaningful 2008-07-15 14:27:37 +00:00
Jesse Noller 9ace15ca25 multiprocessing/connection.py patch to remove fqdn oddness for issue 3270 2008-07-15 13:47:33 +00:00
Eric Smith d0c841243c Added '#' formatting to integers. This adds the 0b, 0o, or 0x prefix for bin, oct, hex. There's still one failing case, and I need to finish the docs. I hope to finish those today. 2008-07-15 10:10:07 +00:00
Benjamin Peterson a6864e0d9f fix test_py3kwarns
The fact that this was failing and went unnoticed so long seems like a good argument for being able to enable and disble py3kwarnings through Python.
2008-07-14 17:42:17 +00:00
Robert Schuppenies 2ee623b710 Fixed test failure on Win64 machines. 2008-07-14 08:42:18 +00:00
Benjamin Peterson e79edf5f7c remove sys.version_info check for 3.0 2008-07-13 18:34:58 +00:00
Benjamin Peterson 2a6087966c remove bytes alias 2008-07-13 18:25:13 +00:00
Nick Coghlan b028f50911 Fix issue 3221 by emitting a RuntimeWarning instead of raising SystemError when the parent module can't be found during an absolute import (likely due to non-PEP 361 aware code which sets a module level __package__ attribute) 2008-07-13 14:52:36 +00:00
Nick Coghlan 38469e2719 Make test.test_support.catch_warnings more robust as discussed on python-dev. Also add explicit tests for itto test_warnings. 2008-07-13 12:23:47 +00:00
Brett Cannon 3d0b9f095a dummy_thread.acquire() would return None if no waitflag argument was given. It
should have returned True.

Fixes issue #3339. Thanks, Henk Punt for the report and Andrii v. Mishkovskiyi
for attempting a patch.
2008-07-13 01:15:07 +00:00
Benjamin Peterson 0522a9f1eb #1778443 robotparser fixes from Aristotelis Mikropoulos 2008-07-12 23:41:19 +00:00
Josiah Carlson 873c3864ba Fixed test for asyncore. 2008-07-11 23:26:59 +00:00
Josiah Carlson b65b4c3a47 Fix for the AttributeError in test_asynchat. 2008-07-11 22:17:14 +00:00
Amaury Forgeot d'Arc 2252d11c08 #3342: In tracebacks, printed source lines were not indented since r62555.
#3343: Py_DisplaySourceLine should be a private function. Rename it to _Py_DisplaySourceLine.
2008-07-11 21:45:06 +00:00
Amaury Forgeot d'Arc ae6d2b9175 #3317 in zipfile module, restore the previous names of global variables:
some applications relied on them.

Also remove duplicated lines.
2008-07-11 21:28:25 +00:00
Robert Schuppenies 4762902998 Added garbage collector overhead and optional default return value to
sys.getsizeof.
2008-07-10 17:13:55 +00:00
Raymond Hettinger 5930d8f05e Suppress -3 warnings in unittest.py 2008-07-10 16:06:41 +00:00
Raymond Hettinger 930795b7e0 Clear the -3 warnings in optparse.py 2008-07-10 15:37:08 +00:00
Robert Schuppenies 9be2ec109b Added additional __sizeof__ implementations and addressed comments made in
Issue3122.
2008-07-10 15:24:04 +00:00
Raymond Hettinger b01713e7dc Issue 3285: Fractions from_float() and from_decimal() accept Integral arguments. 2008-07-10 14:34:57 +00:00
Raymond Hettinger 3cd1e42dca Issue 3301: Bisect functions behaved badly when lo was negative. 2008-07-10 14:03:19 +00:00
Robert Schuppenies d2cd86ddd5 Fixed Issue3122 and extended sys.getsizeof tests for built-in types. 2008-07-10 13:43:26 +00:00
Raymond Hettinger 548db58e02 Use operator.index() instead of n.__index__(). 2008-07-10 10:28:41 +00:00
Raymond Hettinger 655d583a49 Issue 3287: Raise correct exception for float inputs. 2008-07-10 09:31:08 +00:00
Nick Coghlan 524b7773cc Issue 2517: Allow unicode messages in Exceptions again by correctly bypassing the instance dictionary when looking up __unicode__ on new-style classes 2008-07-08 14:08:04 +00:00
Facundo Batista 1a664419bb Issue 3306. Better control for a lenght in findmax() function. 2008-07-07 17:02:59 +00:00
Gregory P. Smith c4691ec0bf - Issue #3094: httplib.HTTPSConnection Host: headers no longer include the
redundant ":443" port number designation when the connection is using the
  default https port (443).
2008-07-07 05:09:12 +00:00
Josiah Carlson ff5f42088b Fixed bugs 760475, 953599, and 1519. 2008-07-07 04:51:46 +00:00
Gregory P. Smith 3b1e6b2f83 - Issue #3309: Fix bz2.BZFile itererator to release its internal lock
properly when raising an exception due to the bz2file being closed.
  Prevents a deadlock.
2008-07-07 04:31:58 +00:00
Amaury Forgeot d'Arc 0f7cddc308 Issue839496: SimpleHTTPServer should open all files in binary mode.
Forward-port of 38255 (2005/01/15!)
This was already fixed in 2.4, but never merged into trunk...
py3k is already right, thanks to the bytes/str distinction!

Should be backported to 2.5.
2008-07-06 21:34:39 +00:00
Benjamin Peterson 7f58022219 remove test_compact_freelists from test_sys 2008-07-06 12:39:09 +00:00
Gregory P. Smith f41406409e - Issue #2113: Fix error in subprocess.Popen if the select system call is
interrupted by a signal.
2008-07-06 07:16:40 +00:00
Facundo Batista 17f2e4acb9 Issue #3239. Differentiate the ascii call from the curses one and
the builtin one.
2008-07-05 20:39:59 +00:00
Georg Brandl 1ecce468f8 Keep below 80 chars. 2008-07-05 16:43:45 +00:00
Benjamin Peterson 87988b6753 make regrtest aware of the lib2to3 resource 2008-07-05 16:29:38 +00:00
Martin v. Löwis 5a9ef426a9 Disable lib2to3 by default, unless run explicitly. 2008-07-05 15:48:20 +00:00
Martin v. Löwis 5144ff5f78 Merged revisions 64285-64735 via svnmerge from
svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3

........
  r64493 | benjamin.peterson | 2008-06-24 04:14:14 +0200 (Di, 24 Jun 2008) | 1 line

  add a fix_import mapping for cPickle -> pickle
........
  r64651 | brett.cannon | 2008-07-02 04:00:11 +0200 (Mi, 02 Jul 2008) | 3 lines

  Update fix_imports for urllib. Had to change the fixer itself to handle modules
  that are split across several renames in 3.0.
........
  r64669 | brett.cannon | 2008-07-02 21:43:48 +0200 (Mi, 02 Jul 2008) | 4 lines

  Backing out last change until fix_imports is working again. Also re-enable the
  testing for fix_imports; if it is deemed that it takes too long to run then a
  random sample should be taken and used to test it.
........
2008-07-05 15:45:45 +00:00
Mark Dickinson bf9f4d8015 Issue 3188: accept float('infinity') as well as float('inf'). This
makes the float constructor behave in the same way as specified
by various other language standards, including C99, IEEE 754r,
and the IBM Decimal standard.
2008-07-05 11:33:52 +00:00
Georg Brandl e78fbcce3e #2663: support an *ignore* argument to shutil.copytree(). Patch by Tarek Ziade.
This is a new feature, but Barry authorized adding it in the beta period.
2008-07-05 10:13:36 +00:00
Martin v. Löwis 8c43641271 Patch #1622: Correct interpretation of various ZIP header fields.
Also fixes
- Issue #1526: Allow more than 64k files to be added to Zip64 file.

- Issue #1746: Correct handling of zipfile archive comments (previously
  archives with comments over 4k were flagged as invalid). Allow writing
  Zip files with archives by setting the 'comment' attribute of a ZipFile.
2008-07-03 12:51:14 +00:00
Brett Cannon 0bfac6e5d8 Revert r64673 and instead just change the file encoding. 2008-07-02 21:52:42 +00:00
Brett Cannon 3bff9d269c FIx some Latin-1 characters to be UTF-8 as the file encoding specifies.
Closes issue #3261. THankjs Leo Soto for the bug report.
2008-07-02 21:40:11 +00:00
Jesse Noller 76cf55f499 Add #!/usr/bin/env python for ben 2008-07-02 16:56:51 +00:00
Facundo Batista 66c527755d Issue #449227: Now with the rlcompleter module, callable objects are
added a '(' when completed.
2008-07-02 16:52:55 +00:00
Jesse Noller 146b7ab818 Reenable the manager tests with Amaury's threading fix 2008-07-02 16:44:09 +00:00
Nick Coghlan c060b0e7eb Issue 3190: pydoc now hides module __package__ attributes 2008-07-02 13:09:19 +00:00
Mark Dickinson 70c3289085 Replace occurrences of '\d' with '[0-9]' in Decimal regex, to make sure
that the behaviour of Decimal doesn't change if/when re.UNICODE becomes
assumed in Python 3.0.

Also add a check that alternative Unicode digits (e.g. u'\N{FULLWIDTH
DIGIT ONE}') are *not* accepted in a numeric string.
2008-07-02 09:37:01 +00:00
Brett Cannon 8bb8fa5dd6 Handle urllib's renaming for Python 3.0:
* Deprecate urllib.urlopen() in favor of urllib2.urlopen() for 3.0.
* Update docs to mention split/rename of the module and deprecation of
  urlopen().

Changes to lib2to3 are in a separate commit. Work is for issue #2885.
2008-07-02 01:57:08 +00:00
Amaury Forgeot d'Arc bdd941fac3 #3242: fix a crash in "print", if sys.stdout is set to a custom object,
whose write() method installs another sys.stdout.

Will backport.
2008-07-01 20:38:04 +00:00
Benjamin Peterson 175e4d9663 #3219 repeated keyword arguments aren't allowed in function calls anymore 2008-07-01 19:34:52 +00:00
Amaury Forgeot d'Arc 1f40c8a8d7 #Issue3088 in-progress: Race condition with instances of classes derived from threading.local:
When a thread touches such an object for the first time, a new thread-local __dict__ is created,
and the __init__ method is run.
But a thread switch can occur here; if the other thread touches the same object, it installs another
__dict__; when the first thread resumes, it updates the dictionary of the second...

This is the deep cause of the failures in test_multiprocessing involving "managers" objects.

Also a 2.5 backport candidate.
2008-06-30 22:42:40 +00:00
Facundo Batista 763d309bba Fix #2702, with a correct accounting of recursion. 2008-06-30 01:10:55 +00:00
Vinay Sajip 5ff7171ddc Removed out-of-date comment in _install_handlers and
used issubclass in place of equality comparison of classes.
2008-06-29 21:25:28 +00:00
Benjamin Peterson efc4a3ac17 fix typo 2008-06-28 23:35:31 +00:00
Benjamin Peterson 7416a4cd2a convert test_audioop to unittest. Thanks to Giampaolo Rodola. 2008-06-28 23:06:05 +00:00
Bill Janssen de34d91eb0 make sure we close the active channels when eof is received on them 2008-06-28 23:00:39 +00:00
Bill Janssen 934b16d0c2 various SSL fixes; issues 1251, 3162, 3212 2008-06-28 22:19:33 +00:00
Mark Dickinson 3af386a5cb Remove trailing 'L's from numerator and denominator in the
repr() of a Fraction instance.
2008-06-27 10:11:52 +00:00
Trent Nelson 6e7e137cff Merged revisions 64368-64369 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/tnelson-trunk-bsddb-47-upgrade

........
  r64368 | trent.nelson | 2008-06-17 23:13:44 -0500 (Tue, 17 Jun 2008) | 1 line

  Initial commit of work pertaining to switching the Windows build from Berkeley DB 4.4.20 to 4.7.25.  Note that I've deprecated the standalone '_bsddb44.vcproj' in lieu of adding the sources in a separate folder to the _bsddb project.  This was a conscious decision and actually makes everything far more easier to manage.  With this approach, entire test suite passed straight off the bat.  Well, almost -- the timeout in bsddb/test/test_replication.py needed bumping up a little -- 2 seconds was too short.  10 seconds seems to be fine for me, but I'll make sure Jesus verifies.  More documentation to come once I've been able to test out this approach on the buildbots (hence keeping the changes in a separate branch for now).
........
  r64369 | trent.nelson | 2008-06-17 23:19:12 -0500 (Tue, 17 Jun 2008) | 1 line

  Bump Berkeley DB version from 4.4.20 to 4.7.25.
........
2008-06-27 02:30:34 +00:00
Brett Cannon dea1b5653f warnings.warn_explicit() did not have the proper TypeErrors in place to prevent
bus errors or SystemError being raised. As a side effect of fixing this, a bad
DECREF that could be triggered when 'message' and 'category' were both None was
fixed.

Closes issue 3211. Thanks JP Calderone for the bug report.
2008-06-27 00:31:13 +00:00
Benjamin Peterson 80821f7cf4 fix isSet in _exposed 2008-06-26 21:29:19 +00:00
Benjamin Peterson 0adfd93f6f use the new API 2008-06-26 21:24:35 +00:00
Robert Schuppenies 161b92103c Corrected inconsistencies in sizeof tests and addressed issue pointed
out by Jean Brouwers.
2008-06-26 15:20:35 +00:00
Facundo Batista 68dc052ca6 Reverting the patch from #3165, as it broke other
behaviours. I left the original test commented out (note
that that test came from #2702, which seems to have a
problem in FreeBSD and Windows, but not in Linux).

I included a new test, to watch over the now-broken
behaviour, I took it from #3179.
2008-06-25 19:24:53 +00:00
Benjamin Peterson 264800822a get rid of 2.6/3.0 switch statements in multiprocessing 2008-06-25 12:44:29 +00:00
Benjamin Peterson b09c9396cd use byte literals in multiprocessing 2008-06-25 12:39:05 +00:00
Robert Schuppenies 41a7ce0a2e Issue 3147: Fixed SizeofTest failure for LLP64 systems. 2008-06-25 09:20:03 +00:00
Benjamin Peterson aa164e1bd3 remove bytes alias in multiprocessing 2008-06-25 03:09:05 +00:00
Raymond Hettinger 9c437af4eb Revert 64424, 64438, and 64439. 2008-06-24 22:46:07 +00:00
Raymond Hettinger 4ac817213b Issue 3189: Py3k DeprecationWarning in difflib 2008-06-24 15:58:53 +00:00
Eric Smith 5dce7e9a83 Fixed formatting with thousands separator and padding. Resolves issue 3140. 2008-06-24 11:11:59 +00:00
Raymond Hettinger 4c52f52ef3 Issue 3161: Missing import and test. 2008-06-23 03:29:28 +00:00
Facundo Batista 9da18b3133 Fixing the problem stated in issue 2702 with the patch submitted
in the issue 3165. Now cPickle does not fails with uncontrolled
behaviour when pickling into a very deep nested structure.
2008-06-22 23:19:14 +00:00
Facundo Batista 2694eb0219 Just returning nothing instead of rising TestSkipped, because
it makes the test fail in the trunk.loewis-sun buildbot.
2008-06-22 19:35:24 +00:00
Facundo Batista 96f3dc36ed Trying to see if the problem in Martin's buildot is at
directory creation time...
2008-06-22 18:23:55 +00:00
Facundo Batista b8242ba6b1 Trying to see if the @ in a path is causing the issue in the
shutil.rmtree() in the trunk.loewis-sun buildbot.
2008-06-22 16:11:34 +00:00
Facundo Batista 5596b0cfc2 Issue #2722. Now the char buffer to support the path string has
not fixed length, it mallocs memory if needed. As a result, we
don't have a maximum for the getcwd() method.
2008-06-22 13:36:20 +00:00
Facundo Batista a6a4d50efe Now a from submitted via POST that also has a query string
will contain both FieldStorage and MiniFieldStorage items.

Fixes #1817.
2008-06-21 18:58:04 +00:00
Facundo Batista 2da91c375b Fixed issue #2888. Now the behaviour of pprint when working with nested
structures follows the common sense (and works like in 2.5 and 3.0).
2008-06-21 17:43:56 +00:00
Andrew M. Kuchling c2dd030b0e Docstring correction 2008-06-21 13:48:38 +00:00
Andrew M. Kuchling f484363bae Use repr() for bad input strings; this makes the empty string or binary characters more visible 2008-06-21 13:47:20 +00:00
Raymond Hettinger e0e711446b Issue 3008: hex/oct/bin can show floats exactly. 2008-06-21 06:39:53 +00:00
Mark Dickinson 1ec2fcd16e Issue #3004: Minor fix to slice.indices(). slice(-10).indices(9) now
returns (0, 0, 1) instead of (0, -1, 1), and slice(None, 10, -1).indices(10)
returns (9, 9, -1) instead of (9, 10, -1).
2008-06-20 14:53:43 +00:00
Raymond Hettinger e3ae655edf Make bin() implementation parallel oct() and hex() so that int/long subclasses can override or so that other classes can support. 2008-06-20 04:18:15 +00:00
Vinay Sajip 5f7b97d987 Bug #3136: fileConfig()'s disabling of old loggers is now conditional via an optional disable_existing_loggers parameter, but the default value is such that the old behaviour is preserved.
Thanks to Leandro Lucarella for the patch.
2008-06-19 22:40:17 +00:00
Benjamin Peterson 6f5a2b52ae skip test_macostools when UCS4 is enabled 2008-06-19 21:39:06 +00:00
Amaury Forgeot d'Arc 9b69ed9d67 In test_site, correctly escape backslashes in path names.
This allows the test to pass when the username begins with a lowercase 't'...
2008-06-19 21:17:12 +00:00
Amaury Forgeot d'Arc 8f40f0635b test_macos can be skipped on non-mac platforms. 2008-06-19 19:57:39 +00:00
Barry Warsaw b5d174037f Bumping to 2.6b1 2008-06-19 01:48:07 +00:00
Benjamin Peterson da9c9be159 Fix test_socket_ssl the easy way and remove it per #1489 2008-06-18 22:59:32 +00:00
Amaury Forgeot d'Arc 7248fd833c The ssl certificate at https://sf.net is not valid.
Switch to https://sourceforge.net
2008-06-18 21:18:27 +00:00
Jesse Noller a3b6baaaab Remove test_listener_client to remove possible race condition in the multiprocessing tests 2008-06-18 16:34:50 +00:00
Jesse Noller 18623825d2 Attempt RLock creation prior to test execution on Linux, if it raises the OSError in issue 3111, skip the test suite 2008-06-18 13:29:52 +00:00
Amaury Forgeot d'Arc 09fc075c1c Fix the previous fix 2008-06-17 23:14:19 +00:00
Amaury Forgeot d'Arc 19fc7f6635 On windows, lib2to3 should accept / and \ in the fixer_dir argument
Needed to let the tests pass
2008-06-17 23:09:19 +00:00
Benjamin Peterson aa4e47a04d add needed import 2008-06-17 23:01:59 +00:00
Benjamin Peterson ed77f2e143 skip test_multiprocessing when /dev/shm doesn't exist. This seems to be a chroot problem in the buildbot env. 2008-06-17 22:40:44 +00:00
Guido van Rossum 21a45e1bea Roll back Raymond's -r64098 while we think of something better.
(See issue 3056 -- we're close to a resolution but need unittests.)
2008-06-17 17:38:02 +00:00
Vinay Sajip 8f96b8ec43 Bug #3126: StreamHandler and FileHandler check before calling "flush" and "close" that the stream object has these, using hasattr (thanks to bobf for the patch). 2008-06-17 11:02:14 +00:00
Robert Schuppenies 59f3ade862 Issue 3048: Fixed sys.sizeof test fails with wide unicode. 2008-06-17 08:42:15 +00:00
Benjamin Peterson da3a1b1200 reduce the test_multiprocessing load to ones that shouldn't hang. These will be reenabled gradually as we find the problems. 2008-06-16 20:52:48 +00:00
Amaury Forgeot d'Arc a8919fe631 Issue 3110: Crash with weakref subclass,
seen after a "import multiprocessing.reduction"

An instance of a weakref subclass can have attributes.
If such a weakref holds the only strong reference to the object,
deleting the weakref will delete the object. In this case,
the callback must not be called, because the ref object is being deleted!
2008-06-16 19:12:42 +00:00
Georg Brandl a161f6070b Forward-port new test from r64300. 2008-06-15 19:54:36 +00:00
Benjamin Peterson e607823af5 Merged revisions 63661,63666,63695,63711,63729,63769,63790,63880,63886 via svnmerge from
svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3

........
  r63661 | georg.brandl | 2008-05-26 05:26:20 -0500 (Mon, 26 May 2008) | 2 lines

  Add import fixes for dbm package.
........
  r63666 | georg.brandl | 2008-05-26 05:49:09 -0500 (Mon, 26 May 2008) | 2 lines

  Add xmlrpc package fixes.
........
  r63695 | georg.brandl | 2008-05-26 10:14:33 -0500 (Mon, 26 May 2008) | 2 lines

  Add fixer entries for http package.
........
  r63711 | benjamin.peterson | 2008-05-26 13:43:51 -0500 (Mon, 26 May 2008) | 2 lines

  add import mapping for test.test_support -> test.support
........
  r63729 | benjamin.peterson | 2008-05-26 16:31:03 -0500 (Mon, 26 May 2008) | 2 lines

  mapping for commands module -> subprocess
........
  r63769 | brett.cannon | 2008-05-29 00:13:13 -0500 (Thu, 29 May 2008) | 1 line

  Fixer for UserString.UserString over to the collections module.
........
  r63790 | brett.cannon | 2008-05-29 14:13:51 -0500 (Thu, 29 May 2008) | 4 lines

  Add a fixer for UserList.

  Closes issue #2878. Thanks to Quentin Gallet-Gilles for the patch.
........
  r63880 | collin.winter | 2008-06-01 18:09:38 -0500 (Sun, 01 Jun 2008) | 6 lines

  Move lib2to3/fixes/{basefix,util}.py down to lib2to3/.

  This is step 1 of turning lib2to3/ into a general-purpose refactoring
  library, reusable by other projects.
........
  r63886 | collin.winter | 2008-06-01 22:15:01 -0500 (Sun, 01 Jun 2008) | 5 lines

  Allow refactoring tools to specify a directory for fixer modules.

  This is step 2 of turning lib2to3/ into a general-purpose refactoring
  library, reusable by other projects. Step 1: r63880.
........
2008-06-15 02:31:05 +00:00
Gregory P. Smith a0205d0a46 silence the test when it is skipped on some platforms. should fix a
buildbot.
2008-06-14 17:34:09 +00:00
Martin v. Löwis 3a4414855c Revert eol-style to CRLF. 2008-06-14 00:41:41 +00:00
Martin v. Löwis 06510b2213 Run svneol.py on all sources. 2008-06-13 22:38:33 +00:00
Benjamin Peterson 7f03ea77bf darn! I converted half of the files the wrong way. 2008-06-13 19:20:48 +00:00
Benjamin Peterson dfd79494ce convert multiprocessing to unix line endings 2008-06-13 19:13:39 +00:00
Benjamin Peterson 5c0be328c1 platform.uname now tries to fill empty values even when os.uname is present 2008-06-13 15:11:50 +00:00
Robert Schuppenies 73e9ffc811 Fixed: sys.getsizeof does not take the actual length of the tuples into account. 2008-06-13 13:29:37 +00:00
Neal Norwitz 04097a6282 Fix typo in method name. The LT class implemented less than. The LE class
should implement less than or equal to (as the code does).
2008-06-13 06:03:25 +00:00
Benjamin Peterson 26305a03e3 add py3k warnings to rfc822 2008-06-12 22:33:06 +00:00
Benjamin Peterson a03722f278 deprecated mimetools 2008-06-12 14:23:49 +00:00
Armin Rigo ffae306784 Sounds obvious, but I didn't even realize that you can put non-string
keys in type dictionaries without using this locals() hack.
2008-06-12 09:50:58 +00:00
Benjamin Peterson 13f7382e0d add old names back into __all__ 2008-06-11 18:02:31 +00:00
Benjamin Peterson f439560265 add aliases to threading module 2008-06-11 17:50:00 +00:00
Benjamin Peterson 0fbcf69455 give the threading API PEP 8 names 2008-06-11 17:27:50 +00:00
Raymond Hettinger e29a10306c Add test for heapq using both __lt__ and __le__. 2008-06-11 13:14:50 +00:00
Benjamin Peterson e605e4f09a fix import of multiprocessing by juggling imports 2008-06-11 12:26:31 +00:00
Raymond Hettinger 4267be6478 Multi-arg form for set.difference() and set.difference_update(). 2008-06-11 10:30:54 +00:00
Gregory P. Smith 9d53457e59 Merge in release25-maint r60793:
Added checks for integer overflows, contributed by Google. Some are
 only available if asserts are left in the code, in cases where they
 can't be triggered from Python code.
2008-06-11 07:41:16 +00:00
Benjamin Peterson 190d56e009 add the multiprocessing package to fulfill PEP 371 2008-06-11 02:40:25 +00:00
Benjamin Peterson d5299866f9 convert test_struct to a unittest thanks to Giampaolo Rodola
I had to disable one test because it was functioning incorrectly, see #1530559
I also removed the debugging prints
2008-06-11 01:31:28 +00:00
Raymond Hettinger 610a93ea26 Handle the case with zero arguments. 2008-06-11 00:44:47 +00:00
Raymond Hettinger caea65e465 Mini-PEP: Simplifying numbers.py
* Convert binary methods in Integral to mixin methods
* Remove three-arg __pow__ as a required method
* Make __int__ the root method instead of __long__.
2008-06-11 00:25:29 +00:00
Benjamin Peterson 31296c09ed backport of 64096 2008-06-10 22:39:25 +00:00
Amaury Forgeot d'Arc 8e8de4afef Correct test_pydoc for win32 platforms, to account for normalized URLs:
C:\temp => file:///C|temp/
2008-06-10 21:37:15 +00:00
Josiah Carlson b67b53db51 Fixed test to reflect new filedispatcher semantics, as well as two
NameErrors pointed out by Giampaolo.
2008-06-10 15:58:19 +00:00
Robert Schuppenies 901c997de0 Issue 3048: Fixed sys.getsizeof for unicode objects. 2008-06-10 10:10:31 +00:00
Georg Brandl 8509db5a21 Add the "ast" module, containing helpers to ease use of the "_ast" classes. 2008-06-10 07:45:28 +00:00
Josiah Carlson 1a72d88abf Applying updated patch from Issue 1736190, which addresses partial
issues in: 909005 and 17361001, as well as completely as possible issues
539444, 760475, 777588, 889153, 953599, 1025525, 1063924, and 658749.
This patch also includes doc and test updates as necessary.
2008-06-10 05:00:08 +00:00
Alexandre Vassalotti 602d8db2bc Added better pickling support to xrange objects.
Cleaned up the unit test.
2008-06-10 04:01:23 +00:00
Alexandre Vassalotti 1f2f61a78f Issue 2582: Fix pickling of xrange objects. 2008-06-10 03:34:53 +00:00
Raymond Hettinger 5c4d3d0e4c Let set.intersection() and set.intersection_update() take multiple input arguments. 2008-06-09 13:07:27 +00:00
Raymond Hettinger ee4bcad68e Let set.union() and set.update() accept multiple inputs. 2008-06-09 08:33:37 +00:00
Raymond Hettinger ecbdd2e9b0 Issue #2138: Add math.factorial(). 2008-06-09 06:54:45 +00:00
Raymond Hettinger e98839a1f4 Issue3065: Fixed pickling of named tuples. Added tests. 2008-06-09 01:28:30 +00:00
Benjamin Peterson f4fcdb6b8c warn about parameter tuple unpacking 2008-06-08 23:00:00 +00:00
Benjamin Peterson d5efd20406 Warn about assigning to Py3k keywords (True and False) 2008-06-08 22:52:37 +00:00
Benjamin Peterson 2fe3ef8750 change Py3k backquote warning to a SyntaxWarning and add a test 2008-06-08 02:05:33 +00:00
Georg Brandl 60fbf7f8bb #3057: Fix the MutableMapping ABC to use the 2.6 dict interface. 2008-06-07 17:03:28 +00:00
Georg Brandl 3bed4aeea5 Register IterableUserDict as a MutableMapping. 2008-06-07 16:16:12 +00:00
Georg Brandl bf0610a1ca Revert unwanted changes. 2008-06-07 16:04:01 +00:00
Georg Brandl 7be19aabe2 Factor out docstring dedenting from inspect.getdoc() into inspect.cleandoc()
to ease standalone use of the algorithm.
2008-06-07 15:59:10 +00:00
Facundo Batista 6a5a177cba Finished bug #2451. Fixed the retrying part to make it
more robust.
2008-06-07 13:36:36 +00:00
Thomas Heller fbb9c0bf3c Issue #1798: Add ctypes calling convention that allows safe access of errno.
ctypes maintains thread-local storage that has space for two error
numbers: private copies of the system 'errno' value and, on Windows,
the system error code accessed by the GetLastError() and
SetLastError() api functions.

Foreign functions created with CDLL(..., use_errno=True), when called,
swap the system 'errno' value with the private copy just before the
actual function call, and swapped again immediately afterwards.  The
'use_errno' parameter defaults to False, in this case 'ctypes_errno'
is not touched.

On Windows, foreign functions created with CDLL(...,
use_last_error=True) or WinDLL(..., use_last_error=True) swap the
system LastError value with the ctypes private copy.

The values are also swapped immeditately before and after ctypes
callback functions are called, if the callbacks are constructed using
the new optional use_errno parameter set to True: CFUNCTYPE(...,
use_errno=TRUE) or WINFUNCTYPE(..., use_errno=True).

New ctypes functions are provided to access the ctypes private copies
from Python:

- ctypes.set_errno(value) and ctypes.set_last_error(value) store
  'value' in the private copy and returns the previous value.

- ctypes.get_errno() and ctypes.get_last_error() returns the current
  ctypes private copies value.
2008-06-06 08:33:46 +00:00
Benjamin Peterson 8456f64ce2 revert 63965 for preformance reasons 2008-06-05 23:02:33 +00:00
Benjamin Peterson 30dc7b8ce2 use the more idomatic while True 2008-06-05 22:39:34 +00:00
Thomas Heller 2e75c450d2 Backport from py3k: Implement the new buffer interface from pep3118
for ctypes instances.  Closes issue #2404.
2008-06-05 17:51:15 +00:00
Ronald Oussoren 5640ce2f1e MacOS X: Enable 4-way universal builds
This patch adds a new configure argument on OSX:
        --with-universal-archs=[32-bit|64-bit|all]

When used with the --enable-universalsdk option this controls which
CPU architectures are includes in the framework. The default is 32-bit,
meaning i386 and ppc. The most useful alternative is 'all', which includes
all 4 CPU architectures supported by MacOS X (i386, ppc, x86_64 and ppc64).

This includes limited support for the Carbon bindings in 64-bit mode as well,
limited because (a) I haven't done extensive testing and (b) a large portion
of the Carbon API's aren't available in 64-bit mode anyway.

I've also duplicated a feature of Apple's build of python: setting the
environment variable 'ARCHFLAGS' controls the '-arch' flags used for building
extensions using distutils.
2008-06-05 12:58:24 +00:00
Alexandre Vassalotti 80af6da748 Fixed complex.__getnewargs__() to not emit another complex object. 2008-06-04 20:41:44 +00:00
Thomas Heller d5bb9215c9 Revert revisions 63943 and 63942 (Issue #1798: Add ctypes calling
convention that allows safe access to errno)

This code does not yet work on OS X (__thread storage specifier not
available), so i needs a configure check plus a more portable
solution.
2008-06-04 20:22:05 +00:00
Thomas Heller e70c3378c0 Issue #1798: Add ctypes calling convention that allows safe access to
errno (and LastError, on Windows).

ctypes maintains a module-global, but thread-local, variable that
contains an error number; called 'ctypes_errno' for this discussion.
This variable is a private copy of the systems 'errno' value; the copy
is swapped with the 'errno' variable on several occasions.

Foreign functions created with CDLL(..., use_errno=True), when called,
swap the values just before the actual function call, and swapped
again immediately afterwards.  The 'use_errno' parameter defaults to
False, in this case 'ctypes_errno' is not touched.

The values are also swapped immeditately before and after ctypes
callback functions are called, if the callbacks are constructed using
the new optional use_errno parameter set to True: CFUNCTYPE(..., use_errno=TRUE)
or WINFUNCTYPE(..., use_errno=True).

Two new ctypes functions are provided to access the 'ctypes_errno'
value from Python:

- ctypes.set_errno(value) sets ctypes_errno to 'value', the previous
  ctypes_errno value is returned.

- ctypes.get_errno() returns the current ctypes_errno value.

---

On Windows, the same scheme is implemented for the error value which
is managed by the GetLastError() and SetLastError() windows api calls.

The ctypes functions are 'ctypes.set_last_error(value)' and
'ctypes.get_last_error()', the CDLL and WinDLL optional parameter is
named 'use_last_error', defaults to False.

---

On Windows, TlsSetValue and TlsGetValue calls are used to provide
thread local storage for the variables; ctypes compiled with __GNUC__
uses __thread variables.
2008-06-04 18:59:03 +00:00
Martin v. Löwis 8718459f0f Patch #1513695: New turtle module, with demos. 2008-06-04 06:29:55 +00:00
Georg Brandl 4ed3ed13c5 Fix Tkinter sequence passing. #2906. 2008-06-03 10:23:15 +00:00
Benjamin Peterson c5393c64b8 make test_mutex more elegant 2008-06-03 01:30:37 +00:00
Walter Dörwald a2a89a8712 Change all functions that expect one unicode character to accept a pair of
surrogates in narrow builds. Fixes issue #1706460.
2008-06-02 20:36:03 +00:00
Thomas Heller 261b136321 Fix the -x flag so that is does work. 2008-06-02 20:07:46 +00:00
Gregory P. Smith 137d824148 Fix issue 2782: be less strict about the format string type in strftime.
Accept unicode and anything else ParseTuple "s#" can deal with.  This
matches the time.strftime behavior.
2008-06-02 04:05:52 +00:00
Gregory P. Smith 8856ddae25 Adds a Thread.getIdent() method to provide the _get_ident() value for
any given threading.Thread object.  feature request issue 2871.
2008-06-01 23:48:47 +00:00
Georg Brandl ac19d85e04 Deprecate htmllib and sgmllib for 3.0. 2008-06-01 21:19:14 +00:00
Georg Brandl 681001e11b Generate pydoc's topic help from the reST docs via Sphinx'
new text writer.
2008-06-01 20:33:55 +00:00