EmilyDirsh / hotwire-shell

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

Bug on Windows in webbrowser.py #145

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
There is a bug in "hotwire/externals/webbrowser.py" at line 107 on Windows
(SVN head).

This line is currently:

        if os.path.isfile(cmd) and cmd.endswith((".exe", ".bat")):

You can't call 'endswith' with a tuple. The correct code should be:

        if os.path.isfile(cmd) and (cmd.endswith(".exe") or
cmd.endswith(".bat")):

For Python 2.4 there is also a dependency on pysqllite2 which isn't documented.

Original issue reported on code.google.com by fuzzyman on 8 Feb 2008 at 1:43

GoogleCodeExporter commented 9 years ago
The .endswith tuple argument appears to be valid in Python 2.5, but not 2.4.

We're running into this bug because we unconditionally override the Python 2.4
webbrowser.py with the version we copied from Python SVN, because even the 2.5
version did not work correctly on Linux/GNOME.  I think the right fix here is 
to use
the system webbrowser.py on Windows, but use our copy on Linux.

Let me know if this doesn't work (I can't reboot into Windows at the moment):

Committed r1008
    M   hotvte/vteterm.py
    M   hotwire_ui/renderers/unicode.py
r1008 = 93149ec1ca4fe5484a5043659b398ce41cb09c5e (git-svn)

Original comment by cgwalt...@gmail.com on 8 Feb 2008 at 2:59

GoogleCodeExporter commented 9 years ago
No - just reverted my changed and updated. Still get the same exception (it is 
still
using the same version of webbrowser.py on my system.)

Original comment by fuzzyman on 8 Feb 2008 at 4:14

GoogleCodeExporter commented 9 years ago
Hm.  Is this for links from the help display?  If so, can you try adding:

print >>sys.stderr, webbrowser.__file__

after the import?  Then we'll know whether we're picking up the right one (this
should be the path to the system webbrowser.py)

Just noticed we weren't using the right webbrowser in the about dialog, now 
fixed:

Committed r1009
    M   ui/hotwire
r1009 = c0a8f640adf1323874500e795a77bc7515d5e18f (git-svn)

Original comment by cgwalt...@gmail.com on 8 Feb 2008 at 4:29

GoogleCodeExporter commented 9 years ago
It is failing on line 56. No point in putting any code after the import because 
the
import fails.

Full traceback:

Running uninstalled, extending PYTHONPATH with: C:\compile\hotwire
Traceback (most recent call last):
  File "ui\hotwire", line 56, in ?
    import hotwire.externals.webbrowser as webbrowser
  File "C:\compile\hotwire\hotwire\externals\webbrowser.py", line 535, in ?
    if _iscommand(browser):
  File "C:\compile\hotwire\hotwire\externals\webbrowser.py", line 124, in _iscom
mand
    if _isexecutable(cmd):
  File "C:\compile\hotwire\hotwire\externals\webbrowser.py", line 107, in _isexe
cutable
    if os.path.isfile(cmd) and cmd.endswith((".exe", ".bat")):
TypeError: expected a character buffer object

Original comment by fuzzyman on 8 Feb 2008 at 5:40

GoogleCodeExporter commented 9 years ago
Ignore that - I hadn't updated. Starts fine now.

Original comment by fuzzyman on 8 Feb 2008 at 5:42

GoogleCodeExporter commented 9 years ago
Ok, cool.

Original comment by cgwalt...@gmail.com on 8 Feb 2008 at 5:49