Benjamin Peterson
90b60a61d8
close the source's byte stream
2010-10-31 20:03:32 +00:00
Benjamin Peterson
1bd93a754f
fix ftplib resource warnings
2010-10-31 19:58:07 +00:00
Benjamin Peterson
d5df36d378
fix resource warnings in test_sax #10269
2010-10-31 18:23:23 +00:00
Benjamin Peterson
a807137c39
wrap some things in with blocks
2010-10-31 18:21:16 +00:00
Benjamin Peterson
2d8c917f30
more fun with string exceptions
2010-10-31 18:13:04 +00:00
Benjamin Peterson
959516615c
string exceptions; how quaint
2010-10-31 17:59:20 +00:00
Raymond Hettinger
189316a2e3
Issue 10110: Let Queue.put recognize a full queue when the maxsize parameter has been reduced.
2010-10-31 17:57:52 +00:00
Benjamin Peterson
d285bdb443
start banging on zipfile's file leakiness
2010-10-31 17:57:22 +00:00
Benjamin Peterson
d6868b4ed4
fix leaking sockets
2010-10-31 17:34:34 +00:00
Benjamin Peterson
d094efd8b7
cleanup resources in test_smtplib #10264
2010-10-31 17:15:42 +00:00
Antoine Pitrou
f569826f06
Issue #10266 : uu.decode didn't close in_file explicitly when it was given
...
as a filename. Patch by Brian Brazil.
2010-10-31 16:04:14 +00:00
Antoine Pitrou
e974571d36
Issue #10160 : Speed up operator.attrgetter. Patch by Christos Georgiou.
2010-10-31 15:26:04 +00:00
Vinay Sajip
c5b273011b
Added style argument to logging.basicConfig() and documented this change.
2010-10-31 14:59:16 +00:00
Antoine Pitrou
64474542eb
PY_CFLAGS doesn't exist under Windows
2010-10-31 11:34:47 +00:00
Raymond Hettinger
b643ef8f8e
Issue #5729 : json.dumps to support using '\t' as an indent string
2010-10-31 08:00:16 +00:00
Brian Curtin
6ff2a7d121
Fix a ResourceWarning for an unclosed socket.
2010-10-31 04:40:53 +00:00
Kristján Valur Jónsson
f53a626073
issue 10237
...
After increasing the default timeout for the barrier, the unittest for the default timeout must be adjusted
2010-10-31 03:00:57 +00:00
Benjamin Peterson
cc221b2411
close some more files
2010-10-31 02:06:21 +00:00
Benjamin Peterson
5dc8fabb01
context managerify
2010-10-31 01:44:49 +00:00
Benjamin Peterson
aa7cec0ac4
close file properly
2010-10-31 01:35:53 +00:00
Benjamin Peterson
556c7355dd
use addCleanup
2010-10-31 01:35:43 +00:00
Benjamin Peterson
ebe5d8ae3b
patch up leaking fds
2010-10-31 01:30:11 +00:00
Benjamin Peterson
d8fc2e1aeb
this test manages the fds itself
2010-10-31 01:19:53 +00:00
Brian Curtin
bf0757137f
Fix ResourceWarning for unclosed files (from os.popen)
2010-10-31 01:10:58 +00:00
Brian Curtin
61d0d60e13
Fix ResourceWarning for an unclosed socket.
...
test_return_header_keep_alive - Added a cleanup call for the socket.
2010-10-31 00:34:23 +00:00
Brian Curtin
076623bf0a
Fix ResourceWarning. Use context manager to properly close file.
2010-10-31 00:03:45 +00:00
Brian Curtin
3ddcaafbbf
Fix ResourceWarning about unclosed file
2010-10-30 23:56:45 +00:00
Benjamin Peterson
b2fda23922
close files correctly
2010-10-30 23:51:34 +00:00
Benjamin Peterson
e048797991
close open file from find_module()
2010-10-30 23:06:57 +00:00
Benjamin Peterson
1c87e2943a
condense
2010-10-30 23:04:49 +00:00
Benjamin Peterson
0bbf9c99d6
kill pointless function imports
2010-10-30 23:01:58 +00:00
Benjamin Peterson
1a7127f6df
remove useless assignment
2010-10-30 23:00:54 +00:00
Benjamin Peterson
807a5a1652
close files properly
2010-10-30 22:59:37 +00:00
Brian Curtin
9f5f65c736
Fix #10258 - clean up resource warning
2010-10-30 21:35:28 +00:00
Brian Curtin
810921b675
Fix #10257 . Clear resource warnings by using os.popen's context manager.
2010-10-30 21:24:21 +00:00
Brian Curtin
1d7878a696
Fix #10256 - resource warning
2010-10-30 21:03:18 +00:00
Antoine Pitrou
b6751dcff2
Issue #10250 : fix resource warnings in test_urllib2_localnet. Patch by Brian Brazil.
2010-10-30 17:33:22 +00:00
Antoine Pitrou
8d2b51b46a
Issue #10253 : FileIO leaks a file descriptor when trying to open a file
...
for append that isn't seekable. Patch by Brian Brazil.
2010-10-30 16:19:14 +00:00
Georg Brandl
6ce29fa7a8
Fix test_mailbox by supporting context manager protocol for get_file() returns.
2010-10-30 14:33:28 +00:00
Antoine Pitrou
849e12bfe9
Fix resource warning in test_unicodedata. Patch by Brian Brazil.
2010-10-30 14:24:33 +00:00
Antoine Pitrou
a6e9502ab9
Fix resource warning in test_file. Patch by Brian Brazil.
2010-10-30 14:22:43 +00:00
Antoine Pitrou
bfa3470b85
Issue #10246 : uu.encode didn't close file objects explicitly when filenames
...
were given to it. Patch by Brian Brazil.
2010-10-30 13:03:56 +00:00
Vinay Sajip
b046b807fa
Remove ResourceWarnings caused by files left open.
2010-10-30 09:50:18 +00:00
Georg Brandl
cc2adbc693
#10198 : fix duplicate header when writeframes() is called with an empty string.
2010-10-30 08:29:28 +00:00
Kristján Valur Jónsson
6b6dffdc73
issue 10237
...
Increase the default timout of the barries used in the barrier tests. This should solve unexpected timeouts on some machines.
2010-10-30 05:15:42 +00:00
Brett Cannon
028011f9f0
Silence ResourceWarnings in modulefinder by using file context managers.
2010-10-30 00:26:48 +00:00
Brett Cannon
c524692c88
Properly close a file in test_minidom.
2010-10-30 00:14:59 +00:00
Brett Cannon
653238a88d
Silence some ResourceWarning in test_mailbox by using file context managers.
...
Also call super().tearDown() where appropriate.
2010-10-30 00:13:00 +00:00
Antoine Pitrou
d05f9ad302
Windows can't remove a file before it is closed
2010-10-29 23:55:55 +00:00
Brett Cannon
0174368449
Move test_linecache over to file context managers.
2010-10-29 23:55:51 +00:00
Brett Cannon
dff69853af
Use a file context manager for test_ioctl.
2010-10-29 23:54:28 +00:00
Brett Cannon
5a9e91b050
Silence ResourceWarning when testing that the file destructor closes the file.
2010-10-29 23:53:03 +00:00
Antoine Pitrou
e1eca4e3f5
Issue #10233 : Close file objects in a timely manner in the tarfile module
...
and its test suite.
2010-10-29 23:49:49 +00:00
Brett Cannon
749afa95ce
Move test_imp over to file context managers.
2010-10-29 23:47:23 +00:00
Brett Cannon
105df5d75b
Move test_httpservers over to file context managers.
2010-10-29 23:43:42 +00:00
Antoine Pitrou
d2eca37cc5
Clean up socket closing in test_ssl and test.ssl_servers
2010-10-29 23:41:37 +00:00
Brett Cannon
77b7de6d18
Move test_httplib over to file context managers.
2010-10-29 23:31:11 +00:00
Brett Cannon
7f462fc835
Fix file closing in test_http_cookiejar.
2010-10-29 23:27:39 +00:00
Brett Cannon
918e2d4832
Clean up socket closing in test_ftplib.
2010-10-29 23:26:25 +00:00
Brett Cannon
384917a922
Properly close files used by test_email.
2010-10-29 23:08:36 +00:00
Brett Cannon
06407b35b1
Properly close a temporary TextIOWrapper in 'email'.
2010-10-29 23:08:13 +00:00
Brett Cannon
c0eee315f5
Properly close files in test_dbm_dumb.
2010-10-29 22:49:14 +00:00
Brett Cannon
5ede149342
Properly close a test file in test_cprofile.
2010-10-29 22:47:04 +00:00
Brett Cannon
2d562f8081
have test_asyncore properly close files.
2010-10-29 22:40:44 +00:00
Brett Cannon
1ab58dfb12
Have pkgutil properly close files.
2010-10-29 22:36:53 +00:00
Brett Cannon
5c035c0949
Have distutils.sysconfig close a file to remove ResourceWarnings coming up
...
during the build from setup.py.
2010-10-29 22:36:08 +00:00
Benjamin Peterson
54ad0beae0
set literals and unions are our friends
2010-10-29 21:33:10 +00:00
Benjamin Peterson
65c66ab255
make gdb skip expected
2010-10-29 21:31:35 +00:00
Antoine Pitrou
2b40efdfe8
Fix typo
2010-10-29 19:36:37 +00:00
Antoine Pitrou
c14efc4e80
Make a GC run before trying to clean up files left over by
...
the latest test run.
2010-10-29 19:34:45 +00:00
Antoine Pitrou
83432babfd
Issue #7547 : fix transient failures due to network glitches in test_timeout.
...
Patch by Sandro Tosi.
2010-10-29 18:15:33 +00:00
Alexander Belopolsky
3cdfb12360
Issue 7061: Explained 'gon'
2010-10-29 17:16:49 +00:00
Antoine Pitrou
aa8796598a
Actually restore the original asyncore socket map by making a copy of the dict
2010-10-29 11:54:38 +00:00
Antoine Pitrou
31e08a4df6
Make check_warnings error messages more informative
2010-10-29 11:54:03 +00:00
Antoine Pitrou
a0d2f4def9
test___all__ ignores ResourceWarning as well
2010-10-29 11:53:34 +00:00
Antoine Pitrou
5efe9d0865
Fix ResourceWarning in Lib/test/threaded_import_hangers.py
2010-10-29 11:08:32 +00:00
Victor Stinner
14d8fe7de8
test_tarfile: woops, remove +0.001 which was used to debug
2010-10-29 11:02:06 +00:00
Victor Stinner
26bfb5ab82
test_tarfile: dump mtime as hexadecimal on test_extractall failure
2010-10-29 10:59:08 +00:00
Antoine Pitrou
e033e06db0
Issue #10093 : ResourceWarnings are now issued when files and sockets are
...
deallocated without explicit closing. These warnings are silenced by
default, except in pydebug mode.
2010-10-29 10:38:18 +00:00
Lars Gustäbel
9cbdd75ec5
Add read support for all missing variants of the GNU sparse
...
extensions. Thus, in addition to GNUTYPE_SPARSE headers, sparse
information in pax headers created by GNU tar can now be decoded.
All three formats 0.0, 0.1 and 1.0 are supported.
On filesystems that support this, holes in files are now restored
whenever a sparse member is extracted.
2010-10-29 09:08:19 +00:00
Benjamin Peterson
a95e977e41
decrement offset when it points to a newline ( #10186 followup)
2010-10-29 03:28:14 +00:00
Victor Stinner
6f35eda4d9
Issue #10210 : os.get_exec_path() ignores BytesWarning warnings
2010-10-29 00:38:58 +00:00
Victor Stinner
bfd7b265b6
#10209 , test_pep277: disable test_normalize and test_listdir on darwin
...
These tests are irrevelant on this OS.
2010-10-28 23:14:45 +00:00
Victor Stinner
fc6f5a4020
test_pep277: disable filenames 11, 12, 13, 14 on darwin
...
Because darwin "normalizes" these filenames differently than Python's NFD
normalization.
2010-10-28 22:57:03 +00:00
Antoine Pitrou
07e20ef50b
Issue #5437 : A preallocated MemoryError instance should not hold traceback
...
data (including local variables caught in the stack trace) alive infinitely.
2010-10-28 22:56:58 +00:00
Alexander Belopolsky
1842d0c4d8
Fixed a typo in a comment.
2010-10-28 20:13:52 +00:00
Georg Brandl
5be365f55d
#10116 : wrap transient_internet() around net access in test_urllib2net.
2010-10-28 14:55:02 +00:00
Éric Araujo
ae2d8320a5
Fix typo from r85874
2010-10-28 13:49:17 +00:00
Georg Brandl
2fa4cc55e9
Support new Condition return value in the multiprocessing version.
2010-10-28 13:01:06 +00:00
Victor Stinner
7362c4f311
test_pep277: add identifiers to filenames
2010-10-28 11:20:31 +00:00
Victor Stinner
7dae81b1ff
test_pep277: format filename with ascii() on failure
...
"%a" instead of "%r"
2010-10-28 11:11:24 +00:00
Victor Stinner
74ad75405c
test_pep277: format function argument with ascii() on failure
...
"%a" instead of "%r"
2010-10-28 11:09:09 +00:00
Kristján Valur Jónsson
3be00037d6
issue 8777
...
Add threading.Barrier
2010-10-28 09:43:10 +00:00
Georg Brandl
65ffae0aa3
Condition.wait now returns bool.
2010-10-28 09:24:56 +00:00
Georg Brandl
b9a4391754
#10218 : return timeout status from Condition.wait, mirroring other primitives' behavior.
2010-10-28 09:03:20 +00:00
Georg Brandl
4d54088599
#7351 : add more consistent exception name alias.
2010-10-28 06:42:33 +00:00
Antoine Pitrou
d72402effc
Recode modules from latin-1 to utf-8
2010-10-27 18:52:48 +00:00
Antoine Pitrou
6b03ee6033
Issue #5027 : The standard `xml` namespace is now understood by
...
xml.sax.saxutils.XMLGenerator as being bound to
http://www.w3.org/XML/1998/namespace . Patch by Troy J. Farrell.
2010-10-27 18:33:30 +00:00
Alexander Belopolsky
c1a6836305
Issue #10193 : Simplified instrospection used by turtle module
2010-10-27 13:25:45 +00:00
Georg Brandl
7424dd359c
#5975 : add unix_dialect to csv module.
2010-10-27 07:27:06 +00:00
Vinay Sajip
6a65c5df86
logging: Improved Formatter implementation.
2010-10-26 13:16:11 +00:00
R. David Murray
ba488d1504
#7761 : fix telnetlib.interact failures on Windows.
2010-10-26 12:42:24 +00:00
Senthil Kumaran
0256b2a8d6
Fix issue10192 - add urlencode to urllib.parse.__all__
2010-10-25 16:36:20 +00:00
Vinay Sajip
d0557bfe77
logging: Formatter implementation tweak.
2010-10-25 15:25:24 +00:00
Vinay Sajip
a39c571061
logging: Added style option to Formatter to allow %, {} or himBHformatting.
2010-10-25 13:57:39 +00:00
Skip Montanaro
97019ff665
test_gdb should be skipped on darwin (not up to v7 yet)
2010-10-25 01:35:48 +00:00
Victor Stinner
e882aac16d
str.encode() doesn't accept None as errors: use 'strict' instead
2010-10-24 21:12:26 +00:00
Victor Stinner
2ebe697267
Issue #10161 : test_pep277 formats filenames with ascii() on error
...
As suggested by Antoine, it's better to patch only test_pep277 than the
unittest module.
2010-10-24 21:05:03 +00:00
Victor Stinner
df6d6cb0fa
os: fsencode(), fsdecode() and os.environ(b) internal encode-decode methods
...
keep a local copy of the fileystem encoding, instead of calling
sys.getfilesystemencoding() each time.
The filesystem encoding is now constant.
2010-10-24 20:32:26 +00:00
Georg Brandl
08be72d0aa
Add a new warning gategory, ResourceWarning, as discussed on python-dev. It is silent by default,
...
except when configured --with-pydebug.
Emit this warning from the GC shutdown procedure, rather than just printing to stderr.
2010-10-24 15:11:22 +00:00
Georg Brandl
b75b639a8b
Remove usage of exception indexing.
2010-10-24 14:20:22 +00:00
Nick Coghlan
543af75961
Issue 5178: Add tempfile.TemporaryDirectory (original patch by Neil Schemenauer)
2010-10-24 11:23:25 +00:00
Benjamin Peterson
503d6c5ae9
remove broken code accounting an offset the size of the line #10186
2010-10-24 02:52:05 +00:00
R. David Murray
8451c4b6e0
#1349106 : add linesep argument to generator.flatten and header.encode.
2010-10-23 22:19:56 +00:00
Martin v. Löwis
57f75799bf
Revert r85801. The test ought to pass without rounding.
2010-10-23 19:02:30 +00:00
Antoine Pitrou
fbb1c6191c
Follow up to #9778 : fix regressions on 64-bit Windows builds
2010-10-23 17:37:54 +00:00
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