Gregory P. Smith added the comment:
fundamentally: this shouldn't work anyways.
You are calling wait() from a signal handler.
That is a blocking operation.
You cannot do that from a signal handler.
os.waitpid(p.pid, 1) is os.waitpid(p.pid, os.WNOHANG) which is a non-blocking
operation
Changes by Gregory P. Smith :
--
resolution: -> wont fix
status: open -> closed
title: Popen.wait() hangs with SIGINT when os.waitpid() does not ->
Popen.wait() hangs when called from a signal handler when os.waitpid(pid,
os.WNOHANG)
Gregory P. Smith added the comment:
I think it still applies. os.waitpid even in blocking mode could hang at the
whim of the OS. you aren't guaranteed that your child process has died and the
OS is ready to return a status code.
--
___
P
Gregory P. Smith added the comment:
I strongly recommend people use https://pypi.python.org/pypi/subprocess32/
instead of Python 2.7's subprocess module whenever possible.
That said, the fix is pretty easy.
--
assignee: -> gregory
Gregory P. Smith added the comment:
note: this was not a security issue nor was it a crash. an exception was being
raised anyways from the forked child prior to the exec(), this bug just caused
that to be swallowed and this ValueError raised instead.
--
resolution: -> fixed
st
Changes by Gregory P. Smith :
--
nosy: +gregory.p.smith
___
Python tracker
<http://bugs.python.org/issue19251>
___
___
Python-bugs-list mailing list
Unsubscribe:
Gregory P. Smith added the comment:
Overall +1 to this private API. I like the UncheckedGet name better than
FastGet but don't really care what the name is so long as it keeps this
property: It must be non-blocking and safe to call from a signal handler.
Returning NULL in the even
Changes by Gregory P. Smith :
--
resolution: out of date -> fixed
___
Python tracker
<http://bugs.python.org/issue21949>
___
___
Python-bugs-list mai
Gregory P. Smith added the comment:
I'm reopening this and assigning it to benjamin as the 2.7 release manager.
This change is valuable to apply to 2.7.x as well. It is very simple and is a
clear performance improvement for realistic workloads. No API change.
When you profile Pytho
New submission from Gregory P. Smith:
The implementation of string interning uses a dict [1]. It would consume less
memory and be a bit simpler if it used a set.
Identifier strings in a program are interned. If you have a large program with
a lot of code, this makes for a large dictionary
Gregory P. Smith added the comment:
Here's an example patch against 2.7 by nnorwitz that we're currently testing.
--
keywords: +needs review, patch
Added file: http://bugs.python.org/file41863/interned_set_27.diff
___
Python trac
New submission from Robert P Fischer:
Changes to OS X 10.11 render GCC's Objective-C compiler useless. However, I
want to compile the main part of Python in GCC (because my C++ / Fortran Cython
modules use GCC).
I tried to build Python (via MacPorts) using Clang for Objective-C and GC
Robert P Fischer added the comment:
I'm trying to compile the Objective-C portions of Python (the Python
Launcher app) with clang, not GCC. Why does Python insist on using GCC,
even when I set the OBJC env variable to clang? That seems to be a problem
that the Python project CAN fix.
O
Gregory P. Smith added the comment:
Because it was only called from within an "#ifdef __INSURE__" which we weren't
using. I called it an "example" patch for a reason. Updating that function to
deal with the set instead of dict seems wise.
Ironically... a few days
Robert P Fischer added the comment:
> The makefiles use CC throughout and don't look at and OBJC variable. Is
> that variable a standard way to specify an ObjC compiler in makefiles?
I believe that OBJC and OBJCFLAGS are standard for Autoconf/Automake:
https://www.gnu.org/softwa
Robert P Fischer added the comment:
Could this be fixed on 3.5 and 3.6?
On Fri, Feb 12, 2016 at 2:34 PM, Terry J. Reedy
wrote:
>
> Terry J. Reedy added the comment:
>
> 3.4 only gets security fixes
>
> --
> nosy: +terry.reedy
> stage: -> needs patc
Gregory P. Smith added the comment:
As pointed out, this is working as intended and is documented as such. That it
isn't what you want is why Python 3 has html.escape() instead.
--
resolution: -> duplicate
status: open -> closed
superseder: -> cgi.escape C
Gregory P. Smith added the comment:
Python's time.strptime() behavior is consistent with that of glibc 2.19:
=== strptime_c.c ===
#define _XOPEN_SOURCE
#include
#include
#include
#include
int
main(void)
{
struct tm tm;
char buf[255];
memset(&tm, 0, sizeof(
Gregory P. Smith added the comment:
time.strptime() is "working" (not raising an exception) as it appears not to
validate the day of the month when a year is not specified, yet the return
value from either of these APIs is a date which has no concept of an ambiguous
year.
Gregory P. Smith added the comment:
thanks for reporting this!
--
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.org/i
Gregory P. Smith added the comment:
Piping up from the peanut gallery here:
If your use case is not doing release builds for production use, i.e. "casual
use", don't bother with either PGO or LTO. It won't matter.
Your final build that you Q&A ship should absolut
Gregory P. Smith added the comment:
updated patch:
Don't Py_CLEAR the dummy sentinel value in PySet_Fini. The interned set uses
it. Otherwise it causes problems when re-initializing after a Fini as happens
in processes the setup and tear down an embedded interpreter multiple
Gregory P. Smith added the comment:
The space for the strings is a fixed cost, the structure used to store them for
efficient lookup is the only overhead that can be trimmed and is all in one
contiguous allocation.
regardless, i agree, this isn't a large savings. priority low, feel fr
New submission from Gregory P. Smith:
time.localtime(float("NaN")) raises a ValueError on x86_64 using the few
compilers I have tested it with. (this makes sense)
>>> time.localtime(float("NaN"))
Traceback (most recent call last):
File "", line 1, in
New submission from Gregory P. Smith:
Telnet instances should support the context manager protocol so they can be
used in with statements.
>>> import telnetlib
>>> with telnetlib.Telnet('192.168.86.7') as tn:
... pass
...
Traceback (most recent call
Gregory P. Smith added the comment:
hah, i should've tested this in an up to date client. :)
--
___
Python tracker
<http://bugs.python.org/issue26714>
___
___
Gregory P. Smith added the comment:
--with-optimizations seems fine.
As does having the final thing the Makefile prints out when run from a
configuration that did not specify any of --with-pgo, --with-lto,
--with-pydebug, or --with-optimizations be to echo message reminding people to
Gregory P. Smith added the comment:
What i committed for 3.5 and 3.6 matches lto-cpython3-v04.patch which just adds
--with-lto support. 2.7 still needs to be patched.
For reference: Using ubuntu's gcc 5.2.1 i was seeing a 2-3% performance
increase in the resulting LTO binary vs a
New submission from Gregory P. Smith:
When configured using './configure --with-lto' (added in issue25702) and doing
a 'make profile-opt' build, test_distutils fails:
==
FAIL: test_sys
Changes by Gregory P. Smith :
--
dependencies: +test_distutils fails when configured --with-lto
___
Python tracker
<http://bugs.python.org/issue25702>
___
___
New submission from Gregory P. Smith:
cpython/build35.lto$ ./python ../3.5/Lib/test/test_gdb.py
GDB version 7.10:
GNU gdb (Ubuntu 7.10-1ubuntu2) 7.10
...
==
FAIL: test_tuples (__main__.PrettyPrintTests)
Verify the pretty
Changes by Gregory P. Smith :
--
dependencies: +test_gdb fails all tests on a profile-opt build configured
--with-lto
___
Python tracker
<http://bugs.python.org/issue25
Gregory P. Smith added the comment:
CPython should not attempt make a judgement about the safety of a particular
function. We can only document if something has known issues.
We should only include things in the stdlib which are either (a) standard or
(b) widely used regardless of being
Gregory P. Smith added the comment:
Confirm that the CC license is valid/acceptable with Van L. first. That's
why I pointed at the Apache 2 code, already a known good license. :)
On Mon, Apr 18, 2016, 2:51 PM Christian Heimes
wrote:
>
> Christian Heimes added the comment:
>
>
Gregory P. Smith added the comment:
I have wanted bytes/bytearray bit operations (be sure to include the in place
operators for bytearray) when using micropython where it is normal to be
operating on binary data.
that said, i'd need someone from micropython to chime in as to if the
Gregory P. Smith added the comment:
I have no problem just removing the #ifdef as Android API 21 is now old enough
(Lollipop / 5.0) that anyone building Python 3.6 for use on Android is probably
fine with it.
If there is a #define that can be used to test the android api level at compile
Gregory P. Smith added the comment:
Raising an error on duplicates also has precedent:
>>> dict(a=3, b=4, a=5)
File "", line 1
SyntaxError: keyword argument repeated
--
nosy: +gregory.p.smith
___
Python tracker
<http://bugs
Gregory P. Smith added the comment:
I'd there any good reason 2.7 needs this? They are available via pypi as
extensions. (Read: I vote no)
On Sat, May 7, 2016, 3:15 AM Larry Hastings wrote:
>
> Larry Hastings added the comment:
>
> Christian: any interest in proposing this f
Gregory P. Smith added the comment:
FWIW i consider the whole subprocess module doc to be pretty unapproachable and
in need of refactoring. Your suggestions sound like good ones. We should sit
down and make it sane at pycon.
--
nosy: +gregory.p.smith
Gregory P. Smith added the comment:
I'm not against adding a new name if it makes glorious sense, but we should not
remove the old names from unittest as that causes unnecessary pain (based on
past experience).
assertCountEqual does make sense in terms of the "equivalent to" co
Gregory P. Smith added the comment:
assertUnorderedSequenceEqual would make more sense to me given the natural
relation to assertSequenceEqual.
We aren't dealing with sets (though sets are valid sequences) as this method
specifically does not require sequence items to be hashable. Expli
Gregory P. Smith added the comment:
assertSequenceEqualUnordered also works R. David. I was going to suggest that
as well but edited it out to keep my suggestion simpler. :)
I don't like the assertMultisetEqual suggestion as this is most notably an api
having nothing to do with
Changes by Gregory P. Smith :
--
nosy: +gregory.p.smith -gps
___
Python tracker
<http://bugs.python.org/issue27122>
___
___
Python-bugs-list mailing list
Unsub
Gregory P. Smith added the comment:
A side effect of the changes made within are that getstatusoutput() on POSIX
systems now returns a different value for status.
The old implementation present in Python 2 and Python 3.3 before this patch
returned the raw waitpid() status result as the status
Gregory P. Smith added the comment:
http://bugs.python.org/issue23508 to track the fall out of that.
--
___
Python tracker
<http://bugs.python.org/issue10
New submission from Gregory P. Smith:
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
>>> import os, stat
>>> os.stat('/')
posix.stat_result(st_mode=16877, st_ino=2, st_dev=64513L, st_nlink=29,
st_uid=0, st_gid=0, st_size=4096, st_atime=1425341751, st_mtime=1424
Gregory P. Smith added the comment:
I missed that because i was looking for it to be called out under 2.7 os.stat()
docs rather than under 2.7's os.stat_float_times() which is a method nobody is
likely to read the documentation for as floats have been the default since 2.5.
The 2.7 doc
Gregory P. Smith added the comment:
Haha, yes, that description and patch look correct. Thanks!
Fortunately this bug is low impact as this was just a sanity check and the
calling code from subprocess.py was already passing the correct data in.
An ideal regression test: An explicit unittest
Gregory P. Smith added the comment:
I do not object to the removal of the & 0xfff from the stdlib library code
if these functions have actually been fixed to always return unsigned now.
(double check the behavior, and if good, just do it!)
But I think the docs should still mention
Gregory P. Smith added the comment:
This would avoid the need to modify an interpreter to have this optimization.
In this mode the potentially expensive stat() call is avoided. No need to
ensure that the pyc file's embedded timestamp matches the py file's timestamp.
The only u
Gregory P. Smith added the comment:
We already use zipimport for most production deployments. It works well.
We've modified our own zipimport to ignore timestamps as keeping them in sync
between pyc and py files in the zip files own timestamps is painful.
Unfortunately the stdlib zipi
New submission from Gregory P. Smith:
The zipimport module checks the timestamp of a pyc file loaded from the zip
file against the timestamp of a corresponding py file in the zip if any. This
seems pointless. By the time someone has created a zip file for zipimport they
should have
Changes by Gregory P. Smith :
--
nosy: +gregory.p.smith
___
Python tracker
<http://bugs.python.org/issue23731>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Gregory P. Smith :
--
nosy: +gregory.p.smith
___
Python tracker
<http://bugs.python.org/issue23058>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Gregory P. Smith :
--
nosy: +nailor, r.david.murray
versions: +Python 3.4, Python 3.5
___
Python tracker
<http://bugs.python.org/issue23058>
___
___
Gregory P. Smith added the comment:
This is blocking Python auto formatters from working properly on Python 3
syntax code. For example: https://github.com/google/yapf/issues/61
--
assignee: -> gregory.p.smith
nosy: +gregory.p.smith
priority: low ->
Changes by Gregory P. Smith :
--
versions: +Python 2.7
___
Python tracker
<http://bugs.python.org/issue19511>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Gregory P. Smith :
--
versions: -Python 2.7
___
Python tracker
<http://bugs.python.org/issue19511>
___
___
Python-bugs-list mailing list
Unsubscribe:
Gregory P. Smith added the comment:
I'm not going to bother setting up a VM with an esoteric OS in it myself, if
someone knows the past and current state of various OpenBSD versions and what
to do there, feel free to commit OpenBSD conditional compilation bits as you
see fit to make th
Gregory P. Smith added the comment:
You may not be, but I am. :). Jeff is aware of PEP 475.
Thanks for the awesome work on the real cleanup of this stuff in 3.5.
Sanity at last.
--
___
Python tracker
<http://bugs.python.org/issue23
Gregory P. Smith added the comment:
This was fixed in 3.4.1:
https://hg.python.org/cpython/log/094615256a54/Lib/lib2to3/Grammar.txt
i'm leaving this open to update the devguide.
--
___
Python tracker
<http://bugs.python.org/is
Gregory P. Smith added the comment:
i'm moving this to the more recent issue as i like the patch in that one better.
--
superseder: -> Fix EINTR Socket Module issues in 2.7
___
Python tracker
<http://bugs.python.org
Changes by Gregory P. Smith :
--
resolution: -> duplicate
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue20611>
___
___
Python-bugs-
Gregory P. Smith added the comment:
I like the socketmodule.c part of socket_eintr.1.patch, but it appears to still
have the issue haypo describes in https://bugs.python.org/issue20611#msg240194
where connect() cannot be called more than once. The kernel carries on with
the connect without
Changes by Gregory P. Smith :
--
assignee: -> gregory.p.smith
keywords: +needs review
stage: -> patch review
type: -> behavior
___
Python tracker
<http://bugs.python.or
Gregory P. Smith added the comment:
the things left to to before closing this are to rename mswindows and MAXFD as
those shouldn't be exported... and to wait for the windows buildbots to tell me
if i missed adding anything to the intentionally_excluded list in the uni
Gregory P. Smith added the comment:
Done. MAXFD was already gone in 3.5 (yay).
--
assignee: -> gregory.p.smith
resolution: -> fixed
stage: needs patch -> commit review
status: open -> closed
type: -> behavior
versions: +Python
Gregory P. Smith added the comment:
I'm at pycon as well, we can get this taken care of here. :)
--
___
Python tracker
<http://bugs.python.org/issue23342>
___
___
Gregory P. Smith added the comment:
Based on our hallway pow-wow at PyCon 2015 sprints day #1... I audited the
zipfile module to confirm our suspicions about it being "large".
In current Python 3.5 head's zipfile.py module here are the things it depends
directly upon fro
Changes by Gregory P. Smith :
--
resolution: -> rejected
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue17630>
___
___
Python-bugs-
Gregory P. Smith added the comment:
getrlimit() is not an async-signal-safe function according to
http://pubs.opengroup.org/onlinepubs/009695399/functions/xsh_chap02_04.html so
you cannot call it from safe_get_max_fd().
having the getrlimit call done prior to the fork and using the value
Gregory P. Smith added the comment:
Running the https://hg.python.org/benchmarks suite against this change (edited
to not have the warning about PyTupleObject* vs PyObject* types) I see no
repeatably significant benefits and one that is consistently a few percent
slower no matter how many
Changes by Gregory P. Smith :
--
assignee: -> gregory.p.smith
nosy: +gregory.p.smith
___
Python tracker
<http://bugs.python.org/issue9859>
___
___
Python-
Gregory P. Smith added the comment:
fyi - i didn't update the 2.7 docs. just 3.4 and 3.5. if some committer wants
to, feel free.
--
nosy: +gregory.p.smith
___
Python tracker
<http://bugs.python.org/is
Changes by Gregory P. Smith :
--
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue22046>
___
___
Python-bugs-
Gregory P. Smith added the comment:
i used wiggin15's patch to start with. I'm now looking at akuchling's patch
and will incorporate any additional things it adds (I missed that earlier).
--
assignee: docs@python -> gregory.p.smith
nosy
Gregory P. Smith added the comment:
We no longer describe the contents of PyObject in the docs so mentioning
Py_TRACE_REFS does not seem worth it as that just changes Py_HEAD_EXTRA which
adds the doubly linked list to PyObject (today).
Py_TRACE_REFS isn't useful for anyone to know
Gregory P. Smith added the comment:
Thanks! Patch applied. I reworded one doc string slightly and fixed up a few
lines that were longer than 80 characters. Berker's most recent comments are
good ones and can be addressed in another patch.
Laura, can you jump through the
Gregory P. Smith added the comment:
A test has been added as part of issue9859, it is marked with @unittest.skip as
the API surface does not yet match.
--
nosy: +gregory.p.smith
___
Python tracker
<http://bugs.python.org/issue9
Changes by Gregory P. Smith :
--
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue9859>
___
___
Python-bugs-list
Gregory P. Smith added the comment:
yeah, that's fine. just surround the call to getrlimit with appropriate
openbsd ifdef's and a comment. it is _probably_ async signal safe given the
nature of the function in most implementations even though it isn't on the
official posix li
Changes by Gregory P. Smith :
--
assignee: -> gregory.p.smith
___
Python tracker
<http://bugs.python.org/issue9858>
___
___
Python-bugs-list mailing list
Un
Gregory P. Smith added the comment:
thanks! i'll close this later after some buildbot runs and any post-commit
reviews.
--
stage: patch review -> commit review
___
Python tracker
<http://bugs.python.org
Gregory P. Smith added the comment:
I think this was just overlooked when implementing argparse. Most code out
there is likely to get the executable name using:
os.path.basename(sys.argv[0])
Which is going to do exactly what you are seeing here when sys.argv[0] ends
with a /.
feel free to
Gregory P. Smith added the comment:
nice and simple. that wording looks good to me.
--
nosy: +gregory.p.smith
___
Python tracker
<http://bugs.python.org/issue23
Gregory P. Smith added the comment:
Won't we always consume the memory thanks to a memset(newtable, 0, ...)
https://hg.python.org/cpython/file/df28044b7e14/Objects/dictobject.c#l654 ?
(also, i'm not sure if Windows is allocates mapped pages on demand as posix
systems tend to)
-
Gregory P. Smith added the comment:
fwiw, as for 2.7 i personally don't think I would change its behavior around
this at this point. make sure 3.5+ do something desirable. (my link to
dictobject.c above is from 2.7)
--
___
Python tracker
Gregory P. Smith added the comment:
I wouldn't make an efficiency argument against it without trying it and
showing reproducible degradation in the hg.python.org/benchmarks suite.
On Sun, Apr 19, 2015, 10:31 PM Serhiy Storchaka
wrote:
>
> Serhiy Storchaka added the comment:
>
Gregory P. Smith added the comment:
... Code review:
In socket_eintr.5.patch I don't think the thread safety concerns about the
s.settimeout() calls being done from Python code should be an issue but I'll
ponder that for a bit. When you've got a socket s, why would code e
Gregory P. Smith added the comment:
diverging discussion: Go re-read the documentation on os.times(). It is
plural, it isn't just CPU time. (on POSIX os.times()[4] is likely to be the
system uptime in seconds as a float... it cannot be changed like the absolute
clock can, it is a rel
Changes by Gregory P. Smith :
--
nosy: +gregory.p.smith
versions: +Python 3.5 -Python 3.4
___
Python tracker
<http://bugs.python.org/issue11477>
___
___
Python-bug
Gregory P. Smith added the comment:
bytes.hex-1.diff looks good, i'll take care of committing this and adding a
what's new entry. thanks!
--
assignee: ncoghlan -> gregory.p.smith
nosy: +gregory.p.smith
___
Python tracker
<http:/
Changes by Gregory P. Smith :
--
resolution: -> fixed
stage: patch review -> commit review
status: open -> closed
___
Python tracker
<http://bugs.python.o
Gregory P. Smith added the comment:
note quite fixed, looks like some of the buildbots are having fun not compiling
with this change:
http://buildbot.python.org/all/builders/x86%20Tiger%203.x/builds/9569/steps/compile/logs/stdio
investigating...
--
resolution: fixed ->
sta
Gregory P. Smith added the comment:
i missed the hg adds :)
--
___
Python tracker
<http://bugs.python.org/issue9951>
___
___
Python-bugs-list mailing list
Unsub
Gregory P. Smith added the comment:
I see some _Py_strhex related link errors on the Windows buildbots:
http://buildbot.python.org/all/builders/x86%20Windows7%203.x/builds/9642/steps/compile/logs/stdio
--
___
Python tracker
<http://bugs.python.
Changes by Gregory P. Smith :
--
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue9951>
___
___
Python-bugs-list
Changes by Gregory P. Smith :
--
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue23342>
___
___
Python-bugs-
Gregory P. Smith added the comment:
This seems somewhat related to the "We need to document Python's concurrency
and memory model" that came out at the language summit this year.
--
nosy: +gregory.p.smith
___
Python tracker
<http
Changes by Gregory P. Smith :
--
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue23852>
___
___
Python-bugs-
3301 - 3400 of 3457 matches
Mail list logo