Richard Oudkerk added the comment:
Actually, I am not so sure it is the isolate plugin. But I do think that
sys.modules is being manipulated somewhere before shutdown.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15881
Richard Oudkerk added the comment:
Actually it is test.with_project_on_sys_path() in setuptools/commands/test.py
that does the save/restore of sys.modules. See
http://www.eby-sarna.com/pipermail/peak/2010-May/003357.html
--
___
Python tracker
Changes by Richard Oudkerk shibt...@gmail.com:
--
nosy: +sbt
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15881
___
___
Python-bugs-list mailing
Richard Oudkerk added the comment:
If sysconfig._generate_posix_vars() creates the build directory and
pybuilddir.txt (instead of setup.py) then it could write _sysconfigdata.py in
the correct place. Then setup.py would not have to mess with its own sys.path.
One issue with having
Richard Oudkerk added the comment:
Alternative patch.
--
Added file: http://bugs.python.org/file27122/alt_sysconfigdata.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15298
Richard Oudkerk added the comment:
builddir should have added
+(-pydebug if hasattr(sys, gettotalrefcount) else )
Oops, yes.
the installation installs this to the lib-dynload directory, which
maybe is not desired.
The lines
+ -rm $(DESTDIR)$(DESTSHARED)/_sysconfigdata.py
Richard Oudkerk added the comment:
Updated patch.
--
Added file: http://bugs.python.org/file27125/alt_sysconfigdata.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15298
Changes by Richard Oudkerk shibt...@gmail.com:
Removed file: http://bugs.python.org/file27125/alt_sysconfigdata.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15298
Richard Oudkerk added the comment:
Try again.
--
Added file: http://bugs.python.org/file27126/alt_sysconfigdata.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15298
Changes by Richard Oudkerk shibt...@gmail.com:
Added file: http://bugs.python.org/file27127/alt_sysconfigdata.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15298
Changes by Richard Oudkerk shibt...@gmail.com:
Removed file: http://bugs.python.org/file27126/alt_sysconfigdata.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15298
Changes by Richard Oudkerk shibt...@gmail.com:
Removed file: http://bugs.python.org/file27122/alt_sysconfigdata.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15298
Richard Oudkerk added the comment:
Richard: what was your use case?
Building on the main host and a VM without having to commit and synchronize
temporary changes. (The VM has read-only access to the host's repositories).
What steps did you take that resulted in getting typeslots.inc
Richard Oudkerk added the comment:
Why is that? python will work just fine if it can't write pyc files.
When I hacked around the _sysconfigdata.py issue, running the created python
produced
Fatal Python error: Py_Initialize: Unable to get the locale encoding
Traceback (most recent call last
Richard Oudkerk added the comment:
It looks like the code which writes the byte-compiled codes checks for and
ignores PermissionError (EACCES, EPERM) and FileExistsError (EEXIST).
However, for me it is EIO which is raised.
--
___
Python tracker rep
New submission from Richard Oudkerk:
As discussed in
http://bugs.python.org/issue15819
trying to run python built outside a read-only source directory fails for me
because OSError(EIO, ...) is raised when importlib tries to write the byte
compiled file. (I built python in a Linux VM
Richard Oudkerk added the comment:
I have opened a new issue:
http://bugs.python.org/issue15833
It is a regression because in Python 3.2 all failures to open the file for
writing were supressed.
But as I said: I'd also be fine with declaring this VM software
unsupported. If this work
Changes by Richard Oudkerk shibt...@gmail.com:
--
nosy: +sbt
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15818
___
___
Python-bugs-list mailing
Richard Oudkerk added the comment:
Would it simplify matters to stop treating 0,1,2 specially and just add them to
pass_fds instead?
--
nosy: +sbt
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15798
Richard Oudkerk added the comment:
I tried building from out-of-tree with a read-only srcdir, but I found two
other files which the build process tries to create in the source directory:
$(srcdir)/Objects/typeslots.inc
$(srcdir)/Lib/_sysconfigdata.py
--
nosy: +sbt
Richard Oudkerk added the comment:
The changeset is 2e587b9bae35.
Georg, could you copy it to your release branch please.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15784
New submission from Richard Oudkerk:
When inspect.getframeinfo() tries to collect lines of context it never shows
the first line (unless context is as big as the number of lines in the file).
The relevant code is
start = lineno - 1 - context//2
try:
lines, lnum
Richard Oudkerk added the comment:
Well, Error and Errno are rather hard to distinguish
Embarrassingly, I did not even notice the was a difference.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15784
New submission from Richard Oudkerk:
Since WindowsError became an alias of OSError, the error number shown in the
stringification of an OSError err can either be a windows error code
(err.winerror) or a posix style error number (err.errno), with no way to tell
which.
For instance
Changes by Richard Oudkerk shibt...@gmail.com:
Added file: http://bugs.python.org/file27002/winerror.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15784
Changes by Richard Oudkerk shibt...@gmail.com:
Removed file: http://bugs.python.org/file27001/winerror.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15784
Richard Oudkerk added the comment:
After playing with the patch on Linux it seems that Linux much prefers the
realloc() scheme to the list-of-chunks scheme.
This new patch only does list-of-chunks on Windows.
--
Added file: http://bugs.python.org/file26985/readall-combined.patch
Richard Oudkerk added the comment:
Attached is an alternative benchmark program which does not use subprocess.
--
Added file: http://bugs.python.org/file26986/readall-benchmark.py
___
Python tracker rep...@bugs.python.org
http://bugs.python.org
Changes by Richard Oudkerk shibt...@gmail.com:
Removed file: http://bugs.python.org/file26952/push-thru-cat.py
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15758
Changes by Richard Oudkerk shibt...@gmail.com:
Removed file: http://bugs.python.org/file26970/readall-combined.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15758
Richard Oudkerk added the comment:
What about the method call overhead in RawIO.readall(), and the
different progression of buffer sizes? (the realloc scheme uses larger
and larger read() sizes, while RawIO.readall() uses a constant read()
size).
For this benchmark the call overhead does
Changes by Richard Oudkerk shibt...@gmail.com:
Removed file: http://bugs.python.org/file26953/popen_communicate.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15758
Changes by Richard Oudkerk shibt...@gmail.com:
Removed file: http://bugs.python.org/file26960/readall-chunks.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15758
Changes by Richard Oudkerk shibt...@gmail.com:
Removed file: http://bugs.python.org/file26959/readall-resize.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15758
Changes by Richard Oudkerk shibt...@gmail.com:
Removed file: http://bugs.python.org/file26963/readall-combined.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15758
Richard Oudkerk added the comment:
Here is the patch (with the old ones removed).
Note that the old code mishandled the case where _PyBytes_Resize() failed by
assuming that the old bytes object would still be valid.
I have assumed that stream psuedo-files will never claim to have a size
Richard Oudkerk added the comment:
In each loop before calling read() the buffer size is recalculated based on the
amount of space used, causing a realloc *regardless* of how much empty space is
left in the buffer. And each read is only producing a smallish chunk (5120
bytes).
So assuming
Richard Oudkerk added the comment:
The attached patch (readall-resize.patch) makes the resizes only happen when
the buffer is full. It produces
amount = 1 MB; time taken = 0.02 secs; rate = 64.10 MB/s
amount = 2 MB; time taken = 0.03 secs; rate = 64.10 MB/s
amount = 4 MB; time taken = 0.06
Richard Oudkerk added the comment:
Alternative patch (readall-chunks.patch) which delegates to RawIOBase.readall()
if the file cannot be stat-ed or appears to have size zero.
amount = 1 MB; time taken = 0.02 secs; rate = 64.10 MB/s
amount = 2 MB; time taken = 0.02 secs; rate = 128.21 MB/s
Richard Oudkerk added the comment:
It seems we could do both (fix the resizing logic, and fallback on
chunks if the size is unknown).
Combined patch attached.
--
Added file: http://bugs.python.org/file26963/readall-combined.patch
___
Python
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
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
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
Richard Oudkerk added the comment:
RawIOBase.readall() does the sensible thing already. Maybe FileIO should be
allowed to inherit it.
The alternative patch (which probably only works for raw unbuffered case)
diff -r ca54c27a9045 Lib/subprocess.py
--- a/Lib/subprocess.py Tue Aug 21 14:54:22
Richard Oudkerk added the comment:
FileIO.readall() already has an overallocation mechanism which should
yield linear complexity. Perhaps it needs to be tweaked a bit?
(look at new_buffersize in Modules/_io/fileio.c)
I think it needs a bit more than a tweak;-) Looks like it increases
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
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
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
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
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
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
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
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
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
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
Changes by Richard Oudkerk shibt...@gmail.com:
--
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15364
___
___
Python-bugs
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
Changes by Richard Oudkerk shibt...@gmail.com:
--
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15322
___
___
Python-bugs
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
Changes by Richard Oudkerk shibt...@gmail.com:
--
nosy: +sbt
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14501
___
___
Python-bugs-list mailing
Changes by Richard Oudkerk shibt...@gmail.com:
--
nosy: +sbt
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6056
___
___
Python-bugs-list mailing
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
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
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
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
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
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
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
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
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
501 - 600 of 736 matches
Mail list logo