New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

repr(CIMultiDictProxy(CIMultiDict())) clears current exception #410

Closed
zware opened this Issue Jun 13, 2015 · 5 comments

Comments

Projects
None yet
2 participants
@zware

zware commented Jun 13, 2015

Reproducer:

from aiohttp.multidict import CIMultiDictProxy, CIMultiDict
import sys

try:
    raise Exception
except Exception:
    print(sys.exc_info())
    repr(CIMultiDictProxy(CIMultiDict()))
    print(sys.exc_info())

Results:

(<class 'Exception'>, Exception(), <traceback object at 0x101a3d048>)
(None, None, None)

This is fairly serious; if you stick an 'as e' at the end of 'except Exception' and a 'raise' at the end of the except block, you wind up with a segfault.

Discovered in version 0.14.4, confirmed in 0.16.3.

@zware zware changed the title from repr(CIMultiDictProxy() clears current exception to repr(CIMultiDictProxy(CIMultiDict())) clears current exception Jun 13, 2015

@asvetlov

This comment has been minimized.

Member

asvetlov commented Jun 13, 2015

Thanks for report!
It's Cython side effect.
Working on it.

asvetlov added a commit that referenced this issue Jun 13, 2015

@asvetlov

This comment has been minimized.

Member

asvetlov commented Jun 13, 2015

Fixed in 0.16.4 release

@asvetlov asvetlov closed this Jun 13, 2015

@asvetlov

This comment has been minimized.

Member

asvetlov commented Jun 13, 2015

Reported to Cython development list.

@zware

This comment has been minimized.

zware commented Jun 15, 2015

Thanks for the quick response! I suspected it might be a Cython issue, but I'm completely unfamiliar with Cython.

@asvetlov

This comment has been minimized.

Member

asvetlov commented Jun 15, 2015

@zware sure!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment