Commit Graph

5394 Commits

Author SHA1 Message Date
Éric Araujo 017e535bde Fix distutils’ check and register Unicode handling (#13114).
The check command was fixed by Kirill Kuzminykh.

The register command was using StringIO.getvalue, which uses “''.join”
and thus coerces to str using the default encoding (ASCII), so I changed
the code to use one extra intermediary list and correctly encode to
UTF-8.
2011-10-09 07:11:19 +02:00
Ned Deily bd9d07c1dd Issue #7425 and Issue #7367: add NEWS items. 2011-10-06 14:29:49 -07:00
Charles-François Natali 9ffcbf71a5 Issue #13070: Fix a crash when a TextIOWrapper caught in a reference cycle
would be finalized after the reference to its underlying BufferedRWPair's
writer got cleared by the GC.
2011-10-06 19:09:45 +02:00
Antoine Pitrou ace2ccf387 Issue #13099: Fix sqlite3.Cursor.lastrowid under a Turkish locale.
Reported and diagnosed by Thomas Kluyver.
2011-10-04 13:38:04 +02:00
Antoine Pitrou 561a821e93 Issue #7689: Allow pickling of dynamically created classes when their
metaclass is registered with copyreg.  Patch by Nicolas M. Thiéry and
Craig Citro.
2011-10-04 09:34:48 +02:00
Meador Inge ad349a190e Issue #12881: ctypes: Fix segfault with large structure field names. 2011-10-03 21:34:04 -05:00
Charles-François Natali 564f89036f Issue #13058: ossaudiodev: fix a file descriptor leak on error. Patch by Thomas
Jarosch.
2011-09-29 19:43:01 +02:00
Meador Inge fe15003680 Issue #13013: ctypes: Fix a reference leak in PyCArrayType_from_ctype.
Thanks to Suman Saha for finding the bug and providing a patch.
2011-09-27 20:35:28 -05:00
Mark Dickinson a96b0d119d Backport issue #12973 itertools fix from 3.x. 2011-09-24 09:01:16 +01:00
Victor Stinner 63c22fac72 Issue #7732: Fix a crash on importing a module if a directory has the same name
than a Python module (e.g. "__init__.py"): don't close the file twice.

PyFile_FromFile() does also close the file if PyString_FromString() failed. It
did already close the file on fill_file_fields() error (e.g. if the file is a
directory).
2011-09-23 19:37:03 +02:00
Victor Stinner 51b719814e Issue #12931: xmlrpclib now encodes Unicode URI to ISO-8859-1, instead of
failing with a UnicodeDecodeError.
2011-09-23 01:15:32 +02:00
Jesus Cea c23484b21f Close #13022: _multiprocessing.recvfd() doesn't check that file descriptor was actually received 2011-09-21 03:47:39 +02:00
Mark Dickinson 4ac5d2cda4 Backport issue #12973 list_repeat fix from 3.x. 2011-09-19 19:23:55 +01:00
Mark Dickinson dbbed04941 Issue #12973: Fix int.__pow__ overflow checks that invoked undefined behaviour, thereby producing incorrect results on Clang. 2011-09-19 16:38:08 +01:00
Jesus Cea d256ca12c1 Close #13007: whichdb should recognize gdbm 1.9 magic numbers 2011-09-19 16:57:18 +02:00
Amaury Forgeot d'Arc 439c25eb9e Issue #12483: ctypes: Fix a crash when the destruction of a callback
object triggers the garbage collector.
2011-09-12 20:12:09 +02:00
Éric Araujo dcdc3ef5fa Branch merge 2011-09-12 17:47:48 +02:00
Éric Araujo a13cd39533 Fix determination of Metadata version (#8933). Patch by Filip Gruszczyński. 2011-09-10 05:39:45 +02:00
Jesus Cea 6ebaca137f NEWS 2011-09-10 04:35:18 +02:00
Éric Araujo ab08da0a1c Branch merge 2011-09-05 17:45:48 +02:00
Lars Gustäbel 8babfdfd45 Issue #12841: Fix tarfile extraction of non-existent uids/gids.
tarfile unnecessarily checked the existence of numerical user and group ids on
extraction. If one of them did not exist the respective id of the current user
(i.e. root) was used for the file and ownership information was lost. (Patch
by Sebastien Luttringer)
2011-09-05 17:04:18 +02:00
Éric Araujo 0f2dbf3645 Warn instead of crashing because of invalid path in MANIFEST.in (#8286).
sdist used to crash with a full traceback dump instead of printing a
nice warning with the faulty line number.
2011-09-03 00:47:07 +02:00
Amaury Forgeot d'Arc cf316a171e Issue #12764: Fix a crash in ctypes when the name of a Structure field is not
a string.
2011-09-02 20:32:23 +02:00
Amaury Forgeot d'Arc 3d7f236329 Issue #9651: Fix a crash when ctypes.create_string_buffer(0) was passed to
some functions like file.write().
2011-08-30 21:04:35 +02:00
Éric Araujo 429b890561 Make bdist_* commands respect --skip-build passed to bdist (#10946) 2011-08-30 01:48:59 +02:00
Charles-François Natali fda7b379ac Issue #12287: Fix a stack corruption in ossaudiodev module when the FD is
greater than FD_SETSIZE.
2011-08-28 16:22:33 +02:00
Nadeem Vawda bbabbae114 Issue #12839: Fix crash in zlib module due to version mismatch.
If the version of zlib used to compile the zlib module is incompatible
with the one that is actually linked in, then calls into zlib will fail.
This can leave attributes of the z_stream uninitialized, so we must take
care to avoid segfaulting by trying to use an invalid pointer.

Fix by Richard M. Tew.
2011-08-28 11:23:57 +02:00
Charles-François Natali 2a34eb3104 Issue #12786: Set communication pipes used by subprocess.Popen CLOEXEC to avoid
them being inherited by other subprocesses.
2011-08-25 21:20:54 +02:00
Antoine Pitrou 77657e40fa Issue #4106: Fix occasional exceptions printed out by multiprocessing on interpreter shutdown.
This bug doesn't seem to exist on 3.2, where daemon threads are killed
before Py_Finalize() is entered.
2011-08-24 22:41:05 +02:00
Antoine Pitrou a1a8da8bf5 Issue #11657: Fix sending file descriptors over 255 over a multiprocessing Pipe.
Also added some tests.
2011-08-23 19:54:20 +02:00
Charles-François Natali cdaafe0f9e Issue #12821: Fix test_fcntl failures on OpenBSD 5. 2011-08-23 19:42:02 +02:00
Antoine Pitrou 808cec536a Issue #12213: Fix a buffering bug with interleaved reads and writes that
could appear on io.BufferedRandom streams.
2011-08-20 15:40:58 +02:00
Victor Stinner acacbaa788 Issue #12326: sys.platform is now always 'linux2' on Linux
Even if Python is compiled on Linux 3.
2011-08-20 14:02:38 +02:00
Éric Araujo e7329f47e7 Guard shutil._make_archive against a logger=None argument.
Backporting two lines from the 3.x tests was enough to trigger the bug.
I also took the opportunity of making the logging call lazy.
2011-08-19 03:07:39 +02:00
Charles-François Natali b02302c5cf Issue #12650: Fix a race condition where a subprocess.Popen could leak
resources (FD/zombie) when killed at the wrong time.
2011-08-18 17:18:28 +02:00
Barry Warsaw 39935f4ab8 NEWS entry. 2011-08-15 19:50:35 -04:00
Ezio Melotti 15d6b65ead #12266: Fix str.capitalize() to correctly uppercase/lowercase titlecased and cased non-letter characters. 2011-08-15 09:22:24 +03:00
Senthil Kumaran f432aeca7c Fix closes issue12683 - urljoin to work with relative join of svn scheme. 2011-08-03 18:31:59 +08:00
Éric Araujo 33af263d36 Fix incorrect mtime comparison in distutils (#11933).
This is a regression introduced in 9211a5d7d0b4, when uses of ST_MTIME
constants were changed to uses of st_mtime attributes.  As diagnosed in
the bug report, this change is not merely stylistic: st_mtime is a
float but ST_MTIME’s resolution is rounded to the seconds, so there was
a mismatch between the values seen by file_util and dep_util which
caused an sdist to be unnecessarily created a second time on an ext4
filesystem.

This patch has been tested by John S. Gruber, who reported the bug.
As this is a simple code revert, I think it’s okay to commit without a
unit test.
2011-08-02 03:16:12 +02:00
Éric Araujo 498da2c162 Stop trying to write into the stdlib during lib2to3 tests (#12331).
This prevents tests from failing when run from a Python installed in a
read-only directory.
2011-07-31 17:59:28 +02:00
Éric Araujo 560bf855d3 Fix regression with distutils MANIFEST handing (#11104, #8688).
The changed behavior of sdist in 2.7 broke packaging for projects that
wanted to use a manually-maintained MANIFEST file (instead of having a
MANIFEST.in template and letting distutils generate the MANIFEST).

The fixes that were committed for #8688 (d29399100973 by Tarek and
f7639dcdffc3 by me) did not fix all issues exposed in the bug report,
and also added one problem: the MANIFEST file format gained comments,
but the read_manifest method was not updated to handle (i.e. ignore)
them.  This changeset should fix everything; the tests have been
expanded and I successfully tested with Mercurial, which suffered from
this regression.

I have grouped the versionchanged directives for these bugs in one place
and added micro version numbers to help users know the quirks of the
exact version they’re using.  I also removed a stanza in the docs that
was forgotten in Tarek’s first changeset.

Initial report, thorough diagnosis and patch by John Dennis, further
work on the patch by Stephen Thorne, and a few edits and additions by
me.
2011-07-31 02:04:00 +02:00
Éric Araujo 9a528306b9 Make “pydoc somebuiltin.somemethod” work (#8887) 2011-07-29 17:34:35 +02:00
Raymond Hettinger 55e5e27b74 Issue 12514: Use try/finally to assure that timeit restores GC when done. 2011-07-28 23:56:38 -07:00
Jason R. Coombs fee7745ebb Fixes #10639: reindent.py should not convert newlines
Backport of changeset 070dc6e359fb, reindent.py now will use the newline detected in the original file and will report an error if mixed newlines are encountered.
2011-07-27 14:05:37 -04:00
Charles-François Natali 0cf7e25c28 - Issue #12603: Fix pydoc.synopsis() on files with non-negative st_mtime. 2011-07-27 19:36:40 +02:00
Ross Lagerwall d8e3901478 Issue #12607: In subprocess, fix issue where if stdin, stdout or stderr is
given as a low fd, it gets overwritten.
2011-07-27 18:54:53 +02:00
Ned Deily d8b1723965 Issue #12590: IDLE editor window now always displays the first line
when opening a long file.  With Tk 8.5, the first line was hidden.
2011-07-26 18:16:08 -07:00
Ross Lagerwall 528c4adc0b Issue #12102: Document that buffered files must be flushed before being used
with mmap. Patch by Steffen Daode Nurpmeso.
2011-07-25 07:23:58 +02:00
Charles-François Natali 3de8c73d90 Issue #12560: Build libpython.so on OpenBSD. Patch by Stefan Sperling. 2011-07-24 22:33:35 +02:00
Antoine Pitrou 4cfae027b3 Issue #1813: Fix codec lookup and setting/getting locales under Turkish locales. 2011-07-24 02:51:01 +02:00
Nadeem Vawda 0d2889f56c Fix typo in NEWS entry for dbf1e1a27427. 2011-07-23 16:13:01 +02:00
Nadeem Vawda b42c53e442 Issue #10883: Fix socket leaks in urllib.request.
* ftpwrapper now uses reference counting to ensure that the underlying socket
  is closed when the ftpwrapper object is no longer in use
* ftplib.FTP.ntransfercmd() now closes the socket if an error occurs

Initial patch by Victor Stinner.
2011-07-23 15:51:16 +02:00
Charles-François Natali 97781b0b64 Issue #12592: Make Python build on OpenBSD 5 (and future major releases). 2011-07-22 23:43:42 +02:00
Benjamin Peterson 6c18ff0808 news note 2011-07-22 10:41:44 -05:00
Charles-François Natali 4929eb911b Issue #12372: POSIX semaphores are broken on AIX: don't use them. 2011-07-21 19:41:04 +02:00
Barry Warsaw a4c383b8b3 Upstream merge. 2011-07-19 19:28:16 -04:00
Antoine Pitrou 495ee8f563 Issue #12571: Add a plat-linux3 directory mirroring the plat-linux2 directory,
so that "import DLFCN" and other similar imports work on Linux 3.0.
2011-07-20 00:26:23 +02:00
Barry Warsaw c56432804a - Issue #10309: Define _GNU_SOURCE so that mremap() gets the proper
signature.  Without this, architectures where sizeof void* != sizeof int are
  broken.  Patch given by Hallvard B Furuseth.
2011-07-19 17:06:30 -04:00
R David Murray 9522595d70 #7484: no more <> around addresses in VRFY or EXPN
The RFC doesn't say that they are allowed; apparently many mailers accept
them, but not postfix.  Contributions to this patch were made by Felipe Cruz
and Catalin Iacob.
2011-07-18 21:34:04 -04:00
Antoine Pitrou 304f0f952d Issue #11603: Fix a crash when __str__ is rebound as __repr__.
Patch by Andreas Stührk.
2011-07-15 21:22:50 +02:00
Benjamin Peterson c3349cd22e port 8d05f697acd4 (#11627) 2011-07-15 14:15:40 -05:00
Charles-François Natali 2659140a5d Issue #12502: asyncore: fix polling loop with AF_UNIX sockets. 2011-07-14 19:49:02 +02:00
Ned Deily 0ab67ee79e Issue #12549: Correct test_platform to not fail when OS X returns 'x86_64'
as the processor type on some Mac systems.  Also fix NameError in fallback
_mac_ver_gestalt function.  And remove out-of-date URL in docs.
2011-07-13 15:05:31 -07:00
Victor Stinner bf547fd3f2 Close #4376: ctypes now supports nested structures in a endian different than
the parent structure. Patch by Vlad Riscutia.
2011-07-13 21:47:31 +02:00
Antoine Pitrou 1616645a00 Issue #12149: Update the method cache after a type's dictionnary gets
cleared by the garbage collector.  This fixes a segfault when an instance
and its type get caught in a reference cycle, and the instance's
deallocator calls one of the methods on the type (e.g. when subclassing
IOBase).

Diagnosis and patch by Davide Rizzo.
2011-07-12 22:04:20 +02:00
Antoine Pitrou 4a4a0fed07 Skip network tests when getaddrinfo() returns EAI_AGAIN, meaning a temporary
failure in name resolution.

Should fix a buildbot failure.
2011-07-09 02:34:05 +02:00
Antoine Pitrou 2960308c0c Avoid failing in test_robotparser when mueblesmoraleda.com is flaky and
an overzealous DNS service (e.g. OpenDNS) redirects to a placeholder
Web site.
2011-07-08 19:40:15 +02:00
Antoine Pitrou a4d58d26a1 Avoid failing in test_urllibnet.test_bad_address when some overzealous
DNS service (e.g. OpenDNS) resolves a non-existent domain name.  The test
is now skipped instead.
2011-07-08 19:14:19 +02:00
Victor Stinner ba8b3a2ca7 Close #12501: Adjust callable() warning: callable() is only not supported in
Python 3.1. callable() is again supported in Python 3.2.
2011-07-08 02:07:45 +02:00
Victor Stinner e790131dc6 Issue #12493: subprocess: communicate() handles EINTR
subprocess.Popen.communicate() now also handles EINTR errors if the process has
only one pipe.
2011-07-05 14:08:01 +02:00
Victor Stinner 59729ff609 Issue #9611, #9015: FileIO.read(), FileIO.readinto(), FileIO.write() and
os.write() clamp the length to INT_MAX on Windows.
2011-07-05 11:28:19 +02:00
Ned Deily 46268c49f6 Issue #8716: Avoid crashes caused by Aqua Tk on OSX when attempting to run
test_tk or test_ttk_guionly under a username that is not currently logged
in to the console windowserver (as may be the case under buildbot or ssh).
2011-07-03 21:52:35 -07:00
Victor Stinner 65c153547b Issue #12467: warnings: fix a race condition if a warning is emitted at
shutdown, if globals()['__file__'] is None.
2011-07-04 03:05:37 +02:00
Charles-François Natali 414d0faedc Issue #12352: Fix a deadlock in multiprocessing.Heap when a block is freed by
the garbage collector while the Heap lock is held.
2011-07-02 13:56:19 +02:00
Raymond Hettinger bf7a266074 Fixup repr for dict_proxy objects. 2011-06-30 00:44:36 +01:00
Ned Deily 87e82bb0e3 Issue #9516: Update Misc/NEWS. 2011-06-28 19:52:59 -07:00
Ned Deily 63144c6444 Issue #12141: Install a copy of template C module file so that
test_build_ext of test_distutils is no longer silently skipped when
run outside of a build directory.
2011-06-28 00:39:19 -07:00
Ned Deily 43e1054e38 Issue #8746: Correct faulty configure checks so that os.chflags() and
os.lchflags() are once again built on systems that support these
functions (*BSD and OS X).  Also add new stat file flags for OS X
(UF_HIDDEN and UF_COMPRESSED).  Also add additional tests for
os.chflags() and os.lchflags(). (Tests by Garrett Cooper)
2011-06-27 23:41:53 -07:00
Ned Deily 64e59959f2 Issue #10736: Fix test_ttk test_widgets failures with Cocoa Tk 8.5.9
on Mac OS X.  (Patch by Ronald Oussoren)
2011-06-27 23:09:31 -07:00
Raymond Hettinger 2c316a3e29 Issue 11802: filecmp cache was growing without bound. 2011-06-25 17:14:53 +02:00
Ross Lagerwall ffa8e2fb56 Issue 12404: Remove C89 incompatible code from mmap module.
Patch by Akira Kitada.
2011-06-25 09:55:10 +02:00
Victor Stinner ecb863b29e Revert d370d609d09b as requested by Terry Jan Reedy:
"#3067: locale.setlocale() accepts a Unicode locale."
2011-06-20 22:07:06 +02:00
Victor Stinner c36c6ccb41 Close #3067: locale.setlocale() accepts a Unicode locale. 2011-06-20 16:14:48 +02:00
R David Murray f1138bb1b6 #11700: proxy object close methods can now be called multiple times
This makes them work like the close provided by regular file objects.  This
patch also backports the close-the-underlying-file code for _ProxyFile objects
that was introduced along with context manager support in the 3.x branch.
2011-06-17 22:23:04 -04:00
Victor Stinner c74a6ba2d6 Issue #12133: AbstractHTTPHandler.do_open() of urllib.request closes the HTTP
connection if its getresponse() method fails with a socket error. Patch written
by Ezio Melotti.
2011-06-17 14:06:27 +02:00
Benjamin Peterson 0eb4ac4c62 allow "fake" filenames in findsource (closes #9284)
This allows findsource() to work in doctests.

A patch from Dirkjan Ochtman.
2011-06-11 15:53:11 -05:00
Benjamin Peterson a573e0df36 merge 2.7.2 release branch 2011-06-11 09:51:21 -05:00
Benjamin Peterson 9843ba5e54 bump to 2.7.2 final 2011-06-11 09:42:44 -05:00
Benjamin Peterson b30d5c711e merge heads 2011-06-10 11:33:58 -05:00
Benjamin Peterson 8b8162d868 merge 2.7.2 release branch with fix for #12009 2011-06-10 11:33:41 -05:00
Benjamin Peterson 43ee1a5d90 fix regression in netrc comment handling (closes #12009) 2011-06-10 11:32:52 -05:00
R David Murray 873c583244 #10694: zipfile now ignores garbage at the end of a zipfile.
Original fix by 'rep', final patch (with tests) by Xuanji Li.
2011-06-09 16:01:09 -04:00
Brian Curtin caea7e8d23 Merge 2011-06-08 19:29:53 -05:00
Mark Dickinson a493ca3fae Issue #12080: Fix a performance issue in Decimal._power_exact that caused some corner-case Decimal.__pow__ calls to take an unreasonably long time. 2011-06-04 18:24:15 +01:00
Benjamin Peterson d571cf5ab0 merge 2.7.2 release branch 2011-06-03 16:17:48 -05:00
Benjamin Peterson ef1122cbd6 another benefit of this change 2011-06-03 16:17:22 -05:00
Raymond Hettinger 45b082935d Fix named tuples to work with vars(). 2011-06-02 20:40:35 -07:00
Raymond Hettinger 19b851d11b sys.checkinterval() now refreshes the current countdown ticker. 2011-06-01 18:21:42 -07:00
Benjamin Peterson 35a9b1ca13 merge 2.7.2 release branch 2011-05-31 19:01:23 -05:00
Benjamin Peterson 4ba009d8dc simply use the Python version for pyexpat.__version__ #12221 2011-05-31 18:59:49 -05:00