Commit Graph

4766 Commits

Author SHA1 Message Date
R. David Murray 4617e5085a Issue #7143: get_payload used to strip any trailing newline from a
base64 transfer-encoded payload *after* decoding it; it no longer does.
email had a special method in utils, _bdecode, specifically to do this,
so it must have served a purpose at some point, yet it is clearly wrong
per RFC.  Fixed with Barry's approval, but no backport.  Email package
minor version number is bumped, now version 4.0.1.

Patch by Joaquin Cuenca Abela.
2010-03-08 02:04:06 +00:00
Mark Dickinson 154b7ad07e Issue #1530559: When packing a non-integer with any integer conversion
code using struct.pack, attempt to convert to an integer first using
the argument's __int__ method (if present).  Also raise a
DeprecationWarning for any such usage of __int__.

This fixes a regression from 2.6, where some (but not all) integer
conversion codes already used __int__.
2010-03-07 16:24:45 +00:00
Georg Brandl 21e99f4924 #5341: more built-in vs builtin fixes. 2010-03-07 15:23:59 +00:00
Florent Xicluna 6de9e938a5 Issue #7849: Now the utility ``check_warnings`` verifies if the warnings are
effectively raised.  A new utility ``check_py3k_warnings`` deals with py3k warnings.
2010-03-07 12:18:33 +00:00
Benjamin Peterson 5da7e7ce3f post release update 2010-03-06 22:44:07 +00:00
Benjamin Peterson 8e7c1178a0 bump version to 2.7a4 2010-03-06 20:34:14 +00:00
Florent Xicluna 985478dbbb Minor tweaking of previous r78734, and add a NEWS entry. 2010-03-06 18:52:52 +00:00
Florent Xicluna 58526417ed Do not print the header lines when running a single test. 2010-03-06 17:24:36 +00:00
Florent Xicluna 0b9a18a42f #6906: TCL_LIBRARY and TK_LIBRARY environment variables should be encoded. 2010-03-06 11:01:08 +00:00
Gerhard Häring 3bbb67273a Merged code from pysqlite 2.6.0. 2010-03-05 09:12:37 +00:00
Victor Stinner 7c924ec925 Issue #1054943: Fix unicodedata.normalize('NFC', text) for the Public Review
Issue #29.

PR #29 was released in february 2004!
2010-03-04 12:09:33 +00:00
Victor Stinner 56a5153e21 Issue #7494: fix a crash in _lsprof (cProfile) after clearing the profiler,
reset also the pointer to the current pointer context.
2010-03-04 00:10:12 +00:00
Victor Stinner 71fb87e64c Issue #7544: Preallocate thread memory before creating the thread to avoid a
fatal error in low memory condition.
2010-03-03 23:20:25 +00:00
Lars Gustäbel 6458104188 Issue #7232: Add support for the context manager protocol
to the TarFile class.
2010-03-03 11:55:48 +00:00
Victor Stinner d23d3930ff Issue #7820: The parser tokenizer restores all bytes in the right if the BOM
check fails.

Fix an assertion in pydebug mode.
2010-03-02 23:20:02 +00:00
Florent Xicluna c0a9d4152d Test test_pep277 is only relevant for Unicode-friendly filesystems. 2010-03-02 22:34:11 +00:00
Florent Xicluna 2db61fb7a8 Tentatively enable test_pep277 on all platforms. 2010-03-02 21:34:45 +00:00
Steven Bethard e9330e7941 Initial commit of the argparse library, based on argparse 1.1.
Docs still need some updating to make getopt and optparse match the wording promised in the PEP.
There are also probably a number of :class:ArgumentParser etc. links that could be added to the argparse documentation.
2010-03-02 08:38:09 +00:00
Barry Warsaw 08a8fb30b6 Manually copy patch for bug 7250 from the release26-maint branch. I suck
because I did this in the wrong order and couldn't smack svnmerge into
submission.
2010-03-01 21:46:51 +00:00
Florent Xicluna e7901c5ebb #7808: Fix reference leaks in _bsddb and related tests. 2010-03-01 20:45:01 +00:00
Gregory P. Smith 6a65f85e79 Fixes issue #7999: os.setreuid() and os.setregid() would refuse to accept
a -1 parameter on some platforms such as OS X.
2010-03-01 05:43:43 +00:00
Gregory P. Smith 3c699d334a Adds c_ssize_t to ctypes. issue 6729. 2010-03-01 04:56:12 +00:00
Gregory P. Smith 9e5d1327f8 Issue #7242: On Solaris 9 and earlier calling os.fork() from within a
thread could raise an incorrect RuntimeError about not holding the import
lock.  The import lock is now reinitialized after fork.
2010-03-01 01:22:39 +00:00
Gregory P. Smith cce211f88c Issue #1068268: The subprocess module now handles EINTR in internal
os.waitpid and os.read system calls where appropriate.
2010-03-01 00:05:08 +00:00
Gregory P. Smith 613c7a549a Issue #7481: When a threading.Thread failed to start it would leave the
instance stuck in initial state and present in threading.enumerate().
2010-02-28 18:36:09 +00:00
Florent Xicluna 2a903b26e9 Issue #1729305: Fix doctest to handle encode error with "backslashreplace". It fixes #7667 too. 2010-02-27 13:31:23 +00:00
Florent Xicluna 82aa01fa29 Add entry for issue #691291. 2010-02-27 11:19:18 +00:00
Martin v. Löwis 99bf01b4b4 Add Florent Xicluna. 2010-02-25 20:42:40 +00:00
Ezio Melotti 321251567e #7649: "u'%c' % char" now behaves like "u'%s' % char" and raises a UnicodeDecodeError if 'char' is a byte string that can't be decoded using the default encoding. 2010-02-25 17:36:04 +00:00
Ezio Melotti 2076666770 typos 2010-02-24 16:49:56 +00:00
Eric Smith 2d9856d6ce Issue #7309: Unchecked pointer access when converting UnicodeEncodeError, UnicodeDecodeError, and UnicodeTranslateError to strings. 2010-02-24 14:15:36 +00:00
Dirkjan Ochtman ebc73dce57 Issue #7427: improve the representation of httplib.BadStatusLine exceptions. 2010-02-24 04:49:00 +00:00
R. David Murray 48605be128 Issue 7975: in python 2.6 bsddb.dbshelve switched from DictMixin to
MutableMapping, and thereby lost functionality because the replacement
functionality was implemented incorrectly or incompletely).  Since bsddb
isn't in py3k, this patch just goes back to using DictMixin in order to
correct the regression.
2010-02-24 02:31:27 +00:00
Brett Cannon 1ffccb0f8a Record that Dino Viehland got commit privs. 2010-02-24 01:38:04 +00:00
Victor Stinner f20f9c299e Issue #7649: Fix u'%c' % char for character in range 0x80..0xFF
=> raise an UnicodeDecodeError. Patch written by Ezio Melotti.
2010-02-23 23:16:07 +00:00
Georg Brandl ea370a9edd #6544: fix refleak in kqueue, occurring in certain error conditions. 2010-02-23 21:48:57 +00:00
Dirkjan Ochtman 8614817875 Fix #1537721: add writeheader() method to csv.DictWriter.
Reviewed by skip.montanaro and thomas.wouters.
2010-02-23 21:09:52 +00:00
Thomas Heller 92bd059c67 ctypes CThunkObject was not registered correctly with the cycle
garbage collector, leading to possible leaks when using callback
functions.
2010-02-23 20:11:44 +00:00
Tarek Ziadé b8708a298e fixed #5801: removed spurious empty lines in wsgiref 2010-02-23 05:53:05 +00:00
R. David Murray f28fd24c36 Issue 6292: for the moment at least, the test suite passes if run
with -OO.  Tests requiring docstrings are skipped.  Patch by
Brian Curtin, thanks to Matias Torchinsky for helping review and
improve the patch.
2010-02-23 00:24:49 +00:00
Eric Smith 87bcb243ac Issue #6902: Fix problem with built-in types format incorrectly with 0 padding. 2010-02-23 00:11:16 +00:00
Andrew M. Kuchling b64d61369a #2560: remove an unnecessary 'for' loop from my_fgets() in Parser/myreadline.c.
Noted by Joseph Armbruster; patch by Jessica McKellar.

The original code was 'for (;;) {...}', where ... ended
with a 'return -2' statement and did not contain a 'break' or 'continue'
statement.  Therefore, the body of the loop is always executed once.

Once upon a time there was a 'continue' in the loop, but it was removed in
rev36346, committed by mwh on Wed Jul 7 17:44:12 2004.
2010-02-22 22:48:41 +00:00
Jack Diederich 5cac46dd41 * fix issue#7476 2010-02-22 21:27:38 +00:00
Eric Smith f32d4acead Issue #7988: Fix default alignment to be right aligned for complex.__format__. Now it matches other numeric types. 2010-02-22 18:33:47 +00:00
Andrew M. Kuchling 83fddec8bd Note granting of commit privileges to Larry Hastings 2010-02-22 17:21:54 +00:00
Mark Dickinson 82b34c5dbe Issue #5211: Fix complex type to avoid implicit calls to
complex.__coerce__.  Thanks Meador Inge for the patch.
2010-02-21 12:57:35 +00:00
R. David Murray 51f1204590 Issue 7970: When email.Parser.Parser parses a MIME message of type
message/rfc822 it turns it into an object whose body consists of
a list containing a single Message object.  HeaderParser, on the
other hand, just copies the body as a string.  Generator.flatten
has a special handler for the message mime type that expected the
body to be the one item list.  This fails if the message was parsed
by HeaderParser.  So we now check to see if the body is a string
first, and if so just we just emit it.
2010-02-21 04:23:00 +00:00
Ezio Melotti 4cc80ca921 #3426: os.path.abspath now returns unicode when its arg is unicode. 2010-02-20 08:09:39 +00:00
Mark Dickinson 6d8effb1fc Issue #7633: Context method in the decimal module (with the exception
of the 'canonical' and 'is_canonical' methods) now consistently accept
integer arguments wherever a Decimal instance is accepted.  Thanks
Juan José Conti for the patch.
2010-02-18 14:27:02 +00:00
Martin v. Löwis 413fabc070 Stop providing crtassem.h symbols when compiling with
Visual Studio 2010, as msvcr100.dll is not a platform
assembly anymore.
2010-02-18 09:22:20 +00:00
Martin v. Löwis 7875ef67cd Issue #7903: Define _BSD_SOURCE through OpenBSD 4.9. 2010-02-15 21:41:12 +00:00
Martin v. Löwis 5e2dd866a8 Issue #3920: Define _BSD_SOURCE on OpenBSD 4.4. 2010-02-15 08:32:00 +00:00
R. David Murray 7c29f071d5 Issue 5754: tweak shelve doc wording to make it clearer that even when
writeback=True values are written to the backing store when assigned to
the shelf.  Add test to confirm that this happens.  Doc patch and added
test by Robert Lehmann.  I also fixed the cross references to the sync
and close methods.
2010-02-11 01:38:42 +00:00
R. David Murray 63e4fd7eef Issue 7835: Shelve's __del__ method calls its close method, and its
close method refers to an identifier in the global module namespace.
This means that when __del__ is called during interpreter shutdown (if,
for example, the calling program still has a pointer to the shelf),
sometimes that global identifier would wind up being None, causing
mysterious 'ignored' exceptions.  This patch checks for the possible None
value first before using the global, thus avoiding the error messages.
2010-02-10 22:42:04 +00:00
Ezio Melotti 8f6a287029 #7712: add a temp_cwd context manager to test_support and use it in regrtest to run all the tests in a temporary directory, saving the original CWD in test_support.SAVEDCWD. Thanks to Florent Xicluna who helped with the patch. 2010-02-10 21:40:33 +00:00
Michael Foord db43b5a1f5 Issue 7893 and Issue 7588 2010-02-10 14:25:12 +00:00
Antoine Pitrou 42fb6ab491 Issue #2746: Don't escape ampersands and angle brackets ("&", "<", ">")
in XML processing instructions and comments.  These raw characters are
allowed by the XML specification, and are necessary when outputting e.g.
PHP code in a processing instruction.  Patch by Neil Muller.
2010-02-09 17:08:05 +00:00
Ronald Oussoren dd25e86cf4 Issue 6003: ZipFile.writestr "compression_type" argument 2010-02-07 20:18:02 +00:00
Vinay Sajip 64e8b970f9 Issue #7869: logging: improved format-time diagnostics and removed some 1.5.2 support code. 2010-02-07 12:56:54 +00:00
Vinay Sajip 657514a690 Issue #7868: logging: added loggerClass attribute to Manager. 2010-02-07 01:37:08 +00:00
Benjamin Peterson 2d798ac619 post release updates 2010-02-06 18:26:27 +00:00
Benjamin Peterson a7be9d240a bump version to 2.7a3 2010-02-06 16:37:32 +00:00
R. David Murray ce6e4b0930 issue #7728: test_timeout was using a hardcoded port, which was
causing buildbot failures.  Changed to use test_support.bind_port.
Patch by Florent Xicluna.
2010-02-06 04:27:21 +00:00
Barry Warsaw b1e66ee651 Resolve bug 7847 by including documentation for -J, -U, and -X under "Options
you shouldn't use".
2010-02-05 18:45:25 +00:00
Antoine Pitrou bb445a1f22 Issue #5677: Explicitly forbid write operations on read-only file objects,
and read operations on write-only file objects.  On Windows, the system C
library would return a bogus result; on Solaris, it was possible to crash
the interpreter.  Patch by Stefan Krah.
2010-02-05 17:05:54 +00:00
Benjamin Peterson 565d78586b normalize exceptions passed to the __exit__ method #7853
In Python 2.x, exceptions in finally blocks are not normalized.  Since with
statements are implemented using finally blocks, ceval.c had to be tweaked to
distinguish between with finally blocks and normal ones.

A test for the finalization of generators containing with statements was also
added.
2010-02-05 02:12:14 +00:00
Vinay Sajip 0e6e97d9ad Issue #7851: logging: clarification on logging configuration files. 2010-02-04 20:23:45 +00:00
Antoine Pitrou d840e5174d Issue #4772: Raise a ValueError when an unknown Bluetooth protocol is
specified, rather than fall through to AF_PACKET (in the `socket` module).
Also, raise ValueError rather than TypeError when an unknown TIPC address
type is specified.  Patch by Brian Curtin.
2010-02-04 20:20:18 +00:00
Vinay Sajip 28c382f73a Logging: Implemented PEP 391. 2010-02-04 18:48:53 +00:00
R. David Murray 7045d64de5 Add Chris Rebert to ACKS for issue 6760 Popen doc improvements. 2010-02-04 16:33:31 +00:00
Antoine Pitrou 526e421b12 Issue #7385: Fix a crash in `MemoryView_FromObject` when
`PyObject_GetBuffer` fails.  Patch by Florent Xicluna.
2010-02-02 22:36:17 +00:00
Victor Stinner b4b0a2935d Issue #7819: Check sys.call_tracing() arguments types.
py3k was already patched by issue #3661.
2010-01-31 22:32:15 +00:00
Antoine Pitrou f3fa074703 - Issue #6939: Fix file I/O objects in the `io` module to keep the original
file position when calling `truncate()`.  It would previously change the
  file position to the given argument, which goes against the tradition of
  ftruncate() and other truncation APIs.  Patch by Pascal Chambon.
2010-01-31 22:26:04 +00:00
Matthias Klose 626d92aaea - Update python manual page (options -B, -O0, -s, environment variables
PYTHONDONTWRITEBYTECODE, PYTHONNOUSERSITE).
2010-01-31 16:05:13 +00:00
Mark Dickinson a36507c64c Issue #7767: Add new C-API function PyLong_AsLongLongAndOverflow, a
long long variant of PyLong_AsLongAndOverflow.  Patch by Case Van
Horsen.
2010-01-30 10:08:33 +00:00
Martin v. Löwis 721caaa9ce Add Victor Stinner. 2010-01-30 00:15:44 +00:00
Mark Dickinson 36ecd676ea Issue #7788: Fix a crash produced by deleting a list slice with huge
step value.  Patch by Marcin Bachry.
2010-01-29 17:11:39 +00:00
Benjamin Peterson e06f7114a2 an -> a 2010-01-28 02:15:02 +00:00
Benjamin Peterson 9ef7d4f73c add compat note 2010-01-28 01:24:46 +00:00
Antoine Pitrou 94c33ebfa8 Issue #7610: Reworked implementation of the internal
:class:`zipfile.ZipExtFile` class used to represent files stored inside
an archive.  The new implementation is significantly faster and can
be wrapped in a :class:`io.BufferedReader` object for more speedups.
It also solves an issue where interleaved calls to `read()` and
`readline()` give wrong results.  Patch by Nir Aides.
2010-01-27 20:59:50 +00:00
Jesse Noller 654ade3e6a Issue #6963: Added maxtasksperchild argument to multiprocessing.Pool 2010-01-27 03:05:57 +00:00
Benjamin Peterson 2deb5c758a raise a clear TypeError when trying to register a non-class 2010-01-27 02:16:42 +00:00
Eric Smith ee931b7253 Issue #7766: Change sys.getwindowsversion() return value to a named tuple and add the additional members returned in an OSVERSIONINFOEX structure. The new members are service_pack_major, service_pack_minor, suite_mask, and product_type. 2010-01-27 00:28:29 +00:00
Ezio Melotti 82230f952d Add a news entry for the functions verify and vereq that have been removed in r77729 and r77731 2010-01-25 12:37:02 +00:00
Benjamin Peterson a43f34cc2a fix an UnboundLocalError when the release file is empty #7773 2010-01-25 03:31:13 +00:00
Tarek Ziadé f14c7fc33d Fixed #7748: now upload and register commands don't need to force the encoding anymore : DistributionMetada returns utf8 strings 2010-01-24 00:33:32 +00:00
Matthias Klose 0d948ac90c - Expat: Fix DoS via XML document with malformed UTF-8 sequences
(CVE_2009_3560).
2010-01-22 00:39:04 +00:00
Matthias Klose 3b0f9b01f6 - Mention CVE-2009-3720 for change in r74429. 2010-01-22 00:34:48 +00:00
Antoine Pitrou c07336c673 Add a NEWS entry for r77599 and r77600. 2010-01-18 21:15:21 +00:00
Mark Dickinson 9481c576cd Issue #7632: When Py_USING_MEMORY_DEBUGGER is defined, disable the
private memory allocation scheme in dtoa.c, along with a piece of code
that caches powers of 5 for future use.  This makes it easier to
detect dtoa.c memory leaks with Valgrind or similar tools.

Patch by Stefan Krah.
2010-01-17 20:57:56 +00:00
Ronald Oussoren a55af9a9db - Issue #7658: Ensure that the new pythonw executable works on OSX 10.4
- Issue #7714: Use ``gcc -dumpversion`` to detect the version of GCC on
  MacOSX.

- Make configure look for util.h as well as libutil.h. The former
  is the header file that on OSX contains the defition of openpty.

  (Needed to compile for OSX 10.4 on OSX 10.6)

- Use the correct definition of CC to compile the pythonw executable
2010-01-17 16:25:57 +00:00
Mark Dickinson 23df3d270d Issue #7632: Fix a memory leak in _Py_dg_strtod. 2010-01-17 13:37:57 +00:00
Antoine Pitrou e80a6a4ead Issue #7561: Operations on empty bytearrays (such as `int(bytearray())`)
could crash in many places because of the PyByteArray_AS_STRING() macro
returning NULL.  The macro now returns a statically allocated empty
string instead.
2010-01-17 12:26:20 +00:00
Ezio Melotti 3373a3a282 typo: use one instead instead of two 2010-01-16 18:38:01 +00:00
Mark Dickinson 476279f18b Issue #7632: Fix a serious wrong output bug for string -> float conversion.
Also remove some now unused variables, and add comments clarifying the
possible outputs of the parsing section of _Py_dg_strtod.  Thanks
Eric Smith for reviewing.
2010-01-16 10:44:00 +00:00
R. David Murray ed44dfa4c7 Issue #1670765: Prevent email.generator.Generator from re-wrapping
headers in multipart/signed MIME parts, which fixes one of the sources of
invalid modifications to such parts by Generator.  Patch and tests by
Martin von Gagern.
2010-01-16 05:15:17 +00:00
Sean Reifscheider 57cd8ebc20 issue5063: Fixes for building RPM on CentOS plus misc .spec file enhancements. 2010-01-16 04:27:58 +00:00
Vinay Sajip 334ffe8cc8 Fixed issue-number mistake in NEWS update. 2010-01-15 23:27:05 +00:00
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