Commit graph

15763 commits

Author SHA1 Message Date
Georg Brandl
1e908af335 #6518: enable context manager protocol for ossaudiodev types. 2010-10-23 17:31:52 +00:00
Antoine Pitrou
1cae8b58eb Also guard other SOCK_NONBLOCK test 2010-10-23 17:05:13 +00:00
Victor Stinner
75d8c5cea2 Issue #6011: sysconfig and distutils.sysconfig use the surrogateescape error
handler to parse the Makefile file. Avoid a UnicodeDecodeError if the source
code directory name contains a non-ASCII character and the locale encoding is
ASCII.
2010-10-23 17:02:31 +00:00
Antoine Pitrou
acd0fda1a4 Fix SOCK_CLOEXEC and SOCK_NONBLOCK tests on recent glibcs with old Linux kernels. 2010-10-23 17:01:44 +00:00
Victor Stinner
2b9af63b4f Try to fix test_tarfile on AMD64 debian parallel 3.x
tarinfo.mtime is an int, whereas getmtime() is a float and it might be
different by something like 3 µs.
2010-10-23 01:15:30 +00:00
Antoine Pitrou
ff150f2921 Revert r85797 (and r85798): it broke the Windows buildbots because of
test_multiprocessing's misbehaviour.
2010-10-22 21:41:05 +00:00
Antoine Pitrou
7eecffd05d Issue #9935: Speed up pickling of instances of user-defined classes. 2010-10-22 19:43:59 +00:00
Antoine Pitrou
eb585adbde Fix test_ssl on Ubuntu buildbot with patched OpenSSL 2010-10-22 18:24:20 +00:00
Antoine Pitrou
d532321f7b Issue #5639: Add a *server_hostname* argument to SSLContext.wrap_socket
in order to support the TLS SNI extension.  `HTTPSConnection` and
`urlopen()` also use this argument, so that HTTPS virtual hosts are now
supported.
2010-10-22 18:19:07 +00:00
Barry Warsaw
4ebfdf01bb Only hack cmd.library_dirs when running under Py_ENABLE_SHARED. Tested both
with and without --enable-shared on Ubuntu 10.10.  Hopefully this finally
solves bug 10126.  Will check 3.1 next.
2010-10-22 17:17:51 +00:00
Georg Brandl
9a8439d3e9 Refactor interesting use of try-finally. 2010-10-22 06:35:59 +00:00
Georg Brandl
eb7e56922e Make top_level attribute a set instead of a dict with None values. 2010-10-22 06:29:21 +00:00
Georg Brandl
83938437cb #10166: rewrite self-recursion to iteration in pstats.Stats.add(). Also add a unittest and a stats test file. 2010-10-22 06:28:01 +00:00
Éric Araujo
68fc9aa318 Apply fix from r85784 on py3k too.
Fixes bug #10126 for Python 3.2 by using $RUNSHARED to find the
directory to the shared library.  test_distutils now passes when
Python was built with --enable-shared (Barry didn’t have the error
but I did).
2010-10-21 23:02:07 +00:00
Brian Curtin
6ce1daedc3 Fix r85774 editor fail. Had a dangling try and incorrect indent. 2010-10-21 14:45:01 +00:00
Brian Curtin
000f974b44 Fix #10162: Add try/except around _winreg.OpenKey for keys that are
unreadable by all users, e.g., Flash, Silverlight, and Java keys were
causing errors.

We don't currently have a way to grant/deny permissions for a key
via winreg so there are no tests for this.
2010-10-21 14:11:48 +00:00
Antoine Pitrou
9583cac633 Issue #10089: Add support for arbitrary -X options on the command-line.
They can be retrieved through a new attribute `sys._xoptions`.
2010-10-21 13:42:28 +00:00
Georg Brandl
50de5f56a9 #10159: sort completion matches before comparing to dir() result. 2010-10-21 07:40:03 +00:00
Victor Stinner
f933e1ab6f Issue #4388: On Mac OS X, decode command line arguments from UTF-8, instead of
the locale encoding. If the LANG (and LC_ALL and LC_CTYPE) environment variable
is not set, the locale encoding is ISO-8859-1, whereas most programs (including
Python) expect UTF-8. Python already uses UTF-8 for the filesystem encoding and
to encode command line arguments on this OS.
2010-10-20 22:58:25 +00:00
Victor Stinner
073f759d65 Move non-ascii test from test_run_code() to a new function: test_non_ascii() 2010-10-20 21:56:55 +00:00
Victor Stinner
f6211eda71 Move test_undecodable_code() from test_sys to test_cmd_line 2010-10-20 21:52:33 +00:00
Victor Stinner
6722b5f7f1 test_zipimport_support: use ascii() on bytes output to avoid BytesWarning
The test failed with python -bb.
2010-10-20 21:48:35 +00:00
Vinay Sajip
2a20dfc2aa logging: Made StreamHandler terminator configurable. 2010-10-20 20:05:38 +00:00
Georg Brandl
9450cc056a Fix r85728: use "" to mean the system default locale, which should work on more systems. 2010-10-20 06:50:19 +00:00
Vinay Sajip
fc082cafa6 logging: Documented usage of callables as filters. 2010-10-19 21:13:49 +00:00
Vinay Sajip
6dbed2e8b3 logging: Allowed filters to be just callables. 2010-10-19 20:53:01 +00:00
Vinay Sajip
6fac817136 logging: Added tests for _logRecordClass changes. 2010-10-19 20:44:14 +00:00
Georg Brandl
7004bd1a3d #10092: Properly reset locale in Locale*Calendar classes. The context manager was buggy because setlocale() returns the *new* locale, not the old. Also add a test for this. 2010-10-19 18:54:25 +00:00
Alexander Belopolsky
f87cc04481 Fixed the docstring for calendar.isleap() function.
Thanks Boštjan Mejak for the patch.
2010-10-19 17:43:50 +00:00
Vinay Sajip
062d56b1f0 logging: Added _logRecordClass, getLogRecordClass, setLogRecordClass to increase flexibility of LogRecord creation. 2010-10-19 15:26:24 +00:00
Victor Stinner
9a90900da5 PyUnicode_FromFormatV(): Fix %A format
It was not completly implemented. Add a test.
2010-10-18 20:59:24 +00:00
Alexander Belopolsky
eebccfb10c Reverted inadvertent change that slipped into r85695 2010-10-18 15:11:33 +00:00
Alexander Belopolsky
4a98e3b6d0 Issue #10117: Tools/scripts/reindent.py now accepts source files that
use encoding other than ASCII or UTF-8.  Source encoding is preserved
when reindented code is written to a file.
2010-10-18 14:43:38 +00:00
Hirokazu Yamamoto
b08820ad40 Issue #5117: Case normalization was needed on ntpath.relpath(). And
fixed root directory issue on posixpath.relpath(). (Ported working fixes
from ntpath)
2010-10-18 12:13:18 +00:00
R. David Murray
a90032a3fb #1343: Add short_empty_elements option to XMLGenerator.
Patch and tests by Neil Muller.
2010-10-17 22:46:45 +00:00
Victor Stinner
6fb457526c test_httpservers: Python CGI scripts have to be encoded to utf-8
And not the locale encoding. With this commit, the test finally pass on Windows
with a non-ascii path :-)
2010-10-17 20:17:41 +00:00
Victor Stinner
3218c31429 test_httpservers: Fix skip test check, the python executable path have to be
encodable to utf-8, not to the file1 encoding.
2010-10-17 20:13:36 +00:00
Victor Stinner
0b0ca0c37e test_httpservers: skip CGI tests if Python executable path is not encodable 2010-10-17 19:46:36 +00:00
Senthil Kumaran
ee2538beef Fix Issue10119 - test_urllibnet failure when using support.transient_internet. 2010-10-17 10:52:12 +00:00
Gregory P. Smith
feedda2bab Avoid hanging the test on netbsd5. 2010-10-17 03:09:12 +00:00
Gregory P. Smith
0f61dd0787 skip test_itimer_virtual on NetBSD to prevent the test suite from hanging. 2010-10-17 02:57:19 +00:00
Victor Stinner
e3874ed7dd test_cmd_line_script: format paths with ascii() instead of repr()
Fix the test if the native filesystem encoding is not utf-8 (eg. cp1250 on
Windows).
2010-10-17 01:41:09 +00:00
Benjamin Peterson
ca9f128583 use assertion methods 2010-10-17 01:30:26 +00:00
Benjamin Peterson
cb17094dcd disable the garbage collector while collecting traces, so that __del__s don't get caught 2010-10-17 01:29:11 +00:00
Benjamin Peterson
fc49f2a973 remove rather pointless test 2010-10-17 01:25:19 +00:00
Gregory P. Smith
b603d03f15 fix for netbsd. 2010-10-17 00:17:24 +00:00
Victor Stinner
f6782ac0b6 test_subprocess: use surrogateescape error handler to write shell scripts
test_args_string() and test_call_string() create shell scripts including the
path to the Python executable: use surrogateescape to encode paths including
surrogate characters.
2010-10-16 23:46:43 +00:00
Victor Stinner
9d396399da Issue #10123: Don't use non-ascii filenames in test_doctest tests. Add a
new test specific to unicode (non-ascii name and filename).
2010-10-16 21:54:59 +00:00
Benjamin Peterson
230b20684f don't identify the toplevel namespace by name #9997 2010-10-16 03:45:45 +00:00
Barry Warsaw
8cf4eae522 First (uncontroversial) part of issue 9807.
* Expose the build flags to Python as sys.abiflags
* Shared library libpythonX.Y<abiflags>.so
* python-config --abiflags
* Make two distutils tests that failed with --enable-shared (even before this
  patch) succeed.
* Fix a few small style issues.
2010-10-16 01:04:07 +00:00