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

fix(unicode): Import unicode_literals in every file #6805

Merged
merged 2 commits into from
Jan 25, 2019

Conversation

adityahase
Copy link
Member

@adityahase adityahase commented Jan 22, 2019

Ran this script

import os
files = os.popen("git ls-files | grep \.py$ | xargs grep -L 'unicode_literals'").read().split()
for filename in files:
    new_content = None
    with open(filename) as f:
        content = f.readlines()
        if len(content):
            if content[0] == "from __future__ import print_function\n":
                new_content = ["from __future__ import print_function, unicode_literals\n"] + content
            else:
                new_content = ["from __future__ import unicode_literals\n"] + content
    if new_content:
        with open(filename, "w") as f:
            f.writelines(new_content)

Basically check if every .py file does from __future__ import unicode_literals if not do so.

frappe/public/images/ui/bubble-tea-happy.svg Outdated Show resolved Hide resolved
frappe/templates/autodoc/pymodule.html Outdated Show resolved Hide resolved
@sagarvora
Copy link
Contributor

@adityahase
Copy link
Member Author

travis-ci.org/frappe/frappe/jobs/482862437#L1557

Passes now

@rmehta rmehta merged commit 837bfc0 into frappe:staging-fixes Jan 25, 2019
scmmishra pushed a commit to scmmishra/frappe that referenced this pull request Jan 28, 2019
* fix(unicode): Import unicode_literals in every file

* fix(unicode): Test if safe_json_loads return unicode instead of bytes
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants