Commit Graph

7255 Commits

Author SHA1 Message Date
Martin v. Löwis f86e8ef33e Patch #550765: Add daemon_threads flag. 2002-11-22 08:08:44 +00:00
Piers Lauder e0273de432 added new IMAP4_stream class; added proxyauth command; added login_cram_md5 method 2002-11-22 05:53:04 +00:00
Raymond Hettinger 54405456e5 Implement dict() style constructor.
Already supported dict() and dict(mapping).
Now supports dict(itemsequence) and
Just van Rossum's new syntax for dict(keywordargs).

Also, added related unittests.

The docs already promise dict-like behavior
so no update is needed there.
2002-11-22 00:07:40 +00:00
Martin v. Löwis d899605e30 Patch #633547: Support plural forms. Do TODOs in test suite. 2002-11-21 21:45:32 +00:00
Guido van Rossum 21b60147e9 The _Event class should be more careful with releasing its lock when
interrupted.  A try/finally will do nicely.  Maybe other classes need
this too, but since they manipulate more state it's less clear that
that is always the right thing, and I'm in a hurry.

Backport candidate.
2002-11-21 21:08:39 +00:00
Andrew M. Kuchling fec3262691 Reflow comment 2002-11-21 20:41:07 +00:00
Martin v. Löwis 69ceb33bac Patch #642019: Recognize gcc-x.y as gcc. 2002-11-21 20:33:24 +00:00
Andrew M. Kuchling cdd215789c Bug #639118 from Ollie Oldham: archiver should use zipfile before zip
Previously archive_util.py attempted to spawn an
        external 'zip' program for the zip action, if this fails, an
        attempt to import zipfile.py is made...

        This bites folks who have 'old' or non-conforming zip
        programs on windows platforms.  This change tries the 'zipfile'
        module first, falling back to spawning a zip process if
        the module isn't available.
2002-11-21 18:33:28 +00:00
Tim Peters 97701b507b _RandomNameSequence(): style guide changes, small speedup, don't
put more in the critical section than absolutely needed, acquire
the mutex before the "try".
2002-11-21 15:59:59 +00:00
Tim Peters 6ef966e1ad _TemporaryFileWrapper: changed self.close_called to a proper bool. 2002-11-21 15:48:33 +00:00
Kurt B. Kaiser 4fc904708b Apply Nicolas Riley's Patch.
[ 634250 ] SearchDialogBase.py fix for Tk 8.4.1

SearchDialogBase refers to the grid 'col' option
considered ambiguous with Python 2.2.2 and Tk 8.4.1.
The correct name is 'column'.
2002-11-21 03:02:17 +00:00
Neal Norwitz 201626e00f Fix SF #640094, on win32 getpass runs into unix_getpass
Make sure we have a UNIX-compatible termios.
Apparently, McMillan Installer made a termios on windows
which caused unix_getpass() to be used instead of win_getpass().

Will backport.
2002-11-20 23:15:54 +00:00
Andrew M. Kuchling 2db92a6ee1 Add missing import 2002-11-20 16:10:29 +00:00
Walter Dörwald 7f82f7955e Add missing documentation for the PEP 293 functionality to
the codecs docstrings.
2002-11-19 21:42:53 +00:00
Walter Dörwald f171540ab8 Change int() so that passing a string, unicode, float or long argument
that is outside the integer range no longer raises OverflowError, but
returns a long object instead.

This fixes SF bug http://www.python.org/sf/635115
2002-11-19 20:49:15 +00:00
Martin v. Löwis 7a3bae410d Replace bsddb3 and _db occurrences. 2002-11-19 17:48:49 +00:00
Martin v. Löwis 1c6b1a2b4e Importing test suite from bsddb3 3.4.0 (with modifications). 2002-11-19 17:47:07 +00:00
Andrew M. Kuchling d448f66317 Add comment to Distutil files about requiring 1.5.2 compatibility, as
suggested by PEP 291.
2002-11-19 13:12:28 +00:00
Martin v. Löwis 6aa4a1f29c Import PyBSDDB 3.4.0. Rename historical wrapper to bsddb185. 2002-11-19 08:09:52 +00:00
Neil Schemenauer fe4f769fb8 Add __mod__ method to UserString. 2002-11-18 16:12:54 +00:00
Neil Schemenauer b981df9943 check for str.__mod__ 2002-11-18 16:12:11 +00:00
Neil Schemenauer ab9e4b76c2 check for unicode.__mod__ 2002-11-18 16:11:34 +00:00
Raymond Hettinger 311f419628 Improve comments. Clarify docs.
Replace "type(0)" with "int".
Replace "while 1" with "while True"
2002-11-18 09:01:24 +00:00
Raymond Hettinger 8ddc176e2e Improve DictMixin.
Replaced docstring with comments.  Prevents subclass contamination.
Added the missing __cmp__() method and a test for __cmp__().
Used try/except style in preference to has_key() followed by a look-up.
Used iteritem() where possible to save creating a long key list and
   to save redundant lookups.
Expanded .update() to look for the most helpful methods first and gradually
   work down to a mininum expected interface.
Expanded documentation to be more clear on how to use the class.
2002-11-18 04:34:10 +00:00
Eric S. Raymond 782d940866 Guard against error if .netrc is missing. 2002-11-17 17:53:12 +00:00
Neal Norwitz c4d047aad3 SF Patch #638825
Fix pychecker warnings, port arg was unused (it was always the default)
Need a global statement for _listener
2002-11-15 23:33:20 +00:00
Neal Norwitz d1cade0d1f SF Patch #638825 logging module
Fix pychecker warnings, remove unused imports and rename root
2002-11-15 23:31:28 +00:00
Tim Peters a1d004af04 Style guide reformats. I saw this test fail on a very heavily loaded
Win98SE box, but whatever the cause, it had scrolled off the DOS box.
(There was just the "test_queue failed" summary at the end of the
regrtest run.)
2002-11-15 19:08:50 +00:00
Raymond Hettinger 903bf90723 SF patch #520382: Expand shelve.py to have a full dictionary interface
and add a mixin to UserDict.py to make it easier to implement a full
dictionary interface.
2002-11-15 08:39:40 +00:00
Raymond Hettinger 7994716b6b SF patch #520382: Expand shelve.py to have a full dictionary interface
and add a mixin to UserDict.py to make it easier to implement a full
dictionary interface.
2002-11-15 06:46:14 +00:00
Guido van Rossum b9ba45894a Checking in Greg Ward's Optik, as optparse.py. This is the most
recent version from Greg's CVS.  I've changed the module docstring,
added a copyright notice, and renamed OptikError to OptParseError.

Still to do are documentation and unit tests.
2002-11-14 22:00:19 +00:00
Guido van Rossum 9a81892100 Fix or disable some tests that were affected by the new C3 MRO
algorithm, and add some new tests for the C3 algorithm.
2002-11-14 19:50:14 +00:00
Tim Peters c293704e93 This uses only one temp file at a time, so use test_support.TESTFN as
the name instead of enduring nanny "security warnings" from
tempfile.mktemp().
2002-11-14 16:23:29 +00:00
Guido van Rossum 3165786dd1 From SF patch 638299 [by Vinaj]: fileConfig() now takes an optional
defaults dictionary parameter which is passed to ConfigParser.
2002-11-14 12:52:17 +00:00
Neal Norwitz a4864a2464 Update the docstring to match the code. Will backport. 2002-11-14 03:31:32 +00:00
Neal Norwitz f539bdeb9c Sync Tix from Mike Clarkson, a maintainer 2002-11-14 02:43:40 +00:00
Andrew M. Kuchling a6483d2e9a Remove 'created by' lines; people can use CVS for this, and the information is often out of date 2002-11-14 02:25:42 +00:00
Neal Norwitz ef67956139 Fix typo in comment 2002-11-14 02:19:44 +00:00
Andrew M. Kuchling f6756e8dd4 Fix docstring typo; remove 'created' line 2002-11-14 01:58:48 +00:00
Andrew M. Kuchling 1cace1a30a [Bug #550364] Use sysconfig.get_python_version() 2002-11-14 01:44:35 +00:00
Andrew M. Kuchling 0ff98b9346 [Bug #550364] Add get_python_version() 2002-11-14 01:43:00 +00:00
Andrew M. Kuchling 9a38dcf057 [Bug #599248] ext module generation problem
If you have source files srcdir1/foo.c and srcdir2/foo.c, the
temporary .o for both files is written to build/temp.<platform>/foo.o.
This patch sets strip_dir to false for both calls to object_filename,
so now the object files are written to temp.<platform>/srcdir1/foo.o
and .../srcdir2/foo.o.

2.2 bugfix candidate
2002-11-14 01:29:00 +00:00
Eric S. Raymond b2db587b11 Make nntplib aware of ~/.netrc credentials; now they get used if they are
present and the caller has not specified a name/password pair.  This change
makes it less likely that a lazy coder will expose sensitive information in a
word-readable script.

Also, make the test a bit smarter.  If NNTPSERVER is defined in the environment
it will go talk to that server rather than look for a possibly nonexistent
local one named 'news'.  Maybe the osession initializer ought to look at
NNTPSERVER rather than requiring a host arg?  Must look around and see how
universal this convention is first.
2002-11-13 23:05:35 +00:00
Jeremy Hylton 4c8be8510b Add some simple tests of the persistence hooks. 2002-11-13 22:10:47 +00:00
Jeremy Hylton 5e0f4e73a9 Remove inst_persistent_id() WANNI (we ain't never needed it).
Add some simple tests of the persistence hooks.
2002-11-13 22:01:27 +00:00
Jeremy Hylton 0e1183ddff remove debugging print 2002-11-13 22:00:02 +00:00
Andrew M. Kuchling 3f1c9a916f Allow unknown keyword arguments to the Extension class, and warn about them. 2002-11-13 20:54:21 +00:00
Jeremy Hylton cd58b8f532 Add getstate and setstate implementation to concrete set classes. 2002-11-13 19:34:26 +00:00
Jeremy Hylton 77628658ca Remove some test code.
The buggy yahoo server was fixed, and the opalgroup test files are
gone.
2002-11-13 17:30:32 +00:00
Jeremy Hylton 22b3a49d3c Fix SF bug #637789: Handle Proxy-Connection header.
Also, remove unused local variable noted by pychecker.
2002-11-13 17:27:43 +00:00
Andrew M. Kuchling 33635aaf93 Back out part of rev. 1.53, restoring the use of the string module.
The two long lines have been reflowed differently; hopefully someone on
BeOS can test them.  Rev. 1.53 also converted string.atoi() to int(); I've
left that alone.
2002-11-13 17:03:05 +00:00
Guido van Rossum 455ab77f34 Get rid of #! lines, references to usage as __main__, README.txt, and
http://www.red-dove.com/python_logging.html.
2002-11-13 16:18:29 +00:00
Guido van Rossum 57102f861d Adding Vinay Sajip's logging package. 2002-11-13 16:15:58 +00:00
Raymond Hettinger c0b4034b81 Improved clarity and thoroughness of docstring.
Added design notes in comments.
Used better variable names.
Eliminated the unsavory "pool[-k:]" which was an aspiring bug (for k==0).
Used if/else to show the two algorithms in parallel style.
Added one more test assertion.
2002-11-13 15:26:37 +00:00
Fred Drake f2928eb017 Fix typo in comment. 2002-11-13 14:38:17 +00:00
Andrew M. Kuchling 8557156717 Update file 2002-11-13 13:26:59 +00:00
Andrew M. Kuchling ea002a1aff Docstring typo fix 2002-11-13 13:25:46 +00:00
Neal Norwitz 80a1bf4b5d Fix SF # 635969, No error "not all arguments converted"
When mwh added extended slicing, strings and unicode became mappings.
Thus, dict was set which prevented an error when doing:
	newstr = 'format without a percent' % string_value

This fix raises an exception again when there are no formats
and % with a string value.
2002-11-12 23:01:12 +00:00
Tim Peters b9099c3df4 SF patch 637176: list.sort crasher
Armin Rigo's Draconian but effective fix for

SF bug 453523: list.sort crasher

slightly fiddled to catch more cases of list mutation.  The dreaded
internal "immutable list type" is gone!  OTOH, if you look at a list
*while* it's being sorted now, it will appear to be empty.  Better
than a core dump.
2002-11-12 22:08:10 +00:00
Raymond Hettinger f24eb35d18 SF patch 629637: Add sample(population, k) method to the random module.
Used for random sampling without replacement.
2002-11-12 17:41:57 +00:00
Martin v. Löwis 3ae84b6389 Allow both string and Unicode objects in levels. 2002-11-09 20:19:12 +00:00
Martin v. Löwis 2411a2dd82 Don't try to convert the test filename to Unicode with -U. 2002-11-09 19:57:26 +00:00
Martin v. Löwis 838a359b95 Search for tix subdirectories. Fixes #564729. Will backport to 2.2. 2002-11-09 19:01:44 +00:00
Tim Peters 44a7910873 I already forgot what I changed -- it wasn't important <wink>. 2002-11-09 06:51:30 +00:00
Tim Peters 63c1081ae3 OK -- all tests pass on Windows now. The rest were due to 3 more
binary-vs-text-mode screwups.
2002-11-09 06:49:43 +00:00
Tim Peters 9de06bd605 More tests run on Windows now. Something is still wrong here, but no
idea what.  Added liberal XXX explanations for the next guy.
2002-11-09 06:45:31 +00:00
Tim Peters 499d09af92 Many changes to get this to pass on Windows, and to make it easier to
figure out what the code was doing.  The fixes were a combination of
closing open files before deletion, opening files in binary mode, and
plain skipping things that can't work on Windows (BaseTest.decompress
uses a process gimmick that doesn't exist on Windows, and, even if it
did, assumes a "bunzip2" executable is on PATH).
2002-11-09 06:31:56 +00:00
Tim Peters 3de75266aa Whitespace normalization. 2002-11-09 05:26:15 +00:00
Tim Peters e7130315a5 Comment out the test docstrings so we can at least tell which tests are
failing.
2002-11-09 05:22:41 +00:00
Tim Peters 230a60c6ec Whitespace normalization. 2002-11-09 05:08:07 +00:00
Tim Peters ae9cbee4da Open at least one binary file in binary mode. This allows a few of the
bz2 tests to pass on Windows; most are still failing.
2002-11-09 04:44:30 +00:00
Guido van Rossum 7cd83ca9ad Another attempt at making the set constructor both safe and fast. [SF
bug 628246]
2002-11-08 17:03:36 +00:00
Andrew M. Kuchling 91e77536e8 [Bug #233259] Ugly traceback for DistutilsPlatformError
Fixed by catching all exceptions that are subclasses of DistutilsError,
  so only the error message will be printed.  You can still get the
  whole traceback by enabling the Distutils debugging mode.
2002-11-08 16:18:24 +00:00
Andrew M. Kuchling 706867c20c Fix comment typo 2002-11-08 15:11:42 +00:00
Michael W. Hudson 006c75265f This is Richie Hindle's patch:
[ 631276 ] Exceptions raised by line trace function

It conflicted with the patches from Armin I just checked it, so I had
to so some bits by hand.
2002-11-08 13:08:46 +00:00
Martin v. Löwis 1f04610b49 Make strip behave as documented. Will backport to 2.2.3. 2002-11-08 12:09:59 +00:00
Tim Peters 0ec1ddcdcf _update(): Commented the new obscurity. Materialized into a tuple
instead of into a list for a bit of speed/space savings.  Reopened the
bug report too (628246), as I'm unclear on why we don't sort out the
cause of the TypeError instead.
2002-11-08 05:26:52 +00:00
Raymond Hettinger 1eb1fb814b Closes SF bug #628246.
The _update method detected mutable elements by trapping TypeErrors.
Unfortunately, this masked useful TypeErrors raised by the iterable
itself.  For cases where it is possible for an iterable to raise
a TypeError, the iterable is pre-converted to a list outside the
try/except so that any TypeErrors propagate through.
2002-11-08 05:03:21 +00:00
Thomas Heller 492620ae5e Use dynamic linking for the SHGetSpecialFolderPath function, it is not
always available on Windows NT. When the function cannot be loaded,
get_special_folder_path raises OSError, "function not available".

Compiled the exe, and rebuilt bdist_wininst.py.
2002-11-07 16:46:19 +00:00
Thomas Heller 8560bb8167 Fix a small bug when sys.argv[0] has an absolute path.
See http://mail.python.org/pipermail/distutils-sig/2002-November/003039.html
2002-11-07 16:41:38 +00:00
Gustavo Niemeyer fbceb01ef0 Fixed bug "[#466200] ability to specify a 'verify' script".
* Lib/distutils/command/bdist_rpm.py
  (bdist_rpm.initialize_options): Included verify_script attribute.
  (bdist_rpm.finalize_package_data): Ensure that verify_script is a filename.
  (bdist_rpm._make_spec_file): Included verify_script in script_options
  tuple.

* Misc/NEWS
  Mention change.
2002-11-06 18:44:26 +00:00
Walter Dörwald 4dbf192f2b Add next() and __iter__() methods to StreamReader, StreamReaderWriter
and StreamRecoder.

This closes SF bug #634246.
2002-11-06 16:53:44 +00:00
Walter Dörwald 07e147667c Make int("...") return a long if an int would overflow.
Also remove the 512 character limitation for int(u"...") and long(u"...").

This closes SF bug #629989.
2002-11-06 16:15:14 +00:00
Andrew M. Kuchling aca49b065b Fix NameError exception ('name' undefined) 2002-11-06 15:40:05 +00:00
Andrew M. Kuchling 9050a517c8 Fix docstring typos 2002-11-06 14:51:20 +00:00
Gustavo Niemeyer 4e7be06a65 Fixed bug #470582, using a modified version of patch #527371,
from Greg Chapman.

* Modules/_sre.c
  (lastmark_restore): New function, implementing algorithm to restore
  a state to a given lastmark. In addition to the similar algorithm used
  in a few places of SRE_MATCH, restore lastindex when restoring lastmark.
  (SRE_MATCH): Replace lastmark inline restoring by lastmark_restore(),
  function. Also include it where missing. In SRE_OP_MARK, set lastindex
  only if i > lastmark.

* Lib/test/re_tests.py
* Lib/test/test_sre.py
  Included regression tests for the fixed bugs.

* Misc/NEWS
  Mention fixes.
2002-11-06 14:06:53 +00:00
Finn Bock 57f0f3475e Skip the test_nocaret test when running as jython. Jython happens to add
a caret in this case too.
2002-11-06 11:45:15 +00:00
Finn Bock 41c570f2e7 Make the test pass for jython where there are no sys.executable. 2002-11-06 11:37:57 +00:00
Chui Tey 5a231c8f79 By default when getting the search menu, the currently highligted
text is the search term.
2002-11-06 02:18:45 +00:00
Barry Warsaw 210bd208eb Implement a `pp' command, which is like `p' except that it
pretty-prints the value of its expression argument.
2002-11-05 22:40:20 +00:00
Barry Warsaw da2525ed2a parse(), _parseheaders(), _parsebody(): A fix for SF bug #633527,
where in lax parsing, the first non-header line after a header block
(e.g. the first line not containing a colon, and not a continuation),
can be treated as the first body line, even without the RFC mandated
blank line separator.

rfc822 had this behavior, and I vaguely remember problems with this,
but can't remember details.  In any event, all the tests still pass,
so I guess we'll find out. ;/

This patch works by returning the non-header, non-continuation line
from _parseheader() and using that as the first header line prepended
to fp.read() if given.  It's usually None.

We use this approach instead of trying to seek/tell the file-like
object.
2002-11-05 21:44:06 +00:00
Barry Warsaw a0a00761a5 test_no_separating_blank_line(): A test for SF bug #633527, no
separating blank line between a header block and body text.

Tests both lax and strict parsing.
2002-11-05 21:36:17 +00:00
Barry Warsaw 847fdbbe71 A message with no separating blank line between the headers and the
body.  A test message for SF bug #633527.
2002-11-05 21:29:47 +00:00
Barry Warsaw 48b0a1c603 test_text_plain_in_a_multipart_digest(): A test of the fix for SF bug
#631350, where a subobject in a multipart/digest isn't a
message/rfc822.
2002-11-05 21:04:52 +00:00
Barry Warsaw 5c9130ec46 _parsebody(): A fix for SF bug #631350, where a subobject in a
multipart/digest isn't a message/rfc822.  This is legal, but counter
to recommended practice in RFC 2046, $5.1.5.

The fix is to look at the content type after setting the default
content type.  If the maintype is then message or multipart, attach
the parsed subobject, otherwise use set_payload() to set the data of
the other object.
2002-11-05 20:54:37 +00:00
Barry Warsaw 00e6a02ef8 Test case, distilled from SF bug #631350, where a subobject in a
multipart/digest isn't a message/rfc822.  This is legal, but counter
to recommended practice in RFC 2046, $5.1.5.
2002-11-05 20:53:18 +00:00
Tim Peters 9288f95cb5 Another round on SF patch 618135: gzip.py and files > 2G
The last round boosted "the limit" from 2GB to 4GB.  This round gets
rid of the 4GB limit.  For files > 4GB, gzip stores just the last 32
bits of the file size, and now we play along with that too.  Tested
by hand (on a 6+GB file) on Win2K.

Boosting from 2GB to 4GB was arguably enough "a bugfix".  Going beyond
that smells more like "new feature" to me.
2002-11-05 20:38:55 +00:00
Jeremy Hylton cd8fdbb3fa Repair inconsistent use of tabs and spaces. 2002-11-05 20:27:17 +00:00
Jeremy Hylton a5f4c071b5 Remove use of string module and reflow a couple of long lines. 2002-11-05 20:11:08 +00:00
Barry Warsaw 8f4dcbd3f6 Bump __version__ (yes, to 2.5 "minus") 2002-11-05 19:56:47 +00:00
Barry Warsaw 030ddf794f Jason Mastaler's patch to break the dependence on rfc822.py for the
address parsing routines.  Closes SF patch #613434.
2002-11-05 19:54:52 +00:00
Guido van Rossum e94d8fab56 Fix an old bug in poll(). When a signal is handled while we're
blocked in select(), this will raise select.error with errno set to
EINTR.  The except clauses correctly ignores this error, but the rest
of the logic will then call read() for all objects in select's *input*
list of read file descriptors.  Then when an object's read_handler()
is naive, it will call recv() on its socket, which will raise an
IOError, and then asyncore decides to close the socket.  To fix this,
we simply return in this case.

Backport candidate.
2002-11-05 18:41:20 +00:00
Michael W. Hudson 5da854fe51 This is Alex Martelli's patch
[ 633870 ] allow any seq assignment to a list slice

plus a very silly little test case of my own.
2002-11-05 17:38:05 +00:00
Gustavo Niemeyer f8ca8364c9 Patch implementing bz2 module.
* setup.py
  (PyBuildExt.detect_modules): Included bz2 module detection.

* Modules/bz2module.c
* Lib/test/test_bz2.py
* Doc/lib/libbz2.tex
  Included files implementing, testing, and documenting bz2 module.

* Doc/Makefile.deps
* Doc/lib/lib.tex
  Include references to libbz2.tex.

* Misc/NEWS
  (Library): Mention distutils' c++ linkage patch, and new bz2 module.
2002-11-05 16:50:05 +00:00
Gustavo Niemeyer 6b016852f8 This patch fixes the following bugs:
[#413582] g++ must be called for c++ extensions
[#454030] distutils cannot link C++ code with GCC

topdir = "Lib/distutils"

* bcppcompiler.py
  (BCPPCompiler.create_static_lib): Fixed prototype, removing extra_preargs
  and extra_postargs parameters. Included target_lang parameter.
  (BCPPCompiler.link): Included target_lang parameter.

* msvccompiler.py
  (MSVCCompiler.create_static_lib): Fixed prototype, removing extra_preargs
  and extra_postargs parameters. Included target_lang parameter.
  (MSVCCompiler.link): Included target_lang parameter.

* ccompiler.py
  (CCompiler): New language_map and language_order attributes, used by
  CCompiler.detect_language().

  (CCompiler.detect_language): New method, will return the language of
  a given source, or list of sources. Individual source language is
  detected using the language_map dict. When mixed sources are used,
  language_order will stablish the language precedence.

  (CCompiler.create_static_lib, CCompiler.link, CCompiler.link_executable,
   CCompiler.link_shared_object, CCompiler.link_shared_lib):
  Inlcuded target_lang parameter.

* cygwinccompiler.py
  (CygwinCCompiler.link): Included target_lang parameter.

* emxccompiler.py
  (EMXCCompiler.link): Included target_lang parameter.

* mwerkscompiler.py
  (MWerksCompiler.link): Included target_lang parameter.

* extension.py
  (Extension.__init__): New 'language' parameter/attribute, initialized
  to None by default. If provided will overlap the automatic detection
  made by CCompiler.detect_language(), in build_ext command.

* sysconfig.py
  (customize_compiler): Check Makefile for CXX option, and also the
  environment variable CXX. Use the resulting value in the 'compiler_cxx'
  parameter of compiler.set_executables().

* unixccompiler.py
  (UnixCCompiler): Included 'compiler_cxx' in executables dict, defaulting
  to 'cc'.
  (UnixCCompiler.create_static_lib): Included target_lang parameter.
  (UnixCCompiler.link): Included target_lang parameter, and made
  linker command use compiler_cxx, if target_lang is 'c++'.

* command/build_ext.py
  (build_ext.build_extension): Pass new ext.language attribute
  to compiler.link_shared_object()'s target_lang parameter. If
  ext.language is not provided, detect language using
  compiler.detect_language(sources) instead.

* command/config.py
  (config._link): Pass already available lang parameter as target_lang
  parameter of compiler.link_executable().
2002-11-05 16:12:02 +00:00
Michael W. Hudson 173f11da5d Some days, I think my comment of
/* this is harder to get right than you might think */

angered some God somewhere.  After noticing

    >>> range(5000000)[slice(96360, None, 439)]
    []

I found that my cute test for the slice being empty failed due to
overflow.  Fixed, and added simple test (not the above!).
2002-11-05 15:28:51 +00:00
Thomas Heller d7c14c6c9b Must now give the basename - not including directories - of the
install-script on the command line.

Recreated after recompilation of wininst.exe.
2002-11-05 10:06:19 +00:00
Raymond Hettinger 78a7aeeb1a SF 633560: tokenize.__all__ needs "generate_tokens" 2002-11-05 06:06:02 +00:00
Tim Peters a326f47a13 This stopped working on Windows, due to a reference to the non-existent
_locale.getdefaultlocale.  Guessing a leading underscore was intended,
but don't really understood this stuff (locale looks like Spanish for
the opposite of global to me <wink>).
2002-11-05 03:49:09 +00:00
Chui Tey 69371d6530 Set breakpoints on remote debugger 2002-11-04 23:39:45 +00:00
Chui Tey 72a8a3b2b8 Tidied up widget placement 2002-11-04 23:07:51 +00:00
Chui Tey a2adb0f6d9 Recalls breakpoints set in a file 2002-11-04 22:14:54 +00:00
Andrew M. Kuchling 29c8623e5c [Patch #588809] LDFLAGS support for build_ext.py, from Robert Weber
customize_compiler() now looks at various environment variables and uses
   their values to override the configured C compiler/preprocessor/linker
   binary and flags.
2002-11-04 19:53:24 +00:00
Tim Peters fb0ea525d5 Related to SF patch 618135: gzip.py and files > 2G.
Fixed the signed/unsigned confusions when dealing with files >= 2GB.
4GB is still a hard limitation of the gzip file format, though.

Testing this was a bitch on Win98SE due to frequent system freezes.  It
didn't freeze while running gzip, it kept freezing while trying to *create*
a > 2GB test file!  This wasn't Python's doing.  I don't know of a
reasonable way to test this functionality in regrtest.py, so I'm not
checking in a test case (a test case would necessarily require creating
a 2GB+ file first, using gzip to zip it, using gzip to unzip it again,
and then compare before-and-after; so >4GB free space would be required,
and a loooong time; I did all this "by hand" once).

Bugfix candidate, I guess.
2002-11-04 19:50:11 +00:00
Andrew M. Kuchling 47ca2bc661 [Patch #588809] Remove check of environment variables; sysconfig.py will do that now 2002-11-04 19:50:03 +00:00
Martin v. Löwis 574deae5b7 Patch #625823: Add symbolic constants for more commands. 2002-11-04 17:34:07 +00:00
Andrew M. Kuchling e2d1214c42 [Bug #620630] Flush stdout after logging every message. Without it,
when output is redirected to a file, compiler error messages show
   up before Distutils prints the command being invoked.
2002-11-04 14:27:43 +00:00
Andrew M. Kuchling 33a5edf89c Add get_distutil_options(); future setup.py files can use this to check
whether the Distutils being used supports a particularly capability.

   (This idea was originally suggested by Juergen Hermann as a method
    on the Distribution class.  I think it makes more sense as a
    function in core.py, and that's what this patch implements.)
2002-11-04 13:45:15 +00:00
Andrew M. Kuchling b6c316f134 [Bug #570655] Fix misleading option text 2002-11-04 13:33:07 +00:00
Martin v. Löwis 1da9c57c74 Patch #630829: Don't block on IAC, process suboptions. 2002-11-04 09:56:00 +00:00
Chui Tey a178cff979 [ 629984 ] Smaller font sizes not supported 2002-11-04 03:17:45 +00:00
Chui Tey 993e81a8a5 619127: Recent File Menu Not Updating 2002-11-04 03:11:10 +00:00
Martin v. Löwis f0a4668e6f Add getpreferredencoding. Support @euro modifiers. Fixes #554676.
The @euro part is backported to 2.2.3.
2002-11-03 17:20:12 +00:00
Neal Norwitz 26a1eefd0f Fix SF # 631066, running regrtest in user mode fails
Try to write to TESTFN, if that fails, try TESTFN in /tmp
If that fails, print a warning and go on.
Will backport.
2002-11-03 00:35:53 +00:00
Neal Norwitz e7629c85bc Skip test_dbm if we can't write to the file
Cleanup (remove) the file(s) after we are done with the test.
(Fixes problem on snake farm)
2002-11-02 18:25:08 +00:00
Raymond Hettinger 4f759d8504 Correct erroneous parenthesis placement in the delta from 1.63 to 1.64. 2002-11-02 02:02:46 +00:00
Finn Bock 57bc5fa60a Patch #631972: Adds an is_jython flag. 2002-11-01 18:02:03 +00:00
Fredrik Lundh 768c98bb0b patch #624180 (part 2 of 2):
use unquote on authentication strings, to allow users to embed
@ and : in user names and passwords (from Phillip Eby)
2002-11-01 17:14:16 +00:00
Finn Bock 218c5f9691 [SF bug 631713] use the import exeption message in the TestFailed
exception.
2002-11-01 11:33:00 +00:00
Greg Ward d1a72a0d5e Ad test_funky_hyphens() to test some screwy edge cases reported in SF
bug #596434.  (Alas, I don't think this completely covers that bug.)

Remove 'wrapper' argument from BaseTestCase.check_split() -- it's not
actually needed.
2002-10-31 16:11:18 +00:00
Thomas Heller 05c9335659 Fixes SF bug#614051: win32 build_ext problem. 2002-10-31 14:26:37 +00:00
Andrew M. Kuchling ccf4e421b8 Catch only ImportError 2002-10-31 13:39:33 +00:00
Andrew M. Kuchling ff4ad9a1ce Make the Distribution() constructor forgiving of unknown keyword
arguments, triggering a warning instead of raising an exception.  (In
1.5.2/2.0, it will print to stderr.)

Bugfix candidate for all previous versions.  This changes behaviour,
but the old behaviour wasn't very useful.  If Distutils version X+1
adds a new keyword argument, using the new keyword means your setup.py
file won't work with Distutils version X any more.
2002-10-31 13:22:41 +00:00
Raymond Hettinger d8ea2e080f Added missing class to __all__. 2002-10-30 06:20:37 +00:00
Raymond Hettinger a853cc6647 Added __all__. 2002-10-30 06:15:53 +00:00
Raymond Hettinger 39f02f98f5 Added missing names to __all__. 2002-10-30 06:09:58 +00:00
Raymond Hettinger 2b9bfb33ff Added new move() function to __all__. 2002-10-30 05:44:50 +00:00
Tim Peters fb05c4e5bb SF bug 630824: pydoc Helper keywords missing 'yield'
Wow, what a brittle subsystem!  Fixed, maybe, provided Fred doesn't
shuffle the docs around.

Bugfix candidate.
2002-10-30 05:21:00 +00:00
Raymond Hettinger edc853e2f4 Patrick K. O'Brien notices that kwlist was missing from __all__.
Added because it is part of the documented interface.
2002-10-30 05:17:22 +00:00
Guido van Rossum 2c9590f625 Added test for this fix to classobject.c:
Since properties are supported here, is possible that
instance_getattr2() raises an exception.  Fix all code that made this
assumption.

Backport candidate.
2002-10-29 19:08:29 +00:00
Fred Drake 6d8905012c Minor simplification. 2002-10-28 18:09:41 +00:00
Fred Drake 9142b19216 Remove unnecessary output file. 2002-10-28 17:59:24 +00:00
Fred Drake 32f3add267 Add a test of interaction between &amp; and extra replacements.
Remove extra noise from the output when there are no errors, and say more
in the exception when there are errors.
2002-10-28 17:58:48 +00:00
Fred Drake 407fea5197 Really do replacement of &amp; last to avoid bad interactions between &amp;
replacement and replacements based on the entities parameter.
2002-10-28 17:46:59 +00:00
Fred Drake f55222d98f Avoid calling __dict_replace() if we don't need to -- the call is much
more expensive than just doing to work needed, and these things seem
to always turn into a bottleneck eventually.
2002-10-28 17:29:01 +00:00
Martin v. Löwis 74b51ac1e5 Patch #613256: Add nescape method to xml.sax.saxutils. 2002-10-26 14:50:45 +00:00
Fred Drake 0eebd5cef9 Implement a safer and more predictable interpolation approach.
Closes SF bug #511737.
2002-10-25 21:52:00 +00:00
Fred Drake 98e3b29b59 Add tests for both raw and non-raw versions of the items() methods. 2002-10-25 20:42:44 +00:00
Fred Drake df393bd46a According to the docs, __name__ is not exposed via the API except
indirectly via %(__name__)s.  Not sure why, but maintain the
documented behavior for the new items() method.

Be a little more efficient about how we compute the list of options in
the ConfigParser.items() method.
2002-10-25 20:41:30 +00:00
Fred Drake 8811ce79f1 Remove useless output file. 2002-10-25 19:41:26 +00:00
Fred Drake c6f2891af8 Convert to PyUnit. 2002-10-25 19:40:49 +00:00
Fred Drake 3af0eb872a Added (very) minimal tests of the RawConfigParser class.
Moved the write() test to near the end of the file since it screws up
font-lock.  ;-(
2002-10-25 18:09:24 +00:00
Fred Drake fce6557c6b Re-factor: Use a RawConfigParser base class and make ConfigParser a
derived class that adds the ugly string interpolation code.  In the
process, changed all "__" methods and instance variables to "_".
2002-10-25 18:08:18 +00:00
Marc-André Lemburg 9cd87aaa54 Fix for bug #626172: crash using unicode latin1 single char
Python 2.2.3 candidate.
2002-10-23 09:02:46 +00:00
Kurt B. Kaiser 45186c4ce0 Implement Restoring Breakpoints in Subprocess Debugger
M Debugger.py
M EditorWindow.py
M PyShell.py

0. Polish PyShell.linecache_checkcache()
1. Move break clearing code to PyShell.PyShellEditorWindow from
   EditorWindow.
2. Add PyShellEditorWindow.breakpoints attribute to __init__, a list of
   line numbers which are breakpoints for that edit window.
3. Remove the code in Debugger which removes all module breakpoints when
   debugger is closed.  Want to be able to reload into debugger when
   restarted.
4. Moved the code which sets EditorWindow.text breakpoints from Debugger
   to PyShell.PyShellEditorWindow and refactored.
5. Implement reloading subprocess debugger with breakpoints from all open
   PyShellEditorWindows when debugger is opened or subprocess restarted.
6. Eliminate the break_set attribute, use the breakpoint list instead.
2002-10-23 04:48:08 +00:00
Greg Ward 4c486bc0c0 Add comment about inability to handle Unicode strings (hopefully a
temporary condition).
2002-10-22 18:31:50 +00:00
Fredrik Lundh 1303c7cb16 add support for basic authentication, based on patch #624180
by Phillip J. Eby
2002-10-22 18:23:00 +00:00
Raymond Hettinger 9ecf9ce161 Patches #626105:
Replaces the _center function in the calendar
module with the center method for strings.

For situations with uneven padding, the behavior is
slightly different in that the center method puts the
extra space on the right instead of the left.
2002-10-22 05:15:17 +00:00
Barry Warsaw 4111804548 test_body_encoding(): a new test for Charset.body_encode(), especially
one that tests the obscure bug reported in SF # 625509.
2002-10-21 05:43:58 +00:00
Barry Warsaw 34aa44538d test_body_encoding(): a new test 2002-10-21 05:31:08 +00:00
Barry Warsaw 3d57589f0f body_encode(): Fixed typo reported by Chris Lawrence, closing SF bug
#625509.  This isn't a huge problem because at the moment there are no
built-in charsets for which header_encoding is QP but body_encoding is
not.
2002-10-21 05:29:53 +00:00
Raymond Hettinger fca3bb6a29 Explicitly use floor division 2002-10-21 04:44:11 +00:00
Raymond Hettinger d058f08e03 Eliminate unused instance variable 2002-10-21 03:08:20 +00:00
Fredrik Lundh 37a0982278 point people to the Python bug tracker, rather than to a mail
account I hardly ever use...
2002-10-19 20:19:10 +00:00
Neal Norwitz 673cd824ba Fix SF # 624982, Potential AV in slot_sq_item, by Greg Chapman
Don't crash when getting value of a property raises an exception
2002-10-18 16:33:13 +00:00
Martin v. Löwis 9def6a3a77 Update to Unicode 3.2 database. 2002-10-18 16:11:54 +00:00
Martin v. Löwis e4913c9987 Patch #624936: Implement __contains__. 2002-10-18 08:58:14 +00:00
Neal Norwitz d8407a7031 Add new encoding for Ukrainian Cyrillic 2002-10-17 22:15:33 +00:00
Fred Drake 1e146e7876 Continue to work even though the test can be named test.test_regex
these days.
2002-10-17 22:13:28 +00:00
Fred Drake 7633d2393f Don't call warnings.resetwarnings(); that does bad things that cause
other tests to generate warning when they didn't before.  In
particular, this cancels not only filters set by -W, but also from
test.regrtest.
2002-10-17 22:09:03 +00:00
Fred Drake de4742b87f Remove spurious cruft from the output. 2002-10-17 20:36:08 +00:00
Guido van Rossum b390315872 Must catch TypeError from int(length). 2002-10-17 16:21:35 +00:00
Fred Drake f606e8d705 Added missing entries to __all__. 2002-10-16 21:21:39 +00:00
Fred Drake 707056580f Make sure we test urlsplit() / urlunsplit() directly, rather than
guessing that urlparse() / urlunparse() use them.

Add tests of urldefrag().
2002-10-16 21:02:36 +00:00
Thomas Heller 5b1614d568 Recreated after source changes. 2002-10-16 17:51:38 +00:00
Thomas Heller 0cf4269862 Recreated after source changes. 2002-10-15 19:45:25 +00:00
Martin v. Löwis 77ac429eff Patch #572628: Optional timeouts for put and get. 2002-10-15 15:11:13 +00:00
Thomas Heller d98d25e22d Revert the previous checkin - it didn't work anyway. 2002-10-15 14:51:58 +00:00
Guido van Rossum 6e5680fc83 For some reason (probably cut and paste), __ipow__ for new-style
classes was called with three arguments.  This makes no sense, there's
no way to pass in the "modulo" 3rd argument as for __pow__, and
classic classes don't do this.  [SF bug 620179]

I don't want to backport this to 2.2.2, because it could break
existing code that has developed a work-around.  Code in 2.2.2 that
wants to use __ipow__ and wants to be forward compatible with 2.3
should be written like this:

  def __ipow__(self, exponent, modulo=None):
      ...
2002-10-15 01:01:53 +00:00
Martin v. Löwis ff9284bc2e Allow Unicode strings as message and module name. 2002-10-14 21:06:02 +00:00
Martin v. Löwis 5357c6511d Convert empty string literal to string. Speed up creation of idmap. 2002-10-14 20:03:40 +00:00
Guido van Rossum bbc0568a5c Fix for 1.33: urlsplit() should only add '//' if scheme != ''.
Will add test and backport.
2002-10-14 19:59:54 +00:00
Barry Warsaw 67f8f2fe2a append(): Fixing the test for convertability after consultation with
Ben.  If s is a byte string, make sure it can be converted to unicode
with the input codec, and from unicode with the output codec, or raise
a UnicodeError exception early.  Skip this test (and the unicode->byte
string conversion) when the charset is our faux 8bit raw charset.
2002-10-14 16:52:41 +00:00
Barry Warsaw a74771c0b9 Two new tests for splitting (or not splitting) 8-bit header data. 2002-10-14 15:26:17 +00:00
Barry Warsaw 1a6ea3398e Bump the __version__ 2002-10-14 15:24:18 +00:00
Barry Warsaw 5e3bcff651 __init__(): Fix an invariant, that the charset item in a chunk tuple
must be a Charset instance, not a string.  The bug here was that
self._charset wasn't being converted to a Charset instance so later
.append() calls which used the default charset would break.

_split(): If the charset of the chunk is '8bit', return the chunk
unchanged.  We can't safely split it, so this is the avenue of least
harm.
2002-10-14 15:13:17 +00:00
Barry Warsaw 6c2bc46355 _split_header(): If we have a header which is a byte string containing
8-bit data, we cannot split it safely, so return the original string
unchanged.

_is8bitstring(): Helper function which returns True when we have a
byte string that contains non-ascii characters (i.e. mysterious 8-bit
data).
2002-10-14 15:09:30 +00:00
Barry Warsaw 7cd724049f CHARSETS: Add faux '8bit' encoding for representing raw 8-bit data for
which we know nothing else.
2002-10-14 15:06:55 +00:00
Guido van Rossum 0d976551fb Add finditer to __all__ (when defining it at all).
SF bug 585882.  Will forward-port.
2002-10-14 12:22:17 +00:00
Greg Ward 78cc051617 Fix copyright date: the core of this code actually dates back to 1999
(rev. 1.4 of distutils/fancy_getopt.py).
2002-10-13 19:23:18 +00:00
Martin v. Löwis 6f6873baa1 Patch #611760: read archives with comments. 2002-10-13 13:54:50 +00:00
Martin v. Löwis b24e3477dc Patch #621891: Add askopenfile{name}s. 2002-10-13 10:28:04 +00:00
Martin v. Löwis 2ec362717b Patch #621205: Tkinter updates for tk8.4. 2002-10-13 10:22:08 +00:00
Barry Warsaw 0c358258c9 _encode_chunks(), encode(): Don't modify self._chunks. As Ben says:
Also, it fixes a really egregious error in Header.encode() (really
    in Header._encode_chunks()) that could cause a header to grow and
    grow each time encode() was called if output_codec was different
    from input_codec.

Also, fix a typo.
2002-10-13 04:06:28 +00:00
Barry Warsaw ab9439fdd4 Update the urls and other information about the add-on Japanese,
Korean, and Chinese codecs.
2002-10-13 04:00:45 +00:00
Neal Norwitz 520cdf733a SF # 539360, webbrowser.py and konqueror, by Andy McKay
Fix Konqueror so it can start when calling open().
The assert needed to be on the raw URL, not openURL 'url...'

Will backport.
2002-10-11 22:04:22 +00:00
Jeremy Hylton e190663742 Typo in docstring 2002-10-11 17:27:55 +00:00
Jeremy Hylton 96f1129de8 Fix for SF bug #599836: Don't duplicate headers.
If the request object has a header, it should override the default
header provided by the OpenerDirector.
2002-10-11 17:26:46 +00:00
Fred Drake a0f453b2b1 Allow restricted code to get byteorder, getdefaultencoding(),
getrefcount(), maxunicode, and version_info.
2002-10-11 16:20:45 +00:00
Jeremy Hylton 83d0fd2fd1 Trying alphabet again 2002-10-11 16:05:07 +00:00
Jeremy Hylton a325c42b2d Sort names alphabetically. 2002-10-11 15:55:17 +00:00
Jeremy Hylton 69dc0c5bf5 Add hexversion to list of safe sys names (SF bug 621447).
Bug fix candidate.
2002-10-11 15:51:29 +00:00
Jeremy Hylton 3bd6fde4e3 Use fdopen() to create file from fd. 2002-10-11 14:36:24 +00:00
Michael W. Hudson 549ab8a98d A test for the recent overflow-in-format-crash bug.
Only runs when sys.maxint == 2**32 - 1; different things go wrong
on a 64-bit box.
2002-10-11 13:46:32 +00:00
Neal Norwitz 8dd28eb973 SF # 585913, Adds Galeon support to webbrowser.py 2002-10-10 22:49:29 +00:00
Martin v. Löwis e893f2f3b4 Remove more DOS support. 2002-10-10 18:17:08 +00:00
Barry Warsaw c986e54733 Bump version number to 2.4.2 to pick up the latest minor bug fixes. 2002-10-10 15:19:46 +00:00
Barry Warsaw dc8087b26e New tests to verify that charsets are case insensitive, and that by
default get_body_encoding() cannot be SHORTEST.
2002-10-10 15:14:22 +00:00
Barry Warsaw ee07cb1d70 get_content_charset(): RFC 2046 $4.1.2 says charsets are not case
sensitive.  Coerce the argument to lower case.
2002-10-10 15:13:26 +00:00
Barry Warsaw 14fc464ec9 __init__(): RFC 2046 $4.1.2 says charsets are not case sensitive.
Coerce the argument to lower case.  Also, since body encodings can't
be SHORTEST, default the CHARSETS failobj's second item to BASE64.
2002-10-10 15:11:20 +00:00
Martin v. Löwis 6ce1315bd3 Patch #612602: Streamline configure methods. 2002-10-10 14:36:13 +00:00
Kurt B. Kaiser 5afa1dfb72 M CallTips.py Add support for getting calltip from subprocess,
refactor a bit and clean up.

M PyShell.py       Cosmetic changes, delete blank lines, add # on some
                   blank lines.

M rpc.py           Add more debugging capability

M run.py           Add support for getting calltip from subprocess
                   Move import statements
2002-10-10 08:25:24 +00:00
Neal Norwitz 853ddd5cb9 SF #614596, fix for urllib2.AbstractBasicAuthHandler, John Williams (johnw42)
Make the regex case insensitive for some web sites which use Realm.
2002-10-09 23:17:04 +00:00
Skip Montanaro 628e3bf6cf MacOSX linker doesn't understand -R flag at all, no matter how you feed it
the flag.  Punt and return a -L flag instead (returning "" gums up the
command to be forked).
2002-10-09 21:37:18 +00:00
Guido van Rossum 06e2a5e052 Add special consideration for rlcompleter. As a side effect of
initializing GNU readline, setlocale(LC_CTYPE, "") is called, which
changes the <ctype.h> macros to use the "default" locale (which isn't
the *initial* locale -- the initial locale is the "C" locale in which
only ASCII characters are printable).  When the default locale is e.g.
Latin-1, the repr() of string objects can include 8-bit characters
with the high bit set; I believe this is due to the recent
PRINT_MULTIBYTE_STRING changes to stringobject.c.  This in turn screws
up test_pyexpat and test_rotor, which depend on the repr() of 8-bit
strings with high bit characters.

The solution (for now) is to force the LC_CTYPE locale to "C" after
importing rlcompleter.  This is the locale required by the test suite
anyway.
2002-10-09 18:17:06 +00:00
Martin v. Löwis 8b10f8988f Remove more DOS support. 2002-10-09 17:23:29 +00:00
Tim Peters 26bc25a6c4 Don't try to access sys.getwindowsversion unless it exists (ntpath is
imported on systems other than Windows, and in particular is imported
by test___all__; the compile farm reported that all Linux tests failed
due to this; isn't anyone in PythonDevLand running CVS on Linux?!).
2002-10-09 07:56:04 +00:00
Tim Peters 2a182dbf3f Logic for determining whether skipping test_pep277 is expected: whether
ths "should be" skipped depends on os.path.supports_unicode_filenames,
not really on the platform.  Fiddled the expected-skip constructor
appropriately.
2002-10-09 01:07:11 +00:00
Tim Peters cfac1d4a18 The
list(xrange(sys.maxint / 4))
test.  Changed 4 to 2.

The belief is that this test intended to trigger a bit of code in
listobject.c's NRESIZE macro that's looking for arithmetic overflow.  As
written, it doesn't achieve that, though, and leaves it up to the platform
realloc() as to whether it wants to allocate 2 gigabytes.  Some platforms
say "sure!", although they don't appear to mean it, and disaster ensues.

Changing 4 to 2 (just barely) manages to trigger the arithmetic overflow
test instead, leaving the platform realloc() out of it.

I'll backport this to the 2.2 branch next.
2002-10-08 21:01:07 +00:00
Mark Hammond 8696ebcd28 Add os.path.supports_unicode_filenames for all platforms,
sys.getwindowsversion() on Windows (new enahanced Tim-proof <wink>
version), and fix test_pep277.py in a few minor ways.
Including doc and NEWS entries.
2002-10-08 02:44:31 +00:00
Barry Warsaw 08c82b8086 openfile(): Go back to opening the files in text mode. This undoes
the change in revision 1.11 (test_email.py) in response to SF bug
#609988.  We now think that was the wrong fix and that WinZip was the
real culprit there.
2002-10-07 17:27:55 +00:00
Barry Warsaw 487fe6ac39 _parsebody(): Use get_content_type() instead of the deprecated
get_type().  Also, one of the regular expressions is constant so might
as well make it a module global.  And, when splitting up digests,
handle lineseps that are longer than 1 character in length
(e.g. \r\n).
2002-10-07 17:27:35 +00:00
Martin v. Löwis 45bb87bc13 Use escaped Unicode literals, according to PEP 8. 2002-10-07 17:27:15 +00:00
Barry Warsaw 1d475d3452 Bump the version to 2.4.1 (not 2.5 as previously mentioned) to sync it
with the standalone mimelib package.
2002-10-07 17:20:25 +00:00
Martin v. Löwis e9ce0b0fea Patch #448038: Add move(). Report errors from copytree as in shutil.Error. 2002-10-07 13:23:24 +00:00
Martin v. Löwis bb20bb6bdb Patch #619493: Prefer rpmbuild over rpm if available. Backported to 2.2. 2002-10-07 05:57:21 +00:00
Guido van Rossum 9cce029e48 Add test_pep277 to the expected skips on Linux. (This test seems to
be skipped everywhere except on Windows NT and descendants, but I'm
only going to add it to the skip list for the platform I can test.)
2002-10-06 20:36:31 +00:00
Martin v. Löwis 49c05d39e3 Patch #572031: AUTH method LOGIN for smtplib
(most of the patch hides in rev. 1.59). Backported to 2.2.
2002-10-06 17:55:08 +00:00
Guido van Rossum b03fac2ded Make sure the email test suite can be run both stand-alone and under
supervision of regrtest.py.  Will backport to 2.2.2.
2002-10-06 14:37:11 +00:00
Kurt B. Kaiser c9a5b5c72e Apply Josh Robb's Patch:
[ 617097 ] EditorWindow.py: underline recent files

Added a couple of mods to reduce the indentation level.

Note that the recent files menu doesn't update until
Idle is restarted, pre-existing bug, at least on Linux.
2002-10-06 01:57:45 +00:00
Tim Peters 1ee401fcf6 This test fails on Win98, which is fine, but when it failed it left
a junk directory behind that caused 4 other tests to fail later.  Now
it cleans up after itself, and the 4 bogus later failures don't happen.
2002-10-05 17:54:56 +00:00
Kurt B. Kaiser beb6bd9659 Josh Robb's Patch
[ 617109 ] WindowList.py: fix win98 quit.
2002-10-04 21:54:41 +00:00
Kurt B. Kaiser a1dee06983 Apply Josh Robb's Patch
[ 617125 ] EditorWindow.py: Fix the wrap
(used 'none' instead of NONE)
2002-10-04 21:33:57 +00:00
Guido van Rossum c8c6065231 When looking for an alias, first look for the normalized name (which
still may contain dots), then if that doesn't exist look for the name
with dots replaced by underscores.  This is a little more forgiving.
2002-10-04 20:49:05 +00:00
Raymond Hettinger bfcdb8734e .iterkeys() is not needed. 2002-10-04 20:01:48 +00:00
Marc-André Lemburg 8dc5ff2e5a Undo the removal. Guido mentioned that the encoding name is in active
by some email headers.
2002-10-04 16:30:42 +00:00
Marc-André Lemburg 68fc27385d Remove unneeded alias. 2002-10-04 15:57:03 +00:00
Marc-André Lemburg a40ea75625 Fix doc-string. 2002-10-04 11:58:24 +00:00
Marc-André Lemburg 9d158bb66f Adapt lookup names to new more general encoding name normalization
scheme.
2002-10-04 11:51:39 +00:00
Marc-André Lemburg 7012673d67 Extending the encoding name normalization to handle more non-alphanumeric
characters.
2002-10-04 11:45:38 +00:00
Marc-André Lemburg c7cdd7182a Pulling Mark Alexander's contribution from CVS. 2002-10-04 09:30:06 +00:00
Mark Hammond 7995eb22f1 Tests for pep277 - Unicode file names on Windows NT. 2002-10-03 23:14:10 +00:00
Michael W. Hudson adf1606161 Updates to track Grammar changes. The patch to token.py loosens the regexp to
allow "testlist1" to be snagged.
2002-10-03 09:42:01 +00:00
Mark Hammond c2e85bd4e2 Patch 594001: PEP 277 - Unicode file name support for Windows NT. 2002-10-03 05:10:39 +00:00
Guido van Rossum eb287a2662 Fix an endcase bug: initial_indent was ignored when the text was short
enough to fit in one line.
2002-10-02 15:47:32 +00:00
Michael W. Hudson fb4d6ecd07 Fix for the recursion_level bug Armin Rigo reported in sf
patch #617312, both on the trunk and the 22-maint branch.

Also added a test case, and ported the test_trace I wrote for HEAD
to 2.2.2 (with all those horrible extra 'line' events ;-).
2002-10-02 13:13:45 +00:00
Barry Warsaw 0ac885e821 test__all__(): Fix the import list. 2002-10-01 17:57:06 +00:00
Skip Montanaro 70e1d9b59d save the verbose argument as an instance attributes. Subclasses of
CCompiler may rely on the presence of self.verbose (SciPy's distutils
appears to).
2002-10-01 17:39:59 +00:00
Guido van Rossum cc3a6df506 Commit fix for SF 603831.
Strangely, two out of three patches there seem already committed; but
the essential one (get rid of the assert in object_filenames in
ccompiler.py) was not yet applied.

This makes the build procedure for Twisted work again.

This is *not* a backport candidate despite the fact that identical
code appears to exist in 2.2.2; Twisted builds fine there, so there
must have been a change elsewhere.
2002-10-01 04:14:17 +00:00
Barry Warsaw 2d7fab1a45 Docstring consistency with the updated .tex files. 2002-10-01 00:52:27 +00:00
Barry Warsaw 1f84ff1d40 _structure(): Swap fp and level arguments. 2002-10-01 00:51:47 +00:00
Barry Warsaw 0ebc5c96c5 Docstring consistency with the updated .tex files. 2002-10-01 00:44:13 +00:00
Barry Warsaw 12272a2f22 Docstring consistency with the updated .tex files. 2002-10-01 00:05:24 +00:00
Barry Warsaw 48330687f3 Docstring consistency with the updated .tex files. 2002-09-30 23:07:35 +00:00
Barry Warsaw 0031982c21 Docstring consistency with the updated .tex files. 2002-09-30 22:15:00 +00:00
Barry Warsaw 03a7559654 Docstring consistency with the updated .tex files. 2002-09-30 21:29:10 +00:00
Barry Warsaw fd2e8f7ea6 Docstring consistency with the updated .tex files. 2002-09-30 21:24:00 +00:00
Barry Warsaw 419b284b7c __all__: Updated 2002-09-30 20:41:33 +00:00
Barry Warsaw 057b8428d0 Docstring consistency with the updated .tex files. 2002-09-30 20:07:22 +00:00
Guido van Rossum 679113702c Now that TestCase is a new-style class, change loadTestsFromModule and
loadTestsFromName to accept new-style classes too!
2002-09-30 19:25:56 +00:00
Barry Warsaw 42d1d3edc0 __contains__(): Change the second argument to `name' for consistency.
I seriously doubt this will break any deployed code.

Docstring consistency with the updated .tex files.
2002-09-30 18:17:35 +00:00
Martin v. Löwis 21ee4091e1 Patch #615069: Fix build problems on SCO Open Server 5. Backported to 2.2. 2002-09-30 16:19:48 +00:00
Barry Warsaw 174aa49a88 With help from Martin v. Loewis, clarification is added for the
semantics of header chunks using byte and Unicode strings.
Specifically,

append(): When the given string is a byte string, charset (whether
specified explicitly in the argument list or implicitly via the
constructor default) is the encoding of the byte string, and a
UnicodeError will be raised if the string cannot be decoded with that
charset.  If s is a Unicode string, then charset is a hint specifying
the character set of the characters in the string.  In this case, when
producing an RFC 2822 compliant header using RFC 2047 rules, the
Unicode string will be encoded using the following charsets in order:
us-ascii, the charset hint, utf-8.

__init__(): Use the global USASCII Charset instance when the charset
argument is None.  Also, clarification in the docstring.

Also, use True/False where appropriate.
2002-09-30 15:51:31 +00:00
Jason Tishler 884554dfe5 Patch #544740: test_commands test fails under Cygwin
Relax regular expression to handle spaces in user and group names.
2002-09-30 15:44:41 +00:00
Barry Warsaw d20b66537c The ansi_x3.4_1968 encoding is an alias for ascii, but isn't known in
Python 2.1.3.  However it's required by the email tests suite, so poke
it into the encodings aliases if it's missing.  The is apparently the
approved API for doing so.

Now we can remove the hexversion shortcircuits in the test suite.
2002-09-30 15:23:17 +00:00
Tony Lownds f2324b9e89 Finding a suitable interpreter to spawn needed tweaking on the Mac 2002-09-29 00:34:10 +00:00
Guido van Rossum bffa52f07f Whitespace normalization (get rid of tabs). 2002-09-29 00:25:51 +00:00
Tony Lownds af7a302c78 Mac users now see correct modifiers in the Key Binding Entry window. 2002-09-29 00:23:08 +00:00
Tony Lownds 6565b261b6 Change key binding to avoid conflict. 2002-09-29 00:10:15 +00:00
Barry Warsaw d63071b05f Make the tests pass under Python 2.1 but only by cheating. Python 2.1
doesn't know about the ansi-x3.4-1968 charset so skip two tests that
rely on that (msg_32.txt and msg_33.txt).
2002-09-28 21:22:52 +00:00
Barry Warsaw eecdc742f5 Add a test for SHORTEST encoding of utf-8 headers, and also update
some of the test values which change because of this.
2002-09-28 21:04:19 +00:00
Barry Warsaw c202d93e0e Use True/False everywhere, and other code cleanups. 2002-09-28 21:02:51 +00:00
Barry Warsaw f776e6922c Code cleanup and add docstrings. 2002-09-28 20:52:26 +00:00
Barry Warsaw 5bdb2bee37 Use True/False everywhere, and other code cleanups. 2002-09-28 20:49:57 +00:00
Barry Warsaw e03e8f09eb Use True/False everywhere. 2002-09-28 20:44:58 +00:00
Barry Warsaw 4ece778bbc is_multipart(): Use isinstance() instead of type equality. 2002-09-28 20:41:39 +00:00
Barry Warsaw c494549566 Docstring and code cleanups, e.g. use True/False everywhere. 2002-09-28 20:40:25 +00:00
Barry Warsaw bba6b0243e __init__(): Minor code cleanup. 2002-09-28 20:27:28 +00:00
Barry Warsaw 5f253279d6 Add a pychecker suppression. 2002-09-28 20:25:15 +00:00
Barry Warsaw 56835dd961 Use True/False everywhere. 2002-09-28 18:04:55 +00:00
Barry Warsaw 5932c9bedd Added a feature suggested by Martin v Loewis, where a new header
encoding flag SHORTEST means to return the shortest encoding between
base64 and qp.  This is used for the header_enc for utf-8.  SHORTEST
isn't legal for body_enc.

Also some code cleanup:

- use True/False everywhere
- use == instead of `is' in a few places
- added _unicode() and make consistent the "is unicode" checks
- update docstrings
2002-09-28 17:47:56 +00:00
Fred Drake 176916a989 Allow internal whitespace in keys.
Closes SF bug #583248; backporting to r22-maint branch.
2002-09-27 16:21:18 +00:00
Fred Drake 2ca041fde0 items(): New method, provided by Gustavo Niemeyer in SF bug #545096. 2002-09-27 15:49:56 +00:00
Fred Drake 309db061af Added regression test for SF bug #561822: has_option() case sensitive. 2002-09-27 15:35:23 +00:00
Fred Drake c2ff9051d2 has_option(): Use the option name transform consistently.
Closes SF bug #561822.

Integrate the "code cleanup and general bug fix patch" (SF bug #545096),
contributed by Gustavo Niemeyer.  This is the portion of that patch that
does not add new functionality.
2002-09-27 15:33:11 +00:00
Kurt B. Kaiser 46466b4c92 Revert Rev 1.6
"Merge Py Idle changes:
Rev 1.7 [Python-idle] loewis
Convert characters from the locale's encoding on output.
Reject characters outside the locale's encoding on input."

Not compatible with Python 2.2.1.  Forwardport as a SF patch.
2002-09-27 00:34:31 +00:00
Kurt B. Kaiser 84f4803f4f Fix Bug 612886 copy/paste menu items fail
(cut vs. Cut etc.)
Fix Bug 613006 Ctrl-x Unix Binding Clears Selection
	(do-nothing does something :)
Leave some debugging prints behind, commented out
M EditorWindow.py
M config-keys.def
M configHandler.py
2002-09-26 22:13:22 +00:00
Skip Montanaro d404bee2e2 try executing 'less' in a parenthesized subshell - prevents systems like
Solaris from squawking if less isn't available.  See
http://python.org/sf/612111 for details.
2002-09-26 21:44:57 +00:00
Guido van Rossum 479f3d3d2a Oops, must convert hyphens to underscores in keys of aliases dict. 2002-09-26 20:08:23 +00:00
Barry Warsaw 09f7424f3a test_unicode_error(): Comment this test out, since we still have
controversy.
2002-09-26 17:21:53 +00:00
Barry Warsaw 9c74569ec9 Fixing some RFC 2231 related issues as reported in the Spambayes
project, and with assistance from Oleg Broytmann.  Specifically,
added some new tests to make sure we handle RFC 2231 encoded
parameters correctly.  Two new data files were added which contain RFC
2231 encoded parameters.
2002-09-26 17:21:02 +00:00
Barry Warsaw 15aefa94d0 Fixing some RFC 2231 related issues as reported in the Spambayes
project, and with assistance from Oleg Broytmann.  Specifically,

get_param(), get_params(): Document that these methods may return
parameter values that are either strings, or 3-tuples in the case of
RFC 2231 encoded parameters.  The application should be prepared to
deal with such return values.

get_boundary(): Be prepared to deal with RFC 2231 encoded boundary
parameters.  It makes little sense to have boundaries that are
anything but ascii, so if we get back a 3-tuple from get_param() we
will decode it into ascii and let any failures percolate up.

get_content_charset(): New method which treats the charset parameter
just like the boundary parameter in get_boundary().  Note that
"get_charset()" was already taken to return the default Charset
object.

get_charsets(): Rewrite to use get_content_charset().
2002-09-26 17:19:34 +00:00
Martin v. Löwis 67c4cb1f13 Disable big charsets in UCS-4 builds. Works around #599377.
Will backport to 2.2
2002-09-26 16:39:20 +00:00
Thomas Heller 6d817ad43d Again, I did check in too many changes. Sorry. 2002-09-26 13:19:48 +00:00
Barry Warsaw 6f30a8ab62 __version__: Bump to 2.4
Move the imports of Parser and Message inside the
message_from_string() and message_from_file() functions.  This way
just "import email" won't suck in most of the submodules of the
package.

Note: this will break code that relied on "import email" giving you a
bunch of the submodules, but that was never documented and should not
have been relied on.
2002-09-25 22:07:50 +00:00
Tim Peters d8a9d2a0e9 SF bug 613233: test_threadedtempfile hangs
A possibility to deadlock (on the hidden import lock) was created here
in 2.3, seemingly when tempfile.py started to call functions in
random.py.  The cure is "the usual":  don't spawn threads as a side
effect of importing, when the spawned threads themselves do imports
(directly or indirectly), and the code that spawned the threads is
waiting for the threads to finish (they can't finish, because they're
waiting for the import lock the spawner still holds).  Worming around
this is why the "test_main" mechanism was introduced in regrest, so
it's a straightforward fix.

NOT a bugfix candidate; the problem was introduced in 2.3.
2002-09-25 20:32:28 +00:00
Neal Norwitz 7dfb6e295b Fix SF # 591713, Fix "file:" URL to have right no. of /'s, by Bruce Atherton
Add a test too.  urljoin() would make file:/tmp/foo instead of file:///tmp/foo

Bugfix candidate, I will backport.
2002-09-25 19:20:12 +00:00
Guido van Rossum b7a88e533d Add yet another alias for ASCII found in the field. Will backport to
2.2.2.
2002-09-25 16:44:34 +00:00
Fred Drake 04d9a80fef Add regression test for a bug found in the version of the markupbase
module used in the Zope TAL implementation.  The bug was already fixed
in the Python standard library, but the regression test would be good
to keep around.
2002-09-25 16:29:17 +00:00
Thomas Heller d8ce87ad84 On Windows, select() does not accept empty lists.
Patch suggested by Guido, fixes SF item 611464.

Bugfix candidate, will backport to release22-maint myself.
2002-09-24 17:30:31 +00:00