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

avoid b' in get_datafile #321

Closed
wants to merge 1 commit into from
Closed

Conversation

graingert
Copy link

@graingert graingert commented Apr 1, 2021

Summary

  • get_datafile feature is limited to Python 2. When Py 2 is used to fetch the datafile using get_datafile() the returned datafile is unicode string.
  • When Py 3 is used, the get_datafile() method returns 'bytes' type, a binary string), not a regular text. This requires extra encoding to convert. The patchmakes datafile json string compatible with both Py2 and Py3.
  • ProjectConfig's init sets self._datafile = u'{}'.format(datafile) but the next line does self._datafile = u'{}'.format(datafile)
  • [PS: bytes/unicode mixups happen a lot when porting py2 code to py3]

Test plan

  • fix to be tested in both Py2 and Py3.

Issues

@andrewleap-optimizely
Copy link
Contributor

fixed by #384

@graingert graingert deleted the patch-1 branch June 3, 2022 18:38
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