Barry Warsaw [Thu, 24 Apr 2003 18:14:49 +0000 (18:14 +0000)]
Updated a bunch of docs to describe how message ids and strings are
Unicode in GNUTranslations. Also provide better descriptions of
*gettext() overridden methods, esp. w.r.t. the behavior in the face of
fallbacks.
Barry Warsaw [Thu, 24 Apr 2003 18:13:39 +0000 (18:13 +0000)]
GNUTranslations:
__init__(): Removed since we no longer need the coerce flag.
Message ids and strings are now always coerced to Unicode, /if/
the catalog specified a charset parameter.
gettext(), ngettext(): Since the message strings are Unicodes in
the catalog, coerce back to encoded 8-bit strings on return.
ugettext(), ungettext(): Coerce the message ids to Unicode when
there's no entry for the id in the catalog.
Minor code cleanups; use booleans where appropriate.
SF bug 665835: filter() treatment of str and tuple inconsistent
As a side issue on this bug, it was noted that list and tuple iterators
used macros to directly access containers and would not recognize
__getitem__ overrides. If the method is overridden, the patch returns
a generic sequence iterator which calls the __getitem__ method; otherwise,
it returns a high custom iterator with direct access to container elements.
Walter Dörwald [Wed, 23 Apr 2003 19:50:24 +0000 (19:50 +0000)]
Max OS X returns "*" as the password in grp.getgrall()
and "" in grep.getgrgid(). Adjust the test to work
around this problem. This should fix SF bug #724771.
SF 557704: netrc module can't handle all passwords
Expanded the range of allowable characters to include ascii punctuation.
Allows resource files to have a larger character set for passwords.
(Idea contributed by Bram Moolenaar.)
SF Patch 685051: fix for 680789: reprs in arraymodule
(contributed by logistix; substantially reworked by rhettinger).
To create a representation of non-string arrays, array_repr() was
starting with a base Python string object and repeatedly using +=
to concatenate the representation of individual objects.
Logistix had the idea to convert to an intermediate tuple form and
then join it all at once. I took advantage of existing tools and
formed a list with array_tolist() and got its representation through
PyObject_Repr(v) which already has a fast implementation for lists.
Tim Peters [Wed, 23 Apr 2003 02:39:17 +0000 (02:39 +0000)]
Enable os.fsync() for Windows, mapping it to MS's _commit() there. The
docs here are best-guess: the MS docs I could find weren't clear, and
some even claimed _commit() has no effect on Win32 systems (which is
easily shown to be false just by trying it).
Mark Hammond [Tue, 22 Apr 2003 23:13:27 +0000 (23:13 +0000)]
Update to the new PyGILState APIs to simplify and correct thread-state
management. Old code still #ifdef'd out - I may remove this in a sec,
but for now, let's get it in and things passing the tests again!
Fred Drake [Tue, 22 Apr 2003 18:15:05 +0000 (18:15 +0000)]
Do a little more searching for the data file for the test: this allows
using a build directory just inside the source directory and saving
just one copy of the test data in the source tree, rather than having
a copy in each build directory.
Improved the bytecode optimizer.
* Can now test for basic blocks.
* Optimize inverted comparisions.
* Optimize unary_not followed by a conditional jump.
* Added a new opcode, NOP, to keep code size constant.
* Applied NOP to previous transformations where appropriate.
Note, the NOP would not be necessary if other functions were
added to re-target jump addresses and update the co_lnotab mapping.
That would yield slightly faster and cleaner bytecode at the
expense of optimizer simplicity and of keeping it decoupled
from the line-numbering structure.
Get test_capi & test_getargs2 to pass on alphas
* UINT_MAX -> ULONG_MAX since we are dealing with longs
* ParseTuple needs &int for 'i' and &long for 'l'
There may be a better way to do this, but this works.
Andrew MacIntyre [Mon, 21 Apr 2003 14:33:04 +0000 (14:33 +0000)]
Makefile & config.c:
- restructure build for modules now in Python DLL
README.os2emx
- clean out old cruft no longer appropriate now that EMX port builds
from CVS
- reflect move of modules into core DLL
- add section on building from source
Update to Optik 1.4.1; here are the relevant bits of the change log:
* Fixed some long-hidden bugs revealed by the new PyUnit-based
test suite (thanks to Johannes Gijsbers the new test suite,
improved tests that caught the bugs, and the bug fixes).
* Make store_true/store_false store True/False rather than 1/0.
I've applied a modified version of Greg Chapman's patch. I've included
the fixes without introducing the reorganization mentioned, for the sake
of stability. Also, the second fix mentioned in the patch don't fix the
mentioned problem anymore, because of the change introduced by patch
#720991 (by Greg as well). The new fix wasn't complicated though, and is
included as well.
As a note. It seems that there are other places that require the
"protection" of LASTMARK_SAVE()/LASTMARK_RESTORE(), and are just waiting
for someone to find how to break them. Particularly, I belive that every
recursion of SRE_MATCH() should be protected by these macros. I won't
do that right now since I'm not completely sure about this, and we don't
have much time for testing until the next release.
- Fixed bug #672491. This change restores the behavior of lastindex/lastgroup
to be compliant with previous python versions, by backing out the changes
made in revision 2.84 which affected this. The bugfix for backtracking is
still maintained.
Tim Peters [Sat, 19 Apr 2003 18:47:02 +0000 (18:47 +0000)]
handle_system_exit(): This leaked the current exception info, in
particular leaving the traceback object (and everything reachable
from it) alive throughout shutdown. The patch is mostly from Guido.
- bool() called without arguments now returns False rather than
raising an exception. This is consistent with calling the
constructors for the other builtin types -- called without argument
they all return the false value of that type. (SF patch #724135)
Thanks to Alex Martelli.
- Several methods of nntplib.NNTP have grown an optional file argument
which specifies a file where to divert the command's output
(already supported by the body() method). (SF patch #720468)
Thanks to Terry Carroll.