Commit Graph

8020 Commits

Author SHA1 Message Date
Martin v. Löwis b4cb664df4 New file. 2003-04-19 12:57:57 +00:00
Martin v. Löwis 78e2f06cc6 Fully support 32-bit codes. Enable BIGCHARSET in UCS-4 builds. 2003-04-19 12:56:08 +00:00
Martin v. Löwis 53d93adc46 Patch #681152: Support escaped Unicode characters in classes. Fixes #612074.
Will backport to 2.2.
2003-04-19 08:37:24 +00:00
Brett Cannon 1e91d8eb03 Make _strptime escape regex syntax in format string to prevent use in internal regex. 2003-04-19 04:00:56 +00:00
Barry Warsaw 482c5f7eb7 as_string(): Added some text to the docstring to make it clear that
it's a convenience only and give hints on what to do for more
flexibility.
2003-04-18 23:04:35 +00:00
Martin v. Löwis 281b2c6211 Patch #536883: SimpleXMLRPCServer auto-docing subclass. 2003-04-18 21:04:39 +00:00
Martin v. Löwis b5c4b7be3f Skip nameprep test 3.43, as we do allow unassigned characters. The test
fails only in UCS-2 mode, since it tests a non-BMP character.
2003-04-18 20:21:00 +00:00
Jason Tishler d7e83a1d51 Patch #718049: Setting exe_extension for cygwin
On cygwin, the setup.py script uses unixccompiler.py for compiling and linking
C extensions. The unixccompiler.py script assumes that executables do not get
special extensions, which makes sense for Unix.  However, on Cygwin,
executables get an .exe extension.

This causes a problem during the configuration step (python setup.py config),
in which some temporary executables may be generated. As unixccompiler.py does
not know about the .exe extension, distutils fails to clean up after itself: it
does not remove _configtest.exe but tries to remove _configtest instead.

The attached patch to unixccompiler.py sets the correct exe_extension for
cygwin by checking if sys.platform is 'cygwin'. With this patch, distutils
cleans up after itself correctly.

Michiel de Hoon
University of Tokyo, Human Genome Center.
2003-04-18 17:27:47 +00:00
Martin v. Löwis 2548c730c1 Implement IDNA (Internationalized Domain Names in Applications). 2003-04-18 10:39:54 +00:00
Guido van Rossum bbb931bebd Delete the 'h' test -- 'h' is no longer unsigned so the machinery here
can't test it.  It's unchanged so why would we test it anyway...
2003-04-18 00:13:53 +00:00
Neal Norwitz 10cf21802d Use True in a few more places.
Use isinstance(somestring, basestring) instead of type() as per PEP 8
2003-04-17 23:09:08 +00:00
Neal Norwitz aa1ac546b6 Get test to work under regrtest when running whole suite 2003-04-17 23:04:22 +00:00
Fred Drake fafd56f439 Add test that demonstrates SGML-style handling of processing
instructions.
2003-04-17 22:19:26 +00:00
Fred Drake 243152384b - use Tue/False for booleans
- some very minor cleanups
2003-04-17 22:01:17 +00:00
Gustavo Niemeyer 68d8cef89a Implemented posix-mode parsing support in shlex.py, as dicussed in
mailing list, and in patch #722686.
2003-04-17 21:31:33 +00:00
Thomas Heller a4ea603b05 SF # 595026: support for masks in getargs.c.
New functions:
  unsigned long PyInt_AsUnsignedLongMask(PyObject *);
  unsigned PY_LONG_LONG) PyInt_AsUnsignedLongLongMask(PyObject *);
  unsigned long PyLong_AsUnsignedLongMask(PyObject *);
  unsigned PY_LONG_LONG) PyLong_AsUnsignedLongLongMask(PyObject *);

New and changed format codes:

b unsigned char 0..UCHAR_MAX
B unsigned char none **
h unsigned short 0..USHRT_MAX
H unsigned short none **
i int INT_MIN..INT_MAX
I * unsigned int 0..UINT_MAX
l long LONG_MIN..LONG_MAX
k * unsigned long none
L long long LLONG_MIN..LLONG_MAX
K * unsigned long long none

Notes:

* New format codes.

** Changed from previous "range-and-a-half" to "none"; the
range-and-a-half checking wasn't particularly useful.

New test test_getargs2.py, to verify all this.
2003-04-17 18:55:45 +00:00
Neal Norwitz 6e5be22d97 Remove extra space in docstring 2003-04-17 13:13:55 +00:00
Guido van Rossum 2cd0a65c70 Add 'get' method to Variable and switch it from internal class to
standard class (it is now useful because it doesn't constrain the type
of the value).
2003-04-16 20:10:03 +00:00
Guido van Rossum a4541a30fc - super() no longer ignores data descriptors, except __class__. See
the thread started at
  http://mail.python.org/pipermail/python-dev/2003-April/034338.html
2003-04-16 20:02:22 +00:00
Martin v. Löwis bfe175c190 For StringVar results to strings. Document that boolean things are of
type bool. Requested in #721171.
2003-04-16 19:42:51 +00:00
Jack Jansen be5d707926 When on MacOSX, and only in a framework build, add
~/Library/Python/2.3/site-packages to sys.path, if it exists.
2003-04-16 13:12:21 +00:00
Jack Jansen 36d49a907f The identify() description didn't match the code. Fixed. 2003-04-16 13:10:53 +00:00
Jack Jansen 20fa6754d1 Allow switching of install dir after creation of preferences.
Changed some message to be clearer when presented by Package Manager.
2003-04-16 12:15:34 +00:00
Walter Dörwald 5688b7ac3e Add two dictionaries to htmlentitydefs: name2codepoint maps
HTML entity names to Unicode codepoints (as integers).
codepoint2name is the reverse mapping. From SF patch #722017.
2003-04-16 09:46:13 +00:00
Jack Jansen a95eab5920 Test SystemEvents too. 2003-04-15 21:40:30 +00:00
Guido van Rossum 52b2705e9c Ouch, it's Carlo Verre, not Verre Carlo. 2003-04-15 20:05:10 +00:00
Walter Dörwald 357981e99d Add a few errors tests for range(). 2003-04-15 18:59:28 +00:00
Walter Dörwald 64976e74af Fix copy & paste error in comment. 2003-04-15 16:08:01 +00:00
Walter Dörwald 43bc1f18db Fix the test so that it works even when /etc/group has two entries
for the same gid.
2003-04-15 15:59:36 +00:00
Walter Dörwald 66e1e508b9 Fix the test so that it works even when /etc/passwd has two entries
for the same uid.
2003-04-15 15:39:08 +00:00
Jack Jansen 6fde1cef4a - Use the tarfile module to unpack tarfiles.
- Allow setting the destination install directory. If this is set then
  it is used for the modules, other items (header files, etc) are not
  installed, and warnings are printed if the package would have liked to.

Unfortunaltey binary installs seem broken due to a tarfile bug (#721871)
or my misunderstanding of how tarfile works.
2003-04-15 14:43:05 +00:00
Tim Peters 299b3dffd2 test_range(): The C code changed to raise TypeError in one of these
cases, but the test still expected ValueError.  Repaired that.
2003-04-15 14:40:03 +00:00
Walter Dörwald b1ded1e508 Port test_pwd.py to PyUnit. Check that getpwall() and
getpwnam()/getpwuid() return consistent data.

Change test_grp to check that getgrall() and
getgrnam()/getgrgid() return consistent data.
Add error checks similar to test_pwd.py.

Port test___all__.py to PyUnit.

From SF patch #662807.
2003-04-15 11:10:33 +00:00
Guido van Rossum 8b7a9a38c6 The date class is now properly subclassable. (SF bug #720908)
(This is only the tip of the iceberg; the time and datetime classes
need the same treatment.)
2003-04-14 22:01:58 +00:00
Guido van Rossum 4dcdb78c6f Close off the "Verre Carlo hack" as discussed on python-dev. 2003-04-14 21:46:03 +00:00
Guido van Rossum 3a3cca5b82 - list.insert(i, x) now interprets negative i as it would be
interpreted by slicing, so negative values count from the end of the
  list.  This was the only place where such an interpretation was not
  placed on a list index.
2003-04-14 20:58:14 +00:00
Guido van Rossum 41c99e7f96 SF patch #720991 by Gary Herron:
A small fix for bug #545855 and Greg Chapman's
addition of op code SRE_OP_MIN_REPEAT_ONE for
eliminating recursion on simple uses of pattern '*?' on a
long string.
2003-04-14 17:59:34 +00:00
Jason Tishler 21664d854f Patch #709178: remove -static option from cygwinccompiler
After some more reflection (and no negative feedback), I am reverting the
original patch and applying my version, cygwinccompiler.py-shared.diff,
instead.

My reasons are the following:

1. support for older toolchains is retained
2. support for new toolchains (i.e., ld -shared) is added

The goal of my approach is to avoid breaking older toolchains while adding
better support for newer ones.
2003-04-14 12:51:26 +00:00
Neal Norwitz ae323198e5 Get test working if gzip support is not available 2003-04-14 01:18:32 +00:00
Jack Jansen 3576066cad Oops, _propdeclarations and friends are needed: gensuitemodule uses them
to lookup properties declared in base classes. Looking at it I'm not sure
what the official scope if the property codes is, maybe it is only the
(OSA) class in which they are used. But giving them global scope hasn't been
a problem so far.

Regenerated the standard suites, which are now also space-indented.
2003-04-12 22:27:11 +00:00
Barry Warsaw 6008cbd4c2 NullTranslations.__init__(): Back out of setting the default charset
to iso-8859-1.

GNUTranslations._parse(): Back out the addition of a test for
Project-ID-Version in the metadata.  This was deliberately removed in
response to SF patch #700839.

Also, re-organize the code in _parse() so we parse the metadata header
containing the charset parameter before we try to decode any strings
using charset.
2003-04-11 20:26:47 +00:00
Guido van Rossum efbbb1c602 Patch by Chad Netzer (with significant change):
- range() now works even if the arguments are longs with magnitude
  larger than sys.maxint, as long as the total length of the sequence
  fits.  E.g., range(2**100, 2**101, 2**100) is the following list:
  [1267650600228229401496703205376L].  (SF patch #707427.)
2003-04-11 18:43:06 +00:00
Barry Warsaw a1ce93f87c From http://mail.python.org/pipermail/i18n-sig/2003-April/001557.html
- Expose NullTranslations and GNUTranslations to __all__

- Set the default charset to iso-8859-1.  It used to be None, which
would cause problems with .ugettext() if the file had no charset
parameter.  Arguably, the po/mo file would be broken, but I still think
iso-8859-1 is a reasonable default.

- Add a "coerce" default argument to GNUTranslations's constructor.  The
reason for this is that in Zope, we want all msgids and msgstrs to be
Unicode.  For the latter, we could use .ugettext() but there isn't
currently a mechanism for Unicode-ifying msgids.

The plan then is that the charset parameter specifies the encoding for
both the msgids and msgstrs, and both are decoded to Unicode when read.
For example, we might encode po files with utf-8. I think the GNU
gettext tools don't care.

Since this could potentially break code [*] that wants to use the
encoded interface .gettext(), the constructor flag is added, defaulting
to False.  Most code I suspect will want to set this to True and use
.ugettext().

- A few other minor changes from the Zope project, including asserting
that a zero-length msgid must have a Project-ID-Version header for it to
be counted as the metadata record.
2003-04-11 18:36:43 +00:00
Neal Norwitz 7f2588c073 SF patch #706707, time.tzset standards compliance update by Stuart Bishop
Update configure and test to use proper timezone specifications
2003-04-11 15:35:53 +00:00
Fred Drake 126f2b76b9 Avoid creating one of the TestSuite objects. 2003-04-11 15:14:05 +00:00
Neal Norwitz 4ec6824896 Fix test_tarfile failure when gzip is not available
The module would exist, but be empty if already imported.
This change ensures we have gzip available.
2003-04-11 03:05:56 +00:00
Neal Norwitz ffe33b7f24 Attempt to make all the various string *strip methods the same.
* Doc - add doc for when functions were added
 * UserString
 * string object methods
 * string module functions
'chars' is used for the last parameter everywhere.

These changes will be backported, since part of the changes
have already been made, but they were inconsistent.
2003-04-10 22:35:32 +00:00
Skip Montanaro 594adac0bf hoist contents of csv submodule up to the package level 2003-04-10 17:16:15 +00:00
Jason Tishler dcae0dc4ed Patch #718551: cygwinccompiler.get_versions() patch
The cygwinccompiler.get_versions() function only handles versions numbers of
the form "x.y.z".  The attached patch enhances get_versions() to handle "x.y"
too (i.e., the ".z" is optional).

This change causes the unnecessary "--entry _DllMain@12" link option to be
suppressed for recent Cygwin and Mingw toolchains. Additionally, it directs
recent Mingw toolchains to use gcc instead of dllwrap during linking.
2003-04-09 20:13:59 +00:00
Guido van Rossum 11d204ca27 Add test for MessageBeep() 2003-04-09 19:57:06 +00:00