[issue24809] Add getprotobynumber to socket module

2015-08-06 Thread Yury Selivanov
Yury Selivanov added the comment: What are the use cases? If it's "(Rarely used.)" (as docstring indicates), then, perhaps, a package on PyPI is a better solution. -- nosy: +haypo, yselivanov versions: +Python 3.6 -Python 3.5 ___

[issue24806] Inheriting from NoneType does not fail consistently

2015-08-06 Thread Yury Selivanov
Changes by Yury Selivanov : -- nosy: +benjamin.peterson, yselivanov versions: -Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5 ___ Python tracker <http://bugs.python.org/issue24

[issue23812] asyncio.Queue.put_nowait(), followed get() task cancellation leads to item being lost

2015-08-06 Thread Yury Selivanov
Yury Selivanov added the comment: Guido, Victor, I've just pushed a commit to fix a misspelled method call in queues.py (related to the previous commit in this issue). Along with fixing the bug and writing a unittest for it, I discovered an issue with the current queues design. Here

[issue23812] asyncio.Queue.put_nowait(), followed get() task cancellation leads to item being lost

2015-08-06 Thread Yury Selivanov
Yury Selivanov added the comment: > Honestly, I've lost track of the queue design. Maybe the push-back on > cancellation is just wrong? After all, if a coroutine has received an item, > it's out of the queue, even if it gets cancelled before it can do anything > with

[issue23812] asyncio.Queue.put_nowait(), followed get() task cancellation leads to item being lost

2015-08-06 Thread Yury Selivanov
Yury Selivanov added the comment: > A better design is to make it so the future that get() is waiting for doesn't > actually receive the item, it is only used to "wake up" the get() coroutine. > I would be something like: > > 1. get(): in case the queue is emp

[issue24824] Pydoc fails with codecs

2015-08-07 Thread Yury Selivanov
Yury Selivanov added the comment: This is related to Arguments Clinic and Larry's implementation of signature parsing for built-in functions. This particular bug is caused by 'codecs.encode' & 'codecs.decode' functions with the AC signatures defined as follows

[issue23812] asyncio.Queue.put_nowait(), followed get() task cancellation leads to item being lost

2015-08-07 Thread Yury Selivanov
Yury Selivanov added the comment: Guido, I agree, let's not push the updated implementation in 3.5.0. Gustavo, could you please generate the patch with "hg diff", so that code review here works? And I think we need a new issue to track the new patch. -- nosy:

[issue23812] asyncio.Queue.put_nowait(), followed get() task cancellation leads to item being lost

2015-08-07 Thread Yury Selivanov
Changes by Yury Selivanov : -- nosy: -larry priority: release blocker -> deferred blocker ___ Python tracker <http://bugs.python.org/issue23812> ___ ___ Py

[issue24383] consider implementing __await__ on concurrent.futures.Future

2015-08-07 Thread Yury Selivanov
Yury Selivanov added the comment: Alex, sure, go ahead. Although I think python-ideas would be a better choice. -- ___ Python tracker <http://bugs.python.org/issue24

[issue23812] asyncio.Queue.put_nowait(), followed get() task cancellation leads to item being lost

2015-08-07 Thread Yury Selivanov
Yury Selivanov added the comment: Yep, GH works. Thanks! -- ___ Python tracker <http://bugs.python.org/issue23812> ___ ___ Python-bugs-list mailing list Unsub

[issue24824] Pydoc fails with codecs

2015-08-08 Thread Yury Selivanov
Yury Selivanov added the comment: Larry, Serhiy, After giving this some thought I think that my initial patch is a wrong approach here -- inspect module should not be touched to fix this issue. With this patch applied, signature object for codecs.encode would have a Parameter with a bogus

[issue24824] Pydoc fails with codecs

2015-08-08 Thread Yury Selivanov
Yury Selivanov added the comment: > Can we do better? How about a new field on the Parameter object, > "symbolic_default_value", which shows you the expression used to compute the > value? We could then set default_value to the result of the expression, > pydoc co

[issue24835] Consistent failure in test_asyncio on Windows 7 buildbot

2015-08-09 Thread Yury Selivanov
Yury Selivanov added the comment: I can commit the fix in an hour or so. -- nosy: +Yury.Selivanov ___ Python tracker <http://bugs.python.org/issue24835> ___ ___

[issue24835] Consistent failure in test_asyncio on Windows 7 buildbot

2015-08-09 Thread Yury Selivanov
Yury Selivanov added the comment: Guido, thanks for investigating this. Larry, it should be fixed now (although I don't have a windows machine at hand to test it) -- ___ Python tracker <http://bugs.python.org/is

[issue24835] Consistent failure in test_asyncio on Windows 7 buildbot

2015-08-09 Thread Yury Selivanov
Changes by Yury Selivanov : -- resolution: -> fixed stage: needs patch -> resolved status: open -> closed ___ Python tracker <http://bugs.python.or

[issue24835] Consistent failure in test_asyncio on Windows 7 buildbot

2015-08-10 Thread Yury Selivanov
Yury Selivanov added the comment: > Yury: be careful when synchonizing github and cpython code. It's common to have changes only on one side. Victor, I agree. But let's make sure that it's no more "common" to have two repos out of sync. I shouldn't syn

[issue24840] implement bool conversion for enums to prevent odd edge case

2015-08-10 Thread Yury Selivanov
Changes by Yury Selivanov : -- nosy: +ethan.furman ___ Python tracker <http://bugs.python.org/issue24840> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue24844] Python 3.5rc1 compilation error on OS X 10.8

2015-08-11 Thread Yury Selivanov
Changes by Yury Selivanov : -- nosy: +benjamin.peterson, ned.deily, yselivanov priority: normal -> release blocker ___ Python tracker <http://bugs.python.org/issu

[issue24851] infinite loop in faulthandler._stack_overflow

2015-08-12 Thread Yury Selivanov
Changes by Yury Selivanov : -- nosy: +haypo ___ Python tracker <http://bugs.python.org/issue24851> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue24867] Asyncio Task.get_stack fails with native coroutines

2015-08-14 Thread Yury Selivanov
Yury Selivanov added the comment: Looks like we didn't have unittests for Task.get_stack()/Task.print_stack(). Anyways, it's now fixed, I'll make a PR for Larry to get this in 3.5.0rc2. -- assignee: -> yselivanov nosy: +larry priority: normal -> release blocker

[issue24879] Pydoc to list data descriptors in _fields order if it exists

2015-08-17 Thread Yury Selivanov
Yury Selivanov added the comment: Can this be enabled only for namedtuples? Otherwise this might be a backwards incompatible change, for example: class Foo: '''spam''' _fields = None -- nosy: +yselivanov ___

[issue24879] Pydoc to list data descriptors in _fields order if it exists

2015-08-17 Thread Yury Selivanov
Yury Selivanov added the comment: > Named tuples are not a type, they are a protocol. Guido has agreed that > checking for _fields is an acceptable and preferred way of finding out > whether something is a namedtuple. They are, but for protocols we usually use dunder names. "

[issue23572] functools.singledispatch fails when "not BaseClass" is True

2015-08-18 Thread Yury Selivanov
Yury Selivanov added the comment: > I was also bitten by this via Enum. Is there any chance this will be fixed in > Python 3.5? It will be fixed in 3.5.1. Thanks for the patch, Ethan! -- nosy: +yselivanov resolution: -> fixed status: open

[issue23572] functools.singledispatch fails when "not BaseClass" is True

2015-08-18 Thread Yury Selivanov
Changes by Yury Selivanov : -- versions: +Python 3.6 ___ Python tracker <http://bugs.python.org/issue23572> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue24692] types.coroutines() idempotence documentation

2015-08-18 Thread Yury Selivanov
Yury Selivanov added the comment: Is this still something that we need to address? I think that the current types.coroutine docs are pretty accurate and don't see where the proposed patch really improves them. -- nosy: +yselivanov ___ P

[issue24710] Class name hardcoded in TracebackException.from_exception()

2015-08-18 Thread Yury Selivanov
Yury Selivanov added the comment: LGTM. FWIW, using 'self.from_exception(..)' is better because this way it's easier to override the method. Another way would be to write 'type(self).from_exception(..)', but I think using 'self' is good en

[issue4356] Add "key" argument to "bisect" module functions

2015-08-18 Thread Yury Selivanov
Changes by Yury Selivanov : -- nosy: +yselivanov ___ Python tracker <http://bugs.python.org/issue4356> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue24931] _asdict breaks when inheriting from a namedtuple

2015-08-24 Thread Yury Selivanov
Changes by Yury Selivanov : -- nosy: +rhettinger ___ Python tracker <http://bugs.python.org/issue24931> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue24941] classproperty

2015-08-26 Thread Yury Selivanov
Changes by Yury Selivanov : -- components: +Interpreter Core nosy: +yselivanov stage: -> needs patch type: -> enhancement versions: +Python 3.6 ___ Python tracker <http://bugs.python.org/i

[issue23630] support multiple hosts in create_server/start_server

2015-08-26 Thread Yury Selivanov
Yury Selivanov added the comment: > Here is a new patch, with modifications according to your review Victor. Could you please generate the patch with 'hg diff', so that code review works with it. -- ___ Python tracker <http:/

[issue23630] support multiple hosts in create_server/start_server

2015-08-26 Thread Yury Selivanov
Yury Selivanov added the comment: Left some feedback in the code review. I have a question about the api: so we allow to pass a set of hosts to create_server, but why do we have only a single port? -- ___ Python tracker <http://bugs.python.

[issue23630] support multiple hosts in create_server/start_server

2015-08-27 Thread Yury Selivanov
Yury Selivanov added the comment: > How am I supposed to handle the method being called with a Mock'ed > getaddrinfo? Why would you call it that way? Are regular asyncio users going to mock it in their production/test code? If the only case for using mocks there are asynci

[issue23630] support multiple hosts in create_server/start_server

2015-08-27 Thread Yury Selivanov
Yury Selivanov added the comment: Thanks! The only remaining question is is it OK that we can specify more than one host but only one port? Guido, Victor? -- ___ Python tracker <http://bugs.python.org/issue23

[issue23630] support multiple hosts in create_server/start_server

2015-08-27 Thread Yury Selivanov
Yury Selivanov added the comment: > Yeah, I think this is fine. I think the use case for multiple hosts is very > different than that for multiple ports, so I see no reason to link the two > features, and multiple ports hasn't been requested. OK! > The patch has a long

[issue24975] Python 3.5 can't compile AST involving PEP 448 unpacking

2015-08-31 Thread Yury Selivanov
Yury Selivanov added the comment: Good find, David. Thanks! Please review the attached patch. -- keywords: +patch nosy: +benjamin.peterson, larry, ncoghlan, serhiy.storchaka, yselivanov priority: normal -> release blocker stage: -> patch review versions: +Python 3.6 Added file

[issue24965] Implement PEP 498: Literal String Formatting

2015-09-01 Thread Yury Selivanov
Changes by Yury Selivanov : -- nosy: +yselivanov ___ Python tracker <http://bugs.python.org/issue24965> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue24975] Python 3.5 can't compile AST involving PEP 448 unpacking

2015-09-01 Thread Yury Selivanov
Yury Selivanov added the comment: Larry, I created a PR for you: https://bitbucket.org/larry/cpython350/pull-requests/10/issue-24975-fix-ast-compilation-for-pep/diff Brett, Should we do that in a separate issue targeting 3.6 only? -- ___ Python

[issue24981] Add a test which uses the ast module to compile the stdlib

2015-09-01 Thread Yury Selivanov
Changes by Yury Selivanov : -- nosy: +yselivanov ___ Python tracker <http://bugs.python.org/issue24981> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue23630] support multiple hosts in create_server/start_server

2015-09-02 Thread Yury Selivanov
Yury Selivanov added the comment: > I can be convenient to have a single Server object with *all* listening > sockets. So I like the idea of supporting multiple ports. It's very cheap to > support it. I like the idea too, but I'm not sure how to redesign the function

[issue23630] support multiple hosts in create_server/start_server

2015-09-02 Thread Yury Selivanov
Yury Selivanov added the comment: > - accept host and port arguments being sequences and then we bind to all > host:port combinations. Like if len(host) == N and len(port) == M, we bind to > N*M sockets. I can't think of a real life example for this. But if you need that, y

[issue23630] support multiple hosts in create_server/start_server

2015-09-02 Thread Yury Selivanov
Yury Selivanov added the comment: Yann, I'll commit this as soon as 3.5.0 and 3.4.4 are out. -- ___ Python tracker <http://bugs.python.org/issue23630> ___ ___

[issue24975] Python 3.5 can't compile AST involving PEP 448 unpacking

2015-09-02 Thread Yury Selivanov
Yury Selivanov added the comment: Thanks Nick and Larry for code reviews and merge! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <http://bugs.python.or

[issue24992] collections.OrderedDict constructor (odict_new) doesn't handle PyDict_New() failure

2015-09-03 Thread Yury Selivanov
Yury Selivanov added the comment: Is this something that we should ship in 3.5.0rc3? -- nosy: +yselivanov ___ Python tracker <http://bugs.python.org/issue24

[issue24995] better exception message when an unsupported object is passed to `async for` (pep 492)

2015-09-03 Thread Yury Selivanov
New submission from Yury Selivanov: Should we raise something like "'int' object is not an asynchronous iterable", instead of "'async for' requires an object with __aiter__ method, got int"? >>> foo().send(None) Traceback (most recent call la

[issue24995] better exception message when an unsupported object is passed to `async for` (pep 492)

2015-09-03 Thread Yury Selivanov
Yury Selivanov added the comment: I saw this reddit thread: https://www.reddit.com/r/Python/comments/3ewnwq/async_function_as_generator_for_async_for/ where people are struggling with understanding how 'async for' works. Which led me to check what error messages we raise when we pa

[issue25014] Add contextlib.itercm()

2015-09-07 Thread Yury Selivanov
Yury Selivanov added the comment: TBH, I don't like the idea. It would take me some time to digest the code every time I see this. > lines = chain.from_iterable(itercm(open(f)) for f in fnames) This looks like an extremely rare use case. -- nosy: +ys

[issue22980] C extension naming doesn't take bitness into account

2015-09-10 Thread Yury Selivanov
Yury Selivanov added the comment: Larry, Matthias, Steve, Berker - I've mentioned this issue in the whatsnew (applied Larry's patch with some modifications to address comments from Steve and Matthias). Please review. -- ___ Python trac

[issue25073] Document asyncio.test_utils

2015-09-11 Thread Yury Selivanov
Yury Selivanov added the comment: It's meant to be private. -- resolution: -> not a bug stage: needs patch -> resolved status: open -> closed ___ Python tracker <http://bugs.pyth

[issue25073] Document asyncio.test_utils

2015-09-11 Thread Yury Selivanov
Yury Selivanov added the comment: > Agreed, but then why isn't it in the tests directory? I think that the main reason is to make it possible for tests to import some common functionality from 'asyncio' package, when you run them from the cloned github asyncio repo. I

[issue25070] Python 2.6 - Python 3.4 allows unparenthesized generator with *args, **kw, forbidden in 3.5

2015-09-11 Thread Yury Selivanov
Yury Selivanov added the comment: > If we have decided that this is a "fixed bug", [..] I'd call this a bug fix. The old syntax was completely unreadable. Should I close this issue? > [..] it should indeed be mentioned in what's new for 3.5 since it is a >

[issue25070] Python 2.6 - Python 3.4 allows unparenthesized generator with *args, **kw, forbidden in 3.5

2015-09-12 Thread Yury Selivanov
Yury Selivanov added the comment: What's new is now updated with description of this issue. Closing it now. -- resolution: -> wont fix stage: -> resolved status: open -> closed ___ Python tracker <http://bugs.pyth

[issue25082] Editing What's New In Python 3.5

2015-09-13 Thread Yury Selivanov
Yury Selivanov added the comment: > Some modules in the "Improved Modules" section are out of lexicographic > order: csv, ssl. Yes, these two weren't properly ordered by *2nd* letter. Fixed. >>-constructor. All converters defined in config parser (either by su

[issue25082] Editing What's New In Python 3.5

2015-09-13 Thread Yury Selivanov
Yury Selivanov added the comment: And can we point https://docs.python.org/3/ to 3.5 docs? -- ___ Python tracker <http://bugs.python.org/issue25082> ___ ___ Pytho

[issue25082] Editing What's New In Python 3.5

2015-09-13 Thread Yury Selivanov
Yury Selivanov added the comment: Larry, Please rebuild the documentation, we've pushed the last round of edits in 746add37495c. Also, could you please merge 3.5 into default -- I don't know how to resolve some conflicts after your 3.5.0 -> 3.5 merge. > I could add a &

[issue24965] Implement PEP 498: Literal String Formatting

2015-09-13 Thread Yury Selivanov
Changes by Yury Selivanov : -- nosy: +elvis ___ Python tracker <http://bugs.python.org/issue24965> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue25082] Editing What's New In Python 3.5

2015-09-13 Thread Yury Selivanov
Yury Selivanov added the comment: > ssl should be between sqlite3 and subprocess. It makes sense that ssl module description follows the socket module. -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tr

[issue25082] Editing What's New In Python 3.5

2015-09-13 Thread Yury Selivanov
Yury Selivanov added the comment: Thanks, Serhiy! -- ___ Python tracker <http://bugs.python.org/issue25082> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue25113] documentation version switcher is broken

2015-09-14 Thread Yury Selivanov
New submission from Yury Selivanov: The dropdown that allowed to switch the Python version for docs disappeared with py3.5 release. -- messages: 250700 nosy: eric.araujo, ezio.melotti, georg.brandl, larry, yselivanov priority: high severity: normal status: open title: documentation

[issue25113] documentation version switcher is broken

2015-09-16 Thread Yury Selivanov
Yury Selivanov added the comment: The switcher isn't visible on all pages, I suspect we need to bust caches on cdns/varnish -- ___ Python tracker <http://bugs.python.org/is

[issue25114] asynico: add ssl_object extra info

2015-09-21 Thread Yury Selivanov
Yury Selivanov added the comment: the patch lgtm -- ___ Python tracker <http://bugs.python.org/issue25114> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue25233] AssertionError from asyncio Queue get

2015-09-25 Thread Yury Selivanov
Yury Selivanov added the comment: > This looks like an important regression and we should fix it before 3.5.1 > goes out. I agree. Any ETA on 3.5.1? -- ___ Python tracker <http://bugs.python.org/i

[issue25293] Hooking Thread/Process instantiation in concurrent.futures.

2015-10-02 Thread Yury Selivanov
Changes by Yury Selivanov : -- nosy: +yselivanov ___ Python tracker <http://bugs.python.org/issue25293> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue25304] Add run_coroutine_threadsafe() to asyncio

2015-10-04 Thread Yury Selivanov
Yury Selivanov added the comment: > - it is less confusing, because it has the same name and using the same > prototype as `ensure_future` > - it accepts futures and awaitables I like this idea. -- ___ Python tracker <http://bug

[issue25304] Add run_coroutine_threadsafe() to asyncio

2015-10-04 Thread Yury Selivanov
Yury Selivanov added the comment: > But honestly I *don't* want to encourage flipping back and forth between > threads and event loops; I see it as a necessary evil. The name we currently > have is fine from the POV of someone coding in the threaded world who wants > to hand

[issue25304] Add run_coroutine_threadsafe() to asyncio

2015-10-04 Thread Yury Selivanov
Yury Selivanov added the comment: > @yury: but where would you have gotten the awaitable in the first place? It's > easy to see how to get a coroutine -- just define it (with either @coroutine > or async def) and call it -- and I think that's the only use case that > mat

[issue25304] Add run_coroutine_threadsafe() to asyncio

2015-10-05 Thread Yury Selivanov
Yury Selivanov added the comment: >> Should I add a note to explain why the loop argument has to be explicitly passed? (there is a note at the beginning of the `task functions` section stating "In the functions below, the optional loop argument ...") > Oh, that's a good

[issue20438] inspect: Deprecate getfullargspec?

2015-10-25 Thread Yury Selivanov
Yury Selivanov added the comment: > The docs for getargspec currently read, "This function will be removed in > Python 3.6." Why? We keep all sorts of old APIs for the sake of backward > compatibility, why is this one different? getargspec was deprecated since 3.0. Besid

[issue23749] asyncio missing wrap_socket (starttls)

2015-10-26 Thread Yury Selivanov
Yury Selivanov added the comment: Here's an example client implementation with writer.start_tls() (taken from my debug code): @asyncio.coroutine def client(addr): reader, writer = yield from asyncio.open_connection( *addr, loop

[issue25486] Resurrect inspect.getargspec() in 3.6

2015-10-26 Thread Yury Selivanov
New submission from Yury Selivanov: See issue #20438 for more details -- components: Library (Lib) messages: 253499 nosy: yselivanov priority: normal severity: normal stage: needs patch status: open title: Resurrect inspect.getargspec() in 3.6 type: behavior versions: Python 3.6

[issue20438] inspect: Deprecate getfullargspec?

2015-10-26 Thread Yury Selivanov
Yury Selivanov added the comment: > This is the situation I am in: coverage.py uses getargspec in a very simple > way in its tooling. I support 2.7 and 3.5, so I have to do this: try: getargspec = inspect.getfullargspec except AttributeError: geta

[issue20438] inspect: Deprecate getfullargspec?

2015-10-26 Thread Yury Selivanov
Yury Selivanov added the comment: > The thing is, we've adopted a policy that if something exists in python2.7 we > shouldn't delete it in python3 until after 2.7 is officially out of > maintenance (at the earliest), in order to facilitate single-source porting > to pyt

[issue23749] asyncio missing wrap_socket (starttls)

2015-10-26 Thread Yury Selivanov
Yury Selivanov added the comment: Guido, Victor, Please find attached a first draft of the patch. It's a very early attempt (i.e. I'm not including unit tests/docstrings), and its primary purpose is to gather initial feedback. Some points: 1. As discussed earlier, the primary AP

[issue25489] sys.exit() caught in exception handler

2015-10-27 Thread Yury Selivanov
Yury Selivanov added the comment: > because in that case the handler isn't getting called from the Task __del__ It's possible to fix -- see the attached future.patch. And perhaps this should be fixed in Future.__del__ and Task.__del__ -- ignoring BaseException

[issue25489] sys.exit() caught in exception handler

2015-10-27 Thread Yury Selivanov
Yury Selivanov added the comment: I see your points, but we're talking about BaseExceptions here -- KeyboardInterrupt, SystemExit etc. Those things usually mean that the program has to crash. -- ___ Python tracker <http://bugs.py

[issue25489] sys.exit() caught in exception handler

2015-10-27 Thread Yury Selivanov
Yury Selivanov added the comment: Trapping those exceptions in __del__ isn't good. Another way to address this would be to at least modify call_exception_handler to log when an exception handler raises a BaseException error. -- ___ Python tr

[issue25489] sys.exit() caught in exception handler

2015-10-27 Thread Yury Selivanov
Yury Selivanov added the comment: > No, you are talking about *all* exceptions, since they all descend from > BaseException. Python's normal __del__ handling just prints the ignored > exception to stdout, even if it is a BaseException. Why should asyncio be > different (o

[issue23749] asyncio missing wrap_socket (starttls)

2015-11-01 Thread Yury Selivanov
Yury Selivanov added the comment: Guido, Victor, any thoughts about the (proto-)patch? -- ___ Python tracker <http://bugs.python.org/issue23749> ___ ___ Python-bug

[issue25612] nested try..excepts don't work correctly for generators

2015-11-12 Thread Yury Selivanov
New submission from Yury Selivanov: Nested try..except statements with yields can loose reference to the current exception. The following code: class MainError(Exception): pass class SubError(Exception): pass def main(): try: raise MainError

[issue25612] nested try..excepts don't work correctly for generators

2015-11-12 Thread Yury Selivanov
Changes by Yury Selivanov : -- versions: +Python 2.7 ___ Python tracker <http://bugs.python.org/issue25612> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue25612] nested try..excepts don't work correctly for generators

2015-11-12 Thread Yury Selivanov
Yury Selivanov added the comment: This was originally discovered here: https://github.com/python/asyncio/issues/287 -- nosy: +brett.cannon ___ Python tracker <http://bugs.python.org/issue25

[issue25612] nested try..excepts don't work correctly for generators

2015-11-12 Thread Yury Selivanov
Changes by Yury Selivanov : -- nosy: +serhiy.storchaka ___ Python tracker <http://bugs.python.org/issue25612> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue25612] nested try..excepts don't work correctly for generators

2015-11-12 Thread Yury Selivanov
Yury Selivanov added the comment: Another bug: class MainError(Exception): pass class SubError(Exception): pass def main(): try: raise MainError() except MainError: yield coro = main() coro.send(None) coro.throw

[issue25612] nested try..excepts don't work correctly for generators

2015-11-12 Thread Yury Selivanov
Yury Selivanov added the comment: Here's a patch the fixes the first problem (but __context__ bug is still open). I'm not sure that the patch is correct :( But at least I've added new unittests (one still failing) -- keywords: +patch Added file: http://bugs.pytho

[issue25579] def is not a keyword with tokenize.py

2015-11-12 Thread Yury Selivanov
Yury Selivanov added the comment: Stéphane, sorry for not replying earlier, emails from bugs.python.org sometimes go to spam. [TokenInfo(type=55 (ASYNC), string='async', start=(1, 0), end=(1, 5), line='async def foo(): pass'), TokenInfo(type=1 (NAME), string='def&

[issue25580] async and await missing from token list

2015-11-12 Thread Yury Selivanov
Yury Selivanov added the comment: ASYNC/AWAIT tokens are temporary and will be removed in 3.7 -- ___ Python tracker <http://bugs.python.org/issue25580> ___ ___

[issue25580] async and await missing from token list

2015-11-13 Thread Yury Selivanov
Yury Selivanov added the comment: > Are you suggesting that the note should state that these two are temporary? Yes, that would be great. > Or is this information available somewhere else, in What's new, for example? Not directly, I think. It was detailed to some extent in P

[issue25637] Move non-collections-related ABCs out of collections.abc

2015-11-16 Thread Yury Selivanov
Yury Selivanov added the comment: We had this discussion when we were adding Awaitable, AsyncIterable etc. I suggested to simply put them in the top-level 'abc' module (where ABCMeta is defined). -- nosy: +yselivanov ___ Python trac

[issue25643] Python tokenizer rewriting

2015-11-17 Thread Yury Selivanov
Changes by Yury Selivanov : -- nosy: +yselivanov ___ Python tracker <http://bugs.python.org/issue25643> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue25648] asyncio.coroutine fails if asyncio debug mode is enabled and wrapped function don't have "__name__" attribute

2015-11-17 Thread Yury Selivanov
Yury Selivanov added the comment: > So until 3.4.4 is released this issue still may be considered as not fixed. Since this issue is fixed in the repo, and will be shipped in the upcoming 3.5.1 and 3.4.4, I'd suggest to close this issue -- there is nothing to be do

[issue25612] nested try..excepts don't work correctly for generators

2015-11-17 Thread Yury Selivanov
Yury Selivanov added the comment: Can someone work with me on fixing this issue? I think it's important to ship 3.5.1 with this resolved (and 3.4.4 FWIW). -- ___ Python tracker <http://bugs.python.org/is

[issue25304] Add run_coroutine_threadsafe() to asyncio

2015-11-18 Thread Yury Selivanov
Yury Selivanov added the comment: Good catch! Fixed in https://hg.python.org/cpython/rev/b34c42e46e7b -- ___ Python tracker <http://bugs.python.org/issue25

[issue25612] nested try..excepts don't work correctly for generators

2015-11-18 Thread Yury Selivanov
Yury Selivanov added the comment: > Thinking about the __context__ thing some more, I guess it might make sense > for __context__ to be overwritten by the generator context. The same way it > gets overwritten when you execute “raise” inside an exception handler. Not sure I unders

[issue25660] tabs don't work correctly in python repl

2015-11-18 Thread Yury Selivanov
New submission from Yury Selivanov: When Python is compiled with readline, repeatedly pressing key in repl breaks the repl prompt. Below is what I see when I hit 4 times. yury@ysmac ~/dev/py/cpython $ ./python.exe Python 3.5.0+ (3.5:4ae62ddf7bc7+, Nov 18 2015, 14:52:57) [GCC

[issue25660] tabs don't work correctly in python repl

2015-11-18 Thread Yury Selivanov
Yury Selivanov added the comment: > Is this related to the BSD editline library (libedit), or is the actual Gnu > Readline library being used? Apparently you can check for "libedit" in > readline.__doc__ to tell the difference. Great suggestion. So on my machine, macpo

[issue25637] Move non-collections-related ABCs out of collections.abc

2015-11-18 Thread Yury Selivanov
Yury Selivanov added the comment: > I guess is the objection of putting concrete ABCs in the abc module is that > the abc module contains the actual code to implement ABCs and not ABCs > themselves. I think it's a rather weak objection. Having some basic (and fundamental!)

[issue25660] tabs don't work correctly in python repl

2015-11-19 Thread Yury Selivanov
Yury Selivanov added the comment: Attached is a patch that uses different logic for tabulation. Instead of returning '\t' from the completion callback, it instead calls explicit readline API: "readline.insert_text('\t'); readline.redisplay()" Please review. ---

[issue23441] rlcompleter: tab on empty prefix => insert spaces

2015-11-19 Thread Yury Selivanov
Yury Selivanov added the comment: Please see my patch for Issue 25660 -- instead of returning '\t' from the completion function, I use readline API to modify the input buffer directly. -- ___ Python tracker <http://bugs.python.o

[issue25612] nested try..excepts don't work correctly for generators

2015-11-20 Thread Yury Selivanov
Yury Selivanov added the comment: Martin, you might be right here. Guido, do you think it's OK that SubError doesn't have MainError in its __context__? http://bugs.python.org/issue25612#msg254576 -- ___ Python tracker <http://bu

[issue25683] __context__ for yields inside except clause

2015-11-20 Thread Yury Selivanov
New submission from Yury Selivanov: In the below snippet, SubError will propagate with __context__ set to None, instead of MainError. Maybe this isn't a bug? class MainError(Exception): pass class SubError(Exception): pass def main(): try: raise Main

[issue25612] nested try..excepts don't work correctly for generators

2015-11-20 Thread Yury Selivanov
Yury Selivanov added the comment: Anyways, here's a separate issue for the __context__ problem: http://bugs.python.org/issue25683 -- ___ Python tracker <http://bugs.python.org/is

<    20   21   22   23   24   25   26   27   28   29   >