Skip to content
This repository has been archived by the owner on Jun 15, 2023. It is now read-only.

archive project hangs when downloading a file #93

Open
ferdymercury opened this issue Jun 2, 2020 · 5 comments
Open

archive project hangs when downloading a file #93

ferdymercury opened this issue Jun 2, 2020 · 5 comments

Comments

@ferdymercury
Copy link

The archive project plugin froze KiCad after trying to download one of the manuals.

Here the last lines in the log file after I waited 10 minutes and killed the process:

06-02 12:19:06 archive_project.archive_project 433:Trying to archive documentation file: "https://media.digikey.com/pdf/data%20sheets/cooper%20bussmann%20pdfs/ccfl_transformers_rev2015.pdf"
06-02 12:19:06 archive_project.archive_project 440:File is encoded with URL
06-02 12:19:06 archive_project.archive_project 456:Downloading file
@ferdymercury
Copy link
Author

I found a workaround by adding the following:

link = link.replace('%20',' ')

@MitjaNemec
Copy link
Owner

Thanks for reporting and providing the workaround. I'll have to take a look into this and provide a more universal solution (there might be links with other % encodings)

@ferdymercury
Copy link
Author

with the requests package on python3 #95, this issue was not the case any more even without replacing %20

@MitjaNemec
Copy link
Owner

I'd really like to avoid relying on requests package. It is an external dependency and this will significantly complicate plugin installation in Windows and maybe also on macOs. I am assuming you are running on Linux? On Win and macOs platforms, KiCad uses its own interpreter, which is installed with KiCad and comes with bare minimum of packages. So user would have to install the requests package to KiCad python interpreter.

If I find a nice way to install request at least into KiCad on Windows, I'll consider using it.

@ferdymercury
Copy link
Author

Yes, I am running on Linux and installed the requests package with pip.

I understand, sure, if there is a solution without extra packages, much better. I think it can be probably fixed with some mapping dictionary of special characters.

The 403 error might be however more hard to solve with urlretrieve, I tried this but did not work https://stackoverflow.com/questions/34957748/http-error-403-forbidden-with-urlretrieve. If no workaround solves it, one might think of a hybrid approach: if the standard urlretrieve query failed, check if user has requests installed and try downloading with that one. This does not force Windows user to install it, but at the same time allows other users to get full docu if package is included.

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

No branches or pull requests

2 participants