Skip to content

Commit

Permalink
Merge pull request #1172 from urbanmatthias/patch-1
Browse files Browse the repository at this point in the history
Fix serialize to file destination when drive letter in destination on windows
  • Loading branch information
ashleysommer committed Oct 1, 2020
2 parents e56df6e + 1fd1fb5 commit 56dc420
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions rdflib/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -992,10 +992,11 @@ def serialize(
stream = os.fdopen(fd, "wb")
serializer.serialize(stream, base=base, encoding=encoding, **args)
stream.close()
dest = path if scheme == "file" else location
if hasattr(shutil, "move"):
shutil.move(name, path)
shutil.move(name, dest)
else:
shutil.copy(name, path)
shutil.copy(name, dest)
os.remove(name)

def parse(
Expand Down

0 comments on commit 56dc420

Please sign in to comment.