Commit graph

21084 commits

Author SHA1 Message Date
Victor Stinner
f86a5e8a93 Close #11022: TextIOWrapper doesn't call locale.setlocale() anymore
open() and io.TextIOWrapper are now calling locale.getpreferredencoding(False)
instead of locale.getpreferredencoding() in text mode if the encoding is not
specified. Don't change temporary the locale encoding using locale.setlocale(),
use the current locale encoding instead of the user preferred encoding.

Explain also in open() documentation that locale.getpreferredencoding(False) is
called if the encoding is not specified.
2012-06-05 13:43:22 +02:00
Hynek Schlawack
91c5a34613 #14814: ipaddress: refactor dup code, minor janitoring, bump coverage
- remove duplicate netmask/hostmask code
- make two ifs more pythonic
- remove packed property for networks
- some minor pep8 stuff
- Test coverage is now at 97%, the rest are mostly unreachable safeguards.
2012-06-05 11:55:58 +02:00
Victor Stinner
034d0aa217 Issue #14711: os.stat_float_times() has been deprecated. 2012-06-05 01:22:15 +02:00
Nadeem Vawda
e860404eb7 Add a function lzma.open(), to match gzip.open() and bz2.open(). 2012-06-04 23:38:12 +02:00
Nadeem Vawda
6cbb20cdf6 Allow LZMAFile to accept modes with a "b" suffix. 2012-06-04 23:36:24 +02:00
Nadeem Vawda
33c34da574 Simplify usage of LZMAFile's fileobj support, like with BZ2File. 2012-06-04 23:34:07 +02:00
Nadeem Vawda
af518c198e Add a function bz2.open(), to match gzip.open(). 2012-06-04 23:32:38 +02:00
Nadeem Vawda
50cb936bd0 Clarify acceptable values for BZ2File.__init__'s mode argument. 2012-06-04 23:31:22 +02:00
Nadeem Vawda
aebcdba829 Make BZ2File's fileobj support easier to use.
The fileobj argument was added during the 3.3 development cycle, so this change
does not break backward compatibility with 3.2.
2012-06-04 23:31:20 +02:00
Nadeem Vawda
68721019ef Add fileobj support to gzip.open(). 2012-06-04 23:21:38 +02:00
R David Murray
05cab75d59 #8739: fix omission of DEBUGSTREAM reset in new test in test_smtpd.
This clears up an error in detected by refleak mode that showed up when
test_smtplib was run after test_smtpd in the same refleak run.
2012-06-04 15:55:51 -04:00
Richard Oudkerk
bd7b5dd816 Prevent handle leak if CreateProcess() fails in multiprocessing 2012-06-04 18:59:10 +01:00
Richard Oudkerk
86eb7e97ae Fix potential NameError in multiprocessing.Condition.wait() 2012-06-04 18:59:07 +01:00
Richard Oudkerk
ad06444d6c Make Finalize reserve a reference to os.getpid in case called at shutdown 2012-06-04 18:58:59 +01:00
Hynek Schlawack
454a74df23 #14814: Remove dead code from ipaddress
_BaseNetwork contained (faulty) methods for creating string representations.
I've fixed them and put them to use by eliminating identical overrides.
2012-06-04 18:14:02 +02:00
Barry Warsaw
efce00c537 Whitespace normalization 2012-06-04 12:02:42 -04:00
Barry Warsaw
028b37c941 PEP 421 requires that .name be lower case. 2012-06-04 12:01:56 -04:00
Barry Warsaw
c58c392da7 Trunk merge. 2012-06-04 09:41:48 -04:00
Hynek Schlawack
bcd304480f #14814: Use correct comparison for IP addresses
ipaddress._BaseV4.is_unspecified() compared IP addresses using "in" which
fails.
2012-06-04 14:19:39 +02:00
Raymond Hettinger
0c9050c25d Separate key creation logic from the sequence class that memoizes its hash value. 2012-06-04 00:21:14 -07:00
Gregory P. Smith
f0a9a9b502 Fixes Issue #14992: os.makedirs(path, exist_ok=True) would raise an OSError
when the path existed and had the S_ISGID mode bit set when it was
not explicitly asked for.  This is no longer an exception as mkdir
cannot control if the OS sets that bit for it or not.
2012-06-03 14:35:09 -07:00
Gregory P. Smith
a81c856436 Fixes Issue #14992: os.makedirs(path, exist_ok=True) would raise an OSError
when the path existed and had the S_ISGID mode bit set when it was not
explicitly asked for.  This is no longer an exception as mkdir cannot control
if the OS sets that bit for it or not.
2012-06-03 14:30:44 -07:00
Barry Warsaw
409da157d7 Eric Snow's implementation of PEP 421.
Issue 14673: Add sys.implementation
2012-06-03 16:18:47 -04:00
R David Murray
82ffabdfa4 #2658: Add test for issue fixed by fix for #1079. 2012-06-03 12:27:07 -04:00
Martin v. Löwis
f20940792d merge 3.2 2012-06-03 12:33:23 +02:00
Martin v. Löwis
9f44a66abc PEP 3131: support non-ASCII characters in auto-completion of identifiers. 2012-06-03 12:32:42 +02:00
Martin v. Löwis
97aa21b46a Do not try to insert control characters. 2012-06-03 12:26:09 +02:00
Martin v. Löwis
428d161b57 Drop unused constant. 2012-06-03 12:03:29 +02:00
Martin v. Löwis
156989aa79 Merge 3.2: issue #14937. 2012-06-03 12:00:48 +02:00
Martin v. Löwis
862d13a30f Issue #14937: Perform auto-completion of filenames in strings even for non-ASCII filenames. 2012-06-03 11:55:32 +02:00
Senthil Kumaran
fe4dfd2b65 merge heads 2012-06-03 16:16:39 +08:00
Senthil Kumaran
1251fafcc5 Issue 14989: http.server --cgi option can enable the CGI http server. 2012-06-03 16:15:54 +08:00
Terry Jan Reedy
a317eef897 Merge with 3.2 #12510 2012-06-03 01:06:38 -04:00
Terry Jan Reedy
e606e238ab Issue 12510: Expand 2 bare excepts. Improve comments. Change deceptive name
'name' to 'expression' as the latter is what the string actually represents.
The bug in this issue was only catching NameError and AttributeError when
evaluating an expression that was not necessarily a name.
2012-06-03 00:27:54 -04:00
Brett Cannon
2b88fcf693 Issue #14987: Add a missing import statement 2012-06-02 22:28:42 -04:00
Terry Jan Reedy
361baaddcf Merge with 3.2 #10365 2012-06-02 20:24:21 -04:00
Terry Jan Reedy
a948c79ad4 Issue 10365: Add and replace comments; condense defaulted attribute access.
Code patch by Roger Serwy.
2012-06-02 20:22:58 -04:00
R David Murray
07ea53cb21 #1079: Fix parsing of encoded words.
This is a behavior change: before this leading and trailing spaces were
stripped from ASCII parts, now they are preserved.  Without this fix we didn't
parse the examples in the RFC correctly, so I think breaking backward
compatibility here is justified.

Patch by Ralf Schlatterbeck.
2012-06-02 17:56:49 -04:00
Sandro Tosi
e1b22edd23 Issue #14926: merge with 3.2 2012-06-02 19:40:20 +02:00
Sandro Tosi
29d09aa4dd Issue #14926: fix docstring highlight 2012-06-02 19:40:02 +02:00
Sandro Tosi
b4386d36f1 Issue #14814: minor spelling fixes 2012-06-02 17:14:22 +02:00
Victor Stinner
0dec1bfef9 Fix sporadic failure of test_time.test_process_time() on Windows
Use a threshold of 20 ms instead of 10 ms.
2012-06-01 22:45:23 +02:00
Hynek Schlawack
35db513187 #14814: Fix errror message creation in ipaddress.collapse_addresses 2012-06-01 20:12:17 +02:00
Nick Coghlan
77452fc121 Close #14969: Improve the handling of exception chaining in contextlib.ExitStack 2012-06-01 22:48:32 +10:00
Hynek Schlawack
c4b78a3e15 #14814: Remove 2.x's new-style classes syntax from ipaddress 2012-06-01 11:48:32 +02:00
Eli Bendersky
2b6b73e7e1 Issue #14007: implement doctype() method calling in XMLParser of _elementtree.
Includes exposing a doctype handler from expat through pyexpat.
2012-06-01 11:32:34 +03:00
Eli Bendersky
52467b167e Issue #14007: make XMLParser a real subclassable type exported from _elementtree. +cleanups 2012-06-01 07:13:08 +03:00
Hynek Schlawack
7e0229e90d #14814: Remove stale __hex__ method from ipaddress
Obsolete 2.x method.
2012-06-01 00:20:13 +02:00
R David Murray
1be413e366 Don't use metaclasses when class decorators can do the job.
Thanks to Nick Coghlan for pointing out that I'd forgotten about class
decorators.
2012-05-31 18:00:45 -04:00
Ned Deily
d3487be876 Issue #14962: merge 2012-05-31 09:58:08 -07:00