Skip to content
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

bpdb: fix TypeError with pdbpp's `__init__` #639

Merged
merged 1 commit into from Oct 10, 2016

Conversation

@blueyed
Copy link
Contributor

blueyed commented Oct 10, 2016

When using bpdb together with pdb++ [1], using debug … will cause a
TypeError, because pdbpp passes in a Config kwarg [2].

…/venv/lib/python3.5/site-packages/pdb.py:647: in do_debug
    return orig_do_debug(self, arg)
/usr/lib64/python3.5/pdb.py:1090: in do_debug
    p = Pdb(self.completekey, self.stdin, self.stdout)
…/venv/lib/python3.5/site-packages/pdb.py:636: in new_pdb_with_config
    return self.__class__(*args, **kwds)
E   TypeError: __init__() got an unexpected keyword argument 'Config'

This patch fixes bpdb to accept and pass on any args/kwargs.

For reference, this is the stacktrace when pdb++ gets instantiated:

File "…/venv/lib/python3.5/site-packages/pytestbpdb/ptbpdb.py", line 50, in set_trace
pdb.BPdb().set_trace(frame)
File "…/venv/lib/python3.5/site-packages/bpdb/debugger.py", line 33, in init
pdb.Pdb.init(self)
File "…/venv/lib/python3.5/site-packages/pdb.py", line 198, in init
print(traceback.print_stack())

1: https://pypi.python.org/pypi/pdbpp/
2: https://bitbucket.org/antocuni/pdb/src/cf937bbd910a8f7fe2b84af7cf5ee9dc96c2fe25/pdb.py?fileviewer=file-view-default#pdb.py-633

When using bpdb together with pdb++ [1], using `debug …` will cause a
TypeError, because pdbpp passes in a `Config` kwarg [2].

    …/venv/lib/python3.5/site-packages/pdb.py:647: in do_debug
        return orig_do_debug(self, arg)
    /usr/lib64/python3.5/pdb.py:1090: in do_debug
        p = Pdb(self.completekey, self.stdin, self.stdout)
    …/venv/lib/python3.5/site-packages/pdb.py:636: in new_pdb_with_config
        return self.__class__(*args, **kwds)
    E   TypeError: __init__() got an unexpected keyword argument 'Config'

This patch fixes bpdb to accept and pass on any args/kwargs.

For reference, this is the stacktrace when pdb++ gets instantiated:

  File "…/venv/lib/python3.5/site-packages/pytestbpdb/ptbpdb.py", line 50, in set_trace
    pdb.BPdb().set_trace(frame)
  File "…/venv/lib/python3.5/site-packages/bpdb/debugger.py", line 33, in __init__
    pdb.Pdb.__init__(self)
  File "…/venv/lib/python3.5/site-packages/pdb.py", line 198, in __init__
    print(traceback.print_stack())

1: https://pypi.python.org/pypi/pdbpp/
2: https://bitbucket.org/antocuni/pdb/src/cf937bbd910a8f7fe2b84af7cf5ee9dc96c2fe25/pdb.py?fileviewer=file-view-default#pdb.py-633
@sebastinas sebastinas merged commit 84e7bf7 into bpython:master Oct 10, 2016
1 check passed
1 check passed
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@blueyed blueyed deleted the blueyed:fix-bpdb-init-with-pdbpp branch Oct 10, 2016
@blueyed
Copy link
Contributor Author

blueyed commented Oct 10, 2016

Thanks for merging it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.