summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* and a unit test for the staticmethod-of-a-non-method failure just fixedAnthony Baxter2004-08-021-0/+6
|
* fix for @decorators under a debug build.Anthony Baxter2004-08-021-0/+1
|
* Fix doubled word.Raymond Hettinger2004-08-021-1/+1
|
* Completed the patch for Bug #215126.Raymond Hettinger2004-08-025-6/+93
| | | | | | | * Fixes an incorrect variable in a PyDict_CheckExact. * Allow general mapping locals arguments for the execfile() function and exec statement. * Add tests.
* notes for @decoratorAnthony Baxter2004-08-022-0/+7
|
* PEP-0318, @decorator-style. In Guido's words:Anthony Baxter2004-08-0228-1918/+2548
| | | | | "@ seems the syntax that everybody can hate equally" Implementation by Mark Russell, from SF #979728.
* Typo repair.Tim Peters2004-08-021-1/+1
|
* Completed a sentence I left dangling.Tim Peters2004-08-021-1/+2
|
* Removed reliance on damaged module object appearing in sys.modulesTim Peters2004-08-021-2/+1
| | | | | | after a failed import. This is the last checkin in the "change import failure semantics" series.
* New tests:Tim Peters2004-08-021-0/+84
| | | | | | | | | | test_failing_import_sticks -- if an import raises an exception, ensure that trying to import it again continues raising exceptions test_failing_reload -- if a module loads OK, but a reload raises an exception, ensure that the module is still in sys.modules, and that its __dict__ reflects as much of the reload attempt as succeeded. That doesn't seem like sane semantics, but it is backward-compatible semantics <wink>.
* Removed no-longer-needed convolutions to recover from damaged modulesTim Peters2004-08-022-25/+0
| | | | getting left beyind in sys.modules.
* PyImport_ExecCodeModuleEx(): remove module from sys.modules in error cases.Tim Peters2004-08-021-16/+46
| | | | | | | | PyImport_ReloadModule(): restore the module to sys.modules in error cases. load_package(): semantic-neutral refactoring from an earlier stab at this patch; giving it a common error exit made the code easier to follow, so retaining that part. _RemoveModule(): new little utility to delete a key from sys.modules.
* "Core" and "C API" news about new semantics for failing imports.Tim Peters2004-08-021-1/+33
|
* PyImport_ImportModule, PyImport_ImportModuleEx, PyImport_ExecCodeModule:Tim Peters2004-08-021-10/+28
| | | | | in failure cases, incompletely initalized module objects are no longer left behind in sys.modules.
* lock_held() docs: Use True/False instead of 1/0. The LaTeX docs wereTim Peters2004-08-011-3/+3
| | | | already correct, so not changed here.
* Trimmed trailing whitespace.Tim Peters2004-08-011-2/+2
|
* Fix SF #1001053, wave.open() with unicode filename failsNeal Norwitz2004-08-012-2/+4
| | | | Backport candidate.
* Fix typo in commentNeal Norwitz2004-08-011-1/+1
|
* SF bug #1001088, incorrect reference to macro named fooNeal Norwitz2004-08-011-1/+1
| | | | Backport candidate.
* list_ass_slice(): Document the obscure new intent that deleting a sliceTim Peters2004-07-311-8/+16
| | | | | | | | | | | | | | | | | | | | | of no more than 8 elements cannot fail. listpop(): Take advantage of that its calls to list_resize() and list_ass_slice() can't fail. This is assert'ed in a debug build now, but in an icky way. That is, you can't say: assert(some_call() >= 0); because then some_call() won't occur at all in a release build. So it has to be a big pile of #ifdefs on Py_DEBUG (yuck), or the pleasant: status = some_call(); assert(status >= 0); But in that case, compilers may whine in a release build, because status appears unused then. I'm not certain the ugly trick I used here will convince all compilers to shut up about status (status is always "used" now, as the first (ignored) clause in a comma expression).
* Whitespace normalization.Tim Peters2004-07-312-100/+100
|
* Be more careful about reverting mutuations to system-wide (sys) variables.Tim Peters2004-07-311-20/+31
| | | | | | | This fixes 15 spurious test failures on Windows (probably all due to the test leaving a wrong path in sys.argv[0], which then prevented regrtest.py from finding the expected-output files for tests running after test_optparse).
* Mention upgrade of optparse to Optik 1.5a1.Greg Ward2004-07-311-0/+31
|
* Upgrade optparse module and tests to Optik 1.5a1:Greg Ward2004-07-312-341/+747
| | | | | | | | | | | | | | | | | | | | | | | | | | * add expansion of default values in help text: the string "%default" in an option's help string is expanded to str() of that option's default value, or "none" if no default value. * bug #955889: option default values that happen to be strings are now processed in the same way as values from the command line; this allows generation of nicer help when using custom types. Can be disabled with parser.set_process_default_values(False). * bug #960515: don't crash when generating help for callback options that specify 'type', but not 'dest' or 'metavar'. * feature #815264: change the default help format for short options that take an argument from e.g. "-oARG" to "-o ARG"; add set_short_opt_delimiter() and set_long_opt_delimiter() methods to HelpFormatter to allow (slight) customization of the formatting. * patch #736940: internationalize Optik: all built-in user- targeted literal strings are passed through gettext.gettext(). (If you want translations (.po files), they're not included with Python -- you'll find them in the Optik source distribution from http://optik.sourceforge.net/ .) * bug #878453: respect $COLUMNS environment variable for wrapping help output. * feature #988122: expand "%prog" in the 'description' passed to OptionParser, just like in the 'usage' and 'version' strings. (This is *not* done in the 'description' passed to OptionGroup.)
* list_ass_slice(): The difference between "recycle" and "recycled" wasTim Peters2004-07-311-17/+10
| | | | | | | | impossible to remember, so renamed one to something obvious. Headed off potential signed-vs-unsigned compiler complaints I introduced by changing the type of a vrbl to unsigned. Removed the need for the tedious explanation about "backward pointer loops" by looping on an int instead.
* Armin asked for a list_ass_slice review in his checkin, so here's theTim Peters2004-07-311-26/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | result. list_resize(): Document the intent. Code is increasingly relying on subtle aspects of its behavior, and they deserve to be spelled out. list_ass_slice(): A bit more simplification, by giving it a common error exit and initializing more values. Be clearer in comments about what "size" means (# of elements? # of bytes?). While the number of elements in a list slice must fit in an int, there's no guarantee that the number of bytes occupied by the slice will. That malloc() and memmove() take size_t arguments is a hint about that <wink>. So changed to use size_t where appropriate. ihigh - ilow should always be >= 0, but we never asserted that. We do now. The loop decref'ing the recycled slice had a subtle insecurity: C doesn't guarantee that a pointer one slot *before* an array will compare "less than" to a pointer within the array (it does guarantee that a pointer one beyond the end of the array compares as expected). This was actually an issue in KSR's C implementation, so isn't purely theoretical. Python probably has other "go backwards" loops with a similar glitch. list_clear() is OK (it marches an integer backwards, not a pointer).
* Repair typo in docstring.Tim Peters2004-07-311-1/+1
|
* re-wrap paragraphs containing long linesFred Drake2004-07-301-43/+56
|
* - document the termination condition for cmd.Cmd.cmdloop()Fred Drake2004-07-301-1/+8
| | | | - document the use of the return value for cmd.Cmd.do_*() methods
* Fix typo.Martin v. Löwis2004-07-301-1/+1
|
* Add closing methoddesc. Add versionadded. Rewrap.Martin v. Löwis2004-07-301-2/+6
|
* This is a reorganization of list_ass_slice(). It should probably be reviewed,Armin Rigo2004-07-301-22/+20
| | | | | | | | | | | | | | | though I tried to be very careful. This is a slight simplification, and it adds a new feature: a small stack-allocated "recycled" array for the cases when we don't remove too many items. It allows PyList_SetSlice() to never fail if: * you are sure that the object is a list; and * you either do not remove more than 8 items, or clear the list. This makes a number of other places in the source code correct again -- there are some places that delete a single item without checking for MemoryErrors raised by PyList_SetSlice(), or that clear the whole list, and sometimes the context doesn't allow an error to be propagated.
* What if you call lst.__init__() while it is being sorted? :-)Armin Rigo2004-07-301-2/+4
| | | | The invariant checks would break.
* * Simplify and speed-up list_resize(). Relying on the newly documentedRaymond Hettinger2004-07-291-3/+7
| | | | | | | | | invariants allows the ob_item != NULL check to be replaced with an assertion. * Added assertions to list_init() which document and verify that the tp_new slot establishes the invariants. This may preclude a future bug if a custom tp_new slot is written.
* * drop the unreasonable list invariant that ob_item should never come backArmin Rigo2004-07-293-31/+64
| | | | | | | | | | | | | | | | | | | | | to NULL during the lifetime of the object. * listobject.c nevertheless did not conform to the other invariants, either; fixed. * listobject.c now uses list_clear() as the obvious internal way to clear a list, instead of abusing list_ass_slice() for that. It makes it easier to enforce the invariant about ob_item == NULL. * listsort() sets allocated to -1 during sort; any mutation will set it to a value >= 0, so it is a safe way to detect mutation. A negative value for allocated does not cause a problem elsewhere currently. test_sort.py has a new test for this fix. * listsort() leak: if items were added to the list during the sort, AND if these items had a __del__ that puts still more stuff into the list, then this more stuff (and the PyObject** array to hold them) were overridden at the end of listsort() and never released.
* Minor memory leak.Armin Rigo2004-07-291-0/+2
|
* Ignore exceptions which occur when closing files in shutdown()Vinay Sajip2004-07-291-2/+7
|
* SF bug #997533: "disjunct" should be "disjoint"Raymond Hettinger2004-07-291-3/+3
| | | | | * Use plain wording in docs for id(). * Use normal quotation marks instead of single quotes in the description.
* Fix obscure breakage (relative to 2.3) in listsort: the test for listTim Peters2004-07-292-26/+15
| | | | | | | | | | | | mutation during list.sort() used to rely on that listobject.c always NULL'ed ob_item when ob_size fell to 0. That's no longer true, so the test for list mutation during a sort is no longer reliable. Changed the test to rely instead on that listobject.c now never NULLs-out ob_item after (if ever) ob_item gets a non-NULL value. This new assumption is also documented now, as a required invariant in listobject.h. The new assumption allowed some real simplification to some of the hairier code in listsort(), so is a Good Thing on that count.
* SF bug #999776, zlib home page wrongNeal Norwitz2004-07-293-3/+3
| | | | Backport candidate.
* SF #998170, fix typo. Backport candidateNeal Norwitz2004-07-291-1/+1
|
* Document what the members of PyListObject are used for, and the crucialTim Peters2004-07-291-0/+9
| | | | invariants they must satisfy.
* Trimmed trailing whitespace.Tim Peters2004-07-291-21/+21
|
* PyList_New(): we went to all the trouble of computing and bounds-checkingTim Peters2004-07-291-1/+2
| | | | | the size_t nbytes, and passed nbytes to malloc, so it was confusing to effectively recompute the same thing from scratch in the memset call.
* Add missing doc for Py_True/Py_False. Use the correct macro to defineSkip Montanaro2004-07-291-6/+16
| | | | Py_RETURN_FALSE and Py_RETURN_TRUE.
* Use PyMODINIT_FUNC.Thomas Heller2004-07-281-1/+1
|
* New codec: [ 996067 ] hp-roman8 codecMarc-André Lemburg2004-07-282-0/+140
|
* Added new codec hp-roman8 submitted as patch [ 996067 ] hp-roman8 codec.Marc-André Lemburg2004-07-281-0/+7
|
* Add new encodingsAndrew M. Kuchling2004-07-281-4/+5
|
* Since build_py handles package data installation, the list of outputsFred Drake2004-07-281-0/+11
| | | | | can contain more than just .py files. Make sure we only report bytecode files for the .py files.