OxygenFramework / Oxygen.jl

💨 A breath of fresh air for programming web apps in Julia
https://oxygenframework.github.io/Oxygen.jl/
MIT License
409 stars 25 forks source link

close file handles #159

Closed ericphanson closed 7 months ago

ericphanson commented 7 months ago

I noticed usage of open without the function-accepting form (see the Julia docs). This will open a file handle, but we never close them. It's good practice to close them, see e.g. https://stackoverflow.com/a/25070939

Here I've done the minimal changes to remove unnecessary open calls for thing like read (which accept filepaths already), and in the other cases to use the form with a function as the first argument so open will close the handle for us.

codecov[bot] commented 7 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Comparison is base (8fed3b9) 98.31% compared to head (b7edf33) 98.31%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #159 +/- ## ======================================= Coverage 98.31% 98.31% ======================================= Files 14 14 Lines 1070 1070 ======================================= Hits 1052 1052 Misses 18 18 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

ericphanson commented 7 months ago

I think the test failure is unrelated, since I see it also on #160 which doesn't have any of the same changes as this PR, and I also see it in #158. I'm not sure what is causing it though 🤔