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

parse failed for mutibytes characters, encode will show in \xxx #77865

Closed
zhouronghuaztecomcn mannequin opened this issue May 29, 2018 · 4 comments
Closed

parse failed for mutibytes characters, encode will show in \xxx #77865

zhouronghuaztecomcn mannequin opened this issue May 29, 2018 · 4 comments
Labels
3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@zhouronghuaztecomcn
Copy link
Mannequin

zhouronghuaztecomcn mannequin commented May 29, 2018

BPO 33684
Nosy @vstinner, @ezio-melotti, @methane, @miss-islington, @zhou.ronghua@zte.com.cn
PRs
  • bpo-33684:when strings or files are encode with utf8 without bom, auto detect encoding will fail. set default decoded type with utf-8 for most time #7203
  • bpo-33684:parse failed for mutibytes characters, encode will show in \xxx #7286
  • bpo-33684: json.tool: Use utf-8 for infile and outfile. #17460
  • [3.8] bpo-33684: json.tool: Use utf-8 for infile and outfile. (GH-17460) #17464
  • [3.7] bpo-33684: json.tool: Use utf-8 for infile and outfile. (GH-17460) #17465
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2019-12-04.10:27:07.562>
    created_at = <Date 2018-05-29.14:29:39.270>
    labels = ['3.7', '3.8', 'type-bug', 'library', '3.9']
    title = 'parse failed for mutibytes characters, encode will show in \\xxx'
    updated_at = <Date 2019-12-04.10:27:17.745>
    user = 'https://github.com/zhouronghuaztecomcn'

    bugs.python.org fields:

    activity = <Date 2019-12-04.10:27:17.745>
    actor = 'methane'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-12-04.10:27:07.562>
    closer = 'methane'
    components = ['Library (Lib)']
    creation = <Date 2018-05-29.14:29:39.270>
    creator = 'zhou.ronghua'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 33684
    keywords = ['patch']
    message_count = 4.0
    messages = ['318039', '357786', '357789', '357791']
    nosy_count = 5.0
    nosy_names = ['vstinner', 'ezio.melotti', 'methane', 'miss-islington', 'zhou.ronghua']
    pr_nums = ['7203', '7286', '17460', '17464', '17465']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue33684'
    versions = ['Python 3.7', 'Python 3.8', 'Python 3.9']

    @zhouronghuaztecomcn
    Copy link
    Mannequin Author

    zhouronghuaztecomcn mannequin commented May 29, 2018

    when type this command in windows(xp or win7, all the same):
    python -m json.tool xxx.txt xxx.json
    if xxx.txt contains Chinese(or other multibytes characters):
    if xxx.txt is encoded in ansi, xxx.json will encode Chinese as \xxx, very bad to see what they are;
    if xxx.txt is encoded in utf8(without bom for most of the time), because with no bom, json.tool will think it is encoded in ansi, and decode fail.

    as now, utf8 is widely use, set default to utf8 for most of the time when auto detect encoding failed

    @zhouronghuaztecomcn zhouronghuaztecomcn mannequin added topic-unicode 3.8 only security fixes type-bug An unexpected behavior, bug, or error labels May 29, 2018
    @methane
    Copy link
    Member

    methane commented Dec 4, 2019

    New changeset 808769f by Inada Naoki in branch 'master':
    bpo-33684: json.tool: Use utf-8 for infile and outfile. (GH-17460)
    808769f

    @miss-islington
    Copy link
    Contributor

    New changeset a75cad4 by Miss Islington (bot) in branch '3.8':
    bpo-33684: json.tool: Use utf-8 for infile and outfile. (GH-17460)
    a75cad4

    @methane
    Copy link
    Member

    methane commented Dec 4, 2019

    New changeset e0f148e by Inada Naoki in branch '3.7':
    bpo-33684: json.tool: Use utf-8 for infile and outfile. (GH-17460)
    e0f148e

    @methane methane added 3.7 (EOL) end of life 3.9 only security fixes labels Dec 4, 2019
    @methane methane closed this as completed Dec 4, 2019
    @methane methane added stdlib Python modules in the Lib dir and removed topic-unicode labels Dec 4, 2019
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life 3.8 only security fixes 3.9 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants