Skip to content

Conversation

@adamcandy
Copy link
Contributor

Fixes a bug in PR 290 and closes issue #369 (Prefer English names logic is broken).

bool cannot be used to test for a True or False string in python.

This uses the standard routine distutils.util.strtobool to check the string provided in config.ini. This will correctly interpret: y, yes, t, true, on, 1, false, n, no, f, false, off, 0 and is case-insensitive.

I'm not sure how this slipped through the tests before...

@coveralls
Copy link

Coverage Status

Coverage increased (+0.006%) to 91.078% when pulling 30a28cc on adamcandy:fix-bool-prefer-english-names into 8e95b96 on jmathai:master.

return False

__PREFER_ENGLISH_NAMES__ = bool(config['MapQuest']['prefer_english_names'])
__PREFER_ENGLISH_NAMES__ = bool(strtobool(config['MapQuest']['prefer_english_names']))
Copy link
Owner

Choose a reason for hiding this comment

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

Thanks - I think we can eliminate the bool() call here.

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