Commit Graph

301 Commits

Author SHA1 Message Date
Martin v. Löwis b45b315855 Patch #1350409: Port signal handling to VS 2005. 2005-11-28 17:34:23 +00:00
Brett Cannon ad07ff2c77 Prevent threading.Thread.join() from blocking when a previous call raised an
exception (e.g., passing in an illegal argument).

Applies patch #1314396.  Thanks Eric Blossom.
2005-11-23 02:15:50 +00:00
Neal Norwitz cf4863831c Fix SF #1345263, colorsys tests, bug in frange
Fix a typo that caused step to be ignored.

Will backport.
2005-11-02 05:54:27 +00:00
Jeremy Hylton 3e0055f8c6 Merge ast-branch to head
This change implements a new bytecode compiler, based on a
transformation of the parse tree to an abstract syntax defined in
Parser/Python.asdl.

The compiler implementation is not complete, but it is in stable
enough shape to run the entire test suite excepting two disabled
tests.
2005-10-20 19:59:25 +00:00
Neal Norwitz c5cdcba2d9 SF patch #1227568, Expression AST node not documented. 2005-10-03 00:38:46 +00:00
Neal Norwitz 484d9a409a Patch #1309009, Fix segfault in pyexpat when the XML document is
in latin_1, but Python incorrectly assumes it is in UTF-8 format

Will backport.
2005-09-30 04:46:49 +00:00
Michael W. Hudson 10402a306f Patches #1298449 and #1298499: Add some missing checks for error
returns in cStringIO.c.  Thanks to Andrew Bennetts.

This must be a backport candidate.
2005-09-22 09:19:01 +00:00
Skip Montanaro d3b01deb17 credit source of idea for recent doc changes 2005-05-12 13:44:23 +00:00
Brett Cannon 4380242580 Modified test for tzset to not rely on tm->tm_zone's existence. Also added
sanity checks on tzname if HAVE_TZNAME defined.

Closes bug #1096244.  Thanks Gregory Bond.
2005-02-10 20:48:03 +00:00
Raymond Hettinger bab4143348 SF patch #1116583: NameError in cookielib domain check 2005-02-05 01:31:19 +00:00
Skip Montanaro 0af3ade6aa Add strptime() constructor to datetime class. Thanks to Josh Spoerri for
the changes.
2005-01-13 04:12:31 +00:00
Raymond Hettinger f9245578c9 Acknowledge contribution of a thorough tutorial review. 2004-12-03 08:33:32 +00:00
Raymond Hettinger 3b0c7c20a1 SF patch #1077353: add key= argument to min and max
(First draft of patch contributed by Steven Bethard.)
2004-12-03 08:30:39 +00:00
Raymond Hettinger 96b49a51d0 SF patch 1062495: Modules/zipimport.c does not compile on solaris (Contributed by Niki W. Waibel.)
Simple renaming to avoid a conflict that prevented compilation on Solaris.
2004-11-10 13:13:05 +00:00
Jeremy Hylton def9d2a17c Fix for SF bug 988120 via patch 1061941.
If read() returned less than the number of bytes request, the full amount was subtracted from length instead of the actually read amount.
2004-11-07 16:13:49 +00:00
Brett Cannon 06a30b087e Fix minor reST error in Misc/NEWS.
Applies patch #1051866.  Thanks Felix Wiemann.
2004-10-22 06:22:54 +00:00
Anthony Baxter a024034b94 Patch 1046644 - improved distutils support for SWIG. 2004-10-14 10:02:08 +00:00
Anthony Baxter 22dcf66f84 Patch 983206: distutils obeys LDSHARED env var. Removed the code in
Python's own setup.py that did the same thing (and tested on Solaris,
where LDSHARED is needed...)
2004-10-13 15:54:17 +00:00
Anthony Baxter e4f8a48b8f 969574 2004-10-13 14:55:56 +00:00
Martin v. Löwis 39a317890f Patch #1025790: Add status code constants to httplib. 2004-09-18 09:03:49 +00:00
Martin v. Löwis 23c48a12d9 Patch #808120: Add --force-arch=ARCH to bdist_rpm.py. 2004-09-10 06:32:54 +00:00
Jeremy Hylton 566d934745 compiler.transformer: correct lineno attribute when possible
SF patch #1015989

The basic idea of this patch is to compute lineno attributes for all AST nodes.  The actual
implementation lead to a lot of restructing and code cleanup.

The generated AST nodes now have an optional lineno argument to constructor.  Remove the
top-level asList(), since it didn't seem to serve any purpose.  Add an __iter__ to ast nodes.
Use isinstance() instead of explicit type tests.

Change transformer to use the new lineno attribute, which replaces three lines of code with one.
Use universal newlines so that we can get rid of special-case code for line endings.  Use
lookup_node() in a few more frequently called, but simple com_xxx methods().  Change string
exception to class exception.
2004-09-07 15:28:01 +00:00
Tim Peters 0973b99e1c SF patch 936813: fast modular exponentiation
This checkin is adapted from part 1 (of 3) of Trevor Perrin's patch set.

x_mul()
  - sped a little by optimizing the C
  - sped a lot (~2X) if it's doing a square; note that long_pow() squares
    often
k_mul()
  - more cache-friendly now if it's doing a square
KARATSUBA_CUTOFF
  - boosted; gradeschool mult is quicker now, and it may have been too low
    for many platforms anyway
KARATSUBA_SQUARE_CUTOFF
  - new
  - since x_mul is a lot faster at squaring now, the point at which
    Karatsuba pays for squaring is much higher than for general mult
2004-08-29 22:16:50 +00:00
Martin v. Löwis e064b41f5a Patch #914575: difflib side by side diff support, diff.py s/b/s HTML option. 2004-08-29 16:34:40 +00:00
Raymond Hettinger 08158a0c65 Add Nick Coghlan for his patch solving an issue with joining string
subclasses.
2004-08-23 23:30:20 +00:00
Andrew M. Kuchling 955d00922c Add name 2004-08-07 14:17:50 +00:00
Anthony Baxter 32083f64a7 notes for @decorator 2004-08-02 06:24:59 +00:00
Marc-André Lemburg 17b6d28c64 New codec: [ 996067 ] hp-roman8 codec 2004-07-28 15:37:54 +00:00
Martin v. Löwis 7b9190b8fc Patch #998149: imaplib deleteacl and myrights. 2004-07-27 05:07:19 +00:00
Martin v. Löwis cc0f93233a Patch #605370: Add description[s] for RFC 2980 compliance. 2004-07-26 12:40:50 +00:00
Andrew M. Kuchling 79d7e92a5c Add item 2004-07-10 21:21:55 +00:00
Brett Cannon e67511809b Add note about closing of bug #679953 and add Jimmy Burgett for helping out to
Misc/ACKS.
2004-07-10 19:13:42 +00:00
Michael W. Hudson 30ea2f223f This closes patch:
[ 960406 ] unblock signals in threads

although the changes do not correspond exactly to any patch attached to
that report.

Non-main threads no longer have all signals masked.

A different interface to readline is used.

The handling of signals inside calls to PyOS_Readline is now rather
different.

These changes are all a bit scary!  Review and cross-platform testing
much appreciated.
2004-07-07 17:44:12 +00:00
Andrew M. Kuchling 93b4b88e96 [Patch #974633] Check PyObject_MALLOC return for error 2004-06-29 14:03:04 +00:00
Raymond Hettinger 70b3a1ab0a Fix leak found by Eric Huss. 2004-06-25 22:20:33 +00:00
Tim Peters 9ddf40b4e1 SF patch 876130: add C API to datetime module, from Anthony Tuininga.
The LaTeX is untested (well, so is the new API, for that matter).
Note that I also changed NULL to get spelled consistently in concrete.tex.
If that was a wrong thing to do, Fred should yell at me.
2004-06-20 22:41:32 +00:00
Brett Cannon 1c3fa18be7 shutil.move() will raise an exception when trying to move a directory into
itself.

Closes bug #919012  .  Thanks Johannes Gijsbers.
2004-06-19 21:11:35 +00:00
Brett Cannon c6c1f478d9 pydoc.stripid() is now case-insensitive for its regex to support platforms that
have pointer addresses in uppercase.

Closes bug #934282.  Thanks Robin Becker.
2004-06-19 01:02:51 +00:00
Raymond Hettinger 57c2d930f6 Add a final permutation step to the tuple hash function.
Prevents a collision pattern that occurs with nested tuples.
(Yitz Gale provided code that repeatably demonstrated the weakness.)
2004-06-10 18:42:15 +00:00
Andrew M. Kuchling b6568b91fd Add a name (old change sitting in my tree) 2004-06-02 15:37:04 +00:00
Raymond Hettinger 354433a59d SF patch #872326: Generator expression implementation
(Code contributed by Jiwon Seo.)

The documentation portion of the patch is being re-worked and will be
checked-in soon.  Likewise, PEP 289 will be updated to reflect Guido's
rationale for the design decisions on binding behavior (as described in
in his patch comments and in discussions on python-dev).

The test file, test_genexps.py, is written in doctest format and is
meant to exercise all aspects of the the patch.  Further additions are
welcome from everyone.  Please stress test this new feature as much as
possible before the alpha release.
2004-05-19 08:20:33 +00:00
Nicholas Bastin c723a14bfb ...for work done at PyCon 2004 (and beyond...) 2004-03-23 23:29:01 +00:00
Raymond Hettinger 31017aed36 SF #904720: dict.update should take a 2-tuple sequence like dict.__init_
(Championed by Bob Ippolito.)

The update() method for mappings now accepts all the same argument forms
as the dict() constructor.  This includes item lists and/or keyword
arguments.
2004-03-04 08:25:44 +00:00
Raymond Hettinger b32e640489 SF patch #875689: >100k alloc wasted on startup
(Contributed by Mike Pall.)

Make sure fill_free_list() is called only once rather than 106 times
when pre-allocating small ints.
2004-02-08 18:54:37 +00:00
Martin v. Löwis 12af0485f8 Patch #874083: Bluetooth support for socket module. 2004-01-31 12:34:17 +00:00
Raymond Hettinger 0c4102760c SF Patch #864863: Bisect C implementation
(Contributed by Dmitry Vasiliev.)
2004-01-05 10:13:35 +00:00
Andrew MacIntyre f1ca7f561c complete backout of listobject.c v2.171 2003-12-28 07:43:56 +00:00
Andrew MacIntyre d57caed52c Performance of list([]) in 2.3 came up in a thread on comp.lang.python,
which can be reviewed via
http://coding.derkeiler.com/Archive/Python/comp.lang.python/2003-12/1011.html

Duncan Booth investigated, and discovered that an "optimisation" was
in fact a pessimisation for small numbers of elements in a source list,
compared to not having the optimisation, although with large numbers
of elements in the source list the optimisation was quite beneficial.

He posted his change to comp.lang.python (but not to SF).

Further research has confirmed his assessment that the optimisation only
becomes a net win when the source list has more than 100 elements.

I also found that the optimisation could apply to tuples as well,
but the gains only arrive with source tuples larger than about 320
elements and are nowhere near as significant as the gains with lists,
(~95% gain @ 10000 elements for lists, ~20% gain @ 10000 elements for
tuples) so I haven't proceeded with this.

The code as it was applied the optimisation to list subclasses as
well, and this also appears to be a net loss for all reasonable sized
sources (~80-100% for up to 100 elements, ~20% for more than 500
elements; I tested up to 10000 elements).

Duncan also suggested special casing empty lists, which I've extended
to all empty sequences.

On the basis that list_fill() is only ever called with a list for the
result argument, testing for the source being the destination has
now happens before testing source types.
2003-12-25 13:28:48 +00:00
Martin v. Löwis d8921379e9 Patch #798297: Add IMAP THREAD command. 2003-11-10 06:44:44 +00:00
Guido van Rossum 967b063add Plug tempfile.mktemp() hole (Iustin Pop). 2003-11-10 02:27:19 +00:00