Commit Graph

3068 Commits

Author SHA1 Message Date
Amaury Forgeot d'Arc f1a7178cd5 #1920: when considering a block starting by "while 0", the compiler optimized the
whole construct away, even when an 'else' clause is present::

    while 0:
        print("no")
    else:
        print("yes")

did not generate any code at all.

Now the compiler emits the 'else' block, like it already does for 'if' statements.

Backport of r60265.
2008-01-24 23:42:08 +00:00
Guido van Rossum d933e0a7d3 News for some crashers I fixed recently.
Also removed three non-ASCII chars at start of file.
2008-01-24 18:28:37 +00:00
Thomas Heller fe528ebf68 Invert the checks in get_[u]long and get_[u]longlong. The intent was
to not accept float types; the result was that integer-like objects
were not accepted.
2008-01-24 13:08:54 +00:00
Christian Heimes d2f4cb8cca Fixed bug #1915: Python compiles with --enable-unicode=no again. However several extension methods and modules do not work without unicode support. 2008-01-23 14:20:41 +00:00
Gregory P. Smith 8f034d9af2 Backport of r60190:
- Fix Issue #1703448: A joined thread could show up in the
  threading.enumerate() list after the join() for a brief period until
  it actually exited.
2008-01-22 01:29:11 +00:00
Mark Dickinson 2bebadfe51 Issue 1678380: fix a bug identifying -0.0 and 0.0 2008-01-21 21:54:47 +00:00
Georg Brandl 78d50ccdf9 Add NEWS entry for #1882.
(backport from rev. 60170)
2008-01-21 18:36:54 +00:00
Gregory P. Smith 1cc98af8a1 backport r60116 - fix zipfile to work with archives having file
headers beyond the signed 2**31 byte boundary.
2008-01-19 23:16:01 +00:00
Gregory P. Smith c223c6cb41 backport r60104 + r60111 from trunk.
- Issue #1336: fix a race condition in subprocess.Popen if the garbage
  collector kicked in at the wrong time that would cause the process
  to hang when the child wrote to stderr.
2008-01-19 22:29:41 +00:00
Georg Brandl 7829d603a8 Backport r59688. 2008-01-19 20:34:19 +00:00
Gregory P. Smith 0f99b71bd0 ** backport r60015 from trunk.
- Issue829951: In the smtplib module, SMTP.starttls() now complies with
  RFC 3207 and forgets any knowledge obtained from the server not obtained
  from the TLS negotiation itself.  Patch contributed by Bill Fenner.
2008-01-17 07:54:47 +00:00
Thomas Heller f43a86b9d7 Backport from trunk:
Fix a potential 'SystemError: NULL result without error'.
  NULL may be a valid return value from PyLong_AsVoidPtr.
Also move an older ctypes NEWS item in the correct category.
2008-01-16 19:24:20 +00:00
Raymond Hettinger 665ddc9bb3 Fix 1698398: Zipfile.printdir() crashed because the format string expected a tuple object of length six instead of a time.struct_time object. 2008-01-14 23:02:51 +00:00
Thomas Heller b9c741c43c Added NEWS entry, plus:
Merged revisions 59925 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk/Modules/_ctypes

........
  r59925 | thomas.heller | 2008-01-11 20:34:06 +0100 (Fr, 11 Jan 2008) | 5 lines

  Raise an error instead of crashing with a segfault when a NULL
  function pointer is called.

  Will backport to release25-maint.
........
2008-01-11 19:48:46 +00:00
Mark Dickinson 4a3c7c78fb Add Decimal backport to Misc/NEWS 2008-01-09 01:02:07 +00:00
Andrew M. Kuchling 7a062c6dca Patch 1114: fix compilation of curses module on 64-bit AIX, and any other LP64 platforms where attr_t isn't a C long 2008-01-08 14:58:52 +00:00
Guido van Rossum 6e3e6e0d77 Forgot to backport the rest of #1637. 2008-01-06 02:40:07 +00:00
Lars Gustäbel e5f9e588c6 Issue #1735: TarFile.extractall() now correctly sets directory
permissions and times.

(backport from r59712)
2008-01-04 14:44:23 +00:00
Christian Heimes 12f03ccece Bug #1713: posixpath.ismount() claims symlink to a mountpoint is a mountpoint. 2008-01-04 13:22:36 +00:00
Guido van Rossum 3b4a5bd9da Fix bug #1301 -- a bad assert in _tkinter. 2008-01-03 23:52:04 +00:00
Guido van Rossum 6df9a82bd3 Issue #1700, reported by Nguyen Quan Son, fix by Fredruk Lundh:
Regular Expression inline flags not handled correctly for some unicode
characters.
2008-01-03 19:08:15 +00:00
Guido van Rossum 309e241881 Add some news items I missed. Careful inspection of the svn log output
reveals that a lot more are missing.  If you checked anything into the
2.5.2 branch without updating Misc/NEWS, please correct your mistake!
2008-01-03 18:57:40 +00:00
Martin v. Löwis ff36b2ce00 Bug #1699: Define _BSD_SOURCE only on OpenBSD. 2007-12-29 18:48:57 +00:00
Brett Cannon 35b84b4123 Backport of fix for issue 1695. 2007-12-24 20:00:42 +00:00
Christian Heimes c2b0d17b31 Fixed merge glitch, second try 2007-12-18 22:03:10 +00:00
Christian Heimes 3880210545 Fixed merge glitch 2007-12-18 22:00:19 +00:00
Christian Heimes 60d96cd54c Backport of #1638: %zd configure test fails on Linux 2007-12-18 21:14:54 +00:00
Thomas Heller 8e9e4d8f95 Issue #1642: Fix segfault in ctypes when trying to delete attributes. 2007-12-18 19:00:59 +00:00
Guido van Rossum d4029c8fda Bug #1608: use -fwrapv when GCC supports it. This is important, newer
GCC versions may optimize away overflow buffer overflow checks without
this option!  Thanks to Ismail Donmez.  No thanks to the GCC devs.
2007-12-13 20:42:33 +00:00
Guido van Rossum 47485a49f0 Backport patch #1643738. 2007-12-10 23:03:55 +00:00
Christian Heimes 03acd85dbf merge -r59315:59316 from py3k: Fix issue #1553: An errornous __length_hint__ can make list() raise a SystemError 2007-12-05 12:51:23 +00:00
Martin v. Löwis c8dbc92395 os.access now returns True on Windows for any existing directory. 2007-12-03 22:39:10 +00:00
Lars Gustäbel 7cc9c8bbe1 Issue #1531: Read fileobj from the current offset, do not seek to
the start.

(backport from r59260)
2007-12-01 21:06:06 +00:00
Amaury Forgeot d'Arc 8334a4fc31 Backport of r59241: str.decode fails on very long strings on 64bit platforms.
PyArgs_ParseTuple t# and w# formats truncated the lengths to 32bit.
2007-11-30 21:53:17 +00:00
Skip Montanaro 664ad76a34 back in these go - thanks to Titus Brown for the fix 2007-11-24 14:31:16 +00:00
Amaury Forgeot d'Arc 30f61cbb13 Issue #1445: Fix a SystemError when accessing the ``cell_contents``
attribute of an empty cell object.  Now a ValueError is raised.

Backport of r59170.
2007-11-24 13:53:29 +00:00
Skip Montanaro 9163783881 revert 2007-11-24 04:31:07 +00:00
Skip Montanaro 5a001c0c2c issue 1429818 2007-11-23 17:13:21 +00:00
Martin v. Löwis 3903f50f2e Allow simultaneous installation of 32-bit and 64-bit versions
on 64-bit Windows systems.
2007-11-22 06:47:17 +00:00
Brett Cannon d3a81df178 Backport of r59082 (doctest and using __loader__.get_data()). 2007-11-21 00:58:54 +00:00
Christian Heimes 946a51c187 Fixed #1372: zlibmodule.c: int overflow in PyZlib_decompress 2007-11-21 00:44:57 +00:00
Amaury Forgeot d'Arc c572dc3752 Backport for issue1265 (pdb bug with "with" statement).
When an unfinished generator-iterator is garbage collected, PyEval_EvalFrameEx
is called with a GeneratorExit exception set.  This leads to funny results
if the sys.settrace function itself makes use of generators.
A visible effect is that the settrace function is reset to None.
Another is that the eventual "finally" block of the generator is not called.

It is necessary to save/restore the exception around the call to the trace
function.

This happens a lot with py3k: isinstance() of an ABCMeta instance runs
    def __instancecheck__(cls, instance):
        """Override for isinstance(instance, cls)."""
        return any(cls.__subclasscheck__(c)
                   for c in {instance.__class__, type(instance)})
which lets an opened generator expression each time it returns True.

And the problem can be reproduced in 2.5 with pure python code.
2007-11-13 22:43:05 +00:00
Guido van Rossum f5ccd459d7 News about list_repeat() fix. 2007-11-13 05:23:21 +00:00
Nick Coghlan e53fcfd7d3 Fix issue #1705170 (backport from trunk) 2007-11-07 12:26:40 +00:00
Gregory P. Smith a1e5387ec5 Backport r58868:
Fixes Issue 1385: The hmac module now computes the correct hmac when using
  hashes with a block size other than 64 bytes (such as sha384 and sha512).
2007-11-06 00:32:04 +00:00
Gregory P. Smith 2c3e0d94b2 Backport r58757, r58758, r58759.
Undoes incorrect dbtables fix and errant strdup introduced as
described below:

r58757 | gregory.p.smith | 2007-11-01 14:08:14 -0700 (Thu, 01 Nov 2007) | 4 lines

Fix bug introduced in revision 58385.  Database keys could no longer
have NULL bytes in them.  Replace the errant strdup with a
malloc+memcpy.  Adds a unit test for the correct behavior.

r58758 | gregory.p.smith | 2007-11-01 14:15:36 -0700 (Thu, 01 Nov 2007) | 3 lines

Undo revision 58533 58534 fixes.  Those were a workaround for
a problem introduced by 58385.

r58759 | gregory.p.smith | 2007-11-01 14:17:47 -0700 (Thu, 01 Nov 2007) | 2 lines

false "fix" undone as correct problem was found and fixed.
2007-11-01 21:22:40 +00:00
Matthias Klose e467dbc3d0 - Build using system ffi library on arm*-linux*. 2007-10-24 20:34:07 +00:00
Neal Norwitz 1046af6f59 Backport 58594:
Issue #1307, patch by Derek Shockey.
When "MAIL" is received without args, an exception happens instead of
sending a 501 syntax error response.
2007-10-23 05:35:11 +00:00
Gregory P. Smith 0dcc3cc949 Backport 58532, 58533, 58534:
- Fix bsddb.dbtables: Don't randomly corrupt newly inserted rows by
   picking a rowid string with null bytes in it.  Such rows could not
   later be deleted, modified or individually selected.  Existing
   bsdTableDb databases created with such rows are out of luck.
 - Use mkdtemp for the test_dbtables test database environment and
   clean it up afterwards using shutil.rmtree.
2007-10-18 17:15:20 +00:00
Gregory P. Smith 137bdfa27a Merge trunk 58434:
Fixes http://bugs.python.org/issue1233 - bsddb.dbshelve.DBShelf.append
was useless due to inverted logic.  Also adds a test case for RECNO dbs
to test_dbshelve.
2007-10-12 18:49:36 +00:00