Fix unicode parsing of ini files.

Review Request #3595 - Created March 22, 2016 and submitted

Garrett Malmquist
benjyw, zundel
We encountered an annoying problem upgrading pants in our repo.
Apparently we had a unicode left-quotation mark (\u2018) inside a
line comment. The line comment happened to be in a list. This
caused the option parsing to fail when trying to call
`value.startswith('[')`, which generated a cryptic error about not
being able to decode the string with ascii. This was especially
troublesome because there was no indication of which option the
error was in (and trying to get python to print out the string
caused it to fail with the same error just trying to format the
string for inclusion in a print message).

Added a test to that fails without this change, and passes with this change.

CI went green here:


  • 0
  • 2
  • 2
  • 4
Description From Last Updated
Eric Ayers
Garrett Malmquist
Stu Hood
Garrett Malmquist
Benjy Weinberger
Garrett Malmquist
Benjy Weinberger
Benjy Weinberger
Garrett Malmquist
Review request changed

Status: Closed (submitted)

Change Summary:

In 9f312e7b7d5d8ffea3abf356cb3733962aa476f3. Thanks Eric, Stu, and Benjy!