Commit Graph

15227 Commits

Author SHA1 Message Date
Antoine Pitrou c391ad007b Issue #7701: Fix crash in binascii.b2a_uu() in debug mode when given a
1-byte argument.  Patch by Victor Stinner.
2010-01-15 00:18:00 +00:00
Brett Cannon 3ffa43db48 The silencing of DeprecationWarning was not taking -3 into consideration. Since
Py3K warnings are DeprecationWarning by default this was causing -3 to
essentially be a no-op. Now DeprecationWarning is only silenced if -3 is not
used.

Closes issue #7700. Thanks Ezio Melotti and Florent Xicluna for patch help.
2010-01-14 20:00:28 +00:00
Antoine Pitrou efdddd3370 Issue #3299: Fix possible crash in the _sre module when given bad
argument values in debug mode.  Patch by Victor Stinner.
2010-01-14 17:25:24 +00:00
Antoine Pitrou fd3a60d5ef Issue #7703: Add support for the new buffer API to functions of the
binascii module.  Backported from py3k by Florent Xicluna, with some
additional tests.
2010-01-14 16:27:09 +00:00
Mark Dickinson 647ed91d5c Issue #7632: add tests for bugs fixed so far. 2010-01-14 15:22:33 +00:00
Benjamin Peterson 7a1b435297 use more robust quoting 2010-01-14 02:40:10 +00:00
Antoine Pitrou 5f76d132a5 Issue #7625: Add more tests that bytearray methods return new objects,
even if identical.  Patch by Florent Xicluna (again).
2010-01-13 15:02:13 +00:00
Antoine Pitrou 5a9112c0cc Issue #2846: Add support for gzip.GzipFile reading zero-padded files.
Patch by Brian Curtin.
2010-01-13 14:32:10 +00:00
Mark Dickinson 5ff4f279e6 Issue #7632: Fix a bug in dtoa.c that could lead to incorrectly-rounded results. 2010-01-12 22:55:51 +00:00
Mark Dickinson 8efef5ce9f Issue #7632: Fix a problem with _Py_dg_strtod that could lead to
crashes in debug builds, for certain long numeric strings
corresponding to subnormal values.
2010-01-12 22:23:56 +00:00
Antoine Pitrou efa45f35b5 Issue #7654: enable additional bytes/bytearray tests. Patch by Florent Xicluna. 2010-01-12 22:02:10 +00:00
Ezio Melotti b5689de044 #5827: make sure that normpath preserves unicode 2010-01-12 03:32:05 +00:00
Alexandre Vassalotti 58a96efde5 Fixed repr of dictionary views. 2010-01-12 01:34:43 +00:00
Tarek Ziadé ae7731af45 module cleanup 2010-01-11 23:41:32 +00:00
Alexandre Vassalotti 69eb51697c Issue #1967: Backport dictionary views. 2010-01-11 23:17:10 +00:00
Tarek Ziadé dc0f487c3b Fixed #5372: .o files are now always rebuilt because file age test don't work in some case 2010-01-11 22:50:29 +00:00
Alexandre Vassalotti b646547bb4 Issue #2333: Backport set and dict comprehensions syntax. 2010-01-11 22:36:12 +00:00
Benjamin Peterson e822ab0166 fix test_popen when the path to python has spaces #7671 2010-01-10 20:42:03 +00:00
Senthil Kumaran 2e3da14d8b Fixed issue7648 - test_urllib2 fails on Windows if not run from C: 2010-01-10 17:35:05 +00:00
Martin v. Löwis 9d87323445 Update root certificate to CAcert. 2010-01-10 10:29:54 +00:00
Brett Cannon 6fdd3dcb6a DeprecationWarning is now silent by default.
This was originally suggested by Guido, discussed on the stdlib-sig mailing
list, and given the OK by Guido directly to me. What this change essentially
means is that Python has taken a policy of silencing warnings that are only
of interest to developers by default. This should prevent users from seeing
warnings which are triggered by an application being run against a new
interpreter before the app developer has a chance to update their code.

Closes issue #7319. Thanks to Antoine Pitrou, Ezio Melotti, and Brian Curtin
for helping with the issue.
2010-01-10 02:56:19 +00:00
Alexandre Vassalotti ee936a2130 Issue #2335: Backport set literals syntax from Python 3.x. 2010-01-09 23:35:54 +00:00
Mark Dickinson e365613528 Issue #7532: Add additional slicing test cases for new- and old-style
classes.  Patch by Florent Xicluna.
2010-01-09 18:50:50 +00:00
Benjamin Peterson aa7e51f006 bump version to 2.7a2 2010-01-09 16:34:06 +00:00
Tarek Ziadé c25417f644 Fixed #7617: all flavors of gcc should be recognized now 2010-01-08 23:42:23 +00:00
Antoine Pitrou 5b77d6dfa3 Remove obsolete warning filters in regrtest.py (from issue #7092 -- patch by
Florent Xicluna).
2010-01-08 19:39:04 +00:00
Senthil Kumaran 7a2ee0b460 Fix for Issue7026. For the Error - RuntimeError: dictionary changed size during iteration 2010-01-08 19:20:25 +00:00
Antoine Pitrou 8015725d4f Issue #7092: Remove py3k warning when importing cPickle. 2to3 handles
renaming of `cPickle` to `pickle`.  The warning was annoying since there's
no alternative to cPickle if you care about performance.  Patch by Florent
Xicluna.
2010-01-08 19:20:17 +00:00
Senthil Kumaran ce8e33a095 Reverting the Revision: 77368. I committed Flox's big patch for tests by
mistake. ( It may come in for sure tough)
2010-01-08 19:04:16 +00:00
Senthil Kumaran 3ddc435af6 Fixing - Issue7026 - RuntimeError: dictionary changed size during iteration. Patch by flox 2010-01-08 18:41:40 +00:00
Mark Dickinson 3194d1454c Backport some float repr tests that were missed in issue 7117. 2010-01-08 16:53:56 +00:00
Antoine Pitrou 0d423b870b Issue #7455: Fix possible crash in cPickle on invalid input. Patch by
Florent Xicluna.
2010-01-07 17:46:49 +00:00
Georg Brandl 8904053003 #5991: let completion for the "help" command include help topics.
This also simplifies the Cmd.get_names() method implementation; it was written
at a time where dir() didn't consider base class attributes.
2010-01-06 18:02:16 +00:00
Georg Brandl 5089a38af2 Small fixes to test_cmd: fix signature of do_shell, remove duplicate import, add option to run the custom Cmd class. 2010-01-06 17:43:06 +00:00
Mark Dickinson 202eb9094c Add missing docstring for Context.divmod. Thanks Juan José Conti. 2010-01-06 16:20:22 +00:00
Benjamin Peterson 2b6e4bc3ad add a test about hashing array.array 2010-01-05 00:04:19 +00:00
Antoine Pitrou af45b11527 Kill a couple of "<>" 2010-01-04 23:28:16 +00:00
Antoine Pitrou b9d4963a98 Issue #7092: Fix the DeprecationWarnings emitted by the standard library
when using the -3 flag.  Patch by Florent Xicluna.
2010-01-04 23:22:44 +00:00
Benjamin Peterson ecdae19fbe do correct lookup of the __complex__ method 2010-01-04 00:43:01 +00:00
Antoine Pitrou 673ddf9907 Issue #7471: Improve the performance of GzipFile's buffering mechanism,
and make it implement the `io.BufferedIOBase` ABC to allow for further
speedups by wrapping it in an `io.BufferedReader`.  Patch by Nir Aides.
2010-01-03 22:29:56 +00:00
Gregory P. Smith 49d709c921 Fix testSourceAddress to not test the host, it wasn't passing on some platforms. 2010-01-03 15:05:52 +00:00
Gregory P. Smith 9d3252154f issue3972: HTTPConnection and HTTPSConnection now support a
source_address parameter.

Also cleans up an annotation in the socket documentation.
2010-01-03 02:06:07 +00:00
Gregory P. Smith 79a3eb1058 Adds an optional source_address parameter to socket.create_connection().
For use by issue3972.
2010-01-03 01:29:44 +00:00
Gregory P. Smith 6dcdcde2a8 Import all implementations of the hash algorithms (OpenSSL & builtin) and run
the test suite across all that are available.  Warns about extension modules
that could not be imported when python was compiled with Py_DEBUG.

That warning could be made fatal but I didn't want to do that initially as
I suspect non setup.py based build processes (windows, any others?) won't
compile them all conditionally based on the Py_DEBUG setting today.
2010-01-03 00:19:04 +00:00
Gregory P. Smith 443ec6875f Issue #3745: Undo the requirement for new buffer API only objects to be passed
to hashlib functions in python 2.x.  The module now uses the 's*' for argument
parsing which auto encodes unicode objects to the system default encoding for
us.
2010-01-02 22:28:48 +00:00
Antoine Pitrou b538d546da Remove silly conditional. 2010-01-02 21:53:44 +00:00
Antoine Pitrou 83f86e8e98 Add tests for issue #7458: str.rfind() would crash when called with an invalid
start value.  The offending code itself was removed as part of #7462.
This patch by Victor Stinner.
2010-01-02 21:47:10 +00:00
Antoine Pitrou 5b7139aab4 Issue #7462: Implement the stringlib fast search algorithm for the `rfind`,
`rindex`, `rsplit` and `rpartition` methods.  Patch by Florent Xicluna.
2010-01-02 21:12:58 +00:00
Georg Brandl 36f4214255 Fix casing. 2010-01-02 12:35:01 +00:00
Benjamin Peterson 1a635e4663 remove use of deprecated os.popen #7619 2010-01-02 02:43:04 +00:00
Mark Dickinson 1b34d2552c Issue #5080: turn the DeprecationWarning from float arguments passed
to integer PyArg_Parse* format codes into a TypeError.  Add a
DeprecationWarning for floats passed with the 'L' format code, which
didn't previously have a warning.
2010-01-01 17:27:30 +00:00
Georg Brandl 8cdc9bc901 More yearly updates. 2010-01-01 13:07:05 +00:00
Ezio Melotti 763f1e8d32 indentation and further alignment with py3k 2009-12-31 13:27:41 +00:00
Ezio Melotti 6d6b53cab8 cleanup and refactoring 2009-12-31 13:00:43 +00:00
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