Skip to content

Escaped Windows path in Python script to avoid Unicode errors - #1

Open
ripiddo wants to merge 4 commits into
QuLearnLabs:mainfrom
ripiddo:main
Open

Escaped Windows path in Python script to avoid Unicode errors#1
ripiddo wants to merge 4 commits into
QuLearnLabs:mainfrom
ripiddo:main

Conversation

@ripiddo

@ripiddo ripiddo commented May 4, 2025

Copy link
Copy Markdown

This PR fixes a Unicode escape issue when generating circuit images on Windows.
The embedded Python script failed with a SyntaxError due to unescaped \U in file paths.
This change uses a raw string to avoid the issue.

Tested on:
Windows 11
Python 3.13

Qiskit (latest)
✅ Confirmed working after fix

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adjusts the generated embedded Python script in circuit-visualizer.ts to avoid Windows path Unicode-escape parsing issues by switching the output-path debug print to a raw string literal.

Changes:

  • Updated the Python debug print for “Output path” to use a raw string (r"...") to prevent \U... escape parsing errors on Windows.
  • Minor formatting-only adjustment at the end of the TypeScript file (no functional change).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/circuit-visualizer.ts Outdated
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants