New submission from Chris Angelico :
An anomaly in the argument types of similar functions:
PyImport_ImportModuleLevel takes char *, while the related functions
PyImport_AddModule, PyImport_ImportModule, and PyImport_ImportModuleNoBlock all
take const char *. This made a nuisance of itself
Change by Chris Angelico :
--
keywords: +patch
nosy: +Rosuav
nosy_count: 3.0 -> 4.0
pull_requests: +23793
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/25045
___
Python tracker
<https://bugs.python.org/i
Chris Angelico added the comment:
Can confirm. This changed in bpo-38038 and the fix isn't too difficult.
Adding 3.10 in case it's decided that this shouldn't be patched onto 3.9.
--
versions: +Python 3.10
___
Python
Change by Chris Angelico :
--
keywords: +patch
nosy: +Rosuav
nosy_count: 5.0 -> 6.0
pull_requests: +23797
stage: -> patch review
pull_request: https://github.com/python/cpython/pull/25045
___
Python tracker
<https://bugs.python.org/i
Chris Angelico added the comment:
Has this been ongoing, or is it something that started in the past day and a
half? I've had intermittent internet issues (and expect them to continue for
another half day or thereabouts), so it's possible that this is actually a
symptom of that.
Chris Angelico added the comment:
That ducks the immediate issue, but I think the underlying issue would still be
worth solving. How hard would it be to fetch this via an encrypted connection?
It's still not 100% secure, but it would be resilient against some of these
sorts of i
Changes by Chris Angelico :
--
nosy: +Rosuav
___
Python tracker
<http://bugs.python.org/issue29929>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Chris Angelico :
--
pull_requests: +13077
___
Python tracker
<https://bugs.python.org/issue35224>
___
___
Python-bugs-list mailing list
Unsubscribe:
Change by Chris Angelico :
--
pull_requests: +13196
___
Python tracker
<https://bugs.python.org/issue32893>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Chris Angelico :
When a non-literal is given to literal_eval, attempt to be more
helpful with the message, rather than calling it 'malformed'.
--
components: Library (Lib)
messages: 312423
nosy: Rosuav
priority: normal
pull_requests:
severity: nor
Change by Chris Angelico :
--
keywords: +patch
pull_requests: +5558
stage: -> patch review
___
Python tracker
<https://bugs.python.org/issue32888>
___
___
Py
Chris Angelico added the comment:
Hmm, I think I see what I broke there. It was part of the merge conflict
resolution - I moved the check into the function, which is actually incorrect.
It wasn't misleading like that in the original patch. Will fix
Chris Angelico added the comment:
Actually, it's a bit more complicated than I thought. Current proposed
solution: Track the context of each conversion, thus allowing different errors
to be distinguished.
--
___
Python tracker
&
Chris Angelico added the comment:
(BTW, by "proposed" I mean that the change that I describe is in the PR.)
--
___
Python tracker
<https://bugs.python.o
Chris Angelico added the comment:
Thanks for handling that Terry. I take it the PR isn't needed now?
I would have done it, but I'm on the way to the US (literally posting this from
the airport), and hadn't gotten to looking at this
Chris Angelico added the comment:
Yes, the PEP says version 3.8. Why is this a problem? Sit tight, let the
implementation land. I don't understand why this needed me to get emailed
saying that the PEP has the wrong version number in it.
--
nosy: +R
Chris Angelico added the comment:
BTW, sorry for sounding a bit snippy in my comment. Jonathan, in future, rather
than dropping someone an email, it'd be more normal to just ping the person on
the issue itself.
--
___
Python tracker
&
Chris Angelico added the comment:
I agree that current behaviour is a bit confusing; also, the implication is
that deleting from the dictionary while you have an iterator may leave some
hanging references around the place, which raises a red flag in my mind (maybe
something else might find
Changes by Chris Angelico :
--
nosy: +Rosuav
___
Python tracker
<http://bugs.python.org/issue21667>
___
___
Python-bugs-list mailing list
Unsubscribe:
Chris Angelico added the comment:
I'm experiencing a similar issue. Fresh install of 3.3 today from the .msi
installer on the web site, identifies itself as:
Python 3.3.0 (v3.3.0:bd8afb90ebf2, Sep 29 2012, 10:55:48) [MSC v.1600 32 bit
(Intel)] on win32
To reproduce: Copy and paste
New submission from Chris Angelico:
IDLE tries to be helpful, but it errors on something that isn't yet an error.
Pasting in this code works fine:
>>> def a():
def b():
nonlocal q
q+=1
q=1
b()
return q
>>&g
New submission from Chris Angelico:
In an interactive session, typing 'import this' a second time doesn't produce
output (as the module's already imported). Peeking into the module shows a
string and what looks like a translation dictionary, but doing the obvious
thing:
Chris Angelico added the comment:
Patch applies nicely to current default, and works for me on amd64 Linux. I'm
liking how this is looking.
--
___
Python tracker
<http://bugs.python.org/is
New submission from Chris Angelico:
When tests are run from an Upstart job in a minimal environment,
test_posix.test_initgroups fails as it attempts to find the max() of an empty
list of supplementary groups.
Problem sighted with 2.7, 3.3, and 3.x branches. Patch derived from 3.x
(default
Chris Angelico added the comment:
Small quibble: The last sentence capitalizes a Python built-in, which is
confusing ("Len(seq_dict) must match..."). Tweak of grammar to have it not at
the beginning of the sentence: "Either way, len(seq_dict) must match...".
Changes by Chris Angelico :
--
nosy: +Rosuav
___
Python tracker
<http://bugs.python.org/issue2292>
___
___
Python-bugs-list mailing list
Unsubscribe:
Chris Angelico added the comment:
Patch doesn't apply to 3.4. Apart from the obvious filename change
(Lib/urllib2.py -> Lib/urllib/request.py), retry_http_basic_auth is distinctly
different in the current version. I think this will need a completely separate
patch, separately done an
Chris Angelico added the comment:
Oops, I was reading off the wrong piece of code. It's not "distinctly
different", actually; it's just different enough that the patch fails. The only
difference is that in 3.4 the headers are Unicode strings (so the content gets
encoded
Changes by Chris Angelico :
Added file:
http://bugs.python.org/file34041/0001-Add-an-authorization-header-to-the-initial-request.patch
___
Python tracker
<http://bugs.python.org/issue19
Changes by Chris Angelico :
Added file:
http://bugs.python.org/file34042/0001-Add-an-authorization-header-to-the-initial-request.patch
___
Python tracker
<http://bugs.python.org/issue19
Chris Angelico added the comment:
Yeah. I first thought "Hey, I could just change the file names in the patch and
apply it", but then when it failed, I went looking, found the wrong piece of
code, and thought it was completely different. Turned out to be not so
different after all
New submission from Chris Angelico:
Only noticed because I was searching the stdlib for hasattr calls, but in
mailbox.Mailbox.update(), a check is done thus:
if hasattr(arg, 'iteritems'):
source = arg.items()
elif hasattr(arg, 'items')
Changes by Chris Angelico :
--
nosy: +Rosuav
___
Python tracker
<http://bugs.python.org/issue20739>
___
___
Python-bugs-list mailing list
Unsubscribe:
Changes by Chris Angelico :
--
components: +Tests
versions: +Python 3.4
___
Python tracker
<http://bugs.python.org/issue20796>
___
___
Python-bugs-list mailin
New submission from Chris Angelico:
$ find . -name \*.pyc -delete
$ PYTHONDONTWRITEBYTECODE=1 make test
Three test failures, which all seem to be duplicates of:
==
FAIL: test_timestamp_overflow
Chris Angelico added the comment:
One test failing, due to Tools/parser/unparse.py not knowing how to unparse an
except expression. Otherwise, test suite passes (with most of the stdlib
unchanged). I'm about to try writing an actual conversion script which will
rewrite the stdlib, and
Chris Angelico added the comment:
Thanks for the fast turn-around, guys! Not that it matters hugely - I happened
to have bytecode writing disabled to test something unrelated and noticed the
test failure.
--
___
Python tracker
<h
Chris Angelico added the comment:
I've applied all the changes my script can find, including ones that are
actually quite inappropriate, like:
try:
some_function_call()
except some_exception:
some_other_function_call()
All tests pass except for one, which I don
Changes by Chris Angelico :
Added file: http://bugs.python.org/file34250/churn1.diff
___
Python tracker
<http://bugs.python.org/issue20739>
___
___
Python-bugs-list mailin
Changes by Chris Angelico :
Added file: http://bugs.python.org/file34251/churn2.diff
___
Python tracker
<http://bugs.python.org/issue20739>
___
___
Python-bugs-list mailin
Changes by Chris Angelico :
Added file: http://bugs.python.org/file34252/broken.diff
___
Python tracker
<http://bugs.python.org/issue20739>
___
___
Python-bugs-list mailin
Chris Angelico added the comment:
Python doesn't currently have any sort of function for fetching all a
computer's IPs, as far as I know, but if there is one (either now or in the
future), it would be good to link to that from there. "Here's how to get your
host name. And
Chris Angelico added the comment:
Patch doesn't apply to current Python trunk (18 months later). Do you know what
version you wrote this against? The current wording is different.
--
nosy: +Rosuav
___
Python tracker
<http://bugs.py
Chris Angelico added the comment:
Presumably this is not an issue in 3.x. Is this considered a bug fix (in which
case the patch should almost certainly be applied - it looks perfectly safe),
or a feature enhancement (in which case this should get closed wontfix)? Looks
like low-hanging fruit
Changes by Chris Angelico :
--
nosy: +Rosuav
___
Python tracker
<http://bugs.python.org/issue27582>
___
___
Python-bugs-list mailing list
Unsubscribe:
Chris Angelico added the comment:
The question was raised that there might be a problem with (UTF-8) bytes vs
characters, but that's definitely not it - pythonrun.c:1362 UTF-8-decodes the
line of source and then gets its character length to use as the new offset. So
I don't think
Chris Angelico added the comment:
Actually pinpointing the invalid character may be impractical, as there are two
boolean situations: either a UnicodeDecodeError (because you had an invalid
UTF-8 stream), or PyUnicode_IsIdentifier returns false. Either way, it applies
to the whole identifier
Changes by Chris Angelico :
Added file: http://bugs.python.org/file43812/method2-change-cur-and-inp.patch
___
Python tracker
<http://bugs.python.org/issue27582>
___
___
Changes by Chris Angelico :
Added file:
http://bugs.python.org/file43814/method4-change-all-errors-if-possible.patch
___
Python tracker
<http://bugs.python.org/issue27
Changes by Chris Angelico :
Added file: http://bugs.python.org/file43813/method3-change-all-errors.patch
___
Python tracker
<http://bugs.python.org/issue27582>
___
___
Chris Angelico added the comment:
BTW, here's how a session looks using method 4's change:
>>> varname = asdf“d“a”t”apoint
File "", line 1
varname = asdf“d“a”t”apoint
^
SyntaxError: invalid character in identifier
>>> varname = asdf“d
Chris Angelico added the comment:
Hmm, that'd be curious. The code to do that is actually pretty simple - see
attached patch - but actually using that to affect error messages is a bit
harder. Is it safe to mess with tok->start?
--
Added file:
http://bugs.python.org/file438
Chris Angelico added the comment:
Attached is a combined patch that has the new private function for
IsIdentifier, method 4's error handling change, and a bit of glue in the middle
to make use of it. The result is a passing test suite (bar test_site which was
already failing on my system
New submission from Chris Angelico:
Originally reported (if you can call it "reported") here:
http://www.viva64.com/en/b/0414/
AFAICT, this is an easy and inconsequential fix.
--
files: uninitialized-pointer.patch
keywords: patch
messages: 270991
nosy: Rosuav
priority: norma
Chris Angelico added the comment:
Berker, I don't push code to CPython (I have the commitbit for PEP editing), so
do you want to push that?
--
___
Python tracker
<http://bugs.python.org/is
Chris Angelico added the comment:
Cool cool! Then someone will need to notify the PVS-Studio people that we've
fixed the two bugs that are actually our bugs :)
--
___
Python tracker
<http://bugs.python.org/is
Changes by Chris Angelico :
--
nosy: +Rosuav
___
Python tracker
<http://bugs.python.org/issue27587>
___
___
Python-bugs-list mailing list
Unsubscribe:
Chris Angelico added the comment:
Here's a first-cut patch. No docs, no tests, and applies only to decimal
formatting. It involves redefining the thousands_separators flag from being a
boolean to being a three-state flag (none, comma, or underscore), and (ab)uses
LT_*_LOCALE to carry
Changes by Chris Angelico :
--
nosy: +Rosuav
___
Python tracker
<http://bugs.python.org/issue27080>
___
___
Python-bugs-list mailing list
Unsubscribe:
Chris Angelico added the comment:
Hmm, adding bin/oct/hex support didn't turn out that hard. Although it feels
like this code is getting hackish. Definitely needs code review!
--
Added file: http://bugs.python.org/file44153/underscores_all_bases.
Chris Angelico added the comment:
Hmm, strange. Comma formatting never seems to have had tests added. So I've
added a couple of simple tests of comma formatting at the same time as adding
underscore formatting tests. Also, test_long.py currently has a comment "#
octal" prece
Changes by Chris Angelico :
--
keywords: +patch
Added file: http://bugs.python.org/file44158/no-site-packages-in-test.patch
___
Python tracker
<http://bugs.python.org/issue27
New submission from Chris Angelico:
Having matplotlib installed globally causes test_site to fail, due to the .pth
file importing types. The point of the test is to monitor startup dependencies
(and thus time) for the core interpreter and standard library, not third-party
libraries, so having
New submission from Chris Angelico:
The timeit module is commonly used via the convenience function timeit.timeit,
which is listed in the documentation as the recommended "Python Interface":
http://docs.python.org/3/library/timeit.html
However, this function is not listed in __all_
Changes by Chris Angelico :
--
nosy: +Rosuav
___
Python tracker
<http://bugs.python.org/issue17575>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Chris Angelico:
As of PEP 393, a string's width is recorded in its header - effectively, a
marker that says whether the highest codepoint in the string is >0x, >0xFF,
or <=0xFF. This is, on some occasions, useful to know; for instance, when
testing stri
Chris Angelico added the comment:
And of course, I make a copy/paste error in a trivial piece of example code.
def str_width(s):
width=1
for ch in map(ord,s):
if ch > 0x: return 4
if ch > 0xFF: width=2
return width
--
___
Chris Angelico added the comment:
CPython also knows the length of a string, which means that len(s) is a fast
operation. I wouldn't expect anyone to rewrite len() as:
def get_string_length(s):
length=0
for ch in s:
length+=1
return length
even though that works. No, we have a
New submission from Chris Angelico:
See PEP for full details. Attached is POC patch: behaviour is altered globally
(rather than respecting a __future__ directive), and minimal changes are made
elsewhere to make the test suite mostly pass (test_generators does not - it'll
need
Chris Angelico added the comment:
Marc, are those all cases where the "raise StopIteration" is actually inside a
generator? If so, it can be trivially replaced with "return". Yes, it'll break
that way of spelling it, but it's a completely mechanical transformation
Chris Angelico added the comment:
Yep, the question is whether any of the "raise StopIteration" lines are
actually non-local flow control. If they're local, then it's easy: mechanical
replacement with "return" and it becomes compatible with all versions (unless
Chris Angelico added the comment:
Sadly, I don't know of a way to check if that's the case, other than by
manually going through and eyeballing the code - if there's "raise
StopIteration", see if there's also "yield" in the same function. The three
cite
Chris Angelico added the comment:
Known issues with the current patch, if anyone feels like playing with this who
better knows the code:
1) Needs a __future__ directive to control behaviour
2) test_generators needs to be heavily reworked
3) The test of what exception was thrown needs to also
Chris Angelico added the comment:
Stefan, I'm not sure - I don't know the details of the C API here. But I tried
commenting out everything but that one line, and while it does result in
RuntimeError, it doesn't do the exception chaining. Currently, I believe the
exception isn
Chris Angelico added the comment:
Yeah, I saw that. Since that function begins with an underscore, I thought it
best to replicate its behaviour rather than to call it. Either way ought to
work though.
--
___
Python tracker
<http://bugs.python.
New submission from Chris Angelico:
Creating an issue to keep track of a patch, but this probably wants to be
discussed on python-ideas.
The attached patch allows a Python function to be put into sys.__getglobal__,
which then works like __getattr__ but for global names. This allows
Chris Angelico added the comment:
I can have a poke at the __future__ import tonight, but my main concern is
memory management - I'm not sufficiently familiar with the exception handling
calls to be sure that I'm neither leaking nor over-freeing anything. There's
also a seconda
Chris Angelico added the comment:
PyErr_Restore doesn't seem to trigger exception chaining. But thanks for the
tip about explicitly setting the traceback; not sure how I missed that, but now
the StopIteration traceback is visible.
Minor point: The previous patch was setting the __context
Changes by Chris Angelico :
Added file: http://bugs.python.org/file37641/stopiter.py
___
Python tracker
<http://bugs.python.org/issue22906>
___
___
Python-bugs-list mailin
Chris Angelico added the comment:
Nick, any particular reason for pointing to
https://hg.python.org/cpython/annotate/bbf16fd024df/Lib/__future__.py rather
than https://hg.python.org/cpython/annotate/tip/Lib/__future__.py ? I'm looking
at both, a
Changes by Chris Angelico :
--
type: -> behavior
___
Python tracker
<http://bugs.python.org/issue23192>
___
___
Python-bugs-list mailing list
Unsubscrib
New submission from Chris Angelico:
As yield is an expression, it's legal in a lambda function, which then
means you have a generator function. But it's not quite the same as
the equivalent function made with def:
$ python3
Python 3.5.0a0 (default:1c51f1650c42+, Dec 29 2014, 02:2
Chris Angelico added the comment:
Okay! I think I have something here. DEFINITELY needs more eyeballs, but all
tests pass, including a new one that tests StopIteration leakage both with and
without the __future__ directive. Some docs changes have been made (I grepped
for 'stopiteration
Chris Angelico added the comment:
I'm not sure what to look for in the code generation. In compile.c lines 3456
and following, there's a LOAD_CONST None coming through, in the else branch of
"if (e->v.Yield.value)", but nothing talking about lambda function
Chris Angelico added the comment:
The third version of the patch is huge compared to the other two. Is it all
important?
I'm seeing a different build failure, and with the size of patch, I'm not sure
I'm well placed to figure out what's going on.
-- cut --
Traceback (m
Chris Angelico added the comment:
*facepalm* Of course I am. I don't know how I missed that in there, but maybe I
was focusing too much on the abort that followed it to actually read the
exception text. Duh.
But with the latest version of the patch, I'm seeing something that I'
Changes by Chris Angelico :
--
nosy: -Rosuav
___
Python tracker
<http://bugs.python.org/issue2292>
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from Chris Angelico:
Grammar/Grammar points to PEP 306, which points instead to the dev guide. The
exact link is not provided, but it'd be useful to skip the PEP altogether and
just link to https://docs.python.org/devguide/grammar.html in the file.
--
messages: 2
Chris Angelico added the comment:
Another good option is read/write without the 'fd' suffix. Either works, I'd
prefer the shorter one but by a small margin.
--
nosy: +Rosuav
___
Python tracker
<http://bugs.pyt
New submission from Chris Angelico:
https://docs.python.org/3/reference/expressions.html#id18
The string "\u0327\u0043" does not normalize to the same string as "\u00C7", as
combining characters are supposed to _follow_ the base character. (Some
consoles may happen to d
Chris Angelico added the comment:
Interestingly, the 2.7 docs have this correct already.
https://docs.python.org/2.7/reference/expressions.html#id23
--
___
Python tracker
<http://bugs.python.org/issue24
Chris Angelico added the comment:
The host is running Debian Jessie (newer than the Debian Wheezy of the VM).
Linux sikorsky 3.16.0-4-amd64 #1 SMP Debian 3.16.7-ckt9-3~deb8u1 (2015-04-24)
x86_64 GNU/Linux
What info are you after re hardware virtualization?
VirtualBox 4.3.28 r100309 manages
Chris Angelico added the comment:
Where's this issue heading? The buildbots seem to be green now, does that imply
that this is fixed?
--
___
Python tracker
<http://bugs.python.org/is
Chris Angelico added the comment:
Ah. It's one of *those* bugs. Got it.
--
___
Python tracker
<http://bugs.python.org/issue24707>
___
___
Python-bugs-list m
Chris Angelico added the comment:
This sounds like a feature enhancement, which means it (almost certainly) won't
be applied to Python 2.7. Does the same question come up in Python 3?
Also (FWIW) if you can confidently assume that all the keys are strings. then
type.lower() is better
Chris Angelico added the comment:
ISTM this is a case where Python's core shouldn't be using assert. It's
possible for userland code to trigger an assertion failure, which means it
should be a regular if(..) raise. Patch attached.
@haypo, what do you mean by "fuzzing"
Chris Angelico added the comment:
Oops, forgot to add a test. Using a variant of poc_getaddr.py to construct
something which fails on current CPython tip, and passes with the patch.
--
Added file: http://bugs.python.org/file40435/dont_assert_with_test.patch
Chris Angelico added the comment:
Hmm. Is Duff's Device a valid construct for CPython? It'd shorten this a lot...
--
nosy: +Rosuav
___
Python tracker
<http://bugs.python.o
Chris Angelico added the comment:
Or at very least, can fallthrough be used in the switch block, so there aren't
7+6+5+4+3+2+1 copies of the same line?
-- Not a C performance expert --
--
___
Python tracker
<http://bugs.python.org/is
Chris Angelico added the comment:
+1 for anything that makes Python faster with provably no semantic changes.
--
___
Python tracker
<http://bugs.python.org/issue25
1 - 100 of 157 matches
Mail list logo