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 LaTeX drawer on split-filesystem systems #8629

Merged
merged 4 commits into from
Aug 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion qiskit/visualization/circuit_visualization.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

import logging
import os
import shutil
import subprocess
import tempfile
from warnings import warn
Expand Down Expand Up @@ -488,7 +489,7 @@ def _latex_circuit_drawer(
image = utils._trim(image)
if filename:
if filename.endswith(".pdf"):
os.rename(base + ".pdf", filename)
shutil.move(base + ".pdf", filename)
else:
try:
image.save(filename)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
fixes:
- |
Fixed an ``OSError`` in the LaTeX circuit drawer on systems whose temporary
directories (*e.g* ``/tmp``) are on a different filesystem to the working
directory. See `#8542 <https://github.com/Qiskit/qiskit-terra/issues/8542>`__
for more detail.