EmilyDirsh / hotwire-shell

Automatically exported from code.google.com/p/hotwire-shell
Other
0 stars 0 forks source link

Exception is not properly processed on Win32 #179

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. launch hotwire
2. type in 'http-get a'

What is the expected output? What do you see instead?
Because this is a command with an invalid option, an exception will be
thrown. Hotwire should report it to users. However, it freezes in this case

Please use labels and text to provide additional information.
The tested version is trunk r1206

The traceback before freezing is:
21:56:01 [3284] hotwire.Command DEBUG executing async: http-get a
21:56:01 [3052] hotwire.Command DEBUG glob on a matched is: []
21:56:01 [3052] hotwire.Command INFO Execute '<hotwire.builtins.httpget.HttpGet
iltin object at 0x02419970>' args: [[u'a']] options: []
21:56:01 [3284] hotwire.ui.Command DEBUG sync sensitivity page None pipeline: e
cuting
21:56:01 [3284] hotwire.ui.Command DEBUG cancellable: True undoable: False
21:56:01 [2984] hotwire.Async DEBUG thread <Thread(MiniThreadPool Thread, start
 daemon)> executing cb
21:56:01 [2984] hotwire.State DEBUG in async run of <bound method History.__do_
pend_command of <hotwire.state.History object at 0x029E0330>>
21:56:01 [2984] hotwire.State DEBUG doing insert of ('http-get a', datetime.dat
ime(2008, 4, 3, 21, 56, 1, 375000), u'c:/Documents and Settings/Jialai Wang.JIA
IWANG', '62270c40-a94a-44dd-aaa0-689f882acf34')
21:56:01 [3284] hotwire.Command DEBUG parsing ''
21:56:01 [3284] hotwire.Command DEBUG tokenize: None
21:56:01 [3284] hotwire.ui.Shell DEBUG parse failed, current syntax=<hotwire.co
and.HotwirePipeLanguage object at 0x0217DBF0>
Traceback (most recent call last):
  File "c:\tools\hotwire-shell.git\hotwire_ui\shell.py", line 1114, in __do_par

    resolve=resolve)
  File "c:\tools\hotwire-shell.git\hotwire\command.py", line 1191, in parse
    return Pipeline.parse(text, context=self.__context, resolver=(resolve and s
f.__resolver or None), **kwargs)
  File "c:\tools\hotwire-shell.git\hotwire\command.py", line 1014, in parse
    return Pipeline.create(context, resolver, accept_partial=accept_partial, *t
ens)
  File "c:\tools\hotwire-shell.git\hotwire\command.py", line 993, in create
    raise PipelineParseException(_("Empty pipeline"))
PipelineParseException: Empty pipeline
21:56:01 [3284] hotwire.ui.Shell DEBUG failed to parse
21:56:01 [2984] hotwire.State DEBUG incrementing count 239
21:56:01 [2984] hotwire.State DEBUG doing insert of (u'c:/Documents and Setting
Jialai Wang.JIALAIWANG', 240, datetime.datetime(2008, 4, 3, 21, 56, 1, 671000))
21:56:01 [2984] hotwire.Async DEBUG thread <Thread(MiniThreadPool Thread, start
 daemon)> waiting
21:56:05 [3052] hotwire.Command DEBUG Caught exception from command: (11001, 'g
addrinfo failed')
Traceback (most recent call last):
  File "c:\tools\hotwire-shell.git\hotwire\command.py", line 346, in __run
    execresult = exectarget(self.context, *target_args, **kwargs)
  File "C:\tools\hotwire-shell.git\hotwire\builtins\httpget.py", line 49, in ex
ute
    conn.request('GET', path)
  File "c:\Python25\lib\httplib.py", line 870, in request
    raise
  File "c:\Python25\lib\httplib.py", line 866, in request
    self._send_request(method, url, body, headers)
  File "c:\Python25\lib\httplib.py", line 889, in _send_request
    self.endheaders()
  File "c:\Python25\lib\httplib.py", line 860, in endheaders
    self._send_output()
  File "c:\Python25\lib\httplib.py", line 732, in _send_output
    self.send(msg)
  File "c:\Python25\lib\httplib.py", line 699, in send
    self.connect()
  File "c:\Python25\lib\httplib.py", line 667, in connect
    socket.SOCK_STREAM):
gaierror: (11001, 'getaddrinfo failed')
21:56:05 [3052] hotwire.ui.Command DEBUG handling state change to exception
21:56:05 [3052] hotwire.ui.Command DEBUG marking http-get a as unseen=True
21:56:05 [3052] hotwire.ui.Command DEBUG marking http-get a as unseen=True
21:56:05 [3052] hotwire.ui.Command DEBUG sync display, current=http-get a
21:56:05 [3052] hotwire.ui.Command DEBUG marking http-get a as unseen=False
21:56:05 [3052] hotwire.ui.Command DEBUG marking http-get a as unseen=False

Original issue reported on code.google.com by Zeng.Shi...@gmail.com on 4 Apr 2008 at 3:02

GoogleCodeExporter commented 9 years ago
Just tried this on my copy and hotwire did not freeze for me.  The only output 
I get is 

<httplib.HTTPResponse instance at 0x8847e2c>

(I am on ubuntu 7.10, latest from svn).  (Is the freezing windows specific?)

The reporting of the error is certainly unhelpful though.

Original comment by dmi...@gmail.com on 4 Apr 2008 at 8:13

GoogleCodeExporter commented 9 years ago
Yes, it's fine on Linux, I've tested that, so I targeted the bug for Win32

Original comment by Zeng.Shi...@gmail.com on 4 Apr 2008 at 8:17

GoogleCodeExporter commented 9 years ago
After adding some debug info, I narrowed down block comes from
UnseenNotifyButton.__on_unseen_pipeline_count_changed in hotwire_ui/command.py:
self.show() blocks.

I'm totally confused about the reason that it blocks. Perhaps bugs in 
pygtk/gtk+ on
Win32?

here's the traceback(after applying th attached patch):
23:36:09 [3592] hotwire.Command DEBUG tokenize: None
23:36:09 [3592] hotwire.ui.Shell DEBUG parse failed, current syntax=<hotwire.com
and.HotwirePipeLanguage object at 0x0217DBF0>
Traceback (most recent call last):
  File "c:\tools\hotwire-shell.git\hotwire_ui\shell.py", line 1114, in __do_pars

    resolve=resolve)
  File "c:\tools\hotwire-shell.git\hotwire\command.py", line 1191, in parse
    return Pipeline.parse(text, context=self.__context, resolver=(resolve and se
f.__resolver or None), **kwargs)
  File "c:\tools\hotwire-shell.git\hotwire\command.py", line 1014, in parse
    return Pipeline.create(context, resolver, accept_partial=accept_partial, *to
ens)
  File "c:\tools\hotwire-shell.git\hotwire\command.py", line 993, in create
    raise PipelineParseException(_("Empty pipeline"))
PipelineParseException: Empty pipeline
23:36:09 [3592] hotwire.ui.Shell DEBUG failed to parse
23:36:09 [4968] hotwire.Async DEBUG thread <Thread(MiniThreadPool Thread, starte
 daemon)> waiting
23:36:11 [2824] hotwire.Command DEBUG Caught exception from command: (11001, 'ge
addrinfo failed')
Traceback (most recent call last):
  File "c:\tools\hotwire-shell.git\hotwire\command.py", line 346, in __run
    execresult = exectarget(self.context, *target_args, **kwargs)
  File "C:\tools\hotwire-shell.git\hotwire\builtins\httpget.py", line 49, in exe
ute
    conn.request('GET', path)
  File "c:\Python25\lib\httplib.py", line 870, in request
    raise
  File "c:\Python25\lib\httplib.py", line 866, in request
    self._send_request(method, url, body, headers)
  File "c:\Python25\lib\httplib.py", line 889, in _send_request
    self.endheaders()
  File "c:\Python25\lib\httplib.py", line 860, in endheaders
    self._send_output()
  File "c:\Python25\lib\httplib.py", line 732, in _send_output
    self.send(msg)
  File "c:\Python25\lib\httplib.py", line 699, in send
    self.connect()
  File "c:\Python25\lib\httplib.py", line 667, in connect
    socket.SOCK_STREAM):
gaierror: (11001, 'getaddrinfo failed')
23:36:11 [2824] hotwire.ui.Command DEBUG handling state change to exception
23:36:11 [2824] hotwire.ui.Command DEBUG marking http-get a as unseen=True
23:36:11 [2824] hotwire.ui.Command DEBUG marking http-get a as unseen=True
23:36:11 [2824] hotwire.ui.Command DEBUG Notify unseen-pipeline-count
23:36:11 [2824] hotwire.ui.Command DEBUG unseen-pipeline-count changed to 1
23:36:11 [2824] hotwire.ui.Command DEBUG set_label done
23:36:11 [2824] hotwire.ui.Command DEBUG to show

Original comment by Zeng.Shi...@gmail.com on 5 Apr 2008 at 4:46

Attachments: