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

session() does not restore previous engine if fails #211

dm-logv opened this Issue Sep 13, 2018 · 1 comment


2 participants
Copy link

dm-logv commented Sep 13, 2018

When with redmine.session() fails redminelib does not restore previous used engine.


rm = redminelib.Redmine('https://redmine.intranet')

# Original engine

    with rm.session(impersonate='william_gates'):
        # Masked engine
        # Some fails
        rm.issue.create(project_id='test', subject='foo')
except redminelib.exceptions.ImpersonateError as e:

# Should be original engine again?


<redminelib.engines.sync.SyncEngine object at 0x03D1B9F0>
<redminelib.engines.sync.SyncEngine object at 0x040EBD10>
Impersonate login provided doesn't exist or isn't active
<redminelib.engines.sync.SyncEngine object at 0x040EBD10>

dm-logv added a commit to dm-logv/python-redmine that referenced this issue Sep 13, 2018

issue maxtepkeev#211
Add exception handling for a `session()` and restore original engine if it fails

@maxtepkeev maxtepkeev self-assigned this Sep 13, 2018

@maxtepkeev maxtepkeev added the bug label Sep 13, 2018


This comment has been minimized.

Copy link

maxtepkeev commented Sep 13, 2018

Fixed via #212, thanks @dm-logv

@maxtepkeev maxtepkeev closed this Sep 13, 2018

maxtepkeev added a commit that referenced this issue Jan 2, 2019

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