Commit Graph

15173 Commits

Author SHA1 Message Date
Benjamin Peterson df6f963f15 Merged revisions 77158 via svnmerge from
svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3

........
  r77158 | benjamin.peterson | 2009-12-30 13:41:03 -0600 (Wed, 30 Dec 2009) | 1 line

  clean up logging's global state after the test finishes
........
2009-12-30 19:44:23 +00:00
Benjamin Peterson 0f02d3933b check if the attribute is set before deleting it with T_OBJECT_EX (fixes #7604)
Also, add a note to the docs about the better behavior of T_OBJECT_EX as
compared to T_OBJECT.
2009-12-30 19:34:10 +00:00
Mark Dickinson 99d652ef66 Issue #7534: Fix handling of nans, infinities, and negative zero in **
operator, on IEEE 754 platforms.  Thanks Marcos Donolo for original patch.
2009-12-30 12:12:23 +00:00
Ezio Melotti 569e61f351 #5511: Added the ability to use ZipFile as a context manager. Patch by Brian Curtin. 2009-12-30 06:14:51 +00:00
Amaury Forgeot d'Arc 8645a5c81f #7413: Passing '\0' as the separator to datetime.datetime.isoformat()
used to drop the time part of the result.
2009-12-29 22:03:38 +00:00
Mark Dickinson 8e3e1d6016 Issue #7575: An overflow test for math.expm1 was failing on OS X 10.4/Intel,
due to a defect in the platform's implementation of expm1.  Since the issue
is of low severity, and appears to be fixed in OS X 10.5 and 10.6, it doesn't
seem worth working around, so I'm just weakening the relevant test so that
it passes on 10.4.
2009-12-29 20:51:24 +00:00
Benjamin Peterson b598393bcb enable test_main.py 2009-12-29 00:09:33 +00:00
Benjamin Peterson abb4274499 Merged revisions 76871-76872,77093-77095,77097-77101 via svnmerge from
svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3

........
  r76871 | benjamin.peterson | 2009-12-17 20:49:21 -0600 (Thu, 17 Dec 2009) | 1 line

  handle unencodable diffs gracefully #5093
........
  r76872 | benjamin.peterson | 2009-12-17 20:51:37 -0600 (Thu, 17 Dec 2009) | 1 line

  fix emacs header
........
  r77093 | benjamin.peterson | 2009-12-28 14:43:32 -0600 (Mon, 28 Dec 2009) | 7 lines

  replace callable(x) with isinstance(x, collections.Callable) #7006

  This is a more accurate translation than hasattr(x, '__call__') which failed in
  the case that somebody had put __call__ in the instance dictionary.

  Patch mostly by Joe Amenta.
........
  r77094 | benjamin.peterson | 2009-12-28 14:45:13 -0600 (Mon, 28 Dec 2009) | 2 lines

  deuglify imports
........
  r77095 | benjamin.peterson | 2009-12-28 14:49:23 -0600 (Mon, 28 Dec 2009) | 1 line

  remove unused flag
........
  r77097 | benjamin.peterson | 2009-12-28 16:12:13 -0600 (Mon, 28 Dec 2009) | 2 lines

  clean up imports and whitespace
........
  r77098 | benjamin.peterson | 2009-12-28 16:43:35 -0600 (Mon, 28 Dec 2009) | 1 line

  *** empty log message ***
........
  r77099 | benjamin.peterson | 2009-12-28 16:45:10 -0600 (Mon, 28 Dec 2009) | 1 line

  revert unintended change
........
  r77100 | benjamin.peterson | 2009-12-28 16:53:21 -0600 (Mon, 28 Dec 2009) | 1 line

  revert unintended changes
........
  r77101 | benjamin.peterson | 2009-12-28 17:46:02 -0600 (Mon, 28 Dec 2009) | 1 line

  normalize whitespace
........
2009-12-28 23:50:41 +00:00
Georg Brandl 740cdc3a9f #7033: add new API function PyErr_NewExceptionWithDoc, for easily giving new exceptions a docstring. 2009-12-28 08:34:58 +00:00
Georg Brandl 02e7dfde63 #7381: consistency update, and backport avoiding ``None >= 0`` check from py3k. 2009-12-28 08:09:32 +00:00
Mark Dickinson e079636853 Use a more idiomatic check in check_truediv. 2009-12-27 21:31:50 +00:00
Mark Dickinson 4c96035f33 Use ldexp(q, exp) instead of q*2.**exp in true division test, to avoid bogus failures on platforms with broken pow (e.g., Ubuntu/ia64). 2009-12-27 16:16:02 +00:00
Mark Dickinson 4657283647 Issue #1811: Improve accuracy and consistency of true division for integers. 2009-12-27 14:55:57 +00:00
Senthil Kumaran 13c2ef92f8 Fix for issue5625 - test_urllib2 fails - urlopen error file not on local host.
This is on hosts with multiple ip addresses.
2009-12-27 09:11:09 +00:00
Ezio Melotti f84caf4eda #6108: unicode(exception) and str(exception) should return the same message 2009-12-24 22:25:17 +00:00
Mark Dickinson db69f01ea9 Issue #7568: typo in docstring. Thanks Mike Putnam. 2009-12-24 16:06:58 +00:00
Benjamin Peterson 27cae34bd0 allow Process name to be unicode #7571 2009-12-24 15:19:40 +00:00
Ronald Oussoren ca8e7ec216 Unittests and news items for the patch in r77026. 2009-12-24 14:50:35 +00:00
Ronald Oussoren 92919a66d2 Issue #6834: replace the implementation for the 'python' and 'pythonw' executables on OSX.
The previous implementation used execv(2) to run the real interpreter, which means that
you cannot use the arch(1) tool to select the architecture you want to use for a
universal build because that only affects the python/pythonw wrapper and not the actual
interpreter.

The new version uses posix_spawnv with a number of OSX-specific options that ensure that
the real interpreter is started using the same CPU architecture as the wrapper, and that
means that 'arch -ppc python' now actually works.

I've also changed the way that the wrapper looks for the framework: it is now linked to
the framework rather than hardcoding the framework path. This should make it easier to
provide pythonw support in tools like virtualenv.
2009-12-24 13:30:58 +00:00
Ronald Oussoren 728cc6110f On OSX the output of "uname -m" always reflects the 32-bit architecture
for the machine ("i386" or "ppc"), even if the executable is
64-bit.

This patchs ensures that the distutils platform architecture
represents the architecture for the executable when running a
64-bit only executable on OSX.
2009-12-24 13:06:39 +00:00
Benjamin Peterson 3293593b54 fix alleged refleak 2009-12-24 01:09:53 +00:00
Gregory P. Smith 9f12d468f4 Fix possible integer overflow in lchown and fchown functions. For issue1747858. 2009-12-23 09:31:11 +00:00
Tarek Ziadé 3efd767336 backported r76993 and r76994 so the trunk behaves the same way with MSVC Manifest files editing 2009-12-21 23:31:55 +00:00
Mark Dickinson 2ba1e9ceb8 Issue #7553: test_long_future wasn't testing properly. Thanks Florent Xicluna
for bug report and patch.
2009-12-21 16:29:21 +00:00
R. David Murray 08dca0d6da Remove a leftover from a previous iteration of the issue 7376 patch. 2009-12-21 12:45:41 +00:00
Tarek Ziadé 2b66da7d15 massive import cleaning in Distutils 2009-12-21 01:22:46 +00:00
Tarek Ziadé 2421d56e02 Fixed #7552: fixed distutils.command.upload failure on very long passwords 2009-12-20 23:23:34 +00:00
Mark Dickinson 603ae9e371 Issue #7554: Various fixups in test_cmath.py: remove code duplication,
use new-style formatting.  Thanks Florent Xicluna for the patch.
2009-12-20 20:34:44 +00:00
Mark Dickinson ed284991e1 Silence -3 warnings. Thanks Florent Xicluna. 2009-12-20 20:23:01 +00:00
Mark Dickinson 3e0bafef25 Fix for consistency with py3k keyword-only version of assertAlmostEqual 2009-12-20 19:52:36 +00:00
Mark Dickinson 1d2ae215aa Issue #7554: Fix incorrect usage of rAssertAlmostEqual. Thanks Florent Xicluna. 2009-12-20 19:45:37 +00:00
R. David Murray 77e48ba993 Issue #7376: When called with no arguments doctest was running a
self-test.  Because of a change to the way tracebacks are printed,
this self-test was failing.  The test is run (and passes) during normal
regression testing.  So instead of running the failing self-test this
patch makes doctest emit a usage message.  This is better behavior anyway
since passing in arguments is the real reason to run doctest as a command.

Bug discovery and initial patch by Florent Xicluna.
2009-12-20 16:46:06 +00:00
R. David Murray 97138117b2 Fix comment typo. 2009-12-20 16:24:46 +00:00
Mark Dickinson b5e348b305 Add missing tests for PyArg_Parse* with format 'h' 2009-12-20 15:57:56 +00:00
Georg Brandl 6ab5d083f2 #7381: subprocess documentation and library docstring consistency fixes. 2009-12-20 14:33:20 +00:00
Senthil Kumaran 7713acf201 Fix for issue 7291 - urllib2 cannot handle https with proxy requiring auth
Refactored HTTPHandler tests and added testcase for proxy authorization.
2009-12-20 06:05:13 +00:00
Antoine Pitrou 98a24def03 Remove superfetatory paragraph (left there by mistake). 2009-12-19 21:06:36 +00:00
Antoine Pitrou e812d29b52 Issue #7545: improve documentation of the `buffering` argument in io.open(). 2009-12-19 21:01:10 +00:00
Mark Dickinson 5ff37ae14b Issue #3366: Add error function and complementary error function to
math module.
2009-12-19 11:07:23 +00:00
Mark Dickinson 9cae178f21 Issue #3366: Add expm1 function to math module. Thanks Eric Smith for
testing on Windows.
2009-12-16 20:13:40 +00:00
R. David Murray 98e3df38fd Issue #7396: fix -s, which was broken by the -j enhancement. 2009-12-16 11:49:46 +00:00
Benjamin Peterson 36902988a6 remove lib2to3 resource 2009-12-16 03:28:52 +00:00
Tarek Ziadé c0680e2d4b cleaned up the module (PEP 8 + old fashion test removal) 2009-12-15 06:29:19 +00:00
R. David Murray c7298ff0fa Issue #7498: make test_multiprocessing use test_support.find_unused_port
instead of a hard coded port number in test_rapid_restart.
2009-12-14 21:57:39 +00:00
R. David Murray 0a0a1a842c Issue #1680159: unicode coercion during an 'in' operation was masking
any errors that might occur during coercion of the left operand and
turning them into a TypeError with a message text that was confusing in
the given context.  This patch lets any errors through, as was already
done during coercion of the right hand side.
2009-12-14 16:28:26 +00:00
Benjamin Peterson ddd392cbb9 accept None as the same as having passed no argument in file types #7349
This is for consistency with imitation file objects like StringIO and BytesIO.

This commit also adds a few tests, where they were lacking for concerned
methods.
2009-12-13 19:19:07 +00:00
Ezio Melotti e304852e21 #7342: make sure that the datetime object in test_fraction always has a number of microseconds != 0 2009-12-13 18:54:53 +00:00
Benjamin Peterson 414721614f make StringIO like other file objects in that readline(-1) has no effect #7348 2009-12-13 17:29:16 +00:00
Benjamin Peterson 4895af4ef1 fix the ignoring of __cmp__ method on metaclasses #7491 2009-12-13 16:36:53 +00:00
Lars Gustäbel 92ca7561bb Issue #7357: No longer suppress fatal extraction errors by
default.

TarFile's errorlevel argument controls how errors are
handled that occur during extraction. There are three
possible levels 0, 1 and 2. If errorlevel is set to 1 or 2
fatal errors (e.g. a full filesystem) are raised as
exceptions. If it is set to 0, which is the default value,
extraction errors are suppressed, and error messages are
written to the debug log instead. But, if the debug log is
not activated, which is the default as well, all these
errors go unnoticed.

The original intention was to imitate GNU tar which tries
to extract as many members as possible instead of stopping
on the first error. It turns out that this is no good
default behaviour for a tar library. This patch simply
changes the default value for the errorlevel argument from
0 to 1, so that fatal extraction errors are raised as
EnvironmentError exceptions.
2009-12-13 11:32:27 +00:00
Antoine Pitrou c169c781a8 Issue #7466: segmentation fault when the garbage collector is called
in the middle of populating a tuple.  Patch by Florent Xicluna.

(note: no NEWS entry for trunk since the bug was introduced in 2.7/3.1)
2009-12-12 19:13:08 +00:00
Mark Dickinson 9be87bc992 Issue #3366: Add lgamma function to math module. 2009-12-11 17:29:33 +00:00
Vinay Sajip 5cc4e2a040 Issue #7470: logging: fix bug in Unicode encoding fallback. 2009-12-11 09:16:01 +00:00
Tarek Ziadé 6c4847fbee using an existing file to avoid dealing with a sleep to test file ages 2009-12-10 19:29:53 +00:00
Tarek Ziadé 1bd9b5e925 added test coverage for distutils.dep_util, and cleaned up the module 2009-12-10 15:29:03 +00:00
Ronald Oussoren 9fa9a0d635 Fix an issue with the detection of a non-existing SDK
on OSX. Without this patch it wasn't possible after all
to compile extensions on OSX 10.6 with the binary
installer unless the user had installed the (non-default)
10.4u SDK.
2009-12-10 10:27:09 +00:00
Raymond Hettinger a5fd24e97d Add a reverse() method to collections.deque(). 2009-12-10 06:42:54 +00:00
Raymond Hettinger 0b3263b073 Fix variants of deque.extend: d.extend(d) d+=d d.extendleft(d) 2009-12-10 06:00:33 +00:00
R. David Murray d4e31a4316 Skip new imaplib SSL tests if ssl is not available. 2009-12-09 16:41:39 +00:00
R. David Murray 93321f333c Issue 5949: fixed IMAP4_SSL hang when the IMAP server response is
missing proper end-of-line termination.  Patch and tests by
Scott Dial.  The new tests include a test harness which will
make it easier to add additional tests.
2009-12-09 15:15:31 +00:00
Antoine Pitrou 29dcdabf40 Make test_pipes a little bit more robust. 2009-12-08 19:46:38 +00:00
Antoine Pitrou ca173e2a07 Fix transient refleaks in test_urllib. Thanks to Florent Xicluna. 2009-12-08 19:35:12 +00:00
Antoine Pitrou 8c54e7819a Fix the transient refleaks in test_zipimport_support.
Diagnosis and original patch by Florent Xicluna (flox).
2009-12-08 19:25:51 +00:00
Antoine Pitrou 187177fc55 Issue #6986: Fix crash in the JSON C accelerator when called with the
wrong parameter types.  Patch by Victor Stinner.
2009-12-08 15:40:51 +00:00
Tarek Ziadé 4b7f9439c0 removed the usage of rfc822 in favor of email.message.Message 2009-12-08 09:39:51 +00:00
Tarek Ziadé a939ecd95b Issue #7457: added a read_pkg_file method to distutils.dist.DistributionMetadata so we can read back PKG-INFO files 2009-12-08 08:56:49 +00:00
Benjamin Peterson a4a04d1a89 fix test_parser from tokenizer tweak 2009-12-06 21:24:30 +00:00
Vinay Sajip bd1094a4a5 logging: Improved support for SMTP over TLS. 2009-12-06 18:05:04 +00:00
Vinay Sajip 4830566751 logging: Added optional 'secure' parameter to SMTPHandler. 2009-12-06 17:57:11 +00:00
Tarek Ziadé 4f38317d5a Fixed #1923: make sure we don't strip meaningful whitespace in PKG-INFO Description field 2009-12-06 09:22:40 +00:00
Benjamin Peterson d78cec5f39 bump version to 2.7a1 2009-12-05 17:47:56 +00:00
Benjamin Peterson c0321aa0d9 regenerate pydoc_topics 2009-12-05 17:45:40 +00:00
R. David Murray 820b0ea36c Issue 7431: use TESTFN in test_linecache instead of trying to create a
file in the Lib/test directory, which might be read-only for the
user running the tests.
2009-12-03 23:57:59 +00:00
Martin v. Löwis c218a2fac8 Issue #4120: Drop reference to CRT from manifest when building
extensions with msvc9compiler.
2009-12-03 20:53:51 +00:00
Philip Jenvey 0299d0d7f0 actually close files 2009-12-03 02:40:13 +00:00
Antoine Pitrou 30b3b35cba Issue #7333: The `posix` module gains an `initgroups()` function providing
access to the initgroups(3) C library call on Unix systems which implement
it.  Patch by Jean-Paul Calderone.
2009-12-02 20:37:54 +00:00
Eric Smith f2bf0d2a51 Issue #4482: Add tests for special float value formatting. 2009-12-02 17:43:06 +00:00
Amaury Forgeot d'Arc d728871ee1 #7419: Fix a crash on Windows in locale.setlocale() when the category
is outside the allowed range.
2009-12-01 21:51:04 +00:00
Raymond Hettinger e09f45a2e3 Issue 7410: deepcopy of itertools.count resets the count 2009-11-30 19:44:40 +00:00
Benjamin Peterson d46430bd81 now that deepcopy can handle instance methods, this hack can be removed #7409
Thanks Robert Collins
2009-11-29 22:26:26 +00:00
Tarek Ziadé a5076a2543 Fixed #7408: dropped group ownership checking because it relies on os-specific rules 2009-11-29 22:20:30 +00:00
Eric Smith c4ab8339e9 Issue #3382: Make '%F' and float.__format__('F') convert results to upper case. Much of the patch came from Mark Dickinson. 2009-11-29 17:40:57 +00:00
Antoine Pitrou d16f57bf4d Issue #1515: Enable use of deepcopy() with instance methods. Patch by Robert Collins. 2009-11-28 15:55:58 +00:00
Vinay Sajip 01801d1f08 Issue #7403: Fixed possible race condition in lock creation. 2009-11-27 14:03:36 +00:00
Martin v. Löwis 50ea4565bd Issue #6508: Add posix.{getresuid,getresgid,setresuid,setresgid}. 2009-11-27 13:56:01 +00:00
Antoine Pitrou acbe3bdbab Issue #6845: Add restart support for binary upload in ftplib. The
`storbinary()` method of FTP and FTP_TLS objects gains an optional `rest`
argument.  Patch by Pablo Mouzo.

(note: the patch also adds a test for the rest argument in retrbinary())
2009-11-27 13:18:34 +00:00
Antoine Pitrou 2dab865ff1 When open_urlresource() fails, HTTPException is another possible error 2009-11-26 12:36:30 +00:00
Antoine Pitrou bcfaf8007d Issue #5788: `datetime.timedelta` objects get a new `total_seconds()` method returning
the total number of seconds in the duration.  Patch by Brian Quinlan.
2009-11-25 22:59:36 +00:00
Barry Warsaw 0d9f61a543 Add mktime_tz to __all__. It's documented as being available in email.utils. 2009-11-25 18:38:32 +00:00
Benjamin Peterson 42d26d94cc Merged revisions 76160-76161,76250,76252,76447,76506 via svnmerge from
svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3

........
  r76160 | benjamin.peterson | 2009-11-08 18:53:48 -0600 (Sun, 08 Nov 2009) | 1 line

  undeprecate the -p option; it's useful for converting python3 sources
........
  r76161 | benjamin.peterson | 2009-11-08 19:05:37 -0600 (Sun, 08 Nov 2009) | 1 line

  simplify condition
........
  r76250 | benjamin.peterson | 2009-11-13 16:56:48 -0600 (Fri, 13 Nov 2009) | 1 line

  fix handling of a utf-8 bom #7313
........
  r76252 | benjamin.peterson | 2009-11-13 16:58:36 -0600 (Fri, 13 Nov 2009) | 1 line

  remove pdb turd
........
  r76447 | benjamin.peterson | 2009-11-22 18:17:40 -0600 (Sun, 22 Nov 2009) | 1 line

  #7375 fix nested transformations in fix_urllib
........
  r76506 | benjamin.peterson | 2009-11-24 18:34:31 -0600 (Tue, 24 Nov 2009) | 1 line

  use generator expressions in any()
........
2009-11-25 18:16:46 +00:00
Vinay Sajip 2ed8813f22 logging: Issue 6615: Changed handler prepend to append. 2009-11-25 14:12:03 +00:00
Vinay Sajip 17e94e052f logging: made _handlers a WeakValueDictionary. 2009-11-25 09:22:47 +00:00
Vinay Sajip c470d68d39 Issue #6615: logging: Used weak references in internal handler list. Thanks to flox (Florent Xicluna) for the patch. 2009-11-25 09:03:30 +00:00
Alexandre Vassalotti 8b2d713d32 Issue 7128: Removed reference to the non-existent copyreg module.
The reference to copyreg was a unnoticed leftover from the compatibility
support for the grand renaming of the standard library in Python 3. The
compatibility support was reverted in r63493, but not completely as this
patch shows.

Based on a patch by Amaury Forgeot d'Arc.
2009-11-24 17:53:23 +00:00
Vinay Sajip 1d2c16db7e Made logging classes new-style and added name property to handlers. 2009-11-24 15:53:25 +00:00
Mark Dickinson 3e5354934e Issue #7117: Update float formatting testcases to match those in py3k. 2009-11-24 15:12:20 +00:00
Jesse Noller 9a03f2fd03 comment out test added in r76438, which caused refleaks 2009-11-24 14:17:29 +00:00
Mark Dickinson bce783757f round(0, "ermintrude") succeeded instead of producing a TypeError. Fix this. 2009-11-24 10:54:58 +00:00
Mark Dickinson 9dd5e16c5d Issue #7117, continued: Remove substitution of %g-style formatting for
%f-style formatting, which used to occur at high precision.  Float formatting
should now be consistent between 2.7 and 3.1.
2009-11-23 20:54:09 +00:00
Mark Dickinson 18cfada1ea Remove restriction on precision when formatting floats. This is the
first step towards removing the %f -> %g switch (see issues 7117,
5859).
2009-11-23 18:46:41 +00:00