Jack Jansen [Fri, 6 Sep 2002 19:47:49 +0000 (19:47 +0000)]
Script to generate .pkg packages, donated by Dinu Gherman. This is his
original code, it still needs fiddling to make it work in general
circumstances.
Added a tutorial note and example regarding the scope of loop variables
in a list comprehension. Includes a justification and a comparision
to regular for-loops.
Walter Dörwald [Fri, 6 Sep 2002 16:15:58 +0000 (16:15 +0000)]
Apply diff3.txt (plus additional documentation)
from SF patch http://www.python.org/sf/554192
This adds two new functions to mimetypes:
guess_all_extensions() which returns a list of all known
extensions for a mime type, and add_type() which adds one
mapping between a mime type and an extension.
Barry Warsaw [Fri, 6 Sep 2002 03:55:04 +0000 (03:55 +0000)]
_formatparam(), set_param(): RFC 2231 encoding support by Oleg
Broytmann in SF patch #600096. Specifically, the former function now
encodes the triplets, while the latter adds optional charset and
language arguments.
Barry Warsaw [Fri, 6 Sep 2002 03:41:27 +0000 (03:41 +0000)]
test_mondo_message(): "binary" is not a legal content type, so with
the previous RFC 2045, $5.2 repair to get_content_type() this
subpart's type will now be text/plain.
Barry Warsaw [Fri, 6 Sep 2002 03:38:12 +0000 (03:38 +0000)]
replace_header(): New method given by Skip Montanaro in SF patch
#601959. Modified slightly by Barry (who added the KeyError in case
the header is missing.
Kurt B. Kaiser [Thu, 5 Sep 2002 02:31:20 +0000 (02:31 +0000)]
M PyShell.py
M RemoteDebugger.py
M ScriptBinding.py
Restart the execution server with a clean environment and execute the
active module from scratch upon activation of Run/F5.
Add functionality to PyShell.py to restart the execution server in a new
subprocess. The server makes a connection to the Idle client which sends a
block of code to be executed.
Modify ScriptBinding.py to restart the subprocess upon Run/F5, assuming that
an execution is not currently in progress. Remove Import Module functionality,
not required now that the code is executed in a clean environment.
If the Debugger is active, also restart the subprocess side of the split
debugger. Add functionality to RemoteDebugger.py to support this.
At this time breakpoints will be lost in the subprocess if Run/F5 is activated.
A subsequent checkin of PyShell.py will implement reloading of the breakpoints
into the subprocess debugger. I'm keeping this separate as the design may
change.
The problem was that it expected rfc822.parseaddr() to return None
upon a parse failure. The actual, documented return value for a
parse failure is (None, None).
Walter Dörwald [Wed, 4 Sep 2002 20:31:32 +0000 (20:31 +0000)]
Change the unicode.translate docstring to document that
Unicode strings (with arbitrary length) are allowed
as entries in the unicode.translate mapping.
Add a test case for multicharacter replacements.
(Multicharacter replacements were enabled by the
PEP 293 patch)
Delete the %c test from test_date_time() untill Brett Cannon has time
to fix it. (It fails when the day of the month is a 1-digit number,
because %c produces space+digit there, while strptime seems to expect
zero+digit somehow.)
Add a custom __str__ method to KeyError that applies repr() to the
missing key. (Also added a guard to SyntaxError__str__ to prevent
calling PyString_Check(NULL).)
Bump default check interval to 100 instructions. Computers are much faster
than when this interval was first established. Checking too frequently just
adds needless overhead because most of the time there is nothing to do and
no other threads ready to run.
replace thread state objects' ticker and checkinterval fields with two
globals, _Py_Ticker and _Py_CheckInterval. This also implements Jeremy's
shortcut in Py_AddPendingCall that zeroes out _Py_Ticker. This allows the
test in the main loop to only test a single value.
The new execvpe code would sometimes do the wrong thing when a
non-executable file existed earlier in the path and an executable file
of the same name existed later in the path. This patch restores the
proper behavior (which is to execute the second file). When only a
non-executable file exists, the correct error is still reported.
Walter Dörwald [Tue, 3 Sep 2002 13:53:40 +0000 (13:53 +0000)]
Check whether a string resize is necessary at the end
of PyString_DecodeEscape(). This prevents a call to
_PyString_Resize() for the empty string, which would
result in a PyErr_BadInternalCall(), because the
empty string has more than one reference.
This closes SF bug http://www.python.org/sf/603937
Fred Drake [Mon, 2 Sep 2002 15:54:06 +0000 (15:54 +0000)]
Minor change for symmetry with PyXML: PyDoc_STR should not include
the "safety" parentheses since some older compilers refuse to compile
the module then, claiming that static initializers are non-constant.
This doesn't actually make any difference for Python, since these
definitions are not used when compiling with a version of Python that
already defines the PyDoc_* macros.
Guido van Rossum [Sat, 31 Aug 2002 15:16:14 +0000 (15:16 +0000)]
Because MWH changed the bytecode again, moved the magic number *back*
to 62011. This should get the snake-farm to throw away its old .pyc
files, amongst others.
Jack Jansen [Sat, 31 Aug 2002 01:25:17 +0000 (01:25 +0000)]
Implemented the Help menu. The Python manual can be viewed (if installed)
and the selection can be looked up, and so can the Carbon manual. From the
help menu you can also get to the online documentation, the Python website
and the MacPython page.
Further SET_LINENO reomval fixes. See comments in patch #587933.
Use a slightly different strategy to determine when not to call the line
trace function. This removes the need for the RETURN_NONE opcode, so
that's gone again. Update docs and comments to match.
Thanks to Neal and Armin!
Also add a test suite. This should have come with the original patch...
Jack Jansen [Fri, 30 Aug 2002 12:56:08 +0000 (12:56 +0000)]
On Jaguar the default mode for files in the installed product is 444 (or 555)
in stead of 644 (755). This makes a subsequent install fail. Changed
the INSTALL_MODE_FLAG to fix this.
Jack Jansen [Thu, 29 Aug 2002 21:09:00 +0000 (21:09 +0000)]
Revived the Carbon.Help module, but implementing the MacHelp API in stead
of the defunct Balloons API. Help tags are TBD, but at least this gives
us access to the help menu.
Barry Warsaw [Thu, 29 Aug 2002 15:29:49 +0000 (15:29 +0000)]
strptime(): The code that was adding 12 to PM hours was incorrect
because it added it to 12 PM too. 12 PM should be hour 12 not hour
24.
Also cleaned up a minor style nit. There are more style problems in
this file that I'll clean up next (but I didn't want them to overwhelm
the substance of this fix).
Barry Warsaw [Thu, 29 Aug 2002 15:25:04 +0000 (15:25 +0000)]
The test I saw failing this morning just happened to be run at 8am
localtime, which in -0400 is 12 noon GMT. The bug boiled down to
broken conversion of 12 PM to hour 12 for the '%I %p' format string.
Added a test for this specific condition: Strptime12AMPMTests. Fix to
_strptime.py coming momentarily.
Guido van Rossum [Thu, 29 Aug 2002 15:10:30 +0000 (15:10 +0000)]
Undo Barry's change. This file is not imported, it's fed as input to
the tokenize module by test_tokenize.py. The FutureWarnings only
appeared during installation, and I've figured out a way to suppress
those in a different way.
Barry Warsaw [Thu, 29 Aug 2002 13:09:47 +0000 (13:09 +0000)]
Fixed three exceptions in the Plain integers test, although I'm not
sure these are the best fixes.
- Test maxint-1 against the negative octal constant -020000000000
- Comment out the tests for oct -1 and hex -1, since 037777777777 and
0xffffffff raise FutureWarnings now and in Python 2.4 those
constants will produce positive values, not negative values. So the
existing test seems to test something that won't be true in 2.4.
Jack Jansen [Wed, 28 Aug 2002 22:22:10 +0000 (22:22 +0000)]
Distutils-based script by Bill Fancher to download the Python documentation
HTML tarball and use it to create a documentation tree readable and
searchable with Apple Help Viewer. The documentation also shows up in
Project Builder (if you add Python.framework to your project).
Jack Jansen [Wed, 28 Aug 2002 21:27:02 +0000 (21:27 +0000)]
- Install a symlink to the documentation (which lives in the framework)
in Python.app, and refer to it in Info.plist. This makes Apple Help
Viewer recognize the Python documentation.
- Changed the externally visible name of Python.app to "Python" (was PythonW).
Jack Jansen [Wed, 28 Aug 2002 21:23:53 +0000 (21:23 +0000)]
Distutils-based script by Bill Fancher to download the Python documentation
HTML tarball and use it to create a documentation tree readable and
searchable with Apple Help Viewer. The documentation also shows up in
Project Builder (if you add Python.framework to your project).