Skip to content

open webbrowser regsiter() error #2047

Closed
@cgn5566

Description

@cgn5566

Versions

  • Python:3.7.1
  • OS:ubuntu 18.0.4 64
  • Kivy:master
  • Cython: 0.28.2

Description

it's my code:
url = 'http://****' #it's a valid url
def launch_webbrowser(self, url):
import webbrowser
if platform == 'android':
from jnius import autoclass, cast
def open_url(url):
PythonActivity = autoclass('org.kivy.android.PythonActivity')
activity = PythonActivity.mActivity
Intent = autoclass('android.content.Intent')
Uri = autoclass('android.net.Uri')
browserIntent = Intent()
browserIntent.setAction(Intent.ACTION_VIEW)
browserIntent.setData(Uri.parse(url))
currentActivity = cast('android.app.Activity', activity)
currentActivity.startActivity(browserIntent)

        # Web browser support.
        class AndroidBrowser(object):
            def open(self, url, new=0, autoraise=True):
                open_url(url)

            def open_new(self, url):
                open_url(url)
            def open_new_tab(self, url):
                open_url(url)

        webbrowser.register('android', AndroidBrowser, None, -1)
    webbrowser.open(url)

when i call launch_webbrowser() in kv
on_press:
root.launch_webbrowser(root.url)

i get this error in log:
webbrowser.register('android', AndroidBrowser, None, -1)
TypeError: register() takes from 2 to 3 positional arguments but 4 were given

maybe i think it's a bug of python3.7
please help ths!

buildozer.spec

Command:

// REPLACE ME: buildozer command ran? e.g. buildozer android debug

Spec file:

// REPLACE ME: Paste your buildozer.spec file here

Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions