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

Unable to execute a ZIP archive example #22

Open
Ajinkz opened this issue Mar 15, 2019 · 9 comments
Open

Unable to execute a ZIP archive example #22

Ajinkz opened this issue Mar 15, 2019 · 9 comments
Labels
bug sciter-engine Issues related to the Sciter Engine itself wontfix

Comments

@Ajinkz
Copy link

Ajinkz commented Mar 15, 2019

OS: Windows 10
Python version: 3.6
Pysciter: 0.4.29

When I was trying to run
python ./archive.zip
I got this error

(face2) D:\Ajinkya\RASA\pysciter-master\examples>python ./archive.zip
warning:dom: failed to load "//archive.zip" file, error=161
Traceback (most recent call last):
  File "D:\ai\envs\face2\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "D:\ai\envs\face2\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File ".\archive.zip\__main__.py", line 7, in <module>
  File "D:\ai\envs\face2\lib\site-packages\sciter\host.py", line 107, in load_file
    raise sciter.SciterError("Unable to load file " + uri)
sciter.error.SciterError: Unable to load file archive.zip#archived.htm
@pravic pravic added the bug label Mar 15, 2019
@pravic
Copy link
Member

pravic commented Mar 15, 2019

@c-smile Andrew, has something been changed in zip archive handling?

@c-smile
Copy link
Contributor

c-smile commented Mar 15, 2019

Nothing have changed in .ZIP handling respect.

Check if SciterLoadFile gets called with absolute path or absolute file URL.

@pravic
Copy link
Member

pravic commented Nov 12, 2020

@c-smile Well, it did work in past.

archive.zip contains "archived.htm".

It was referenced as "archive.zip#archived.htm" and it used to work.

Now, I get for "archive.zip#archived.htm" the following:

warning:dom: failed to load "d:/usr/lib/gui/htmlayout/pysciter/examples/archive.zip%archived.htm" file, error=2

And for "archive.zip/archived.htm":

"warning:dom: failed to load "d:/usr/lib/gui/htmlayout/pysciter/examples/archive.zip/archived.htm" file, error=3

The only thing that works is: "archive.zip" as URL with "index.htm" in it.

So, is it possible to load a specific HTML from a ZIP archive? If yes, how?

@pravic pravic added the sciter-engine Issues related to the Sciter Engine itself label Nov 12, 2020
@c-smile
Copy link
Contributor

c-smile commented Nov 12, 2020

Is this relative URL:
"pysciter/examples/archive.zip%archived.htm"
?
I suspect that problem is on pysciter side - it does not provide absolute file:// .... URL or absolute path.
Again Sciter has no notion of CWD - that's completely on Python,Go,C,whatever side .

@pravic
Copy link
Member

pravic commented Nov 12, 2020

No, it's an absolute url in all cases.

@c-smile
Copy link
Contributor

c-smile commented Nov 12, 2020

Check if https://github.com/c-smile/sciter-sdk/blob/master/samples/zip/test-explicit-main.htm works in wsciter/usciter on your machine.

@c-smile
Copy link
Contributor

c-smile commented Nov 12, 2020

No, it's an absolute url in all cases.

I suspect it is not absolute URL according to this:

raise sciter.SciterError("Unable to load file " + uri)
> Unable to load file **archive.zip#archived.htm**

@pravic pravic changed the title sciter.error.SciterError: Unable to load file file://D:/Ajinkya/RASA/pysciter-master/examples/examples/minimal.htm Unable to execute a ZIP archive example Nov 18, 2020
@pravic
Copy link
Member

pravic commented Nov 18, 2020

Well, it's all about absolute paths.

URL "archive.zip#archived.htm" doesn't work anymore.
URL "d:/pysciter/examples/archive.zip#archived.htm" doesn't work either despite looking like an absolute URL.
URL "d:\pysciter\examples\archive.zip#archived.htm" doesn't work as well.
URL "file://d:\pysciter\examples\archive.zip#archived.htm" works. So, from some point in Sciter's history the file:// part is mandatory now.

But that leads us to a broken example with "archive.zip" - well, it was just a trick anyway.

@pravic pravic added the wontfix label Nov 18, 2020
@zpfz
Copy link

zpfz commented Feb 5, 2023

By the way,has a way to load an ZIP with ZIP's password(prevent some body to modify the core files)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug sciter-engine Issues related to the Sciter Engine itself wontfix
Development

No branches or pull requests

4 participants