Commit Graph

9853 Commits

Author SHA1 Message Date
R David Murray 8d8f110492 #14062: fix BytesParser handling of Header objects
This is a different fix than the 3.2 fix, but the new tests are the same.

This also affected smtplib.SMTP.send_message, which calls BytesParser.
2012-03-14 14:24:22 -04:00
R David Murray e2922835b0 Merge #14291: if a header has non-ascii unicode, default to CTE using utf-8
In Python2, if a unicode string was assigned as the value of a header,
email would automatically CTE encode it using the UTF8 charset.
This capability was lost in the Python3 translation, and this patch
restores it.

Patch by Ali Ikinci, assisted by R. David Murray.

I also added a fix for the mailbox test that was depending (with a comment
that it was a bad idea to so depend) on non-ASCII causing message_from_string
to raise an error.  It now uses support.patch to induce an error during
message serialization.
2012-03-14 03:03:27 -04:00
R David Murray 7441a7aedd #14291: if a header has non-ascii unicode, default to CTE using utf-8
In Python2, if a unicode string was assigned as the value of a header,
email would automatically CTE encode it using the UTF8 charset.
This capability was lost in the Python3 translation, and this patch
restores it.

Patch by Ali Ikinci, assisted by R. David Murray.

I also added a fix for the mailbox test that was depending (with a comment
that it was a bad idea to so depend) on non-ASCII causing message_from_string
to raise an error.  It now uses support.patch to induce an error during
message serialization.
2012-03-14 02:59:51 -04:00
Senthil Kumaran e24f96a059 Issue10050 - urlretrieve uses newer urlopen. reporthook of urlretrieve takes, block number, block read size, file_size 2012-03-13 19:29:33 -07:00
Victor Stinner 8050ca9c6f Issue #14180: TestDateTime.test_microsecond_rounding() handles localtime() and
gmtime() failure on Windows
2012-03-14 00:17:05 +01:00
R David Murray 910df329fd #8315: add automatic unittest test discovery in test.test_email 2012-03-13 18:02:22 -04:00
Victor Stinner 5d272cc6a2 Close #14180: Factorize code to convert a number of seconds to time_t, timeval or timespec
time.ctime(), gmtime(), time.localtime(), datetime.date.fromtimestamp(),
datetime.datetime.fromtimestamp() and datetime.datetime.utcfromtimestamp() now
raises an OverflowError, instead of a ValueError, if the timestamp does not fit
in time_t.

datetime.datetime.fromtimestamp() and datetime.datetime.utcfromtimestamp() now
round microseconds towards zero instead of rounding to nearest with ties going
away from zero.
2012-03-13 13:35:55 +01:00
Senthil Kumaran 19b114b818 merge to 3.3 - Fix closes Issue14281 - Test for cgi.escape by Brian Landers 2012-03-13 01:51:20 -07:00
Senthil Kumaran 47b5ddb9cf 3.2 - Fix closes Issue14281 - Test for cgi.escape by Brian Landers 2012-03-13 01:50:27 -07:00
R David Murray a9719057a2 #8942: add test for __path__ contents in zipimport tests
Patch by Tatiana Al-Chueyr.
2012-03-12 21:16:33 -04:00
Sean Reifschneider 7b3c975aaf closes #14259 re.finditer() now takes keyword arguments: pos, endpos.
Contrary to the documentation, finditer() did not take pos and endpos
keyword arguments.
2012-03-12 18:22:38 -06:00
Ezio Melotti cc50ba26bd #14179: merge with 3.2. 2012-03-13 01:33:30 +02:00
Ezio Melotti df723e1e5e #14179: add tests for re.compile. Patch by Florian Mladitsch. 2012-03-13 01:29:48 +02:00
Eric V. Smith 97722c4132 str.format_map tests don't do what they say: fix to actually implement the intent of the test. Closes #13450. Patch by Akira Li. 2012-03-12 15:26:21 -07:00
Eric V. Smith 1d4798cb93 Merge heads. 2012-03-12 15:18:30 -07:00
Eric V. Smith edbb6ca084 str.format_map tests don't do what they say: fix to actually implement the intent of the test. Closes #13450. 2012-03-12 15:16:22 -07:00
Ezio Melotti 48d578c02a #13394: add more tests for the aifc module and use warnings.warn instead of print. Patch by Oleg Plakhotnyuk. 2012-03-12 23:57:18 +02:00
Ezio Melotti 85769539a3 #13394: add more tests for the aifc module. Patch by Oleg Plakhotnyuk. 2012-03-12 23:52:40 +02:00
Łukasz Langa 17591c1a1d Head merge. 2012-03-12 19:59:48 +01:00
Łukasz Langa f3078fbee2 Fixes #13842: cannot pickle Ellipsis or NotImplemented.
Thanks for James Sanders for the bug report and the patch.
2012-03-12 19:46:12 +01:00
Benjamin Peterson f28fcff17d adjust for change in AST type 2012-03-12 11:19:19 -07:00
Benjamin Peterson 7e0dbfbbde give the AST class a __dict__ 2012-03-12 09:46:44 -07:00
Benjamin Peterson 61a4161de4 merge 3.2 2012-03-12 09:43:27 -07:00
Benjamin Peterson ef87f06798 allow AST objects to be like its subclasses 2012-03-12 09:43:09 -07:00
Benjamin Peterson 6645f7e590 merge heads 2012-03-12 09:28:51 -07:00
Benjamin Peterson 09b4bd03f6 merge 3.2 2012-03-12 09:28:36 -07:00
Benjamin Peterson d279e286f2 every other ast object has a dict, so I think AST should, too 2012-03-12 09:27:36 -07:00
Eric V. Smith 851cad7616 Make test_logging no longer fail if zlib not present. Closes #14256. Patch by Pedro Kroger. 2012-03-11 22:46:04 -07:00
Antoine Pitrou b69ef16fe6 Issue #14252: Fix subprocess.Popen.terminate() to not raise an error under Windows when the child process has already exited. 2012-03-11 19:33:29 +01:00
Antoine Pitrou 1f9a835400 Issue #14252: Fix subprocess.Popen.terminate() to not raise an error under Windows when the child process has already exited. 2012-03-11 19:29:12 +01:00
Antoine Pitrou eab2a50dfc PEP8-ize test names 2012-03-10 16:34:40 +01:00
Antoine Pitrou 8cd8d5e8f2 Remove useless failOnException() method 2012-03-10 16:20:24 +01:00
Victor Stinner 28393828e2 Issue #14205: Fix test_dict.test_mutating_lookup() 2012-03-09 22:58:51 +01:00
Antoine Pitrou 3774977de2 Relax timeout tests for weak Windows buildbot 2012-03-09 18:40:15 +01:00
Victor Stinner 63ed5664a1 Issue #14231: Lib/test/crashers/borrowed_ref_1.py was fixed by ba6376dff6c4. 2012-03-09 13:59:42 +01:00
Eli Bendersky 865756a94c Issue #14178: Problem deleting slices with steps != +1 in the _elementtree module.
Fixed the problem and added some tests. Closes #14178
2012-03-09 13:38:15 +02:00
Victor Stinner 40c9565bcc Issue #14211: Oops, I removed the wrong file :-) 2012-03-09 00:52:07 +01:00
Victor Stinner 2d01dc00bc Issue #14211: _PyObject_GenericSetAttrWithDict() keeps a strong reference to
the descriptor because it may be destroyed before being used, destroyed during
the update of the dict for example.
2012-03-09 00:44:13 +01:00
Victor Stinner d74782b0ac Close #14199: _PyType_Lookup() and super_getattro() keep a strong reference to
the type MRO to avoid a crash if the MRO is changed during the lookup.
2012-03-09 00:39:08 +01:00
Benjamin Peterson 9a6338651e merge 3.2 (#3787e896dbe9) 2012-03-07 18:52:52 -06:00
Benjamin Peterson 52c424343d allow cycles throught the __dict__ slot to be cleared (closes #1469629)
Patch from Armin, test from me.
2012-03-07 18:41:11 -06:00
Benjamin Peterson 099a78fe6d make delegating generators say they running (closes #14220) 2012-03-07 17:57:04 -06:00
Benjamin Peterson 33d21a24fa merge 3.2 (#14212) 2012-03-07 14:59:13 -06:00
Benjamin Peterson e48944b69c keep the buffer object around while we're using it (closes #14212) 2012-03-07 14:50:25 -06:00
Antoine Pitrou 5bb9a8f237 Remove a couple of local imports. 2012-03-06 13:43:24 +01:00
Antoine Pitrou 6c64cc1973 Reap processes at test end to avoid false positives in reference leak detection. 2012-03-06 13:42:35 +01:00
Victor Stinner b1f7f6343b test_pty: fix ResourceWarning warnings 2012-03-06 02:04:58 +01:00
Victor Stinner 198b291df7 Close #14205: dict lookup raises a RuntimeError if the dict is modified during
a lookup.

"if you want to make a sandbox on top of CPython, you have to fix segfaults"
so let's fix segfaults!
2012-03-06 01:03:13 +01:00
Vinay Sajip b2fcd3a989 Added delay before record creation. 2012-03-05 20:02:53 +00:00
Antoine Pitrou bdb1cf1ca5 Issue #12328: Fix multiprocessing's use of overlapped I/O on Windows.
Also, add a multiprocessing.connection.wait(rlist, timeout=None) function
for polling multiple objects at once.  Patch by sbt.

Complete changelist from sbt's patch:

* Adds a wait(rlist, timeout=None) function for polling multiple
  objects at once.  On Unix this is just a wrapper for
  select(rlist, [], [], timeout=None).

* Removes use of the SentinelReady exception and the sentinels argument
  to certain methods.  concurrent.futures.process has been changed to
  use wait() instead of SentinelReady.

* Fixes bugs concerning PipeConnection.poll() and messages of zero
  length.

* Fixes PipeListener.accept() to call ConnectNamedPipe() with
  overlapped=True.

* Fixes Queue.empty() and SimpleQueue.empty() so that they are
  threadsafe on Windows.

* Now PipeConnection.poll() and wait() will not modify the pipe except
  possibly by consuming a zero length message.  (Previously poll()
  could consume a partial message.)

* All of multiprocesing's pipe related blocking functions/methods are
  now interruptible by SIGINT on Windows.
2012-03-05 19:28:37 +01:00