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

fix #313 modification of owl temporary file in save function #314

Closed

Conversation

sygout
Copy link
Collaborator

@sygout sygout commented Dec 1, 2021

Description:

Type of change:

  • Bug fix.
  • New feature.
  • Documentation update.

Checklist:

This checklist can be used as a help for the reviewer.

  • Is the code easy to read and understand?
  • Are comments for humans to read, not computers to disregard?
  • Does a new feature has an accompanying new test (in the CI or unit testing schemes)?
  • Has the documentation been updated as necessary?
  • Does this close the issue?
  • Is the change limited to the issue?
  • Are errors handled for all outcomes?
  • Does the new feature provide new restrictions on dependencies, and if so is this documented?

Comments:

the following code creates a problem on Windows:

with tempfile.NamedTemporaryFile(suffix=".owl") as handle:
   super().save(file=handle.name, format="rdfxml", **kwargs)
   graph = rdflib.Graph() 
   graph.parse(handle.name, format="xml") 
   graph.serialize(destination=filename, format=format)

It is related to an issue with tempfile library. The problem comes from reopening the temporary file. the first line create and open the file. so the modification simply create a file name located in the temporary folder and use that path for the successive operations.

@sygout sygout requested a review from francescalb December 1, 2021 14:56
@sygout sygout linked an issue Dec 1, 2021 that may be closed by this pull request
ontopy/ontology.py Outdated Show resolved Hide resolved
@francescalb
Copy link
Collaborator

Can you please write a little documentation on this PR? Tick off the box for bug fix and write a few sentences on why.

Co-authored-by: Francesca L. Bleken <[email protected]>
@francescalb
Copy link
Collaborator

This is deprecated due to #315

@francescalb francescalb closed this Dec 1, 2021
@CasperWA CasperWA deleted the permission-denied-temporary-file branch May 5, 2022 09:24
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

Successfully merging this pull request may close these issues.

permission denied when working with temporary file
2 participants