Commit graph

15435 commits

Author SHA1 Message Date
Antoine Pitrou
972ee13e03 Issue #5506: BytesIO objects now have a getbuffer() method exporting a
view of their contents without duplicating them.  The view is both readable
and writable.
2010-09-06 18:48:21 +00:00
Brian Curtin
6285774f06 Implement #7566 - os.path.sameopenfile for Windows.
This uses the GetFileInformationByHandle function to return a tuple of values
to identify a file, then ntpath.sameopenfile compares file tuples, which
is exposed as os.path.sameopenfile.
2010-09-06 17:07:27 +00:00
Brian Curtin
5c997b8d90 Fix #8956. ValueError message was only mentioning one signal.
Rather than list out the three signals (or more over time), the message was
made less specific but still descriptive.
2010-09-06 16:29:29 +00:00
Brian Curtin
c734b312cb Clean up the fix to #9324 with some of the suggestions raised on python-dev
in response to the original checkin.

Move the validation from the original loop into a switch statement,
and adjust a platform check in the tests.
2010-09-06 16:04:10 +00:00
Gregory P. Smith
13b55291ac hashlib has two new constant attributes: algorithms_guaranteed and
algorithms_avaiable that respectively list the names of hash algorithms
guaranteed to exist in all Python implementations and the names of hash
algorithms available in the current process.

Renames the attribute new in 3.2a0 'algorithms' to 'algorithms_guaranteed'.
2010-09-06 08:30:23 +00:00
Raymond Hettinger
d5825ccd40 Take advantage of the frozenset constant optimization. 2010-09-05 23:15:06 +00:00
Antoine Pitrou
0d739d7047 Issue #9293: I/O streams now raise io.UnsupportedOperation when an
unsupported operation is attempted (for example, writing to a file open
only for reading).
2010-09-05 23:01:12 +00:00
Éric Araujo
1138eba3df Fix accidental suppression in r84537 2010-09-05 18:59:49 +00:00
Éric Araujo
23eae8646c Make naming consistent 2010-09-05 18:43:07 +00:00
Georg Brandl
58a7b46075 Bump to 3.2a2. 2010-09-05 08:30:40 +00:00
Georg Brandl
bef3db2368 Update pydoc topics. 2010-09-05 08:28:41 +00:00
Raymond Hettinger
4c7c9af542 Clean-up functools.total_ordering(). 2010-09-05 05:57:35 +00:00
Raymond Hettinger
02566ec89f Adopt more descriptive attribute names as suggested on python-dev. 2010-09-04 22:46:06 +00:00
Antoine Pitrou
0049249d63 Issue #8734: Avoid crash in msvcrt.get_osfhandle() when an invalid file
descriptor is provided.  Patch by Pascal Chambon.
2010-09-04 20:53:29 +00:00
Antoine Pitrou
7d6e076f6d Issue #7451: Improve decoding performance of JSON objects, and reduce
the memory consumption of said decoded objects when they use the same
strings as keys.
2010-09-04 20:16:53 +00:00
Antoine Pitrou
d9107aaded Issue #9777: test_idna requires the "network" resource 2010-09-04 18:50:35 +00:00
Antoine Pitrou
74a69fa662 Issue #9225: Remove the ROT_FOUR and DUP_TOPX opcode, the latter replaced
by the new (and simpler) DUP_TOP_TWO.  Performance isn't changed, but
our bytecode is a bit simplified.  Patch by Demur Rumed.
2010-09-04 18:43:52 +00:00
Brett Cannon
ef0e6c3b04 _warnings exposed two variables with the name 'default_action' and
'once_registry'. This is bad as the warnings module had variables named
'defaultaction' and 'onceregistry' which are what people should be looking at
(technically those variables shouldn't be mucked with as they are undocumented,
but we all know better than to believe that isn't happening). So the variables
from _warnings have been renamed to come off as private and to avoid confusion
over what variable should be used.

Closes issue #9766. Thanks to Antoine Pitrou for the discovery.
2010-09-04 18:24:04 +00:00
Antoine Pitrou
d6399d2d19 Fix running the copy module from the command-line (however use{ful,less} it may be). 2010-09-04 17:46:44 +00:00
Antoine Pitrou
3941a8fece Issue #1100562: Fix deep-copying of objects derived from the list and dict types.
Patch by Michele Orrù and Björn Lindqvist.
2010-09-04 17:40:21 +00:00
Antoine Pitrou
e5a9101519 Issue #9581: Fix non-working PosixGroupsTester test case
(it only runs as root, which is why nobody bothered about the failure)
2010-09-04 17:32:06 +00:00
Fred Drake
cc645b9a59 add consistent support for the vars and default arguments on all
configuration parser classes
(http://bugs.python.org/issue9421)
2010-09-04 04:35:34 +00:00
Florent Xicluna
edf5f0ddc0 Strengthen BytesWarning tests. 2010-09-03 20:00:37 +00:00
Florent Xicluna
764d612f5e Remove redundant context manager. 2010-09-03 19:55:26 +00:00
Florent Xicluna
43e4ea1b17 Remove unused import, fix typo and rewrap docstrings. 2010-09-03 19:54:02 +00:00
Florent Xicluna
7dde792e62 Use a context manager for some file objects. 2010-09-03 19:52:03 +00:00
Antoine Pitrou
24e561ae04 Issue #3805: clean up implementation of the _read method in _ssl.c. 2010-09-03 18:38:17 +00:00
Barry Warsaw
35f3a2cbeb PEP 3149 is accepted.
http://mail.python.org/pipermail/python-dev/2010-September/103408.html
2010-09-03 18:30:30 +00:00
Daniel Stutzbach
06a3c8ae82 fromfd exists on Windows now 2010-09-03 11:11:43 +00:00
Raymond Hettinger
faf7b7f4ec Issue 8420: Fix obscure set crashers. 2010-09-03 10:00:50 +00:00
Fred Drake
8844441ae6 fix output from RawConfigParser.write and ConfigParser.write for None
values (http://bugs.python.org/issue7005)
(merged r84443 from the release27-mmaint branch, with changes to reflect
changes in Python 3)
2010-09-03 04:22:36 +00:00
Raymond Hettinger
af1e140334 Readability nit. 2010-09-02 19:58:35 +00:00
Raymond Hettinger
7babc1b6a5 Better method name. Tighten inner-loop with bound methods. 2010-09-02 19:56:28 +00:00
Raymond Hettinger
331722d411 Make OrderedDict.popitem() a bit smarter and faster 2010-09-02 18:44:16 +00:00
Daniel Stutzbach
045b3ba184 Issue #9212: Added the missing isdisjoint method to the dict_keys and
dict_items views.  The method is required by the collections.Set ABC,
which the views register as supporting.
2010-09-02 15:06:06 +00:00
Raymond Hettinger
38d17e3df0 Speed-up cache updates 2010-09-02 09:44:28 +00:00
Antoine Pitrou
e0793ba992 Issue #9737: Fix a crash when trying to delete a slice or an item from
a memoryview object.
2010-09-01 21:14:16 +00:00
Antoine Pitrou
1ce3eb5c5b Issue #8990: array.fromstring() and array.tostring() get renamed to
frombytes() and tobytes(), respectively, to avoid confusion.  Furthermore,
array.frombytes(), array.extend() as well as the array.array()
constructor now accept bytearray objects.  Patch by Thomas Jollans.
2010-09-01 20:29:34 +00:00
Antoine Pitrou
fce7fd6426 Issue #9549: sys.setdefaultencoding() and PyUnicode_SetDefaultEncoding()
are now removed, since their effect was inexistent in 3.x (the default
encoding is hardcoded to utf-8 and cannot be changed).
2010-09-01 18:54:56 +00:00
Benjamin Peterson
49203dc9f2 reformat comment 2010-08-31 20:10:55 +00:00
Daniel Stutzbach
19d6a4fd49 Issue #808164: Fixed socket.close to avoid references to globals, to
avoid issues when socket.close is called from a __del__ method.
2010-08-31 20:08:07 +00:00
Daniel Stutzbach
061b14a4a1 Reverted r84315 and r84316, with Benjamin's blessing. The tests were
fine.  They were failing due to a problem exposed in r84307 and fixed
in r84317.   See Issue 8781 for details.
2010-08-31 15:45:04 +00:00
Vinay Sajip
dc5097ff07 Removed _unicode variable which is always False in Python 3.x. 2010-08-31 07:52:17 +00:00
Vinay Sajip
ec1cd1c475 logging: merged duplicated code in fileConfig and dictConfig paths. 2010-08-30 19:02:14 +00:00
Vinay Sajip
609364a989 Logging: removed some old commented out code. 2010-08-30 18:31:13 +00:00
Giampaolo Rodolà
8b7da623ce Fix issue #9711: raise ValueError is SSLConnection constructor is invoked with keyfile and not certfile. 2010-08-30 18:28:05 +00:00
Vinay Sajip
40d9a4e854 Improved logging.Formatter date/time formatting documentation. 2010-08-30 18:10:03 +00:00
Benjamin Peterson
33856de84d handle names starting with non-ascii characters correctly #9712 2010-08-30 14:41:20 +00:00
Florent Xicluna
e01de8f2f3 remove pointless coding cookies 2010-08-30 14:05:50 +00:00
Benjamin Peterson
e992a7da01 remove pointless coding cookie 2010-08-30 13:57:28 +00:00