Gregory P. Smith added the comment:
we'll need a test case .pyc where this happens.
--
___
Python tracker
<http://bugs.python.org/issue25083>
___
___
Pytho
Gregory P. Smith added the comment:
Inspecting the 2.7 code:
https://hg.python.org/cpython/file/2.7/Python/import.c#l761
following that down to
https://hg.python.org/cpython/file/2.7/Python/marshal.c#l1126
it looks like it does the right thing on EOF error (from either getc or from
fread
Changes by Gregory P. Smith :
--
nosy: +gregory.p.smith
___
Python tracker
<http://bugs.python.org/issue25106>
___
___
Python-bugs-list mailing list
Unsubscribe:
Gregory P. Smith added the comment:
attaching an updated patch.
fwiw, in my own quick tests i'm not seeing a performance difference on the
benchmark suite. but i am not trying to run it in such an isolated quiet
machine locked freq. environment.
it is still a good idea regardless. _
Gregory P. Smith added the comment:
Testing this on a host with a fixed frequency and mostx background tasks
disabled I cannot reproduce the speedups you list. I see no significant change
on most of them and a 6% slowdown on json_load and a 1-4% slowdown on regex_v8
(not sure if those are in
New submission from Gregory P. Smith:
https://docs.python.org/3/c-api/structures.html#c.PyMemberDef
T_STRING members are turned into str objects in Python. The documentation
needs updating to mention which codec the char * bytes are treated as.
Solving this issue involves code inspection and
Gregory P. Smith added the comment:
I applied the same _srcfile setting cleanup to 2.7 as we ran into this at work
with an embedded python stdlib. __file__ was set to something by the embedded
importer, but to something different than the path seen on the actual code
objects which appear to
Gregory P. Smith added the comment:
Definitely a bug. The path search should silently skip directories it can't
access.
On Tue, Oct 27, 2015, 7:05 AM R. David Murray
wrote:
>
> R. David Murray added the comment:
>
> So, two interesting questions: does this in fact match the
Gregory P. Smith added the comment:
Hisham, could you sign the Python contributor agreement?
https://www.python.org/psf/contrib/contrib-form/
thanks!
--
___
Python tracker
<http://bugs.python.org/issue23
Changes by Gregory P. Smith :
--
resolution: -> duplicate
status: open -> closed
superseder: -> subprocess.Popen.send_signal doesn't check whether the process
has terminated
___
Python tracker
<http://bugs.pyth
Changes by Gregory P. Smith :
--
assignee: -> gregory.p.smith
nosy: +gregory.p.smith
___
Python tracker
<http://bugs.python.org/issue6973>
___
___
Python-
Gregory P. Smith added the comment:
I chose to go with the "there should not be an error" approach similar to how
Python deals with multiple file closes. Both are technically programming
errors but the point of Python is make life easier.
Reasoning? I don't want someone to
Gregory P. Smith added the comment:
I'm unassigning as i won't be figuring out how to hackishly fix this again.
The best solution is a complete rewrite of zipimport.
this remains a known issue: if you use zipimport, do not allow the zip file to
change out from underneath your runni
Gregory P. Smith added the comment:
heh, you're right. it's a trivial obvious fix for the mistake in the existing
implementation. writing a test and committing.
the other option would be to get rid of the sanity check entirely or change it
not to use the odd "require a so
Gregory P. Smith added the comment:
I didn't bother adding the fix to 3.4, it isn't high value.
--
resolution: -> fixed
status: open -> closed
versions: +Python 3.5, Python 3.6
___
Python tracker
<http://bugs.py
Changes by Gregory P. Smith :
--
nosy: +gregory.p.smith
___
Python tracker
<http://bugs.python.org/issue19217>
___
___
Python-bugs-list mailing list
Unsubscribe:
Gregory P. Smith added the comment:
Reopen this if you find a reproducible way for this patch to prove useful.
--
resolution: -> rejected
status: open -> closed
___
Python tracker
<http://bugs.python.org/i
Changes by Gregory P. Smith :
--
nosy: +gregory.p.smith
___
Python tracker
<http://bugs.python.org/issue22012>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Gregory P. Smith :
--
components: +Library (Lib)
___
Python tracker
<http://bugs.python.org/issue22012>
___
___
Python-bugs-list mailing list
Unsub
Changes by Gregory P. Smith :
--
versions: +Python 3.6
___
Python tracker
<http://bugs.python.org/issue22012>
___
___
Python-bugs-list mailing list
Unsubscribe:
Gregory P. Smith added the comment:
I wouldn't _assume_ that there was a good design reason for that in
multiprocessing... it already mixed threads and fork() without realizing that
you cannot safely do that.
--
nosy: +gregory.p.smith
Gregory P. Smith added the comment:
_args_from_interpreter_flags really deserves its own unittest using a stubbed
out sys.flags. if someone wants to go ahead with the test provided in the
existing patch here or write one of those, feel free.
As is, i've committed a patch logically equiv
Changes by Gregory P. Smith :
--
resolution: -> fixed
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue20954>
___
___
Python-bugs-
Gregory P. Smith added the comment:
ironically this change would've been a lot simpler had it simply deleted
hash_randomization from the set of sys.flags considered by
_args_from_interpreter_flags().
-R is always enabled in Python 3.4. it cannot be disabled. it isn't even
docum
Gregory P. Smith added the comment:
This change breaks existing code that is relying on the behavior of the enum
API as shipped in 3.4 and 3.5. Please do NOT do this.
Worse, you've landed this change in a "stable" release of the enum34 "backport"
module (1.1.1) des
Gregory P. Smith added the comment:
lets collect some examples of where it causes problems (someone ran into the
problem at work which is why i hunted down this bugs.python.org issue) before
deciding.
If it stays in, it needs a mention in both Misc/NEWS and What's New as it will
require
Changes by Gregory P. Smith :
--
assignee: -> gregory.p.smith
___
Python tracker
<http://bugs.python.org/issue25960>
___
___
Python-bugs-list mailing list
Un
Gregory P. Smith added the comment:
This appears due to Popen._waitpid_lock. It is not being released when the
signal fires and the while loop containing the with self._waitpid_lock repeats.
This also reproduces when using subprocess32
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
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
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
3101 - 3200 of 3274 matches
Mail list logo