[issue15263] Guard against invalid file handles in os functions

2012-07-06 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: Every use of _get_osfhandle() should be guarded by _Py_VerifyFd(). Grepping through the source it seems that that is now true, but we could instead use #define _PY_GET_OSFHANDLE(fd) _Py_VerifyFd(fd) ? _get_osfhandle(fd

[issue15261] os.stat(fd) crashes on Windows if fd does not exist

2012-07-06 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: Sorry about that... -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15261 ___ ___ Python

[issue15361] venv's Activate.ps1 causes broken prompt with powershell

2012-07-15 Thread Richard Oudkerk
New submission from Richard Oudkerk shibt...@gmail.com: If I create a venv on Windows called py3 then py3/Scripts/Activate.ps1 defines the prompt to be function prompt { Write-Host -NoNewline -ForegroundColor Green [(py3) ] _OLD_VIRTUAL_PROMPT } However this prompt

[issue15364] sysconfig confused by relative paths

2012-07-16 Thread Richard Oudkerk
New submission from Richard Oudkerk shibt...@gmail.com: With unix, and a source build, sysconfig.get_config_var('srcdir') and sysconfig.get_path('include') misbehave: user@mint-vm ~/Repos/cpython $ cd / user@mint-vm / $ ~/Repos/cpython/python Python 3.3.0b1 (default:671894ae19a2, Jul 16

[issue15366] venv assumes header files in sys._home + '/Include'

2012-07-16 Thread Richard Oudkerk
New submission from Richard Oudkerk shibt...@gmail.com: For Unix I follow the practice suggested in README of running configure from a subdir of the main python directory, eg mkdir release cd release ../configure make But if I create a venv then I cannot use it to compile C

[issue15367] build_ext in a venv on Windows assumes pyconfig.h in sys.exec_prefix + '\PC'

2012-07-16 Thread Richard Oudkerk
New submission from Richard Oudkerk shibt...@gmail.com: On Windows I can't use a source build of Python to create a venv which will compile C extensions because pyconfig.h cannot be found. For example running build running build_ext building 'demo' extension creating build

[issue15367] build_ext in a venv on Windows assumes pyconfig.h in sys.exec_prefix + '\PC'

2012-07-16 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: The attached patch works for me. -- keywords: +patch Added file: http://bugs.python.org/file26395/build_ext.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15367

[issue15366] venv assumes header files in sys._home + '/Include'

2012-07-16 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: The attached patch seems to fix the problem. -- keywords: +patch Added file: http://bugs.python.org/file26397/distutils-sysconfig.patch ___ Python tracker rep...@bugs.python.org http

[issue15366] venv assumes header files in sys._home + '/Include'

2012-07-16 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: Updated patch. Old one broke test_distutils... -- Added file: http://bugs.python.org/file26399/distutils-sysconfig.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org

[issue15367] build_ext in a venv on Windows assumes pyconfig.h in sys.exec_prefix + '\PC'

2012-07-16 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: Updated patch which does not fail test_distutils. -- Added file: http://bugs.python.org/file26400/build_ext.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15367

[issue15364] sysconfig confused by relative paths

2012-07-16 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: I don't recall what the issue was the resulted in the check-in that you mention. I think it was http://bugs.python.org/issue8577. The issue was about having srcdir != builddir. The initial patch caused a test failure, and 356d0ea8ea34

[issue15364] sysconfig confused by relative paths

2012-07-16 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: In the attached patch _safe_realpath() is only called after calculating the absolute path for srcdir. -- keywords: +patch Added file: http://bugs.python.org/file26407/sysconf.patch ___ Python

[issue15364] sysconfig confused by relative paths

2012-07-17 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: Updated patch which clarifies that for an installed python on a posix system, get_config_var('srcdir') == get_path('stdlib'). Eg, if sys.executable == '/usr/local/bin/python3.3' then get_config_var('srcdir') == '/usr/local/lib/python3.3

[issue15364] sysconfig confused by relative paths

2012-07-17 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: Beyond that, I don't understand why the patch behavior depends on whether the srcdir is an absolute path or not. The os.path.isabs() test is actually redundant since os.path.join(base, srcdir) == srcdir if srcdir is an absolute path. I

[issue15364] sysconfig confused by relative paths

2012-07-18 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: Here is an updated patch which also modifies distutils.sysconfig. For installed pythons on posix systems it makes get_config_var('srcdir') == os.path.dirname(get_makefile_filename()) (The older patches would give the same result only

[issue15364] sysconfig confused by relative paths

2012-07-18 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: Forgot to remove some unnecessary code in patch. -- Added file: http://bugs.python.org/file26427/sysconf.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15364

[issue15184] Test failure in test_sysconfig_module

2012-07-18 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: I suspect the problem is related to http://bugs.python.org/issue15298. Basically the global sysconfig module caches the results of parsing Makefile in Lib/_sysconfigdata.py. This can cause you to get the config vars from an old configure

[issue15364] sysconfig confused by relative paths

2012-07-19 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: I'd make get_config_var('srcdir') to be None for installed systems, because the source tree is not available there. While playing with a version of the patch which returns None for non-source builds, I found that distutils.support

[issue15397] Unbinding of methods

2012-07-20 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: Can't you unbind without any changes to the C code by doing def unbind(f): if hasattr(f, '__func__'): return f.__func__ self = getattr(f, '__self__', None) if self is not None and not isinstance(self

[issue15408] os.fork/os.popen behaviour change between 2.7 and 3.2

2012-07-20 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: The problem is that os.wait() is returning when the wrong process exits. You can fix this by specifying the pid you are waiting for by doing os.waitpid(pid, 0) instead of os.wait(). Arguably os.popen() and subprocess.communicate() etc

[issue15408] os.fork/os.popen behaviour change between 2.7 and 3.2

2012-07-20 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: Actually, if you replace print(os.popen(uname).read()) with f = os.popen(uname) print(f.read()) f.close() or with os.popen(uname) as f: print(f.read()) then things should work

[issue15412] Note in documentation for weakrefs

2012-07-21 Thread Richard Oudkerk
New submission from Richard Oudkerk shibt...@gmail.com: In the documentation on weakrefs there is the following quote Note: Weak references to an object are cleared before the object’s __del__() is called, to ensure that the weak reference callback (if any) finds the object still

[issue15412] Note in documentation for weakrefs

2012-07-21 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: The weakref is dead but it's still a weakref, and it can be used to e.g. index a container of existing weakrefs (cf. WeakSet, WeakKeyDictionary, WeakValueDictionary). Ah. I had assumed that since dead weakrefs were unhashable you

[issue15408] os.fork/os.popen behaviour change between 2.7 and 3.2

2012-07-23 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: In Python 2.x, when the file object returned by popen() is garbage collected the process is automatically waited on, collecting the pid of the process. In Python 3.x a wrapper object is used whose close method wait on the pid. This close

[issue15408] os.fork/os.popen behaviour change between 2.7 and 3.2

2012-07-23 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: A program which depends on the old behaviour would be broken on a non-refcounted implementation of Python, so I would be inclined to say won't fix. However, I think the following patch would restore the old behaviour diff -r a970054a93fb

[issue6056] socket.setdefaulttimeout affecting multiprocessing Manager

2012-07-24 Thread Richard Oudkerk
Changes by Richard Oudkerk shibt...@gmail.com: -- nosy: +sbt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6056 ___ ___ Python-bugs-list mailing

[issue1692335] Fix exception pickling: Move initial args assignment to BaseException.__new__

2012-07-24 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: ISTM the simplest approach would be to just set self-args in BaseException.__new__() (like in Georg's patch) but to ignore the possibility that the user might later set self.args to something stupid wrong: diff -r 51ac5f06dd04 Objects

[issue14930] Make memoryview weakrefable

2012-07-25 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: Is it possible that the use of test.support.gc_collect() in test_memoryview made the difference? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14930

[issue14501] Error initialising BaseManager class with 'authkey' argument of string type.

2012-07-25 Thread Richard Oudkerk
Changes by Richard Oudkerk shibt...@gmail.com: -- nosy: +sbt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14501 ___ ___ Python-bugs-list mailing

[issue15451] PATH is not honored in subprocess.Popen in win32

2012-07-26 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: I think env is used for specifying the environment used by the child process once it has started. env['PATH'] is not used by the parent process to find program to run. Having said that, maybe if you used shell=True as well then the shell

[issue1692335] Fix exception pickling: Move initial args assignment to BaseException.__new__

2012-07-26 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: I see that the originally proposed patch is more or less what I suggested above. Since this has been a critical issue for 5 years, I think such a minimal patch should be committed even though it is not a complete solution. It seems to me

[issue14501] Error initialising BaseManager class with 'authkey' argument of string type.

2012-07-26 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: You could just do Server_1=TestServer(address=(127.0.0.1,5),authkey=bpasskey) so this is probably a documentation issue. The examples in the documentation should at least be updated

[issue15364] sysconfig confused by relative paths

2012-07-26 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: Any objection if I commit the last patch before the next beta? This is the one which on installed Pythons have get_config_var('srcdir') == os.path.dirname(get_makefile_filename()) on posix systems

[issue15364] sysconfig confused by relative paths

2012-07-26 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: Does get_config_var('srcdir') always return a string or sometimes None? Always a string. distutils.support._get_xxmodule_path() is one place which (currently) would throw an exception if it returned None

[issue1692335] Fix exception pickling: Move initial args assignment to BaseException.__new__

2012-07-26 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: I realize now that the idea of using object.__reduce__(..., 2) would not really work since many exception classes use non-slot descriptors (unless '__slots__' attributes were also added as hints of what to serialize). I think there are two

[issue1692335] Fix exception pickling: Move initial args assignment to BaseException.__new__

2012-07-27 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: Here is a minimal patch against default. It is a clear improvement on the current situation, even though it still cannot handle the case class Error(Exception): def __init__(self, x): Exception.__init__(self) self.x = x

[issue1692335] Fix exception pickling: Move initial args assignment to BaseException.__new__

2012-07-27 Thread Richard Oudkerk
Changes by Richard Oudkerk shibt...@gmail.com: Added file: http://bugs.python.org/file26537/init_args.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1692335

[issue1692335] Fix exception pickling: Move initial args assignment to BaseException.__new__

2012-07-27 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: ExceptionTests.testAttributes already checks the attributes of unpickled copies (using all protocols). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue1692335

[issue1692335] Fix exception pickling: Move initial args assignment to BaseException.__new__

2012-07-27 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: BTW, BaseException_init() has the code Py_XDECREF(self-args); self-args = args; Py_INCREF(self-args); Presumably the Py_XDECREF(self-args) would be better replaced by Py_CLEAR(self-args

[issue1692335] Fix exception pickling: Move initial args assignment to BaseException.__new__

2012-07-27 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: Or you could simply Py_INCREF(args) before the Py_XDECREF... But won't self-args point to a broken object while any callbacks triggered by Py_XDECREF() are run? An alternative would be tmp = self-args; self-args = args

[issue1692335] Fix exception pickling: Move initial args assignment to BaseException.__new__

2012-07-27 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: Patch which adds fix for BaseException_init(). Actually this class of problem seem to be quite common. BaseException_set_tb() appears to be affected too, as is the code in the tutorial which introduces setters. -- Added file

[issue1692335] Fix exception pickling: Move initial args assignment to BaseException.__new__

2012-07-29 Thread Richard Oudkerk
Richard Oudkerk added the comment: Richard, can the issue be closed? I guess so (although the change could arguably be back ported). Pickling of Exception classes is still somewhat dodgy because an example like class Error(Exception): def __init__(self, x): Exception

[issue6056] socket.setdefaulttimeout affecting multiprocessing Manager

2012-07-29 Thread Richard Oudkerk
Changes by Richard Oudkerk shibt...@gmail.com: -- resolution: - fixed stage: needs patch - committed/rejected status: open - closed type: crash - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue6056

[issue15364] sysconfig confused by relative paths

2012-07-29 Thread Richard Oudkerk
Richard Oudkerk added the comment: One example is 'srcdir': this value is only useful in the build tree and there currently is no clean way to signal that you are retrieving a value that is not useful. In the particular case of 'srcdir', sysconfig.is_python_build() tells you whether

[issue15451] PATH is not honored in subprocess.Popen in win32

2012-07-29 Thread Richard Oudkerk
Richard Oudkerk added the comment: But I observe that the same script(with proper modification of file names) works very well under Linux. After I dive into the source code, I found Python use execvpe to invoke the child process which _will_ use the PATH variable to search the executable

[issue15451] PATH is not honored in subprocess.Popen in win32

2012-07-29 Thread Richard Oudkerk
Richard Oudkerk added the comment: What I understand you two as saying is that there seems to be an undocumented difference in execxxe between unix and windows which has been carried over to subprocess. No. There is no difference between the platforms in the behaviour of os.execvpe

[issue15507] test_subprocess assumes SIGINT is not being ignored.

2012-07-31 Thread Richard Oudkerk
Richard Oudkerk added the comment: Couldn't the preexec_fn argument of Popen be used instead? -- nosy: +sbt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15507

[issue15507] test_subprocess assumes SIGINT is not being ignored.

2012-07-31 Thread Richard Oudkerk
Richard Oudkerk added the comment: Couldn't the preexec_fn argument of Popen be used instead? Actually, since Python 3.2 you can just use restore_signals=True. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15507

[issue15528] Better support for finalization with weakrefs

2012-08-01 Thread Richard Oudkerk
New submission from Richard Oudkerk: A patch with docs and tests for the idea I suggested on python-ideas: http://comments.gmane.org/gmane.comp.python.ideas/15863 To repeat what I wrote there, the current issues with weakref callbacks include: 1. They are rather low level, and working out

[issue15525] test_multiprocessing failure on Windows XP

2012-08-01 Thread Richard Oudkerk
Richard Oudkerk added the comment: I would guess that the process has already terminated (or is being torn down) but the timeout is not long enough to let the parent join child. Let's see if increasing the timeout fixes the failures. -- ___ Python

[issue15525] test_multiprocessing failure on Windows XP

2012-08-03 Thread Richard Oudkerk
Richard Oudkerk added the comment: Looks like it is fixed. -- resolution: - fixed stage: needs patch - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15525

[issue15528] Better support for finalization with weakrefs

2012-08-04 Thread Richard Oudkerk
Richard Oudkerk added the comment: I don't quite understand the purpose of your suggestions. What can you do with it help, what you can not do with contextlib.ExitStack, atexit, __del__ method, weakref.WeakKeyDictionary or weakref.ref? I read the documentation, but the meaning eludes me

[issue15528] Better support for finalization with weakrefs

2012-08-04 Thread Richard Oudkerk
Richard Oudkerk added the comment: For point 1: global weakref.WeakKeyDictionary is good store for weak refs with callbacks. global weakdict weakdict[kenny] = weakref.ref(kenny, lambda _: print(you killed kenny!)) That depends on kenny being hashable. It also surprises me a bit

[issue15528] Better support for finalization with weakrefs

2012-08-05 Thread Richard Oudkerk
Richard Oudkerk added the comment: Updated patch. get() and put() replaced by peek() and detach(). Added isalive(). Now finalizer class has no state, i.e. __slots__ == (). -- Added file: http://bugs.python.org/file26701/finalize.patch ___ Python

[issue15528] Better support for finalization with weakrefs

2012-08-06 Thread Richard Oudkerk
Richard Oudkerk added the comment: In _make_callback, I still think the default error reporting mechanism should be kept. It can be improved separately. New patch. This time I have got rid of _make_callback, and just given __call__ an ignored optional argument. -- Added file: http

[issue15528] Better support for finalization with weakrefs

2012-08-11 Thread Richard Oudkerk
Richard Oudkerk added the comment: In the latest patch, what are broken and priority for? They are for a subclass used by multiprocessing. But it is premature to worry about subclassing, so I will take them out. Also, I would question why atexit is false by default. I would find

[issue15629] Run doctests in Doc/*.rst as part of regrtest

2012-08-12 Thread Richard Oudkerk
Richard Oudkerk added the comment: Might it be simpler to run doctest over the rst file from the relevant unittest? (Perhaps with help from test.support.) -- nosy: +sbt ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15629

[issue15629] Run doctests in Doc/*.rst as part of regrtest

2012-08-12 Thread Richard Oudkerk
Richard Oudkerk added the comment: the occasional typos can be found by simply run `make doctest` every once in a while). But doesn't make doctest attempt to run the doctests using Python 2.x (because Sphinx does not support Python 3.x

[issue15629] Run doctests in Doc/*.rst as part of regrtest

2012-08-12 Thread Richard Oudkerk
Richard Oudkerk added the comment: An example from the output of make doctest which fails because Python 2.x is being used: ** File library/multiprocessing.rst, line 453, in default Failed example: print(p, p.is_alive

[issue15364] sysconfig confused by relative paths

2012-08-13 Thread Richard Oudkerk
Changes by Richard Oudkerk shibt...@gmail.com: -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15364 ___ ___ Python-bugs

[issue15322] sysconfig.get_config_var('srcdir') returns unexpected value

2012-08-13 Thread Richard Oudkerk
Richard Oudkerk added the comment: I think #15364 is a duplicate of this. It should be fixed now. Can you check again. -- nosy: +sbt resolution: - duplicate stage: - committed/rejected status: open - pending superseder: - sysconfig confused by relative paths type: - behavior

[issue15322] sysconfig.get_config_var('srcdir') returns unexpected value

2012-08-13 Thread Richard Oudkerk
Changes by Richard Oudkerk shibt...@gmail.com: -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15322 ___ ___ Python-bugs

[issue15646] multiprocessing can do equivalent of a fork bomb on Windows

2012-08-14 Thread Richard Oudkerk
New submission from Richard Oudkerk: If the if __name__ == '__main__' idiom is not used on Windows you can get the recursive starting of new processes. This is because importing the main module in a child process starts a new child process as a side effect. There is a test intended

[issue15646] multiprocessing can do equivalent of a fork bomb on Windows

2012-08-14 Thread Richard Oudkerk
Changes by Richard Oudkerk shibt...@gmail.com: -- resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15646

[issue15702] Multiprocessing Pool deadlocks on join after empty map operation

2012-08-17 Thread Richard Oudkerk
Changes by Richard Oudkerk shibt...@gmail.com: -- resolution: - duplicate stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15702

[issue15528] Better support for finalization with weakrefs

2012-08-17 Thread Richard Oudkerk
Richard Oudkerk added the comment: Updated patch. -- Added file: http://bugs.python.org/file26879/finalize.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15528

[issue14501] Error initialising BaseManager class with 'authkey' argument of string type.

2012-08-17 Thread Richard Oudkerk
Richard Oudkerk added the comment: I have fixed the documentation and examples to say that authentication keys are byte strings. -- resolution: - fixed stage: needs patch - committed/rejected status: open - closed ___ Python tracker rep

[issue15412] Note in documentation for weakrefs

2012-08-17 Thread Richard Oudkerk
Changes by Richard Oudkerk shibt...@gmail.com: -- resolution: - fixed stage: - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15412

[issue15526] test_startfile crash on Windows 7 AMD64

2012-08-19 Thread Richard Oudkerk
Richard Oudkerk added the comment: I think the reason that it is only this buildbot which fails is that the other Windows buildbots don't use multiple processes. Therefore they don't use a different dir for each test. 4) change os.startfile() to use ShellExecuteEx and use the hProcess

[issue15528] Better support for finalization with weakrefs

2012-08-19 Thread Richard Oudkerk
Richard Oudkerk added the comment: New patch. -- Added file: http://bugs.python.org/file26900/finalize.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15528

[issue15733] PEP 3121, 384 Refactoring applied to winapi module

2012-08-20 Thread Richard Oudkerk
Richard Oudkerk added the comment: I don't see why you made has_CancelIoEx part of the module state. Availability of CancelIoEx only depends on the version of Windows you have, so it will not change if you reload the module. BTW, I think you forgot to delete the has_CancelIoEx global

[issue15733] PEP 3121, 384 Refactoring applied to winapi module

2012-08-20 Thread Richard Oudkerk
Richard Oudkerk added the comment: In addition, I plan to actively drop Windows 2000 support post 3.3, so CancelIO can be presumed to be present. The function at issue is CancelIoEx() (introduced in Vista) not CancelIo(). I assume WinXP will still be supported

[issue15758] 500x speed up for Popen.communicate() on Windows

2012-08-21 Thread Richard Oudkerk
New submission from Richard Oudkerk: Piping significant amounts of data through a subprocess using Popen.communicate() is crazily slow on Windows. The attached program just pushes data through mingw's cat.exe. Python 3.3: amount = 1 MB; time taken = 0.07 secs; rate = 13.51 MB/s amount = 2 MB

[issue15758] 500x speed up for Popen.communicate() on Windows

2012-08-21 Thread Richard Oudkerk
Changes by Richard Oudkerk shibt...@gmail.com: -- keywords: +patch Added file: http://bugs.python.org/file26953/popen_communicate.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15758

[issue13520] Patch to make pickle aware of __qualname__

2012-08-21 Thread Richard Oudkerk
Richard Oudkerk added the comment: There is a cute way to use operator.attrgetter to produce backwards compatible pickles using the qualname: import pickle, copyreg, operator, sys, pickletools, types class AttrGetter(object): def __init__(self, name): self.name = name def

[issue14308] '_DummyThread' object has no attribute '_Thread__block'

2012-04-19 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: I don't think _DummyThread can override __stop(), because of the name mangling of __private methods. However, the hasattr() approach would probably work. Wouldn't a _DummyThread._Thread__stop() method override Thread.__stop()? Like

[issue14369] make __closure__ writable

2012-04-24 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: Shouldn't test___closure__() also test what happens when the closure is replaced with None, or a tuple which is too long or too short or contains non-cell objects? All of these things seem to be checked when you create a new function using

[issue14369] make __closure__ writable

2012-04-24 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: The patch causes crashes. If I define def cell(o): def f(): o return f.__closure__[0] def f(): a = 1 b = 2 def g(): return a + b return g g = f() then I find g.__closure__ = None; g

[issue14666] test_sendall_interrupted hangs on FreeBSD with a zombi multiprocessing thread

2012-04-24 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: This patch adds a ResourceSharer.stop() method. This is called from tearDownClass() in the unittest. -- keywords: +patch Added file: http://bugs.python.org/file25357/mp_resource_sharer_stop.patch

[issue14666] test_sendall_interrupted hangs on FreeBSD with a zombi multiprocessing thread

2012-04-25 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: New version of patch which does signal.pthread_sigmask(signal.SIG_BLOCK, range(1, signal.NSIG)) in the thread (is that right?). It also uses a timeout when trying to join the thread. -- Added file: http://bugs.python.org

[issue14666] test_sendall_interrupted hangs on FreeBSD with a zombi multiprocessing thread

2012-04-25 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: Warning added to patch. -- Added file: http://bugs.python.org/file25362/mp_resource_sharer_stop.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue14666

[issue14369] make __closure__ writable

2012-04-25 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: Version of patch which checks invariants in the setter and adds tests. -- Added file: http://bugs.python.org/file25363/writable_closure_with_checking.patch ___ Python tracker rep

[issue13210] Support Visual Studio 2010

2012-04-26 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: the errno codes (EAGAIN etc) are provided only as a compatibility for posix apps that test errno. On windows, we use the WSA return values from the api functions and WsaGetLastError(). ... So, the proposed patch is not a change

[issue14666] test_sendall_interrupted hangs on FreeBSD with a zombi multiprocessing thread

2012-04-26 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: New patch which adds timeout to ResourceSharer.stop() which defaults to 0. When stop() fails it now uses the logger. pthread_sigmask() only stops this background thread from receiving signals. Signals will still be delivered to other

[issue13210] Support Visual Studio 2010

2012-04-26 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: This doesn't change that, and as far as I know, this has worked and continues to work. errno is supported. Using your patch, does the following throw an AssertionError? import os, errno try: ... os.read(-1, 10) ... except OSError

[issue14669] test_multiprocessing failure on OS X Tiger

2012-04-26 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: I can't work out what is wrong here. The code does not to account for a partial read of the message from the socket. The attached patch fixes that, but it does not address the cause of this failure. -- keywords: +patch Added file

[issue13210] Support Visual Studio 2010

2012-04-27 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: The problems with error numbers seem to be caused by the addition of a new section in errno.h: /* POSIX SUPPLEMENT */ #define EADDRINUSE 100 #define EADDRNOTAVAIL 101 ... #define ETXTBSY 139 #define EWOULDBLOCK 140

[issue13210] Support Visual Studio 2010

2012-04-27 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: According to http://msdn.microsoft.com/en-us/library/5814770t.aspx the supported errno values in VS2010 are E2BIG EACCES EAGAIN EBADF ECHILD EDEADLOCK EDOM EEXIST EILSEQ EINVAL EMFILE ENOENT ENOEXEC ENOMEM ENOSPC ERANGE EXDEV

[issue9400] multiprocessing.pool.AsyncResult.get() messes up exceptions

2012-05-01 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: There are plenty of other bad exception classes apart from CalledProcessError, including TimeoutExpired in the same file. In fact I suspect this is true of the majority of the exception classes in the stdlib which override __init__. So I

[issue9400] multiprocessing.pool.AsyncResult.get() messes up exceptions

2012-05-02 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: I have backported the fix for issue #9244 to 2.7. This should fix the hang and produce a traceback containing a representation of the original error. -- ___ Python tracker rep...@bugs.python.org

[issue14127] add st_*time_ns fields to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds

2012-05-03 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: bba131e48852 causes crashes on Windows. The attached patch fixes the crash and makes test_os pass for me. However, using PyErr_ExceptionMatches(PyExc_RuntimeError) to check whether to try again using narrow strings is ugly. Maybe

[issue14127] add st_*time_ns fields to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds

2012-05-04 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: TBH I don't understand why it should crash, and therefore how your patch helps. Trying again using narrow strings should always work; indeed, the code did that before I touched it. Can you describe how it crashes? The important part

[issue14127] add st_*time_ns fields to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds

2012-05-04 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: Without the check for RuntimeError os.utime(foo, times=(5,5), ns=(5,5)) raises TypeError(TypeError: 'str' does not support the buffer interface) because we have fallen through to the narrow path. The correct error

[issue14127] add st_*time_ns fields to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds

2012-05-04 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: Let me recap, just to make sure I have it straight. There are two errors on Windows: That's right. The patch looks good and passes for me on Windows. -- ___ Python tracker rep

[issue14127] add st_*time_ns fields to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds

2012-05-04 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: There is another problem causing a fatal error in test_posix on Unix. The attached patch fixes it: *ua-path should be decrefed not ua-path. -- Added file: http://bugs.python.org/file25452/utime_read_time_arguments.patch

[issue14127] add st_*time_ns fields to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds

2012-05-04 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: Looks good to me. You're a core contributor, yes? If not let me know and I'll commit it. I will commit. Though I must admit I'm baffled how I haven't seen that crash. I've run the unit tests a zillion times on this patch. Were you

[issue14127] add st_*time_ns fields to os.stat(), add ns keyword to os.*utime*(), os.*utimens*() expects a number of nanoseconds

2012-05-04 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: I'm developing on Linux (64-bit) in case that helps. I tested it on 32 bit Linux. I have committed it, but I forgot to put the issue number in the commit message. -- ___ Python tracker rep

[issue14725] test_multiprocessing failure under Windows

2012-05-05 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: The documentation page for ConnectNamedPipe (http://msdn.microsoft.com/en-us/library/windows/desktop/aa365146(v=vs.85).aspx) has a community addition which says that ConnectNamedPipe will appear to fail with ERROR_NO_DATA (232) if a client

[issue14753] multiprocessing treats negative timeouts differently from before

2012-05-08 Thread Richard Oudkerk
New submission from Richard Oudkerk shibt...@gmail.com: In version 3.2 and earlier, Process.join() and Connection.poll() treat negative timeouts as zero timeouts. (Thread.join() does the same.) In the current 3.3 version, they treat negative timeouts as infinite timeouts. Also

[issue14727] test_multiprocessing failure under Linux

2012-05-08 Thread Richard Oudkerk
Richard Oudkerk shibt...@gmail.com added the comment: I've recently started seeing this failure repeatably on Linux (Ubuntu Jaunty): The test is newly enabled. Does repeatably mean you always get the failure? I have not seen any failures on the Linux buildbots

<    1   2   3   4   5   6   7   8   >