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

Remove YAML unicode tags from Mkdocs config #2998

Merged
merged 1 commit into from
Jul 12, 2017
Merged

Conversation

agjohnson
Copy link
Contributor

In the case of a unicode string without a unicode character, YAML adds a tag to
ensure the text is read as unicode, ie:

In [1]: import yaml

In [2]: yaml.dump(u'surprise!')
Out[2]: "!!python/unicode 'surprise!'\n"

This forces only literals are output to the YAML config, by using safe_dump
instead of dump

In the case of a unicode string without a unicode character, YAML adds a tag to
ensure the text is read as unicode, ie:

    In [1]: import yaml

    In [2]: yaml.dump(u'surprise!')
    Out[2]: "!!python/unicode 'surprise!'\n"

This forces only literals are output to the YAML config, by using `safe_dump`
instead of `dump`
@agjohnson agjohnson added the PR: work in progress Pull request is not ready for full review label Jul 11, 2017
@agjohnson agjohnson requested a review from ericholscher July 11, 2017 04:13
@agjohnson agjohnson added PR: ready for review and removed PR: work in progress Pull request is not ready for full review labels Jul 11, 2017
Copy link
Member

@ericholscher ericholscher left a comment

Choose a reason for hiding this comment

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

Ah, yes. The wonderful YAML safe API's. Worst API ever.

@agjohnson agjohnson merged commit 228535a into master Jul 12, 2017
@agjohnson agjohnson deleted the fix-mkdocs-unicode branch July 12, 2017 21:44
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.

2 participants