Commit Graph

5838 Commits

Author SHA1 Message Date
Marc-André Lemburg bbea4717bc Allow shebang's which use versioned Python binaries. Fixes
bug #521526.
2002-02-28 09:16:21 +00:00
Guido van Rossum 06ee2531a8 SF patch #523169, by Samuele Pedroni.
There were never tests for the fact that list() always returns a *new*
list object, even when the argument is a list, while tuple() may
return a reference to the argument when it is a tuple.  Now there are.
2002-02-26 22:39:23 +00:00
Steven M. Gava 67716b5f53 bugfix for the problem where EditorWindow instances
would appear to freeze for a few seconds on closing
in some cases when running under X
2002-02-26 02:31:03 +00:00
Guido van Rossum bdba32051b canonic(): Fix by Edward K Ream to make breakpoints work better on
Windows: apply normcase() as well as abspath().  (Note: this isn't
needed to make IDLE work, but it's a good idea anyway.)

Bugfix candidate -- both 2.2.1 and 2.1.3.
2002-02-25 23:23:24 +00:00
Guido van Rossum 16ac99a959 Fix by Edward K Ream to make breakpoints work on Windows: insert a
missing call to self.canonic().
2002-02-25 23:22:08 +00:00
Martin v. Löwis 4ca196dd8d Set TCL_LIBRARY before import _tkinter. Suggested by Kirill Simonov.
Fixes #418173 and #219960. 2.2.1 candidate.
2002-02-24 16:51:45 +00:00
Martin v. Löwis 3356766abf Accept Unicode strings as SMTP TO addresses. Fixes #521270.
2.2.1 candidate.
2002-02-24 15:07:24 +00:00
Andrew MacIntyre 5cef57131f OS/2 EMX port Library and regression test changes:
Lib/
    os.py
    os2emxpath.py   // added - OS/2 EMX specific path manipulation routines
    popen2.py
    site.py
  Lib/test/
    test_fcntl.py
    test_longexp.py
2002-02-24 05:32:32 +00:00
Steven M. Gava 75a8e65873 tracking changes to python idle:
python Patch #520483: Make IDLE OutputWindow handle Unicode.
2002-02-23 23:27:08 +00:00
Martin v. Löwis 0ac16ec149 Patch #521714: fix pychecker warnings in ast.py. 2002-02-23 22:35:33 +00:00
Martin v. Löwis 9d51fc8972 Patch #521670: Remove unused sys import. 2002-02-23 22:31:53 +00:00
Andrew MacIntyre f47d60ffec Create and populate OS/2 EMX port platform specific library directory:
Lib/plat-os2emx/
    IN.py
    SOCKET.py
    grp.py
    pwd.py       // pwd module that can process real passwd files
    regen
2002-02-22 11:06:30 +00:00
Piers Lauder f2d7d15805 moved command logging routines into IMAP4 class: thread safe/faster 2002-02-22 01:15:17 +00:00
Thomas Heller d2d58e0496 First version which runs an install-script (specified by the
--install-script ... command line option to bdist_wininst) at the end
of the installation and at the start of deinstallation.  Output
(stdout, stderr) of the script (if any) is displayed in the last
screen at installation, or in a simple message box at deinstallation.

sys.argv[1] for the script will contain '-install' at installation
time or '-remove' at deinstallation time.

The installation script runs in an environment (embedded by the
bdist_wininst runtime) where an additional function is available as
builtin:

create_shortcut(path, description, filename,
	        [arguments[, workdir[, iconpath, iconindex]]])

Recreated this file after source changes.
2002-02-20 08:01:19 +00:00
Tim Peters 8044055d82 Somebody made list.__dict__ grow a '__doc__' key, but apparently didn't
run the test suite afterwards.  Either that, or whether '__doc__' shows
up is platform-dependent!
2002-02-19 04:25:19 +00:00
Neal Norwitz 45bec8c7fc SF #515023. Make _DummyThread.join() signature match base class (Thread) 2002-02-19 03:01:36 +00:00
Steven M. Gava 82c6682bb7 further work on config system 2002-02-18 01:45:43 +00:00
Steven M. Gava 4974575609 handle user theme and key set deletion 2002-02-18 01:43:11 +00:00
Tim Peters 18e6778bcd Repair so that importing socket doesn't blow up on platforms that lack
SSL support.  test_socket.py passes again on Windows.

Added an XXX about adding _ssl exports to the __all__ list (it doesn't
appear to be doing anything about that now, but since I don't have SSL
on this box I can't really tell).
2002-02-17 04:25:24 +00:00
Martin v. Löwis b4779c3496 Patch #515598: removed unused import of os. 2002-02-16 23:16:53 +00:00
Martin v. Löwis e12454f44a The Grande 'sendall()' patch, copied from release21-maint. Fixes #516715.
Replaces calls to socket.send() (which isn't guaranteed to send all data)
with the new socket.sendall() method.
2002-02-16 23:06:19 +00:00
Marc-André Lemburg a5d2b4cb18 Break SSL support out of _socket module and place it into a new
helper module _ssl.

The support for the RAND_* APIs in _ssl is now only enabled
for OpenSSL 0.9.5 and up since they were added in that
release.

Note that socketmodule.* should really be renamed to _socket.* --
unfortunately, this seems to lose the CVS history of the file.

Please review and test... I was only able to test the header file
chaos in socketmodule.c/h on Linux. The test run through fine
and compiles don't give errors or warnings.

WARNING: This patch does *not* include changes to the various
non-Unix build process files.
2002-02-16 18:23:30 +00:00
Tim Peters e4418609f7 Whitespace normalization. 2002-02-16 07:34:19 +00:00
Tim Peters 20882dd174 SF bug #516372: test_thread: unhandled exc. in thread
Fix exit races in test_thread.py and test_threaded_import.py.
I suspect the bug is provokable only under Linux (where child threads
seem to get lots of cycles before they get killed after the main thread
exits), or on multi-processor machines running other OSes.
Bugfix candidate.
2002-02-16 07:26:27 +00:00
Greg Ward 2e250b4378 Fix bug #511786 (2.2.1 candidate): ensure that custom-supplied headers
are preserved for redirected requests.
2002-02-11 20:46:10 +00:00
Neal Norwitz 34172d5316 SF #515020, delete global variables which are used only for temporary
values in for loops (dircase, prefix, sitedir).
2002-02-11 18:34:41 +00:00
Neal Norwitz 83bd70a7fa SF #515005, change "1 + ''" (which pychecker warns about being invalid)
into "raise Exception".
2002-02-11 18:26:02 +00:00
Neal Norwitz f7fdedc320 SF #515022 remove unused variable 2002-02-11 18:18:29 +00:00
Neal Norwitz aa38aa5435 SF #515009, delete global variable that was apparently used only
in a for loop.
2002-02-11 18:14:22 +00:00
Neal Norwitz d5ba4aeab0 SF #515018, delete global variable that was apparently used only
in a list comprehension.
2002-02-11 18:12:06 +00:00
Neal Norwitz f963b45dfd SF #515026, delete global variable that was apparently used only
in a for loop.
2002-02-11 18:11:09 +00:00
Neal Norwitz bc9bc187aa SF #515024 remove unused variable 2002-02-11 18:06:21 +00:00
Neal Norwitz f151625b59 SF #515021, print the refused list to the DEBUGSTREAM, so the parameter is used
Note:  There is a TBD (aka FIXME) for how best to handle the refused addresses
2002-02-11 18:05:05 +00:00
Neal Norwitz 4212ea4d7a SF #515012, cleanup: remove unused variable 2002-02-11 18:01:32 +00:00
Neal Norwitz 22c5d77d47 SF #515011, cleanup: remove "or 0" condition 2002-02-11 17:59:51 +00:00
Neal Norwitz 7fd41ccdb1 SF #515006, remove unnecessary import 2002-02-11 17:57:55 +00:00
Neal Norwitz 086ac007a3 SF #515004 cleanup
- remove unnecessary imports
  - rename dum -> dummy
2002-02-11 17:56:27 +00:00
Neal Norwitz 9fb289d826 SF #515000, print result of f.tell() in test() instead of ignoring 2002-02-11 17:52:18 +00:00
Marc-André Lemburg a0af63b242 Corrected import behaviour for codecs which live outside the encodings
package.
2002-02-11 17:43:46 +00:00
Just van Rossum 005dbb219e on MacOSX/Darwin, use ranlib when building static libs. 2002-02-11 15:31:50 +00:00
Steven M. Gava e28ee754b0 improvement to keybinding re-use check 2002-02-11 03:45:22 +00:00
Steven M. Gava 9f25e67dd7 base GetHighlight on GetThemeDict for better defaults 2002-02-11 02:51:18 +00:00
Steven M. Gava 46fa7bf86c further work on config saving 2002-02-11 02:28:19 +00:00
Steven M. Gava 052937f0b5 further work on config saving 2002-02-11 02:20:53 +00:00
Marc-André Lemburg 462004e90a Add IANA character set aliases to the encodings alias dictionary
and make alias lookup lazy.

Note that only those IANA character set aliases were added for which
we actually have codecs in the encodings package.
2002-02-10 21:36:20 +00:00
Fred Drake 4a02f9542f Added regression test for start()/stop() returning bogus NULL. 2002-02-08 21:29:22 +00:00
Guido van Rossum 5ff8cb4f1b Whitespace cleanup. 2002-02-08 20:41:34 +00:00
Neal Norwitz af64263afc Fix typo 2002-02-08 20:13:53 +00:00
Fred Drake 63cd9bf488 Python 10 was a success, commemorate it\! 2002-02-08 20:13:47 +00:00
Thomas Heller 745b4609cb Make it 1.5.2 compatible again. 2002-02-08 14:41:31 +00:00
Marc-André Lemburg bd3be8f0ca Fix to the UTF-8 encoder: it failed on 0-length input strings.
Fix for the UTF-8 decoder: it will now accept isolated surrogates
(previously it raised an exception which causes round-trips to
fail).

Added new tests for UTF-8 round-trip safety (we rely on UTF-8 for
marshalling Unicode objects, so we better make sure it works for
all Unicode code points, including isolated surrogates).

Bumped the PYC magic in a non-standard way -- please review. This
was needed because the old PYC format used illegal UTF-8 sequences
for isolated high surrogates which now raise an exception.
2002-02-07 11:33:49 +00:00
Marc-André Lemburg 9273ec726c Forgot to add the new emxccompiler.py from Andrew I. MacIntyre's
distutils patch for OS/2.

Here it is...
2002-02-06 18:22:48 +00:00
Marc-André Lemburg 3688a882d3 Fix for the UTF-8 memory allocation bug and the UTF-8 encoding
bug related to lone high surrogates.
2002-02-06 18:09:02 +00:00
Steven M. Gava 085eb1b372 further work on config system and config saving 2002-02-05 04:52:32 +00:00
Andrew M. Kuchling 3b388ec8b3 [Bug #220993; may also fix bug #479469] Fix flakiness when old
installations are present, by always unlinking the destination file
  before copying to it.  Without the unlink(), the copied file remains
  owned by its previous UID, causing the subsequent chmod() to fail.

Bugfix candidate, though it may cause changes on platforms where
  file ownership behaves differently.
2002-02-01 18:29:34 +00:00
Guido van Rossum 8cb6540652 Wesley Chun's SF patch 511380: add CGIHTTPServer error supt for Win32
This uses os.popen3 (if it exists) to ensure that errors from a
non-Python CGI script are logged.

Bugfix candidate.
2002-02-01 16:27:59 +00:00
Thomas Heller 0c350bfad0 package_dir must be converted from the distutils path conventions to
local conventions before being used by build_py.

Fixes SF bug #509288, probably a candidate for 2.2.1
2002-02-01 09:44:09 +00:00
Steven M. Gava 7cff66d469 improve user config dir handling 2002-02-01 03:02:37 +00:00
Steven M. Gava a498af269c more work on configuration saving 2002-02-01 01:33:36 +00:00
Andrew M. Kuchling b24231e088 Restrict the mode to the lowest four octal positions; higher positions
contain the type of the file (regular file, socket, link, &c.).
   This means that install_scripts will now print
   "changing mode of <file> to 775" instead of "... to 100775".

2.2 bugfix candidate, I suppose, though this isn't actually fixing a bug.
2002-01-31 22:08:38 +00:00
Marc-André Lemburg 2544f51036 OS/2 patches by Andrew I MacIntyre for distutils.
Closes patch #435381.
2002-01-31 18:56:00 +00:00
Fred Drake 1453754fcd string.split() docstring described the interpretation of the maxsplit
argument incorrectly.
This closes SF bug #505997.
2002-01-30 16:15:13 +00:00
Tim Peters 40915bf8dd Thanks to Detlef Lannert for pointing out a typo in the code that
uses _DummyMutex on platforms without threads.
2002-01-30 09:11:42 +00:00
Tim Peters c7349ee2c6 New TemporaryFile implementation for Windows: this doesn't need a
TemproraryFileWrapper wrapper anymore, and should be immune from the
problem that a temp file inherited by a spawned process caused an
attempt to close the temp file in the spawning process to blow
up (the unlink in TemporaryFileWrapper.close() blew up with a
"Permission denied" error because, despite that the temp file got
closed in the spawning process, the spawned process still had it open
by virtue of C-level file descriptor inheritance).  In context,
that bug took days to figure out <wink/sigh>.
2002-01-30 07:47:51 +00:00
Tim Peters d9fbf353a1 This test left a new set of 3 junk files behind each time it was run. 2002-01-30 07:32:53 +00:00
Martin v. Löwis 9635d0bd1f Encode MSVC paths as mbcs. Fixes #509117. 2.2.1 candidate. 2002-01-29 10:23:42 +00:00
Steven M. Gava 2d7bb3fa66 further work on config saving 2002-01-29 08:35:29 +00:00
Tim Peters 4fd5a06580 SF bug #509805 tempfile.gettempdir not threadsafe
This is an ancient race when multiple threads call gettempdir() (or
anything relying on it) for the first time.

Fixed x-platform via the Big Hammer of rearranging the code to serialize
the first calls.  Subsequent calls are as fast as before.

Note that the Python test suite can't provoke this bug:  it requires
setting up multiple threads making the very first calls into tempfile,
but the test suite uses tempfile several times before getting to
test_threadedtempfile.

Bugfix candidate.
2002-01-28 23:11:23 +00:00
Barry Warsaw 6423f8b884 Test case of a singleton multipart; i.e. a multipart/* with only one
subpart.
2002-01-27 06:49:26 +00:00
Barry Warsaw 763af4173d test_multipart_one_part(): Idempotency test case for a multipart/*
with only one subpart.
2002-01-27 06:48:47 +00:00
Barry Warsaw 15e9dc9eac _parsebody(): When adding subparts to a multipart container, make sure
that the first subpart added makes the payload a list object.
Otherwise, a multipart/* with only one subpart will not have the
proper structure.
2002-01-27 06:48:02 +00:00
Steven M. Gava f9bb90e453 further work on saving configs 2002-01-24 06:02:50 +00:00
Steven M. Gava 813b56e387 dialog for getting a new config file section name 2002-01-24 05:59:05 +00:00
Steven M. Gava 8cf2704a59 staying current with python idle fixes 2002-01-23 23:56:41 +00:00
Steven M. Gava d91b0d6a65 fix for python2.2 -Qnew division error,
thanks Tim!
2002-01-23 05:15:17 +00:00
Steven M. Gava bbf5ef552f more on config saving 2002-01-22 11:35:50 +00:00
Steven M. Gava c112cd880a further work on config saving 2002-01-22 05:56:40 +00:00
Steven M. Gava 5f28e8fbfb extension config reading by configDialog and
beginning of configuration saving
2002-01-21 06:38:21 +00:00
Steven M. Gava 72c3bf076f changeover to new keybinding configuration implementation 2002-01-19 10:41:51 +00:00
Steven M. Gava c628a06c70 further work on keybinding configuration 2002-01-19 10:33:21 +00:00
Steven M. Gava 68d7336cb0 keybinding configuration 2002-01-19 01:30:56 +00:00
Steven M. Gava facfc09352 keybinding configuration 2002-01-19 00:29:54 +00:00
Thomas Heller 5cba76df7b SWIGing a source file <name>.i silently overwrites <name>.c if it is
present - at least the swigged file should be named <name>_wrap.c as
this is also SWIG's default. (Even better would be to generate the
wrapped sources in a different location, but I'll leave this for
later).

Newer versions of SWIG don't accept the -dnone flag any more.

Since virtually nobody uses SWIG with distutils, this should do no
harm.

Suggested be Martin Bless on c.l.p.
2002-01-18 20:30:53 +00:00
Mark Hammond f717f0500c Allow abspath to still do something sensisble if the nt module can not be imported. 2002-01-17 00:44:26 +00:00
Guido van Rossum eaa0a22f43 Disable code intended for PEP 277. 2002-01-15 21:25:51 +00:00
Fred Drake 5e99731ab9 Only test ntpath.abspath() on Windows. This allows the rest of the module to
be tested regardless of the host platform.
2002-01-15 03:46:43 +00:00
Martin v. Löwis 9668b933e3 Patch #414775: Add --skip-build option to bdist command. 2002-01-12 11:27:42 +00:00
Steven M. Gava edb60a7ba9 key binding handling dialog 2002-01-12 09:48:02 +00:00
Martin v. Löwis a55ffaeee9 Add a per-message fallback mechanism for translations. 2002-01-11 06:58:49 +00:00
Martin v. Löwis 1be6419871 Add fallback argument to translation(). Request fallbacks on install.
Fixes #500595.
2002-01-11 06:33:28 +00:00
Fred Drake 925f144274 Fix webbrowser.py security bug: be more careful about what we pass to
os.system().
This closes Python bug #500401, Debian bug #127507.
2002-01-07 15:29:01 +00:00
Mark Hammond e843e482ce Ensure Unicode filenames work with glob - they already do, but the test seems worth keeping. 2002-01-07 02:11:43 +00:00
Marc-André Lemburg f853be980e Restore Python 2.1 StringIO.py behaviour: support concatenating
Unicode string snippets to larger Unicode strings.

This fix should also go into Python 2.2.1.
2002-01-06 17:15:05 +00:00
Fred Drake db519205a2 Time2Internaldate(): Call isinstance() once for each of the type tests
instead of possibly twice by using a sequence of types to check for.
Add a message to the ValueError that can be raised.
2002-01-05 17:17:09 +00:00
Fred Drake 1e2fb57b5f Remove unused imports, clean up trailing whitespace. 2002-01-05 17:12:57 +00:00
Martin v. Löwis ea752fbb86 Check for time.struct_time in addition to tuples. Use 3 characters
for zone hours. Fixes #499169.
2002-01-05 11:31:49 +00:00
Steven M. Gava 0cae01c496 loading core keybindings via new config system plus
further devel of highlight handling
2002-01-04 07:53:06 +00:00
Steven M. Gava c597640515 move core functionality of SearchBindings.py into EditorWindow.py proper
adjust configuration sources accordingly
move SearchBindings.py into the attic now
2002-01-04 03:06:08 +00:00
Steven M. Gava ad4f532f65 further development of highlighting and editor preference handling,
plus misc fixes cleanups for new config system
2002-01-03 12:05:17 +00:00
Steven M. Gava 767a7ee9ad remove futzing with text font 2002-01-03 12:04:01 +00:00
Steven M. Gava 361cfcd69b fixups and improvements 2002-01-03 12:02:37 +00:00
Steven M. Gava dc72f48e26 moving to new config system 2002-01-03 11:51:07 +00:00
Andrew M. Kuchling 1142d595ee Fix typo in label 2002-01-02 16:38:19 +00:00
Neal Norwitz 653d85fc86 SF Patch #494867 test file methods
Test that the file methods raise ValueError when called on a closed file.
Test .isatty()
Test name, closed attributes
2002-01-01 19:11:13 +00:00
Martin v. Löwis 85f98143b7 Print encoded versions of the file names in test application. Fixes #496084 2001-12-30 14:43:56 +00:00
Tim Peters 77902970c5 test_support: add a docstring to vereq().
test_complex:  repair new test's usage of vereq().
2001-12-29 17:34:57 +00:00
Neal Norwitz 5a0f010c67 SF Patch #497487 add test to compare conjugate of a complex number 2001-12-29 14:31:46 +00:00
Neal Norwitz fc37af85bf SF Patch #494873 add tests for complex numbers including calls to int()/long() 2001-12-29 01:02:21 +00:00
Neal Norwitz 32f41536cb SF Patch #494874 add tests for int()/long() invalid parameters 2001-12-29 00:35:20 +00:00
Neal Norwitz 707690132f SF Patch #494872 test repr() of a built-in module 2001-12-29 00:25:42 +00:00
Neal Norwitz 26e5341c00 SF Patch #494876, test invalid parameters to pow() 2001-12-29 00:16:09 +00:00
Guido van Rossum f21b2aafa9 Thread.__bootstrap(): ignore exceptions in the self.__delete() call in
the finally clause.  An exception here could happen when a daemon
thread exits after the threading module has already been trashed by
the import finalization, and there's not much of a point in trying to
insist doing the cleanup in that stage.

This should fix SF bug ##497111: active_limbo_lock error at program
exit.

2.1.2 and 2.2.1 Bugfix candidate!
2001-12-28 22:07:09 +00:00
Guido van Rossum 2764a3a50e Fix for SF bug ##497426: can't deepcopy recursive new objects
deepcopy(), _reconstruct(): pass the memo to the other function, so
that recursive data structures built out of new-style objects may be
deeply copied correctly.

2.2.1 bugfix!
2001-12-28 21:39:03 +00:00
Guido van Rossum 1e91c1444a Fix for SF bug ##497426: can't deepcopy recursive new objects
deepcopy(), _reconstruct(): pass the memo to the other function, so
that recursive data structures built out of new-style objects may be
deeply copied correctly.

2.2.1 bugfix!
2001-12-28 21:33:22 +00:00
Guido van Rossum 24a643416d Update the docstring too. :-) 2001-12-28 20:54:55 +00:00
Guido van Rossum c33e077838 SF patch #497420 (Eduardo Pérez): ftplib: ftp anonymous password
Instead of sending the real user and host, use "anonymous@" (i.e. no
host name at all!) as the default anonymous FTP password.  This avoids
privacy violations.
2001-12-28 20:54:28 +00:00
Guido van Rossum 2a6f5b38ac _reduce(): Avoid infinite recursion in the pickler when self.__class__
doesn't have the _HEAPTYPE flag set, e.g. for time.struct_time and
posix.stat_result.

This fixes the immediate symptoms of SF bug #496873 (cPickle /
time.struct_time loop), replacing the infinite loop with an exception.
2001-12-27 16:27:28 +00:00
Guido van Rossum 2826fade49 Don't set passiveserver to 0 in connect(). See SF bug #495693.
This should definitely be backported to 2.2.1.  I'll leave it to Jack
to decide whether he wants to fix this in MacPython 2.2.
2001-12-23 13:54:19 +00:00
Martin v. Löwis fe7286c252 Regenerated for Linux 2.2.4. 2001-12-22 15:23:50 +00:00
Barry Warsaw 52acb49298 Merge of the release22 branch changes back into the trunk. 2001-12-21 20:04:22 +00:00
Andrew M. Kuchling 3d2d980f50 Suggested by Pete Shinners: treat .m and .mm files as source code.
Question for Jack Jansen: is this reasonable?

Candidate for 2.2 release branch (if Jack thinks it's OK).
2001-12-21 15:34:17 +00:00
Anthony Baxter ed9057083b forward-patch from release21-maint branch:
Make dumbdbm merely "dumb", rather than "terminally broken". Without this
  patch, it's almost impossible to use dumbdbm _without_ causing horrible
  datalossage. With this patch, dumbdbm passes my own horrible torture test,
  as well as the roundup test suite.

  dumbdbm really could do with a smidgin of a rewrite or two, but that's not
  suitable for the release21-maint branch.
2001-12-21 05:13:37 +00:00
Barry Warsaw eae36ac5c3 test_parseaddr_empty(): New test for assuring that
Utils.parseaddr('<>') -- i.e. on an empty address, returns the empty
string.  Built on rfc822, this used to return None.
2001-12-20 16:37:27 +00:00
Guido van Rossum f830a52996 SF patch #495358 (Artur Zaprzala): rfc822.AddressList and "<>" address
rfc822.AddressList incorrectly handles empty address.
    "<>" is converted to None and should be "".
    AddressList.__str__() fails on None.
    I got an email with such an address and my program
    failed processing it.

    Example:
    >>> import rfc822

    >>> rfc822.AddressList("<>").addresslist
    [('', None)]
    >>> str(rfc822.AddressList("<>"))
    Traceback (most recent call last):
    File "<stdin>", line 1, in ?
    File "/usr/lib/python2.1/rfc822.py", line 753, in __str__
    return ", ".join(map(dump_address_pair,
    self.addresslist))
    TypeError: sequence item 0: expected string, None found

[His solution: in the internal routine AddrlistClass.getrouteaddr(),
initialize adlist to "".]
2001-12-20 15:54:48 +00:00
Tim Peters 2b26a8627b Whitespace normalization. 2001-12-20 06:18:15 +00:00
Fredrik Lundh b6ab93f433 partial merge with current pythonware codebase:
- use repr instead of implied str for doubles
- updated version number to 1.0.0 (for 2.2 final)
2001-12-19 21:40:04 +00:00
Guido van Rossum 04a866170d Add test for pickling new-style class with custom metaclass. 2001-12-19 16:58:54 +00:00
Guido van Rossum f048a8f6d7 Pickler.save(): Fix for SF bug #494904: Cannot pickle a class with a
metaclass, reported by Dan Parisien.

Objects that are instances of custom metaclasses, i.e. whose class is
a subclass of 'type', should be pickled the same as new-style classes
(objects whose class is 'type').  This can't be done through a
dispatch table entry, and the __reduce__ trick doesn't work for these,
since it finds the unbound __reduce__ for instances of the class
(inherited from 'object').  So check explicitly using issubclass().
2001-12-19 16:55:02 +00:00
Fred Drake 5935ff07be Add some additional tests that check more proxy behaviors. 2001-12-19 16:54:23 +00:00
Fred Drake 694ed091af Fix the test control support for the pickle & cPickle tests so the tests run
under regrtest.
2001-12-19 16:42:15 +00:00
Guido van Rossum 1444f67fa0 The test using class initarg failed, because it was lacking a
__safe_for_unpickling__ attribute.
2001-12-19 16:38:29 +00:00
Fred Drake 4f5b49fb56 Make the module docstring agree with reality: the module prvides the
"handler()" function, not the "handle()" function.
2001-12-19 14:27:41 +00:00
Tim Peters 81b61bdc1a TemporaryFileWrapper: fixed typo in new comment. 2001-12-18 23:22:01 +00:00
Tim Peters a255a72f0a TemporaryFileWrapper: cache the value of os.unlink for use by __del__,
to prevent mysterious errors at shutdown due to "os.unlink" turning into
"None.unlink".
2001-12-18 22:32:40 +00:00
Guido van Rossum 99d2fbb823 Move the helper class _closedsocket *into* the _socketobject class.
This way, when a socket object is deleted after the socket module has
already been zapped by module shutdown, we don't get annoying warnings
about exceptions in __del__ methods.
2001-12-18 22:22:25 +00:00
Thomas Heller f499b030bd Recreated after source changes. 2001-12-18 21:08:15 +00:00
Thomas Heller c7cb9ed35f Second part of fix for bug [#483982] Python 2.2b2 bdist_wininst
crashes.

If no external zip-utility is found, the archive is created by the
zipfile module, which behaves different now than in 2.1: if the
zip-file is created in the root directory if the distribution, it will
contain an (empty) version of itself.

This triggered the above bug - so it's better to create the zip-file
far away in the TMP directory.
2001-12-18 20:13:40 +00:00
Guido van Rossum facf24bdc7 Don't use Latex \code{...} in docstrings. 2001-12-17 16:07:06 +00:00
Barry Warsaw 6e1c576a4e Get rid of the stupid backslash in front of the column zero open
paren.  This was there to worm around a stupid XEmacs bug, but since I
can't tickle the bug in newer XEmacsen (just tried w/21.4.5) it's
possible the problem has been fixed.  We shouldn't have to be working
around editor bugs anyway.

If it crops up again, I'll report it (again) to the XEmacs crowd.
2001-12-17 15:40:24 +00:00
Steve Purcell ca9aaf36e1 Synch with pyunit CVS:
- Adds Fred's patch 487662: "Better error message for assertEqual"
 - Removed small portion of code unused after Guido's patch
   490119: "Don't treat ^C as error"
2001-12-17 10:13:17 +00:00
Tim Peters 1422e9dc60 SF patch 493739 2 Bugfixes for 2.2c1 (RISC OS specific), from
Dietmar Schwertberger.
Bugfix candidate.
"""
RISCOS/Modules/getpath_riscos.c:
Include trailing '\0' when using strncpy [copy
strlen(...)+1 characters].

Lib/plat-riscos/riscospath.py:
Use riscosmodule.expand for os.path.abspath.
[fixes problems with site.py where
abspath("<Python$Dir>") returned
join(os.getcwd(), "<Python$Dir>") as e.g.
"SCSI::SCSI4.$.<Python$Dir>" because "<Python$Dir>"
wasn't recognised as an absolute path.]
"""
2001-12-15 22:12:47 +00:00
Guido van Rossum 796e1e0b30 Don't call resetwarnings(). Be more restrictive in what we filter out
instead.
2001-12-15 18:04:10 +00:00
Jack Jansen f839c27027 Added test_socketserver and test_unicode_file to tests expected to be
skipped on Mac OS X. Not sure yet about test_locale.py: this may be
due to my copy of Mac OS X (although it talks english fine enough).
2001-12-14 21:28:53 +00:00
Barry Warsaw 7675097d78 send(), ehlo(): Integrate patch #487310 by Fazal Majid. Consistently
call self.close() just before raising SMTPServerDisconnected.  This
allows you to, e.g. reconnect after a server timeout.

Merged from the 2.2c1 branch.
2001-12-14 20:34:20 +00:00
Jeremy Hylton 2a05bc72d6 Partial fix for problem in SF buf #487458
Rev 1.20 introduced a call to getpeername() in the dispatcher
constructor.  This only works for a connected socket.  Apparently
earlier versions of the code worked with un-connected sockets, e.g. a
listening socket.

It's not clear that the code is supposed to accept these sockets,
because it sets self.connected = 1 when passed a socket.  But it's
also not clear that it should be a fatal error to pass a listening
socket.

The solution, for now, is to put a try/except around the getpeername()
call and continue if it fails.  The self.addr attribute is used
primarily (only?) to produce a nice repr for the object, so it hardly
matters.  If there is a real error on a connected socket, it's likely
that subsequent calls will fail too.
2001-12-14 16:15:11 +00:00
Guido van Rossum e54616cb6f (Merge into trunk.)
Fix for SF bug #492345.  (I could've sworn I checked this in, but
apparently I didn't!)

This code:

    class Classic:
        pass

    class New(Classic):
        __metaclass__ = type

attempts to create a new-style class with only classic bases -- but it
doesn't work right.  Attempts to fix it so it works caused problems
elsewhere, so I'm now raising a TypeError in this case.
2001-12-14 04:19:56 +00:00
Jeremy Hylton f36cfef1ae Undo inadvertent change to test_scope in previous checkin 2001-12-13 20:00:26 +00:00
Fred Drake 68773e779a Add a comment explaining what these tests are for, and where to look for
tests of complex().
2001-12-13 19:57:53 +00:00
Fred Drake 526c7a0101 Ensure that complex() only accepts a string argument as the first arg,
and only if there is no second arg.
This closes SF patch #479551.
2001-12-13 19:52:22 +00:00
Jeremy Hylton 3095a4c228 Update output generated by test_scope 2001-12-13 19:47:51 +00:00
Jeremy Hylton ccae8377a3 Add test for SF bug [ #492403 ] exec() segfaults on closure's func_code 2001-12-13 19:45:04 +00:00
Fred Drake 723293cb49 Make tix_configure() work the same way configure() works for the basic
Tkinter classes.
Adjust a lot of docstrings.
Convert a few type checks to use isinstance() instead of type().
This is part of SF patch #485959.
2001-12-13 04:53:07 +00:00
Guido van Rossum 1990943095 Fix for SF #491953 (Andrew Dalke): ScrolledText.py has TabError
Untabified.
2001-12-12 12:47:57 +00:00
Fred Drake 1e7dfd3745 Wrapped a long line.
Converted to use "".startswith() to avoid slicing (& temp string creation).
2001-12-12 06:20:34 +00:00
Fred Drake d077ca1e7c Very small test suite for the calendar module, mostly to check a constraint
on the return values from isleap().  Also checks firstweekday() and
setfirstweekday().
2001-12-12 05:38:08 +00:00
Marc-André Lemburg 90294d01be Joe VanAndel wrote:
>
> When using 'distutils' (shipped with Python 2.1) I've found that my
> Python scripts installed with a first line of:
>
> #!/usr/bin/python2.1None
>
> This is caused by distutils trying to patch the first line of the python
> script to use the current interpreter.
2001-12-11 20:44:42 +00:00
Tim Peters 017052152b Fiddle test_class so it passes with -Qnew. 2001-12-11 19:28:47 +00:00
Tim Peters e93e477215 Fiddle test_augassign so it passes under -Qnew. 2001-12-11 19:20:15 +00:00
Martin v. Löwis df8adcd7ba Ignore SIGXFSZ. Fixes #490453. 2001-12-11 17:57:26 +00:00
Fred Drake d15db5c711 When using GCC, use the right option to add a directory to the list of dirs
searched for a dependency for runtime linking.
This closes SF bug #445902.
2001-12-11 05:04:24 +00:00
Guido van Rossum 29d260670e Additional coverage tests by Neil Norwitz.
(SF patch #491418, #491420, #491421.)
2001-12-11 04:37:34 +00:00
Fred Drake 2a64f4693d Regression test for SF bug #478534 -- exceptions could "leak" into a weakref
callback.
2001-12-10 23:46:02 +00:00
Finn Bock 2b29cb2593 Skipping some tests by adding the usual jython conditional test around:
- the repr of unicode. Jython only add the u'' if the string contains char
  values > 255.
- A unicode arg to unicode() is perfectly valid in jython.
- A test buffer() test. No buffer() on Jython

This closes patch "[ #490920 ] Jython and test_unicode".
2001-12-10 20:57:34 +00:00
Guido van Rossum 61d3637ff8 SF patch #491183 (Jeff Epler): ScrolledText.grid() doesn't work
Using grid methods on ScrolledText widgets does not
work as expected. It either fails to pack a widget, or
can even cause Tk to lock up.

The problem is that the .grid method is being called on
the text widget, not the frame widget. This can lead
to the well-known lockup in Tk when a frame's children
are managed by both the pack and grid managers. Even
if it doesn't lock up, the frame is never placed within
the intended widget.

Program fragment:
>>> import ScrolledText
>>> s = ScrolledText.ScrolledText()
>>> s.grid(row=0, column=0, rowspan=2)

The following patch uses the same hack to copy the
'grid' and 'place' geometry manager methods to the
ScrolledText instance as is already used for the 'pack'
manager.
2001-12-10 16:42:43 +00:00
Michael W. Hudson fb173cd471 Fix for
[ #409430 ] pydoc install broken
2001-12-10 16:15:44 +00:00
Michael W. Hudson 49bdaede1b Fix for
[ #477371 ] build_scripts can use wrong #! line

scripts now get "built" into a directory

build/scripts-$(PYTHON_VERSION)/
2001-12-10 15:28:30 +00:00
Finn Bock 793ead5696 A workaround for the missing buffer() builtin in jython.
This closes patch "[ #490850 ] Jython and test_StringIO".
2001-12-09 20:06:32 +00:00
Fredrik Lundh 82b230732f bug #133283, #477728, #483789, #490573
backed out of broken minimal repeat patch from July

also fixed a couple of minor potential resource leaks in pattern_subx
(Guido had already fixed the big one)
2001-12-09 16:13:15 +00:00
Finn Bock ed69aeedb9 test(): Avoid a UnboundLocalError when a method is missing from both the string
module and from string methods.

This closes patch "[ #490811 ] Jython and test_string".
2001-12-09 16:06:29 +00:00
Finn Bock d08011a0e1 Moved a print statement outside the jython platform test. Otherwise
the output fails to compare correctly for jython. This change was part
of the original patch #403666.
2001-12-09 10:19:25 +00:00
Finn Bock 4ab7adbd94 The initial patch #468662 was not applied quite verbatim. This should one
will fix the remaining Jython issues.

This closes patch "[ #490411 ] Jython and test_grammar.py".
2001-12-09 09:12:34 +00:00
Finn Bock ada1983950 Refcounting isn't available in Jython. Putting the jython test around it.
This closes patch "[ #490414 ] Jython and test_socket".
2001-12-09 08:57:46 +00:00
Guido van Rossum 146483964e Patch supplied by Burton Radons for his own SF bug #487390: Modifying
type.__module__ behavior.

This adds the module name and a dot in front of the type name in every
type object initializer, except for built-in types (and those that
already had this).  Note that it touches lots of Mac modules -- I have
no way to test these but the changes look right.  Apologies if they're
not.  This also touches the weakref docs, which contains a sample type
object initializer.  It also touches the mmap test output, because the
mmap type's repr is included in that output.  It touches object.h to
put the correct description in a comment.
2001-12-08 18:02:58 +00:00
Guido van Rossum b931bf3c55 SF patch #490515 (Joe A) urllib.open_https() protocol issue
open_http():
    In urllib.py library module, URLopener.open_https()
    returns a class instance of addinfourl() with its
    self.url property missing the protocol.

    Instead of "https://www.someurl.com", it becomes
    "://www.someurl.com".
2001-12-08 17:09:07 +00:00
Finn Bock aa3dc45658 Enable support for jython:
1. Acknowledge the welknown difference that jython
allows continue in the finally clause.

2. Avoid using _testcapi when running with jython.

This closes patch "[ #490417 ] Jython and test_exceptions"
2001-12-08 10:15:48 +00:00
Guido van Rossum baefcebb55 Remove erroneous and confusing comment -- sre patterns *can* be
pickled and we do *not* expect exceptions from either pickle or
cPickle.
2001-12-08 05:11:15 +00:00
Fred Drake 2c8373bc23 Honor the mode argument to dumbdbm.open(); there is not good reason not to,
especially since the documentation described it in detail.
This partially closes SF bug #490098.
2001-12-07 21:54:46 +00:00
Tim Peters cbfc0343fc SF patch 490393: test___all__ and Jython; from Finn Bock.
Don't even try to import _socket when running under Jython.
2001-12-07 21:35:42 +00:00
Guido van Rossum 78f0dd3397 I found that when run as a script, this test suite ran its tests
twice!  Fixed this by avoiding the import of test_email, which loads
the module a second time in that situation, and fiddled the __main__
section to resemble other test suites using unittest.
2001-12-07 21:07:08 +00:00
Finn Bock 71be984b80 Align the number of %s with the number of format arguments.
This closes patch "[ #490330 ] String format bug in test_b2."
2001-12-07 18:21:56 +00:00
Guido van Rossum a35e2cee32 Move import dbhash out of test_sundry and into test_bsddb,
so that test_sundry won't fail if the bsddb module is absent.
2001-12-07 16:43:19 +00:00
Guido van Rossum 202dd1ef42 In unconditional except clauses, don't catch KeyboardInterrupt -- it's
annoying that often you have to hit ^C numerous times before it
works.  The solution: before the "except:" clause, insert "except
KeyboardInterrupt: raise".  This propagates KeyboardInterrupt out,
stopping the test in its tracks.
2001-12-07 03:39:34 +00:00
Fred Drake 9028d0a525 Visious hackery to solve a build-control problem related to our use of
distutils for the library modules built as shared objects.  A better solution
appears possible, but with the threat that the distutils becomes more
magical ("complex").
This closes SF bug #458343.
2001-12-06 22:59:54 +00:00
Andrew M. Kuchling 3ecc1ce529 [Bug #475009] Tighten the pattern for the first line, so we don't
adjust it when a versioned interpreter is supplied (#!.../python2 ...)
2001-12-06 21:29:28 +00:00
Fred Drake 21d45356b8 Whitespace normalization. 2001-12-06 21:01:19 +00:00
Fred Drake b94b849d65 Whitespace normalization. 2001-12-06 20:51:35 +00:00
Thomas Heller bcd8975740 Use a version number of 0.0.0 instead of ???. The latter leads to
invalid filenames on Windows when building without specifying a
version number in the setup script.

See also
http://mail.python.org/pipermail/distutils-sig/2001-November/002656.html

Bugfix candidate.
2001-12-06 20:44:19 +00:00
Fred Drake 2998a55f2d Attribute nodes did not always get their ownerDocument and ownerElement
properly set.  This fixes that.
2001-12-06 18:27:48 +00:00
Fred Drake 6b04ffe9e5 Be more careful about accessing attributes of the parent: if Tk has not been
initialized, this will be None, but the functions will still work (there will
simply be a bogus parent on the screen).  Allowing the parent to be None
is useful when testing the functions from an interactive interpreter.

Add an optional keyword paramter "show" to the _QueryString class; when given
it is used to set the -show option to the entry widget.  This allows passing
show="*" or the like to askstring(), making it useful for requesting
passwords/passphrases from the user.
This closes SF bug #438517.

Changed a docstring to be less font-lock-hostile.
2001-12-06 16:51:41 +00:00
Andrew M. Kuchling d303b61eb4 [Bug #459270] Fix incorrect docstring 2001-12-06 16:32:05 +00:00
Tim Peters 3caca2326e SF bug #488514: -Qnew needs work
Big Hammer to implement -Qnew as PEP 238 says it should work (a global
option affecting all instances of "/").

pydebug.h, main.c, pythonrun.c:  define a private _Py_QnewFlag flag, true
iff -Qnew is passed on the command line.  This should go away (as the
comments say) when true division becomes The Rule.  This is
deliberately not exposed to runtime inspection or modification:  it's
a one-way one-shot switch to pretend you're using Python 3.

ceval.c:  when _Py_QnewFlag is set, treat BINARY_DIVIDE as
BINARY_TRUE_DIVIDE.

test_{descr, generators, zipfile}.py:  fiddle so these pass under
-Qnew too.  This was just a matter of s!/!//! in test_generators and
test_zipfile.  test_descr was trickier, as testbinop() is passed
assumptions that "/" is the same as calling a "__div__" method; put
a temporary hack there to call "__truediv__" instead when the method
name is "__div__" and 1/2 evaluates to 0.5.

Three standard tests still fail under -Qnew (on Windows; somebody
please try the Linux tests with -Qnew too!  Linux runs a whole bunch
of tests Windows doesn't):
    test_augassign
    test_class
    test_coercion
I can't stay awake longer to stare at this (be my guest).  Offhand
cures weren't obvious, nor was it even obvious that cures are possible
without major hackery.

Question:  when -Qnew is in effect, should calls to __div__ magically
change into calls to __truediv__?  See "major hackery" at tail end of
last paragraph <wink>.
2001-12-06 06:23:26 +00:00
Fred Drake e50959a58e Fix appendChild() and insertBefore() (and replaceChild() indirectly) when
the node being added is a fragment node.
This closes SF bug #487929.
2001-12-06 04:32:18 +00:00
Jack Jansen 8a97f4a380 sys.platform on Mac OS X is now "darwin", without any version number appended.
This should probably go into NEWS (who's responsible for that?).
2001-12-05 23:27:32 +00:00
Guido van Rossum 33bab01da6 Fix SF bug #489581: __slots__ leak.
It was easier than I thought, assuming that no other things contribute
to the instance size besides slots -- a pretty good bet.  With a test
suite, no less!
2001-12-05 22:45:48 +00:00
Fred Drake a16433b14e Re-enabled debugging prints in poplib & documented the set_debuglevel()
method.
This closes SF patch #486079.
2001-12-05 22:37:21 +00:00
Fred Drake ee836445d1 Added a missing period at the end of an error message. 2001-12-05 22:27:47 +00:00
Guido van Rossum d331cb5502 At the PythonLabs meeting someone mentioned it would make Jim really
happy if one could delete the __dict__ attribute of an instance.  I
love to make Jim happy, so here goes...

- New-style objects now support deleting their __dict__.  This is for
  all intents and purposes equivalent to assigning a brand new empty
  dictionary, but saves space if the object is not used further.
2001-12-05 19:46:42 +00:00
Fred Drake 698da02d3b Separate the script portion from the library portion; everything that
pertains to the script is now in the if __name__ == "__main__" block.
This is in response to a commenton python-dev from Neal Norwitz.
2001-12-05 15:58:29 +00:00
Steven M. Gava 2d4e03b092 changes to use new tabpages classes 2001-12-05 07:54:07 +00:00
Steven M. Gava 34b8851c5f remove cruft from other project 2001-12-05 06:39:18 +00:00