[issue2835] Py30a5: webbrowser.open() inf recursion

Mark Summerfield report at bugs.python.org
Mon May 12 16:32:58 CEST 2008


Mark Summerfield <mark at qtrac.eu> added the comment:

On 2008-05-12, Amaury Forgeot d'Arc wrote:
> Amaury Forgeot d'Arc <amauryfa at gmail.com> added the comment:
>
> The traceback suggest a problem when using KDE: a call to file() was
> renamed to open(), this clashes with webbrowser.open().
> Can you try the following patch:
>
> Index: Lib/webbrowser.py
> ===================================================================
> --- Lib/webbrowser.py   (revision 63159)
> +++ Lib/webbrowser.py   (working copy)
> @@ -347,7 +347,8 @@
>          else:
>              action = "openURL"
>
> -        devnull = open(os.devnull, "r+")
> +        import io
> +        devnull = io.open(os.devnull, "r+")
>          # if possible, put browser in separate process group, so
>          # keyboard interrupts don't affect browser as well as Python
>          setsid = getattr(os, 'setsid', None)

That fixed it!

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue2835>
__________________________________


More information about the Python-bugs-list mailing list