[issue43614] Search is not beginner friendly
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/issue43614> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue43433] xmlrpc.client ignores query in URI ("?action=xmlrpc2") since python-3.9
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 tracker <https://bugs.python.org/issue43433> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue43433] xmlrpc.client ignores query in URI ("?action=xmlrpc2") since python-3.9
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/issue43433> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41940] AMD64 Debian root 3.x: tests fail because downloaded files start with:
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 issues. -- ___ Python tracker <https://bugs.python.org/issue41940> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue41940] AMD64 Debian root 3.x: tests fail because downloaded files start with:
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. If that's the case, then the issue would be that my gateway returned a failure page of some sort, which would be another good reason to download the content via HTTPS (since that response happens only on non-encrypted downloads). -- nosy: +Rosuav ___ Python tracker <https://bugs.python.org/issue41940> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue32893] ast.literal_eval() shouldn't accept booleans as numbers in AST
Change by Chris Angelico : -- pull_requests: +13196 ___ Python tracker <https://bugs.python.org/issue32893> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue35224] PEP 572: Assignment Expressions
Change by Chris Angelico : -- pull_requests: +13077 ___ Python tracker <https://bugs.python.org/issue35224> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue34237] faq/design: PEP 572 adds assignment expressions
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 <https://bugs.python.org/issue34237> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue34237] faq/design: PEP 572 adds assignment expressions
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: +Rosuav ___ Python tracker <https://bugs.python.org/issue34237> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue32888] Improve exception message in ast.literal_eval
Chris Angelico <ros...@gmail.com> added the comment: (BTW, by "proposed" I mean that the change that I describe is in the PR.) -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue32888> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue32888] Improve exception message in ast.literal_eval
Chris Angelico <ros...@gmail.com> 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 <rep...@bugs.python.org> <https://bugs.python.org/issue32888> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue32888] Improve exception message in ast.literal_eval
Chris Angelico <ros...@gmail.com> 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 that. -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue32888> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue32888] Improve exception message in ast.literal_eval
Change by Chris Angelico <ros...@gmail.com>: -- keywords: +patch pull_requests: +5558 stage: -> patch review ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue32888> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue32888] Improve exception message in ast.literal_eval
New submission from Chris Angelico <ros...@gmail.com>: 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: normal status: open title: Improve exception message in ast.literal_eval versions: Python 3.8 ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue32888> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue31780] Using format spec ',x' displays incorrect error message
Chris Angelico <ros...@gmail.com> 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 in the interval. -- ___ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue31780> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue29929] Eliminate implicit __main__ relative imports
Changes by Chris Angelico <ros...@gmail.com>: -- nosy: +Rosuav ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue29929> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27322] test_compile_path fails when python has been installed
Chris Angelico added the comment: Also working for me. Thanks! -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27322> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27322] test_compile_path fails when python has been installed
Chris Angelico added the comment: I'm not sure. The patch got backed out with little explanation, so presumably it broke something somewhere, but I don't know what. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27322> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue28172] Upper-case all example enum members
New submission from Chris Angelico: Discussion on python-ideas led to a firm ruling by Guido that enum members are functionally equivalent to constants, and should thus be named in upper-case. This is contrary to the current documentation. Solution? Change the docs. -- assignee: docs@python components: Documentation files: uppercase-enums.patch keywords: patch messages: 276589 nosy: Rosuav, docs@python priority: normal severity: normal status: open title: Upper-case all example enum members versions: Python 3.5, Python 3.6, Python 3.7 Added file: http://bugs.python.org/file44676/uppercase-enums.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue28172> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27322] test_compile_path fails when python has been installed
Chris Angelico added the comment: Huh. Yeah, that would work really nicely. Thanks Christian! Does this count as a bugfix? I think we've missed 3.6 feature freeze. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27322> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27080] Implement the formatting part of PEP 515, '_' in numeric literals.
Chris Angelico added the comment: Thanks Brett! Sounds like a plan. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27080> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27322] test_compile_path fails when python has been installed
Chris Angelico added the comment: Just ran into the same issue, but in a slightly different way, and with slightly different consequences. You can actually eliminate this failure by manually running compileall on the affected directory: sudo python3 -m compileall /usr/local/lib/python3.6/site-packages In other words, a test failure can come and go depending on the presence of other files on the system. IMO the test should (a) restrict itself to directories within the build tree, and (b) call compile_path with force=True. That should make it more consistent. Something like the attached patch. -- keywords: +patch nosy: +Rosuav Added file: http://bugs.python.org/file44426/compile-nearly-all.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27322> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27080] Implement the formatting part of PEP 515, '_' in numeric literals.
Chris Angelico added the comment: Another couple of tests, per comments. -- Added file: http://bugs.python.org/file44425/moar-tests.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27080> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27807] Prevent site-packages .pth files from causing test_site failure
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 a test failure due to a .pth is not overly useful. Solution suggested by Steve Dower: hack out all .pth handling during this one test, leaving everything else unchanged. -- components: Tests messages: 273160 nosy: Rosuav priority: normal severity: normal status: open title: Prevent site-packages .pth files from causing test_site failure type: behavior versions: Python 3.6 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27807> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27807] Prevent site-packages .pth files from causing test_site failure
Changes by Chris Angelico <ros...@gmail.com>: -- keywords: +patch Added file: http://bugs.python.org/file44158/no-site-packages-in-test.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27807> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27080] Implement the formatting part of PEP 515, '_' in numeric literals.
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" preceding a bunch of tests of *binary* formatting, and no tests of octal. So I've added those too. In any case, here's a patch with full functionality and tests. -- Added file: http://bugs.python.org/file44154/underscores_with_tests.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27080> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27080] Implement the formatting part of PEP 515, '_' in numeric literals.
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.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27080> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27080] Implement the formatting part of PEP 515, '_' in numeric literals.
Changes by Chris Angelico <ros...@gmail.com>: -- nosy: +Rosuav ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27080> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27080] Implement the formatting part of PEP 515, '_' in numeric literals.
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 that same information around. -- keywords: +patch Added file: http://bugs.python.org/file44152/underscores_decimal_only.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27080> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27587] Issues, reported by PVS-Studio static analyzer
Changes by Chris Angelico <ros...@gmail.com>: -- nosy: +Rosuav ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27587> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27591] multiprocessing: Possible uninitialized pointer use in Windows builds
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 <rep...@bugs.python.org> <http://bugs.python.org/issue27591> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27591] multiprocessing: Possible uninitialized pointer use in Windows builds
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 <rep...@bugs.python.org> <http://bugs.python.org/issue27591> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27591] multiprocessing: Possible uninitialized pointer use in Windows builds
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: normal severity: normal status: open title: multiprocessing: Possible uninitialized pointer use in Windows builds versions: Python 3.6 Added file: http://bugs.python.org/file43832/uninitialized-pointer.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27591> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27582] Mispositioned SyntaxError caret for unknown code points
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) and a caret that points to the errant Unicode character, or the beginning of the identifier if it's a decode problem. -- Added file: http://bugs.python.org/file43819/combined.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27582> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27582] Mispositioned SyntaxError caret for unknown code points
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/file43818/where-did-that-error-come-from.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27582> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27582] Mispositioned SyntaxError caret for unknown code points
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“a”t”apoint.evidence File "", line 1 varname = asdf“d“a”t”apoint.evidence ^ SyntaxError: invalid character in identifier >>> varname = $d$a$t$apoint File "", line 1 varname = $d$a$t$apoint ^ SyntaxError: invalid syntax >>> varname = asdf$d$a$t$apoint File "", line 1 varname = asdf$d$a$t$apoint ^ SyntaxError: invalid syntax >>> varname = 0o1234987654 + 123 File "", line 1 varname = 0o1234987654 + 123 ^ SyntaxError: invalid syntax >>> varname = "asdf" + "qwer File "", line 1 varname = "asdf" + "qwer ^ SyntaxError: EOL while scanning string literal -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27582> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27582] Mispositioned SyntaxError caret for unknown code points
Changes by Chris Angelico <ros...@gmail.com>: Added file: http://bugs.python.org/file43813/method3-change-all-errors.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27582> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27582] Mispositioned SyntaxError caret for unknown code points
Changes by Chris Angelico <ros...@gmail.com>: Added file: http://bugs.python.org/file43812/method2-change-cur-and-inp.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27582> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27582] Mispositioned SyntaxError caret for unknown code points
Changes by Chris Angelico <ros...@gmail.com>: Added file: http://bugs.python.org/file43814/method4-change-all-errors-if-possible.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27582> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27582] Mispositioned SyntaxError caret for unknown code points
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. So there are a few possibilities, corresponding to the patches I'm attaching. 1) Change the way this one specific error is handled, in tokenizer.c verify_identifier(). If it finds an error, adjust tok->cur to point to the beginning of it. No new failures in test suite. 2) As above, but also change tok->inp, because of this comment in tokenizer.h:31 /* NB If done != E_OK, cur must be == inp!!! */ which I have no idea about the meaning of. This results in truncated error messages, but suggests that method 1 might be breaking an invariant that results in breakage elsewhere. If there are, though, they're not exercised by 'make test', which itself may be a problem. No new test failures. 3) Change the handling of ALL parser errors, in parsetok.c parsetok(), so now they all point to tok->start. Octal literals with 8s or 9s in them now get the caret pointing to the invalid digit, rather than the end of the literal. Unterminated strings point to the opening quote. And some forms of IndentationError now segfault Python. Test suite fails (unsurprisingly). 4) In response to the above segfault, hack it back to the old way of doing things if there's no tok->start. Maybe the condition should be done differently? No new failures in the test suite. I'd ideally like to use the technique from method 3 (either as patch 4 or with some other guard condition). Failing that, can anyone explain the "NB" above, and what ought to be done to comply with it? -- keywords: +patch Added file: http://bugs.python.org/file43811/method1-change-cur.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27582> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27582] Mispositioned SyntaxError caret for unknown code points
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 this is a duplicate of 2382. (Side point: There appears to be quite a bit of complexity inside the CPython parser to cope with the fact that it does everything in UTF-8 bytes rather than simply decoding to text and lexing that. I presume that's for the sake of efficiency - that it'd be too slow to work through PyUnicode everywhere?) Am looking into the rest. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27582> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue27582] Mispositioned SyntaxError caret for unknown code points
Changes by Chris Angelico <ros...@gmail.com>: -- nosy: +Rosuav ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue27582> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue26823] Shrink recursive tracebacks
Chris Angelico added the comment: By "doesn't keep track of call chains", you mean that it can't handle mutually-recursive functions, right? Still useful. -- nosy: +Rosuav ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26823> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue26805] Refer to types.SimpleNamespace in namedtuple documentation
Changes by Chris Angelico <ros...@gmail.com>: -- nosy: +Rosuav ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26805> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue26763] Update PEP-8 regarding binary operators
Chris Angelico added the comment: Typo fixed in peps repo. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26763> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue26763] Update PEP-8 regarding binary operators
Changes by Chris Angelico <ros...@gmail.com>: -- nosy: +Rosuav ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26763> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue26576] Tweak wording of decorator docos
Chris Angelico added the comment: The remaining difference that's actually of use, perhaps. But the decoration itself happens before the name is bound. It's impossible to describe in Python code; but it can be probed - you can monkeypatch a class using a decorator: def monkeypatch(cls): orig = globals()[cls.__name__] # Undocumented magic print("Monkeypatch",id(cls),"into",id(orig)) for attr in dir(cls): if not attr.startswith("_"): setattr(orig,attr,getattr(cls,attr)) return orig class Foo: def method1(self): print("I am method 1") print("Foo is currently",id(Foo)) some_object = Foo() @monkeypatch class Foo: def method2(self): print("I am method 2") print("Foo is now",id(Foo)) some_object.method1() some_object.method2() Is this undocumented behaviour? Should it be supported? It works on every Python I've tried it on (CPython 2.7 and 3.6, PyPy2 and PyPy3, Jython, and MicroPython), but it's not something I'd depend on in production code unless it's documented. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26576> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue26576] Tweak wording of decorator docos
Chris Angelico added the comment: I may be a committer, but I don't push to cpython - just to the peps. But sure, pretty little logo :) -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26576> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue26576] Tweak wording of decorator docos
New submission from Chris Angelico: The official documentation declares an unambiguous equivalence which is not true in some corner cases: @deco def f(x): pass is not quite the same as def f(x): pass f = deco(f) as the name is never bound to the undecorated function. This is what makes @property and @prop.setter work; otherwise, the undecorated setter function would overwrite the property, and the decoration would fail. Attached patch loosens the wording slightly to "broadly equivalent"; this permits corner cases to vary from the equivalence, while still retaining its simplicity for the 99% of cases where it's correct. (Think of explaining "yield from iter" as "for x in iter: yield x" and you have a similar near-equivalence.) Also, class decorators aren't required to return classes. Text removed saying that they do. -- assignee: docs@python components: Documentation files: deco-docos.patch keywords: patch messages: 261888 nosy: Rosuav, docs@python priority: normal severity: normal status: open title: Tweak wording of decorator docos Added file: http://bugs.python.org/file42181/deco-docos.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26576> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue26576] Tweak wording of decorator docos
Chris Angelico added the comment: Sure - changing it to "roughly". I started with that wording, and then changed to "broadly", for reasons which I now can't remember - so they can't have been too important. Consistency wins. -- Added file: http://bugs.python.org/file42214/deco-docos.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26576> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue26576] Tweak wording of decorator docos
Chris Angelico added the comment: Sounds good to me. Replacement patch. -- Added file: http://bugs.python.org/file42182/deco-docos.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26576> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue26576] Tweak wording of decorator docos
Chris Angelico added the comment: Question: Is it worth having an explanation somewhere of exactly what *does* happen? To what extent is it guaranteed by the language? -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26576> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue26221] awaiting asyncio.Future swallows StopIteration
Chris Angelico added the comment: Opened https://github.com/python/asyncio/pull/322 -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26221> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue26221] awaiting asyncio.Future swallows StopIteration
Chris Angelico added the comment: Wording changed, and a simple test added. I'm currently seeing failures in test_site, but that probably means I've messed something up on my system. -- Added file: http://bugs.python.org/file41986/no_stop_iter.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26221> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue26221] awaiting asyncio.Future swallows StopIteration
Chris Angelico added the comment: How about "StopException interacts badly with generators and cannot be raised into a Future"? -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26221> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue26221] awaiting asyncio.Future swallows StopIteration
Chris Angelico added the comment: POC patch, no tests. Is TypeError right? Should it be ValueError, since the notional type is "Exception"? -- keywords: +patch Added file: http://bugs.python.org/file41980/no_stop_iter.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26221> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue26221] awaiting asyncio.Future swallows StopIteration
Chris Angelico added the comment: Ultimately, it's the exact same thing that PEP 479 is meant to deal with - raising StopIteration is functionally identical to returning. I don't use asyncio enough to be certain, but I'm not aware of any good reason to inject a StopIteration into it; maybe an alternative solution is to add a check in set_exception "if isinstance(exception, StopIteration): raise DontBeAFool"? -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue26221> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18018] SystemError: Parent module '' not loaded, cannot perform relative import
Chris Angelico added the comment: If someone made a new way of importing and had it raise ValueError on some issue or other, I think there'd be complete consensus that that's the wrong exception. Yes, this is incompatible with Python 2 - but there are a lot of corner cases in the 3.3+ import code that differ from 2.7. What we have is a code error ("relative imports outside of packages don't make sense, dummy!") and the only difference is which exception is being raised (ValueError, SystemError, ImportError). It's not like working code has different semantics. But even if ValueError is chosen, I would still greatly prefer that to SystemError. When my student told me he was getting SystemError, I started trying to diagnose a corrupted venv, not a buggy script. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue18018> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue25956] Unambiguous representation of recursive objects
Chris Angelico added the comment: LGTM. I'm currently seeing failures in test_ssl, but they weren't introduced by this patch. I'll run with this patch and see if I run into any third party test failures. +1 on the change. -- nosy: +Rosuav ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25956> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue25899] Unnecessary non-ASCII characters in standard library
Chris Angelico added the comment: Whoops! Meant to include that as a second attachment. Now attached. It's a quickly-thrown-together thing and not fully PEP 8 compliant. -- Added file: http://bugs.python.org/file41346/nonascii.py ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25899> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue25899] Unnecessary non-ASCII characters in standard library
Chris Angelico added the comment: There are non-ASCII dashes and apostrophes in .rst files; are they worth cleaning up? -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25899> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue25899] Unnecessary non-ASCII characters in standard library
Chris Angelico added the comment: Oops, didn't see Victor's comment. (How do I get notified when someone posts a patch review?) New patch uploaded which does this. Note that Steven D'Aprano has expressed the opposite desire - that non-ASCII text be kept, as it should be acceptable and its presence makes for good toolchain testing. Noseying him in for his input. -- nosy: +steven.daprano Added file: http://bugs.python.org/file41351/asciify.diff ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25899> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue25899] Unnecessary non-ASCII characters in standard library
Chris Angelico added the comment: Misc/NEWS has a UTF-8 BOM. Otherwise, it and Misc/HISTORY look fine (all names and other legit cases). Lib/idlelib/CREDITS.txt and Lib/idlelib/README.txt both have non-UTF8 text in them. I don't understand what's with the first line of .bzrignore, so I'm (pun fully intended) ignoring it. Modules/_ctypes/libffi/ChangeLog has several non-ASCII markers, but it looks to be a historical record, so I'm not sure it should be tampered with. Expanded patch attached. That egrep needs --color to do its highlighting, if it's not the default. -- Added file: http://bugs.python.org/file41349/asciify.diff ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25899> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue25899] Unnecessary non-ASCII characters in standard library
Chris Angelico added the comment: Another version of detection script attached. -- Added file: http://bugs.python.org/file41350/nonascii.py ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25899> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue25899] Unnecessary non-ASCII characters in standard library
Chris Angelico added the comment: As an alternative to checking only *.py, the second version uses the 'file' command to recognize text files. Run from the cpython top-level directory (rather than Lib/), it finds a large number of additional results, many of which appear to have a UTF-8 BOM. Are they also worth removing? -- Added file: http://bugs.python.org/file41348/nonascii.py ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25899> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue25899] Unnecessary non-ASCII characters in standard library
Chris Angelico added the comment: So Lib/idlelib/README.txt would decode wrongly in anything other than a Windows codepage? Seems a good reason to asciify line 3. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25899> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue25899] Unnecessary non-ASCII characters in standard library
Chris Angelico added the comment: Ah, got it. That definitely settles Idle's CREDITS.txt. Are there any locale encodings where \x92 isn't an apostrophe? -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25899> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue25903] SUGGESTION: Optimize code in PYO
Chris Angelico added the comment: The trouble with that example is that the semantics aren't the same. The isinstance check will also be true for subclasses of int (for instance, isinstance(True,int) is True), but the equality check will catch only exact matches. And that's even before considering that anything can be overridden - the name 'type' or 'int' might have been rebound, or the type object might have an __eq__ method, etc, etc. If you want to look into CPython optimization, hang out on the python-dev mailing list (and read its recent archives); there's a current project called "FAT Python" which does a lot of changes of this nature, and it has to cope with certain questions (like "what if this has been rebound?"). This isn't a simple problem, but it's one people are looking into. -- nosy: +Rosuav ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25903> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue25899] Unnecessary non-ASCII characters in standard library
New submission from Chris Angelico: Discussion on python-list led to searching out unnecessary non-ASCII in the stdlib. While there are places where non-ASCII text is good and worthwhile (eg in comments identifying people such as Łukasz Langa, Peter Åstrand, Martin v. Löwis, and Gerhard Häring, or code specifically demonstrating or implementing non-ASCII behaviour), there are some instances which are unnecessary. Attached is a patch converting apostrophes, dashes, and one space. -- components: Library (Lib) files: asciify.diff keywords: patch messages: 256647 nosy: Rosuav priority: normal severity: normal status: open title: Unnecessary non-ASCII characters in standard library versions: Python 3.6 Added file: http://bugs.python.org/file41344/asciify.diff ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25899> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue25446] smtplib.py AUTH LOGIN code messed up sending login and password data since 3.5
Changes by Chris Angelico <ros...@gmail.com>: -- nosy: +Rosuav ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25446> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6259] ctypes pointer arithmetic
Chris Angelico added the comment: Fair enough. Still needs someone to update the patch though. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue6259> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue6259] ctypes pointer arithmetic
Chris Angelico added the comment: Nudging this as a forgotten patch. Is anyone at all interested in this, or should it be closed as not worth the hassle? The patch is ancient and doesn't apply to 3.6. Propose closing, to clean up the tracker. It can always be reopened if the patch is updated to current. -- nosy: +Rosuav ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue6259> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue25375] Don't mention 2.2 in the 3.x docs
New submission from Chris Angelico: See: https://mail.python.org/pipermail/python-list/2015-October/697818.html Saying "In Python 2.2" is not helpful in the 3.x docs. Even in the 2.x docs, it's pretty safe to assume by now that everyone's on 2.2+. (At very least, "Since" would be better than "If".) Patch attached. I suspect that a lot of that FAQ is outdated now, though. -- assignee: docs@python components: Documentation files: no_mention_2.2.patch keywords: patch messages: 252769 nosy: Rosuav, docs@python priority: normal severity: normal status: open title: Don't mention 2.2 in the 3.x docs Added file: http://bugs.python.org/file40750/no_mention_2.2.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25375> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22228] Adapt bash readline operate-and-get-next function
Chris Angelico added the comment: Any other interest in this? It'd be nice to get this in trunk and start being able to recommend it to people. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue8> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20216] Misleading docs for sha1, sha256, sha512, md5 modules
Chris Angelico added the comment: "bytes of binary data" seems redundant - how about just "byte string"? Otherwise, sure. -- nosy: +Rosuav ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue20216> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue12813] uuid4 is not tested if a uuid4 system routine isn't present
Chris Angelico added the comment: 3.6 doesn't have this check, so I would say that yes, this has indeed been fixed. Issue can be closed fixed. -- nosy: +Rosuav ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue12813> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue25371] select.select docstring needs comma
New submission from Chris Angelico: The grammar of the IMPORTANT NOTICE on the select module and the select.select function wants a comma, I think. Patch attached. -- assignee: docs@python components: Documentation files: add_comma.patch keywords: patch messages: 252750 nosy: Rosuav, docs@python priority: normal severity: normal status: open title: select.select docstring needs comma Added file: http://bugs.python.org/file40745/add_comma.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25371> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue18769] argparse remove subparser
Chris Angelico added the comment: Patch applies cleanly to 3.6 and doesn't appear to add any new test failures (3.6 currently has a couple). Needs its own test, though. -- nosy: +Rosuav versions: +Python 3.6 -Python 3.5 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue18769> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue15999] Using new 'bool' format character
Chris Angelico added the comment: Has this been entirely superseded by Argument Clinic? -- nosy: +Rosuav ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue15999> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue25106] Hash computation speedup for {buffer, string, unicode}object
Chris Angelico added the comment: +1 for anything that makes Python faster with provably no semantic changes. -- ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25106> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue25106] Hash computation speedup for {buffer, string, unicode}object
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 <rep...@bugs.python.org> <http://bugs.python.org/issue25106> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue25068] The proxy key's string should ignore case.
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 than string.lower(type). -- nosy: +Rosuav ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue25068> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24684] socket.getaddrinfo(host) doesn't ensure that host.encode() returns a byte string
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"? Is there something I've missed here? -- keywords: +patch nosy: +Rosuav Added file: http://bugs.python.org/file40434/dont_assert.patch ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue24684> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24684] socket.getaddrinfo(host) doesn't ensure that host.encode() returns a byte string
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 ___ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue24684> ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24707] Assertion failed in pymonotonic_new
Chris Angelico added the comment: Ah. It's one of *those* bugs. Got it. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24707 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24707] Assertion failed in pymonotonic_new
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 the VM. Any other information that would help? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24707 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24610] Incorrect example Unicode string in docs footnote
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 rep...@bugs.python.org http://bugs.python.org/issue24610 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24610] Incorrect example Unicode string in docs footnote
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 display them the same way, but prepend another letter to the string and it's clear that the combining cedilla is attached to that and not to the C.) Switching the two escape sequences makes the example work. Patch attached. -- assignee: docs@python components: Documentation files: cedilla_docs.patch keywords: patch messages: 246599 nosy: Rosuav, docs@python priority: normal severity: normal status: open title: Incorrect example Unicode string in docs footnote versions: Python 3.6 Added file: http://bugs.python.org/file39894/cedilla_docs.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24610 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24536] os.pipe() should return a structsequence (or namedtuple.)
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 rep...@bugs.python.org http://bugs.python.org/issue24536 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue24435] Grammar/Grammar points to outdated guide
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: 245180 nosy: Rosuav priority: normal severity: normal status: open title: Grammar/Grammar points to outdated guide ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue24435 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22906] PEP 479: Change StopIteration handling inside generators
Chris Angelico added the comment: Weird. Tests ran fine on my machine too. Interestingly, that number is 0xdbdbdbdbdbdbdbda - does that mean anything? (It's negative 0x2424242424242426, for what that's worth.) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22906 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22906] PEP 479: Change StopIteration handling inside generators
Chris Angelico added the comment: Thanks everyone for all the help getting this to land! This is going to be a part of my active python3 binary from now on :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22906 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22906] PEP 479: Change StopIteration handling inside generators
Chris Angelico added the comment: The comment was general because I honestly had no idea what was needed still. All I knew was that the patch seemed to work for me, all tests passing (including the new one). Thanks for uploading the new patch; it compiles happily, and I'm running tests now, although that probably won't prove anything new. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22906 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22906] PEP 479: Change StopIteration handling inside generators
Chris Angelico added the comment: You sure can! Take it, deploy it, run the test suite, and then start writing real code that uses it. When you find a problem, that's what needs help! :) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22906 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22906] PEP 479: Change StopIteration handling inside generators
Chris Angelico added the comment: Stinner, not sure what you mean by first part / second part. Is there a way for me to withdraw the first two versions of the patch and just keep #37646? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22906 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22906] PEP 479: Change StopIteration handling inside generators
Chris Angelico added the comment: Had a peek at the 2.7 branch in the web (https://hg.python.org/cpython/file/4234b0dd2a54/Lib/test) and all the tests appear to be testing the behaviour *with* the future directive, not bothering to test the old behaviour. It makes sense - that way, when the future directive becomes permanent, there's no suddenly-failing test - can someone confirm that that's the intention? The current test simply triggers a StopIteration and verifies that RuntimeError comes up off it, without testing the current behaviour, nor testing any of the aspects that haven't changed. I'm basically assuming that generators themselves are adequately tested elsewhere, such that a bug in the PEP 479 code that breaks generators in any other way should be caught by a test failure someplace else. Can anyone think of other aspects of PEP 479 that need to be tested? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22906 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23614] Opaque error message on UTF-8 decoding to surrogates
Chris Angelico added the comment: Got around to tracking down where this is actually being done. It's in Objects/stringlib/codecs.h and it looks to be a hot area for optimization. I don't want to fiddle with it without knowing a lot about the performance implications (UTF-8 encode/decode being a pretty common operation), and since my knowledge of CPU operation costs is about fifteen or twenty years out of date, it's probably best I not do this. It would be nice if the message could be improved per Ezio's suggestion, but that would mean returning more information to the caller. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23614 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue22906] PEP 479: Change StopIteration handling inside generators
Chris Angelico added the comment: Simple test case for the future directive. Needs expansion. -- Added file: http://bugs.python.org/file39079/test_pep479.py ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue22906 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23614] Opaque error message on UTF-8 decoding to surrogates
Chris Angelico added the comment: Nice document. Is that actually how Python's decoder checks things? Does the decoder have different definitions of valid continuation byte based on the lead byte? If that's the case... well, ten out of ten for complying with the spec, to be sure, but unfortunately it leads to some opaque error messages! I haven't looked into the code even a little bit, but would it be possible to have a specific error message attached to certain invalid continuation bytes? * E0 followed by 80..9F: non-shortest form * ED followed by A0..BF: surrogate * F4 followed by 90..BF: outside defined range If that's too hard, it'd at least be helpful to point out that the invalid continuation byte is not the same as the byte 0x?? in position ? - the rejection here is actually of the B4 that follows it. How does this look? UnicodeDecodeError: 'utf-8' codec can't decode byte 0xed in position 0: invalid continuation byte 0xb4 for this start byte (BTW, I think Pike's decoder just always emits two bytes, no matter what the actual errant stream (after all, there's no way to know how many bytes ought to have been one character, when there's an error in it). So it's incomplete, yes, but when you're dealing with wrong data, completeness isn't all that possible anyway.) -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23614 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue23614] Opaque error message on UTF-8 decoding to surrogates
New submission from Chris Angelico: b\xed\xb4\x80.decode(utf-8) Traceback (most recent call last): File stdin, line 1, in module UnicodeDecodeError: 'utf-8' codec can't decode byte 0xed in position 0: invalid continuation byte The actual problem here is that this byte sequence would decode to U+DD00, which, being a surrogate, is invalid for the encoding. It's correct to raise UnicodeDecodeError, but the text of the message is a bit obscure. I'm not sure whether the invalid continuation byte is talking about the 0xed in position 0 or about one of the others; 0xED is not a continuation byte, it's a start byte - and a perfectly valid one: b\xed\x9f\xbf.decode(utf-8) '\ud7ff' Pike is more explicit about what the problem is: utf8_to_string(\xed\xb4\x80); UTF-8 sequence beginning with 0xed 0xb4 at index 0 would decode to a UTF-16 surrogate character. Is this something worth fixing? Tested on 3.4.2 and a recent build of 3.5, probably applies to most 3.x versions. (2.7 actually permits this, which is a bigger bug, but one with backward-compatibility issues.) -- components: Interpreter Core, Unicode messages: 237572 nosy: Rosuav, ezio.melotti, haypo priority: normal severity: normal status: open title: Opaque error message on UTF-8 decoding to surrogates versions: Python 3.4, Python 3.5 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23614 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com