Guido van Rossum [Mon, 23 Dec 2002 16:30:00 +0000 (16:30 +0000)]
Last week we discussed adding this module to the standard library.
Here's a draft. I have no immediate use for it, but I'd like this to
be available for experimentation. I may withdraw it or change it
radically up to and including the release of Python 2.3b1.
Kurt B. Kaiser [Mon, 23 Dec 2002 03:31:49 +0000 (03:31 +0000)]
M MANIFEST.in
M PyShell.py
M idlever.py
M setup.py
1. Update MANIFEST.in to include all non-pure Python files
2. PyShell and idlever reflect Rev 0.9a0
3. setup.py modified to install IDLE as a collection of modules with
a .pth file living at the idlelib level in site-packages. This was
done to make it easier to run from the source directory prior to
installing IDLE. This approach may change back to the package
technique depending on what happens with the Mac installation
development.
Tim Peters [Sun, 22 Dec 2002 20:58:42 +0000 (20:58 +0000)]
I give up: unless I write my own strftime by hand, datetime just can't
be trusted with years before 1900, so now we raise ValueError if a date or
datetime or datetimetz .strftime() method is called with a year before
1900.
Tim Peters [Sun, 22 Dec 2002 20:34:46 +0000 (20:34 +0000)]
Python's strftime implementation does strange things with the year,
such that the datetime tests failed if the envar PYTHON2K was set.
This is an utter mess, and the datetime module's strftime functions
inherit it. I suspect that, regardless of the PYTHON2K setting, and
regardless of platform limitations, the datetime strftime wrappers
will end up delivering nonsense results (or bogus exceptions) for
any year before 1900. I should probably just refuse to accept years
earlier than that -- else we'll have to implement strftime() by hand.
Tim Peters [Sun, 22 Dec 2002 18:10:22 +0000 (18:10 +0000)]
classify_object(): Renamed more meaningfully, to classify_utcoffset().
Also changed logic so that instances of user-defined subclasses of date,
time, and datetime are called OFFSET_NAIVE instead of OFFSET_UNKNOWN.
Tim Peters [Sun, 22 Dec 2002 03:43:39 +0000 (03:43 +0000)]
Implemented a Wiki suggestion:
{timetz,datetimetz}.{utcoffset,dst}() now return a timedelta (or None)
instead of an int (or None).
tzinfo.{utcoffset,dst)() can now return a timedelta (or an int, or None).
Curiously, this was much easier to do in the C implementation than in the
Python implementation (which lives in the Zope3 code tree) -- the C code
already had lots of hair to extract C ints from offset objects, and used
C ints internally.
Kurt B. Kaiser [Sat, 21 Dec 2002 21:39:11 +0000 (21:39 +0000)]
When IDLE is installed and run from a startup script, the script's
directory becomes sys.path[0]. What is wanted is the directory from which
IDLE was called.
Insert the current working directory in the path if it isn't there
already.
Kurt B. Kaiser [Sat, 21 Dec 2002 21:03:06 +0000 (21:03 +0000)]
M PyShell.py
M idle
M setup.py
To be able to run from the source directory or from an installed version
of IDLE, and also to allow the subprocess to find run(), Python needs to
have the idlelib package on its path.
1. Modify setup.py to supply a .pth file living at same level as idlelib
2. Move boolcheck to PyShell.py
3. Remove boolcheck and path setting code from the "idle" script
Kurt B. Kaiser [Fri, 20 Dec 2002 22:40:30 +0000 (22:40 +0000)]
Update the setup file:
1. Make it easier to change the package and script installation names.
2. Update the text files transferred to include the .def and new .txt
files.
3. Update the description and long description, change email to
python-dev, update the url to point at sourceforge.
4. Rename the build and install classes for clarity.
Thomas Heller [Fri, 20 Dec 2002 20:13:35 +0000 (20:13 +0000)]
Fix an error message in the _winreg module. The error message referred
to a constant in the 'win32con' module, but this constant is also
defined in the _winreg module itself.
Tony Lownds [Fri, 20 Dec 2002 04:24:43 +0000 (04:24 +0000)]
Update way a subprocess is launched for Mac OS X.
Another applet mechanism has been developed for Python on Mac OS X and
trying to use the -c "__import__('run').main()" trick is just not working.
macosx_main.py is a new file which should be used as the startup file for
Mac OS X applet bundles. This startup file understands a -p option, which
when seen will start run.main(). When running as an applet, this seems like
the best approach.
Tim Peters [Fri, 20 Dec 2002 01:31:27 +0000 (01:31 +0000)]
format_utcoffset(): The natural type of the buflen arg is size_t, so
used that.
wrap_strftime(): Removed the most irritating uses of buf.
TestDate.test_ordinal_conversions(): The C implementation is fast enough
that we can afford to check the endpoints of every year. Also added
tm_yday tests at the endpoints.
Jack Jansen [Wed, 18 Dec 2002 23:17:26 +0000 (23:17 +0000)]
- Added rawdata initializers
- Added support for optional FSSpecs and FSRefs to the Alias routines.
NewAlias and friends are still functions, though, not methods.
Jack Jansen [Tue, 17 Dec 2002 22:10:46 +0000 (22:10 +0000)]
- Added as_pathname and as_tuple methods
- Added access to the "data" attribute
- Fixed the FSRef tp_init routine to accept pathnames on OSX
- Changed the FSSpec tp_repr to return something resembling what
macfs returns.
Jack Jansen [Tue, 17 Dec 2002 22:08:48 +0000 (22:08 +0000)]
Added an optional longname argument to Module, which gives the full,
externally visible name of the module. This is so that type names can be
shown as "Carbon.File.FSSpec" even though the real name of the module is
"_File".
Kurt B. Kaiser [Tue, 17 Dec 2002 21:16:12 +0000 (21:16 +0000)]
M ColorDelegator.py
M PyShell.py
M ScriptBinding.py
1. Update ScriptBinding.py to highlight a syntax error in the Edit window,
and place the cursor on the error. Add a syntax check to the
Run Script event instead of waiting until the script tries to run and
raises a syntax error in the shell, forcing the user to navigate back
to the Edit window to fix it.
2. Modify tag_config's appropriately in PyShell.py and ColorDelegator.py
3. Some minor clean-up in ScriptBinding.py
Gustavo Niemeyer [Tue, 17 Dec 2002 17:48:00 +0000 (17:48 +0000)]
* Objects/fileobject.c
(file_read): Replaced assertion with mixed sign operation by a simple
comment (thank you Raymond). The algorithm is clear enough in that point.
[ 643835 ] Set Next Statement for Python debuggers
with a few tweaks by me: adding an unsigned or two, mentioning that
not all jumps are allowed in the doc for pdb, adding a NEWS item and
a note to whatsnew, and AuCTeX doing something cosmetic to libpdb.tex.
Neal Norwitz [Tue, 17 Dec 2002 01:08:06 +0000 (01:08 +0000)]
Fix SF # 641111, Undocumented side effect of eval
Try to clear up confusion about the current globals being copied
into a globals dict passed to eval(). This wording (more or less)
was suggested in bug report. It should probably be made clearer.
Neal Norwitz [Tue, 17 Dec 2002 01:02:57 +0000 (01:02 +0000)]
Fix SF #642742, property() builtin not documented
Added doc for functions new to 2.2: classmethod property staticmethod super
Taken from docstrings. Could use review.
Hope there wasn't a reason why these shouldn't have been added.
Tim Peters [Mon, 16 Dec 2002 20:18:38 +0000 (20:18 +0000)]
datetime escapes the sandbox. The Windows build is all set. I leave it
to others to argue about how to build it on other platforms (on Windows
it's in its own DLL).
Gustavo Niemeyer [Mon, 16 Dec 2002 18:12:53 +0000 (18:12 +0000)]
Fixed bug
[#521782] unreliable file.read() error handling
* Objects/fileobject.c
(file_read): Clear errors before leaving the loop in all situations,
and also check if some data was read before exiting the loop with an
EWOULDBLOCK exception.
* Doc/lib/libstdtypes.tex
* Objects/fileobject.c
Document that sometimes a read() operation can return less data than
what the user asked, if running in non-blocking mode.
Gustavo Niemeyer [Mon, 16 Dec 2002 13:11:57 +0000 (13:11 +0000)]
Applying patch
[#636769] Fix for major rexec bugs
* Lib/rexec.py
(FileBase): Added 'xreadlines' and '__iter__' to allowed file methods.
(FileWrapper.__init__): Removed unnecessary self.f variable, which gave
direct access to the file object.
(RExec): Added 'xreadlines' and '_weakref' to allowed modules.
(RExec.r_open): Convert string subclasses to a real string classes
before doing comparisons with mode parameter.
* Lib/ihooks.py
(BasicModuleImporter.import_module/reload/unload): Convert the module
name to a real string before working with it.
(ModuleImporter.import_module/import_it/reload): Convert the module
name to a real strings before working with it.
Kurt B. Kaiser [Mon, 16 Dec 2002 02:07:11 +0000 (02:07 +0000)]
M EditorWindow.py
M PyShell.py
Idlefork SF Bug 440383 - IDLE goes into beep loop
Fix loop in EditorWindow.newline_and_indent_event() and
in addition fix submission of >>> prompt to PyParse.Parser
Eliminate extra attribute EditorWindow.auto_indent
Jack Jansen [Sun, 15 Dec 2002 19:55:07 +0000 (19:55 +0000)]
Combined alias and file into a single module. This is the only reasonable
way to get various alias creation routines as methods of FSSpec or FSRef
objects (which is the logical thing, from a Python POV). Also started on
the code that will contain all the macfs functionality, so macfs can
becode a Python module, to be used mainly for backward compatibility.
Kurt B. Kaiser [Sat, 14 Dec 2002 04:38:51 +0000 (04:38 +0000)]
M Debugger.py
M IOBinding.py
M PyShell.py
* Could not remove last set of saved breakpoints from a file
* Starting with empty edit window, could not load a file
* Multiple adjacent breakpoints were saved as one breakpoint
* Storing breakpoints whenever a file is closed can get them out
of synch with the saved version of a file. Only store them when the
file is saved.
* Add comment on current limitations on file editing in the presence of
breakpoints.
* Replace get_current_breaks() with update_breakpoints(), add an update to
PyShellEditorWindow.breakpoints, which is the master breakpoint data
structure, and which is used to reload the subprocess debugger.
* Revert Debugger.Debugger.load_breakpoints() to use editwin.breakpoints.
It is easier to debug the debugger if the breakpoint list in IDLE is
identical to the list in the subprocess debugger and is transferred when
the subprocess debugger is restarted, because this list can be easily
queried.
* Cleanup some linespacing and comments in IOBinding.py
Jack Jansen [Fri, 13 Dec 2002 23:32:51 +0000 (23:32 +0000)]
Sigh: the Jaguar workaround for the prefs file broke saving it on OS9. Temporary workaround is to ignore the exception (it's only about file creator/type anyway).