[issue41907] Regression in IntFlag behaviour in f-string

2020-10-01 Thread Roger Taylor


New submission from Roger Taylor :

An IntFlag member before 3.8.6 was converted to an integer in an f-string. 
After 3.8.6, the textual IntFlag class and member name are placed in the 
interpolated f-string instead of the integer.

3.8.3: f"... {X.F} ..." where X.F = 1 << 4 will give "... 16 ..."
3.8.5: Same
3.8.6: f"... {X.F} ..." where X.F = 1 << 4 will give "... X.F ..."

I have reproduced this on Linux using the version compiled and installed by 
pyenv, and on Windows using the 32-bit versions from the downloadable 
standalone installer.

Now I have to locate and go through all my SQL statements and verify that they 
explicitly convert IntFlag values to integer to avoid the errors introduced by 
this regression.

--
components: Interpreter Core
messages: 377793
nosy: rt121212121
priority: normal
severity: normal
status: open
title: Regression in IntFlag behaviour in f-string
type: behavior
versions: Python 3.8

___
Python tracker 
<https://bugs.python.org/issue41907>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue32661] ProactorEventLoop locks up on close call

2018-01-24 Thread Roger Taylor

New submission from Roger Taylor <roger.taylor.em...@gmail.com>:

The following problem only occurs when I use ProactorEventLoop.  If I use 
'asyncio.get_event_loop()' it exits normally, rather than infinite looping in 
IOCP land.

1. I run the attached 'bug.py' script in a DOS window.  It is a slightly 
modified version of the asyncio echo server example.
2. It reaches 'loop.run_forever()' and blocks.  I can make connections here and 
use it as an echo server.  Or make no connections.
3. I press Ctrl-C in the DOS window.  Nothing happens.
4. I do a raw connection with Putty and try some input.
5. 'run_forever()' exits and the script proceeds to the 'loop.close()' call.  
Before this is invoked and the infinite loop entered, I see the script output 
''.

At this point, the script locks up and never reaches the next line.  It can be 
interrupted with another Ctrl-C, and the following stack track is seen:

Traceback (most recent call last):
  File "bug.py", line 39, in 
loop.close()
  File "C:\Program Files (x86)\Microsoft Visual 
Studio\Shared\Python36_64\lib\asyncio\proactor_events.py", line 437, in close
self._proactor.close()
  File "C:\Program Files (x86)\Microsoft Visual 
Studio\Shared\Python36_64\lib\asyncio\windows_events.py", line 745, in close
if not self._poll(1):
  File "C:\Program Files (x86)\Microsoft Visual 
Studio\Shared\Python36_64\lib\asyncio\windows_events.py", line 673, in _poll
status = _overlapped.GetQueuedCompletionStatus(self._iocp, ms)
KeyboardInterrupt

The following code in 'windows_events.py:IocpProactor.close' is looping 
infinitely.

while self._cache:
if not self._poll(1):
logger.debug('taking long time to close proactor')

Note that '_poll' does not actually return anything.

--
components: asyncio
files: bug.py
messages: 310655
nosy: asvetlov, rt121212121, yselivanov
priority: normal
severity: normal
status: open
title: ProactorEventLoop locks up on close call
type: behavior
versions: Python 3.6
Added file: https://bugs.python.org/file47408/bug.py

___
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue32661>
___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com