Vinay Sajip vinay_sa...@yahoo.co.uk added the comment:
Bill,
Thanks for the suggestion and the patch. It's a good idea, though I wonder
whether you found that the bulk of the time spent in isEnabledFor() was
actually spent in getEffectiveLevel()? That's the one which loops through a
logger's
Filip Gruszczyński grusz...@gmail.com added the comment:
Here is a small patch. Could you advise me, how can I test it now? Or is it an
issue, that doesn't require writing new tests?
--
keywords: +patch
Added file: http://bugs.python.org/file20970/8841.patch
Vinay Sajip vinay_sa...@yahoo.co.uk added the comment:
Closing, as I said I would, since no feedback has been received for a week.
--
components: +Library (Lib) -Extension Modules
status: pending - closed
___
Python tracker rep...@bugs.python.org
New submission from John Szakmeister j...@szakmeister.net:
This is a port of r301 from unladen swallow to the py3k-jit branch.
On the Mac, there was an extra '-framework CoreFoundation' that was being
passed in python3 (maybe it wasn't there in Python 2.x?). At any rate, I
changed the logic
Éric Araujo mer...@netwok.org added the comment:
I suggested subclassing to solve the more general problem of the
caller being able to tell one getopt error from another, for which it
is a pretty common solution.
Now I see what you meant and understand your request. optparse has five
New submission from Filip Gruszczyński grusz...@gmail.com:
In http://bugs.python.org/issue8841 Eric asked to open a new ticket about
localisation of getopt error messages. I attach a patch.
--
files: 8841.patch
keywords: patch
messages: 129865
nosy: eric.araujo, gruszczy
priority:
Filip Gruszczyński grusz...@gmail.com added the comment:
Here it is: http://bugs.python.org/issue11371
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue8841
___
Ram Rachum cool...@cool-rr.com added the comment:
Amaury:
Your example succeeds on Linux but fails on Windows:
$ python3.2 main.py
CALLED
Traceback (most recent call last):
File C:\Python32\Lib\pickle.py, line 679, in save_global
klass =
Antoine Pitrou pit...@free.fr added the comment:
Amaury:
Your example succeeds on Linux but fails on Windows:
$ python3.2 main.py
I think the difference has to do with Python 3 vs. Python 2.
In Python 3 unbound methods are not wrapped in a specific object, and so
ForkingPickler
Éric Araujo mer...@netwok.org added the comment:
Sorry for overlooking this. The test is good, I could trigger the bug with it
and then fix it with the patch.
Would you mind adding the same test for upload_docs? The code was originally
copied from upload, so we should test it too.
Philip:
Michal Nowikowski godf...@gmail.com added the comment:
Improved the patch:
- moved code example up, just below S_* functions list
--
Added file: http://bugs.python.org/file20973/documented-os_chflags-flags-v2.diff
___
Python tracker
Éric Araujo mer...@netwok.org added the comment:
Thanks for the report. What ./configure options did you use? I wonder if this
is a duplicate of #11171 or #10086.
--
nosy: +eric.araujo
___
Python tracker rep...@bugs.python.org
Filip Gruszczyński grusz...@gmail.com added the comment:
Yes, I have run
./python -m test -v test_getopt
and it was ok.
Running
xgettext --from-code utf-8 getopt.py
produces no output.
--
___
Python tracker rep...@bugs.python.org
Éric Araujo mer...@netwok.org added the comment:
I will wait for any negative feedback from another core dev and then commit
this. Thanks.
--
assignee: - eric.araujo
resolution: - accepted
status: open - pending
___
Python tracker
John Szakmeister j...@szakmeister.net added the comment:
Looks like this should've been done against the py3k branch instead. Looking
at py3k, it's changed quite a bit since the last merge into py3k-jit.
Perhaps there is a better way to do this under py3k? Or it's handled already?
New submission from Ross Lagerwall rosslagerw...@gmail.com:
As the title says, this patch replaces xrange with range for the 3.3 docs.
--
assignee: docs@python
components: Documentation
files: doc.patch
keywords: patch
messages: 129876
nosy: docs@python, rosslagerwall
priority: normal
Filip Gruszczyński grusz...@gmail.com added the comment:
Cool, thanks for all your advice.
--
status: pending - open
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11371
___
STINNER Victor victor.stin...@haypocalc.com added the comment:
subprocess_errpipe_buffer.patch: Patch for 2.7 which improve by 30% the dummy
benchmark (run /bin/false 10,000 times). It avoids the creation of the 1 MB
buffer: start with a buffer of a single byte (just to check if there is data
Antoine Pitrou pit...@free.fr added the comment:
subprocess_errpipe_buffer.patch: Patch for 2.7 which improve by 30%
the dummy benchmark (run /bin/false 10,000 times). It avoids the
creation of the 1 MB buffer: start with a buffer of a single byte
(just to check if there is data or if the
STINNER Victor victor.stin...@haypocalc.com added the comment:
Quick benchmark:
- fork(), execv(), waitpid(): 19081.1 ms
- os.popen(): 25769.8 ms
- subprocess.Popen(): 40025.8 ms
- subprocess.Popen() patched: 26155.2 ms
I tested Python 2.7 (debug build) on Linux (Debian Sid) with a Pentium
Antoine Pitrou pit...@free.fr added the comment:
Victor, your patch doesn't even apply on 3.x. That code doesn't exist anymore...
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11314
___
Amaury Forgeot d'Arc amaur...@gmail.com added the comment:
OK, let's go back to the __namespace__ idea, then.
A long time ago I had the idea that the ast compiler could remember the list of
named blocks (classes, functions) with their line numbers;
for example, the statement class C spans
Antoine Pitrou pit...@free.fr added the comment:
Benchmark under 3.x (without obsolete patch):
- fork + execv + waitpid: 4794.4 ms
- os.popen: 19792.9 ms
- subprocess.popen: 10152.1 ms
Benchmark under 2.x (without patch:)
- fork + execv + waitpid: 4292.7 ms
- os.popen: 12697.6 ms
-
Antoine Pitrou pit...@free.fr added the comment:
Here is a quick profile under 3.x:
Time: 10178.0 ms
320812 function calls (320809 primitive calls) in 10.182 seconds
Ordered by: internal time
ncalls tottime percall cumtime percall filename:lineno(function)
1
Antoine Pitrou pit...@free.fr added the comment:
Interestingly, reducing from the max open file descriptors from 8192 (my
default) to 512 halves the runtime and solves the regression:
$ ulimit -n
512
$ ./python bench_subprocess.py
pid: 31631
Time: 4903.8 ms
So, even though implemented in C,
New submission from Boštjan Mejak bostjan.me...@gmail.com:
Try to fix this in every Python documentation that you can.
The typo was found here: http://docs.python.org/library/stdtypes.html#memoryview
Create a memoryview that references obj. obj must support the buffer protocol.
Builtin
STINNER Victor victor.stin...@haypocalc.com added the comment:
pitrou Victor, your patch doesn't even apply on 3.x.
pitrou That code doesn't exist anymore...
subprocess.Popen() does still read errpipe_read, but using a buffer of 50,000
bytes instead of 1 MB (the traceback is not more send to
STINNER Victor victor.stin...@haypocalc.com added the comment:
os.popen is 41% is slower than subprocess: I suppose that it
is the usage of stdout=PIPE (creation of the pipe) which make
it slower
Oh no, it's because os.popen() calls subprocess.Popen() with shell=True: the
overhead is the
Charles-Francois Natali neolo...@free.fr added the comment:
pitrou I think your analysis is wrong. These mmap() calls are for
pitrou anonymous memory, most likely they are emitted by the libc's
pitrou malloc() to get some memory from the kernel. In other words
pitrou they will be blazingly
Charles-Francois Natali neolo...@free.fr added the comment:
So, even though implemented in C, the file descriptor closing logic is still
quite costly!
Yes, see this recent issue: http://bugs.python.org/issue11284
In the reporter's case, it's much worse, because FreeBSD (at least the version
STINNER Victor victor.stin...@haypocalc.com added the comment:
As written by Charles-Francois Natali (msg129890), we can use closefrom().
Pseudo-code: find the biggest fd than that be kept open, call
closefrom(highest+1), and then use close() (os.closerange) for fd in 0..highest
that have to
Antoine Pitrou pit...@free.fr added the comment:
The patch is wrong, as explained by Charles-François.
If someone wants subprocess to use closefrom(), a patch is required :)
But I think at least a mention in the documentation is warranted.
--
nosy: +gregory.p.smith, pitrou
priority:
STINNER Victor victor.stin...@haypocalc.com added the comment:
Benchmark on subprocess with a less trivial example. Run 100x python -c pass:
8.63 sec without my patch, 8.53 sec with my patch = only 1% faster, so the
patch is just useless on a real world example.
Finally, I think that there is
STINNER Victor victor.stin...@haypocalc.com added the comment:
Benchmark extracted from #11314, Python 3.2 on Linux: subprocess(/bin/false,
close_fds=True) is 22% slower than subprocess(/bin/false, close_fds=False).
--
stage: - patch review
___
anatoly techtonik techto...@gmail.com added the comment:
That's not a good reason to close report. Such limitations of
xml.etree.ElementTree should be at least documented properlt. And even
documented it is still a valid feature request for standard library. Not for
current implementation,
New submission from Alexandre Badez alexandre.ba...@gmail.com:
extend_path only test if init.py files exist, but it should also test
init.pyc and/or init.pyo.
--
components: Library (Lib)
messages: 129896
nosy: Alexandre.Badez
priority: normal
severity: normal
status: open
title:
Changes by Alexandre Badez alexandre.ba...@gmail.com:
--
type: - behavior
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11374
___
___
Amaury Forgeot d'Arc amaur...@gmail.com added the comment:
Anatoly, do you find the suggestions in
http://effbot.org/zone/element.htm#accessing-parents useful to you? If so,
this paragraph could be copied into the documentation.
--
nosy: +amaury.forgeotdarc
Alexandre Badez alexandre.ba...@gmail.com added the comment:
I've made a simple patch.
--
keywords: +patch
Added file: http://bugs.python.org/file20977/patch.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11374
New submission from OJW owh...@yahoo.com:
#!/usr/bin/python
import socks
import socket
socks.setdefaultproxy(socks.PROXY_TYPE_SOCKS4, 127.0.0.1, 9050, True)
socket.socket = socks.socksocket
import urllib2
print urllib2.urlopen(http://example.com/;).read()
Expected result: all network
Changes by Alexandre Badez alexandre.ba...@gmail.com:
Removed file: http://bugs.python.org/file20977/patch.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11374
___
Alexandre Badez alexandre.ba...@gmail.com added the comment:
A little change in the patch
--
Added file: http://bugs.python.org/file20978/patch.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11374
Changes by Jérôme Radix jerome.ra...@gmail.com:
--
nosy: +jerome.radix
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11375
___
___
Martin v. Löwis mar...@v.loewis.de added the comment:
Éric, what forward porting exactly needs to be done?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9313
___
Charles-Francois Natali neolo...@free.fr added the comment:
Attached is a patch adding os.closefrom.
If closefrom(2) is available, it's used.
Otherwise, two options:
- if sysconf and _SC_OPEN_MAX are defined, we close each file descriptor up to
_SC_OPEN_MAX
- if not, we choose a default value
Changes by Senthil Kumaran orsent...@gmail.com:
--
assignee: - orsenthil
nosy: +orsenthil
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11375
___
New submission from Dave Abrahams d...@boostpro.com:
http://twistedmatrix.com/trac/ticket/4916#comment:2 suggests that maybe there's
a bug in distutils. Something in the build process for twisted is deciding
that I have Sun CC installed instead of letting pycc, which can handle the job
of
Changes by Filip Gruszczyński grusz...@gmail.com:
--
nosy: +gruszczy
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue1559549
___
___
Changes by Charles-Francois Natali neolo...@free.fr:
Removed file: http://bugs.python.org/file20979/py3k_closefrom.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11284
___
Changes by Charles-Francois Natali neolo...@free.fr:
Added file: http://bugs.python.org/file20980/py3k_closefrom.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11284
___
Charles-Francois Natali neolo...@free.fr added the comment:
Attached is a new version falling back to /proc/self/fd when closefrom(2) is
not available (on Unix), working on Linux.
It's indeed much faster than the current approach.
Note that it's only used if _posixsubprocess is not available,
Changes by s7v7nislands s7v7nisla...@gmail.com:
Removed file: http://bugs.python.org/file20834/py3k.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11284
___
Changes by s7v7nislands s7v7nisla...@gmail.com:
Removed file: http://bugs.python.org/file20835/python27.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11284
___
New submission from STINNER Victor victor.stin...@haypocalc.com:
Extract of the documentation:
15.14.3.1. Win95/98 specific
platform.popen(cmd, mode='r', bufsize=None)
Portable popen() interface. Find a working popen implementation preferring
win32pipe.popen(). On Windows NT,
New submission from Alessandro Forghieri a...@orion.it:
Observed behavior:
os.path.join('/foo/bar', '/baz')
'/baz'
Expected behavior:
should return '/foo/bar/baz' or (suboptimally) raise an exception.
Why:
Observed beahvior violates the minimal surprise principle and does not appear
to
Marc-Andre Lemburg m...@egenix.com added the comment:
STINNER Victor wrote:
New submission from STINNER Victor victor.stin...@haypocalc.com:
Extract of the documentation:
15.14.3.1. Win95/98 specific
platform.popen(cmd, mode='r', bufsize=None)
Portable popen() interface. Find
Changes by Alessandro Forghieri a...@orion.it:
--
title: os.path.join when second starts with '/' (linux/unix) - os.path.join
when second argument starts with '/' (linux/unix)
___
Python tracker rep...@bugs.python.org
Daniel Urban urban.dani...@gmail.com added the comment:
It does exactly what is documented: If any component is an absolute path, all
previous components (on Windows, including the previous drive letter, if there
was one) are thrown away, and joining continues.
Amaury Forgeot d'Arc amaur...@gmail.com added the comment:
And the current behaviour is useful; for example, the absolute path of a file
name can be computed with os.path.join(os.getcwd(), filename).
This works with both absolute and relative paths.
os.path.join() won't change; you probably
Max m...@alleged.net added the comment:
This is still occurring with the release version of Python 3.2, installed from
the 32-bit MSI, on Windows XP.
--
nosy: +max-alleged
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10654
Alessandro Forghieri a...@orion.it added the comment:
Documented it is, and change it may not, but I am still unconvinced.
Anything that joins should (IMHO) preserve the leading stuff - this one
throws it away - sometimes. Also I do believe a number of other languages take
a different stance
Changes by Charles-Francois Natali neolo...@free.fr:
Removed file: http://bugs.python.org/file20980/py3k_closefrom.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11284
___
Gregory P. Smith g...@krypto.org added the comment:
There is no OS API call to provide a *safe* way to get a list of all open file
descriptors as part of POSIX in general that can be called after the fork() and
before the exec(). It must be async signal safe. The closefrom() call
available
Gregory P. Smith g...@krypto.org added the comment:
According to http://www.unix.com/man-page/All/3c/closefrom/ closefrom() is not
async-signal-safe. :(
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11284
New submission from Stefan Behnel sco...@users.sourceforge.net:
http://docs.python.org/library/xml.dom.minidom.html
presents MiniDOM as a Lightweight DOM implementation. The word lightweight
is easily misunderstood as meaning efficient or memory friendly. MiniDOM is
well known to be neither
Eric Smith e...@trueblade.com added the comment:
I appreciate that you're unconvinced of its usefulness, but you can be assured
that some of us do find it a useful and desirable behavior. And Python isn't
the only system that works this way, emacs does the same thing when you enter
filenames.
Charles-Francois Natali neolo...@free.fr added the comment:
Your posix_closefrom() implementation as written today is not safe to call
between fork() and exec() due to the opendir/readdir implementation. It can
and will hang processes at unexpected times.
Yeah, I remove the patch when I
Changes by Wojciech Muła wojciech_m...@poczta.onet.pl:
Removed file: http://bugs.python.org/file20948/test.py
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11354
___
Wojciech Muła wojciech_m...@poczta.onet.pl added the comment:
Daniel, thanks for note, fixed.
--
Added file: http://bugs.python.org/file20981/test.py
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11354
Changes by SilentGhost ghost@gmail.com:
--
nosy: +bethard
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11354
___
___
Python-bugs-list mailing
Martin v. Löwis mar...@v.loewis.de added the comment:
-1. The description is factually correct - minidom *does* have a lower
footprint than other Python DOM implementations (such as 4DOM).
--
nosy: +loewis
___
Python tracker rep...@bugs.python.org
Aaron Sherman a...@ajs.com added the comment:
I think it's still safe to say that high performance applications which need to
create many hundreds or thousands of children (e.g. large monitoring systems)
will still need another solution that isn't subprocess. That being said, you're
right
Antoine Pitrou pit...@free.fr added the comment:
That being said, I can't really submit a full-blown monitoring system
against this bug,
Perhaps you can take a look at Shinken, it is a Nagios-lookalike written
in Python.
--
___
Python tracker
STINNER Victor victor.stin...@haypocalc.com added the comment:
os.popen() is deprecated since Python 2.6 (Use the subprocess module.) and it
is no more documented in Python 3. The following documentation explains how to
replace os.popen() by subprocess:
Marc-Andre Lemburg m...@egenix.com added the comment:
STINNER Victor wrote:
STINNER Victor victor.stin...@haypocalc.com added the comment:
os.popen() is deprecated since Python 2.6 (Use the subprocess module.) and
it is no more documented in Python 3. The following documentation explains
Marc-Andre Lemburg m...@egenix.com added the comment:
BTW: The _popen class can be removed as well, if the function
is replaced with os.popen() or the subprocess module Popen().
--
___
Python tracker rep...@bugs.python.org
Benjamin Peterson benja...@python.org added the comment:
r88712 Thanks
--
nosy: +benjamin.peterson
resolution: - accepted
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9373
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
Is there a way to test this?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11335
___
Antoine Pitrou pit...@free.fr added the comment:
Valgrind perhaps?
If the keys container was a list or tuple it would simply take a refleak run
of the test suite.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11335
Daniel Stutzbach stutzb...@google.com added the comment:
I'm not sure. What infrastructure do we have to leaked memory that was
allocated with PyMem_MALLOC?
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11335
Daniel Stutzbach stutzb...@google.com added the comment:
I meant to *detect* leaked memory, of course. :-)
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue11335
___
Daniel Stutzbach stutzb...@google.com added the comment:
I played around with this a little. That code path doesn't appear to be
exercised during the existing unit tests. I'll add a test so the leak at least
shows up when the tests are run under valgrind.
--
New submission from ulidtko ulid...@gmail.com:
The following script fails:
from time import sleep
try:
while True:
sleep(0.1)
print blah
except KeyboardInterrupt:
pass
when being launched with redirections like this:
$ python test.py | tee /dev/null
and the tee
Ray.Allen ysj@gmail.com added the comment:
Hi, haypo, would you mind modify your newly added parse_format_flags() function
so that it can diff the precision value of '%.0s' and '%s'(Currently both of
them return precision as 0)? Because if used with string formatters(%s, %R, %S,
%A, ...),
Fred L. Drake, Jr. fdr...@acm.org added the comment:
Committed for Python 3.3.0: r88717
Committed for Python 3.2.1: r88718
--
assignee: docs@python - fdrake
nosy: +fdrake
resolution: - accepted
stage: - committed/rejected
status: open - closed
versions: +Python 3.2
New submission from Abafei aba...@gmail.com:
I'm not sure if this is a bug per se, since I don't think pretending operators
are callable is in the docs, but:
pretending an operator (at least the not operator) is callable, like so:
not(True)
can be surprising:
(not 1) == 9
False
not(1) == 9
Stefan Behnel sco...@users.sourceforge.net added the comment:
Well, I'm not aware of many people who use 4DOM these days, and if that's what
it's meant to refer to, maybe that should be made more obvious, because it
currently is not at all. Even cDomlette uses only half of the memory according
Georg Brandl ge...@python.org added the comment:
I don't think this is wise, or necessary.
I'm not sure why you would treat an operator as callable; the tutorial
hopefully doesn't tell you such things.
--
nosy: +georg.brandl
resolution: - rejected
status: open - closed
88 matches
Mail list logo