Using persistent cache.json

Posted on
Sat Aug 21, 2021 5:27 am
davinci offline

Using persistent cache.json

I am using the external script TeslaPy. I need to login by using a captcha. To only do this once I need to use cache.json, but ist always asks for the captcha again.

How is Indigo handling this?

Posted on
Sat Aug 21, 2021 10:54 am
jay (support) offline
Site Admin
User avatar
Posts: 18200
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Using persistent cache.json

How is Indigo handling what exactly? We don't use anything that requires a cache.json file.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Sat Aug 21, 2021 11:44 am
davinci offline

Re: Using persistent cache.json

Not sure, but the login has to be saved somewhere, right?

I understood, that this is saved in cache.json.

Posted on
Sat Aug 21, 2021 2:01 pm
jay (support) offline
Site Admin
User avatar
Posts: 18200
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Using persistent cache.json

That TeslaPy script isn’t ours, so we know nothing about how it works.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Sun Aug 22, 2021 6:38 am
davinci offline

Re: Using persistent cache.json

In case someone else runs into that problem, this is the solution:

Code: Select all
with teslapy.Tesla(tesla_mail, tesla_pass, cache_file='/path/to/cache/cache.json') as tesla:


It does not work without that, which means Indigo has no temporary space that is available for other scripts - probably due to sandboxing.

Posted on
Mon Aug 23, 2021 9:30 am
jay (support) offline
Site Admin
User avatar
Posts: 18200
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Using persistent cache.json

davinci wrote:
It does not work without that, which means Indigo has no temporary space that is available for other scripts - probably due to sandboxing.


I suspect that the default location that that particular library tries to use isn't writable by the Indigo Host process. Nothing to do with temporary space (Python has no build-in concept like OS tmp directories outside of the build-in module to access system level temp files, but those don't persist as you'd need for a cache).

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 3 guests