diff options
author | Ashley Sommer <ashleysommer@gmail.com> | 2020-10-02 08:17:07 +1000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-10-02 08:17:07 +1000 |
commit | 56dc4207ce6e7b11ed7b45fb4fd4020ba548e718 (patch) | |
tree | cfb0312726bf033947c486807e1aabfa148efb87 | |
parent | e56df6e189fba0e592391d21e3b394882032f186 (diff) | |
parent | 1fd1fb5a277f68da87fa64101cca7665f69df4b3 (diff) | |
download | rdflib-56dc4207ce6e7b11ed7b45fb4fd4020ba548e718.tar.gz |
Merge pull request #1172 from urbanmatthias/patch-1
Fix serialize to file destination when drive letter in destination on windows
-rw-r--r-- | rdflib/graph.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/rdflib/graph.py b/rdflib/graph.py index f6024c46..e0d5f854 100644 --- a/rdflib/graph.py +++ b/rdflib/graph.py @@ -992,10 +992,11 @@ class Graph(Node): 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( |