]> granicus.if.org Git - python/log
python
17 years agoThe Identifiers and keywords syntax diagram did not appear correctly in the
Mark Summerfield [Tue, 20 Nov 2007 13:22:19 +0000 (13:22 +0000)]
The Identifiers and keywords syntax diagram did not appear correctly in the
HTML output. I've now fixed this as best I can (but could do with
improvement).

Note that there are two terms used, "Other_ID_Start" and
"Other_ID_Continue" that are not explained; I've added an extra see
reference to PEP 3131 though.

17 years agoAdded configurations and files for profile guided optimization (PGO).
Christian Heimes [Tue, 20 Nov 2007 09:34:16 +0000 (09:34 +0000)]
Added configurations and files for profile guided optimization (PGO).

17 years agoThe patch from weck does a better job than my original idea. Thanks!
Christian Heimes [Tue, 20 Nov 2007 06:51:17 +0000 (06:51 +0000)]
The patch from weck does a better job than my original idea. Thanks!

17 years agoReport #1473 Drop _EXPORTS macros in PCbuild9
Christian Heimes [Tue, 20 Nov 2007 05:57:30 +0000 (05:57 +0000)]
Report #1473 Drop _EXPORTS macros in PCbuild9
I've removed a bunch of obsolete defines. I've also taken the opportunity to fix the pre-link event of sqlite3 and some optimization flags.

17 years agoAnother fix for test_shutil. Martin pointed out that it breaks some build bots
Christian Heimes [Tue, 20 Nov 2007 03:20:04 +0000 (03:20 +0000)]
Another fix for test_shutil. Martin pointed out that it breaks some build bots

17 years agoos.system: on Windows, avoid encoding the command and use the "wide" function: _wsystem
Amaury Forgeot d'Arc [Tue, 20 Nov 2007 01:52:14 +0000 (01:52 +0000)]
os.system: on Windows, avoid encoding the command and use the "wide" function: _wsystem

17 years agoFixed bug #1470
Christian Heimes [Tue, 20 Nov 2007 01:45:17 +0000 (01:45 +0000)]
Fixed bug #1470
py3k unit tests are removing %TEMP% dir on Windows
os.removedirs removes all parent directories until it hits a non empty directory. In my case my %TEMP% directory was clean and empty.

17 years agoCorrect test_cvs on Windows, as suggested by Raghuram Devarakonda
Amaury Forgeot d'Arc [Mon, 19 Nov 2007 21:20:21 +0000 (21:20 +0000)]
Correct test_cvs on Windows, as suggested by Raghuram Devarakonda
in issue1395. All other places in this file already use newline=''...

Also check that csv.reader is given an iterable returning strings.

17 years agoOops, I missed this one again (test_univnewlines fails):
Amaury Forgeot d'Arc [Mon, 19 Nov 2007 21:14:47 +0000 (21:14 +0000)]
Oops, I missed this one again (test_univnewlines fails):

Some incremental decoders return multiple characters, even when fed with
only one more byte. In this case the tell() state must subtract the
number of extra characters.

17 years agoIssue1395: Universal mode used to duplicate newlines when using read(1).
Amaury Forgeot d'Arc [Mon, 19 Nov 2007 20:34:10 +0000 (20:34 +0000)]
Issue1395: Universal mode used to duplicate newlines when using read(1).

"Universal newline" is now an incremental decoder wrapping the initial one,
with its own additional buffer (if '\r' is seen at the end of the input).

A decoder allows the tell() funtion to record the state of the translation.
This also simplifies the readline() process.

Now test_netrc passes on Windows, as well as many new tests in test_io.py

17 years agoMake test_cmd_line_scripts pass by using a unicode string instead of
Guido van Rossum [Mon, 19 Nov 2007 18:36:41 +0000 (18:36 +0000)]
Make test_cmd_line_scripts pass by using a unicode string instead of
a bytes string to hold argv0 in RunMainFromImporter().
Also changed the code lay-out a bit to be more readable (for me :-),
and print any unexpected errors rather than suppressing them.

17 years agoFixed build order of the _ssl project. The openssl project needs to come first becaus...
Christian Heimes [Mon, 19 Nov 2007 18:35:20 +0000 (18:35 +0000)]
Fixed build order of the _ssl project. The openssl project needs to come first because the makefile puts the header files in the right place.
Added some optimization flags to the Release builds of pythoncore and the executables.

17 years agoMerged revisions 59041-59055 via svnmerge from
Guido van Rossum [Mon, 19 Nov 2007 18:03:44 +0000 (18:03 +0000)]
Merged revisions 59041-59055 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r59044 | neal.norwitz | 2007-11-18 17:46:20 -0800 (Sun, 18 Nov 2007) | 1 line

  Use a slightly more recent version than 1.5.2b2.
........
  r59047 | walter.doerwald | 2007-11-19 04:14:05 -0800 (Mon, 19 Nov 2007) | 2 lines

  Fix typo in comment.
........
  r59049 | walter.doerwald | 2007-11-19 04:41:10 -0800 (Mon, 19 Nov 2007) | 4 lines

  Fix for #1444: utf_8_sig.StreamReader was (indirectly through decode())
  calling codecs.utf_8_decode() with final==True, which falled with incomplete
  byte sequences. Fix and test by James G. Sack.
........
  r59051 | nick.coghlan | 2007-11-19 05:56:27 -0800 (Mon, 19 Nov 2007) | 1 line

  Enable some test_cmd_line_script debugging output to investigate failure on Mac OSX buildbot
........
  r59053 | facundo.batista | 2007-11-19 08:30:24 -0800 (Mon, 19 Nov 2007) | 3 lines

  Fixed detail in add_type() explanation (issue 1463).
........
  r59054 | guido.van.rossum | 2007-11-19 09:35:24 -0800 (Mon, 19 Nov 2007) | 2 lines

  Make this work stand-alone, too.
........
  r59055 | guido.van.rossum | 2007-11-19 09:50:22 -0800 (Mon, 19 Nov 2007) | 3 lines

  Fix the OSX failures in this test -- they were due to /tmp being a symlink
  to /private/tmp.  Adding a call to os.path.realpath() to temp_dir() fixed it.
........

17 years agoTweak the imports so this script will run stand-alone.
Guido van Rossum [Mon, 19 Nov 2007 15:56:44 +0000 (15:56 +0000)]
Tweak the imports so this script will run stand-alone.
(No, this doesn't fix the bugs on OSX.)

17 years agoI've spend some time to automate more steps of the build process. Now bzip2, bsddb...
Christian Heimes [Mon, 19 Nov 2007 08:36:32 +0000 (08:36 +0000)]
I've spend some time to automate more steps of the build process. Now bzip2, bsddb, sqlite and openssl are automatically build by prelink steps.
I had to use some tricks to build openssl for 32 and 64bit CPUs in two separate build dirs.

17 years agoRevert modifications to extract_msvcr71 in 59040,
Martin v. Löwis [Mon, 19 Nov 2007 06:46:55 +0000 (06:46 +0000)]
Revert modifications to extract_msvcr71 in 59040,
as they didn't actually work.

17 years agoRemoved ReleaseAMD64 and replaced it with platform x64. The x64 builds fine except...
Christian Heimes [Mon, 19 Nov 2007 01:23:57 +0000 (01:23 +0000)]
Removed ReleaseAMD64 and replaced it with platform x64. The x64 builds fine except of the modules that depend on external libraries like tkinter and openssl. And I can't test the build on my 32bit CPU.

17 years agoI'm using the xxmodule and xxsubtype to test the msvccompiler on Windows. I'm having...
Christian Heimes [Sun, 18 Nov 2007 21:30:36 +0000 (21:30 +0000)]
I'm using the xxmodule and xxsubtype to test the msvccompiler on Windows. I'm having trouble to compile the module with VS 2008 cl.exe because "initializer is not a constant".

17 years agoMerged revisions 59005-59040 via svnmerge from
Christian Heimes [Sun, 18 Nov 2007 19:35:23 +0000 (19:35 +0000)]
Merged revisions 59005-59040 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

I've tried to fix test_cmd_line_script but I wasn't able to get all tests
right. Nick, can you please have a look?

........
  r59020 | facundo.batista | 2007-11-16 19:04:14 +0100 (Fri, 16 Nov 2007) | 12 lines

  Now in find, rfind, index, and rindex, you can use None as defaults,
  as usual with slicing (both with str and unicode strings).  This
  fixes issue 1259.

  For str only the stringobject.c file was modified.  But for unicode,
  I needed to repeat in the four functions a lot of code, so created
  a new function that does part of the job for them (and placed it in
  find.h, following a suggestion of Barry).

  Also added tests for this behaviour.
........
  r59021 | facundo.batista | 2007-11-16 19:41:24 +0100 (Fri, 16 Nov 2007) | 4 lines

  Fix for stupid error (I need to remember to do a full 'make clean + make'
  cycle before the tests...). Sorry.
........
  r59022 | facundo.batista | 2007-11-16 20:16:15 +0100 (Fri, 16 Nov 2007) | 3 lines

  Made _ParseTupleFinds only defined to unicodeobject.c
........
  r59024 | raymond.hettinger | 2007-11-17 02:51:22 +0100 (Sat, 17 Nov 2007) | 1 line

  Fix signature in example
........
  r59033 | brett.cannon | 2007-11-17 08:07:29 +0100 (Sat, 17 Nov 2007) | 5 lines

  Remove a confusing sentence about pth files and which directories are searched
  for them.

  Closes issue #1431.  Thanks Giambattista Bloisi for the help.
........
  r59039 | nick.coghlan | 2007-11-18 12:56:28 +0100 (Sun, 18 Nov 2007) | 1 line

  Patch #1739468: Directories and zipfiles containing __main__.py are now executable
........

17 years agoUpdates to the msi builder and PCbuild9 directory. msi.py can now create installers...
Christian Heimes [Sun, 18 Nov 2007 18:18:41 +0000 (18:18 +0000)]
Updates to the msi builder and PCbuild9 directory. msi.py can now create installers from the PCbuild9 directory with MSVCR90.dll. PCbuild and MSVCR71.dll are still the default.

17 years agoremove now-obsolete test_socket_ssl
Bill Janssen [Sat, 17 Nov 2007 21:51:51 +0000 (21:51 +0000)]
remove now-obsolete test_socket_ssl

17 years agoFixed some build issues and updated docs.
Christian Heimes [Sat, 17 Nov 2007 19:08:41 +0000 (19:08 +0000)]
Fixed some build issues and updated docs.

17 years agoThe _winreg module returns bytes which must be decoded to unicode, not encoded.
Christian Heimes [Sat, 17 Nov 2007 11:46:54 +0000 (11:46 +0000)]
The _winreg module returns bytes which must be decoded to unicode, not encoded.

17 years agoInitial import of new PCbuild9 for VS 2008. It partly based on PCbuild and partly...
Christian Heimes [Sat, 17 Nov 2007 08:15:27 +0000 (08:15 +0000)]
Initial import of new PCbuild9 for VS 2008. It partly based on PCbuild and partly hand crafted with some idea from PCbuild8. I've recreated all the extension module projects.

The new directory needs some more love and care but it works. I'm not able to test the AMD64 build.

The new tree is heavily using the *.vcprops property sheets. Please set any global settings in the property sheets.

17 years agoUse 'del' instead of rmpyc.py to remove the pyc and pyo files.
Thomas Heller [Fri, 16 Nov 2007 07:00:30 +0000 (07:00 +0000)]
Use 'del' instead of rmpyc.py to remove the pyc and pyo files.

17 years agoFixed an error in my last commit. The dll files are in the bin directory, not in...
Christian Heimes [Fri, 16 Nov 2007 02:35:02 +0000 (02:35 +0000)]
Fixed an error in my last commit. The dll files are in the bin directory, not in the lib directory.

17 years agoI finally figured out why _tkinter and _bsddb didn't compile with PCbuild8.
Christian Heimes [Fri, 16 Nov 2007 02:14:19 +0000 (02:14 +0000)]
I finally figured out why _tkinter and _bsddb didn't compile with PCbuild8.

17 years agoDisable dup() of SSLSocket. I don't think it can be made to work.
Guido van Rossum [Fri, 16 Nov 2007 01:28:45 +0000 (01:28 +0000)]
Disable dup() of SSLSocket.  I don't think it can be made to work.

17 years agoThis is roughly socket2.diff from issue 1378, with a few changes applied
Guido van Rossum [Fri, 16 Nov 2007 01:24:05 +0000 (01:24 +0000)]
This is roughly socket2.diff from issue 1378, with a few changes applied
to ssl.py (no need to test whether we can dup any more).
Regular sockets no longer have a _base, but we still have explicit
reference counting of socket objects for the benefit of makefile();
using duplicate sockets won't work for SSLSocket.

17 years agoCorrect a failing test when test_import is run after test_coding:
Amaury Forgeot d'Arc [Fri, 16 Nov 2007 00:56:23 +0000 (00:56 +0000)]
Correct a failing test when test_import is run after test_coding:
be sure to import a fresh module by removing it from sys.modules

17 years agoCleanup of tokenizer.c.
Guido van Rossum [Fri, 16 Nov 2007 00:51:45 +0000 (00:51 +0000)]
Cleanup of tokenizer.c.

17 years agoOops, forgot to test this after the merge.
Guido van Rossum [Fri, 16 Nov 2007 00:48:13 +0000 (00:48 +0000)]
Oops, forgot to test this after the merge.

17 years agoMerged revisions 58947-59004 via svnmerge from
Guido van Rossum [Fri, 16 Nov 2007 00:35:22 +0000 (00:35 +0000)]
Merged revisions 58947-59004 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r58952 | christian.heimes | 2007-11-12 10:58:08 -0800 (Mon, 12 Nov 2007) | 6 lines

  readline module cleanup
  fixed indention to tabs
  use Py_RETURN_NONE macro
  added more error checks to on_completion_display_matches_hook

  open question: Does PyList_SetItem(l, i, o) steal a reference to o in the case of an error?
........
  r58956 | guido.van.rossum | 2007-11-12 12:06:40 -0800 (Mon, 12 Nov 2007) | 2 lines

  Add the test from issue 1704621 (the issue itself is already fixed here).
........
  r58963 | amaury.forgeotdarc | 2007-11-13 13:54:28 -0800 (Tue, 13 Nov 2007) | 23 lines

  Merge from py3k branch:
  Correction for issue1265 (pdb bug with "with" statement).

  When an unfinished generator-iterator is garbage collected, PyEval_EvalFrameEx
  is called with a GeneratorExit exception set.  This leads to funny results
  if the sys.settrace function itself makes use of generators.
  A visible effect is that the settrace function is reset to None.
  Another is that the eventual "finally" block of the generator is not called.

  It is necessary to save/restore the exception around the call to the trace
  function.

  This happens a lot with py3k: isinstance() of an ABCMeta instance runs
      def __instancecheck__(cls, instance):
          """Override for isinstance(instance, cls)."""
          return any(cls.__subclasscheck__(c)
                     for c in {instance.__class__, type(instance)})
  which lets an opened generator expression each time it returns True.

  Backport candidate, even if the case is less frequent in 2.5.
........
  r58968 | georg.brandl | 2007-11-14 05:59:09 -0800 (Wed, 14 Nov 2007) | 2 lines

  Remove dead link from random docs.
........
  r58971 | raymond.hettinger | 2007-11-14 14:56:16 -0800 (Wed, 14 Nov 2007) | 1 line

  Make __fields__ read-only.  Suggested by Issac Morland
........
  r58972 | raymond.hettinger | 2007-11-14 15:02:30 -0800 (Wed, 14 Nov 2007) | 1 line

  Add test for __fields__ being read-only
........
  r58975 | raymond.hettinger | 2007-11-14 18:44:53 -0800 (Wed, 14 Nov 2007) | 6 lines

  Accept Issac Morland's suggestion for __replace__ to allow multiple replacements
  (suprisingly, this simplifies the signature, improves clarity, and is comparably fast).
  Update the docs to reflect a previous change to the function name.
  Add an example to the docs showing how to override the default __repr__ method.
........
  r58976 | raymond.hettinger | 2007-11-14 18:55:42 -0800 (Wed, 14 Nov 2007) | 1 line

  Small improvement to the implementation of __replace__().
........
  r58977 | raymond.hettinger | 2007-11-14 18:58:20 -0800 (Wed, 14 Nov 2007) | 1 line

  Fixup example in docs.
........
  r58978 | raymond.hettinger | 2007-11-14 19:16:09 -0800 (Wed, 14 Nov 2007) | 1 line

  Example of multiple replacements.
........
  r58998 | raymond.hettinger | 2007-11-15 14:39:34 -0800 (Thu, 15 Nov 2007) | 1 line

  Add example for use cases requiring default values.
........
  r59000 | bill.janssen | 2007-11-15 15:03:03 -0800 (Thu, 15 Nov 2007) | 1 line

  add the certificate for the Python SVN repository for testing SSL
........
  r59004 | guido.van.rossum | 2007-11-15 16:24:44 -0800 (Thu, 15 Nov 2007) | 8 lines

  A patch from issue 1378 by roudkerk:

  Currently on Windows set_error() make use of a large array which maps
  socket error numbers to error messages.

  This patch removes that array and just lets PyErr_SetExcFromWindowsErr()
  generate the message by using the Win32 function FormatMessage().
........

17 years agoFix some minor style nits. (I'll leave adding __all__ and making the
Guido van Rossum [Fri, 16 Nov 2007 00:06:11 +0000 (00:06 +0000)]
Fix some minor style nits.  (I'll leave adding __all__ and making the
docstrings conform to PEP 8 to someone else.)

17 years agoFix for VS 2008
Christian Heimes [Thu, 15 Nov 2007 23:37:07 +0000 (23:37 +0000)]
Fix for VS 2008
Although WS2_32.dll doesn't have inet_pton the definition conflicts with ws2tcpip.h.

17 years agoCorrection for issue1134: all source files with a coding spec, except latin-1
Amaury Forgeot d'Arc [Thu, 15 Nov 2007 23:19:43 +0000 (23:19 +0000)]
Correction for issue1134: all source files with a coding spec, except latin-1
and utf-8, crashed when parsing a multiline string, or a line longer that 512
columns.

17 years agoadd the certificate for the Python SVN repository for testing SSL
Bill Janssen [Thu, 15 Nov 2007 23:01:30 +0000 (23:01 +0000)]
add the certificate for the Python SVN repository for testing SSL

17 years agoget SSL support to work again
Bill Janssen [Thu, 15 Nov 2007 22:23:56 +0000 (22:23 +0000)]
get SSL support to work again

17 years agoAttempt to manually add _ssl to the PCBuild8 solution file.
Amaury Forgeot d'Arc [Thu, 15 Nov 2007 21:36:47 +0000 (21:36 +0000)]
Attempt to manually add _ssl to the PCBuild8 solution file.
Seems to start compiling.

17 years agoFound another memory leak in longrangeiter. And redo the previous correction
Amaury Forgeot d'Arc [Thu, 15 Nov 2007 20:52:21 +0000 (20:52 +0000)]
Found another memory leak in longrangeiter. And redo the previous correction
without calling PyType_Ready().

Question 1: Should the interpreter register all types with PyType_Ready()?
Many types seem to avoid it.

Question 2: To reproduce the problem, run the following code:
    def f():
        while True:
           for a in iter(range(0,1,10**20)):
              pass
    f()
And watch the memory used by the process.
How do we test this in a unittest?

17 years agoReplace PyObject_Unicode with PyObject_Str everywhere, and remove the
Thomas Heller [Thu, 15 Nov 2007 20:48:54 +0000 (20:48 +0000)]
Replace PyObject_Unicode with PyObject_Str everywhere, and remove the
#define for PyObject_Unicode in object.h.

17 years agoFix two compiler warnings on Win64.
Thomas Heller [Thu, 15 Nov 2007 20:03:00 +0000 (20:03 +0000)]
Fix two compiler warnings on Win64.

17 years agoIn anticipation of the upcoming ssl patch I've added _ssl to PCbuild8. It's based...
Christian Heimes [Thu, 15 Nov 2007 19:57:43 +0000 (19:57 +0000)]
In anticipation of the upcoming ssl patch I've added _ssl to PCbuild8. It's based on a copy of _socket.vcproj. My German version of VS 2005 alters almost every line of pcbuild.sln. Could somebody else please add _ssl.vcproj to the solution?

17 years agoPatch 1144 by David Binger, fix for parser module. With unittest.
Guido van Rossum [Thu, 15 Nov 2007 19:17:28 +0000 (19:17 +0000)]
Patch 1144 by David Binger, fix for parser module. With unittest.
(I also cleared out all trailing whitespace in the C file.)

17 years agoCorrect a memory leak: the range() object was not properly freed.
Amaury Forgeot d'Arc [Thu, 15 Nov 2007 19:16:08 +0000 (19:16 +0000)]
Correct a memory leak: the range() object was not properly freed.

17 years agoOn Win64, linking the python dll currently fails with 'unresolved
Thomas Heller [Thu, 15 Nov 2007 19:11:49 +0000 (19:11 +0000)]
On Win64, linking the python dll currently fails with 'unresolved
external symbol PyObject_Unicode'.

Building _ssl than hangs the build server because starting python.exe
displayes a message box that 'Python30.dll' cannot be found.

Temporary (?) solution: Look for existance of python30.dll and fail
the _ssl build when it is missing.

17 years agoAdded some additional checks for sys.std?? is None, see #1440
Christian Heimes [Thu, 15 Nov 2007 02:26:46 +0000 (02:26 +0000)]
Added some additional checks for sys.std?? is None, see #1440

17 years agoThe peeping and bawling of the builtin speaker is giving my poor cat the creeps.
Christian Heimes [Thu, 15 Nov 2007 02:15:53 +0000 (02:15 +0000)]
The peeping and bawling of the builtin speaker is giving my poor cat the creeps.

17 years agoPatch 1439 by Bill Janssen. I think this will work.
Guido van Rossum [Wed, 14 Nov 2007 22:32:02 +0000 (22:32 +0000)]
Patch 1439 by Bill Janssen.  I think this will work.
Tested on Windows by Christian Heimes.
I changed the code slightly, renaming decref_socketios() to
_decref_socketios(), and moving it closer to the close() method
that it calls.  Hopefully Bill can now submit his SSL port to 3.0.

17 years agoFix for bug #1442 pythonstartup addition of minor error checking
Christian Heimes [Wed, 14 Nov 2007 16:21:32 +0000 (16:21 +0000)]
Fix for bug #1442 pythonstartup addition of minor error checking
Python failed to report an error when it wasn't able to open the PYTHONSTARTUP file.

17 years agoMoved the initalization of the exception before the initialization of sys.
Christian Heimes [Wed, 14 Nov 2007 00:16:07 +0000 (00:16 +0000)]
Moved the initalization of the exception before the initialization of sys.
On Windows _PySys_Init() could raise an uninitialized exception which leads to a seg fault.

17 years agoPaths and file names from the fs should always be decoded with PyUnicode_DecodeFSDefa...
Christian Heimes [Wed, 14 Nov 2007 00:15:01 +0000 (00:15 +0000)]
Paths and file names from the fs should always be decoded with PyUnicode_DecodeFSDefault and not PyUnicode_FromString

17 years agoAnother #1415 fix for Windows GUI apps
Christian Heimes [Tue, 13 Nov 2007 15:24:14 +0000 (15:24 +0000)]
Another #1415 fix for Windows GUI apps
print() mustn't raise an exception when sys.stdout is None.

17 years agoFixed space -> tab
Christian Heimes [Tue, 13 Nov 2007 02:34:21 +0000 (02:34 +0000)]
Fixed space -> tab

17 years agoFix for #1415 pythonw.exe fails because std streams a missing
Christian Heimes [Tue, 13 Nov 2007 02:19:40 +0000 (02:19 +0000)]
Fix for #1415 pythonw.exe fails because std streams a missing

After a long discussion about the problem with Windows GUI apps Guido decided that sys.stdin, stdout and stderr should be None when the C runtime library returns invalid file descriptors for the standard streams.

So far the only known cases are Windows GUI apps and scripts started with pythonw on Windows. The OS restrictions are tight enough to catch the problem on other OSes.

17 years agoCorrection for issue1265 (pdb bug with "with" statement).
Amaury Forgeot d'Arc [Tue, 13 Nov 2007 01:05:30 +0000 (01:05 +0000)]
Correction for issue1265 (pdb bug with "with" statement).

When an unfinished generator-iterator is garbage collected, PyEval_EvalFrameEx
is called with a GeneratorExit exception set.  This leads to funny results
if the sys.settrace function itself makes use of generators.
A visible effect is that the settrace function is reset to None.
Another is that the eventual "finally" block of the generator is not called.

It is necessary to save/restore the exception around the call to the trace
function.

This happens a lot with py3k: isinstance() of an ABCMeta instance runs
    def __instancecheck__(cls, instance):
        """Override for isinstance(instance, cls)."""
        return any(cls.__subclasscheck__(c)
                   for c in {instance.__class__, type(instance)})
which lets an opened generator expression each time it returns True.

Seems a backport candidate, even if the case is less frequent in 2.5.

17 years agoAdd -i option. Don't exit when the command fails. Redirect stderr to stdout.
Guido van Rossum [Mon, 12 Nov 2007 23:12:57 +0000 (23:12 +0000)]
Add -i option.  Don't exit when the command fails.  Redirect stderr to stdout.

17 years agoAnother fix for #1414
Christian Heimes [Mon, 12 Nov 2007 19:53:03 +0000 (19:53 +0000)]
Another fix for #1414

17 years agoFix for refleak tests through regrtest.py -R:: bug #1414
Christian Heimes [Mon, 12 Nov 2007 19:19:07 +0000 (19:19 +0000)]
Fix for refleak tests through regrtest.py -R:: bug #1414
The pre-commit hook doesn't allow a trailing newline

17 years agoPatch 1420 by Ron Adam.
Guido van Rossum [Mon, 12 Nov 2007 17:40:10 +0000 (17:40 +0000)]
Patch 1420 by Ron Adam.
This adds support for bytes literals (b'...') to tokenize.py, and
removes support for unicode literals (u'...').

17 years agoLet's do as Guido says and return None instead of -1
Christian Heimes [Mon, 12 Nov 2007 17:02:51 +0000 (17:02 +0000)]
Let's do as Guido says and return None instead of -1

17 years agoStop Python code from instantiating a new stdprinter with sys.stderr.__class__()
Christian Heimes [Mon, 12 Nov 2007 16:05:45 +0000 (16:05 +0000)]
Stop Python code from instantiating a new stdprinter with sys.stderr.__class__()
Added some more methods and attributes to stdprinter to ease up debugging #1415 on Windows. It also makes the object more file like. Now it can be used as a working replacement for an io instance.

17 years agoMerged revisions 58939-58946 via svnmerge from
Christian Heimes [Mon, 12 Nov 2007 15:01:33 +0000 (15:01 +0000)]
Merged revisions 58939-58946 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r58940 | martin.v.loewis | 2007-11-12 05:53:02 +0100 (Mon, 12 Nov 2007) | 3 lines

  Only set rl_completion_display_matches_hook if there
  is a Python hook function. Fixes #1425.
........
  r58941 | martin.v.loewis | 2007-11-12 06:14:05 +0100 (Mon, 12 Nov 2007) | 2 lines

  Patch #1418: Make the AC_REPLACE_FUNCS object files actually work.
........
  r58942 | walter.doerwald | 2007-11-12 11:01:33 +0100 (Mon, 12 Nov 2007) | 2 lines

  Fix TextCalendar.prweek(). This closes issue #1427.
........

17 years agoMerged revisions 58930-58938 via svnmerge from
Christian Heimes [Mon, 12 Nov 2007 01:32:03 +0000 (01:32 +0000)]
Merged revisions 58930-58938 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r58931 | vinay.sajip | 2007-11-11 15:27:30 +0100 (Sun, 11 Nov 2007) | 1 line

  Fixed a bug reported (in private email, by Robert Crida) in logging configuration whereby child loggers of a logger named in a configuration file, which are not themselves named in the configuration, are disabled when the configuration is applied.
........
  r58932 | georg.brandl | 2007-11-11 16:16:16 +0100 (Sun, 11 Nov 2007) | 2 lines

  Remove duplication of "this".
........
  r58935 | christian.heimes | 2007-11-12 02:15:40 +0100 (Mon, 12 Nov 2007) | 2 lines

  Added new decorator syntax to property.__doc__
  Guido prefers _x over __x.
........
  r58936 | christian.heimes | 2007-11-12 02:20:56 +0100 (Mon, 12 Nov 2007) | 2 lines

  Fix for #1427: Error in standard module calendar
  the prweek() method is still broken and I can't figure out how it suppose to work.
........
  r58938 | andrew.kuchling | 2007-11-12 02:25:21 +0100 (Mon, 12 Nov 2007) | 1 line

  Re-word sentence
........

17 years agoMinimal change that disables (AFAICT) the interpolation of \u and \U inside
Guido van Rossum [Mon, 12 Nov 2007 01:13:56 +0000 (01:13 +0000)]
Minimal change that disables (AFAICT) the interpolation of \u and \U inside
raw string literals.  I added a whole bunch of tests but am still not sure
I am testing all paths through the code.  I really think the code could be
simplified quite a bit.

17 years agoFixed some of the bugs in the readline module. #1425 is still open and several method...
Christian Heimes [Sun, 11 Nov 2007 22:42:36 +0000 (22:42 +0000)]
Fixed some of the bugs in the readline module. #1425 is still open and several methods don't do enough error checks.

17 years agoMerged revisions 58886-58929 via svnmerge from
Guido van Rossum [Sat, 10 Nov 2007 23:39:45 +0000 (23:39 +0000)]
Merged revisions 58886-58929 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r58892 | guido.van.rossum | 2007-11-06 15:32:56 -0800 (Tue, 06 Nov 2007) | 2 lines

  Add missing "return NULL" in overflow check in PyObject_Repr().
........
  r58893 | raymond.hettinger | 2007-11-06 17:13:09 -0800 (Tue, 06 Nov 2007) | 1 line

  Fix marshal's incorrect handling of subclasses of builtin types (backport candidate).
........
  r58895 | raymond.hettinger | 2007-11-06 18:26:17 -0800 (Tue, 06 Nov 2007) | 1 line

  Optimize dict.fromkeys() with dict inputs.  Useful for resetting bag/muliset counts for example.
........
  r58896 | raymond.hettinger | 2007-11-06 18:45:46 -0800 (Tue, 06 Nov 2007) | 1 line

  Add build option for faster loop execution.
........
  r58900 | nick.coghlan | 2007-11-07 03:57:51 -0800 (Wed, 07 Nov 2007) | 1 line

  Add missing NEWS entry
........
  r58905 | christian.heimes | 2007-11-07 09:50:54 -0800 (Wed, 07 Nov 2007) | 1 line

  Backported fix for bug #1392 from py3k branch r58903.
........
  r58906 | christian.heimes | 2007-11-07 10:30:22 -0800 (Wed, 07 Nov 2007) | 1 line

  Backport of Guido's review of my patch.
........
  r58908 | raymond.hettinger | 2007-11-07 18:52:43 -0800 (Wed, 07 Nov 2007) | 1 line

  Add set.isdisjoint()
........
  r58915 | raymond.hettinger | 2007-11-08 10:47:51 -0800 (Thu, 08 Nov 2007) | 1 line

  Reposition the decref (spotted by eagle-eye norwitz).
........
  r58920 | georg.brandl | 2007-11-09 04:31:43 -0800 (Fri, 09 Nov 2007) | 2 lines

  Fix seealso link to sets docs. Do not merge to Py3k.
........
  r58921 | georg.brandl | 2007-11-09 05:08:48 -0800 (Fri, 09 Nov 2007) | 2 lines

  Fix misleading example.
........
  r58923 | georg.brandl | 2007-11-09 09:33:23 -0800 (Fri, 09 Nov 2007) | 3 lines

  Correct a comment about testing methods - nowadays most
  tests don't run directly on import.
........
  r58924 | martin.v.loewis | 2007-11-09 14:56:30 -0800 (Fri, 09 Nov 2007) | 2 lines

  Add Amaury Forgeot d'Arc.
........
  r58925 | raymond.hettinger | 2007-11-09 15:14:44 -0800 (Fri, 09 Nov 2007) | 1 line

  Optimize common case for dict.fromkeys().
........
  r58927 | raymond.hettinger | 2007-11-09 17:54:03 -0800 (Fri, 09 Nov 2007) | 1 line

  Use a freelist to speed-up block allocation and deallocation in collections.deque().
........
  r58929 | guido.van.rossum | 2007-11-10 14:12:24 -0800 (Sat, 10 Nov 2007) | 3 lines

  Issue 1416.  Add getter, setter, deleter methods to properties that can be
  used as decorators to create fully-populated properties.
........

17 years agoNo need to include windows.h twice
Amaury Forgeot d'Arc [Sat, 10 Nov 2007 13:55:44 +0000 (13:55 +0000)]
No need to include windows.h twice

17 years agoBug #1415
Christian Heimes [Sat, 10 Nov 2007 00:30:14 +0000 (00:30 +0000)]
Bug #1415

On Windows fileno(stdout) and fileno(stderr) can return an invalid file descriptor number (-2 on my machine). It happens only for pythonw.exe but not for python.exe.

Catch the problem ASAP in PyFile_NewStdPrinter(). I've also removed the call to PyErr_BadInternalCall(). It was causing a seg fault because the exceptions aren't available yet.

17 years agoseek() has to accept any int-like number
Christian Heimes [Fri, 9 Nov 2007 01:27:29 +0000 (01:27 +0000)]
seek() has to accept any int-like number

17 years agoIt works w/o the newline on my system but you are right. A newline is nicer.
Christian Heimes [Fri, 9 Nov 2007 00:56:36 +0000 (00:56 +0000)]
It works w/o the newline on my system but you are right. A newline is nicer.

17 years agoI've created three bat files based on the howto http://wiki.python.org/moin/Building_...
Christian Heimes [Thu, 8 Nov 2007 23:55:45 +0000 (23:55 +0000)]
I've created three bat files based on the howto http://wiki.python.org/moin/Building_Python_with_the_free_MS_C_Toolkit

I figured out that the files may suite other developers. The files take care of most problems and makes building Python on Windows easier. Simply double click on build_env.bat to open a shell and type build.

17 years agoIssue 1406: use widechar api for os.environ, on Windows.
Thomas Heller [Thu, 8 Nov 2007 19:33:05 +0000 (19:33 +0000)]
Issue 1406: use widechar api for os.environ, on Windows.

17 years agoFixed bug #1081: file.seek allows float arguments
Christian Heimes [Thu, 8 Nov 2007 18:04:45 +0000 (18:04 +0000)]
Fixed bug #1081: file.seek allows float arguments

17 years agoFixed #1403 where compileall and py_compile choked on an encoding header in a py...
Christian Heimes [Thu, 8 Nov 2007 16:34:32 +0000 (16:34 +0000)]
Fixed #1403 where compileall and py_compile choked on an encoding header in a py file. Both modules need more unit tests.

17 years agoAdded unit test to verify that #1087 is invalid. os.popen is using subprocess.
Christian Heimes [Thu, 8 Nov 2007 14:16:55 +0000 (14:16 +0000)]
Added unit test to verify that #1087 is invalid. os.popen is using subprocess.

17 years agoApplied patch #1127 from Quentin Gallet Gilles: No tests for inspect.getfullargspec()
Christian Heimes [Thu, 8 Nov 2007 13:48:53 +0000 (13:48 +0000)]
Applied patch #1127 from Quentin Gallet Gilles: No tests for inspect.getfullargspec()

17 years agoAdded tests from Raghuram Devarakonda for bug #1395 'py3k: duplicated line endings...
Christian Heimes [Thu, 8 Nov 2007 13:12:43 +0000 (13:12 +0000)]
Added tests from Raghuram Devarakonda for bug #1395 'py3k: duplicated line endings when using read(1)' to outstanding_bugs.py

17 years agoFixed memoryview constructor. It allowed arbitrary keyword arguments. The bug was...
Christian Heimes [Thu, 8 Nov 2007 02:28:11 +0000 (02:28 +0000)]
Fixed memoryview constructor. It allowed arbitrary keyword arguments. The bug was found by mykhal from #python. I've also added a small test case in the new test_memoryview.py

17 years agoCosmetic changes to Christian's patch r58903.
Guido van Rossum [Wed, 7 Nov 2007 17:46:34 +0000 (17:46 +0000)]
Cosmetic changes to Christian's patch r58903.
(Consider this code review feedback. :-)

17 years agoPatch for bug http://bugs.python.org/issue1293
Christian Heimes [Wed, 7 Nov 2007 17:26:16 +0000 (17:26 +0000)]
Patch for bug http://bugs.python.org/issue1293

The patch doesn't do the whole name mangling mambo jambo on purpose. MS sure does some weird things and I don't feel like reimplementing ntpath.normpath in C. If the user does deliberately something stupid he is on his own.

TODO: Backport to 2.6 (maybe 2.5?) and document that users should only do sys.path.append(os.path.normpath(somepath)) if they want to be on the safe side.

17 years agoReset original sys.stdout, stderr and displayhook even in the case of an error
Christian Heimes [Wed, 7 Nov 2007 16:14:12 +0000 (16:14 +0000)]
Reset original sys.stdout, stderr and displayhook even in the case of an error

17 years agoChange a variable to Py_ssize_t to silence a compiler warning (and because it
Brett Cannon [Tue, 6 Nov 2007 23:15:11 +0000 (23:15 +0000)]
Change a variable to Py_ssize_t to silence a compiler warning (and because it
is more appropriate).

17 years agoRemove an unused local variable.
Brett Cannon [Tue, 6 Nov 2007 23:14:42 +0000 (23:14 +0000)]
Remove an unused local variable.

17 years agoMerging the py3k-pep3137 branch back into the py3k branch.
Guido van Rossum [Tue, 6 Nov 2007 21:34:58 +0000 (21:34 +0000)]
Merging the py3k-pep3137 branch back into the py3k branch.
No detailed change log; just check out the change log for the py3k-pep3137
branch.  The most obvious changes:

  - str8 renamed to bytes (PyString at the C level);
  - bytes renamed to buffer (PyBytes at the C level);
  - PyString and PyUnicode are no longer compatible.

I.e. we now have an immutable bytes type and a mutable bytes type.

The behavior of PyString was modified quite a bit, to make it more
bytes-like.  Some changes are still on the to-do list.

17 years agoMerged revisions 58862-58885 via svnmerge from
Guido van Rossum [Tue, 6 Nov 2007 20:51:31 +0000 (20:51 +0000)]
Merged revisions 58862-58885 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r58868 | gregory.p.smith | 2007-11-05 16:19:03 -0800 (Mon, 05 Nov 2007) | 3 lines

  Fixes Issue 1385: The hmac module now computes the correct hmac when using
  hashes with a block size other than 64 bytes (such as sha384 and sha512).
........

17 years agoFixed bug #1384 Windows fix for inspect tests
Christian Heimes [Tue, 6 Nov 2007 11:44:48 +0000 (11:44 +0000)]
Fixed bug #1384 Windows fix for inspect tests
Thanks to Amaury Forgeot d'Arc for fixing my patch ;-)

17 years agoMerged revisions 58817-58861 via svnmerge from
Guido van Rossum [Mon, 5 Nov 2007 19:43:04 +0000 (19:43 +0000)]
Merged revisions 58817-58861 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r58822 | brett.cannon | 2007-11-02 23:47:02 -0700 (Fri, 02 Nov 2007) | 2 lines

  Add a missing quotation mark.
........
  r58840 | skip.montanaro | 2007-11-04 07:56:52 -0800 (Sun, 04 Nov 2007) | 2 lines

  Note change to get_dialect semantics in 2.5.  Will backport to 2.5.
........
  r58844 | georg.brandl | 2007-11-04 09:43:49 -0800 (Sun, 04 Nov 2007) | 2 lines

  Fix syntax for versionchanged markup.
........
  r58850 | gregory.p.smith | 2007-11-04 18:32:26 -0800 (Sun, 04 Nov 2007) | 9 lines

  Fixes bug 477182 on pybsddb.sf.net.  DB objects now load the flags and
  pay attention to them when opening an existing database.  This means
  that d[] behaves properly even on databases previously created with DB_DUP
  or DB_DUPSORT flags to allow duplicate keys.

  http://sourceforge.net/tracker/index.php?func=detail&aid=477182&group_id=13900&atid=113900

  Do not backport, this bugfix could be considered an API change.
........
  r58851 | gregory.p.smith | 2007-11-04 18:56:31 -0800 (Sun, 04 Nov 2007) | 3 lines

  Add the bsddb.db.DBEnv.lock_id_free method.
  Improve test_lock's tempdir creation and cleanup.
........
  r58852 | gregory.p.smith | 2007-11-05 01:06:28 -0800 (Mon, 05 Nov 2007) | 3 lines

   * db->get_types is only available in BerkeleyDB >= 4.2
   * get compiling with older versions of python again for a stand alone release.
........
  r58853 | gregory.p.smith | 2007-11-05 01:07:40 -0800 (Mon, 05 Nov 2007) | 2 lines

  * db->get_flags is only available in BerkeleyDB >= 4.2
........
  r58854 | mark.summerfield | 2007-11-05 01:22:48 -0800 (Mon, 05 Nov 2007) | 3 lines

  Added cross-references between the various archive file formats.
........
  r58857 | mark.summerfield | 2007-11-05 06:38:50 -0800 (Mon, 05 Nov 2007) | 5 lines

  Clarified the fact that you can have comments for individual archive
  members even though comments to the archive itself aren't currently
  supported.
........

17 years agoApplied patch #1379 with a minor tweak.
Christian Heimes [Sun, 4 Nov 2007 12:10:01 +0000 (12:10 +0000)]
Applied patch #1379 with a minor tweak.
PyModule_GetName() returns a char* from PyUnicode_AsString but the code in import.c was using PyString_FromString on it.

17 years agoFixed a bug in PyUnicode_DecodeFSDefault. strcmp() returns 0 on success.
Christian Heimes [Sun, 4 Nov 2007 11:43:14 +0000 (11:43 +0000)]
Fixed a bug in PyUnicode_DecodeFSDefault. strcmp() returns 0 on success.
Added PyUnicode_DecodeFSDefaultAndSize
Fixed a problem with the sys.path code that caused a segfault on Windows when the path contains non ASCII chars. The code for sys.executable, exec_prefix and prefix should be fixed, too.

17 years agoDisabled test_sys_path_with_unicode for now
Christian Heimes [Sun, 4 Nov 2007 11:37:22 +0000 (11:37 +0000)]
Disabled test_sys_path_with_unicode for now
Fixed encoding of author name in tarfile.py.

17 years agoRe-add two paragraphs that seem to have been lost during the merge from trunk.
Georg Brandl [Sat, 3 Nov 2007 08:44:43 +0000 (08:44 +0000)]
Re-add two paragraphs that seem to have been lost during the merge from trunk.

17 years agoPatch 1171 by mfenniak -- allow subclassing of bytes.
Guido van Rossum [Sat, 3 Nov 2007 00:24:24 +0000 (00:24 +0000)]
Patch 1171 by mfenniak -- allow subclassing of bytes.
I suspect this has some problems when the subclass is evil,
but that's for later.

17 years agoMerged revisions 58742-58816 via svnmerge from
Guido van Rossum [Fri, 2 Nov 2007 23:46:40 +0000 (23:46 +0000)]
Merged revisions 58742-58816 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r58745 | georg.brandl | 2007-11-01 10:19:33 -0700 (Thu, 01 Nov 2007) | 2 lines

  #1364: os.lstat is available on Windows too, as an alias to os.stat.
........
  r58750 | christian.heimes | 2007-11-01 12:48:10 -0700 (Thu, 01 Nov 2007) | 1 line

  Backport of import tests for bug http://bugs.python.org/issue1293 and bug http://bugs.python.org/issue1342
........
  r58751 | christian.heimes | 2007-11-01 13:11:06 -0700 (Thu, 01 Nov 2007) | 1 line

  Removed non ASCII text from test as requested by Guido. Sorry :/
........
  r58753 | georg.brandl | 2007-11-01 13:37:02 -0700 (Thu, 01 Nov 2007) | 2 lines

  Fix markup glitch.
........
  r58757 | gregory.p.smith | 2007-11-01 14:08:14 -0700 (Thu, 01 Nov 2007) | 4 lines

  Fix bug introduced in revision 58385.  Database keys could no longer
  have NULL bytes in them.  Replace the errant strdup with a
  malloc+memcpy.  Adds a unit test for the correct behavior.
........
  r58758 | gregory.p.smith | 2007-11-01 14:15:36 -0700 (Thu, 01 Nov 2007) | 3 lines

  Undo revision 58533 58534 fixes.  Those were a workaround for
  a problem introduced by 58385.
........
  r58759 | gregory.p.smith | 2007-11-01 14:17:47 -0700 (Thu, 01 Nov 2007) | 2 lines

  false "fix" undone as correct problem was found and fixed.
........
  r58765 | mark.summerfield | 2007-11-02 01:24:59 -0700 (Fri, 02 Nov 2007) | 3 lines

  Added more file-handling related cross-references.
........
  r58766 | nick.coghlan | 2007-11-02 03:09:12 -0700 (Fri, 02 Nov 2007) | 1 line

  Fix for bug 1705170 - contextmanager swallowing StopIteration (2.5 backport candidate)
........
  r58784 | thomas.heller | 2007-11-02 12:10:24 -0700 (Fri, 02 Nov 2007) | 4 lines

  Issue #1292: On alpha, arm, ppc, and s390 linux systems the
  --with-system-ffi configure option defaults to "yes" because the
  bundled libffi sources are too old.
........
  r58785 | thomas.heller | 2007-11-02 12:11:23 -0700 (Fri, 02 Nov 2007) | 1 line

  Enable the full ctypes c_longdouble tests again.
........
  r58796 | georg.brandl | 2007-11-02 13:06:17 -0700 (Fri, 02 Nov 2007) | 4 lines

  Make "hashable" a glossary entry and clarify docs on __cmp__, __eq__ and __hash__.
  I hope the concept of hashability is better understandable now.
  Thanks to Tim Hatch for pointing out the flaws here.
........

17 years agoFixes for issue 1752184, ensuring type objects are always created
Guido van Rossum [Fri, 2 Nov 2007 23:07:07 +0000 (23:07 +0000)]
Fixes for issue 1752184, ensuring type objects are always created
with a PyUnicode name.

17 years agoPatch 1373 by Adam Hupp.
Guido van Rossum [Fri, 2 Nov 2007 16:10:06 +0000 (16:10 +0000)]
Patch 1373 by Adam Hupp.
Fixes intermittent errors in test_xmlrpc due to socket timeouts.

17 years agoRemoved non ASCII text from test as requested by Guido.
Christian Heimes [Thu, 1 Nov 2007 22:37:07 +0000 (22:37 +0000)]
Removed non ASCII text from test as requested by Guido.

17 years agoFixes issue1371 and reenables those tests.
Gregory P. Smith [Thu, 1 Nov 2007 21:55:08 +0000 (21:55 +0000)]
Fixes issue1371 and reenables those tests.

Merge r58757 and r58758 from trunk.
Undoes incorrect dbtables fix and errant strdup introduced as
described below:

r58757 | gregory.p.smith | 2007-11-01 14:08:14 -0700 (Thu, 01 Nov 2007) | 4 lines

Fix bug introduced in revision 58385.  Database keys could no longer
have NULL bytes in them.  Replace the errant strdup with a
malloc+memcpy.  Adds a unit test for the correct behavior.

r58758 | gregory.p.smith | 2007-11-01 14:15:36 -0700 (Thu, 01 Nov 2007) | 3 lines

Undo revision 58533 58534 fixes.  Those were a workaround for
a problem introduced by 58385.

17 years agoRemove file that should have been removed during the merge.
Georg Brandl [Thu, 1 Nov 2007 20:58:46 +0000 (20:58 +0000)]
Remove file that should have been removed during the merge.

17 years agoAdd new directory "using". This should have been in the merge patch,
Georg Brandl [Thu, 1 Nov 2007 20:58:08 +0000 (20:58 +0000)]
Add new directory "using". This should have been in the merge patch,
but it was probably generated with "svn diff" so that new files that
weren't added first weren't included.