[issue37658] In some cases asyncio.wait_for can lead to socket leak.

2021-05-24 Thread Denis S. Otkidach
Denis S. Otkidach added the comment: Re: msg393586 > See my comment in the PR for a suggestion about an alternative structure for > wait_for, which may avoid this gap and hence prevent the leak (but I have not > tested it!) Unfortunately this didn't close the gap, so the leak pers

[issue37658] In some cases asyncio.wait_for can lead to socket leak.

2021-05-13 Thread Denis S. Otkidach
Denis S. Otkidach added the comment: The original problem can be fixed by wrapping await into try-except block: ``` async def create_connection(ssl_obj): loop = asyncio.get_event_loop() connector = loop.create_connection(MyEchoClientProtocol, '127.0.0.1', 5000, ssl=ssl_obj

[issue42130] AsyncIO's wait_for can hide cancellation in a rare race condition

2021-05-13 Thread Denis S. Otkidach
Change by Denis S. Otkidach : -- keywords: +patch pull_requests: +24737 stage: -> patch review pull_request: https://github.com/python/cpython/pull/26097 ___ Python tracker <https://bugs.python.org/issu

[issue37658] In some cases asyncio.wait_for can lead to socket leak.

2021-05-13 Thread Denis S. Otkidach
Change by Denis S. Otkidach : -- pull_requests: +24738 pull_request: https://github.com/python/cpython/pull/26097 ___ Python tracker <https://bugs.python.org/issue37

[issue37658] In some cases asyncio.wait_for can lead to socket leak.

2021-05-13 Thread Denis S. Otkidach
Denis S. Otkidach added the comment: The current solutions doesn't look correct. It swallows cancelling causing task to hang: https://bugs.python.org/issue42130 . Proposed test case calls cancel for inner future and set_result for outer task in the same loop step. The old (prior

[issue42130] AsyncIO's wait_for can hide cancellation in a rare race condition

2020-10-26 Thread Denis S. Otkidach
Change by Denis S. Otkidach : -- nosy: +ods ___ Python tracker <https://bugs.python.org/issue42130> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue42140] asyncio.wait function creates futures set two times

2020-10-25 Thread Denis S. Otkidach
Denis S. Otkidach added the comment: The current error message is way too cryptic anyway. And restricting it to the set type only, as in docs, will certainly break a lot of code (passing a list is quite common). -- ___ Python tracker <ht

[issue42140] asyncio.wait function creates futures set two times

2020-10-24 Thread Denis S. Otkidach
Change by Denis S. Otkidach : -- nosy: +ods ___ Python tracker <https://bugs.python.org/issue42140> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue36221] Setting PYTHONASYNCIODEBUG breaks warnings

2019-11-26 Thread Denis S. Otkidach
Denis S. Otkidach added the comment: It's fixed in 3.8 final, but the problem persists in 3.7.5 -- versions: -Python 3.8 ___ Python tracker <https://bugs.python.org/issue36

[issue34364] problem with traceback for syntax error in f-string

2019-05-28 Thread Denis S. Otkidach
Change by Denis S. Otkidach : -- nosy: +ods ___ Python tracker <https://bugs.python.org/issue34364> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue37065] File and lineno is not reported for syntax error in f-string

2019-05-27 Thread Denis S. Otkidach
New submission from Denis S. Otkidach : Minimal example to reproduce: -->8-- >>> with open('f_bug.py', 'w') as fp: ... fp.write('f"{a b}"') ... 8 >>> import f_bug Traceback (most recent call last): File "", line 1, in File "", li

[issue36221] Setting PYTHONASYNCIODEBUG breaks warnings

2019-03-06 Thread Denis S. Otkidach
New submission from Denis S. Otkidach : Test script: -->8-- import asyncio @asyncio.coroutine def test(): with (yield from asyncio.Lock()): pass asyncio.run(test()) -->8-- Correct behavior without flag (warning is reported and points to correct line of code): --- $

[issue10935] wsgiref.handlers.BaseHandler and subclasses of str

2011-01-20 Thread Denis S. Otkidach
Denis S. Otkidach denis.otkid...@gmail.com added the comment: Phillip, your argument about interfacing with code written in C doesn't work for built-in immutable types like str. Any subclass of str must call str.__new__ thus keeping proper internal state

[issue10935] wsgiref.handlers.BaseHandler and subclasses of str

2011-01-19 Thread Denis S. Otkidach
Denis S. Otkidach denis.otkid...@gmail.com added the comment: Current behavior is unpythonic: documentation explicitly mentions isinstance as preferred way to check type (see http://docs.python.org/library/types.html ). Also 2.7 is the last minor version with str as main string type. So I

[issue5166] ElementTree and minidom don't prevent creation of not well-formed XML

2009-11-24 Thread Denis S. Otkidach
Denis S. Otkidach denis.otkid...@gmail.com added the comment: Here is a regexp I use to clean up text (note, that I don't touch compatibility characters that are also not recommended in XML; some other developers remove them too): # http://www.w3.org/TR/REC-xml/#NT-Char # Char ::= #x9 | #xA

[issue5166] ElementTree and minidom don't prevent creation of not well-formed XML

2009-06-25 Thread Denis S. Otkidach
Denis S. Otkidach denis.otkid...@gmail.com added the comment: Every blog engine I've even seen so far pass through comments from untrusted users to RSS/Atom feeds without proper validation causing broken XML in feeds. Sure, this is a bug in web applications, but DOM manipulation packages should

[issue1576598] ftplib doesn't follow standard

2009-03-30 Thread Denis S. Otkidach
Denis S. Otkidach denis.otkid...@gmail.com added the comment: Yes, it's a problem in Python library. I believe the patch proposed by Oleg in the issue821862 is the best solution to it. -- ___ Python tracker rep...@bugs.python.org http

[issue5166] ElementTree and minidom don't prevent creation of not well-formed XML

2009-02-06 Thread Denis S. Otkidach
New submission from Denis S. Otkidach denis.otkid...@gmail.com: ElementTree and minidom allow creation of not well-formed XML, that can't be parsed: from xml.etree import ElementTree element = ElementTree.Element('element') element.text = u'\0' xml = ElementTree.tostring(element, encoding