dag_drawer should check the existence of filename extension
See original GitHub issueInformation
- Qiskit Terra version: 0.10.0.dev0+831d942
- Python version: 3.7
- Operating system: Mac
What is the current behavior?
If a filename without extension is passed to the function dag_drawer
, this line reports two errors:
nxpd.pydot.InvocationException: Program terminated with status: 1. stderr follows: Format: "XXXXX" not recognized. Use one of: ......
During handling of the above exception, another exception occurred:
qiskit.visualization.exceptions.VisualizationError: 'dag_drawer requires GraphViz installed in the system. Check https://www.graphviz.org/download/ for details on how to install GraphViz in your system.'
This is confusing because the second error thrown by Qiskit is not the cause of the problem.
Steps to reproduce the problem
Try dag_drawer(dag, filename='abc')
What is the expected behavior?
Make the error catching better.
Suggested solutions
We could either catch this error by reading and filtering the error message, or we could check the existence of the filename’s extension, and provide a default one.
Issue Analytics
- State:
- Created 4 years ago
- Comments:13 (9 by maintainers)
Top Results From Across the Web
How to check if a file exists without looking at its extension ...
This would list all files with same name but different extensions. import glob print glob.glob("E:\\Logs\\Filename.*").
Read more >Checking the existence of any file with a specific extension in ...
I require to check whether any file exists with a specific extension in a given folder. Let us say, I look for whether...
Read more >How to check if the file exists in folder without passing file ...
First, I need to read data from one folder there I get attachment filename with extension and then I need to search in...
Read more >Check if a File or Directory Exists using Python - Data to Fish
Where the file name is 'New_Products' and the file extension is txt. Step 2: Check if the file exists using os.path.isfile. You can...
Read more >OneDrive -Check to see if a file already exists, s...
Hello, I have a workflow that requires a check to see if a filename and file extension already exists in a OneDrive folder....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@javabster Please assign the issue to me.
I can have a look!