question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

dag_drawer should check the existence of filename extension

See original GitHub issue

Information

  • 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:closed
  • Created 4 years ago
  • Comments:13 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
iuliazidarucommented, Dec 22, 2021

@javabster Please assign the issue to me.

1reaction
1ucian0commented, Nov 15, 2019

I can have a look!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found