Commit Graph

3154 Commits

Author SHA1 Message Date
Benjamin Peterson 692428e77f implement test skipping and expected failures
patch by myself #1034053
2009-03-23 21:50:21 +00:00
Antoine Pitrou f8387af262 Issue #4688: Add a heuristic so that tuples and dicts containing only
untrackable objects are not tracked by the garbage collector. This can
reduce the size of collections and therefore the garbage collection overhead
on long-running programs, depending on their particular use of datatypes.

(trivia: this makes the "binary_trees" benchmark from the Computer Language
Shootout 40% faster)
2009-03-23 18:41:45 +00:00
Mark Dickinson 0b666bfdf9 Issue #5512: speed up the long division algorithm for Python longs.
The basic algorithm remains the same; the most significant speedups
come from the following three changes:

  (1) normalize by shifting instead of multiplying and dividing
  (2) the old algorithm usually did an unnecessary extra iteration of
      the outer loop; remove this.  As a special case, this means that
      long divisions with a single-digit result run twice as fast as
      before.
  (3) make inner loop much tighter.

Various benchmarks show speedups of between 50% and 150% for long
integer divisions and modulo operations.
2009-03-23 18:25:13 +00:00
Lars Gustäbel 2020a59563 Issue #5068: Fixed the tarfile._BZ2Proxy.read() method that would loop
forever on incomplete input. That caused tarfile.open() to hang when used
with mode 'r' or 'r:bz2' and a fileobj argument that contained no data or
partial bzip2 compressed data.
2009-03-22 20:09:33 +00:00
Benjamin Peterson b364bfe2f4 close the file even if an exception occurs #5536 2009-03-22 17:45:11 +00:00
Mark Dickinson efc82f7e8e Issue #4258: Use 30-bit digits for Python longs, on 64-bit platforms.
Backport of r70459.
2009-03-20 15:51:55 +00:00
Raymond Hettinger 91852ca673 Issue 5381: Add object_pairs_hook to the json module. 2009-03-19 19:19:03 +00:00
Benjamin Peterson 6ffe852f90 fix strange errors when setting attributes on tracebacks #4034 2009-03-18 20:52:15 +00:00
Mark Dickinson 6b265f1bf8 Issue 4474: On platforms with sizeof(wchar_t) == 4 and
sizeof(Py_UNICODE) == 2, PyUnicode_FromWideChar now converts
each character outside the BMP to the appropriate surrogate pair.

Thanks Victor Stinner for the patch.

(backport of r70452 from py3k to trunk)
2009-03-18 16:07:26 +00:00
Mark Dickinson 277859d591 Issue #2110: Add support for thousands separator and 'n' format specifier
to Decimal __format__ method.
2009-03-17 23:03:46 +00:00
Mark Dickinson b065e52bc2 Fix bug in Decimal __format__ method that swapped left and right
alignment.
2009-03-17 18:01:03 +00:00
Eric Smith 6f42edb682 Issue 5237, Allow auto-numbered replacement fields in str.format() strings.
For simple uses for str.format(), this makes the typing easier. Hopfully this
will help in the adoption of str.format().

For example:
'The {} is {}'.format('sky', 'blue')

You can mix and matcth auto-numbering and named replacement fields:
'The {} is {color}'.format('sky', color='blue')

But you can't mix and match auto-numbering and specified numbering:
'The {0} is {}'.format('sky', 'blue')
ValueError: cannot switch from manual field specification to automatic field numbering

Will port to 3.1.
2009-03-14 11:57:26 +00:00
Antoine Pitrou feeafff052 Issue #1222: locale.format() bug when the thousands separator is a space character. 2009-03-14 00:07:21 +00:00
Tarek Ziadé 61585c260c Issue #5472: Fixed distutils.test_util tear down 2009-03-11 12:48:04 +00:00
Brett Cannon 6c4cff0f32 Require implementations for warnings.showwarning() support the 'line' argument.
Was a DeprecationWarning for not supporting it since Python 2.6.

Closes issue #3652.
2009-03-11 04:51:06 +00:00
Raymond Hettinger 56411aac79 For collections.deque() objects, expose the maxlen parameter as a read-only attribute. 2009-03-10 12:50:59 +00:00
Guilherme Polo 15d57653f1 Fixed issue #2638: Show a window constructed with tkSimpleDialog.Dialog only
after it is has been populated and properly configured in order to prevent
window flashing.
2009-03-07 02:14:38 +00:00
Guilherme Polo 3768b2f4ce Fixed issue #4792: Prevent a segfault in _tkinter by using the
guaranteed to be safe interp argument given to the PythonCmd in place
of the Tcl interpreter taken from a PythonCmd_ClientData.
2009-03-07 01:47:49 +00:00
Guilherme Polo 6d6c1fd04e Fixed issue #5193: Guarantee that Tkinter.Text.search returns a string. 2009-03-07 01:19:12 +00:00
Tarek Ziadé 943b24e7e4 Issue #5394: removed > 2.3 syntax from distutils.msvc9compiler 2009-03-07 00:32:45 +00:00
Hirokazu Yamamoto 264fc12fbf Issue #5385: Fixed mmap crash after resize failure on windows.
Now uses NULL instead of INVALID_HANDLE_VALUE as invalid map handle
because CreateFileMapping returns NULL when error occurs.
2009-03-05 14:21:12 +00:00
Hirokazu Yamamoto eacbbdfb73 Issue #5179: Fixed subprocess handle leak on failure on windows. 2009-03-03 22:18:14 +00:00
Raymond Hettinger e89b8e9832 Backport 70111: Let configparser use ordered dicts by default. 2009-03-03 05:00:37 +00:00
Raymond Hettinger 88a9164cdb Backport 70106: Add OrderedDict support to collections.namedtuple(). 2009-03-03 04:51:24 +00:00
Raymond Hettinger bc512d3abd Backport PEP 372: OrderedDict() 2009-03-03 04:45:34 +00:00
Benjamin Peterson 7d49bba969 give httplib.IncompleteRead a more sane repr #4308 2009-03-02 22:41:42 +00:00
Gregory P. Smith ae91d0907d Adds an optional flags argument to re.split, re.sub and re.subn to be
consistent with the other re module functions.
2009-03-02 05:13:57 +00:00
Benjamin Peterson ad58b7c9da fix a silly problem of caching gone wrong #5401 2009-03-02 03:35:12 +00:00
Hirokazu Yamamoto b0e10c760c Issue #1733986: Fixed mmap crash in accessing elements of second map object
with same tagname but larger size than first map. (Windows)
2009-02-28 12:13:07 +00:00
Hirokazu Yamamoto f2dc885780 Issue #5386: mmap.write_byte didn't check map size, so it could cause buffer
overrun.
2009-02-28 10:31:54 +00:00
Tarek Ziadé 7334735ee1 Issues #1533164 and #5378: Added quiet and force-optimize options to Distutils bdist_rpm command 2009-02-28 10:08:02 +00:00
Tarek Ziadé dda92f7f02 Issue #5052: make Distutils compatible with 2.3 again. 2009-02-27 12:53:34 +00:00
Benjamin Peterson b3dd5485da remove deprecated symtable.Symbol methods 2009-02-26 19:07:18 +00:00
Tarek Ziadé e3bc0eff25 Fixed #5316 : test failure in test_site 2009-02-25 22:29:27 +00:00
Matthias Klose 8ad554fdbe - Link the shared python library with $(MODLIBS). 2009-02-22 23:14:26 +00:00
Mark Dickinson 3e4caeb3bf Issue #5341: Fix a variety of spelling errors. 2009-02-21 20:27:01 +00:00
Eric Smith e9fb6863da Issue #5247: Improve error message when unknown format codes are used when using str.format() with str, unicode, long, int, and float arguments. 2009-02-20 14:02:36 +00:00
Vinay Sajip 1a0d2befea #5287: Add exception handling around findCaller() call to help out IronPython. 2009-02-19 12:31:32 +00:00
Raymond Hettinger 08259e8f25 Py3k warnings now automatically include -Qwarn for division. 2009-02-18 23:10:19 +00:00
Hirokazu Yamamoto 17a837e4db Issue #5282: Fixed mmap resize on 32bit windows and unix. When offset > 0,
The file was resized to wrong size.
2009-02-17 13:17:26 +00:00
Hirokazu Yamamoto f6bbd0e71d Issue #5292: Fixed mmap crash on its boundary access m[len(m)]. 2009-02-17 10:12:10 +00:00
Tarek Ziadé 7dd533963f Fixed #2279: distutils.sdist.add_defaults now add files listed in package_data and data_files 2009-02-16 21:38:01 +00:00
Benjamin Peterson 5781f32b4f remove some PyBytes_* aliases that are not in 3.x 2009-02-16 21:09:09 +00:00
Mark Dickinson 2ffb26fb83 Issue #5260: Various portability and standards compliance fixes, optimizations
and cleanups in Objects/longobject.c.  The most significant change is that
longs now use less memory:  average savings are 2 bytes per long on 32-bit
systems and 6 bytes per long on 64-bit systems.  (This memory saving already
exists in py3k.)
2009-02-15 10:13:41 +00:00
Tarek Ziadé 1369900619 Fix for #5257: refactored all tests in distutils, so they use a temporary directory. 2009-02-14 14:10:23 +00:00
Tarek Ziadé 2432b0b367 Fixed #4524: distutils build_script command failed with --with-suffix=3 2009-02-13 23:00:43 +00:00
Tarek Ziadé 275958aacf Issue #2461: added tests for distutils.util 2009-02-13 22:22:03 +00:00
Antoine Pitrou 76a4b896c4 Issue #5186: Reduce hash collisions for objects with no __hash__ method by
rotating the object pointer by 4 bits to the right.
2009-02-13 13:52:33 +00:00
Gregory P. Smith ea38826ab2 - Issue #3745: Fix hashlib to always reject unicode and non buffer-api
supporting objects as input no matter how it was compiled (built in
  implementations or external openssl library).
(backported from a py3k branch)
2009-02-13 03:00:00 +00:00
Mark Dickinson 39c6f7f123 Typo fix. 2009-02-12 17:55:42 +00:00
Raymond Hettinger 31c769ca89 Issue 5032: added a step argument to itertools.count() and allowed non-integer arguments. 2009-02-12 05:39:46 +00:00
Gregory P. Smith 3605b5cee3 Issue #1008086: Fixes socket.inet_aton() to always return 4 bytes even
on LP64 platforms (most 64-bit Linux, bsd, unix systems).
2009-02-11 23:45:25 +00:00
Thomas Heller 3689ae256e Issue#5203: ctypes segfaults when passing a unicode string to a
function without argtypes, if HAVE_USABLE_WCHAR_T is false.
2009-02-10 18:43:01 +00:00
Mark Dickinson 4015f62e39 Issue #5175: PyLong_AsUnsignedLongLong now raises OverflowError for
negative arguments.  Previously, it raised TypeError.

Thanks Lisandro Dalcin.
2009-02-10 15:46:50 +00:00
Martin v. Löwis a3e3cb7ee0 Issue #5134: Silence compiler warnings when compiling sqlite with VC++. 2009-02-10 13:09:19 +00:00
Tarek Ziadé 74fbf60e8c Fixed #3386: the optional prefix argument was ignored under OS2 and NT in distutils.sysconfig.get_python_lib 2009-02-10 12:31:09 +00:00
Brett Cannon 28d108893c compileall used the ctime of bytecode and source to determine if the bytecode
should be recreated. This created a timing hole. Fixed by just doing what
import does; check the mtime and magic number.
2009-02-10 02:07:38 +00:00
Raymond Hettinger 322daea7c3 Issue 1818: collections.namedtuple() to support automatic renaming of invalid fieldnames. 2009-02-10 01:24:05 +00:00
Guilherme Polo a66cf5bd04 Fixed issue #5122: Synchronize tk load failure check to prevent a
potential deadlock.
2009-02-09 20:50:27 +00:00
Guilherme Polo d2ea0332ab Fixed issue #4890: Handle empty text search pattern in
Tkinter.Text.search
2009-02-09 16:41:09 +00:00
Mark Dickinson c97c9096ed Issue #4575: fix Py_IS_INFINITY macro to work correctly on x87 FPUs.
It now forces its argument to double before testing for infinity.
2009-02-09 14:18:43 +00:00
Vinay Sajip b20af944d2 Issue #5170: Fixed Unicode output bug in logging and added test case. This is a regression which did not occur in 2.5. 2009-02-08 19:06:08 +00:00
Nick Coghlan 0194f5bc98 Issue #4512 closeout: Make ZipImport.get_filename() a public method 2009-02-08 03:17:00 +00:00
Nick Coghlan c3623b1849 Mention patch submitter in NEWS entry for r69419 2009-02-08 01:46:01 +00:00
Nick Coghlan d39600e69f Issue 4195: Restore the ability to execute packages with the -m switch (but this time in a way that leaves the import machinery in a valid state). (Original patch by Andi Vajda) 2009-02-08 01:26:34 +00:00
Neil Schemenauer 92c3b2190b Issue #999042: The Python compiler now handles explict global statements
correctly (should be assigned using STORE_GLOBAL opcode).  This was done by
having the system table differentiate between explict and implicit globals.
2009-02-07 00:54:41 +00:00
Guilherme Polo 363161a418 Issue #1731706: Call Tcl_ConditionFinalize for Tcl_Conditions that will
not be used again (this requires Tcl/Tk 8.3.1), also fix a memory
leak in Tkapp_Call when calling from a thread different than the one that
created the Tcl interpreter.
2009-02-06 22:48:07 +00:00
Guilherme Polo 14ff18d211 Partial fix to issue #1731706: memory leak in Tkapp_Call when calling
from a thread different than the one that created the Tcl interpreter.
2009-02-06 22:26:22 +00:00
Tarek Ziadé 05adf073cc fixed #1520877: now distutils reads Read from the environment/Makefile 2009-02-06 01:15:51 +00:00
Eric Smith 81fe09344c Implement issue #4285, convert sys.version_info to a named
tuple. Patch by Ross Light.
2009-02-06 00:48:26 +00:00
Tarek Ziadé d5eb985492 Fixed #1276768: verbose option was not used in the code. 2009-02-06 00:31:59 +00:00
Tarek Ziadé 0d4fd3493e Fixed #5132: enable extensions to link on Solaris 2009-02-05 22:52:52 +00:00
Raymond Hettinger b516370bcb Issue 1242657: list(obj) can swallow KeyboardInterrupt. 2009-02-02 21:50:13 +00:00
Guilherme Polo d7bb4d484f NEWS entry for issue #1581476 2009-02-02 21:14:14 +00:00
Martin v. Löwis fee1c7f4c9 Issue #4494: Fix build with Py_NO_ENABLE_SHARED on Windows. 2009-02-02 14:23:16 +00:00
Gregory P. Smith de1a8b720a - Issue #5104: The socket module now raises OverflowError when 16-bit port and
protocol numbers are supplied outside the allowed 0-65536 range on bind()
  and getservbyport().
2009-01-31 22:57:30 +00:00
Antoine Pitrou 707c593761 Issue #2047: shutil.move() could believe that its destination path was
inside its source path if it began with the same letters (e.g. "src" vs.
"src.new").
2009-01-29 20:19:34 +00:00
Raymond Hettinger f779e6f51b Issue 4920: Fixed next() vs __next__() issues in the ABCs
for Iterator and MutableSet.  Also added thorough test for
required abstractmethods.
2009-01-28 23:02:26 +00:00
Guilherme Polo b1a98de25e Issue #5083: New 'gui' resource for regrtest. 2009-01-28 20:03:26 +00:00
Guilherme Polo 4eae078448 Demos for ttk added. 2009-01-28 15:56:01 +00:00
Guilherme Polo cda93aafde Added the ttk module. See issue #2983: Ttk support for Tkinter. 2009-01-28 13:09:03 +00:00
Raymond Hettinger ecf252abac Issue 5021: doctest.testfile should set __name__ 2009-01-27 10:03:04 +00:00
Raymond Hettinger d081abc8be Promote combinations_with_replacement() from a recipe to a regular itertool. 2009-01-27 02:58:49 +00:00
Brett Cannon 93881c6c58 Backport importlib in the form of providing importlib.import_module(). This has
been done purely to help transitions from 2.7 to 3.1.
2009-01-26 01:16:50 +00:00
Tarek Ziadé aaedcef578 Fixed #1885: --formats=tar,gztar was not working properly in the sdist command 2009-01-25 23:34:00 +00:00
Raymond Hettinger 2bcb8e9b0d Promote compress() from a recipe to being a regular itertool. 2009-01-25 21:04:14 +00:00
Tarek Ziadé ef249b13eb Fixed #4863: removed distutils.mwerkscompiler 2009-01-25 18:19:25 +00:00
Jesse Noller b5a4b0abed Properly document multiprocessing's logging support, resolve outstanding issues with the custom levels 2009-01-25 03:36:13 +00:00
Mark Dickinson a3ecd2c668 Issue #1672332: Fix unpickling of subnormal floats, which was raising
ValueError on some platforms as a result of the platform strtod setting
errno on underflow.
2009-01-24 16:40:29 +00:00
Martin v. Löwis f081e1c9d9 Issue #3881: Help Tcl to load even when started through the
unreadable local symlink to "Program Files" on Vista.
2009-01-24 15:47:27 +00:00
Martin v. Löwis 0dfcfc8b59 Issue #4710: Extract directories properly in the zipfile module;
allow adding directories to a zipfile.
2009-01-24 14:00:33 +00:00
Jesse Noller f6da8d1495 Issue 3807: multiprocessing fails to compile under --without-threads 2009-01-23 14:04:41 +00:00
Antoine Pitrou e741cc607c Issue #5008: When a file is opened in append mode with the new IO library,
do an explicit seek to the end of file (so that e.g. tell() returns the
file size rather than 0). This is consistent with the behaviour of the
traditional 2.x file object.
2009-01-21 00:45:36 +00:00
Vinay Sajip 5fb11b2b85 Issue 5013: Fixed bug in FileHandler when delay was set. 2009-01-20 22:43:17 +00:00
Raymond Hettinger 933d3a7a54 Issue 4998: __slots__ on Fractions was useless. 2009-01-20 20:34:19 +00:00
Benjamin Peterson e18ef194d9 allow unicode keyword arguments for the ** syntax #4978 2009-01-20 14:21:16 +00:00
Benjamin Peterson 596d306950 add a note about the ftruncate change 2009-01-19 15:42:23 +00:00
Jesse Noller 9a5b2ad38d Resolve issue 3321: (segfault) _multiprocessing.Connection() doesn't check handle 2009-01-19 15:12:22 +00:00
Benjamin Peterson 5848d1ff35 raise an OSError for invalid fds #4991 2009-01-19 00:08:08 +00:00
Jesse Noller 438195fc11 issue 4301: patch logging to add processName, remove the old _check_logger_class code 2009-01-18 21:04:36 +00:00