Skip to content

[Bug]: Infinite loop when there is single double quote in matplotlibrc #22636

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

Closed
yy0931 opened this issue Mar 11, 2022 · 0 comments · Fixed by #22668
Closed

[Bug]: Infinite loop when there is single double quote in matplotlibrc #22636

yy0931 opened this issue Mar 11, 2022 · 0 comments · Fixed by #22668
Assignees
Labels
Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. status: confirmed bug
Milestone

Comments

@yy0931
Copy link

yy0931 commented Mar 11, 2022

Bug summary

This code https://github.com/timhoffm/matplotlib/blob/7c378a8f3f30ce57c874a851f3af8af58f1ffdf6/lib/matplotlib/cbook/__init__.py#L403-L415 on the main branch (not released yet) falls into an infinite loop when there is only one double quotation because when s.find('"', quote_pos + 1) == -1 pos == 0

context:

Code for reproduction

from pathlib import Path

import matplotlib.pyplot as plt

Path("./test.mplstyle").write_text('grid.color: "aa')
plt.style.use("./test.mplstyle")

Actual outcome

The program doesn't exit.

Expected outcome

Show an error or set '"aa'.

Additional information

No response

Operating system

No response

Matplotlib Version

3.6.0.dev1816+gb9ae51ca8c.d20220311

Matplotlib Backend

No response

Python version

Python 3.10.0

Jupyter version

No response

Installation

No response

@yy0931 yy0931 changed the title [Bug]: Infinite loop when there is single double quote [Bug]: Infinite loop when there is single double quote in matplotlibrc Mar 11, 2022
@tacaswell tacaswell added this to the v3.6.0 milestone Mar 11, 2022
@tacaswell tacaswell added the Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. label Mar 11, 2022
@timhoffm timhoffm self-assigned this Mar 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Release critical For bugs that make the library unusable (segfaults, incorrect plots, etc) and major regressions. status: confirmed bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants