Commit Graph

11354 Commits

Author SHA1 Message Date
Ronald Oussoren 17db495445 Without this patch CMD-W won't close EditorWindows on MacOS X. This solves
part of bug #1517990.
2006-07-23 09:41:09 +00:00
Kurt B. Kaiser c6bacd5606 Tooltips failed on new-syle class __init__ args. Bug 1027566 Loren Guthrie 2006-07-23 04:19:49 +00:00
Greg Ward 7802af426e Be a lot smarter about whether this test passes: instead of assuming
that a 2.93 sec audio file will always take 3.1 sec (as it did on the
hardware I had when I first wrote the test), expect that it will take
2.93 sec +/- 10%, and only fail if it's outside of that range.
Compute the expected
2006-07-23 02:25:53 +00:00
Neal Norwitz cde0fa9c61 Don't fail if the directory already exists 2006-07-22 17:00:57 +00:00
Georg Brandl 4085f1499c Fix check for empty list (vs. None). 2006-07-21 17:36:31 +00:00
Barry Warsaw b110bad2d9 More RFC 2231 improvements for the email 4.0 package. As Mark Sapiro rightly
points out there are really two types of continued headers defined in this
RFC (i.e. "encoded" parameters with the form "name*0*=" and unencoded
parameters with the form "name*0="), but we were were handling them both the
same way and that isn't correct.

This patch should be much more RFC compliant in that only encoded params are
%-decoded and the charset/language information is only extract if there are
any encoded params in the segments.  If there are no encoded params then the
RFC says that there will be no charset/language parts.

Note however that this will change the return value for Message.get_param() in
some cases.  For example, whereas before if you had all unencoded param
continuations you would have still gotten a 3-tuple back from this method
(with charset and language == None), you will now get just a string.  I don't
believe this is a backward incompatible change though because the
documentation for this method already indicates that either return value is
possible and that you must do an isinstance(val, tuple) check to discriminate
between the two.  (Yeah that API kind of sucks but we can't change /that/
without breaking code.)

Test cases, some documentation updates, and a NEWS item accompany this patch.
2006-07-21 14:51:07 +00:00
Vinay Sajip dc57936b63 Addressed SF#1524081 by using a dictionary to map level names to syslog priority names, rather than a string.lower(). 2006-07-20 23:20:12 +00:00
Kurt B. Kaiser 43476e009b Avoid occasional failure to detect closing paren properly.
Patch 1407280 Tal Einat

M    ParenMatch.py
M    NEWS.txt
M    CREDITS.txt
2006-07-20 22:22:52 +00:00
Georg Brandl 13cf38c0cf Guard for _active being None in __del__ method. 2006-07-20 16:28:39 +00:00
Phillip J. Eby 1a2959cfa8 Fix SF#1516184 (again) and add a test to prevent regression.
(There was a problem with empty filenames still causing recursion)
2006-07-20 15:54:16 +00:00
Martin v. Löwis cfe3128cd5 Revert r50706 (Whitespace normalization) and
r50697: Comments and docs cleanups, and some little fixes
per recommendation from Raymond Hettinger.
2006-07-19 17:18:32 +00:00
Tim Peters 112aad3630 SF bug 1524317: configure --without-threads fails to build
Moved the code for _PyThread_CurrentFrames() up, so it's no longer
in a huge "#ifdef WITH_THREAD" block (I didn't realize it /was/ in
one).

Changed test_sys's test_current_frames() so it passes with or without
thread supported compiled in.

Note that test_sys fails when Python is compiled without threads,
but for an unrelated reason (the old test_exit() fails with an
indirect ImportError on the `thread` module).  There are also
other unrelated compilation failures without threads, in extension
modules (like ctypes); at least the core compiles again.

Do we really support --without-threads?  If so, there are several
problems remaining.
2006-07-19 00:03:19 +00:00
Tim Peters 73a9eade1c Whitespace normalization. 2006-07-18 21:55:15 +00:00
Martin v. Löwis 426f4a1c65 Patch #1524429: Use repr instead of backticks again. 2006-07-18 17:46:31 +00:00
Facundo Batista ac4ae4baf7 Comments and docs cleanups, and some little fixes, provided by Santiágo Peresón 2006-07-18 12:16:13 +00:00
Brett Cannon caebe22038 Fix bug #1520914. Starting in 2.4, time.strftime() began to check the bounds
of values in the time tuple passed in.  Unfortunately people came to rely on
undocumented behaviour of setting unneeded values to 0, regardless of if it was
within the valid range.  Now those values force the value internally to the
minimum value when 0 is passed in.
2006-07-18 04:41:36 +00:00
Kurt B. Kaiser 4b7e35b530 Rebinding Tab key was inserting 'tab' instead of 'Tab'. Bug 1179168. 2006-07-18 04:03:16 +00:00
Barry Warsaw 18d2f39af7 decode_rfc2231(): Be more robust against buggy RFC 2231 encodings.
Specifically, instead of raising a ValueError when there is a single tick in
the parameter, simply return that the entire string unquoted, with None for
both the charset and the language.  Also, if there are more than 2 ticks in
the parameter, interpret the first three parts as the standard RFC 2231 parts,
then the rest of the parts as the encoded string.

Test cases added.

Original fewer-than-3-parts fix by Tokio Kikuchi.

Resolves SF bug # 1218081.  I will back port the fix and tests to Python 2.4
(email 3.0) and Python 2.3 (email 2.5).

Also, bump the version number to email 4.0.1, removing the 'alpha' moniker.
2006-07-17 23:07:51 +00:00
Kurt B. Kaiser a2f60a47b5 Patch 1479219 - Tal Einat
1. 'as' highlighted as builtin in comment string on import line
2. Comments such as "#False identity" which start with a keyword immediately
   after the '#' character aren't colored as comments.
3. u or U beginning unicode string not correctly highlighted

Closes bug 1325071
2006-07-17 21:59:27 +00:00
Georg Brandl 7b71bf3872 Remove usage of sets module (patch #1500609). 2006-07-17 13:23:46 +00:00
Neal Norwitz 84be93b2db Bug #1512814, Fix incorrect lineno's when code within a function
had more than 255 blank lines.  Byte codes need to go first, line #s second.
2006-07-16 01:50:38 +00:00
Bob Ippolito 5ea4bf1c58 Patch #1220874: Update the binhex module for Mach-O. 2006-07-15 16:53:15 +00:00
Thomas Heller ce049a0aef Patch #1521817: The index range checking on ctypes arrays containing
exactly one element is enabled again.
2006-07-14 17:51:14 +00:00
Peter Astrand 7d1d43630e Bug #1223937: CalledProcessError.errno -> CalledProcessError.returncode. 2006-07-14 14:04:45 +00:00
Thomas Heller 2bdf29ec28 Fix #1521375. When running with root priviledges, 'gcc -o /dev/null'
did overwrite /dev/null.  Use a temporary file instead of /dev/null.
2006-07-13 17:01:14 +00:00
Thomas Heller 47d7a069d1 Fix #1467450: ctypes now uses RTLD_GLOBAL by default on OSX 10.3 to
load shared libraries.
2006-07-12 08:43:47 +00:00
Neal Norwitz edef2be4af Bug #1520864: unpacking singleton tuples in for loop (for x, in) work again. 2006-07-12 05:26:17 +00:00
Thomas Heller 3b9be2ae6f Change the ctypes version number to 1.0.0. 2006-07-11 18:40:50 +00:00
Thomas Heller a42a662fec When a foreign function is retrived by calling __getitem__ on a ctypes
library instance, do not set it as attribute.
2006-07-11 18:28:35 +00:00
Tim Peters 12c00f79bc Whitespace normalization. 2006-07-11 02:17:48 +00:00
Martin v. Löwis 06c68b800c Patch #1519566: Remove unused _tofill member.
Make begin_fill idempotent.
Update demo2 to demonstrate filling of concave shapes.
2006-07-10 22:11:28 +00:00
Tim Peters 722b88308d Whitespace normalization. 2006-07-10 21:11:49 +00:00
Tim Peters 32a8361f2d After approval from Anthony, merge the tim-current_frames
branch into the trunk.  This adds a new sys._current_frames()
function, which returns a dict mapping thread id to topmost
thread stack frame.
2006-07-10 21:08:24 +00:00
Peter Astrand 2b221ed657 Make it possible to run test_subprocess.py with Python 2.2, which lacks test_support.reap_children(). 2006-07-10 20:39:49 +00:00
Phillip J. Eby 137ff79329 Fix SF#1457312: bad socket error handling in distutils "upload" command. 2006-07-10 19:18:35 +00:00
Phillip J. Eby 5d86bdb3ae Fix SF#1516184 and add a test to prevent regression. 2006-07-10 19:03:29 +00:00
Thomas Heller 7644262aa5 Assigning None to pointer type structure fields possible overwrote
wrong fields.
2006-07-10 11:11:10 +00:00
Thomas Heller dda068dee1 Fix bug #1518190: accept any integer or long value in the
ctypes.c_void_p constructor.
2006-07-10 09:10:28 +00:00
Anthony Baxter 70e8e87750 preparing for 2.5b2 2006-07-10 07:41:04 +00:00
Martin v. Löwis d24d5b3f81 Change error message to indicate that VS2003 is necessary to build extension modules, not the .NET SDK. 2006-07-10 07:26:41 +00:00
Martin v. Löwis 8d65681e94 Introduce DISTUTILS_USE_SDK as a flag to determine whether the
SDK environment should be used. Fixes #1508010.
2006-07-10 07:23:48 +00:00
Neal Norwitz 4a5fbda66d Part of SF patch #1484695. This removes dead code. The chksum was
already verified in .frombuf() on the lines above.  If there was
a problem an exception is raised, so there was no way this condition
could have been true.
2006-07-10 00:23:17 +00:00
Neal Norwitz 8440483fea Fix doco. Backport candidate. 2006-07-10 00:05:34 +00:00
Neal Norwitz ed65755608 Bug #1512814, Fix incorrect lineno's when code at module scope
started after line 256.
2006-07-10 00:04:44 +00:00
Neal Norwitz 28746aba9b On 64 bit systems, int literals that use less than 64 bits are now ints
rather than longs.  This also fixes the test for eval(-sys.maxint - 1).
2006-07-09 22:14:42 +00:00
Neil Schemenauer 6ec6ab02c3 Fix SF bug 1441486: bad unary minus folding in compiler. 2006-07-09 21:19:29 +00:00
Neil Schemenauer 0e07b60a4e Fix AST compiler bug #1501934: incorrect LOAD/STORE_GLOBAL generation. 2006-07-09 16:16:34 +00:00
Tim Peters 63597f129d Whitespace normalization. 2006-07-08 19:55:05 +00:00
Georg Brandl 9575fb241e Add an additional test for bug #1519018. 2006-07-08 12:15:27 +00:00
Neal Norwitz fb48afa708 Fix SF bug #1519018: 'as' is now validated properly in import statements 2006-07-08 05:31:37 +00:00
Neal Norwitz 84bc19a453 Restore rev 47014:
The hppa ubuntu box sometimes hangs forever in these tests.  My guess
is that the wait is failing for some reason.  Use WNOHANG, so we won't
wait until the buildbot kills the test suite.

I haven't been able to reproduce the failure, so I'm not sure if
this will help or not.  Hopefully, this change will cause the test
to fail, rather than hang.  That will be better since we will get
the rest of the test results.  It may also help us debug the real problem.

*** The reason this originally failed was because there were many
zombie children outstanding before rev 47158 cleaned them up.
There are still hangs in test_subprocess that need to be addressed,
but that will take more work.  This should close some holes.
2006-07-07 06:03:15 +00:00
Martin v. Löwis 388a8c26fa Properly generate logical file ids. Fixes #1515998.
Also correct typo in Control.mapping.
2006-07-06 19:28:03 +00:00
Hye-Shik Chang b9aa7ea660 Test using all CJK encodings for the testcases which don't require
specific encodings.
2006-07-06 15:39:24 +00:00
Hye-Shik Chang 84392bee48 Add a testcase for r47086 which fixed a bug in codec_getstreamcodec(). 2006-07-06 15:21:52 +00:00
Nick Coghlan b6983bbe15 Ignore ImportWarning by default 2006-07-06 13:35:27 +00:00
Nick Coghlan 56829d5b4a Revert the __module_name__ changes made in rev 47142. We'll revisit this in Python 2.6 2006-07-06 12:53:04 +00:00
Fredrik Lundh bf84e54078 added XMLParser alias for cElementTree compatibility 2006-07-06 12:29:24 +00:00
Thomas Heller 5becdbee96 Patch #1517790: It is now possible to use custom objects in the ctypes
foreign function argtypes sequence as long as they provide a
from_param method, no longer is it required that the object is a
ctypes type.
2006-07-06 08:48:35 +00:00
Thomas Heller 2329b64c20 The test that calls a function with invalid arguments and catches the
resulting Windows access violation will not be run by default.
2006-07-06 08:28:14 +00:00
Armin Rigo 5953baca0a A couple of examples about how to attack the fact that _PyType_Lookup()
returns a borrowed ref.  Many of the calls are open to attack.
2006-07-06 07:58:18 +00:00
Thomas Heller 43d9a58dfd Revert the change done in svn revision 47206:
Add a new function uses_seh() to the _ctypes extension module.  This
will return True if Windows Structured Exception handling (SEH) is
used when calling functions, False otherwise.
2006-07-06 07:50:18 +00:00
Thomas Wouters add191118f Fix bug in passing tuples to string.Template. All other values (with working
str() or repr()) would work, just not multi-value tuples. Probably not a
backport candidate, since it changes the behaviour of passing a
single-element tuple:

>>> string.Template("$foo").substitute(dict(foo=(1,)))

'(1,)'

versus

'1'
2006-07-05 11:03:49 +00:00
Martin v. Löwis d5cfa5491a Put method-wrappers into trashcan. Fixes #927248. 2006-07-03 13:47:40 +00:00
Martin v. Löwis ede77f5373 Patch #825417: Fix timeout processing in expect,
read_until. Will backport to 2.4.
2006-07-03 13:01:35 +00:00
Martin v. Löwis 4548239e2b Bug #1267547: Put proper recursive setup.py call into the
spec file generated by bdist_rpm.
2006-07-03 12:28:58 +00:00
Martin v. Löwis fcfff0a7fa Bug #1417699: Reject locale-specific decimal point in float()
and atof().
2006-07-03 12:19:50 +00:00
Martin v. Löwis 2b88f63a3c Bug #1514693: Update turtle's heading when switching between
degrees and radians.
2006-07-03 10:19:49 +00:00
Martin v. Löwis 4c4300de4e Reimplement turtle.circle using a polyline, to allow correct
filling of arcs. Also fixes #1514693.
2006-07-03 10:05:30 +00:00
Martin v. Löwis bd39c03c9f Only setup canvas when it is first created.
Fixes #1514703
2006-07-03 09:44:00 +00:00
Tim Peters 16a3932774 Whitespace normalization. 2006-07-03 08:23:19 +00:00
Thomas Heller f780be4239 Add a new function uses_seh() to the _ctypes extension module. This
will return True if Windows Structured Exception handling (SEH) is
used when calling functions, False otherwise.

Currently, only MSVC supports SEH.

Fix the test so that it doesn't crash when run with MingW compiled
_ctypes.  Note that two tests are still failing when mingw is used, I
suspect structure layout differences and function calling conventions
between MSVC and MingW.
2006-07-03 08:08:14 +00:00
Thomas Heller b3c0942356 Don't run the doctests with Python 2.3 because it doesn't have the ELLIPSIS flag. 2006-07-03 07:59:50 +00:00
Martin v. Löwis ee1e06d497 Correct arithmetic in access on Win32. Fixes #1513646. 2006-07-02 18:44:00 +00:00
Gerhard Häring 762fbd3485 The sqlite3 module did cut off data from the SQLite database at the first null
character before sending it to a custom converter. This has been fixed now.
2006-07-02 17:48:30 +00:00
Fred Drake 6ffe499397 SF bug #1296433 (Expat bug #1515266): Unchecked calls to character data
handler would cause a segfault.  This merges in Expat's lib/xmlparse.c
revisions 1.154 and 1.155, which fix this and a closely related problem
(the later does not affect Python).

Moved the crasher test to the tests for xml.parsers.expat.
2006-07-01 16:28:20 +00:00
Martin v. Löwis 7596e8342e Release all forwarded functions in .close. Fixes #1513223. 2006-07-01 15:33:37 +00:00
Vinay Sajip a09803329c Added duplicate call to fileConfig() to ensure that it cleans up after itself correctly. 2006-07-01 10:47:20 +00:00
Tim Peters 38ff36c4cc Whitespace normalization. 2006-06-30 06:18:39 +00:00
Vinay Sajip cea4bf092d Fixed bug in fileConfig() which failed to clear logging._handlerList 2006-06-30 00:13:08 +00:00
Neal Norwitz 877fdb01fe This should fix the buildbot failure on s/390 which can't connect to gmail.org.
It makes the error message consistent and always sends to stderr.

It would be much better for all the networking tests to hit only python.org.
2006-06-29 05:48:14 +00:00
Neal Norwitz b15ac3169d Add new utility function, reap_children(), to test_support. This should
be called at the end of each test that spawns children (perhaps it
should be called from regrtest instead?).  This will hopefully prevent
some of the unexplained failures in the buildbots (hppa and alpha)
during tests that spawn children.  The problems were not reproducible.
There were many zombies that remained at the end of several tests.
In the worst case, this shouldn't cause any more problems,
though it may not help either.  Time will tell.
2006-06-29 04:10:08 +00:00
Fred Drake a136210a9f SF bug #1504333: sgmlib should allow angle brackets in quoted values
(modified patch by Sam Ruby; changed to use separate REs for start and end
 tags to reduce matching cost for end tags; extended tests; updated to avoid
 breaking previous changes to support IPv6 addresses in unquoted attribute
 values)
2006-06-29 00:51:53 +00:00
Georg Brandl 1be63af41d Fix end_fill(). 2006-06-28 20:23:25 +00:00
Armin Rigo d77ef8fa51 A couple of crashers of the "won't fix" kind. 2006-06-28 10:49:51 +00:00
Nick Coghlan 999a336ad7 Make full module name available as __module_name__ even when __name__ is set to something else (like '__main__') 2006-06-28 10:41:47 +00:00
Neal Norwitz 7983c7298d According to the man pages on Gentoo Linux and Tru64, EACCES or EAGAIN
can be returned if fcntl (lockf) fails.  This fixes the test failure
on Tru64 by checking for either error rather than just EAGAIN.
2006-06-28 05:03:22 +00:00
Tim Peters 3249d00f4d Whitespace normalization. 2006-06-27 11:52:49 +00:00
Ronald Oussoren 7b9053a274 MacOSX: fix rather dumb buglet that made it impossible to create extensions on
OSX 10.3 when using a binary distribution build on 10.4.
2006-06-27 10:08:25 +00:00
Vinay Sajip 6dd59f1632 Removed buggy exception handling in doRollover of rotating file handlers. Exceptions now propagate to caller. 2006-06-27 07:34:37 +00:00
Andrew M. Kuchling 15486f78f0 Attempt to fix build failure on OS X and Debian alpha; the symptom is
consistent with os.wait() returning immediately because some other
subprocess had previously exited; the test suite then immediately
tries to lock the mailbox and gets an error saying it's already
locked.

To fix this, do a waitpid() so the test suite only continues once
the intended child process has exited.
2006-06-26 17:00:35 +00:00
Andrew M. Kuchling ec3c368195 Windows doesn't have os.fork(). I'll just disable this test for now 2006-06-26 14:33:24 +00:00
Andrew M. Kuchling 9afbacef27 Add a test for a conflicting lock.
On slow machines, maybe the time intervals (2 sec, 0.5 sec) will be too tight.
I'll see how the buildbots like it.
2006-06-26 13:23:10 +00:00
Andrew M. Kuchling 557325930c [Bug #1512163] Use one set of locking methods, lockf();
remove the flock() calls.

On FreeBSD, the two methods lockf() and flock() end up using the same
mechanism and the second one fails.  A Linux man page claims that the
two methods are orthogonal (so locks acquired one way don't interact
with locks acquired the other way) but that clearly must be false.
2006-06-26 13:12:16 +00:00
Andrew M. Kuchling a7ee9eb3d9 [Bug #1512163] Fix typo.
This change will probably break tests on FreeBSD buildbots, but I'll check in
a fix for that next.
2006-06-26 13:08:24 +00:00
Ronald Oussoren 53f1a943ec Workaround for bug #1512124
Without this patch IDLE will get unresponsive when you open the debugger
window on OSX. This is both using the system Tcl/Tk on Tiger as the latest
universal download from tk-components.sf.net.
2006-06-25 20:44:16 +00:00
Fred Drake 2f99da636b - SF bug #853506: IP6 address parsing in sgmllib
('[' and ']' were not accepted in unquoted attribute values)

- cleaned up tests of character and entity reference decoding so the
  tests cover the documented relationships among handle_charref,
  handle_entityref, convert_charref, convert_codepoint, and
  convert_entityref, without bringing up Unicode issues that sgmllib
  cannot be involved in
2006-06-23 06:03:45 +00:00
Peter Astrand ff355f1ada Applied patch #1506758: Prevent MemoryErrors with large MAXFD. 2006-06-22 20:21:26 +00:00
Peter Astrand d6b2430b7a Make it possible to run test_subprocess.py on Python 2.2, which lacks test_support.is_resource_enabled. 2006-06-22 20:06:46 +00:00
Brett Cannon 53ab5b761d 'warning's was improperly requiring that a command-line Warning category be
both a subclass of Warning and a subclass of types.ClassType.  The latter is no
longer true thanks to new-style exceptions.

Closes bug #1510580.  Thanks to AMK for the test.
2006-06-22 16:49:14 +00:00
Georg Brandl f57c54db03 Test for correct compilation of try-except-finally stmt.
Test for correct lineno on list, tuple, dict literals.
2006-06-22 14:46:46 +00:00