Skip testing inet_ntop() an inet_pton() if they aren't defined.
This makes the test pass on Windows again (and on other platforms
that don't have these).
Fix the tests on Windows, by writing the test data file in binary
mode.
XXX I'm not convinced that this is the right solution -- arguably,
on Windows, the _fileobject class should honor the mode argument
and do newline translation. But it's never done that so I think
there's no urgent need to fix this today.
Fred Drake [Fri, 25 Apr 2003 14:27:00 +0000 (14:27 +0000)]
Attempt to deal with some obvious errors in the code. These were all
due to using a single module-level namespace where multiple namespaces
were used before.
There *really* need to be tests for the sniffer stuff. This could
have been avoided.
Tim Peters [Fri, 25 Apr 2003 07:11:48 +0000 (07:11 +0000)]
New generator os.walk() does a bit more than os.path.walk() does, and
seems much easier to use. Code, docs, NEWS, and additions to test_os.py
(testing this sucker is a bitch!).
- The socket module now provides the functions inet_pton and inet_ntop
for converting between string and packed representation of IP addresses.
See SF patch #658327.
This still needs a bit of work in the doc area, because it is not
available on all platforms (especially not on Windows).
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!