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 call to ord in lib3 emitter code #129

Closed
wants to merge 1 commit into from
Closed

Conversation

@scauligi
Copy link
Contributor

@scauligi scauligi commented Feb 4, 2018

Fixes issue #118
encode produces a bytestring, and iterating over a bytestring in python 3 produces ints instead of chars

@perlpunk
Copy link
Member

@perlpunk perlpunk commented Mar 17, 2018

I vote for merging. @ingydotnet @sigmavirus24 or anyone else, thoughts?

Loading

@ingydotnet
Copy link
Member

@ingydotnet ingydotnet commented Mar 19, 2018

Can we get a test to support this change?

Loading

@perlpunk
Copy link
Member

@perlpunk perlpunk commented Feb 23, 2019

Here's a test reproducing it:

import yaml

l = lambda: None
d = yaml.dump({ 'l': l }, default_flow_style=False)

print(d)
assert(d == "l: !!python/name:__main__.%3Clambda%3E ''\n")

Currently it produces an exception in python3:

...
  File "lib3/yaml/emitter.py", line 607, in prepare_tag
    chunks.append('%%%02X' % ord(ch))
TypeError: ord() expected string of length 1, but int found

Loading

@ingydotnet ingydotnet moved this from Possible PRs and To Do items to Added to release/5/1 branch in 5.1 Release Feb 23, 2019
@perlpunk
Copy link
Member

@perlpunk perlpunk commented Mar 14, 2019

merged in d13a3d0

Loading

@perlpunk perlpunk closed this Mar 14, 2019
@perlpunk perlpunk mentioned this pull request Mar 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
No open projects
5.1 Release
Added to release/5/1 branch
Linked issues

Successfully merging this pull request may close these issues.

None yet

3 participants