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 ValueError: could not convert string to float on Windows/MikTeX #1237

Closed
wants to merge 2 commits into from
Closed

Conversation

cgohlke
Copy link
Contributor

@cgohlke cgohlke commented Sep 12, 2012

On Windows with MikTeX 2.9, the backend_pgf backend frequently fails with

  File "X:\Python32\lib\site-packages\matplotlib\backends\backend_pgf.py", line 348, in get_width_height_descent
    w, h, o = float(width[:-2]), float(height[:-2]), float(offset[:-2])
ValueError: could not convert string to float: '2.49608p'

@ghost ghost assigned pwuertz Sep 12, 2012
@pwuertz
Copy link
Contributor

pwuertz commented Sep 12, 2012

Oh nice, you already tracked the problem down to parsing the font metric query? Could you tell me what exactly went wrong on Windows? Do you have an example string that couldn't be parsed correctly?

I'm wondering.. \typeout{\the\wd0,\the\ht0,\the\dp0} should not cause latex to add any whitespaces :/

@cgohlke
Copy link
Contributor Author

cgohlke commented Sep 12, 2012

Turns out the end of the split line was and \r. No need to strip all strings.

@pwuertz
Copy link
Contributor

pwuertz commented Sep 12, 2012

Ah, I was afraid of something like that. For the sake of python3 support I had to remove the "universal_newlines" parameter in subprocess.Popen.. but I think this should be the only incident. Can you squash the commits to a single fix?

@cgohlke
Copy link
Contributor Author

cgohlke commented Sep 12, 2012

Just ignore this PR and apply the change with a better commit message.

@pwuertz
Copy link
Contributor

pwuertz commented Sep 12, 2012

All right, fixed in #1240
Thanks for tracking this down!

@pwuertz pwuertz closed this Sep 12, 2012
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.

None yet

2 participants