Commit graph

39000 commits

Author SHA1 Message Date
Benjamin Peterson
a3d19f35c4 Backport the removal of a __repr__ from 62251 2008-04-13 02:05:48 +00:00
Benjamin Peterson
7bb4d2d0fa Backported io module docs 2008-04-13 02:01:27 +00:00
Andrew M. Kuchling
c161df6abd Mention -J, -X 2008-04-13 01:05:59 +00:00
Brett Cannon
76ca13ca2a Fix an accidental bug of an non-existent init function. 2008-04-13 00:25:15 +00:00
Brett Cannon
40f0a87666 Fix a bug in PySys_HasWarnOption() where it was not properly checking the
length of the list storing the warning options.
2008-04-13 00:18:44 +00:00
Gregory P. Smith
b2693e007b Adds a profile-opt target for easy compilation of a python binary using
gcc's profile guided optimization.
2008-04-13 00:03:25 +00:00
Brett Cannon
e974689038 Re-implement the 'warnings' module in C. This allows for usage of the
'warnings' code in places where it was previously not possible (e.g., the
parser). It could also potentially lead to a speed-up in interpreter start-up
if the C version of the code (_warnings) is imported over the use of the
Python version in key places.

Closes issue #1631171.
2008-04-12 23:44:07 +00:00
Gregory P. Smith
e6c03033af socket.error inherits from IOError, it no longer needs listing in
the all_errors tuple.
2008-04-12 22:24:04 +00:00
Gregory P. Smith
73bee444ab fix compiler warnings 2008-04-12 20:37:48 +00:00
Georg Brandl
751a0362aa Don't offend snake lovers. 2008-04-12 19:05:37 +00:00
Georg Brandl
a93eaa5772 Add Jeroen. 2008-04-12 19:00:20 +00:00
Georg Brandl
8189310a7f #2615: small consistency update by Jeroen Ruigrok van der Werven. 2008-04-12 18:36:09 +00:00
Georg Brandl
b4d21139b7 Use absolute path in sys.path. 2008-04-12 18:11:18 +00:00
Christian Heimes
7a98d2730c Applied patch #2617 from Frank Wierzbicki wit some extras from me
-J and -X are now reserved for Jython and non-standard arguments (e.g. IronPython). I've added some extra comments to make sure the reservation don't get missed in the future.
2008-04-12 13:03:03 +00:00
Thomas Heller
d3ed492164 Performance improvements. 2008-04-11 14:20:26 +00:00
Thomas Heller
12c4e6478a Move backwards compatibility macro to the correct place;
PyIndex_Check() was introduced in Python 2.5.
2008-04-11 13:05:38 +00:00
Andrew M. Kuchling
17f8429bd2 Use issue directive 2008-04-10 21:29:01 +00:00
Andrew M. Kuchling
19baaadf51 Add punctuation 2008-04-10 21:28:51 +00:00
Andrew M. Kuchling
3351e4142c Remove forward-looking statement 2008-04-10 21:27:10 +00:00
Gregory P. Smith
2ea2968064 get rid of assert (size >= 0) now that an explicit if (size < 0) is in the code. 2008-04-10 19:50:36 +00:00
Neal Norwitz
36a59b4a08 Remove the test file before writing it in case there is no write permission.
This might help fix some of the failures on Windows box(es).  It doesn't hurt
either way and ensure the tests are a little more self contained (ie have
less assumptions).
2008-04-10 05:46:39 +00:00
Martin v. Löwis
60a819d681 Merged revisions 62080-62262 via svnmerge from
svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3

........
  r62092 | collin.winter | 2008-04-01 18:27:10 +0200 (Di, 01 Apr 2008) | 1 line

  Add get_prev_sibling() to complement pytree's get_next_sibling().
........
  r62226 | collin.winter | 2008-04-08 21:07:56 +0200 (Di, 08 Apr 2008) | 1 line

  Add min() and max() to the list of special contexts that don't require adding list() calls around dict methods.
........
  r62232 | collin.winter | 2008-04-09 00:12:38 +0200 (Mi, 09 Apr 2008) | 4 lines

  Fix for http://bugs.python.org/issue2596

  This extends fix_xrange to know about the (mostly) same special contexts as fix_dict (where a special context is something that is guaranteed to fully consume the iterable), adding list() calls where appropriate. It also special-cases "x in range(y)".
........
2008-04-10 02:48:01 +00:00
Gregory P. Smith
c00eb73a30 Raise SystemError when size < 0 is passed into PyString_FromStringAndSize,
PyBytes_FromStringAndSize or PyUnicode_FromStringAndSize.  [issue2587]
2008-04-09 23:16:37 +00:00
Gregory P. Smith
f108320055 better diagnostics 2008-04-09 23:11:56 +00:00
Andrew M. Kuchling
c157c9c277 Try out the new issue role. Thanks, Georg! 2008-04-09 22:28:43 +00:00
Martin v. Löwis
023b9f952a Package wininst*.exe from distutils/command. 2008-04-09 18:56:20 +00:00
Gregory P. Smith
671c5d9fb5 Add a note about the zlib.decompressobj().flush() fix. 2008-04-09 18:18:43 +00:00
Georg Brandl
c305192196 Add :issue: directive for easy linking to bugs.python.org. 2008-04-09 17:58:56 +00:00
Georg Brandl
99bb5f3fef #2585: initialize code attribute of HTTPError. 2008-04-09 17:57:38 +00:00
Jerry Seutter
8f80a6a5f9 Changed test so it no longer runs as a side effect of importing. 2008-04-09 05:07:58 +00:00
Andrew M. Kuchling
f68b55327c Add items 2008-04-09 01:08:32 +00:00
Trent Nelson
6c4a7c6821 Fix typo with regards to self.PORT shadowing class variables with the same name. 2008-04-09 00:34:53 +00:00
Gregory P. Smith
79e42a0e08 Fix zlib crash from zlib.decompressobj().flush(val) when val was not positive.
It tried to allocate negative or zero memory.  That fails.
2008-04-09 00:25:17 +00:00
Trent Nelson
e41b0061dd - Issue #2550: The approach used by client/server code for obtaining ports
to listen on in network-oriented tests has been refined in an effort to
  facilitate running multiple instances of the entire regression test suite
  in parallel without issue.  test_support.bind_port() has been fixed such
  that it will always return a unique port -- which wasn't always the case
  with the previous implementation, especially if socket options had been
  set that affected address reuse (i.e. SO_REUSEADDR, SO_REUSEPORT).  The
  new implementation of bind_port() will actually raise an exception if it
  is passed an AF_INET/SOCK_STREAM socket with either the SO_REUSEADDR or
  SO_REUSEPORT socket option set.  Furthermore, if available, bind_port()
  will set the SO_EXCLUSIVEADDRUSE option on the socket it's been passed.
  This currently only applies to Windows.  This option prevents any other
  sockets from binding to the host/port we've bound to, thus removing the
  possibility of the 'non-deterministic' behaviour, as Microsoft puts it,
  that occurs when a second SOCK_STREAM socket binds and accepts to a
  host/port that's already been bound by another socket.  The optional
  preferred port parameter to bind_port() has been removed.  Under no
  circumstances should tests be hard coding ports!

  test_support.find_unused_port() has also been introduced, which will pass
  a temporary socket object to bind_port() in order to obtain an unused port.
  The temporary socket object is then closed and deleted, and the port is
  returned.  This method should only be used for obtaining an unused port
  in order to pass to an external program (i.e. the -accept [port] argument
  to openssl's s_server mode) or as a parameter to a server-oriented class
  that doesn't give you direct access to the underlying socket used.

  Finally, test_support.HOST has been introduced, which should be used for
  the host argument of any relevant socket calls (i.e. bind and connect).

  The following tests were updated to following the new conventions:
    test_socket, test_smtplib, test_asyncore, test_ssl, test_httplib,
    test_poplib, test_ftplib, test_telnetlib, test_socketserver,
    test_asynchat and test_socket_ssl.

  It is now possible for multiple instances of the regression test suite to
  run in parallel without issue.
2008-04-08 23:47:30 +00:00
Amaury Forgeot d'Arc
02f33b43dc Add a NEWS entry for previous checkin 2008-04-08 23:10:07 +00:00
Amaury Forgeot d'Arc
7adc776ea6 Issue 2408: remove the _types module
It was only used as a helper in types.py to access types (GetSetDescriptorType and MemberDescriptorType),
when they can easily be obtained with python code.
These expressions even work with Jython.

I don't know what the future of the types module is; (cf. discussion in http://bugs.python.org/issue1605 )
at least this change makes it simpler.
2008-04-08 22:07:05 +00:00
Amaury Forgeot d'Arc
24f3c5c646 Prevent an error when inspect.isabstract() is called with something else than a new-style class. 2008-04-08 21:51:57 +00:00
Amaury Forgeot d'Arc
4b798bdf8a Issue2564: Prevent a hang in "import test.autotest", which runs the entire test
suite as a side-effect of importing the module.

- in test_capi, a thread tried to import other modules
- re.compile() imported sre_parse again on every call.
2008-04-08 21:27:42 +00:00
Andrew M. Kuchling
abf8e015c2 Add items 2008-04-08 21:22:53 +00:00
Martin v. Löwis
775e10d9e6 Suppress compilation of py3_ files upon installation. 2008-04-08 16:48:35 +00:00
Andrew M. Kuchling
eba0004198 Typographical fix: 32bit -> 32-bit, 64bit -> 64-bit 2008-04-08 01:33:10 +00:00
Andrew M. Kuchling
5b1070a32b Typo fix 2008-04-07 23:57:21 +00:00
Andrew M. Kuchling
34be7cec31 Write PEP 3127 section; add items 2008-04-07 23:57:07 +00:00
Georg Brandl
4a1672368d #2525: update timezone info examples in the docs. 2008-04-07 18:51:59 +00:00
Martin v. Löwis
1e72feced3 Make the "private CRT" case work, by editing the
manifest in DLLs to refer to the root copy of the CRT.
2008-04-07 16:34:04 +00:00
Martin v. Löwis
46a8be7a35 Drop support for 7.1 CRT. 2008-04-07 14:55:53 +00:00
Martin v. Löwis
e411f8955f Make private_crt feature object a global variable. 2008-04-07 14:54:16 +00:00
Martin v. Löwis
54d489a97f Delete ALLUSERS property merged from CRT merge module, so that per-user installations become possible again. 2008-04-07 14:53:34 +00:00
Mark Summerfield
528576031d changed "2500 components" to "several thousand" since the number keeps
growning:-)
2008-04-07 07:39:23 +00:00
Gregory P. Smith
c20adf8ef2 Use the new PyFile_IncUseCount & PyFile_DecUseCount calls appropriatly
within the standard library.  These modules use PyFile_AsFile and later
release the GIL while operating on the previously returned FILE*.
2008-04-07 06:33:21 +00:00