Commit Graph

4947 Commits

Author SHA1 Message Date
Eric S. Raymond 29bb115bae Clean up some argument profiles, enrich the docstring. 2001-08-20 13:16:30 +00:00
Skip Montanaro ae8454aeb3 of course I muffed it separating the notes code from the initial_value
code.  grrr...
2001-08-19 05:53:47 +00:00
Guido van Rossum 8cb00e2387 Avoid total dependency on the new module. This addresses the problem
reported by Greg Ball on python-dev.
2001-08-19 05:29:25 +00:00
Skip Montanaro b446fc7f27 add debug calls to self._note for the Semaphore class. This closes bug
443614.  I will submit a new feature request and patch to threading.py and
libthreading.tex to address the bounded semaphore issue.
2001-08-19 04:25:24 +00:00
Guido van Rossum 112ea6bfa6 Inspired by Greg Stein's proposed simplification of the _closesocket
class, I came up with an even simpler solution: raise the error in
__getattr__().
2001-08-18 21:00:39 +00:00
Tim Peters aa32070f4d Expose the CO_xxx flags via the "new" module (re-solving a problem "the
right way").  Fiddle __future__.py to use them.

Jeremy's pyassem.py may also want to use them (by-hand duplication of
magic numbers is brittle), but leaving that to his judgment.

Beef up __future__'s test to verify the exported feature names appear
correct.
2001-08-18 20:18:49 +00:00
Eric S. Raymond b60f2d0977 Framework code for compilerlike scripts. 2001-08-18 09:24:38 +00:00
Greg Stein 81937a4a12 Resolve patch #449367.
For the HTTPS class (when available), ensure that the x509 certificate data
gets passed through to the HTTPSConnection class. Create a new
HTTPS.__init__ to do this, and refactor the HTTP.__init__ into a new _setup
method for both init's to call.

Note: this is solved differently from the patch, which advocated a new
**x509 parameter on the base HTTPConnection class. But that would open
HTTPConnection to arbitrary (ignored) parameters, so was not as desirable.
2001-08-18 09:20:23 +00:00
Ka-Ping Yee 6cb0d4c632 Add some fairly important file extensions: bmp css doc mid midi mp2 mp3 xls.
Entries taken from the standard Debian mime.types file.
2001-08-18 04:06:54 +00:00
Ka-Ping Yee 6b5a48d48e Initial check-in of cgitb.
A few enhancements are pending, but this should work reliably.
2001-08-18 04:04:50 +00:00
Guido van Rossum e5e50591a4 When the socket is closed, don't just assign 0 to self._sock.
This breaks software that excepts a socket.error but not an
AttributeError.
2001-08-18 01:23:20 +00:00
Jeremy Hylton ab427b8cce Generate correct reprs for Mul, Add, etc. 2001-08-18 00:14:37 +00:00
Jeremy Hylton ec5bfd13ca Track removal of doc string from Module().nodes[0] 2001-08-18 00:07:46 +00:00
Jeremy Hylton 8548f9b183 Add Yield() node 2001-08-18 00:07:14 +00:00
Tim Peters 4fd9e2fc13 Remove the horrid generators hack from doctest.py. This relies on a
somewhat less horrid hack <wink>:  if a module does
    from __future__ import X
then the module dict D is left in a state such that (viewing X as a
string)
    D[X] is getattr(__future__, X)
So by examining D for all the names of future features, and making that
test for each, we can make a darned good guess as to which future-features
were imported by the module.  The appropriate flags are then sucked out
of the __future__ module, and passed on to compile()'s new optional
arguments (PEP 264).

Also gave doctest a meaningful __all__, removed the history of changes
(CVS serves that purpose now), and removed the __version__ vrbl (similarly;
before CVS, it was a reasonable clue, but not anymore).
2001-08-18 00:05:50 +00:00
Jeremy Hylton ec927348c2 Add Yield() statement handler
Fix Module() handler to avoid including the doc string in the AST
2001-08-18 00:04:31 +00:00
Tim Peters 9fa96bed6f Fix for bug [#452230] future division isn't propagated.
builtin_eval wasn't merging in the compiler flags from the current frame;
I suppose we never noticed this before because future division is the
first future-feature that can affect expressions (nested_scopes and
generators had only statement-level effects).
2001-08-17 23:04:59 +00:00
Tim Peters 6cd6a82db9 A fiddled version of the rest of Michael Hudson's SF patch
#449043 supporting __future__ in simulated shells
which implements PEP 264.
2001-08-17 22:11:27 +00:00
Martin v. Löwis 10d7255249 Use raw-unicode-escape for the tests that require it. 2001-08-17 22:08:34 +00:00
Guido van Rossum 65d5d7fac6 Add test for weak references. 2001-08-17 21:27:53 +00:00
Barry Warsaw d1795705de Test that uu.py will not override an existing file if out_file isn't
given and the path is gleaned from the uu header.
2001-08-17 20:00:11 +00:00
Barry Warsaw 59dae8ad36 decode(): Raise a uu.Error if no out_file is given but the file
specified in the uu header already exists.  No additional
    workaround is provided since out_file=pathname is a deprecated
    interface, so it is better to simply pass a file-like object into
    out_file anyway.  This closes SF bug #438083.

Use isinstance() tests instead of type comparisons.
2001-08-17 19:59:34 +00:00
Tim Peters de642bdc5d A self-contained piece of Michael Hudson's patch
#449043 supporting __future__ in simulated shells
in support of PEP 264.

Much has changed from the patch version:
+ Repaired bad hex constant for nested_scopes.
+ Defined symbolic CO_xxx names so global search will find these uses.
+ Made the exported list of feature names explicit, instead of abusing
  __all__ for this purpose (and redefined __all__ accordingly).
+ Added gross .compiler_flag verification to test___future__.py, and
  reworked it a little to make use of the newly exported explicit list
  of feature names.
2001-08-17 19:49:02 +00:00
Guido van Rossum b0a98e9c94 Address SF #451547. The approach is a bit draconian: any object that
is pickled as a global must now exist by the name under which it is
pickled, otherwise the pickling fails.  Previously, such things would
fail on unpickling, or unpickle as the wrong global object.  I'm
hoping that this won't break existing code that is playing tricks with
this.

I need a volunteer to do this for cPickle too.
2001-08-17 18:49:52 +00:00
Martin v. Löwis 339d0f720e Patch #445762: Support --disable-unicode
- Do not compile unicodeobject, unicodectype, and unicodedata if Unicode is disabled
- check for Py_USING_UNICODE in all places that use Unicode functions
- disables unicode literals, and the builtin functions
- add the types.StringTypes list
- remove Unicode literals from most tests.
2001-08-17 18:39:25 +00:00
Guido van Rossum 70297d3bd4 Change the 227 response parser to use a more liberal regular
expression.  This is needed for certain servers that (in violation of
the standard) don't return the parentheses in the response.

This fixes SF bug #441712 by Henrik Weber (not exactly using his
patch).
2001-08-17 17:24:29 +00:00
Guido van Rossum 84a79a8d25 classic(),metods(): add tests to verify that a bound method without a
class has a correct repr().
2001-08-17 13:58:31 +00:00
Guido van Rossum 93018760bc classic(), methods(): add another test relating to unbound methods:
when an unbound method of class A is stored as a class variable of
class B, and class B is *not* a subclass of class A, that method
should *not* get bound to B instances.
2001-08-17 13:40:47 +00:00
Guido van Rossum 7e1ff69271 Add early binding of methods to the 2nd metaclass example. 2001-08-17 11:55:58 +00:00
Guido van Rossum 309b566704 metaclass(): add tests for metaclasses written in Python: one that
subclasses type, one that doesn't (the latter isn't fully functional
yet).
2001-08-17 11:43:17 +00:00
Barry Warsaw f6365e0107 Added a test for module repr truncation when the package name is
really long.  Closes SF bug #437984.
2001-08-16 20:42:38 +00:00
Guido van Rossum 501c7c7d0e classobject.c:instancemethod_descr_get(): when a bound method is
assigned to a class variable and then accessed via an instance, it
should not be rebound.

test_descr.py:methods(): test for the condition above.
2001-08-16 20:41:56 +00:00
Andrew M. Kuchling db7aed5219 [Patch #441691] preprocess() method for Borland C compiler.
I have no way of testing this.
2001-08-16 20:17:41 +00:00
Tim Peters 4d2dded044 test_descr started breaking in yet another way in the same place. 2001-08-16 19:50:51 +00:00
Fred Drake 3791838339 New unit test for the mimetypes module, to avoid future regressions. 2001-08-16 18:36:59 +00:00
Fred Drake c81a06998f Another egregious error that copied the encodings info over the suffix
info.  Caught by the tests that I'm writing now.
2001-08-16 18:14:38 +00:00
Martin v. Löwis c47016ee74 Use (c)StringIO for collecting bytes. Fixes bug #451622. 2001-08-16 17:06:44 +00:00
Tim Peters 63a8d69476 Repair some accidents causing Windows failures:
+ test_compare.  While None compares less than anything else, it's not
  always the case that None has the smallest id().
+ test_descr.  The output of %p (pointer) formats varies across platforms.
  In particular, on Windows it doesn't produce a leading "0x".
2001-08-16 16:56:16 +00:00
Fred Drake c019ecb7fe Bad bug: the MimeTypes.readfp() was supposed to take a file object as a
parameter, but did not.  This was found because it can create failures
elsewhere based on the presence of mime.types files in some common locations
the module searches by default.

(I will be writing a test for this module shortly!)
2001-08-16 15:54:28 +00:00
Andrew M. Kuchling b1d6029437 [Patch #444854 from twburton]
Add executable extension, needed to get the program name right on Win32
2001-08-16 14:08:02 +00:00
Andrew M. Kuchling 6fb8d3a3d6 [Patch #442530 from twburton]
Provide include_dirs argument to all calls to ._preprocess and ._compile
    Fix typo: pattern.search(pattern) should be pattern.search(line)
2001-08-16 13:56:40 +00:00
Guido van Rossum 297abadc6b The change of type(None).__name__ from 'None' to 'NoneType' broke this
test in a trivial way.  Fixed.
2001-08-16 08:32:39 +00:00
Guido van Rossum a4ff6ab093 Add tests for overridable operators that have default interpretations
(__hash__ etc.), in static and dynamic classes, overridden and
default.
2001-08-15 23:57:59 +00:00
Just van Rossum ba634b2ec3 Rewrote Jack's latest change so it does what it intended to do... 2001-08-15 21:20:42 +00:00
Guido van Rossum 28962cc0ea Given a class without __cmp__ or __eq__, cmp() of two instances of
that class should compare the id() of those instances.  Add a test
that verifies this.  This test currently fails; I believe this is
caused by object.c:2.132 (Patch #424475 by loewis).
2001-08-15 21:02:20 +00:00
Guido van Rossum b5a136b05d Add a test to verify that bound methods work correctly. 2001-08-15 17:51:17 +00:00
Jack Jansen 31b5323c84 Don't remove non-directories from sys.path on the mac: files
can be on sys.path too.
2001-08-15 12:07:46 +00:00
Tim Peters e5614630fb Move one of the tests into the "PEP 255" section, to reflect a change in
the PEP.
2001-08-15 04:41:19 +00:00
Jeremy Hylton 9272b14d62 Fix typo in astgen script 2001-08-14 21:18:30 +00:00
Guido van Rossum 80e36750c8 Add a test for a weird bug I just discovered: a dynamic subclass
doesn't have a __dict__!
2001-08-14 20:00:33 +00:00
Jeremy Hylton 7713ac2ff1 Regenerated from new ast.txt and new astgen.py 2001-08-14 18:59:01 +00:00
Barry Warsaw 033daa49ea Test the new semantics for setting and deleting a function's __dict__
attribute.  Deleting it, or setting it to a non-dictionary result in a
TypeError.  Note that getting it the first time magically initializes
it to an empty dict so that func.__dict__ will always appear to be a
dictionary (never None).

Closes SF bug #446645.
2001-08-14 18:28:28 +00:00
Barry Warsaw b9c1d3dedf reload(exceptions) should not raise an ImportError, but should act
just like reload(sys).  Test that this is so.  Closes SF bug #422004.
2001-08-13 23:07:00 +00:00
Tim Peters 04601063e8 Repair Unix-specific assumptions that caused this to fail on Windows. 2001-08-13 22:25:24 +00:00
Barry Warsaw 406d46e185 found_terminator(): Add a debug print showing the data. 2001-08-13 21:18:01 +00:00
Fred Drake 3a28ca8fb8 Nick Mathewson: test suite for the class browser support module. 2001-08-13 20:26:19 +00:00
Fred Drake 03f7a70345 Nick Mathewson: Make sure the recursion is handled properly.
This is part of SF patch #440292.
2001-08-13 20:20:51 +00:00
Guido van Rossum 97dbec97bc Remove redundant import (PyChecker).
Update greeting message to avoid the long copyright notice.
2001-08-13 15:58:26 +00:00
Guido van Rossum 4a5555b19d Remove unused variable 'imports' from readmodule_ex(). 2001-08-13 15:55:19 +00:00
Guido van Rossum 8f15bd8500 Remove redundant 'import string' (PyChecker). 2001-08-13 15:48:06 +00:00
Guido van Rossum ef8f4dee07 Remove redundant imports (PyChecker). 2001-08-13 15:37:02 +00:00
Guido van Rossum a79bbaca54 Remove redundant 'import sys' (PyChecker). 2001-08-13 15:34:41 +00:00
Guido van Rossum f9f48812d0 Remove two redundant statements (PyChecker). 2001-08-13 15:30:22 +00:00
Guido van Rossum bfbc18dbf9 Remove redundant assignment l = [] from poll3() -- copy-and-paste
error.
2001-08-13 15:21:55 +00:00
Guido van Rossum 8710681400 Commenting out the getfillable() method -- it's broken, and nobody
remembers what it is supposed to do. :-(
2001-08-13 15:04:33 +00:00
Andrew M. Kuchling 7c2cf73811 Remove redefinition of has_option() method 2001-08-13 14:58:32 +00:00
Andrew M. Kuchling 8ea9227b1b Remove empty __init__ (PyChecker) 2001-08-13 14:55:17 +00:00
Andrew M. Kuchling f31d31373e Remove redefinition of writelines() method
Remove unused variable and import
2001-08-13 14:54:12 +00:00
Andrew M. Kuchling 77f9caf633 Remove unused variable (PyChecker) 2001-08-13 14:52:37 +00:00
Andrew M. Kuchling 1f877ef199 Remove some dead code (PyChecker) 2001-08-13 14:50:44 +00:00
Andrew M. Kuchling 86c7e22036 Add forgotten import (PyChecker) 2001-08-13 14:47:12 +00:00
Andrew M. Kuchling e7abf97903 Remove unused import (PyChecker) 2001-08-13 14:43:43 +00:00
Andrew M. Kuchling 6be424fdd6 Remove redundant import 2001-08-13 14:41:39 +00:00
Andrew M. Kuchling 994b51e906 Capture exception message (PyChecker) 2001-08-13 14:40:47 +00:00
Andrew M. Kuchling a49e0a0893 Remove unused imports (PyChecker) 2001-08-13 14:40:29 +00:00
Andrew M. Kuchling 3e44248483 Remove unused variable 2001-08-13 14:38:50 +00:00
Andrew M. Kuchling 118aa5337c Fix malformed line (PyChecker) 2001-08-13 14:37:23 +00:00
Guido van Rossum 49fa2bdaa1 Fix two bugs discovered by PyChecker. (I cannot test these, but I'm
confident that the old code was utterly broken -- the worse that can
happen is that the new code is still broken.)
2001-08-13 14:12:35 +00:00
Andrew M. Kuchling 246c425964 Fix for NameError caught by PyChecker.
(This command seems to be essentially untested; should fix that...)
2001-08-13 13:56:24 +00:00
Andrew M. Kuchling fd6608bcea Fix typo (PyChecker) 2001-08-13 13:48:55 +00:00
Andrew M. Kuchling fee3126eb3 Catch curses.error instead of a non-existent global (PyChecker)
Edit comment
2001-08-13 13:47:23 +00:00
Andrew M. Kuchling 40ea6177b9 Remove redundant import 2001-08-13 13:45:22 +00:00
Steven M. Gava 33277c767f further work on font config and general feel improvements 2001-08-13 04:36:58 +00:00
Tim Peters 5e824c37d3 SF patch #445412 extract ndiff functionality to difflib, from
David Goodger.
2001-08-12 22:25:01 +00:00
Jeremy Hylton 39f77bc90e Modify _Set to support iteration.
Otherwise printlist(surprise) will fail with a TypeError, because map
is called with an argument that doesn't support iteration.
2001-08-12 21:53:08 +00:00
Guido van Rossum d3077402c7 - Expand test for dynamic objects.
- Remove various 'global' directives and move some global definitions
  inside the test functions that use them -- we have nested scopes so
  the old hacks using globals are no longer needed.
2001-08-12 05:24:18 +00:00
Tim Peters a45da92484 Make the output of tests skipped readable (i.e., deliberately break it
into indented lines each of which probably fits on a typical screen line).
2001-08-12 03:45:50 +00:00
Guido van Rossum 9d4fe4298e dynamics(): add tests for dynamic *instances* (which are currently
broken).  Also fix an invalid reference to C (should be S).
2001-08-12 03:38:18 +00:00
Jeremy Hylton 08a6403973 Test the unary operator changes to the compiler 2001-08-12 02:22:27 +00:00
Guido van Rossum f73e30c3e3 Add the list of expected skips for Linux 2.x. Restructured the code a
little bit using a dictionary to avoid more code duplication as
more platforms are supported.
2001-08-12 02:22:19 +00:00
Tim Peters a2be2d624a Move line; reported on python-dev by Mark Favas (thanks!). 2001-08-12 02:01:09 +00:00
Tim Peters b5b7b78414 Teach regrtest which tests we *expect* to skip on Win32. Please teach it
about your platform too.
2001-08-12 01:20:39 +00:00
Steven M. Gava 28ccc2463e removed some cruft 2001-08-12 01:14:55 +00:00
Tim Peters a6a4f27ef7 _Condition.wait(): never sleep longer than the timeout time remaining,
and even if we have a long time left to wait, try the lock at least 20
times/second.
2001-08-12 00:41:33 +00:00
Jack Jansen dbc363ce35 The test assumed that the local pathname convention for "foo" would sort before "foo/bar", which is not true on the mac (where they are "foo" and ":foo:bar", respectively; ":foo" would be fine too, but "foo" is the preferred spelling). Fixed by sorting the output. 2001-08-11 23:22:43 +00:00
Jeremy Hylton d5d8fc559c Replace all type comparisons with isinstance() calls 2001-08-11 21:44:46 +00:00
Steven M. Gava c01e30f072 repair posix fonts fix 2001-08-11 15:48:13 +00:00
Martin v. Löwis 58682b7fe5 Only catch the errors that can actually occur, as reported in bug #411881. 2001-08-11 15:02:57 +00:00
Steven M. Gava abdfc4147d support for help menu changes 2001-08-11 07:46:26 +00:00
Steven M. Gava 5b3ac8f98f some re-design 2001-08-11 07:45:28 +00:00
Steven M. Gava 6b1ab255c2 supports about changes 2001-08-11 07:44:28 +00:00
Steven M. Gava 0ba4df89ab adjust help menu bindings 2001-08-11 07:42:37 +00:00
Fred Drake cd112f5546 Added tests for rich comparison operator functions.
Converted tests to PyUnit.
2001-08-11 03:21:35 +00:00
Guido van Rossum e45763a8e6 Add test for SF bug #442833 (multiple inheritance). 2001-08-10 21:28:46 +00:00
Guido van Rossum 61cf780b6d The message accompanying the TypeError exception on a readonly
attribute changed again.
2001-08-10 21:25:24 +00:00
Andrew M. Kuchling f4aa684132 [Bug #414032] Make the 'sdist' command work when the distribution contains
libraries.  This is done by adding a .get_source_files() method,
    contributed by Rene Liebscher and slightly modified.
Remove an unused local variable spotted by PyChecker
2001-08-10 20:24:33 +00:00
Guido van Rossum 6d94627f1e Allow AttributeError as well as TypeError for attribute-less objects. 2001-08-10 19:42:38 +00:00
Andrew M. Kuchling 13f4ea25d4 Remove unused variable 2001-08-10 19:00:41 +00:00
Andrew M. Kuchling 5079fe07fe Fix typo caught by PyChecker 2001-08-10 19:00:15 +00:00
Andrew M. Kuchling 665f248806 Add forgotten import 2001-08-10 18:59:59 +00:00
Fred Drake 981a1787b7 Wrap a comment to fit in 80 columns.
Use construction-syntax for an exception to make the argument easier
to read.
2001-08-10 18:59:30 +00:00
Andrew M. Kuchling db988b1ed3 Use .get_license() 2001-08-10 18:50:11 +00:00
Andrew M. Kuchling fa7dc57d6c [Bug #412271, bug #449009] Use 'license' as the attribute name,
though 'licence' is still supported for backward-compatibility
   (Should I add a warning to get_licence(), or not bother?)

Also fixes an UnboundLocalError noticed by PyChecker
2001-08-10 18:49:23 +00:00
Andrew M. Kuchling fcfc8d5c0e Patch #441091 from Finn Bock: the more advanced flush options are not
available in java, so only use the advanced flush options if they
  are defined in the zlib module.
2001-08-10 15:50:11 +00:00
Guido van Rossum 315cd29ecf Disable the sub() optimization until Fredrik has time to look into SF
bug #449000, "re.sub(r'\n', ...) broke".  This was Fredrik's
suggestion -- he's on vacation and said he wouldn't be able to work on
this until next week.
2001-08-10 14:56:54 +00:00
Guido van Rossum e056e4d15c Check in a testcase for SF bug #449000: re.sub(r'\n', ...) broke. 2001-08-10 14:52:48 +00:00
Jeremy Hylton a8b5f7d178 Remove hard-coded NT constants that are already defined in errno on NT.
Wrap some long lines.
Remove unnecessary tuple unpack.
2001-08-10 14:30:35 +00:00
Martin v. Löwis 9b75dca192 Expose nl_langinfo through locale where available. 2001-08-10 13:58:50 +00:00
Tim Peters ab9ba27dc0 Whitespace normalization. 2001-08-09 21:40:30 +00:00
Tim Peters c7ca3ffba3 Skip test_mhlib on Windows -- too many Unix assumptions. 2001-08-09 21:34:54 +00:00
Guido van Rossum e4deb959cc Fix two bugs detected by PyChecker: there's no need for redundant
"import MacOS", and there *is* a need for "import operator".
2001-08-09 21:22:15 +00:00
Andrew M. Kuchling 6386a4c846 Import UnknownFileError 2001-08-09 21:02:34 +00:00
Andrew M. Kuchling 106ffdb672 Import the errno module 2001-08-09 20:59:53 +00:00
Andrew M. Kuchling affadeb9fd Use correct variable name 2001-08-09 20:57:46 +00:00
Fred Drake eaa77e2ca1 Added tests for operator.floordiv() and operator.truediv(). 2001-08-09 20:23:08 +00:00
Guido van Rossum 3720261729 Restore the test for 'object' that I removed when object was
uninstantiable.  All is well now.
2001-08-09 19:45:21 +00:00
Guido van Rossum a995c91243 Use type(x).__name__ to get the name of the type instead of parsing
repr(type(x)).
2001-08-09 18:56:27 +00:00
Guido van Rossum 0263c80b90 Unittests for mhlib, by Nick Mathewson. 2001-08-09 18:18:08 +00:00
Tim Peters 55c12d4d5b SF patch #403640: incomplete proxy handling in URLLIB
Look specific to Windows.  Don't know whether it works.
2001-08-09 18:04:14 +00:00
Guido van Rossum f0713d3f4d SF Patch #420725 by Walter Doerwald:
For local files urllib.py doesn't return the MIME
  headers that the documentation says it does:

  http://www.python.org/doc/current/lib/module-
  urllib.html#l2h-2187 states that "When the method is
  local-file, returned headers will include a Date
  representing the file's last-modified time, a Content-
  Length giving file size, and a Content-Type containing
  a guess at the file's type"

  But in Python 2.1 the only header that gets returned
  is the Content-Type:

  >>> import urllib
  >>> f = urllib.urlopen("gurk.txt")
  >>> f.info().headers
  ['Content-Type: text/plain\n']
2001-08-09 17:43:35 +00:00
Martin v. Löwis c8718c13e8 Patch #403514: precompute _subst_format_str to avoid a call to
string.join() on each invocation of _bind.
2001-08-09 16:57:33 +00:00
Guido van Rossum 3c7a25a4d9 Applied SF patch #438424 by Josh Cogliati:
Python's logolike module turtle.py did not display
the turtle except when actually drawing lines.
This patch changes the turtle.py module so that
it displays the turtle at all times when tracing is
on. This is similar to the the way that logo works.
When tracing is off the turtle will not be displayed.
2001-08-09 16:42:07 +00:00
Martin v. Löwis dbdcb0fc3a Regenerate for glibc 2.2.3. 2001-08-09 12:48:17 +00:00
Martin v. Löwis 4414933f62 Regenerate for Solaris 8. 2001-08-09 12:33:32 +00:00
Martin v. Löwis 8cc965c1fb Patch #448474: Add support for tell() and seek() to gzip.GzipFile. 2001-08-09 07:21:56 +00:00
Guido van Rossum 64deef2b17 A test suite for binary operators, disguised as a rational number
class.
2001-08-08 22:27:20 +00:00
Greg Ward 034cbf1350 Typo fix (spelling mistake in error message). 2001-08-08 20:55:10 +00:00
Martin v. Löwis ff88556af6 Patch #449083: Use builtins to initalize the module. 2001-08-08 16:02:01 +00:00
Steve Purcell e00dde2087 Merged in bugfix from PyUnit CVS for problem reported by Gary Todd.
If 'unittest.py' was run from the command line with the name of a test
case class as a parameter, it failed with an ugly error. (Which was a
shame, because the documentation says you can do that.)

The problem was the old 'is the class X that you imported from me the same
as my class X?' gotcha.
2001-08-08 07:57:26 +00:00
Tim Peters a38d2608bc Regenerated token.py to account for new DOUBLESLASH and DOUBLESLASHEQUAL. 2001-08-08 06:35:56 +00:00
Guido van Rossum 96204f5e49 Add new tokens // and //=, in support of PEP 238. 2001-08-08 05:04:07 +00:00
Guido van Rossum 4668b000a1 Implement PEP 238 in its (almost) full glory.
This introduces:

- A new operator // that means floor division (the kind of division
  where 1/2 is 0).

- The "future division" statement ("from __future__ import division)
  which changes the meaning of the / operator to implement "true
  division" (where 1/2 is 0.5).

- New overloadable operators __truediv__ and __floordiv__.

- New slots in the PyNumberMethods struct for true and floor division,
  new abstract APIs for them, new opcodes, and so on.

I emphasize that without the future division statement, the semantics
of / will remain unchanged until Python 3.0.

Not yet implemented are warnings (default off) when / is used with int
or long arguments.

This has been on display since 7/31 as SF patch #443474.

Flames to /dev/null.
2001-08-08 05:00:18 +00:00
Steven M. Gava 074c9d2b20 beginning of work on the conf. handling smarts 2001-08-08 01:30:38 +00:00
Jeremy Hylton 54e99e8b3b Fix SF bug [ #447370 ] typo in urllib2.py
Also fix another bug caught by pychecker-- HTTPError() raised when
redirect limit exceed did not pass an fp object.  Had to change method
to keep fp object around until it's certain that the error won't be
raised.

Remove useless line in do_proxy().
2001-08-07 21:12:25 +00:00
Guido van Rossum 16fd3381d4 Apply two small changes to the Windows code, according to SF bug
#427345.  These are supposed to support binary data and avoid
buffering problems on Windows.
2001-08-07 19:55:10 +00:00
Fred Drake 56b5fdd295 Remove make_re() function; this is no longer needed since _sre and pcre
are now allowed by ok_builtin_modules.  This effectively backs out
revision 1.26.

This closes SF bug #448546.
2001-08-07 19:49:15 +00:00
Fred Drake c9fadf991c Add a test that xml.sax.saxutils.XMLGenerator does the right thing
when quoting attribute values that contain single & double quotes.

This provides the rest of the regression test for SF bug #440351.
2001-08-07 19:17:06 +00:00
Fred Drake dad91dd1e9 Make sure XMLGenerator uses quoteattr() instead of escape() to quote
attribute values.  Just using escape() can (and always has) led to broken
XML being generated.  This makes sure it always produces the right thing.

This actually closes SF bug #440351.
2001-08-07 19:14:46 +00:00
Guido van Rossum 288cd2cb69 Fix the test so it uses IterableUserDict for the "for x in dict" test. 2001-08-07 17:50:06 +00:00
Guido van Rossum 2050b65e84 Remove the __iter__ method from the UserDict class -- it can silently
break old code (in extreme cases).  See SF bug #448153.

Add a new subclass IterableUserDict that has the __iter__ method.

Note that for new projects, unless backwards compatibility with
pre-2.2 Python is required, subclassing 'dictionary' is recommended;
UserDict might become deprecated.
2001-08-07 17:40:42 +00:00