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

No such file or directory #166

Closed
VitoFanelli opened this issue Aug 15, 2023 · 14 comments
Closed

No such file or directory #166

VitoFanelli opened this issue Aug 15, 2023 · 14 comments

Comments

@VitoFanelli
Copy link

Hi, thank you for this package. But I'm not able to use it because every functions I use I get this error. Fo example,

load_results(2023, 4)

Error in gzfile(file, mode) : cannot open the connection
In addition: Warning message:
In gzfile(file, mode) :
cannot open compressed file 'D://f1dataR_http_cache/948140ffb44381f90077cc96050d2d5b.rds', probable reason 'No such file or directory'

load_pitstops(2023,1)

Error in gzfile(file, mode) : cannot open the connection
In addition: Warning message:
In gzfile(file, mode) :
cannot open compressed file 'D://f1dataR_http_cache/03450e79b4e92363d94773d150821d90.rds', probable reason 'No such file or directory'

Only last results or pitstops is ok.

Can you help me?

I downloaded github version of the packages because there is no package available for my R version (4.3.1).

Thank you!

@SCasanova
Copy link
Owner

Hi Vito,

This sounds like something that should be fixed either today or tomorrow. We've been working on it

As for the CRAN version, that's also coming very soon.

Please try again tomorrow and let us know if the problem persists

@SCasanova
Copy link
Owner

Please re-download and see if you still ger the error

@VitoFanelli
Copy link
Author

Hi, I've tried and it works! But some other functions not. For example,

data <- load_driver_telemetry()

Error in py_run_string_impl(code, local, convert) :
File "", line 1
fastf1.Cache.enable_cache('C:\Users\vito\AppData\Local\Temp\RtmpGwdSEw')
^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

or

data <- load_session_laps(2023,1)

Error in py_run_string_impl(code, local, convert) :
File "", line 1
fastf1.Cache.enable_cache('C:\Users\vito\AppData\Local\Temp\RtmpGwdSEw')
^
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape

I hope this is useful for you to fix if it is a bug.

Thank you very much!

@SCasanova
Copy link
Owner

SCasanova commented Aug 16, 2023

It's very useful thanks @VitoFanelli

Hey @pbulsink looks like a practical case of normalizePath(). Looks like we need to add the winslash option everywhere

@pbulsink
Copy link
Collaborator

Is these are both FastF1 functions.

I guess we didn't test with cache set to "memory", so I can possibly do that this afternoon/early evening.

As for the bug though, winslash should have been set up already in load_session_data() which is where this error likely comes out of. I think for the fastf1 call itself we need to use default winslash instead of just "/"?

@SCasanova
Copy link
Owner

The thing is that is see the backslashes in the error message, which is the same I was dealing with when we first used normalize path

@pbulsink
Copy link
Collaborator

You sometimes have to escape the slash from R - so // is what's needed. Else C:/Users looks like a failed /Uxxxxxx Unicode character. Sometimes we might even need to double escape it: //// turns into // in R, then in Python it turns into / for a proper path pointer.

@pbulsink
Copy link
Collaborator

Not an issue on *nix because they use \ paths instead.

@SCasanova
Copy link
Owner

Hmm, looking closer at the code it might be a direct issue with tempdir() as it doesn't get normalized when the option is memory. I believe it should be fixed with just that normalization with winslash

@SCasanova
Copy link
Owner

@VitoFanelli please try in about an hour if possible

@VitoFanelli
Copy link
Author

Hey, now it works.
Next days I'll try other things and I'll report to you if I find bugs.
Thank you @SCasanova @pbulsink for this beautifull package. Very impressive!

@SCasanova
Copy link
Owner

SCasanova commented Aug 16, 2023

Good to hear! Let us know if you have any other problems. Enjoy

@pbulsink sadly the fix came after CRAN so we might have to re-submit immediately.

@pbulsink
Copy link
Collaborator

pbulsink commented Aug 16, 2023 via email

@SCasanova
Copy link
Owner

Done. Don't know how CRAN will handle the double submission...

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

3 participants