Benjamin Peterson
21f6aac633
apply the second part of #4242 's patch; classify all the implementation details in test_descr
2009-03-26 20:17:27 +00:00
Benjamin Peterson
47d9738b0f
rename TestCase.skip() to skipTest() because it causes annoying problems with trial #5571
2009-03-26 20:05:50 +00:00
Benjamin Peterson
c3141a6e96
add some useful utilities for skipping tests with unittest's new skipping ability
...
most significantly apply a modified portion of the patch from #4242 with
patches for skipping implementation details
2009-03-26 19:58:18 +00:00
Benjamin Peterson
0ad9b7727d
add support for PyPy
2009-03-26 19:09:21 +00:00
Benjamin Peterson
94e4e2a7e5
roll old test in with new one
2009-03-26 18:58:30 +00:00
Benjamin Peterson
b457b89323
more and more implementations now support sys.subversion
2009-03-26 18:55:48 +00:00
Benjamin Peterson
f521b8c6d2
add much better tests for python version information parsing
2009-03-26 18:35:37 +00:00
Benjamin Peterson
c9301355d8
remove uneeded function
2009-03-26 16:32:23 +00:00
Raymond Hettinger
2dc90fdfaf
Separate initialization from clearing.
2009-03-25 22:41:32 +00:00
Benjamin Peterson
2f6f7436aa
this can be slightly less ugly
2009-03-25 21:42:51 +00:00
Benjamin Peterson
a8adceb431
add shorthands for expected failures and unexpected success
2009-03-25 21:24:04 +00:00
Marc-André Lemburg
a519cfc953
Remove the sys.version_info shortcut, since they cause the APIs
...
to return different information than the _sys_version() output
used in previous Python versions.
This also fixes issue5561: platform.python_version_tuple returns tuple of ints, should be strings
Added more tests for the various platform functions.
2009-03-25 19:44:58 +00:00
Benjamin Peterson
d0cdb2ddf2
another style nit
2009-03-24 23:07:07 +00:00
Benjamin Peterson
a473f00cac
fix newline issue in test summary
2009-03-24 22:56:32 +00:00
Benjamin Peterson
2bf74fd0ac
this is better written using assertRaises
2009-03-24 03:24:56 +00:00
Benjamin Peterson
037154865e
fix typo
2009-03-24 01:11:37 +00:00
Benjamin Peterson
c750d4d761
add new skipping things to __all__
2009-03-24 00:39:24 +00:00
Benjamin Peterson
4e4de33ca9
update docstring
2009-03-24 00:37:12 +00:00
Benjamin Peterson
3e0aa49d3f
remove special metadata
2009-03-24 00:36:16 +00:00
Benjamin Peterson
a7d441de68
some cleanup and modernization
2009-03-24 00:35:20 +00:00
Benjamin Peterson
bca248e9a5
update from CVS
2009-03-23 23:19:03 +00:00
Benjamin Peterson
cb2b0e45d4
comply with the evilJavaNamingScheme for attribute names
...
It seems my love of PEP 8 overrode the need for consistentcy
2009-03-23 22:29:45 +00:00
Benjamin Peterson
692428e77f
implement test skipping and expected failures
...
patch by myself #1034053
2009-03-23 21:50:21 +00:00
Benjamin Peterson
797eaf305a
complain when there's no last exception
2009-03-23 21:25:15 +00:00
Benjamin Peterson
3e6c335ae0
revert r70552; wrong fix
2009-03-23 21:23:30 +00:00
Benjamin Peterson
85e1478ca4
fix very old names for exception terms #5543
2009-03-23 20:47:59 +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
Raymond Hettinger
e5b78563b6
Make imported name private and wrap long-line.
2009-03-23 18:26:59 +00:00
Raymond Hettinger
906f95e80b
Move initialization of root link to __init__.
2009-03-23 04:42:18 +00:00
Raymond Hettinger
f1e2df9780
Add more comments. Improve variable names.
...
Make links clearer by using a Link object
instead of a list. Use proxy links to avoid
circular references.
2009-03-23 00:08:09 +00:00
Benjamin Peterson
704dc269e3
AttributeError can be thrown during recursion errors
2009-03-22 22:24:58 +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
c8e81ef508
Fix typo
2009-03-19 23:22:25 +00:00
Raymond Hettinger
e980d2d44b
* Add implementation notes.
...
* Re-order methods so that those touching the underlying data
structure come first and the derived methods come last.
2009-03-19 23:12:41 +00:00
Raymond Hettinger
2412299be9
* Add clearer comment to initialization code.
...
* Add optional argument to popitem() -- modeled
after Anthon van der Neut's C version.
* Fix method markup in docs.
2009-03-19 19:59:58 +00:00
Raymond Hettinger
91852ca673
Issue 5381: Add object_pairs_hook to the json module.
2009-03-19 19:19:03 +00:00
Raymond Hettinger
2124599eaa
Improve implementation with better underlying data structure
...
for O(1) deletions. Big-Oh performance now the same as regular
dictionaries. Uses a doubly-linked list instead of a list/seq
to track insertion order.
2009-03-19 15:21:10 +00:00
Benjamin Peterson
fcfa7ead4f
close files after comparing them
2009-03-19 03:04:31 +00:00
Raymond Hettinger
a61ae6922f
Use mixin methods where possible. (2.7 only -- these don't all exist in 3.0)
2009-03-18 22:13:20 +00:00
Benjamin Peterson
6ffe852f90
fix strange errors when setting attributes on tracebacks #4034
2009-03-18 20:52:15 +00:00
Antoine Pitrou
7c33bd5ecb
Attempt to fix Solaris buildbot failure on test_locale
2009-03-18 17:10:04 +00:00
Mark Dickinson
b14514a153
Fix bug in _insert_thousands_sep: too much zero padding could be
...
added for 'n' formats with non-repeating thousands-separator.
2009-03-18 08:22:51 +00:00
Bob Ippolito
d914e3f861
merge json library with simplejson 2.0.9 (issue 4136)
2009-03-17 23:19:00 +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
Hirokazu Yamamoto
bb7467f6e3
Added skip for old MSVC.
2009-03-15 22:43:14 +00:00
Georg Brandl
fc9ea97a18
Move the previously local import of threading to module level.
...
This is cleaner and avoids lockups in obscure cases where a Queue
is instantiated while the import lock is already held by another thread.
OKed by Tim Peters.
2009-03-15 22:11:07 +00:00
Eric Smith
2ace4cf813
Unicode format tests weren't actually testing unicode. This was probably due to the original backport from py3k.
2009-03-14 14:37:38 +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
Raymond Hettinger
bac769bb5e
Small optimization for corner case where maxlen==0.
2009-03-10 09:31:48 +00:00
Raymond Hettinger
daeceb2de8
Add a version tag to the decimal module.
2009-03-10 04:49:21 +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
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
09033068f1
mmap.resize for anonymous map is not working yet, so changed to real file mapping...
2009-03-05 14:52:44 +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
Ronald Oussoren
a97063a108
Fixes issues 3883 and 5194
2009-03-04 21:35:05 +00:00
Brett Cannon
417937733f
Fix some more bugs caused by the backport from 3.x for importlib.
...
Do a more exact copy of the final 3.x code to resolve bugs and add
appropriate tests.
2009-03-04 01:00:53 +00:00
Raymond Hettinger
131af6505a
Backport 70140, 70141, 70143, and 70144.
...
Adds tests, switches from list to deque, fixes __reduce__
which was unnecessarily copying __keys.
2009-03-03 22:59:25 +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
0b15541ae2
Minor simplification.
2009-03-03 21:13:51 +00:00
Raymond Hettinger
9353ea2b85
Make the underlying data structure more private.
2009-03-03 20:53:51 +00:00
Raymond Hettinger
f17f81d9c8
Beef-up tests.
2009-03-03 07:12:09 +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
Tarek Ziadé
ce45a967c2
removing the force-optimized option as discussed in #1533164
2009-03-02 05:38:44 +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
Georg Brandl
bcf7bf3833
Fix 3k-style metaclass syntax in docstrings.
2009-02-28 21:33:10 +00:00
Jeffrey Yasskin
68d6852006
Backport r69961 to trunk, replacing JUMP_IF_{TRUE,FALSE} with
...
POP_JUMP_IF_{TRUE,FALSE} and JUMP_IF_{TRUE,FALSE}_OR_POP. This avoids executing
a POP_TOP on each conditional and sometimes allows the peephole optimizer to
skip a JUMP_ABSOLUTE entirely. It speeds up list comprehensions significantly.
2009-02-28 19:03:21 +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
Raymond Hettinger
b31a6d0949
Give mapping views a usable repr.
2009-02-27 08:09:47 +00:00
Brett Cannon
ac10be365e
Fix a bug where code was trying to index an int. Left over from the situation
...
from using str.rpartition to str.rindex.
Closes Issue5213.
2009-02-27 03:38:28 +00:00
Tarek Ziadé
b5fc89ee57
removed unused import
2009-02-26 23:44:00 +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
Brett Cannon
b7019d8e9e
Expand upon test_site.test_s_option to try to debug its failure.
2009-02-24 22:01:02 +00:00
Raymond Hettinger
8c56f8890e
Backport 69934: Register xrange() as a Sequence.
2009-02-24 12:23:23 +00:00
Neil Schemenauer
c9332fada6
Fix call to os.waitpid, it does not take keyword args.
2009-02-24 04:23:25 +00:00
Tarek Ziadé
11b34d07d8
more test coverage
2009-02-23 12:41:29 +00:00
Tarek Ziadé
7b47172bec
Removing unused __main__ sections
2009-02-22 20:15:41 +00:00
Tarek Ziadé
28bba74b7f
removing map and lambda usage, so the test is similar to py3k's branch one
2009-02-22 20:11:46 +00:00
Tarek Ziadé
90b7d56d91
moved distutils.text_file tests into a real unittest class
2009-02-22 19:58:12 +00:00
Antoine Pitrou
b03f532fe5
Revert debugging statements, culprit is possibly test_distutils (see #5316 )
2009-02-22 18:20:46 +00:00
Antoine Pitrou
13d1690ecd
Try to make sense of the test_site buildbot failures
2009-02-22 17:25:52 +00:00
Mark Dickinson
3e4caeb3bf
Issue #5341 : Fix a variety of spelling errors.
2009-02-21 20:27:01 +00:00
Raymond Hettinger
be9b765c07
Speedup and simplify negative counter using count's new step argument.
2009-02-21 08:58:42 +00:00
Raymond Hettinger
aa681c7b99
Fix keyword arguments for itertools.count().
...
Step arg without a start arg was ignored.
2009-02-21 07:17:22 +00:00
Mark Dickinson
2752e9b527
Issue #5295 : Typos in turtle.py
2009-02-20 20:42:53 +00:00
Collin Winter
8725dce2ae
Issue 5176: special-case string formatting in BINARY_MODULO implementation. This shows a modest (1-3%) speed-up in templating systems, for example.
2009-02-20 19:30:41 +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
8f9a1eee0d
Inline coefficients in gamma(). Add reflection formula. Add comments.
2009-02-19 09:50:24 +00:00
Raymond Hettinger
f9bce83e71
Add some cross-references to the docs. Simplify the python code equivalent for izip(). Supply an optional argument for the nth() recipe.
2009-02-19 05:34:35 +00:00
Raymond Hettinger
182edaefb5
Add keyword arg support to itertools.repeat().
2009-02-19 02:38:25 +00:00
Raymond Hettinger
2e2909f584
Add keyword arg support to itertools.compress().
2009-02-19 02:15:14 +00:00
Tarek Ziadé
0e5001eff9
fixed the data_files inclusion behavior
2009-02-17 23:06:51 +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é
f68b5b8046
#2279 added the plain path case for data_files
2009-02-17 09:42:44 +00:00
Tarek Ziadé
ae9dc8c48a
#2279 : use os.sep so the MANIFEST file test work on win32
2009-02-16 21:41:54 +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
Raymond Hettinger
b21d8109af
Add GC support to count() objects. Backport candidate.
2009-02-16 20:39:12 +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
Georg Brandl
f3715d2fc7
#5179 : don't leak PIPE fds when child execution fails.
2009-02-14 17:01:36 +00:00
Benjamin Peterson
95777bb019
this needn't be a shebang line
2009-02-14 17:00:51 +00:00
Benjamin Peterson
76afd3b8d0
we're no longer using CVS, so this doesn't have to be binary
2009-02-14 16:51:03 +00:00
Tarek Ziadé
09d3d2ded6
Replace variable
2009-02-14 14:12:30 +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
Raymond Hettinger
a4038038c6
Add keyword argument support to itertools.count().
2009-02-14 00:25:51 +00:00
Tarek Ziadé
544c3e19e6
fix the environ for distutils test_util
2009-02-13 23:41:57 +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
Tarek Ziadé
6f1d931495
reverted leak fix, to use the one done in py3k branch (r67382)
2009-02-13 16:13:16 +00:00
Georg Brandl
0638a08a4b
#3694 : add test for fix committed in r66693.
2009-02-13 11:03:59 +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
Tarek Ziadé
b516c126ef
fixing the leak introduced in r69304
2009-02-12 20:56:21 +00:00
Raymond Hettinger
dbe3bfbb30
One more test.
2009-02-12 12:43:01 +00:00
Raymond Hettinger
aa04461260
Add an extra testcase.
2009-02-12 12:04:26 +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
Benjamin Peterson
4bb96feb60
no need for this __bases__ trick anymore
2009-02-12 04:17:04 +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
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
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
55bdb8e4ac
Checking for tk availability before continuing (basically the same that is done in test_ttk_guionly)
2009-02-09 19:57:04 +00:00
Guilherme Polo
bbb7efd72b
Some tests for Tkinter.Text.search
2009-02-09 19:21:21 +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
Guilherme Polo
190c35f928
Turned setup_master public
2009-02-09 16:09:17 +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
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
Benjamin Peterson
096c3ad41d
make destinsrc private
2009-02-07 19:08:22 +00:00
Neil Schemenauer
f8741eacf5
Add test for issue #999042 , explict global statement works.
2009-02-07 18:35:16 +00:00
Neil Schemenauer
8573d62f8f
Fix broken test in test_hotshot. Treating the current directory as an
...
empty file is sloppy and non-portable. Use NamedTemporaryFile to make
an empty file.
2009-02-07 14:53:31 +00:00
Guilherme Polo
8e5e438d21
Eliminated the need to use ttk.__loadtk__ and the problems related it.
2009-02-07 02:20:29 +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
Neil Schemenauer
98c3b85bc4
Make names generated for 'with' variables match the built-in compiler.
2009-02-07 00:13:39 +00:00
Tarek Ziadé
8be8765a2e
#3986 replacing string and types call (like in the Py3k branch), and put exec_msg call at the right place
2009-02-07 00:05:39 +00:00
Neil Schemenauer
aa397d1806
Convert "srcdir" into an absolute path if that seems prudent. Currrently
...
the only user of this is Lib/distutils/tests/test_build_ext.py (in order
to find the source for xxmodule.c). I'm not sure if other platforms
need similar tweaks, I'm not brave enough to attempt it without being
able to test.
2009-02-06 21:33:45 +00:00
Neil Schemenauer
4db626f95d
Overhaul Lib/compiler block ordering. The previous code was filled with
...
hacks. The new code is based on issue #2472 posted by Antoine Pitrou. I
did some further cleanups of the pyassem code and optimized the block
ordering pass.
2009-02-06 21:08:52 +00:00
Tarek Ziadé
0d6705b234
Fixed #5167 : test_customize_compiler does not apply under non unix compilers
2009-02-06 13:27:38 +00:00
Armin Rigo
5561986da3
Ivan on IRC in #twisted reported this crasher.
2009-02-06 11:46:26 +00:00
Kristján Valur Jónsson
e20f54f542
Fix a number of Win32ErrorTests error cases. chmod wasn't being tested. 'access' never raises an error.
2009-02-06 10:17:34 +00:00
Tarek Ziadé
98da8e151a
removed types usage and added test coverage (work for #3986 )
2009-02-06 08:55:23 +00:00
Tarek Ziadé
c5ed5ba585
Fixed #3987 : removed unused import
2009-02-06 08:20:15 +00:00
Tarek Ziadé
05adf073cc
fixed #1520877 : now distutils reads Read from the environment/Makefile
2009-02-06 01:15:51 +00:00
Tarek Ziadé
aaf2e18841
using >= so setting verbose to 2 will work as well
2009-02-06 00:49:45 +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é
5dde357c9e
README now reflects the current state
2009-02-06 00:46:57 +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
Neil Schemenauer
a52f1c62eb
Fix test_build_ext.py to work when building in a separate directory.
...
Since "srcdir" should now be defined on all platforms, use it to
find the module source.
2009-02-05 16:25:16 +00:00
Neil Schemenauer
e844be6d9a
Since sysconfig.get_python_inc() now works when building in a
...
directory other than the source directory, simplify the test code in
test_sysconfig.py.
2009-02-05 16:19:05 +00:00
Neil Schemenauer
444df45739
Fix get_python_inc() to work when building in a directory separate from
...
the source. Also, define 'srcdir' on non-posix platforms.
2009-02-05 16:14:39 +00:00
Tarek Ziadé
97a69f0c10
Fix comment for #1835
2009-02-05 09:06:23 +00:00
Raymond Hettinger
d507afdc81
Minor doc fixups.
2009-02-04 10:52:32 +00:00
Kristján Valur Jónsson
fd4c872726
issue 4804: Provide checks for the format string of strftime, and for the "mode" string of fopen on Windows. These strings are user provided from python and so we can avoid invoking the C runtime invalid parameter handler by first checking that they are valid.
2009-02-04 10:05:25 +00:00
Brett Cannon
8bdd3b3dcf
Make importlib backwards-compatible to Python 2.2 (but this is not promised to
...
last; just doing it to be nice).
Also fix a message for an exception.
2009-02-03 21:13:05 +00:00
Brett Cannon
1797b7dbbc
Backport importlib to at least Python 2.5 by getting rid of use of str.format.
2009-02-03 05:08:22 +00:00
Brett Cannon
94196532c1
Make importlib a package. This allows using svn:externals in the sandbox to
...
package up the code for separate distribution.
2009-02-03 04:58:29 +00:00
Raymond Hettinger
2c8585b0af
Register decimals as numbers.Number
2009-02-03 03:37:03 +00:00
Raymond Hettinger
d6fc2623c5
Validate that __length_hint__ returns a usable result.
2009-02-03 02:23:19 +00:00
Raymond Hettinger
b516370bcb
Issue 1242657: list(obj) can swallow KeyboardInterrupt.
2009-02-02 21:50:13 +00:00
Guilherme Polo
b98cb43e4a
Moving to importlib
2009-02-02 20:28:59 +00:00
Guilherme Polo
b64c989efc
Restore the previous geometry before leaving the test
2009-02-02 20:23:29 +00:00
Guilherme Polo
905c6b7f48
Use a single Tcl interpreter through all these tests, this may help some
...
failing buildbots.
2009-02-02 00:38:54 +00:00
Guilherme Polo
3b331dd3ea
Restore Tkinter.Tk._loadtk so this test doesn't fail for problems
...
related to ttk.
2009-02-01 02:56: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
Benjamin Peterson
fb921e2c00
I believe the intention here was to avoid a global lookup
2009-01-31 21:00:10 +00:00
Mark Dickinson
f709ab8526
Add an extra test for long <-> float hash equivalence.
2009-01-31 16:44:04 +00:00
Benjamin Peterson
1de05e9b2a
check the errno in bad fd cases
2009-01-31 01:42:55 +00:00
Benjamin Peterson
b3619be995
make _tkinter._flatten check the result of PySequence_Size for errors #3880
2009-01-30 02:24:39 +00:00
Benjamin Peterson
4a69410e9f
pep8tify conditionals
2009-01-30 02:02:25 +00:00
Tarek Ziadé
5da9a51d9d
fixed test_make_distribution so it runs on any platform, as long as tar an gzip are available
2009-01-29 23:49:17 +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
Mark Hammond
6ed1cb0014
Fix issue5075: bdist_wininst should not depend on the vc runtime?
2009-01-29 12:13:31 +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
6d51f12c5e
Make sure the root windows gets destroyed
2009-01-28 20:02:01 +00:00
Guilherme Polo
7a77ee88af
* Renaming test_tk_* to test_ttk_* since that is what they are testing.
...
* Added ttk tests to the expected skips mapping just like where test_tcl
was expected to be skipped too.
2009-01-28 19:28:04 +00:00
Guilherme Polo
6785cf0169
Added support for collecting tests only from specific packages.
2009-01-28 19:23:28 +00:00
Guilherme Polo
cda93aafde
Added the ttk module. See issue #2983 : Ttk support for Tkinter.
2009-01-28 13:09:03 +00:00
Benjamin Peterson
fd0107fdf9
use True and False
2009-01-27 23:15:48 +00:00
Raymond Hettinger
560f9a8a90
Add more tests for the powerset() recipe.
2009-01-27 13:26:35 +00:00
Raymond Hettinger
2f6c2e03a8
More exhaustive combinatoric checks.
2009-01-27 10:36:14 +00:00
Raymond Hettinger
ecf252abac
Issue 5021: doctest.testfile should set __name__
2009-01-27 10:03:04 +00:00
Raymond Hettinger
f93f3032c6
Stronger tests for combinatoric relationships.
2009-01-27 09:52:35 +00:00
Raymond Hettinger
2976aaa396
Add tests to verify combinatoric relationships.
2009-01-27 09:33:06 +00:00
Benjamin Peterson
1763f8adb4
excellent place to use a set() #5069
2009-01-27 03:07:53 +00:00
Raymond Hettinger
d081abc8be
Promote combinations_with_replacement() from a recipe to a regular itertool.
2009-01-27 02:58:49 +00:00
Raymond Hettinger
bf3f69ee85
Remove startup firewall message. That is handled by an error dialog
...
whenever a connection cannot be formed. Also, the Idle version number
is already in the About Idle dialog. Now, the startup is clean looking
once again.
2009-01-26 23:29:09 +00:00
Mark Dickinson
c028abf3cd
Issue #5073 : Fix occasional failure of bsddb/test/test_lock.py. Thanks
...
Hirokazu Yamamoto for the patch.
2009-01-26 21:51:56 +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
Tarek Ziadé
7c28be8df5
added missing module docstring
2009-01-25 22:11:04 +00:00
Tarek Ziadé
9f369e9163
Issue #5052 : removed backward compatibility information (out of date)
2009-01-25 22:09:10 +00:00
Raymond Hettinger
68d919e4d6
Improved itertools recipe for generating powerset().
2009-01-25 21:31:47 +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é
1af3b5a9a4
Issue #4863 , removing remaining bits
2009-01-25 19:29:10 +00:00
Tarek Ziadé
ef249b13eb
Fixed #4863 : removed distutils.mwerkscompiler
2009-01-25 18:19:25 +00:00
Benjamin Peterson
78821ddf8c
fix building the core with --disable-unicode
...
I changed some bytearray methods to use strings instead of unicode like bytes_repr
Also, bytearray.fromhex() can take strings as well as unicode
2009-01-25 17:15:10 +00:00
Mark Dickinson
e52c31450d
Remove uses of cmp from the decimal module.
2009-01-25 10:39:15 +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
10085c656f
Issue #3657 : fix occasional test_pickletools failures.
2009-01-24 21:08:38 +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
Mark Dickinson
c187d11af3
Issue #5025 : Fix occasional test_kqueue failure on OS X.
2009-01-24 16:17:27 +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
7d7e1b7c2e
Add heading for 2.7a0.
2009-01-24 15:45:18 +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
Kristján Valur Jónsson
89e759d462
Add a test for UNC import paths, see issue 3677
2009-01-24 10:52:26 +00:00
Raymond Hettinger
1bc1c8ac76
Update comments and add an optimized path for Counter.update().
2009-01-22 09:05:43 +00:00
Raymond Hettinger
0a1f7b8f72
Tighten-up the docs for Counter().
2009-01-21 23:12:51 +00:00
Raymond Hettinger
4571f347f9
Simplify explanation of multiset operations by removing restrictions on negative inputs.
2009-01-21 20:31:50 +00:00
Jesse Noller
7314b38168
Issue 5009: multiprocessing: failure in manager._debug_info()
2009-01-21 02:08:17 +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
aecf36a0b5
Issue 5013: Fixed bug in FileHandler when delay was set - added fix for RotatingFileHandler and changed header comment slightly.
2009-01-20 23:16:08 +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
Raymond Hettinger
7b4c2beda6
Use Georg's new permalinks to documentation by version number.
...
That assures that IDLE's help always points to the correct
version and the latest update with all bug fixes.
2009-01-20 10:46:23 +00:00
Raymond Hettinger
ae3f068fb5
Make merging easier by formattng comment blocks the same in Py3.1
2009-01-20 03:36:36 +00:00
Raymond Hettinger
562a4ada56
Add Counter() to __all__.
2009-01-20 02:24:38 +00:00
Raymond Hettinger
bad1eb2ff3
Build-outs for Counter() class:
...
* Constructor and update() support keyword args (like their dict counterparts).
* The 'del' statement no longer raises KeyError for missing values.
* Add multiset operations: __add__, __sub__, __and__, __or__.
2009-01-20 01:19:26 +00:00
Benjamin Peterson
1f01cd013f
I'm sick of these deprecations warnings in test_os
2009-01-19 21:08:37 +00:00
Benjamin Peterson
5539c78391
make bad file descriptor tests more robust
2009-01-19 17:37:42 +00:00
Jesse Noller
9a5b2ad38d
Resolve issue 3321: (segfault) _multiprocessing.Connection() doesn't check handle
2009-01-19 15:12:22 +00:00
Kristján Valur Jónsson
2e659ce36f
Issue 4957
...
Let os.ftruncate raise OSError like documented.
2009-01-19 13:10:27 +00:00
Benjamin Peterson
5848d1ff35
raise an OSError for invalid fds #4991
2009-01-19 00:08:08 +00:00
Benjamin Peterson
b6e112bd95
fix encoding cookie case
2009-01-18 22:47:04 +00:00
Benjamin Peterson
910f216260
fix test that wasn't working as expected #4990
2009-01-18 21:11:38 +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
Kristján Valur Jónsson
60e79ced94
issue 4293: make test_capi.py more robutst, it times out on some platforms, presumably waiting for threads. Lower the thread count to 16.
2009-01-18 10:58:44 +00:00
Jesse Noller
6ab22154dd
Resolve issue 4449: AssertionError in mp_benchmarks.py
2009-01-18 02:45:38 +00:00
Amaury Forgeot d'Arc
2407ac9a4b
follow-up of #3997 : since 0xFFFF numbers are not enough to indicate a zip64 format,
...
always try to read the "zip64 end of directory structure".
2009-01-17 22:43:50 +00:00
Benjamin Peterson
5e5fbb612d
fix inspect.isclass() on instances with a custom __getattr__ #1225107
2009-01-17 22:27:54 +00:00
Amaury Forgeot d'Arc
d25f87ae36
#3997 : zipfiles generated with more than 65536 files could not be opened
...
with other applications.
Reviewed by Martin, will backport to 2.6 and 3.0
2009-01-17 16:40:17 +00:00
Benjamin Peterson
f320c22701
trying to find some fpathconf() settings that all unixs support...
2009-01-17 04:39:05 +00:00
Benjamin Peterson
9109f91c6b
use enumerate
2009-01-17 04:28:57 +00:00
Benjamin Peterson
b3af601b22
compare with == not is #4946
2009-01-16 02:55:24 +00:00
Kristján Valur Jónsson
4f69b7e33b
Make all the invalid fd tests for os subject to the function being available.
2009-01-15 22:46:26 +00:00
Kristján Valur Jónsson
71ba215d6b
Fix two test cases in test_os. ftruncate raises IOError unlike all the others which raise OSError. And close() on some platforms doesn't complain when given an invalid file descriptor.
2009-01-15 22:40:03 +00:00
Kristján Valur Jónsson
51a035e383
Issue 4929: Handle socket errors when receiving
2009-01-15 17:20:21 +00:00
Mark Dickinson
0e15182a38
Comment typo
2009-01-15 14:58:28 +00:00
Mark Dickinson
e82cdae58f
Issue #4397 . Fix occasional test_socket failure on OS X.
2009-01-15 14:54:37 +00:00
Kristján Valur Jónsson
8adc0b54d4
Fix recently introduced test cases.
...
For datetime, gentoo didn't seem to mind the %e format for strftime. So, we just excercise those instead making sure that we don't crash.
For test_os, two cases were incorrect.
2009-01-15 09:09:13 +00:00
Kristján Valur Jónsson
018760e3dc
Re-enable all tests for windows platforms.
...
Also, explicitly connect to the IPV4 address. On windows platforms supporting AF_INET6, the SocketProxy would connect using socket.create_connection('localhost', port) which would cycle through all address families and try to connect. It would try connecting using AF_INET6 first and this would cause a delay of up to a second.
2009-01-14 10:50:57 +00:00
Raymond Hettinger
afd112baef
Add tests for __init__() and update() with no args.
2009-01-14 01:15:06 +00:00
Benjamin Peterson
717c083e8d
fix test_xmlrpc failures #4939
2009-01-13 23:43:50 +00:00
Amaury Forgeot d'Arc
b54447f31c
#1162154 : inspect.getmembers() now skips attributes that raise AttributeError,
...
e.g. a __slots__ attribute which has not been set.
2009-01-13 23:39:22 +00:00
Georg Brandl
b24c9519b4
Use assertRaises.
2009-01-13 22:14:01 +00:00
Armin Ronacher
dd53e114ef
ast.literal_eval can properly evaluate complex numbers now. This fixes issue4907.
2009-01-13 11:52:23 +00:00
Raymond Hettinger
2d21d50c10
Issue 4922: Incorrect comments for MutableSet.add() and MutableSet.discard().
...
Needs to be backported to 2.6 and forward ported to 3.0 and 3.1.
2009-01-13 09:08:32 +00:00
Raymond Hettinger
35288c6b6c
Speed-up __repr__. Eliminate duplicate tests. Use a from-irmport.
2009-01-13 04:50:35 +00:00
Raymond Hettinger
783d73fc2f
Fixup and simplify docstrings and doctests.
2009-01-13 04:13:53 +00:00
Raymond Hettinger
aaa6e630f8
Simplify Counter() API. Replace items keyword argument
...
with a mapping. Makes Counter() idempotent, makes update()
API the same as Counter.__init__(), makes a more readable
repr, makes the API more dict-like, and allows Steven
Bethard's update() example to work.
2009-01-13 01:05:03 +00:00
Amaury Forgeot d'Arc
a40d573664
#3720 : Interpreter crashes when an evil iterator removes its own next function.
...
Now the slot is filled with a function that always raises.
Will not backport: extensions compiled with 2.6.x would not run on 2.6.0.
2009-01-12 23:36:55 +00:00
Raymond Hettinger
f94d7fa5fb
Issue 1696199: Add collections.Counter().
2009-01-12 22:58:41 +00:00
Kristján Valur Jónsson
1c62b650d0
Add tests for invalid format specifiers in strftime, and for handling of invalid file descriptors in the os module.
2009-01-12 18:09:27 +00:00
Raymond Hettinger
b5bc33cdab
Optimize heapq.nsmallest/nlargest for cases where n==1 or n>=size.
2009-01-12 10:37:32 +00:00
Kristján Valur Jónsson
3c43fcba8b
Issue 4879: Allow buffering for HTTPResponse
2009-01-11 16:23:37 +00:00
Benjamin Peterson
164b0455b6
make tests fail if they can't be imported
2009-01-10 22:42:10 +00:00
Mark Dickinson
da62f81d1d
Remove an unnecessary check from test_decimal.
2009-01-10 19:14:55 +00:00
Matthias Klose
43723e2ad8
- Issue #4861 : ctypes.util.find_library(): Robustify. Fix library detection on
...
biarch systems. Try to rely on ldconfig only, without using objdump and gcc.
2009-01-10 17:00:42 +00:00
Antoine Pitrou
b74fc2b5fe
Issue #3860 : GzipFile and BZ2File now support the context manager protocol.
2009-01-10 16:13:45 +00:00
Kristján Valur Jónsson
0e2d8c36e3
Issue 4293: Make Py_AddPendingCall() thread safe
...
Add test cases and documentation
2009-01-09 21:35:16 +00:00
Kristján Valur Jónsson
84040dbe81
Issue 4336: Let users of HTTPConnection.endheaders() submit a message body to the function if required.
2009-01-09 20:27:16 +00:00
Kristján Valur Jónsson
7e876f5e93
Issue 4336: HTTPRequest._send_output() now deals with the case of the message body not being a string. This allows clients to use endheaders(message_body) instead of endheaders() + send(message_body) without making any extra checks.
2009-01-09 20:23:16 +00:00
Benjamin Peterson
25f221b0cb
Merged revisions 68306-68308,68340,68368,68422 via svnmerge from
...
svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3
........
r68306 | benjamin.peterson | 2009-01-04 12:27:19 -0600 (Sun, 04 Jan 2009) | 1 line
fix_urllib: add mappings for the url parsing functions
........
r68307 | benjamin.peterson | 2009-01-04 12:30:01 -0600 (Sun, 04 Jan 2009) | 1 line
remove duplicated function
........
r68308 | benjamin.peterson | 2009-01-04 12:50:34 -0600 (Sun, 04 Jan 2009) | 1 line
turtle is no longer renamed
........
r68340 | georg.brandl | 2009-01-05 02:11:39 -0600 (Mon, 05 Jan 2009) | 2 lines
Fix undefined locals in parse_tokens().
........
r68368 | benjamin.peterson | 2009-01-06 17:56:10 -0600 (Tue, 06 Jan 2009) | 1 line
fix typo (thanks to Robert Lehmann)
........
r68422 | benjamin.peterson | 2009-01-08 20:01:03 -0600 (Thu, 08 Jan 2009) | 1 line
run the imports fixers after fix_import, so fix_import doesn't try to make stdlib renames into relative imports #4876
........
2009-01-09 02:13:34 +00:00
Tarek Ziadé
1a240fb9f0
fixed #4394 make the storage of the password optional in .pypirc
2009-01-08 23:56:31 +00:00
Raymond Hettinger
5b913e31a1
Forward port r68394 for issue 4816.
2009-01-08 06:39:04 +00:00
Mark Dickinson
e6dc53120d
Issue #4869 : clarify documentation for random.expovariate.
2009-01-07 17:48:33 +00:00
Hirokazu Yamamoto
fde5b803d8
Issue #4864 : test_msvc9compiler failed on VC6/7.
...
Reviewed by Amaury Forgeot d'Arc.
2009-01-07 09:42:28 +00:00
Antoine Pitrou
09cafb6335
Use shutil.rmtree rather than os.rmdir.
2009-01-06 18:34:08 +00:00
Antoine Pitrou
e96d4ea4e2
Issue #1180193 : When importing a module from a .pyc (or .pyo) file with
...
an existing .py counterpart, override the co_filename attributes of all
code objects if the original filename is obsolete (which can happen if the
file has been renamed, moved, or if it is accessed through different paths).
Patch by Ziga Seilnacht and Jean-Paul Calderone.
2009-01-06 18:10:47 +00:00
Antoine Pitrou
f0d2c3f730
Issue #4272 : Add an optional argument to the GzipFile constructor to override the timestamp in the gzip stream.
2009-01-04 21:29:23 +00:00
Mark Dickinson
65808ff0c0
More Python 2.3 compatibility fixes for decimal.py.
2009-01-04 21:22:02 +00:00
Mark Dickinson
6a961637a8
Fix Decimal.from_float to use valid Python 2.3 syntax, as per
...
comments at top of decimal.py. (But note that the from_float
method itself with still not be usable before Python 2.7.)
See issue 4796 for discussion.
2009-01-04 21:10:56 +00:00
Tarek Ziadé
d81780b8b0
using clearer syntax
2009-01-04 10:37:52 +00:00
Tarek Ziadé
85d6fb5022
fixed #1702551 : distutils sdist was not pruning VCS directories under win32
2009-01-04 00:04:49 +00:00
Georg Brandl
fe427895b5
Manually merge r68095,68186,68187,68188,68190 from 2.6 branch.
2009-01-03 22:03:11 +00:00
Raymond Hettinger
b7e835b820
Reapply r68191.
2009-01-03 19:08:10 +00:00
Raymond Hettinger
f4d8597a59
Issue 4796: Add from_float methods to the decimal module.
2009-01-03 19:02:23 +00:00
Benjamin Peterson
37fc82348c
Merged revisions 67900-67901,67919,67928,67984,67991-67993,68106-68108,68110 via svnmerge from
...
svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3
........
r67900 | benjamin.peterson | 2008-12-22 14:02:45 -0600 (Mon, 22 Dec 2008) | 4 lines
fix_execfile: wrap the open(fn).read() call in compile(), so the filename is preserved
also add unittests for the fixer
........
r67901 | benjamin.peterson | 2008-12-22 14:09:55 -0600 (Mon, 22 Dec 2008) | 1 line
remove unused import
........
r67919 | benjamin.peterson | 2008-12-23 13:12:22 -0600 (Tue, 23 Dec 2008) | 1 line
copy permission bits from the backup to the original
........
r67928 | benjamin.peterson | 2008-12-26 20:49:30 -0600 (Fri, 26 Dec 2008) | 1 line
don't be so idiot about multiple local imports in fix_import; still won't handle absolute and local imports on the same line
........
r67984 | benjamin.peterson | 2008-12-28 09:55:16 -0600 (Sun, 28 Dec 2008) | 1 line
don't need loop
........
r67991 | benjamin.peterson | 2008-12-28 14:30:26 -0600 (Sun, 28 Dec 2008) | 1 line
actually call finish_tree()
........
r67992 | benjamin.peterson | 2008-12-28 14:34:47 -0600 (Sun, 28 Dec 2008) | 1 line
remove useless test
........
r67993 | benjamin.peterson | 2008-12-28 15:04:32 -0600 (Sun, 28 Dec 2008) | 1 line
update pyk3's test grammar
........
r68106 | benjamin.peterson | 2008-12-31 11:53:58 -0600 (Wed, 31 Dec 2008) | 1 line
#2734 don't convert every instance of long (eg if it's an attribute)
........
r68107 | benjamin.peterson | 2008-12-31 11:55:10 -0600 (Wed, 31 Dec 2008) | 1 line
add another test
........
r68108 | benjamin.peterson | 2008-12-31 12:00:12 -0600 (Wed, 31 Dec 2008) | 1 line
don't change long even if it's the only argument name
........
r68110 | benjamin.peterson | 2008-12-31 14:13:26 -0600 (Wed, 31 Dec 2008) | 1 line
remove unused import
........
2009-01-03 16:34:02 +00:00
Mark Dickinson
4aa04db573
Issue #4812 : further renaming of internal Decimal constants, for clarity.
2009-01-03 12:07:20 +00:00
Mark Dickinson
c5de0969ca
Issue #4812 : add missing underscore prefix to some internal-use-only
...
constants in the decimal module. (Dec_0 becomes _Dec_0, etc.)
2009-01-02 23:07:08 +00:00
Raymond Hettinger
44e1581df3
Issue #4615 . Document how to use itertools for de-duping.
2009-01-02 21:26:45 +00:00
Ronald Oussoren
072bb405f3
Fix for issues #841800 and #900506
2009-01-02 15:25:36 +00:00
Ronald Oussoren
abcc168c69
Fix for issue 1149804
2009-01-02 15:00:05 +00:00
Ronald Oussoren
919697cefe
Fix for issue r1737832
2009-01-02 14:52:09 +00:00
Ronald Oussoren
7f8cbf0e73
Fix for issue 1627952
2009-01-02 14:48:17 +00:00
Ronald Oussoren
63b74feb51
Fix for issue 900949
2009-01-02 14:46:19 +00:00
Ronald Oussoren
0238497e93
Fix for issue1594
2009-01-02 14:10:20 +00:00
Ronald Oussoren
8c95484cff
Fix for issue3559: No preferences menu in IDLE on OSX
...
1) Add a comment to the help file to that points to the
preferences menu.
2) An earlier checkin tried to detect Tk >= 8.10.14,
but did this in the wrong way. The end result of this
was that the IDLE->Preferences... menu got surpressed
when using the system version of Tcl/Tk
2009-01-02 12:59:32 +00:00
Antoine Pitrou
733dc74442
fill in actual issue number in tests
2009-01-01 15:38:03 +00:00
Antoine Pitrou
aa687902f2
Issue #3680 : Reference cycles created through a dict, set or deque iterator did not get collected.
2009-01-01 14:11:22 +00:00
Georg Brandl
6269fec171
#4228 : Pack negative values the same way as 2.4
...
in struct's L format.
2009-01-01 12:15:31 +00:00
Georg Brandl
775c307068
#4222 : document dis.findlabels() and dis.findlinestarts() and
...
put them into dis.__all__.
2009-01-01 12:09:40 +00:00
Georg Brandl
2adde0551a
#4185 : clarify escape behavior of replacement strings.
2009-01-01 12:00:19 +00:00
Benjamin Peterson
6060d5e3fa
simplfy code
2009-01-01 04:04:41 +00:00
Benjamin Peterson
8ad09a4f2e
#4795 inspect.isgeneratorfunction() should return False instead of None
2008-12-31 23:48:39 +00:00
Benjamin Peterson
941db4d91f
fix name collision issues
2008-12-31 04:08:55 +00:00
Benjamin Peterson
43ea6d9acc
#4788 qualify some bare except clauses
2008-12-31 03:37:51 +00:00
Tarek Ziadé
b1a85413b1
Fixed #4702 : Throwing DistutilsPlatformError instead of IOError under win32 if MSVC is not found
2008-12-30 23:03:41 +00:00
Nick Coghlan
180e400766
Issue #4701 : implicitly call PyType_Ready from PyObject_Hash
2008-12-30 01:18:48 +00:00
Tarek Ziadé
c13acb18bc
fixed #4646 : distutils was choking on empty options arg in the setup function.
2008-12-29 22:23:53 +00:00
Benjamin Peterson
7af65568ff
#4764 in io.open, set IOError.filename when trying to open a directory on POSIX platforms
2008-12-29 17:56:58 +00:00
Benjamin Peterson
fe231b07e4
#4764 set IOError.filename when trying to open a directory on POSIX platforms
2008-12-29 17:47:42 +00:00
Martin v. Löwis
732479f50b
Issue #3767 : Convert Tk object to string in tkColorChooser.
2008-12-29 16:22:25 +00:00
Martin v. Löwis
e2eb2b4bc3
Issue #3248 : Allow placing ScrolledText in a PanedWindow.
2008-12-29 15:51:01 +00:00
Ronald Oussoren
88a3083c28
Update the fix for issue4064 to deal correctly with all three variants of
...
universal builds that are presented by the configure script.
2008-12-28 19:50:40 +00:00
Ronald Oussoren
4b48c612bb
Issue4064: architecture string for universal builds on OSX
2008-12-28 19:40:56 +00:00
Antoine Pitrou
dae1a6a488
Issue #2153 : modernize coding style of unittest.py, remove obsolete compatibility stuff.
...
Patch by Virgil Dupras.
2008-12-28 16:01:11 +00:00
Antoine Pitrou
697ca3d0cb
Issue #4444 : Allow assertRaises() to be used as a context handler.
2008-12-28 14:09:36 +00:00
Georg Brandl
6425a2fa8f
Backport r67974:
...
#4759 : allow None as first argument of bytearray.translate(), for consistency with bytes.translate().
Also fix segfault for bytearray.translate(x, None) -- will backport this part to 3.0 and 2.6.
2008-12-28 11:54:53 +00:00
Georg Brandl
3eef441700
Follow-up to r67746 in order to restore backwards-compatibility for
...
those who (monkey-)patch TextWrapper.wordsep_re with a custom RE.
2008-12-27 18:27:53 +00:00
Benjamin Peterson
8d5934b25d
#4748 lambda generators shouldn't return values
2008-12-27 18:24:11 +00:00
Georg Brandl
c3a9803410
Patch #4739 by David Laban: add symbols to pydoc help topics,
...
so that ``help('@')`` works as expected.
2008-12-27 18:20:04 +00:00
Antoine Pitrou
6f193e0e95
Issue #4756 : zipfile.is_zipfile() now supports file-like objects.
...
Patch by Gabriel Genellina.
2008-12-27 15:43:12 +00:00
Alexandre Vassalotti
e57e9990e7
Fix bogus unicode tests in pickletester.
2008-12-27 10:02:59 +00:00
Alexandre Vassalotti
f852bf97ef
Fix issue #4730 : cPickle corrupts high-unicode strings.
...
Update outdated copy of PyUnicode_EncodeRawUnicodeEscape.
Add a test case.
2008-12-27 07:08:47 +00:00
Hirokazu Yamamoto
0fc0747586
Issue #4740 : Use HIGHEST_PROTOCOL in pickle test.
...
(There is no behavior difference in 2.x because HIGHEST_PROTOCOL == 2)
2008-12-27 04:19:48 +00:00
Tarek Ziadé
e4c75bb585
fixed #4400 : distutils .pypirc default generated file was broken.
2008-12-24 19:10:05 +00:00
Benjamin Peterson
54686e3c29
#4736 BufferRWPair.closed shouldn't try to call another property as a function
2008-12-24 15:10:27 +00:00
Skip Montanaro
f205c13fac
As a result of a regression that snuck into 2.5.3 add a test case that
...
ensures that when you try to read from a file opened for writing an IOError
is raised.
2008-12-23 03:30:15 +00:00
Benjamin Peterson
f09925da67
add py3k warnings to frame.f_exc_*
2008-12-22 20:16:25 +00:00
Benjamin Peterson
03943d9808
Merged revisions 67809 via svnmerge from
...
svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3
........
r67809 | benjamin.peterson | 2008-12-15 21:54:45 -0600 (Mon, 15 Dec 2008) | 1 line
fix logic error
........
2008-12-21 01:29:32 +00:00
Mark Dickinson
1a707981c8
Issue #3439 : add bit_length method to int and long.
...
Thanks Fredrik Johansson and Victor Stinner for code,
Raymond Hettinger for review.
2008-12-17 16:14:37 +00:00
Antoine Pitrou
d0c3515bc5
Issue #2183 : Simplify and optimize bytecode for list comprehensions.
2008-12-17 00:38:28 +00:00
Benjamin Peterson
43caaa09ea
Merged revisions 67427,67431,67433,67435,67630,67652,67656-67657,67674-67675,67678-67679,67705-67706,67716,67723,67765-67771,67774,67776,67778 via svnmerge from
...
svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3
........
r67427 | benjamin.peterson | 2008-11-28 16:07:41 -0600 (Fri, 28 Nov 2008) | 1 line
fix spelling in comment
........
r67431 | benjamin.peterson | 2008-11-28 17:14:08 -0600 (Fri, 28 Nov 2008) | 1 line
add a scripts directory; move things to it
........
r67433 | benjamin.peterson | 2008-11-28 17:18:48 -0600 (Fri, 28 Nov 2008) | 1 line
run svneol.py
........
r67435 | benjamin.peterson | 2008-11-28 17:25:03 -0600 (Fri, 28 Nov 2008) | 1 line
rename pre/post_order_mapping to pre/post_order_heads
........
r67630 | alexandre.vassalotti | 2008-12-06 21:51:56 -0600 (Sat, 06 Dec 2008) | 2 lines
Fix typo in the urllib2.HTTPDigestAuthHandler fixer.
........
r67652 | armin.ronacher | 2008-12-07 15:39:43 -0600 (Sun, 07 Dec 2008) | 5 lines
Added a fixer that cleans up a tuple argument to isinstance after the tokens
in it were fixed. This is mainly used to remove double occurrences of
tokens as a leftover of the long -> int / unicode -> str conversion.
........
r67656 | armin.ronacher | 2008-12-07 16:54:16 -0600 (Sun, 07 Dec 2008) | 3 lines
Added missing copyright fo 2to3 fix_isinstance.
........
r67657 | armin.ronacher | 2008-12-07 18:29:35 -0600 (Sun, 07 Dec 2008) | 3 lines
2to3: intern and reduce fixes now add the imports if missing. Because that is a common task the fixer_util module now has a function "touch_import" that adds imports if missing.
........
r67674 | benjamin.peterson | 2008-12-08 19:58:11 -0600 (Mon, 08 Dec 2008) | 1 line
copy permission bits when making backup files #4602
........
r67675 | benjamin.peterson | 2008-12-08 19:59:11 -0600 (Mon, 08 Dec 2008) | 1 line
add forgotten import
........
r67678 | benjamin.peterson | 2008-12-08 20:08:30 -0600 (Mon, 08 Dec 2008) | 1 line
fix #4602 for real
........
r67679 | armin.ronacher | 2008-12-09 00:54:03 -0600 (Tue, 09 Dec 2008) | 3 lines
Removed redudant code from the 2to3 long fixer. This fixes #4590 .
........
r67705 | benjamin.peterson | 2008-12-11 13:04:08 -0600 (Thu, 11 Dec 2008) | 1 line
put trailers after a range call after the list()
........
r67706 | benjamin.peterson | 2008-12-11 13:17:57 -0600 (Thu, 11 Dec 2008) | 1 line
add html related modules to the fix_imports mapping
........
r67716 | benjamin.peterson | 2008-12-11 22:16:47 -0600 (Thu, 11 Dec 2008) | 1 line
consolidate tests
........
r67723 | benjamin.peterson | 2008-12-12 19:49:31 -0600 (Fri, 12 Dec 2008) | 1 line
fix name
........
r67765 | benjamin.peterson | 2008-12-14 14:05:05 -0600 (Sun, 14 Dec 2008) | 1 line
run fix_isinstance after fix_long and fix_unicode
........
r67766 | benjamin.peterson | 2008-12-14 14:13:05 -0600 (Sun, 14 Dec 2008) | 1 line
use run_order instead of order
........
r67767 | benjamin.peterson | 2008-12-14 14:28:12 -0600 (Sun, 14 Dec 2008) | 1 line
don't retain parenthesis if there is only one item left
........
r67768 | benjamin.peterson | 2008-12-14 14:32:30 -0600 (Sun, 14 Dec 2008) | 1 line
use insert_child()
........
r67769 | benjamin.peterson | 2008-12-14 14:59:10 -0600 (Sun, 14 Dec 2008) | 1 line
parenthesize doesn't belong in pygram or FixerBase
........
r67770 | alexandre.vassalotti | 2008-12-14 15:15:36 -0600 (Sun, 14 Dec 2008) | 2 lines
Fix typo: html.paser -> html.parser.
........
r67771 | benjamin.peterson | 2008-12-14 15:22:09 -0600 (Sun, 14 Dec 2008) | 1 line
altering .children needs to call changed()
........
r67774 | benjamin.peterson | 2008-12-14 15:55:38 -0600 (Sun, 14 Dec 2008) | 1 line
employ an evil hack to fix multiple names in the same import statement
........
r67776 | benjamin.peterson | 2008-12-14 16:22:38 -0600 (Sun, 14 Dec 2008) | 1 line
make a common mixin class for Test_imports and friends
........
r67778 | alexandre.vassalotti | 2008-12-14 17:48:20 -0600 (Sun, 14 Dec 2008) | 2 lines
Make fix_imports refactor multiple imports as.
........
2008-12-16 03:35:28 +00:00
Amaury Forgeot d'Arc
31949b9108
#3954 : Fix error handling code in _hotshot.logreader
...
Will port to 2.6. hotshot was deleted from python 3.
2008-12-15 21:47:57 +00:00
Nick Coghlan
68060013ea
Issue #4197 : Fix the remaining part of the doctest-in-zipfile problem by giving linecache access to the module globals when available
2008-12-15 11:41:05 +00:00
Georg Brandl
2d2fe572a4
#4578 : fix has_key() usage in compiler package.
2008-12-15 08:58:59 +00:00
Antoine Pitrou
cc5b64a70a
modify other occurrence of test_bad_address
2008-12-15 00:39:51 +00:00
Antoine Pitrou
122388a5a5
try to fix failure in test_bad_address on some buildbots
2008-12-14 22:33:55 +00:00
Antoine Pitrou
655fbf1806
Backport r67759 (fix io.IncrementalNewlineDecoder for UTF-16 et al.).
2008-12-14 17:40:51 +00:00
Nick Coghlan
bbba3f0cec
Add file that was missed from r67750
2008-12-14 11:09:40 +00:00
Nick Coghlan
a2053475bb
Fix several issues relating to access to source code inside zipfiles. Initial work by Alexander Belopolsky. See Misc/NEWS in this checkin for details.
2008-12-14 10:54:50 +00:00
Benjamin Peterson
3e16f3dd7f
remove has_key usage
2008-12-14 01:46:11 +00:00
Antoine Pitrou
74af3bbfbd
Issue #4163 : Use unicode-friendly word splitting in the textwrap functions when given an unicode string.
2008-12-13 23:12:30 +00:00
Lars Gustäbel
3b02742f7d
Issue #4616 : TarFile.utime(): Restore directory times on Windows.
2008-12-12 13:58:03 +00:00
Facundo Batista
e29d435e0c
Issue #4084 : Fix max, min, max_mag and min_mag Decimal methods to
...
give correct results in the case where one argument is a quiet NaN
and the other is a finite number that requires rounding.
Thanks Mark Dickinson.
2008-12-11 04:19:46 +00:00
Amaury Forgeot d'Arc
240028cb77
#1030250 : correctly pass the dry_run option to the mkpath() function.
2008-12-11 00:03:42 +00:00
Amaury Forgeot d'Arc
ad9b5992e3
#4559 : When a context manager's __exit__() method returns an object whose
...
conversion to bool raises an exception, 'with' loses that exception.
Reviewed by Jeffrey Yasskin.
Already ported to 2.5, will port to 2.6 and 3.0
2008-12-10 23:22:49 +00:00
Jeremy Hylton
1868d7c221
Add simple unittests for Request
2008-12-09 21:03:10 +00:00
Jeffrey Yasskin
2d873bd68b
Issue 4597: Fix several cases in EvalFrameEx where an exception could be
...
"raised" without setting x, err, or why to let the eval loop know.
2008-12-08 18:55:24 +00:00
Antoine Pitrou
ae5beceb35
Issue #4509 : bugs in bytearray with exports (buffer protocol)
2008-12-06 21:29:24 +00:00
Mark Dickinson
826f3fefe5
Issue #4445 : save 3 bytes (on average, on a typical machine) per
...
string allocation.
2008-12-05 21:55:28 +00:00
Georg Brandl
fe879e8a23
#4529 : fix parser's validation for try-except-finally statements.
2008-12-05 12:09:41 +00:00
Georg Brandl
3129ea2e05
#4544 : add `dedent` to textwrap.__all__.
2008-12-05 11:34:51 +00:00
Georg Brandl
a07435d3e3
#4458 : recognize "-" as an argument, not a malformed option in gnu_getopt().
2008-12-05 09:23:14 +00:00
Gregory P. Smith
26576801a6
rename the new check_call_output to check_output. its less ugly.
2008-12-05 02:27:01 +00:00
Vinay Sajip
6831d6bc7f
Took Nick Coghlan's advice about importing warnings globally in logging, to avoid the possibility of race conditions: "This could deadlock if a thread spawned as a side effect of importing a module happens to trigger a warning. warnings is pulled into sys.modules as part of the interpreter startup - having a global 'import warnings' shouldn't have any real effect on logging's import time."
2008-12-04 20:32:18 +00:00
Gregory P. Smith
97f49f4be7
Adds a subprocess.check_call_output() function to return the output from a
...
process on success or raise an exception on error.
2008-12-04 20:21:09 +00:00
Fred Drake
5248103ef9
Issue #1055234 : cgi.parse_header(): Fixed parsing of header parameters to
...
support unusual filenames (such as those containing semi-colons) in
Content-Disposition headers.
2008-12-04 18:25:17 +00:00
Vinay Sajip
213faca204
Issue #4384 : Added logging integration with warnings module using captureWarnings(). This change includes a NullHandler which does nothing; it will be of use to library developers who want to avoid the "No handlers could be found for logger XXX" message which can appear if the library user doesn't configure logging.
2008-12-03 23:22:58 +00:00
Raymond Hettinger
7989a4dccb
Backport r67478
2008-12-03 15:42:10 +00:00
Jeremy Hylton
0381f48936
Send HTTP headers and message body in a single send() call.
...
This change addresses part of issue 4336.
Change endheaders() to take an optional message_body argument
that is sent along with the headers. Change xmlrpclib and
httplib's other methods to use this new interface.
It is more efficient to make a single send() call, which should
get the entire client request into one packet (assuming it is
smaller than the MTU) and will avoid the long pause for delayed
ack following timeout.
Also:
- Add a comment about the buffer size for makefile().
- Extract _set_content_length() method and fix whitespace issues there.
2008-11-29 01:09:35 +00:00
Jeremy Hylton
21d2e59ab1
Reflow long lines.
2008-11-29 00:09:16 +00:00
Benjamin Peterson
2555d9ddeb
Merged revisions 67384,67386-67387,67389-67390,67392,67399-67400,67403-67405,67426 via svnmerge from
...
svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3
........
r67384 | benjamin.peterson | 2008-11-25 16:13:31 -0600 (Tue, 25 Nov 2008) | 4 lines
don't duplicate calls to start_tree()
RefactoringTool.pre_order values now holds a list of the fixers while pre_order_mapping holds the dict.
........
r67386 | benjamin.peterson | 2008-11-25 16:44:52 -0600 (Tue, 25 Nov 2008) | 1 line
#4423 fix_imports was still replacing usage of a module if attributes were being used
........
r67387 | benjamin.peterson | 2008-11-25 16:47:54 -0600 (Tue, 25 Nov 2008) | 1 line
fix broken test
........
r67389 | benjamin.peterson | 2008-11-25 17:13:17 -0600 (Tue, 25 Nov 2008) | 1 line
remove compatibility code; we only cater to 2.5+
........
r67390 | benjamin.peterson | 2008-11-25 22:03:36 -0600 (Tue, 25 Nov 2008) | 1 line
fix #3994 ; the usage of changed imports was fixed in nested cases
........
r67392 | benjamin.peterson | 2008-11-26 11:11:40 -0600 (Wed, 26 Nov 2008) | 1 line
simpilfy and comment fix_imports
........
r67399 | benjamin.peterson | 2008-11-26 11:47:03 -0600 (Wed, 26 Nov 2008) | 1 line
remove more compatibility code
........
r67400 | benjamin.peterson | 2008-11-26 12:07:41 -0600 (Wed, 26 Nov 2008) | 1 line
set svn:ignore
........
r67403 | benjamin.peterson | 2008-11-26 13:11:11 -0600 (Wed, 26 Nov 2008) | 1 line
wrap import
........
r67404 | benjamin.peterson | 2008-11-26 13:29:49 -0600 (Wed, 26 Nov 2008) | 1 line
build the fix_imports pattern in compile_pattern, so MAPPING can be changed and reflected in the pattern
........
r67405 | benjamin.peterson | 2008-11-26 14:01:24 -0600 (Wed, 26 Nov 2008) | 1 line
stop ugly messages about runtime errors being from printed
........
r67426 | benjamin.peterson | 2008-11-28 16:01:40 -0600 (Fri, 28 Nov 2008) | 5 lines
don't replace a module name if it is in the middle of a attribute lookup
This fix also stops module names from being replaced if they are not in an attribute lookup.
........
2008-11-28 22:12:14 +00:00
Jesse Noller
1f8b49f517
issue4238: bsd support for cpu_count
2008-11-28 18:59:35 +00:00
Christian Heimes
aa67471227
Fixed issue ##3741: DISTUTILS_USE_SDK set causes msvc9compiler.py to raise an exception
2008-11-28 11:02:32 +00:00
Benjamin Peterson
b38e325e97
Merged revisions 67183,67191,67371 via svnmerge from
...
svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3
........
r67183 | benjamin.peterson | 2008-11-10 21:51:33 -0600 (Mon, 10 Nov 2008) | 1 line
handle 'import x as y' in fix_imports; this still needs more work...
........
r67191 | benjamin.peterson | 2008-11-11 17:24:51 -0600 (Tue, 11 Nov 2008) | 1 line
super() is good
........
r67371 | benjamin.peterson | 2008-11-24 16:02:00 -0600 (Mon, 24 Nov 2008) | 1 line
don't blow up in the metaclass fixer when assignments in the class statement aren't simple
........
2008-11-25 04:07:45 +00:00
Jeremy Hylton
8942011db1
Add unittests that verify documented behavior of public methods in Transport
...
class.
These methods can be overridden. The tests verify that the overridden
methods are called, and that changes to the connection have a visible
effect on the request.
2008-11-24 22:00:29 +00:00
Benjamin Peterson
9dfe6a8862
#4396 make the parser module correctly validate the with syntax
2008-11-24 04:09:03 +00:00
Benjamin Peterson
21f25d3fcd
raise a better error
2008-11-23 02:09:41 +00:00
Georg Brandl
5ecd7452ec
Fix typo.
2008-11-22 08:45:33 +00:00
Benjamin Peterson
bfc51567f5
backport r67325: make FileIO.mode always contain 'b'
2008-11-22 01:59:15 +00:00
Benjamin Peterson
c078f929cb
don't segfault when \N escapes are used and unicodedata fails to load
...
Fixes #4367
2008-11-21 22:27:24 +00:00
Amaury Forgeot d'Arc
d42941751c
#4363 : Let uuid.uuid1() and uuid.uuid4() run even if the ctypes module is not present.
...
Will backport to 2.6
2008-11-21 22:05:48 +00:00
Amaury Forgeot d'Arc
322656596a
Fixed issue #4233 .
...
Changed semantic of _fileio.FileIO's close() method on file objects with closefd=False.
The file descriptor is still kept open but the file object behaves like a closed file.
The FileIO object also got a new readonly attribute closefd.
Approved by Barry
Backport of r67106 from the py3k branch
2008-11-20 23:34:31 +00:00
Benjamin Peterson
ad100c3acb
backport r67300
2008-11-20 22:06:22 +00:00
Benjamin Peterson
d3b5a7985d
oops! didn't mean to disable that test
2008-11-20 21:44:23 +00:00
Benjamin Peterson
46cc6d1102
make sure that bytearray methods return a new bytearray even if there is no change
...
Fixes #4348
Reviewed by Brett
2008-11-19 21:49:09 +00:00
Josiah Carlson
a98d72d598
Fix for issue 4332 in trunk.
2008-11-19 18:26:12 +00:00
Martin v. Löwis
bb9b1f1d4a
Issue #4116 : Resolve member name conflict in ScrolledCanvas.__init__
2008-11-19 09:09:41 +00:00
Skip Montanaro
7fb29797e3
patch from issue 1108
2008-11-19 03:35:41 +00:00
Amaury Forgeot d'Arc
7cfe7ea745
#4317 : Fix an Array Bounds Read in imageop.rgb2rgb8.
...
Will backport to 2.4.
2008-11-18 22:19:37 +00:00
Benjamin Peterson
273c233c78
when __getattr__ is a descriptor, call it correctly; fixes #4230
...
patch from Ziga Seilnacht
2008-11-17 22:39:09 +00:00
Brett Cannon
e3d0bf740f
The docs for httplib.HTTPConnection.putheader() have claimed for quite a while
...
that their could be an arbitrary number of values passed in. Turns out the code
did not match that. The code now matches the docs.
2008-11-15 22:40:44 +00:00
Benjamin Peterson
ba4d480776
Merged revisions 66985,67170,67173,67177-67179 via svnmerge from
...
svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3
........
r66985 | benjamin.peterson | 2008-10-20 16:43:46 -0500 (Mon, 20 Oct 2008) | 1 line
no need to use nested try, except, finally
........
r67170 | benjamin.peterson | 2008-11-08 12:28:31 -0600 (Sat, 08 Nov 2008) | 1 line
fix #4271 : fix_imports didn't recognize imports with parenthesis (ie from x import (a, b))
........
r67173 | benjamin.peterson | 2008-11-08 17:42:08 -0600 (Sat, 08 Nov 2008) | 1 line
consolidate test
........
r67177 | benjamin.peterson | 2008-11-09 21:52:52 -0600 (Sun, 09 Nov 2008) | 1 line
let the metclass fixer handle complex assignments in the class body gracefully
........
r67178 | benjamin.peterson | 2008-11-10 15:26:43 -0600 (Mon, 10 Nov 2008) | 1 line
the metaclass fixers shouldn't die when bases are not a simple name
........
r67179 | benjamin.peterson | 2008-11-10 15:29:58 -0600 (Mon, 10 Nov 2008) | 1 line
allow the fix_import pattern to catch from imports with parenthesis
........
2008-11-10 22:11:12 +00:00
Benjamin Peterson
b7c95ce8b8
fix comment
2008-11-09 01:52:32 +00:00
Benjamin Peterson
2c98faada6
check for assignment to __debug__ during AST generation
...
Also, give assignment to None a better error message
2008-11-08 18:38:54 +00:00
Benjamin Peterson
81e92e582e
move a FileIO test to test_fileio
2008-11-03 22:34:57 +00:00
Hirokazu Yamamoto
b9828f67b8
Issue #3774 : Fixed an error when create a Tkinter menu item without command
...
and then remove it. Written by Guilherme Polo (gpolo).
2008-11-03 18:03:06 +00:00
Benjamin Peterson
6624a9fddd
#4048 make the parser module accept relative imports as valid
2008-11-03 15:14:51 +00:00
Benjamin Peterson
dcee09d920
make sure the parser flags and passed onto the compiler
...
This fixes "from __future__ import unicode_literals" in an exec statment
See #4225
2008-10-31 02:16:05 +00:00
Christian Heimes
ab5f879022
Issue #4237 : io.FileIO() was raising invalid warnings caused by insufficient initialization of PyFileIOObject struct members.
2008-10-30 21:26:15 +00:00
Amaury Forgeot d'Arc
69a9c5b539
Issue #4176 : Pickle would crash the interpreter when a __reduce__ function
...
does not return an iterator for the 4th and 5th items.
(sequence-like and mapping-like state)
A list is not an iterator...
Will backport to 2.6 and 2.5.
2008-10-30 21:18:34 +00:00
Thomas Heller
1fac5a4505
Fixed a modulefinder crash on certain relative imports.
2008-10-30 20:18:13 +00:00
Armin Rigo
581eb1e498
Fix one of the tests: it relied on being present in an "output test" in
...
order to actually test what it was supposed to test, i.e. that the code
in the __del__ method did not crash. Use instead the new helper
test_support.captured_output().
2008-10-28 17:01:21 +00:00
Benjamin Peterson
260f5bae70
add forgotten test for r67030
2008-10-26 20:33:19 +00:00
Benjamin Peterson
bdca942ffc
fix __future__ imports when multiple features are given
2008-10-26 20:21:13 +00:00
Benjamin Peterson
399b1fe8df
give a py3k warning when 'nonlocal' is used as a variable name
2008-10-25 02:53:28 +00:00
Hirokazu Yamamoto
592c275567
Issue #4183 : Some tests didn't run with pickle.HIGHEST_PROTOCOL.
2008-10-23 00:37:33 +00:00
Benjamin Peterson
c18574c98e
fix #4150 : pdb's up command didn't work for generators in post-mortem
2008-10-22 21:16:34 +00:00
Benjamin Peterson
4d9b0cd409
return ArgInfo from inspect.getargvalues #4092
2008-10-21 22:18:29 +00:00
Amaury Forgeot d'Arc
fbc0b0ca29
#4157 move two test functions out of platform.py.
...
Turn them into unit tests, and correct an obvious typo:
(("a", "b") ("c", "d") ("e", "f"))
compiles even with the missing commas, but does not execute very well...
2008-10-21 22:01:38 +00:00
Benjamin Peterson
77c2f93663
make sure to call iteritems()
2008-10-21 20:51:13 +00:00
Armin Ronacher
297ddcd823
Fixed #4062 , added import for _ast.__version__ to ast to match the documented behavior.
2008-10-20 21:29:08 +00:00
Benjamin Peterson
595e3cbb3d
check for error conditions in _json #3623
2008-10-16 21:09:28 +00:00
Benjamin Peterson
b76444b2fa
use new showwarnings signature for idle #3391
2008-10-16 19:40:14 +00:00
Benjamin Peterson
6ae94ee299
Merged revisions 66805,66841,66860,66884-66886,66893,66907,66910 via svnmerge from
...
svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3
........
r66805 | benjamin.peterson | 2008-10-04 20:11:02 -0500 (Sat, 04 Oct 2008) | 1 line
mention what the fixes directory is for
........
r66841 | benjamin.peterson | 2008-10-07 17:48:12 -0500 (Tue, 07 Oct 2008) | 1 line
use assertFalse and assertTrue
........
r66860 | benjamin.peterson | 2008-10-08 16:05:07 -0500 (Wed, 08 Oct 2008) | 1 line
instead of abusing the pattern matcher, use start_tree to find a next binding
........
r66884 | benjamin.peterson | 2008-10-13 15:50:30 -0500 (Mon, 13 Oct 2008) | 1 line
don't print tokens to stdout when -v is given
........
r66885 | benjamin.peterson | 2008-10-13 16:28:57 -0500 (Mon, 13 Oct 2008) | 1 line
add the -x option to disable fixers
........
r66886 | benjamin.peterson | 2008-10-13 16:33:53 -0500 (Mon, 13 Oct 2008) | 1 line
cut down on some crud
........
r66893 | benjamin.peterson | 2008-10-14 17:16:54 -0500 (Tue, 14 Oct 2008) | 1 line
add an optional set literal fixer
........
r66907 | benjamin.peterson | 2008-10-15 16:59:41 -0500 (Wed, 15 Oct 2008) | 1 line
don't write backup files by default
........
r66910 | benjamin.peterson | 2008-10-15 17:43:10 -0500 (Wed, 15 Oct 2008) | 1 line
add the -n option; it stops backupfiles from being written
........
2008-10-15 23:10:28 +00:00
Benjamin Peterson
9dc0a639bd
support the optional line argument for idle
2008-10-15 21:05:55 +00:00
Skip Montanaro
c01e32118b
easter egg
2008-10-15 11:49:10 +00:00
Benjamin Peterson
32e7aa6ab9
remove set compat cruft
2008-10-14 22:37:18 +00:00
Benjamin Peterson
76f71a52d7
give poplib a real test suite
...
#4088 from Giampaolo Rodola'x
2008-10-11 17:25:36 +00:00
Georg Brandl
f3776a17ef
#3935 : properly support list subclasses in the C impl. of bisect.
...
Patch reviewed by Raymond.
2008-10-08 18:47:17 +00:00
Amaury Forgeot d'Arc
d78b9dcbc3
#4069 : aSet.remove(otherSet) would always report the empty frozenset([]) as the missing key.
...
Now it correctly refers to the initial otherset.
Reviewed by Raymond. Will backport to 2.6.
2008-10-07 20:32:10 +00:00
Hirokazu Yamamoto
39defbe6a9
more intensive test on dbm.
2008-10-07 18:10:47 +00:00
Skip Montanaro
7d9d7a2659
save/restore stdout/stderr instead of relying on __*__ versions
2008-10-07 15:03:40 +00:00
Skip Montanaro
0d8372bdb9
Simplify individual tests by defining setUp and tearDown methods.
2008-10-07 01:55:20 +00:00
Andrew M. Kuchling
ddbce9e845
Per Greg Ward, optparse is no longer being externally maintained.
...
I'll look at the bugs in the Optik bug tracker and copy them to the Python bug
tracker if they're still relevant.
2008-10-06 12:07:04 +00:00
Hirokazu Yamamoto
18c4e8734c
More strict test. Consider the case sys.executable itself is symlink.
2008-10-06 02:41:59 +00:00
Hirokazu Yamamoto
6e5e50104c
Added the test for issue3762.
2008-10-06 01:57:03 +00:00
Andrew M. Kuchling
dcf3b1c79a
#1415508 from Rocky Bernstein: add docstrings for enable_interspersed_args(), disable_interspersed_args()
2008-10-05 00:11:56 +00:00
Benjamin Peterson
4d164158d6
Merged revisions 66707,66775,66782 via svnmerge from
...
svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3
........
r66707 | benjamin.peterson | 2008-09-30 18:27:10 -0500 (Tue, 30 Sep 2008) | 1 line
fix #4001 : fix_imports didn't check for __init__.py before converting to relative imports
........
r66775 | collin.winter | 2008-10-03 12:08:26 -0500 (Fri, 03 Oct 2008) | 4 lines
Add an alternative iterative pattern matching system that, while slower, correctly parses files that cause the faster recursive pattern matcher to fail with a recursion error. lib2to3 falls back to the iterative matcher if the recursive one fails.
Fixes http://bugs.python.org/issue2532 . Thanks to Nick Edds.
........
r66782 | benjamin.peterson | 2008-10-03 17:51:36 -0500 (Fri, 03 Oct 2008) | 1 line
add Victor Stinner's fixer for os.getcwdu -> os.getcwd #4023
........
2008-10-04 20:55:50 +00:00
Andrew M. Kuchling
081bb457ab
Typo fix
2008-10-03 16:42:52 +00:00
Hirokazu Yamamoto
b7df32e620
Fixed following error when DocXMLRPCServer failed.
...
UnboundLocalError: local variable 'serv' referenced before assignment
2008-10-03 16:18:42 +00:00
Benjamin Peterson
c95726e28b
update pydoc topics
2008-10-02 20:46:58 +00:00
Barry Warsaw
afa1436958
Bumping to 2.6 final.
2008-10-01 21:46:40 +00:00
Andrew MacIntyre
bf24401a1f
fix for issue 3862: test_array fails FreeBSD 7 amd64
...
FreeBSD 7's underlying malloc() is behaves differently to earlier versions
and seriously overcommits available memory on amd64. This may affect
other 64bit platforms in some circumstances, so the scale of the
problematic test is wound back.
Patch by Mark Dickinson, reviewed by Martin von Loewis.
2008-10-01 03:25:25 +00:00
Gregory P. Smith
0806749e63
Works around issue3863: freebsd4/5/6 and os2emx are known to have OS bugs when
...
calling fork() from a child thread. This disables that unit test (with a note
printed to stderr) on those platforms.
A caveat about buggy platforms is added to the os.fork documentation.
2008-09-30 20:41:13 +00:00
Benjamin Peterson
8d77d448a5
fix security issue 2: imageop's poor validation of arguments could result in segfaults
...
patch by Victor Stinner
reviewed by myself and Brett
2008-09-30 01:31:49 +00:00
Jesse Noller
37040cdace
issue3770: if SEM_OPEN is 0, disable the mp.synchronize module, rev. Nick Coghlan, Damien Miller
2008-09-30 00:15:45 +00:00
Martin v. Löwis
e563aa4383
Issue #3965 : Allow repeated calls to turtle.Screen, by making it a
...
true singleton object.
Reviewed by Gregor Lingl.
2008-09-29 22:09:07 +00:00
Thomas Heller
e144873071
Fix issue #3547 for MingW, update comments.
2008-09-29 19:56:24 +00:00
Bill Janssen
eb257ac97d
fix for release blocker 3910, 2.6 regression in socket.ssl method
2008-09-29 18:56:38 +00:00
Brett Cannon
b2d61bde28
The _lsprof module could crash the interpreter if it was given an external
...
timer that did not return a float and a timer was still running when the
Profiler object was garbage collected.
Fixes issue 3895.
Code review by Benjamin Peterson.
2008-09-29 03:41:21 +00:00
Benjamin Peterson
e14267bbad
merge in the fix for test_ftplib on some bots [reviewed by Georg]
2008-09-28 20:57:21 +00:00
Benjamin Peterson
dee0b175f6
backport r66656 so people using -Qnew aren't affected
2008-09-27 22:08:12 +00:00
Benjamin Peterson
003d7463dd
enable refactor tests
2008-09-27 21:12:20 +00:00
Benjamin Peterson
08be29193e
Merged revisions 66511,66548-66549,66644,66646-66652 via svnmerge from
...
svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3
........
r66511 | benjamin.peterson | 2008-09-18 21:49:27 -0500 (Thu, 18 Sep 2008) | 1 line
remove a useless if __name__ == '__main__'
........
r66548 | benjamin.peterson | 2008-09-21 21:14:14 -0500 (Sun, 21 Sep 2008) | 1 line
avoid the perils of mutable default arguments
........
r66549 | benjamin.peterson | 2008-09-21 21:26:11 -0500 (Sun, 21 Sep 2008) | 1 line
some places in RefactoringTool should raise an error instead of logging it
........
r66644 | benjamin.peterson | 2008-09-27 10:45:10 -0500 (Sat, 27 Sep 2008) | 1 line
fix doctest refactoring
........
r66646 | benjamin.peterson | 2008-09-27 11:40:13 -0500 (Sat, 27 Sep 2008) | 1 line
don't print to stdout when 2to3 is used as a library
........
r66647 | benjamin.peterson | 2008-09-27 12:28:28 -0500 (Sat, 27 Sep 2008) | 1 line
let fixer modules and classes have different prefixes
........
r66648 | benjamin.peterson | 2008-09-27 14:02:13 -0500 (Sat, 27 Sep 2008) | 1 line
raise errors when 2to3 is used as a library
........
r66649 | benjamin.peterson | 2008-09-27 14:03:38 -0500 (Sat, 27 Sep 2008) | 1 line
fix docstring
........
r66650 | benjamin.peterson | 2008-09-27 14:22:21 -0500 (Sat, 27 Sep 2008) | 1 line
make use of enumerate
........
r66651 | benjamin.peterson | 2008-09-27 14:24:13 -0500 (Sat, 27 Sep 2008) | 1 line
revert last revision; it breaks things
........
r66652 | benjamin.peterson | 2008-09-27 16:03:06 -0500 (Sat, 27 Sep 2008) | 1 line
add tests for lib2to3.refactor
........
2008-09-27 21:09:10 +00:00
Benjamin Peterson
3c0c483af4
give ftplib a real test suite
...
A asyncore based mock ftp server is used to test the protocol.
This is all thanks to Giampaolo Rodola #3939
(Barry gave me permission to do this before final on IRC.)
2008-09-27 02:49:54 +00:00
Amaury Forgeot d'Arc
fc5ea39289
#3967 : Correct a crash in count() and find() methods of string-like objects.
...
For example:
"".count("xxxx", sys.maxint, 0)
Reviewed by Benjamin Peterson.
Will port to 2.5 and 3.0.
2008-09-26 22:34:08 +00:00
Raymond Hettinger
6ee7bc04f7
Fix namedtuple bug reported by Glenn Linderman. Template did not form correctly if the field names were input in Unicode.
2008-09-25 23:31:52 +00:00
Amaury Forgeot d'Arc
17617a07d1
#3965 : on Windows, open() crashes if the filename or the mode is invalid,
...
and if the filename is a unicode string.
Reviewed by Martin von Loewis.
2008-09-25 20:52:56 +00:00
Benjamin Peterson
52d52f185a
#3950 fix missing scale factors in turtle.py
...
reviewers: Georg, Benjamin
2008-09-24 22:11:59 +00:00
Thomas Heller
a85c95d5e8
Fix issue #3547 : ctypes is confused by bitfields of varying integer types
...
Reviewed by Fredrik Lundh and Skip Montanaro.
2008-09-24 18:26:05 +00:00