Commit Graph

13044 Commits

Author SHA1 Message Date
Benjamin Peterson 323c40d48c Make the Python implementation of warnings compatible with the C implementation regarding non-callable showwarning 2008-05-06 22:31:52 +00:00
Benjamin Peterson d295032910 Fix logic error in Python/_warnings.c and add a test to verify 2008-05-06 22:18:11 +00:00
Christian Heimes c8a0d2f368 Intern static string
Use float constructors instead of magic code for float constants
2008-05-06 16:18:41 +00:00
Gregory P. Smith 8e4997390c fix issue2707 - os.walk docstring example correctness typo. 2008-05-06 07:05:18 +00:00
Brett Cannon e3dcb01bfc Fix a bug in the handling of the stacklevel argument in warnings.warn() where
the stack was being unwound by two levels instead of one each time.
2008-05-06 04:37:31 +00:00
Benjamin Peterson 0b7f77847a PEP 8 nits in json package 2008-05-06 02:51:10 +00:00
Gregory P. Smith 24237ea8a1 Fix a bug introduced in r62627. see issue2760 and issue2632.
An assertion in readline() would fail as data was already in the
internal buffer even though the socket was in unbuffered read mode.
That case is now handled.  More importantly, read() has been fixed to
not over-recv() and leave newly recv()d data in the _fileobject buffer.

The max() vs min() issue in read() is now gone.  Neither was correct.
On bounded reads, always ask recv() for the exact amount of data we
still need.

Candidate for backporting to release25-maint along with r62627.
2008-05-05 21:53:45 +00:00
Brett Cannon 4b964f9c90 Add the 'json' package. Code taken from simplejson 1.9 and contributed by Bob
Ippolito.

Closes issue #2750.
2008-05-05 20:21:38 +00:00
Martin v. Löwis 5f2e0e5ccb Revert bogus checkin in r62724 to that file. 2008-05-05 17:54:01 +00:00
Martin v. Löwis c3ad68c88a Fix Unicode filename test. 2008-05-05 17:47:06 +00:00
Martin v. Löwis 471617d6d3 Issue #1734346: Support Unicode file names for zipfiles. 2008-05-05 17:16:58 +00:00
Brett Cannon 9c19bc6247 Remove the use of 'inspect' from 'warnings' for detected deprecated use of the
showwarning API. Turns out 'inspect' uses 'operator' which is an extension
module. That's a problem when it has not been built yet by setup.py.
2008-05-05 16:57:38 +00:00
Brett Cannon 8a232cc385 Add a DeprecationWarning for when warnings.showwarning() is set to a function
that lacks support for the new 'line' argument.
2008-05-05 05:32:07 +00:00
Benjamin Peterson 9ae080ee5a Remove method signatures from the docstrings of io.py 2008-05-04 22:39:33 +00:00
Georg Brandl 8d66dcd0f4 #2695: Do case-insensitive check for algorithms. 2008-05-04 21:40:44 +00:00
Gerhard Häring e11c9b3dfd Implemented feature request 2157: Converter names are cut off at '('
characters. This avoids the common case of something like 'NUMBER(10)' not
being parsed as 'NUMBER', like expected. Also corrected the docs about
converter names being case-sensitive. They aren't any longer.
2008-05-04 13:42:44 +00:00
Gerhard Häring 5a366c3b8b Applied sqliterow-richcmp.diff patch from Thomas Heller in Issue2152. The
sqlite3.Row type is now correctly hashable.
2008-05-04 13:15:12 +00:00
Mark Dickinson 71f3b85497 Make sure that Context traps and flags dictionaries have values 0 and 1
(as documented) rather than True and False.
2008-05-04 02:25:46 +00:00
Mark Dickinson 8aca9d032e Some very minor changes to decimal.py in Python 2.6, aimed
at reducing the size of the diff between the 2.x decimal.py
and 3.x decimal.py and thereby making future merges easier:

- replace one instnace of an old-style raise statement
- define __div__ in terms of __truediv__ instead of the
  other way around
- make wording match on an exception message
2008-05-04 02:05:06 +00:00
Benjamin Peterson 979395b7a8 Moved testing of builtin types out of test_builtin and into type specific modules 2008-05-03 21:35:18 +00:00
Mark Dickinson 1840c1abca Backport Raymond's changes in r60508 to Python 2.6.
'Context flags get set, not incremented'
2008-05-03 18:23:14 +00:00
Amaury Forgeot d'Arc 7684f85297 In test_io, StatefulIncrementalDecoderTest was not part of the test suite.
And of course, the test failed:
a bytearray was used without reason in io.TextIOWrapper.tell().

The difference is that iterating over bytes (i.e. str in python2.6) returns 1-char bytes,
whereas bytearrays yield integers.
This code should still work with python3.0
2008-05-03 12:21:13 +00:00
Brett Cannon 64a4bbeb25 Fix the C implementation of 'warnings' to infer the filename of the module that
raised an exception properly when __file__ is not set, __name__ == '__main__',
and sys.argv[0] is a false value.

Closes issue2743.
2008-05-03 03:19:39 +00:00
Ronald Oussoren 26f545c662 Fix for issue #2520 (cannot import macerrors) 2008-05-02 21:54:56 +00:00
Ronald Oussoren f2ef92cee7 Fix for #1905: PythonLauncher not working correctly on OSX 10.5/Leopard
This fixes both Python Launchar and the terminalcommand module.
2008-05-02 21:42:35 +00:00
Martin v. Löwis 6780a9dd9f Merged revisions 62263-62646 via svnmerge from
svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3

........
  r62470 | david.wolever | 2008-04-24 02:11:07 +0200 (Do, 24 Apr 2008) | 3 lines

  Fixed up and applied the patch for #2431 -- speeding up 2to3 with a lookup table.
........
  r62646 | martin.v.loewis | 2008-05-02 23:29:27 +0200 (Fr, 02 Mai 2008) | 2 lines

  Fix whitespace.
........
2008-05-02 21:30:20 +00:00
Facundo Batista ee340e501d Fixed some test structures. Thanks Mark Dickinson. 2008-05-02 17:39:00 +00:00
Mark Hammond 7c5c8e6823 #2581: Vista UAC/elevation support for bdist_wininst 2008-05-02 12:48:15 +00:00
Gregory P. Smith f8cc64017c This should fix issue2632. A long description of the two competing
problems is in the bug report (one old, one recently introduced trying
to fix the old one).  In short:

buffer data during socket._fileobject.read() and readlines() within a
cStringIO object instead of a [] of str()s returned from the recv()
call.

This prevents excessive memory use due to the size parameter being
passed to recv() being grossly larger than the actual size of the data
returned *and* prevents excessive cpu usage due to looping in python
calling recv() with a very tiny size value if min() is used as the
previous memory-use bug "fix" did.

It also documents what the socket._fileobject._rbufsize member is
actually used for.

This is a candidate for back porting to 2.5.
2008-05-02 07:26:52 +00:00
Benjamin Peterson 95287fa951 Remove some from __future__ import with_statements 2008-04-30 21:25:55 +00:00
Georg Brandl 655fc7012a #1748: use functools.wraps instead of rolling own metadata update. 2008-04-30 21:08:42 +00:00
Benjamin Peterson d8f2d0bdb3 make test_support's captured_output a bit more robust when exceptions happen 2008-04-30 21:03:58 +00:00
Georg Brandl 28e0873f1f #2719: backport next() from 3k. 2008-04-30 19:47:09 +00:00
Eric Smith 0a95063d73 Issue 2526, float.__format__ 'n' specifier does not support thousands grouping.
Implemented grouping, with tests.
Cleaned up PyOS_ascii_formatd by breaking reformatting into smaller functions.
2008-04-30 01:09:30 +00:00
Amaury Forgeot d'Arc 87da1278eb test_sundry performs minimal tests (a simple import...) on modules that are not tested otherwise.
Some of them now have tests and can be removed.
Only 70 to go...
2008-04-28 21:07:06 +00:00
Brett Cannon 8dc4303297 Rename the test_traceback_print() function to traceback_print() to prevent
test_capi from automatically calling the function.
2008-04-28 04:50:06 +00:00
Skip Montanaro b8bdbc04e7 Get rid of _test(), _main(), _debug() and _check(). Tests are no longer
needed (better set available in Lib/test/test_robotparser.py).  Clean up a
few PEP 8 nits (compound statements on a single line, whitespace around
operators).
2008-04-28 03:27:53 +00:00
Brett Cannon 141534e56f Fix a bug introduced by the warnings rewrite where tracebacks were being
improperly indented.

Closes issue #2699.
2008-04-28 03:23:50 +00:00
Skip Montanaro fe1372c7d5 Minor cleanups:
* Avoid creating unused local variables where we can.  Where we can't prefix
  the unused variables with '_'.
* Avoid shadowing builtins where it won't change the external interface of a
  function.
* Use None as default path arg to readmodule and readmodule_ex.
2008-04-28 02:57:23 +00:00
Skip Montanaro ea59a84244 A few small changes:
* The only exception we should catch when trying to import cStringIO is an
  ImportError.
* Delete the function signatures embedded in the mk*temp docstrings.
* The tempdir global variable was initialized twice.
2008-04-27 22:49:56 +00:00
Kurt B. Kaiser 83101909cb Autocompletion of filenames now support alternate separators, e.g. the
'/' char on Windows.  Patch 2061 Tal Einat.
2008-04-27 21:52:19 +00:00
Kurt B. Kaiser 9c5c0af804 Improved AutoCompleteWindow logic. Patch 2062 Tal Einat. 2008-04-27 21:38:05 +00:00
Kurt B. Kaiser 93cdae5f81 Home / Control-A toggles between left margin and end of leading white
space.  Patch 1196903 Jeff Shute.

M    idlelib/PyShell.py
M    idlelib/EditorWindow.py
M    idlelib/NEWS.txt
2008-04-27 21:07:41 +00:00
Alexandre Vassalotti ba08f072d2 Fixed URL of PEP 205 in weakref's module docstring. 2008-04-27 00:52:24 +00:00
Benjamin Peterson 14204ad982 Allow test_import to work when it is invoked directly 2008-04-25 21:43:56 +00:00
Mark Dickinson fe536f53ea Issue 2635: fix bug in the fix_sentence_endings option to textwrap.fill. 2008-04-25 16:59:09 +00:00
Thomas Heller 6ad5fbb7ea Add from_buffer and from_buffer_copy class methods to ctypes types. 2008-04-25 15:44:16 +00:00
Armin Rigo 5364e2e46f A new crasher. 2008-04-25 09:35:18 +00:00
Amaury Forgeot d'Arc 1c596d5604 Use absolute import for test package 2008-04-24 20:41:50 +00:00
Amaury Forgeot d'Arc 747720540c Add a few tests for pydoc.
This is a modified version of a patch proposed by Humberto Diogenes
in the discussion of issue1883.

I will merge manually this change into the py3k branch: the tests must be adapted.
2008-04-24 20:22:26 +00:00