Commit Graph

3749 Commits

Author SHA1 Message Date
Marc-André Lemburg ad7c98e264 This patch adds a new builtin unistr() which behaves like str()
except that it always returns Unicode objects.

A new C API PyObject_Unicode() is also provided.

This closes patch #101664.

Written by Marc-Andre Lemburg. Copyright assigned to Guido van Rossum.
2001-01-17 17:09:53 +00:00
Andrew M. Kuchling c14fa303e1 Patch #103279: sysconfig.py always looks for versions of files in
sys.prefix + 'config/Makefile'. When building Python for the first
time, these files aren't there, so the files from the build tree have
to be used instead; this file adds an entry point for specifying that
the build tree files should be used.  (Perhaps 'set_python_build' should
should be preceded with an underscore?)
2001-01-17 15:16:52 +00:00
Guido van Rossum 846d6dbbe6 Fix a bizarre typo in the helper class ComparableException: the
__getattr__() method, which clearly (like the other methods) was
intended to pass the __getattr__() call on to the self.err object,
mistakenly returned getattr(self, self.err) rather than
getattr(self.err, attr).  Since self.err is not a string, this always
raises a TypeError.  Apparently that doesn't bother for the one
attribute for which __getattr__() is actually called ('__coerce__'),
but it broke the rich comparisons stuff that I'm trying to get into
shape, so I'm fixing this now.  (I could also simply remove the
__getattr__() method, but fixing it seems more in the spirit of what
the ComparableException class is trying to do.)
2001-01-17 15:08:37 +00:00
Marc-André Lemburg d2ebe8775e Changed name of codec to full path name. This allows importing
the test_charmapcodec test via the test package.
2001-01-17 15:07:00 +00:00
Tim Peters 70c4378dbc Whitespace normalization. 2001-01-17 08:48:39 +00:00
Guido van Rossum e69d3d7587 Use __name__ instead of "test_regex" as the module name in the
warnings.filterwarnings() call.  This suppresses the warning when the
module is imported with its full name (test.test_regex) too.
2001-01-17 03:12:01 +00:00
Andrew M. Kuchling b11bd03626 Fix bugs with integer-valued variables when parsing Makefiles. Values
for done[n] can be integers as well as strings, but the code
concatenates them with strings (fixed by adding a str()) and calls
string.strip() on them (fixed by rearranging the logic)

(Presumably this wasn't noticed previously because parse_makefile()
was only called on Modules/Makefile, which contains no integer-valued
variables.)
2001-01-16 16:33:28 +00:00
Andrew M. Kuchling 9710297e36 Modified version of a patch from Jeremy Kloth, to make .get_outputs()
produce a list of unique filenames:
    "While attempting to build an RPM using distutils on Python 2.0,
    rpm complained about duplicate files.  The following patch fixed
    that problem.
2001-01-16 16:16:03 +00:00
Eric S. Raymond bddbaf7023 Make pop_source and push_source available, as documented. 2001-01-16 15:19:13 +00:00
Marc-André Lemburg 3a645e4dd4 Added checks to prevent PyUnicode_Count() from dumping core
in case the parameters are out of bounds and fixes error handling
for .count(), .startswith() and .endswith() for the case of
mixed string/Unicode objects.

This patch adds Python style index semantics to PyUnicode_Count()
indices (including the special handling of negative indices).

The patch is an extended version of patch #103249 submitted
by Michael Hudson (mwh) on SF. It also includes new test cases.
2001-01-16 11:54:12 +00:00
Fredrik Lundh 1c5aa6901f bumped SRE version number to 2.1. cleaned up and added 1.5.2
compatibility patches.
2001-01-16 07:37:30 +00:00
Tim Peters dfb673b457 Whitespace normalization. 2001-01-16 07:12:46 +00:00
Tim Peters 8a7d2d5cb1 doctest-- The Little Module That Could --finally makes it to the Big Show <wink>. 2001-01-16 07:10:57 +00:00
Thomas Wouters 47adcbafc0 Fix for SF bug #123625: some newsservers need 'authinfo' *before* 'mode
readers', others *after*. (Netscape Collabra for the first category,
INN-which-forks-nnrpd for the second.)
2001-01-16 06:35:14 +00:00
Andrew M. Kuchling bd2983caf3 Add strip_dir argument to the single call to .object_filenames(), to
prevent creating files such as build/lib.whatever/Modules/foo.o
    when given a source filename such as Modules/foo.c.
2001-01-16 03:10:43 +00:00
Tim Peters b8c941771a Variant of Skip's patch 103246 (Remove unneeded string exception compat from Queue). 2001-01-15 22:53:46 +00:00
Ka-Ping Yee 10bc59320c Ugh. Sorry. Checked in the wrong file. Please ignore revision 1.3;
it anticipates another patch i was about to propose.
2001-01-15 22:27:06 +00:00
Ka-Ping Yee 27ac0d1ff5 better format names and error messages 2001-01-15 22:21:39 +00:00
Ka-Ping Yee 2057970601 This patch makes sure that the function name always appears in the error
message, and tries to make the messages more consistent and helpful when
the wrong number of arguments or duplicate keyword arguments are supplied.
Comes with more tests for test_extcall.py and and an update to an error
message in test/output/test_pyexpat.
2001-01-15 22:14:16 +00:00
Ka-Ping Yee 1ff08b1243 Add tokenizer support and tests for u'', U"", uR'', Ur"", etc. 2001-01-15 22:04:30 +00:00
Barry Warsaw 534c60f9ab Add a test case suggested by Guido, where a method is created with the
new module.
2001-01-15 21:00:02 +00:00
Barry Warsaw 4a420a0a75 Committing PEP 232, function attribute feature, approved by Guido.
Closes SF patch #103123.

Regression test for function attributes, with output file.
2001-01-15 20:30:15 +00:00
Guido van Rossum afc4f0413a - Make sure to quote the username and password (SF patch #103236 by
dogfort).

- Don't drop the data argument when calling open_https() from the
  authentication error handler.
2001-01-15 18:31:13 +00:00
Fredrik Lundh 2e24044f9d from the really-stupid-bug department: uppercase literals should match
uppercase strings also when the IGNORECASE flag is set (bug #128899)

(also added test cases for recently fixed bugs to the regression suite
-- or in other words, check in re_tests.py too...)
2001-01-15 18:28:14 +00:00
Guido van Rossum 48450cf0a9 mwh@sourceforge found that UnicodeError can be raised by compiling.
Its base class ValueError can be raised too, so catch that.
2001-01-15 18:13:35 +00:00
Guido van Rossum e6ccf3ab96 Default to passive mode. See SF bug #126851.
This is slightly controversial, but after reading the argumentation in
the bug tracker for and against, I believe this is the right solution.
Let me know if it breaks for you, and how.
2001-01-15 16:32:49 +00:00
Andrew M. Kuchling 3f819ec2ed Fix from Jack Jansen for the Mac and the Metrowerks compiler, posted
to the Distutils-SIG and archived at
http://mail.python.org/pipermail/distutils-sig/2000-November/001755.html
2001-01-15 16:09:35 +00:00
Guido van Rossum fd97a919ff Revert a change I accidentally checked in together with Ping's
"smallest patch ever".
2001-01-15 14:34:20 +00:00
Fredrik Lundh b35ffc0417 added "magic" number to the _sre module, to avoid weird errors caused
by compiler/engine mismatches
2001-01-15 12:46:09 +00:00
Tim Peters e119006e7d Whitespace normalization. Top level of Lib now fixed-point for reindent.py! 2001-01-15 03:34:38 +00:00
Tim Peters b90f89a496 Whitespace normalization. 2001-01-15 03:26:36 +00:00
Tim Peters 495ad3c8cc Whitespace normalization. 2001-01-15 01:36:40 +00:00
Tim Peters 0c9886d589 Whitespace normalization. 2001-01-15 01:18:21 +00:00
Tim Peters 2344fae6d0 Whitespace normalization. 2001-01-15 00:50:52 +00:00
Fredrik Lundh fa25a7d51f -- don't use recursion for unbounded non-greedy repeat
(bugs #115903, #115696)

This is based on a patch by Darrel Gallion.  I'm not 100%
sure about this fix, but I haven't managed to come up with
any test case it cannot handle...
2001-01-14 23:55:55 +00:00
Tim Peters 07e99cb774 Whitespace normalization. 2001-01-14 23:47:14 +00:00
Tim Peters 88869f9787 Whitespace normalization. 2001-01-14 23:36:06 +00:00
Guido van Rossum 752d3f557e - Don't hardcode Unix filename syntax when opening ~/.pdbrc.
- Conform to standard coding style in a few more places.
2001-01-14 23:29:48 +00:00
Guido van Rossum 077153e973 - Use mimetypes.types_map to initialize extensions_map.
- Change the default file type to application/octet-stream.
- Add support to recognize .py, .c, .h files as text/plain (this is
  what I use most :-).
2001-01-14 23:21:25 +00:00
Guido van Rossum 2d3eb133b7 SF Patch #103211.
Ping apparently doesn't check in Accepted patches, so I'm doing this
for him.

According to Ping: The name of the controller class should be
"Konqueror", not "Konquerer". (See the website
http://www.konqueror.org/.)
2001-01-14 23:09:35 +00:00
Guido van Rossum c5f15b088f Make the copyright message the same as for the "real" interpreter. 2001-01-14 23:04:22 +00:00
Tim Peters 11cf605f84 Whitespace normalization. 2001-01-14 21:54:20 +00:00
Guido van Rossum f6922aa435 SF Patch #103232 by dougfort: Preserve Nonstandard Port Number in Host
Header

Dougfort's comments: httplib does not include ':port ' in the HTTP 1.1
'Host:' header.  This causes problems if the server is not listening
on Port 80.  The test case I use is the login to /manage under Zope,
with Zope listening on port 8080. Zope returns a <frameset> with the
<frame> source URLs lacking the :8080.
2001-01-14 21:03:01 +00:00
Fredrik Lundh 470ea5ab94 SRE: stricter pattern syntax checking (covers parts of bug #115900) 2001-01-14 21:00:44 +00:00
Tim Peters 146965abf2 Whitespace standardization. 2001-01-14 18:09:23 +00:00
Fredrik Lundh 538f05c94d reapplied Fred's "recommended style" patch... 2001-01-14 15:15:37 +00:00
Fredrik Lundh 770617b23e SRE fixes for 2.1 alpha:
-- added some more docstrings
-- fixed typo in scanner class (#125531)
-- the multiline flag (?m) should't affect the \Z operator (#127259)
-- fixed non-greedy backtracking bug (#123769, #127259)
-- added sre.DEBUG flag (currently dumps the parsed pattern structure)
-- fixed a couple of glitches in groupdict (the #126587 memory leak
   had already been fixed by AMK)
2001-01-14 15:06:11 +00:00
Guido van Rossum 9464a7de60 - Added keyword argument 'append' to filterwarnings(); if true, this
appends to list of filters instead of inserting at the front.  This
  is useful to add a filter with a lower priority than -W options.

- Cosmetic improvements to a docstring and an error message.
2001-01-14 14:08:40 +00:00
Tim Peters 8373218e28 Reverting a dumb experimental version I checked in by mistake. 2001-01-14 05:12:40 +00:00
Tim Peters 2caf8df868 SF bug 128713: type(mmap_object) blew up on Linux. 2001-01-14 05:05:51 +00:00