Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Load html triggers error - resolve_url() missing 1 required positional argument: 'should_serve' #562

Closed
abhishekmishra opened this issue Jul 5, 2020 · 11 comments

Comments

@abhishekmishra
Copy link

abhishekmishra commented Jul 5, 2020

Specification

  • pywebview version: 3.3.1
  • platform / version: win10/64-bit, python 3.8.3

Description

Trying to load html in a pywebview window triggers an exception. Let me know if you need further info, I can also help with debugging.

Sample run (taken from examples in documentation)

window = webview.create_window('Load HTML Example', html='<h1>This is initial HTML</h1>')

Exception

Unhandled Exception: Python.Runtime.PythonException: TypeError : resolve_url() missing 1 required positional argument: 'should_serve'
   at Python.Runtime.Dispatcher.Dispatch(ArrayList args)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

Practicalities

  • YES I am willing to work on this issue myself.

  • NO I am prepared to support this issue financially.

@lpanor
Copy link

lpanor commented Jul 5, 2020

I'm getting the same error! Spent 2 hours around this, thinking I was doing something wrong! :/

Thanks for posting the issue.

@sunilgoothy
Copy link

sunilgoothy commented Jul 7, 2020

Same Error for me. I was trying multi-window example.
Works fine if we use url parameter instead of html.

@lpanor
Copy link

lpanor commented Jul 7, 2020

Same Error for me. I was trying multi-window example.
Works fine if we use url parameter instead of html.

Yes, i can also use url with no problems for web urls (ex: google.com), but if I try to parse a local HTML ( C:\teste.html ) in the URL parameter i'm also getting an error. It's a diferent one and i'm still checking if it's note bad programing on my part, i don't think its related to this issue.

@r0x0r
Copy link
Owner

r0x0r commented Jul 12, 2020

I pushed a fix to the master. Could someone verify it?

@bloemer
Copy link

bloemer commented Jul 14, 2020

Hi, I just copy and paste the script from the api's "load html example".
It's opening now without errors, but it displays "Path / was not found" (without quotes) and prints:
127.0.0.1 - - [14/Jul/2020 15:57:14] "GET / HTTP/1.1" 404 20

I installed the latest version via zip 5h ago

@r0x0r
Copy link
Owner

r0x0r commented Jul 15, 2020

I pushed a fix into the master. A throughout testing is needed and appreciated.

@astronouth7303 bits.path was empty for local URLs outside the application root, so I resorted to using bits.netloc if path is empty. Do you see any problem with this? It works at least on EdgeHTML (both for load_html and http_server). The commit in question is 1c5a050

@AstraLuma
Copy link
Contributor

AstraLuma commented Jul 15, 2020

@r0x0r Added comments to the commit directly.

@r0x0r
Copy link
Owner

r0x0r commented Jul 23, 2020

The latter commit fixes this issue. I am closing this issue and will release a new version soon.

@r0x0r r0x0r closed this as completed Jul 23, 2020
@qaniere
Copy link

qaniere commented Aug 14, 2020

I have to re-open this issue because I have the issue. I paste the example from the documentation site, I try to put add empty URL, try to force cef GUI , I try to disable http_server, and it still don't work. I also try to load the google url then load html, the load html method has the same error as the html attribute :

Python.Runtime.PythonException: TypeError : resolve_url() missing 1 required positional argument: 'should_serve' à Python.Runtime.Dispatcher.Dispatch(ArrayList args)

@r0x0r
Copy link
Owner

r0x0r commented Aug 27, 2020

@qaniere Which example are you referring to? Are you using the latest version?

@qaniere
Copy link

qaniere commented Sep 1, 2020

It's strange, because the 3.3.3 version was producing the issue and I uninstall and install again pywebview and it seem to work even if pip logs tell me that is also the 3.3.3 version. Sorry for the inconvenience.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants