Commit Graph

23331 Commits

Author SHA1 Message Date
Jack Jansen 3e6c80bf5e Hmm, in some cases we don't seem to get our scriptname in argv[0].
Cater for that by working from sys.executable.
2002-08-02 15:31:25 +00:00
Jack Jansen ba1c13db4f Final step in making applets first-class citizens: if the applet wants
argv emulation (i.e. if the end user drops files and folders on the
applets these will show up in sys.argv) BuildApplet will add the required
code to the applet bundle, in __rawmain__.pyc.

This code is compiled from appletrawmain.py, it creates sys.argv, cleans
up most of the mess and executes either __main__.py or __main__.pyc.
2002-08-02 14:57:43 +00:00
Jack Jansen a9454e21a7 Oops, the -psn stuff is in argv[1], of course. 2002-08-02 14:54:46 +00:00
Jack Jansen 21ed16acbe Added one call to Py_Main(), for OSX framework builds only, that will get the
actual script to run in case we are running from an applet. If we are indeed
running an applet we skip the normal option processing leaving it all to the
applet code.

This allows us to get use the normal python binary in the Python.app bundle,
giving us all the normal command line options through PythonLauncher while
still allowing Python.app to be used as the template for building applets.

Consequently, pythonforbundle is gone, and Mac/Python/macmain.c isn't used
on OSX anymore.
2002-08-02 14:11:24 +00:00
Jack Jansen 94416e55d3 Got rid of a couple of OS9-isms. 2002-08-02 14:04:42 +00:00
Jack Jansen 2eb4b18f94 - Slightly better error message in case of syntax errors in the script.
- The applet .rsrc file should be called python.rsrc, it is not based on the
  applet name.
2002-08-02 14:04:15 +00:00
Michael W. Hudson 90b8e4d40c Fix for
[ 589427 ] standard include paths on command line
2002-08-02 13:55:50 +00:00
Jack Jansen 6e1986ba9c - Remove -psn-xxxx argument added by the Finder.
- "Open Document" appleevent is "odoc", not "open".
2002-08-02 12:56:21 +00:00
Jack Jansen d5049e734f Replaced python.app target with osxapps (it builds more than
one .app nowadays) and fixed it to work.
2002-08-02 11:24:11 +00:00
Jack Jansen f4f6d4859d Construct a sys.argv from the initial AppleEvent sent by the finder
during startup of a program. This module will replace the C code in
macgetargv.c so we can get rid of the special macmain.c for OSX
Python.app.
2002-08-02 11:12:15 +00:00
Jack Jansen d05e18139f Slightly better error message in case of missing resources. 2002-08-02 11:03:19 +00:00
Tim Peters d5f4359458 New test %sort. This takes a sorted list, picks 1% of the list positions
at random, and replaces the elements at those positions with new random
values.  I was pleasantly surprised by how fast this goes!  It's hard to
conceive of an algorithm that could special-case for this effectively.
Plus it's exactly what happens if a burst of gamma rays corrupts your
sorted database on disk <wink>.

 i    2**i  *sort  ...  %sort
15   32768   0.18  ...   0.03
16   65536   0.24  ...   0.04
17  131072   0.53  ...   0.08
18  262144   1.17  ...   0.16
19  524288   2.56  ...   0.35
20 1048576   5.54  ...   0.77
2002-08-02 05:46:09 +00:00
Mark Hammond fe51c6d66e Excise DL_EXPORT/DL_IMPORT from Modules/*. Required adding a prototype
for Py_Main().

Thanks to Kalle Svensson and Skip Montanaro for the patches.
2002-08-02 02:27:13 +00:00
Skip Montanaro d3c884d4ea modify testGetServByName so it tries a few different protocols. In this day
and age of rampant computer breakins I imagine there are plenty of systems
with telnet disabled.  Successful check of at least one getservbyname() call
is required for success
2002-08-02 02:19:46 +00:00
Jack Jansen ea0c3828c0 - Get _environ through the NSEnviron call in a MacOSX framework. This allows
us to completely decouple the framework from the executable, so we
  can use a two-level namespace.
- Do framework builds with a twolevel namespace.
- Reorganized the code that creates the minimal framework in the build
  directory, to make it more robust against incomplete frameworks (from
  earlier aborted builds, or builds of previous Python versions).
2002-08-01 21:57:49 +00:00
Jack Jansen be3e1f7a95 Python.app is now a hidden application, deep in the framework. It will
be invoked by PythonLauncher when needed.

Also changed the names of various variables in the Makefile to match
what the main Makefile has.
2002-08-01 21:14:06 +00:00
Jack Jansen 2fc993d16f Python.app no longer advertises that it can handle .py and .pyc files,
PythonLauncher.app has taken that responsibility over.
2002-08-01 21:12:36 +00:00
Guido van Rossum b54c27c861 Fix for SF bug 570678 (can't flush read-only file on Mac OS X). 2002-08-01 21:12:35 +00:00
Guido van Rossum f4be427c46 Tim found that once test_longexp has run, test_sort takes very much
longer to run than normal.  A profiler run showed that this was due to
PyFrame_New() taking up an unreasonable amount of time.  A little
thinking showed that this was due to the while loop clearing the space
available for the stack.  The solution is to only clear the local
variables (and cells and free variables), not the space available for
the stack, since anything beyond the stack top is considered to be
garbage anyway.  Also, use memset() instead of a while loop counting
backwards.  This should be a time savings for normal code too!  (By a
probably unmeasurable amount. :-)
2002-08-01 18:50:33 +00:00
Jack Jansen 0a3d6060d5 Only show the UI for selecting options if the ALT key was depressed while
dragging or double-clicking the script.
2002-08-01 15:07:00 +00:00
Guido van Rossum 0dbab4c560 SF patch 588728 (Nathan Srebro).
The __delete__ method wrapper for descriptors was not supported

(I added a test, too.)

2.2 bugfix candidate.
2002-08-01 14:39:25 +00:00
Tim Peters 74824584ef Added new footnote about list.sort() stability. Repaired footnote about
using sort() with comparison functions (it made reference to the non-
existent "builtin-in function sort()").

BTW, I changed list.sort's docstring to contain the word "stable" -- the
easiest way to tell whether a particular Python version's sort *is* stable
is to look for "stable" in the docstring.  I'm not sure whether to
advertise this <wink>.
2002-08-01 03:10:45 +00:00
Tim Peters f47630ff54 A blurb about the sort implementation. 2002-08-01 02:34:51 +00:00
Tim Peters 2d8b765cc9 New test for sorting sanity. Note that this will fail in earlier Pythons,
in the stability tests.

Bizarre:  this takes 11x longer to run if and only if test_longexp is
run before it, on my box.  The bigger REPS is in test_longexp, the
slower this gets.  What happens on your box?  It's not gc on my box
(which is good, because gc isn't a plausible candidate here).

The slowdown is massive in the parts of test_sort that implicitly
invoke a new-style class's __lt__ or __cmp__ methods.  If I boost
REPS large enough in test_longexp, even the test_sort tests on an array
of size 64 visibly c-r-a-w-l.  The relative slowdown is even worse in
a debug build.  And if I reduce REPS in test_longexp, the slowdown in
test_sort goes away.

test_longexp does do horrid things to Win98's management of user
address space, but I thought I had made that a whole lot better a month
or so ago (by overallocating aggressively in the parser).
2002-08-01 02:23:06 +00:00
Tim Peters a64dc245ac Replaced samplesort with a stable, adaptive mergesort. 2002-08-01 02:13:36 +00:00
Tim Peters 92f81f2e63 Checking in the doc file for "timsort". There's way too much here to
stuff into code comments, and lots of it is going to be useful again (but
hard to predict exactly which parts of it ...).
2002-08-01 00:59:42 +00:00
Tim Peters 6be147541a Restore a full arglist to the socket wrapper, so it supports keyword
arguments correctly too.
2002-07-31 17:48:02 +00:00
Tim Peters 8c3fb874ae For platforms (like Windows) that wrap _socket.socket:
+ Don't change the arglist requirements.
+ Give the wrapper the same docstring as _socket.socket (it didn't
  have any docstring).
2002-07-31 17:32:11 +00:00
Tim Peters 108b7918b0 Reverting this to rev 1.3. It's apparently broken everywhere at rev
1.6, and pierslauder didn't respond to email about it on Monday.
2002-07-31 16:42:33 +00:00
Guido van Rossum b995eb79a0 Enable test_socket again, if only to prevent mistakes like Jeremy
thinking that he was running his new test by running "make test".
Also, I can't get this to fail any more.  Your turn. :-)
2002-07-31 16:08:40 +00:00
Jeremy Hylton cbd5b89571 Repair testNtoH for large long arguments.
If the long is large enough, the return value will be a negative int.
In this case, calling the function a second time won't return the
original value passed in.
2002-07-31 15:57:39 +00:00
Jack Jansen cce7e34aeb - Install into /Applications/Python in stead of into /Applications.
- Build PythonLauncher.app and PythonIDE.app as well as Python.app.
2002-07-31 14:46:04 +00:00
Jack Jansen 40e2e51a7e Install into /Applications/Python in stead of into /Applications. 2002-07-31 14:45:08 +00:00
Jack Jansen b7276cdf71 Implemented starting Python in a terminal window. The implementation isn't
optimal, especially if Terminal wasn't running yet, but it works.
2002-07-31 13:15:59 +00:00
Michael W. Hudson 33876f514a Patch:
[ 561724 ] README additions for Cray T3E

Lightly edited by me.
2002-07-31 09:55:25 +00:00
Michael W. Hudson b6a4505123 Cray fixup as seen in bug #558153. 2002-07-31 09:54:24 +00:00
Mark Hammond 543fb35cca Replace DL_EXPORT with PyMODINIT_FUNC 2002-07-31 06:17:46 +00:00
Barry Warsaw 408b6d34de Complete the absolute import patch for the test suite. All relative
imports of test modules now import from the test package.  Other
related oddities are also fixed (like DeprecationWarning filters that
weren't specifying the full import part, etc.).  Also did a general
code cleanup to remove all "from test.test_support import *"'s.  Other
from...import *'s weren't changed.
2002-07-30 23:27:12 +00:00
Martin v. Löwis 1bc894b133 Shared libraries also work on GNU/Hurd. Suggested by Matthias Klose. 2002-07-30 20:19:58 +00:00
Guido van Rossum fb0e545c85 Get rid of the DEFS variable. The only thing this was used for was to
pass -DHAVE_CONFIG_H to CC, and that symbol isn't used any more.
2002-07-30 19:06:51 +00:00
Fred Drake 5b11bdd0ed SF patch #581414: info reader bug
The "Matching vs. Searching" Info node is unreachable from the Info
program (but is fine in Emacs's Info mode). This patch seems to fix
it.  This is the only occurrence where the info reader fails, so
probably it could be addressed in the python docs as a workaround.
Forwarded the report to the info maintainer.
2002-07-30 17:51:20 +00:00
Michael W. Hudson 202a4b6fdd Repair fill-paragraph damage.
Clarify LLTRACE description.  It was introduced in 1992, revision 2.20 of
ceval.c, well before Python 1.0!
2002-07-30 15:25:57 +00:00
Neal Norwitz cfa1f52941 Revert changes to use PyArg_Parse(), so any sequence will continue to work -- Spotted by Just van Rossum 2002-07-30 12:27:43 +00:00
Thomas Heller 37d5a15e02 Whitespace normalization. 2002-07-30 11:44:44 +00:00
Thomas Heller 3e1c18ad0c Fix SF 588452: debug build crashes on marshal.dumps([128] * 1000).
See there for a description.

Added test case.

Bugfix candidate for 2.2.x, not sure about previous versions:
probably low priority, because virtually no one runs debug builds.
2002-07-30 11:40:57 +00:00
Michael W. Hudson a6255238b2 add description of LLTRACE. 2002-07-30 09:49:29 +00:00
Neal Norwitz 50584b4c78 Use PyArg_ParseTuple() instead of PyArg_Parse() which is deprecated 2002-07-30 01:23:07 +00:00
Neal Norwitz 50d5d4fe31 Fix docstring to be consistent with parameter name (prefix) 2002-07-30 01:17:43 +00:00
Neal Norwitz 1169011f6f SF patch #584245, get python to link on OSF1 (Dec Unix) 2002-07-30 01:08:28 +00:00
Neal Norwitz cee5ca060b SF patch #587889, fix memory leak of tp_doc 2002-07-30 00:42:06 +00:00