[issue12173] PyImport_ImportModuleLevel doesn't have 'const' on its argument

2011-05-25 Thread Chris Angelico
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

[issue43433] xmlrpc.client ignores query in URI ("?action=xmlrpc2") since python-3.9

2021-03-27 Thread Chris Angelico
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

[issue43433] xmlrpc.client ignores query in URI ("?action=xmlrpc2") since python-3.9

2021-03-27 Thread Chris Angelico
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

[issue43614] Search is not beginner friendly

2021-03-27 Thread Chris Angelico
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

[issue41940] AMD64 Debian root 3.x: tests fail because downloaded files start with:

2020-10-05 Thread Chris Angelico
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.

[issue41940] AMD64 Debian root 3.x: tests fail because downloaded files start with:

2020-10-11 Thread Chris Angelico
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

[issue29929] Eliminate implicit __main__ relative imports

2017-06-03 Thread Chris Angelico
Changes by Chris Angelico : -- nosy: +Rosuav ___ Python tracker <http://bugs.python.org/issue29929> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35224] PEP 572: Assignment Expressions

2019-05-07 Thread Chris Angelico
Change by Chris Angelico : -- pull_requests: +13077 ___ Python tracker <https://bugs.python.org/issue35224> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue32893] ast.literal_eval() shouldn't accept booleans as numbers in AST

2019-05-13 Thread Chris Angelico
Change by Chris Angelico : -- pull_requests: +13196 ___ Python tracker <https://bugs.python.org/issue32893> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue32888] Improve exception message in ast.literal_eval

2018-02-20 Thread Chris Angelico
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

[issue32888] Improve exception message in ast.literal_eval

2018-02-20 Thread Chris Angelico
Change by Chris Angelico : -- keywords: +patch pull_requests: +5558 stage: -> patch review ___ Python tracker <https://bugs.python.org/issue32888> ___ ___ Py

[issue32888] Improve exception message in ast.literal_eval

2018-02-20 Thread Chris Angelico
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

[issue32888] Improve exception message in ast.literal_eval

2018-02-20 Thread Chris Angelico
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 &

[issue32888] Improve exception message in ast.literal_eval

2018-02-20 Thread Chris Angelico
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

[issue31780] Using format spec ',x' displays incorrect error message

2017-10-17 Thread Chris Angelico
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

[issue34237] faq/design: PEP 572 adds assignment expressions

2018-07-27 Thread Chris Angelico
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

[issue34237] faq/design: PEP 572 adds assignment expressions

2018-07-31 Thread Chris Angelico
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 &

[issue19414] iter(ordered_dict) yields keys not in dict in some circumstances

2014-04-12 Thread Chris Angelico
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

[issue21667] Clarify status of O(1) indexing semantics of str objects

2014-06-05 Thread Chris Angelico
Changes by Chris Angelico : -- nosy: +Rosuav ___ Python tracker <http://bugs.python.org/issue21667> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue13153] IDLE crashes when pasting non-BMP unicode char on UCS-16 build

2012-12-19 Thread Chris Angelico
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

[issue19335] IDLE over-enthusiastically verifies 'nonlocal' usage

2013-10-21 Thread Chris Angelico
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

[issue19621] Reimporting this and str.translate()

2013-11-15 Thread Chris Angelico
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:

[issue22228] Adapt bash readline operate-and-get-next function

2014-08-20 Thread Chris Angelico
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

[issue20249] test_posix.test_initgroups fails when running with no supplementary groups

2014-01-13 Thread Chris Angelico
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

[issue20364] Rename & explain sqlite3.Cursor.execute 'parameters' param

2014-01-23 Thread Chris Angelico
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...".

[issue2292] Missing *-unpacking generalizations

2014-01-30 Thread Chris Angelico
Changes by Chris Angelico : -- nosy: +Rosuav ___ Python tracker <http://bugs.python.org/issue2292> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue19494] urllib2.HTTPBasicAuthHandler (or urllib.request.HTTPBasicAuthHandler) doesn't work with GitHub API v3 and similar

2014-02-11 Thread Chris Angelico
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

[issue19494] urllib2.HTTPBasicAuthHandler (or urllib.request.HTTPBasicAuthHandler) doesn't work with GitHub API v3 and similar

2014-02-11 Thread Chris Angelico
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

[issue19494] urllib2.HTTPBasicAuthHandler (or urllib.request.HTTPBasicAuthHandler) doesn't work with GitHub API v3 and similar

2014-02-11 Thread Chris Angelico
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

[issue19494] urllib2.HTTPBasicAuthHandler (or urllib.request.HTTPBasicAuthHandler) doesn't work with GitHub API v3 and similar

2014-02-11 Thread Chris Angelico
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

[issue19494] urllib2.HTTPBasicAuthHandler (or urllib.request.HTTPBasicAuthHandler) doesn't work with GitHub API v3 and similar

2014-02-11 Thread Chris Angelico
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

[issue20729] mailbox.Mailbox does odd hasattr() check

2014-02-22 Thread Chris Angelico
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')

[issue20739] PEP 463 (except expression) implementation

2014-02-22 Thread Chris Angelico
Changes by Chris Angelico : -- nosy: +Rosuav ___ Python tracker <http://bugs.python.org/issue20739> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue20796] Test failures when running with PYTHONDONTWRITEBYTECODE

2014-02-27 Thread Chris Angelico
Changes by Chris Angelico : -- components: +Tests versions: +Python 3.4 ___ Python tracker <http://bugs.python.org/issue20796> ___ ___ Python-bugs-list mailin

[issue20796] Test failures when running with PYTHONDONTWRITEBYTECODE

2014-02-27 Thread Chris Angelico
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

[issue20739] PEP 463 (except expression) implementation

2014-02-27 Thread Chris Angelico
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

[issue20796] Test failures when running with PYTHONDONTWRITEBYTECODE

2014-02-27 Thread Chris Angelico
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

[issue20739] PEP 463 (except expression) implementation

2014-02-27 Thread Chris Angelico
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&#x

[issue20739] PEP 463 (except expression) implementation

2014-02-27 Thread Chris Angelico
Changes by Chris Angelico : Added file: http://bugs.python.org/file34250/churn1.diff ___ Python tracker <http://bugs.python.org/issue20739> ___ ___ Python-bugs-list mailin

[issue20739] PEP 463 (except expression) implementation

2014-02-27 Thread Chris Angelico
Changes by Chris Angelico : Added file: http://bugs.python.org/file34251/churn2.diff ___ Python tracker <http://bugs.python.org/issue20739> ___ ___ Python-bugs-list mailin

[issue20739] PEP 463 (except expression) implementation

2014-02-27 Thread Chris Angelico
Changes by Chris Angelico : Added file: http://bugs.python.org/file34252/broken.diff ___ Python tracker <http://bugs.python.org/issue20739> ___ ___ Python-bugs-list mailin

[issue5626] misleading comment in socket.gethostname() documentation

2014-03-02 Thread Chris Angelico
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

[issue14995] PyLong_FromString documentation should state that the string must be null-terminated

2014-03-02 Thread Chris Angelico
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

[issue15618] turtle.pencolor() chokes on unicode

2014-03-02 Thread Chris Angelico
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

[issue27582] Mispositioned SyntaxError caret for unknown code points

2016-07-21 Thread Chris Angelico
Changes by Chris Angelico : -- nosy: +Rosuav ___ Python tracker <http://bugs.python.org/issue27582> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue27582] Mispositioned SyntaxError caret for unknown code points

2016-07-21 Thread Chris Angelico
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

[issue27582] Mispositioned SyntaxError caret for unknown code points

2016-07-21 Thread Chris Angelico
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

[issue27582] Mispositioned SyntaxError caret for unknown code points

2016-07-21 Thread Chris Angelico
Changes by Chris Angelico : Added file: http://bugs.python.org/file43812/method2-change-cur-and-inp.patch ___ Python tracker <http://bugs.python.org/issue27582> ___ ___

[issue27582] Mispositioned SyntaxError caret for unknown code points

2016-07-21 Thread Chris Angelico
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

[issue27582] Mispositioned SyntaxError caret for unknown code points

2016-07-21 Thread Chris Angelico
Changes by Chris Angelico : Added file: http://bugs.python.org/file43813/method3-change-all-errors.patch ___ Python tracker <http://bugs.python.org/issue27582> ___ ___

[issue27582] Mispositioned SyntaxError caret for unknown code points

2016-07-21 Thread Chris Angelico
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

[issue27582] Mispositioned SyntaxError caret for unknown code points

2016-07-21 Thread Chris Angelico
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

[issue27582] Mispositioned SyntaxError caret for unknown code points

2016-07-21 Thread Chris Angelico
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

[issue27591] multiprocessing: Possible uninitialized pointer use in Windows builds

2016-07-22 Thread Chris Angelico
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

[issue27591] multiprocessing: Possible uninitialized pointer use in Windows builds

2016-07-22 Thread Chris Angelico
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

[issue27591] multiprocessing: Possible uninitialized pointer use in Windows builds

2016-07-22 Thread Chris Angelico
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

[issue27587] Issues, reported by PVS-Studio static analyzer

2016-07-23 Thread Chris Angelico
Changes by Chris Angelico : -- nosy: +Rosuav ___ Python tracker <http://bugs.python.org/issue27587> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue27080] Implement the formatting part of PEP 515, '_' in numeric literals.

2016-08-19 Thread Chris Angelico
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

[issue27080] Implement the formatting part of PEP 515, '_' in numeric literals.

2016-08-19 Thread Chris Angelico
Changes by Chris Angelico : -- nosy: +Rosuav ___ Python tracker <http://bugs.python.org/issue27080> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue27080] Implement the formatting part of PEP 515, '_' in numeric literals.

2016-08-19 Thread Chris Angelico
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.

[issue27080] Implement the formatting part of PEP 515, '_' in numeric literals.

2016-08-19 Thread Chris Angelico
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

[issue27807] Prevent site-packages .pth files from causing test_site failure

2016-08-19 Thread Chris Angelico
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

[issue27807] Prevent site-packages .pth files from causing test_site failure

2016-08-19 Thread Chris Angelico
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

[issue17414] timeit.timeit not in __all__ even though documented

2013-03-14 Thread Chris Angelico
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_

[issue17575] HTTPConnection.send

2013-03-29 Thread Chris Angelico
Changes by Chris Angelico : -- nosy: +Rosuav ___ Python tracker <http://bugs.python.org/issue17575> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue17629] Expose string width to Python

2013-04-03 Thread Chris Angelico
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

[issue17629] Expose string width to Python

2013-04-03 Thread Chris Angelico
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 -- ___

[issue17629] Expose string width to Python

2013-04-03 Thread Chris Angelico
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

[issue22906] PEP 479: Change StopIteration handling inside generators

2014-11-20 Thread Chris Angelico
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

[issue22906] PEP 479: Change StopIteration handling inside generators

2014-11-21 Thread Chris Angelico
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

[issue22906] PEP 479: Change StopIteration handling inside generators

2014-11-21 Thread Chris Angelico
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

[issue22906] PEP 479: Change StopIteration handling inside generators

2014-11-21 Thread Chris Angelico
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

[issue22906] PEP 479: Change StopIteration handling inside generators

2014-11-25 Thread Chris Angelico
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

[issue22906] PEP 479: Change StopIteration handling inside generators

2014-11-29 Thread Chris Angelico
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

[issue22906] PEP 479: Change StopIteration handling inside generators

2014-11-29 Thread Chris Angelico
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.

[issue23126] Add Python hook function to replace NameError

2014-12-28 Thread Chris Angelico
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

[issue22906] PEP 479: Change StopIteration handling inside generators

2015-01-07 Thread Chris Angelico
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

[issue22906] PEP 479: Change StopIteration handling inside generators

2015-01-08 Thread Chris Angelico
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

[issue22906] PEP 479: Change StopIteration handling inside generators

2015-01-08 Thread Chris Angelico
Changes by Chris Angelico : Added file: http://bugs.python.org/file37641/stopiter.py ___ Python tracker <http://bugs.python.org/issue22906> ___ ___ Python-bugs-list mailin

[issue22906] PEP 479: Change StopIteration handling inside generators

2015-01-08 Thread Chris Angelico
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

[issue23192] Generator return value ignored in lambda function

2015-01-08 Thread Chris Angelico
Changes by Chris Angelico : -- type: -> behavior ___ Python tracker <http://bugs.python.org/issue23192> ___ ___ Python-bugs-list mailing list Unsubscrib

[issue23192] Generator return value ignored in lambda function

2015-01-08 Thread Chris Angelico
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

[issue22906] PEP 479: Change StopIteration handling inside generators

2015-01-08 Thread Chris Angelico
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

[issue23192] Generator return value ignored in lambda function

2015-01-08 Thread Chris Angelico
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

[issue2292] Missing *-unpacking generalizations

2015-01-19 Thread Chris Angelico
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

[issue2292] Missing *-unpacking generalizations

2015-01-20 Thread Chris Angelico
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'

[issue2292] Missing *-unpacking generalizations

2015-01-25 Thread Chris Angelico
Changes by Chris Angelico : -- nosy: -Rosuav ___ Python tracker <http://bugs.python.org/issue2292> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue24435] Grammar/Grammar points to outdated guide

2015-06-11 Thread Chris Angelico
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

[issue24536] os.pipe() should return a structsequence (or namedtuple.)

2015-06-30 Thread Chris Angelico
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

[issue24610] Incorrect example Unicode string in docs footnote

2015-07-11 Thread Chris Angelico
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

[issue24610] Incorrect example Unicode string in docs footnote

2015-07-11 Thread Chris Angelico
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

[issue24707] Assertion failed in pymonotonic_new

2015-07-24 Thread Chris Angelico
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

[issue24707] Assertion failed in pymonotonic_new

2015-07-30 Thread Chris Angelico
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

[issue24707] Assertion failed in pymonotonic_new

2015-07-30 Thread Chris Angelico
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

[issue25068] The proxy key's string should ignore case.

2015-09-11 Thread Chris Angelico
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

[issue24684] socket.getaddrinfo(host) doesn't ensure that host.encode() returns a byte string

2015-09-11 Thread Chris Angelico
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"

[issue24684] socket.getaddrinfo(host) doesn't ensure that host.encode() returns a byte string

2015-09-11 Thread Chris Angelico
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

[issue25106] Hash computation speedup for {buffer, string, unicode}object

2015-09-14 Thread Chris Angelico
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

[issue25106] Hash computation speedup for {buffer, string, unicode}object

2015-09-14 Thread Chris Angelico
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

[issue25106] Hash computation speedup for {buffer, string, unicode}object

2015-09-14 Thread Chris Angelico
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   2   >