Commit Graph

10334 Commits

Author SHA1 Message Date
Brett Cannon 5d0bf9446b Change time.strptime() to raise ValueError whenever there is an error in the
format string.  Before exceptions generated by the internal code propagated up
to the user and were not helpful.

Closes bug #1340337.
2005-11-02 23:04:26 +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
Vinay Sajip 245a5ab31b Exception handling now raises KeyboardInterrupt and SystemExit rather than passing to handleError 2005-10-31 14:27:01 +00:00
Vinay Sajip 85c1909a78 Exception handling now raises KeyboardInterrupt and SystemExit rather than passing to handleError 2005-10-31 13:14:19 +00:00
Tim Peters 383d3c0a68 test_directories(): This test had no chance of passing on
Windows.  Hacked it to pass, but not sure it's worth the
bother.
2005-10-30 01:15:38 +00:00
Fred Drake db390c1ad8 fix typos, mostly in comments 2005-10-28 14:39:47 +00:00
Neal Norwitz f339654280 Patch #1338314, Bug #1336623: fix tarfile so it can extract
REGTYPE directories from tarfiles written by old programs.

Will backport.
2005-10-28 05:52:22 +00:00
Marc-André Lemburg d9cf593b49 Cosmetic change: make all hex literals use upper case hex so that they
look more like the Unicode Consortium files.

Add ending new-line to all source files.
2005-10-24 12:14:59 +00:00
Marc-André Lemburg 3c72ded23d Removed the decoding_map from the codecs where this is possible.
Replaced the tis_620, cp1140 and koi8_u codecs with new ones
based on custom mapping files.
2005-10-24 12:07:49 +00:00
Neal Norwitz 6ab080cd40 Fix problem handling EXTENDED_ARGs from SF bug # 1333982 2005-10-24 00:08:10 +00:00
Neal Norwitz f8950654e3 Fix compiler test when run with -u (long mode) 2005-10-24 00:01:37 +00:00
Vinay Sajip 1e86beb3f8 One-off "No handlers..." error message only raised if raiseExceptions is set. 2005-10-23 22:32:59 +00:00
Neil Schemenauer d403c45386 Fix arigo's funky LOAD_NAME bug: implicit globals inside classes have
historically been looked up using LOAD_NAME, not LOAD_GLOBAL.
looked up by LOAD_NAME, not
2005-10-23 04:24:49 +00:00
Neal Norwitz ebc3457937 Revert previous checkin:
According to Jeremy, the comment only made sense when
the yield was disallowed.  Now it's testing that the yield
is allowed, so it's not bad and the outer finally is irrelevant.
2005-10-22 03:51:42 +00:00
Neil Schemenauer ab541bb98e Revert change, func_name of lambda's is back to <lambda>. 2005-10-21 18:11:40 +00:00
Marc-André Lemburg 0f00ba8bd8 Replace the old EBCDIC codecs with new ones using the decoding table. 2005-10-21 14:35:35 +00:00
Marc-André Lemburg 7797be7b3b Alias iso8859_1 to latin_1 which is the same encoding, but has
a much faster codec implementation.
2005-10-21 14:02:28 +00:00
Marc-André Lemburg 75c9e8392e Add a few more Mac OS encodings. The mapping tables for these are
available at ftp.unicode.org.
2005-10-21 13:58:32 +00:00
Marc-André Lemburg a1129f4b9b Replace the old charmap codecs with new ones generated from the current
mapping tables available at ftp.unicode.org.

These new codecs include and use character decoding tables which speeds
up decoding by a few factors.
2005-10-21 13:49:12 +00:00
Michael W. Hudson b2308bb9be Fix bug:
[ 1327110 ] wrong TypeError traceback in generator expressions

by removing the code that can stomp on the users' TypeError raised by the
iterable argument to ''.join() -- PySequence_Fast (now?) gives a perfectly
reasonable message itself.  Also, a couple of tests.
2005-10-21 11:45:01 +00:00
Neal Norwitz 37c0844b35 Fix SF bug #1167751, Argument genexp corner case
Incorrect code was generated for:

  foo(a = i for i in range(10))

This should have generated a SyntaxError.  Fix the Grammar so
it raises a SyntaxError and test it.

I'm uncertain whether this should be backported.  It makes
something that was Syntactically valid invalid.  However,
the code would either be completely broken or do the wrong thing.
2005-10-21 06:24:02 +00:00
Neal Norwitz 1e8659b963 Don't use a string exception since it's deprecated 2005-10-21 06:00:24 +00:00
Neal Norwitz f21c8ed58a Add comment lost from AST merge 2005-10-21 04:34:18 +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
Jeremy Hylton bc2a62fcfd Disable some tests in anticipation of merging ast-branch to the head 2005-10-20 14:27:21 +00:00
Neal Norwitz b0e32e2b71 Fix SF bug # 1330039, patch # 1331635 from Lars Gustaebel (tarfile maintainer)
Problem: if two files are assigned the same inode
number by the filesystem, the second one will be added
as a hardlink to the first, which means that the
content will be lost.

The patched code checks if the file's st_nlink is
greater 1. So only for files that actually have several
links pointing to them hardlinks will be created, which
is what GNU tar does.

Will backport.
2005-10-20 04:50:13 +00:00
Neal Norwitz 40563eddf1 Get BSD DB working most for version 3.2 2005-10-20 04:36:08 +00:00
Raymond Hettinger 4b0f20def3 Teach unquote() to handle unicode inputs 2005-10-15 16:41:53 +00:00
Vinay Sajip 239322b97e Optimised Placeholders handling of child loggers by using a dict rather than a list (much slower in the pathological case of hundreds of child Loggers to a Placeholder - problem reported by Ryan Blazecka). 2005-10-14 09:36:35 +00:00
Vinay Sajip b79350601b Added Host and Content-type headers to requests sent by HTTPHandler (suggested by Steven Vereecken) 2005-10-11 13:15:31 +00:00
Walter Dörwald 007f8dfde2 Bug #1245379: Add "unicode-1-1-utf-7" as an alias for "utf-7" as specified
by RFC 1642.
2005-10-09 19:42:27 +00:00
Georg Brandl b980113a8d Fix errors in _synthesize because of missing basename attribute of
browser controller classes.
2005-10-08 20:47:38 +00:00
Guido van Rossum c252c5964c Fix unit test failure -- the output received from Python can be empty,
but verify_valid_flag() wasn't expecting that.  Will backport.
2005-10-08 20:04:35 +00:00
Vinay Sajip 43d6e812c8 Fixed bug where the logging message was wrongly being demoted from Unicode to string (SF #1314107) 2005-10-07 08:35:36 +00:00
Walter Dörwald d1c1e10f70 Part of SF patch #1313939: Speedup charmap decoding by extending
PyUnicode_DecodeCharmap() the accept a unicode string as the mapping
argument which is used as a mapping table.

This code isn't used by any of the codecs yet.
2005-10-06 20:29:57 +00:00
Raymond Hettinger cc9a951f35 SF #1313496: bisect C replacement doesn't accept named args 2005-10-05 11:39:12 +00:00
Neal Norwitz 196f733d93 Fix pychecker warnings 2005-10-04 03:17:49 +00:00
Kurt B. Kaiser 389482ccbe Incorporate Tal Einat's comment on Patch 936169: Fixes alignment problem. 2005-10-03 20:08:25 +00:00
Kurt B. Kaiser 0a1357930a Tweak CodeContext.py docstrings, comments, and names. 2005-10-03 19:26:03 +00:00
Georg Brandl e8f244305e Patch #754022: Greatly enhanced webbrowser.py. 2005-10-03 14:16:44 +00:00
Neal Norwitz 11bd119226 SF bug #887946, segfault if redirecting directory
Also provide a warning if a directory is passed on the command line.
Add minimal command line test.

Will backport.
2005-10-03 00:54:56 +00:00
Kurt B. Kaiser 74910225df Increased performance in CodeContext extension Patch 936169 Noam Raphael 2005-10-02 23:36:46 +00:00
Neal Norwitz 40d3781416 - Fix segfault with invalid coding.
- SF Bug #772896, unknown encoding results in MemoryError, which is not helpful

I will only backport the segfault fix.  I'll let Anthony decide if he wants
the other changes backported.  I will do the backport if asked.
2005-10-02 01:48:49 +00:00
Georg Brandl 8b813db2ef bug [ 729103 ] Cannot retrieve name of super object 2005-10-01 16:32:31 +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
Georg Brandl aa93517de8 patch [ 1300515 ] xdrlib.py: pack_fstring() did not use null bytes for padding 2005-09-29 20:49:16 +00:00
Georg Brandl 80ba8e8549 bug [ 1296004 ] MemoryError in httplib 2005-09-29 20:16:07 +00:00
Armin Rigo dd5c023af5 some more fixes and tests for inspect.getsource(), triggered by crashes
from the PyPy project as well as the SF bug #1295909.
2005-09-25 11:45:45 +00:00
Raymond Hettinger 6b27cda643 Convert iterator __len__() methods to a private API. 2005-09-24 21:23:05 +00:00
Peter Astrand 3a708dfc88 Changed license header: Now simply referring to PSF. This closes bug
1138653.
2005-09-23 17:37:29 +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
Jack Jansen 19e11c86a7 MacOSX 10.4 apparently does not allow the creation time to be set to later
than the modification time. Changed the SetDates test to accomodate.

Backport candidate.
2005-09-21 20:52:11 +00:00
Armin Rigo f879024487 test and fix for buggy handling of exceptions raised by C functions,
causing the profiler to crash on an AssertionError if the same Python
function catches multiple exceptions from C functions.
2005-09-20 18:50:13 +00:00
Matthias Klose f3f231f60c - Patch #1166948: locale.py: Prefer LC_ALL, LC_CTYPE and LANG over LANGUAGE
to get the correct encoding.

- Patch #1166938: locale.py: Parse LANGUAGE as a colon separated list of
  languages.
2005-09-20 07:02:49 +00:00
Armin Rigo 3a703b6059 Reverted revision 1.83, which introduced a bug and subtle incompatibility
issues.  See bug #1112856.
2005-09-19 09:11:04 +00:00
Skip Montanaro f8948ca5d7 skip _locale test if OS X < 10.4 2005-09-19 03:54:46 +00:00
Martin v. Löwis 4ed673877d Patch #1268314: Cache lines in StreamReader.readlines for performance.
Will backport to Python 2.4.
2005-09-18 08:34:39 +00:00
Georg Brandl 9e28107ce8 Test case for latest complexobject fix. 2005-09-17 07:51:15 +00:00
Vinay Sajip 116f16e4ab Added lock acquisition around handler removal from logger 2005-09-16 10:33:40 +00:00
Raymond Hettinger 9bda1d6f64 No longer ignore exceptions raised by comparisons during key lookup.
Inspired by Armin Rigo's suggestion to do the same with dictionaries.
2005-09-16 07:14:21 +00:00
Brett Cannon a783d06f8c Clear out the regex cache when the TimeRE cache is invalidated by a locale
change.

Fixes bug #1290505.
2005-09-15 02:34:56 +00:00
Guido van Rossum 8ee3e5aa93 - Changes donated by Elemental Security to make it work on AIX 5.3
with IBM's 64-bit compiler (SF patch #1284289).  This also closes SF
  bug #105470: test_pwd fails on 64bit system (Opteron).
2005-09-14 18:09:42 +00:00
Gustavo Niemeyer 6fa0c5a452 Bug #1202493: Fixing SRE parser to handle '{}' as perl does, rather than
considering it exactly like a '*'.
2005-09-14 08:54:39 +00:00
Raymond Hettinger ebb7f30111 Speed-up escape() 2005-09-12 22:50:37 +00:00
Raymond Hettinger a1d09e2ded Minor cleanup. 2005-09-11 16:34:05 +00:00
Raymond Hettinger cf6b6326e5 Corrected version of 1.170 2005-09-10 18:17:54 +00:00
Raymond Hettinger 2bdec7bfb0 Revert 1.170. Add tests. 2005-09-10 14:30:09 +00:00
Raymond Hettinger 803ce801ab Simplify and speed-up unquote(). 2005-09-10 06:49:04 +00:00
Raymond Hettinger 957b126649 Simplify and speed-up quote_plus(). 2005-09-10 02:27:41 +00:00
Raymond Hettinger 199d2f7997 SF #1285086: urllib.quote is too slow
Simplify and speed-up quote() function.
2005-09-09 22:27:13 +00:00
Vinay Sajip 0ee9ba258e Added _handlerList to allow shutdown to flush and close handlers in reverse order of creation (see SF# 1282539) 2005-09-08 18:14:16 +00:00
Hye-Shik Chang e029da0aca Quote docstring with r"" to keep '\r\n' in example code. 2005-09-07 07:40:05 +00:00
Vinay Sajip c384fc2357 Changed _srcfile determination to support py2exe. 2005-09-02 11:20:33 +00:00
Walter Dörwald c5238b8288 SF bug #1235646: codecs.StreamRecoder.next() now reencodes the data it reads
from the input stream, so that the output is a byte string in the correct
encoding instead of a unicode string.
2005-09-01 11:56:53 +00:00
Georg Brandl cd3c26a717 Reverting previous checkin. This breaks too much of HTMLParser to be applied
without thought. Anyway, such malformed HTML is better handled by something
like BeautifulSoup.
2005-09-01 06:25:34 +00:00
Neal Norwitz 4ce69a5b06 No need to import exceptions, they are builtins 2005-09-01 00:45:28 +00:00
Neal Norwitz 6203196c7c Remove unused import 2005-09-01 00:39:02 +00:00
Georg Brandl a1be88e24d patch [ 1242454 ] shutil.copytree() quits too soon after an error. 2005-08-31 22:48:45 +00:00
Georg Brandl 7847405a76 bug [ 761452 ] HTMLParser chokes on my.yahoo.com output 2005-08-31 22:08:45 +00:00
Piers Lauder be5615ef99 updated __version__ 2005-08-31 10:50:03 +00:00
Piers Lauder 14f39402af changed select() so readonly flag is treated as a boolean 2005-08-31 10:46:29 +00:00
Walter Dörwald a47d1c08d0 SF bug #1251300: On UCS-4 builds the "unicode-internal" codec will now complain
about illegal code points. The codec now supports PEP 293 style error handlers.
(This is a variant of the Nik Haldimann's patch that detects truncated data)
2005-08-30 10:23:14 +00:00
Brett Cannon f1b2ba6aa1 Fix logic error introduced in last commit. Also add a comment to explain what
the code is doing.
2005-08-29 18:25:55 +00:00
Brett Cannon 6e372d1422 fix bug where str.find() was being misused where __contains__ should have been
used.
2005-08-27 19:25:59 +00:00
Martin v. Löwis 5dbdc59577 Patch #1168594: set sizes of non-regular files to zero. Fixes #1167128.
Will backport to 2.4.
2005-08-27 10:07:56 +00:00
Tim Peters 9e34c04732 Whitespace normalization (via reindent.py). 2005-08-26 15:20:46 +00:00
Tim Peters e8889c5741 testSeekBackwardsFromEnd(): Repair obvious syntax error. 2005-08-26 14:33:57 +00:00
Georg Brandl d603c04bcd Add list() around xreadlines() 2005-08-26 13:23:54 +00:00
Georg Brandl 62fe585b4b *** empty log message *** 2005-08-26 13:21:50 +00:00
Georg Brandl 5a650a253c patch [ 810023 ] Fix for off-by-one bug in urllib.URLopener.retrieve 2005-08-26 08:51:34 +00:00
Georg Brandl d2e3ba7a35 patch [ 756021 ] Allow socket.inet_aton("255.255.255.255") on Windows 2005-08-26 08:34:00 +00:00
Georg Brandl 905a01aba4 bug [ 1262320 ] minidom.py alternate newl support is broken 2005-08-25 22:14:15 +00:00
Georg Brandl 175a7dcf65 bug [ 1262320 ] minidom.py alternate newl support is broken 2005-08-25 22:02:43 +00:00
Martin v. Löwis 8b59514e57 Make IDNA return an empty string when the input is empty. Fixes #1163178.
Will backport to 2.4.
2005-08-25 11:03:38 +00:00
Georg Brandl 8246c439a8 Correct test suite for #848017. 2005-08-25 07:32:42 +00:00
Georg Brandl 532efabf1d patch #848017: make Cookie more RFC-compliant. 2005-08-24 22:34:21 +00:00
Georg Brandl e1b13d2019 Bug #735248: Fix urllib2.parse_http_list. 2005-08-24 22:20:32 +00:00
Georg Brandl a5a2088dd7 Bug 1016563: Bug in urllib2 proxy auth 2005-08-24 20:29:32 +00:00
Georg Brandl b925602f16 Patch [ 1062060 ] fix for 1016880 urllib.urlretrieve silently truncates dwnld 2005-08-24 18:46:39 +00:00
Martin v. Löwis 0a5d4a20e7 Patch #1167716: Support Unicode filenames in mkpath. Fixes #1121494.
Will backport to 2.4.
2005-08-24 14:55:22 +00:00