Commit Graph

21229 Commits

Author SHA1 Message Date
Christian Heimes 6cea65555c Issue #15061: Re-implemented hmac.compare_digest() in C 2012-06-24 13:48:32 +02:00
Larry Hastings 605a62ddb1 Issue #15118: Change return value of os.uname() and os.times() from
plain tuples to immutable iterable objects with named attributes
(structseq objects).
2012-06-24 04:33:36 -07:00
Georg Brandl 306336bcda Closes #15161: add support for giving path as a fd for truncate() and pathconf(). 2012-06-24 12:55:33 +02:00
Mark Dickinson 95aeae01e2 In random's test_seedargs: Make sure to include at least one seed object with a negative hash. 2012-06-24 11:05:30 +01:00
Vinay Sajip 6aed5fe532 Closes #15157: pydoc script added to venvs. 2012-06-24 10:35:40 +01:00
R David Murray 97f43c019f #15160: Extend the new email parser to handle MIME headers.
This code passes all the same tests that the existing RFC mime header
parser passes, plus a bunch of additional ones.

There are a couple of commented out tests where there are issues with the
folding.  The folding doesn't normally get invoked for headers parsed from
source, and the cases are marginal anyway (headers with invalid binary data)
so I'm not worried about them, but will fix them after the beta.

There are things that can be done to make this API even more convenient, but I
think this is a solid foundation worth having.  And the parser is a full RFC
parser, so it handles cases that the current parser doesn't.  (There are also
probably cases where it fails when the current parser doesn't, but I haven't
found them yet ;)

Oh, yeah, and there are some really ugly bits in the parser for handling some
'postel' cases that are unfortunately common.

I hope/plan to to eventually refactor a lot of the code in the parser which
should reduce the line count...but there is no escaping the fact that the
error recovery is welter of special cases.
2012-06-24 05:03:27 -04:00
Hynek Schlawack f841e42a98 Fix whitespace 2012-06-24 09:51:46 +02:00
Éric Araujo ec177c14d3 Packaging removal: also revert introduction of sysconfig.cfg.
We need a discussion to define what should be customized how; this new
config file is premature.  It was added to serve the needs of the
resources system in install_data / packaging.database, so it can be
removed alongside packaging for 3.3.
2012-06-24 03:27:43 -04:00
Gregory P. Smith 853ef47522 merge heads 2012-06-24 00:24:31 -07:00
Gregory P. Smith 990a5feba7 Fixes issue #12268: File readline, readlines and read() or readall() methods
no longer lose data when an underlying read system call is interrupted.
IOError is no longer raised due to a read system call returning EINTR
from within these methods.
2012-06-24 00:23:47 -07:00
Gregory P. Smith 5135992164 Fixes issue #12268: File readline, readlines and read() or readall() methods
no longer lose data when an underlying read system call is interrupted.
IOError is no longer raised due to a read system call returning EINTR
from within these methods.
2012-06-23 23:55:39 -07:00
Gregory P. Smith 8150492f11 Speed up test_io by >2x by reducing the sleep time using setitimer instead of
alarm for the signal tests.
2012-06-23 23:46:37 -07:00
Éric Araujo 859aad6a36 Remove packaging from the standard library.
Distutils2 will live on on PyPI and be included in the stdlib when it
is ready.  See discussion starting at
http://mail.python.org/pipermail/python-dev/2012-June/120430.html
2012-06-24 00:07:41 -04:00
Ezio Melotti dc44f55cc9 #11113: add a new "html5" dictionary containing the named character references defined by the HTML5 standard and the equivalent Unicode character(s) to the html.entities module. 2012-06-24 04:37:41 +02:00
Larry Hastings b698d8e7e9 Issue #15154: Add "dir_fd" parameter to os.rmdir, remove "rmdir"
parameter from os.remove / os.unlink.
Patch written by Georg Brandl.  (I'm really looking forward to George
getting commit privileges so I don't have to keep doing checkins on his
behalf.)
2012-06-23 16:55:07 -07:00
Antoine Pitrou b7eb563a2a Errors in "client" methods in test_socket were ignored because of a bogus except clause.
(this could reveal test failures!)
2012-06-24 01:34:13 +02:00
Ned Deily cbfb9a56e6 Issue #13590: Improve support for OS X Xcode 4:
- Try to avoid building Python or extension modules with problematic
  llvm-gcc compiler.
- Since Xcode 4 removes ppc support, extension module builds now
  check for ppc compiler support and automatically remove ppc and
  ppc64 archs when not available.
- Since Xcode 4 no longer install SDKs in default locations,
  extension module builds now revert to using installed headers
  and libs if the SDK used to build the interpreter is not
  available.
- Update ./configure to use better defaults for universal builds;
  in particular, --enable-universalsdk=yes uses the Xcode default
  SDK and --with-universal-archs now defaults to "intel" if ppc
  not available.
2012-06-23 16:02:19 -07:00
Philip Jenvey 88bc0d2640 small refactor and PEP8 line width/docstring 2012-06-23 15:54:38 -07:00
Antoine Pitrou 110ee34e41 Lower test-skipping threshold in test_reprlib 2012-06-23 22:55:58 +02:00
Antoine Pitrou 4f6e3f74fc Avoid depending on directory iteration order in test_shutil 2012-06-23 22:05:11 +02:00
Antoine Pitrou f3a166d799 Add debug output to test_shutil 2012-06-23 21:32:36 +02:00
Antoine Pitrou 2f8a75c7a7 Proper cleanup in test_shutil, even in case of error. 2012-06-23 21:28:15 +02:00
Hynek Schlawack 2100b42317 #4489: Fix usage of fd-based functions to new api introduced earlier today
Also add an explicit test for safe implementation usage on supported platforms.

As a side effect, this commit adds a module-level attribute 'rmtree_is_safe'
which offers introspection whether the current rmtree implementation is safe
against symlink attacks.
2012-06-23 20:28:32 +02:00
Nick Coghlan 6c6e2545cb Properly test the various builtins lookup cases in inspect.getclosurevars 2012-06-23 20:07:39 +10:00
Hynek Schlawack 67be92bed4 #4489: Add a shutil.rmtree that isn't suspectible to symlink attacks
It is used automatically on platforms supporting the necessary os.openat() and
os.unlinkat() functions. Main code by Martin von Löwis.
2012-06-23 17:58:42 +02:00
Antoine Pitrou 46cb1ef457 Use non-deprecated speling. 2012-06-23 18:11:59 +02:00
Antoine Pitrou d4daa87129 Properly cleanup pep3147 modules in test_import 2012-06-23 18:09:55 +02:00
Antoine Pitrou 06e37587ff Try to further debug occasional buildbot failure 2012-06-23 17:27:56 +02:00
Antoine Pitrou 78157b3f6f On behalf of Nadeem Vawda: issue #10376: micro-optimize reading from a Zipfile.
(patch by Serhiy)
2012-06-23 16:44:48 +02:00
Ezio Melotti 3861d8b271 #15114: the strict mode of HTMLParser and the HTMLParseError exception are deprecated now that the parser is able to parse invalid markup. 2012-06-23 15:27:51 +02:00
Antoine Pitrou 463badf06c Issue #3665: \u and \U escapes are now supported in unicode regular expressions.
Patch by Serhiy Storchaka.
2012-06-23 13:29:19 +02:00
Nick Coghlan 04e2e3f231 Close #15153: Added inspect.getgeneratorlocals to simplify whitebox testing of generator state updates 2012-06-23 19:52:05 +10:00
Nick Coghlan 2f92e54507 Close #13062: Add inspect.getclosurevars to simplify testing stateful closures 2012-06-23 19:39:55 +10:00
Mark Dickinson be4fb69201 Issue #14742: test_unparse now only checks a limited number of files unless the 'cpu' resource is specified. 2012-06-23 09:27:47 +01:00
Brian Curtin dc00f1eba0 Fix #15148. Capitalize PATH, hopefully leading to less confusion 2012-06-22 22:49:12 -05:00
Brian Curtin 2193536e79 Fix #15148. Make the shutil.which docstring more thorough 2012-06-22 22:48:06 -05:00
Larry Hastings dbbc0c8bb3 Issue #14626: Fix buildbot issue on OpenIndiana 3.x machines. (Hopefully.) 2012-06-22 19:50:21 -07:00
Brian Curtin e3f3940fc3 file was the old arg name from an earlier patch. command matches the implementation 2012-06-22 21:14:34 -05:00
Alexander Belopolsky de74de5d5d Issue #15148: Fixed typos in shutil.which() docstring 2012-06-22 21:56:42 -04:00
Alexander Belopolsky 648921371e fixed whitespace 2012-06-22 21:10:50 -04:00
Alexander Belopolsky 8141cc7f88 Issues #11024: Fixes and additional tests for Time2Internaldate. 2012-06-22 21:03:39 -04:00
Jesus Cea 60c13ddd9b Skip the test only if neccesary - Kernel bug in freebsd9 - #10142: Support for SEEK_HOLE/SEEK_DATA 2012-06-23 02:58:14 +02:00
Jesus Cea 9d874866f7 Kernel bug in freebsd9 - #10142: Support for SEEK_HOLE/SEEK_DATA 2012-06-23 02:55:36 +02:00
Antoine Pitrou 310f95b04d A better repr() for FileFinder 2012-06-23 02:12:56 +02:00
Larry Hastings 90867a5aba Issue #14626: Fix buildbot issues on FreeBSD (AMD64). (Fingers crossed.) 2012-06-22 17:01:41 -07:00
Larry Hastings 9cf065cfdc Issue #14626: Large refactoring of functions / parameters in the os module.
Many functions now support "dir_fd" and "follow_symlinks" parameters;
some also support accepting an open file descriptor in place of of a path
string.  Added os.support_* collections as LBYL helpers.  Removed many
functions only previously seen in 3.3 alpha releases (often starting with
"f" or "l", or ending with "at").  Originally suggested by Serhiy Storchaka;
implemented by Larry Hastings.
2012-06-22 16:30:09 -07:00
Antoine Pitrou f0f4742b49 Fix silly mistake in debugging code 2012-06-23 00:49:44 +02:00
Larry Hastings 7c7cbfc00f Issue #15008: Implement PEP 362 "Signature Objects".
Patch by Yury Selivanov.
2012-06-22 15:19:35 -07:00
Guido van Rossum 8e0d25504c Merge 2012-06-22 15:18:38 -07:00
Guido van Rossum 95c1c48fd6 Speed up base64.urlsafe_{en,de}code(). 2012-06-22 15:16:09 -07:00