Describe the bug
The beeware tutorial crashes on startup with the following error message:
2020-11-13 14:12:42.032770+0100 Hello World[2543:85840] File "/Users/Tom/Library/Developer/CoreSimulator/Devices/506D845C-0EA0-453B-A58F-C2D2A33ED530/data/Containers/Bundle/Application/407DBACD-C065-4EB1-87FF-D0087083ACFF/Hello World.app/Library/Application Support/com.example.helloworld/app/helloworld/app.py", line 4, in <module> 2020-11-13 14:12:42.033070+0100 Hello World[2543:85840] import toga 2020-11-13 14:12:42.033235+0100 Hello World[2543:85840] File "/Users/Tom/Library/Developer/CoreSimulator/Devices/506D845C-0EA0-453B-A58F-C2D2A33ED530/data/Containers/Bundle/Application/407DBACD-C065-4EB1-87FF-D0087083ACFF/Hello World.app/Library/Application Support/com.example.helloworld/app_packages/toga/__init__.py", line 1, in <module> 2020-11-13 14:12:42.033535+0100 Hello World[2543:85840] from .app import App, DocumentApp, MainWindow 2020-11-13 14:12:42.033701+0100 Hello World[2543:85840] File "/Users/Tom/Library/Developer/CoreSimulator/Devices/506D845C-0EA0-453B-A58F-C2D2A33ED530/data/Containers/Bundle/Application/407DBACD-C065-4EB1-87FF-D0087083ACFF/Hello World.app/Library/Application Support/com.example.helloworld/app_packages/toga/app.py", line 4, in <module> 2020-11-13 14:12:42.034478+0100 Hello World[2543:85840] import webbrowser 2020-11-13 14:12:42.034647+0100 Hello World[2543:85840] File "/Users/Tom/Library/Developer/CoreSimulator/Devices/506D845C-0EA0-453B-A58F-C2D2A33ED530/data/Containers/Bundle/Application/407DBACD-C065-4EB1-87FF-D0087083ACFF/Hello World.app/Library/Python/lib/python3.7/webbrowser.py", line 622, in <module> 2020-11-13 14:12:42.035111+0100 Hello World[2543:85840] register("mobilesafari", None, MobileSafari(), -1) 2020-11-13 14:12:42.035291+0100 Hello World[2543:85840] TypeError: register() takes from 2 to 3 positional arguments but 4 were given
To Reproduce
Steps to reproduce the behavior:
Try to run the beeware tutorial on iOS
Environment:
Operating System: iOS
Python version: 3.7 or 3.8
Software versions:
Briefcase: 0.3.3
Toga: 0.3.0.dev25
The problem is in the file Library/Python/lib/python3.7/webbrowser.py
I changed the file
from:
register("mobilesafari", None, MobileSafari(), -1)
to:
register("mobilesafari", None, MobileSafari(), preferred=True)
I'm not quite sure whether the correct value for preferred is True or False.
But with this change, the BeeWare tutorial works again.
Describe the bug The beeware tutorial crashes on startup with the following error message:
2020-11-13 14:12:42.032770+0100 Hello World[2543:85840] File "/Users/Tom/Library/Developer/CoreSimulator/Devices/506D845C-0EA0-453B-A58F-C2D2A33ED530/data/Containers/Bundle/Application/407DBACD-C065-4EB1-87FF-D0087083ACFF/Hello World.app/Library/Application Support/com.example.helloworld/app/helloworld/app.py", line 4, in <module> 2020-11-13 14:12:42.033070+0100 Hello World[2543:85840] import toga 2020-11-13 14:12:42.033235+0100 Hello World[2543:85840] File "/Users/Tom/Library/Developer/CoreSimulator/Devices/506D845C-0EA0-453B-A58F-C2D2A33ED530/data/Containers/Bundle/Application/407DBACD-C065-4EB1-87FF-D0087083ACFF/Hello World.app/Library/Application Support/com.example.helloworld/app_packages/toga/__init__.py", line 1, in <module> 2020-11-13 14:12:42.033535+0100 Hello World[2543:85840] from .app import App, DocumentApp, MainWindow 2020-11-13 14:12:42.033701+0100 Hello World[2543:85840] File "/Users/Tom/Library/Developer/CoreSimulator/Devices/506D845C-0EA0-453B-A58F-C2D2A33ED530/data/Containers/Bundle/Application/407DBACD-C065-4EB1-87FF-D0087083ACFF/Hello World.app/Library/Application Support/com.example.helloworld/app_packages/toga/app.py", line 4, in <module> 2020-11-13 14:12:42.034478+0100 Hello World[2543:85840] import webbrowser 2020-11-13 14:12:42.034647+0100 Hello World[2543:85840] File "/Users/Tom/Library/Developer/CoreSimulator/Devices/506D845C-0EA0-453B-A58F-C2D2A33ED530/data/Containers/Bundle/Application/407DBACD-C065-4EB1-87FF-D0087083ACFF/Hello World.app/Library/Python/lib/python3.7/webbrowser.py", line 622, in <module> 2020-11-13 14:12:42.035111+0100 Hello World[2543:85840] register("mobilesafari", None, MobileSafari(), -1) 2020-11-13 14:12:42.035291+0100 Hello World[2543:85840] TypeError: register() takes from 2 to 3 positional arguments but 4 were given
To Reproduce Steps to reproduce the behavior:
Environment:
The problem is in the file Library/Python/lib/python3.7/webbrowser.py I changed the file from:
register("mobilesafari", None, MobileSafari(), -1)
to:register("mobilesafari", None, MobileSafari(), preferred=True)
I'm not quite sure whether the correct value for preferred is True or False. But with this change, the BeeWare tutorial works again.