Giter Club home page Giter Club logo

bugjar's Introduction

logo

BeeWare

Python Versions PyPI Version Maturity BSD License Build Status Discord server

BeeWare is a collection of tools and libraries for building and distributing native applications in Python.

For an introduction to the full BeeWare suite, we recommend running the BeeWare Tutorial.

Community

You can talk to the BeeWare community through:

We foster a welcoming and respectful community as described in our BeeWare Community Code of Conduct.

Contributing

If you experience problems with BeeWare, log them on GitHub. If you want to contribute code, please fork the code and submit a pull request.

Translations

Translation status

We manage translations using Weblate.

Translation status

If you'd like to contribute to the translation effort, join the #translations channel on Discord and introduce yourself!

bugjar's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bugjar's Issues

ModuleNotFoundError: No module named 'Tkinter'

Running bugjar mypythonfile.py gives this error:

Traceback (most recent call last):
  File "e:\wpy-3710\python-3.7.1.amd64\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "e:\wpy-3710\python-3.7.1.amd64\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "E:\WPy-3710\python-3.7.1.amd64\Scripts\bugjar.exe\__main__.py", line 5, in <module>
  File "e:\wpy-3710\python-3.7.1.amd64\lib\site-packages\bugjar\main.py", line 4, in <module>
    from Tkinter import *
ModuleNotFoundError: No module named 'Tkinter'

Python version: 3.7.1
Using Conda? PipEnv? PyEnv? Pex? pip on WinPython
OS version: Windows 10 version 1903
Browser version: Firefox 69.0

ModuleNotFoundError: No module named 'Tkinter'

Running bugjar bugjar_demo1.py a b gives this error:

Traceback (most recent call last): File "C:\NETCONF\Scripts\bugjar-script.py", line 11, in <module> load_entry_point('bugjar==0.1.0', 'console_scripts', 'bugjar')() File "c:\netconf\lib\site-packages\pkg_resources\__init__.py", line 489, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File "c:\netconf\lib\site-packages\pkg_resources\__init__.py", line 2852, in load_entry_point return ep.load() File "c:\netconf\lib\site-packages\pkg_resources\__init__.py", line 2443, in load return self.resolve() File "c:\netconf\lib\site-packages\pkg_resources\__init__.py", line 2449, in resolve module = __import__(self.module_name, fromlist=['__name__'], level=0) File "c:\netconf\lib\site-packages\bugjar\main.py", line 4, in <module> from Tkinter import * ModuleNotFoundError: No module named 'Tkinter'

Expected result -
Debugger GUI should've been opened

Python version: 3.8.3
bugjar version 0.1.0
Windows 10 Version 1909

Bugjar doesn't work with Django

First, I must say thank you for creating so simple but powerful debugger for python.

Second.
I have troubles with using Bugjar on Django (1.4.10) and Python 2.6.

  1. There is "skip" parameter for Bdb in Python 2.7, but not 2.6 - so python 2.6 raises exception.
  2. If I omit this parameter, django doesn't work well with Bugjar - If I let django run in debugger, but set breakpoint before, first few seconds (~20) Django application doesn't respond (It may be django startup time, don't know, but after I click few times Run - application starts to respond, BUT it doesn't stop at breakpoints. Maybe it new Django threading server? Even with --noreload option (bugjar manage.py runserver 8000 --noreload) it doesn't stop at breakpoints.

Bugjar crashes on swagger client instantiation

I am using the ARI-Py and Swagger-Py libraries to interface with the Asterisk open-source phone system. When debugging one of my modules, Bugjar crashes with the following traceback:

Traceback (most recent call last):
  File "C:\Python27\Scripts\bugjar-net-script.py", line 9, in <module>
    load_entry_point('bugjar==0.1.0', 'console_scripts', 'bugjar-net')()
  File "c:\python27\lib\site-packages\bugjar\main.py", line 153, in net
    net_run(options.hostname, options.port, filename, *options.args)
  File "c:\python27\lib\site-packages\bugjar\net.py", line 601, in run
    debugger.interaction(None, t)
  File "c:\python27\lib\site-packages\bugjar\net.py", line 226, in interaction
    self.output_stack()
  File "c:\python27\lib\site-packages\bugjar\net.py", line 161, in output_stack
    for frame, line_no in self.stack[str_index:]
  File "c:\python27\lib\site-packages\bugjar\net.py", line 150, in <genexpr>
    'locals': dict((k, repr(v)) for k, v in frame.f_locals.items()),
  File "build\bdist.win-amd64\egg\swaggerpy\client.py", line 189, in __repr__
  File "build\bdist.win-amd64\egg\swaggerpy\client.py", line 197, in __getattr__

... it then bounces between those last couple of lines several hundred times.

File "build\bdist.win-amd64\egg\swaggerpy\client.py", line 214, in get_resource
  File "build\bdist.win-amd64\egg\swaggerpy\client.py", line 197, in __getattr__

RuntimeError: maximum recursion depth exceeded while calling a Python object

I know about the lack of tail recursion in the language, but everything works perfectly fine outside the debugger.

Exception thrown when trying to debug Django application.

I just installed bugjar in Ubuntu 13.04 to give it a try at debugging a Django application but I'm getting an exception thrown when I try to execute it with bugjar ./manage.py runserver.

This is the whole error:

(my_project)borfast@computer:~/projects/www/my_project$ bugjar ./manage.py runserver --settings=my_project.settings.local
Listening on 0.0.0.0:3742 for a bugjar client
Traceback (most recent call last):
  File "/home/borfast/.virtualenvs/my_project/bin/bugjar", line 9, in <module>
load_entry_point('bugjar==0.1.0', 'console_scripts', 'bugjar')()
  File "/home/borfast/.virtualenvs/my_project/local/lib/python2.7/site-packages/bugjar/main.py", line 77, in local
jar_run(debugger)
  File "/home/borfast/.virtualenvs/my_project/local/lib/python2.7/site-packages/bugjar/main.py", line 22, in jar_run
view = MainWindow(root, debugger)
  File "/home/borfast/.virtualenvs/my_project/local/lib/python2.7/site-packages/bugjar/view.py", line 79, in __init__
self._setup_main_content()
  File "/home/borfast/.virtualenvs/my_project/local/lib/python2.7/site-packages/bugjar/view.py", line 170, in _setup_main_content
self._setup_code_area()
  File "/home/borfast/.virtualenvs/my_project/local/lib/python2.7/site-packages/bugjar/view.py", line 251, in _setup_code_area
self.code = DebuggerCode(self.code_frame, debugger=self.debugger)
  File "/home/borfast/.virtualenvs/my_project/local/lib/python2.7/site-packages/bugjar/widgets.py", line 11, in __init__
ReadOnlyCode.__init__(self, *args, **kwargs)
  File "/home/borfast/.virtualenvs/my_project/local/lib/python2.7/site-packages/tkreadonly.py", line 107, in __init__
self.lexer = kwargs.pop('lexer')
KeyError: 'lexer'

Any thoughts on what could be the cause and how to fix it?

DistributionNotFound

I ran >> bugjar in my terminal and received the message below. I thought I had successfully installed bugjar.

Need help making sense of this Traceback. Thanks **/

Traceback (most recent call last):
File "/usr/local/bin/bugjar", line 5, in
from pkg_resources import load_entry_point
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2603, in
working_set.require(requires)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 666, in require
needed = self.resolve(parse_requirements(requirements))
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 565, in resolve
raise DistributionNotFound(req) # XXX put more info here
pkg_resources.DistributionNotFound: Pygments>=1.5
ramirotrejosmbp:Project1 ramirotrejo$ bugjar main.py arg1 arg2
Traceback (most recent call last):
File "/usr/local/bin/bugjar", line 5, in
from pkg_resources import load_entry_point
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2603, in
working_set.require(requires)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 666, in require
needed = self.resolve(parse_requirements(requirements))
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 565, in resolve
raise DistributionNotFound(req) # XXX put more info here
pkg_resources.DistributionNotFound: Pygments>=1.5

Exception thrown when opening a python file.

There seems to be a escape issue when bugjar attempts to load a file via the GUI.

ie10 - win7 orig

In the screenshot above, I am attempting to load a django project called "testproject" and an app called "testapp" using the command "bugjar manage.py". When the GUI loads, I am going File -> Open -> settings.py

Notice that the 't' in testproject is missing and is replaced by a tab which would happen if the ...\testproject\ is being interpreted as a tab character.

The problem seems to be on line 385 of view.py and can be avoided by doing the following.

# ... select the new filename
f = filename.replace("\\", "\\\\")
self.breakpoints.selection_set(f)
#self.breakpoints.selection_set(filename)

Note: I am not trying to imply that the above is a good solution. Simply that it shows the source of the issue.

New release on pypi?

The current release on pypi is broken for python 3 since it imports Tkinter.
It might be time to do a release on pypi again?

can't get bugjar to start.

$ bugjar pri.py
Listening on 0.0.0.0:3742 for a bugjar client
Got connection from ('127.0.0.1', 49185)
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib64/python2.7/threading.py", line 801, in __bootstrap_inner
    self.run()
  File "/usr/lib64/python2.7/threading.py", line 754, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/usr/lib64/python2.7/site-packages/bugjar/connection.py", line 56, in command_buffer
    getattr(debugger, 'on_%s' % event)(**data)
  File "/usr/lib64/python2.7/site-packages/bugjar/connection.py", line 227, in on_stack
    self.view.on_stack(stack=stack)
  File "/usr/lib64/python2.7/site-packages/bugjar/view.py", line 464, in on_stack
    self.file_notebook.select(self.stack_frame)
  File "/usr/lib64/python2.7/lib-tk/ttk.py", line 888, in select
    return self.tk.call(self._w, "select", tab_id)
TclError: out of stack space (infinite loop?)

No clue how to solve this...

Fails to run when python3 is default on system

This computer has python3 as the default python runtime. Trying to run bugjar triggers this error:

    from Tkinter import *
ImportError: No module named 'Tkinter'

From what I can deduce this is because with python3, Tkinter should be all lowercase, i.e. 'tkinter'.

Can't debug scripts without .py extension

Here's what I tried, and here's the traceback:

$ bugjar ./bin/twistd -n web --path .
Listening on 0.0.0.0:3742 for a bugjar client
Got connection from ('127.0.0.1', 60247)
Exception in thread Thread-1:
Traceback (most recent call last):
  File ".../threading.py", line 808, in __bootstrap_inner
    self.run()
  File ".../threading.py", line 761, in run
    self.__target(*self.__args, **self.__kwargs)
  File ".../bugjar/connection.py", line 56, in command_buffer
    getattr(debugger, 'on_%s' % event)(**data)
  File ".../bugjar/connection.py", line 227, in on_stack
    self.view.on_stack(stack=stack)
  File ".../bugjar/view.py", line 473, in on_stack
    self.show_file(filename=filename, line=line)
  File ".../bugjar/view.py", line 324, in show_file
    self.code.filename = filename
  File ".../tkreadonly.py", line 197, in filename
    lexer = guess_lexer_for_filename(value, all_content, stripnl=False)
  File ".../pygments/lexers/__init__.py", line 181, in guess_lexer_for_filename
    raise ClassNotFound('no lexer for filename %r found' % fn)
ClassNotFound: no lexer for filename u'twistd' found

GUI crashes with freePtr when stepping through code on Windows 8

When playing with testing bugjar on Windows 8 I discovered that the UI component will consistenly crash with the following error on the console.

TclStackFree: incorrect freePtr. Call out of sequence?

This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.

Based on this link, it seems that this error is caused by more than one thread accessing the tk event loop.

My hypothesis is that the Debugger is invoking callbacks such as MainWindow.on_stack and MainWindow.on_line from the non tk event thread.

Below is an attempt to rectify this situation using the python Queue object.

class MainWindow(object):
    def __init__(self, root, debugger):

        # <snip>------------

        self.queue = Queue.Queue()
        self.root.after(200, self.debugger_update)

        debugger.start()

    def debugger_update(self):
        try:
            while 1:
                func_name, args = self.queue.get_nowait()
                handler = getattr(self, func_name)
                handler(*args)
        except Queue.Empty:
            pass
        self.root.after(100, self.debugger_update)

    # <snip>------------

    def on_stack(self, stack):
        self.queue.put(('_on_stack', (stack,),))

    def _on_stack(self, stack):
        # <snip>------------

Using the above setup, I have found that I am able to step through the code without encountering the same freePtr issue.

Debug python 3.x

I work under Ubuntu 14.04 and try to debug my python code written in python 3. Is there a possibility to debug python 3?

bugjar-net shouldn't rely on tkinter.

This would suit debugging a process in vagrant, but would have use beyond that too.

The question is, is this even possible? A cursory look seems to suggest it should be, so leaving this here as a place to continue the convo.

When quitting, error is raised in console

When stopping debug Django application, bugjar hangs for some time and then errror is raising in console

File "/home/khalikov/virtualenvs/PROC26/bin/bugjar", line 9, in
load_entry_point('bugjar==0.1.0', 'console_scripts', 'bugjar')()
File "/home/khalikov/virtualenvs/PROC26/lib/python2.6/site-packages/bugjar-0.1.0- py2.6.egg/bugjar/main.py", line 77, in local
jar_run(debugger)
File "/home/khalikov/virtualenvs/PROC26/lib/python2.6/site-packages/bugjar-0.1.0-py2.6.egg/bugjar/main.py", line 28, in jar_run
view.on_quit()
AttributeError: 'MainWindow' object has no attribute 'on_quit'

defining empty method

def on_quit(self):
pass

of MainWindow helps

Circular Reference when debugging

The bugjar debugger will throw a circular reference exception if you debug the files below.

Exception

Traceback (most recent call last):
  File "D:\BackupSync\Code\django-bugjar\VirtualEnv\lib\site-packages\bugjar\net.py", line 575, in run
    debugger._runscript(filename)
  File "D:\BackupSync\Code\django-bugjar\VirtualEnv\lib\site-packages\bugjar\net.py", line 552, in _runscript
    self.run('execfile(%r)' % filename)
  File "C:\Python27\Lib\bdb.py", line 387, in run
    exec cmd in globals, locals
  File "<string>", line 1, in <module>
  File "d:\backupsync\code\django-bugjar\testproject\test.py", line 8, in <module>
    main()
  File "d:\backupsync\code\django-bugjar\testproject\test.py", line 3, in main
    other = __import__('other')
  File "d:\backupsync\code\django-bugjar\testproject\other.py", line 2, in <module>
    class Cow(object):
  File "d:\backupsync\code\django-bugjar\testproject\other.py", line 6, in Cow
    def talk(self):
  File "C:\Python27\Lib\bdb.py", line 52, in trace_dispatch
    return self.dispatch_return(frame, arg)
  File "C:\Python27\Lib\bdb.py", line 85, in dispatch_return
    self.user_return(frame, arg)
  File "D:\BackupSync\Code\django-bugjar\VirtualEnv\lib\site-packages\bugjar\net.py", line 205, in user_return
    self.output('return', retval=return_value)
  File "D:\BackupSync\Code\django-bugjar\VirtualEnv\lib\site-packages\bugjar\net.py", line 124, in output
    self.client.sendall(json.dumps((event, data)) + Debugger.ETX)
  File "C:\Python27\Lib\json\__init__.py", line 231, in dumps
    return _default_encoder.encode(obj)
  File "C:\Python27\Lib\json\encoder.py", line 201, in encode
    chunks = self.iterencode(o, _one_shot=True)
  File "C:\Python27\Lib\json\encoder.py", line 264, in iterencode
    return _iterencode(o, 0)
ValueError: Circular reference detected

There are two test files test.py and other.py

test.py

def main():
    while True:
        other = __import__('other')
        #cow = other.Cow()
        #cow.talk()

if __name__ == '__main__':
    main()

other.py

class Cow(object):
    def __init__(self):
        pass

    def talk(self):
        print 'Moo'

To produce the exception start the debugger and keep clicking "step".

When running with twisted stopping the reactor makes bugjar shutdown unhappy

When twisted does a reactor.stop it presumably does something that kills the socket that bugjar is using. When you try to exit bugjar it complains (traceback and code to repro below)

I haven't delved deeper because this looks like a trivial fix. If you want, I can though :)

Tool is looking great mate! Definitely going to be helping any way I can!

from twisted.internet.task import react
from twisted.internet.defer import succeed


def main(reactor):
    return succeed(None)

if __name__ == '__main__':
    react(main)
System exit
Exception in Tkinter callback
Traceback (most recent call last):
  File "/usr/lib/python2.7/lib-tk/Tkinter.py", line 1413, in __call__
    return self.func(*args)
  File "/home/dpn/.virtualenvs/musicdata/local/lib/python2.7/site-packages/bugjar/view.py", line 346, in cmd_quit
    self.debugger.stop()
  File "/home/dpn/.virtualenvs/musicdata/local/lib/python2.7/site-packages/bugjar/connection.py", line 100, in stop
    self.socket.shutdown(socket.SHUT_WR)
  File "/usr/lib/python2.7/socket.py", line 224, in meth
    return getattr(self._sock,name)(*args)
error: [Errno 107] Transport endpoint is not connected

port option not respected

$ bugjar -p 4242 foo.py
Listening on 0.0.0.0:3742 for a bugjar client
Waiting for connection... [Errno 111] Connection refused
Waiting for connection... [Errno 111] Connection refused
Waiting for connection... [Errno 111] Connection refused
Waiting for connection... [Errno 111] Connection refused
Waiting for connection... [Errno 111] Connection refused
Waiting for connection... [Errno 111] Connection refused
Waiting for connection... [Errno 111] Connection refused
Waiting for connection... [Errno 111] Connection refused
Waiting for connection... [Errno 111] Connection refused
^CTraceback (most recent call last):
  File "/usr/local/bin/bugjar", line 11, in <module>
Keyboard interrupt
    load_entry_point('bugjar==0.1.0', 'console_scripts', 'bugjar')()
  File "/usr/local/lib/python2.7/dist-packages/bugjar/main.py", line 77, in local
    jar_run(debugger)
  File "/usr/local/lib/python2.7/dist-packages/bugjar/main.py", line 22, in jar_run
    view = MainWindow(root, debugger)
  File "/usr/local/lib/python2.7/dist-packages/bugjar/view.py", line 88, in __init__
    debugger.start()
  File "/usr/local/lib/python2.7/dist-packages/bugjar/connection.py", line 88, in start
    time.sleep(1.0)
KeyboardInterrupt

Bugjar doesn't seem to load on Windows 7

bugjar myapp.py

Listening on 0.0.0.0:3742 for a bugjar client
Waiting for connection... [Errno 10061] No connection could be made because the target machine actively refused it
Waiting for connection... [Errno 10061] No connection could be made because the target machine actively refused it

And it just keeps repeating that.
Python 2.7.3, used "pip install bugjar".
I tried disabling firewall, etc.

bugjar fails with TclError: out of stack space error

I'm running bugjar with python 2.7.5 on Gentoo Linux.
Bugjar was installed on a virtualenv using pip install bugjar.

The script I'm running contains only a print statement, nothing else.
The script was launched using: bugjar script.py

Listening on 0.0.0.0:3742 for a bugjar client
Got connection from ('127.0.0.1', 46871)
Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib64/python2.7/threading.py", line 808, in __bootstrap_inner
    self.run()
  File "/usr/lib64/python2.7/threading.py", line 761, in run
    self.__target(*self.__args, **self.__kwargs)
  File "/home/unode/.virtualenvs/bugjar/lib/python2.7/site-packages/bugjar/connection.py", line 56, in command_buffer
    getattr(debugger, 'on_%s' % event)(**data)
  File "/home/unode/.virtualenvs/bugjar/lib/python2.7/site-packages/bugjar/connection.py", line 227, in on_stack
    self.view.on_stack(stack=stack)
  File "/home/unode/.virtualenvs/bugjar/lib/python2.7/site-packages/bugjar/view.py", line 469, in on_stack
    self.file_notebook.select(self.stack_frame)
  File "/usr/lib64/python2.7/lib-tk/ttk.py", line 885, in select
    return self.tk.call(self._w, "select", tab_id)
TclError: out of stack space (infinite loop?)

After this I also tried to install latest version directly from github but the error persisted.

The GUI is still displayed but it doesn't display any useful information. The code panel is black. The variables panel displays "builtins, globals, locals" but nothing under Values.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.