Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Remove simplejson and deprecate encoding options#3562

Merged
davidism merged 3 commits intomasterfrom
remove-simplejson
Apr 7, 2020
Merged

Remove simplejson and deprecate encoding options#3562
davidism merged 3 commits intomasterfrom
remove-simplejson

Conversation

@davidism
Copy link
Member

  • Remove simplejson. Remove UTF encoding guessing, which the built-in module handles now. Simplifyhtmlsafe_dumps to usestr.translate instead of multiplestr.replace.
  • Issue deprecation warning ifencoding is passed todumps,dump,loads, orload. This was deprecated in the built-in module back in 3.1. The only valid encodings for JSON are UTF-8 (with/without BOM), UTF-16 (BE/LE), and UTF-32 (BE/LE).json.loads accepts bytes andjson.loads accepts binary files in these encodings without any special handling on our part.dumps can be encoded after calling, anddump can be passed a binary file wrapped withio.TextIOWrapper.
  • Rewrite docs for consistency.
  • Fix imports and references ofMarkup to be from MarkupSafe instead of Flask or Jinja.

See the individual commits for easier diffs.

closes#3555

- remove encoding detection backport, json.loads supports it directly- use str.translate instead of multiple str.replace
make consistent with built-in json module
@davidismdavidism added the json labelApr 7, 2020
@davidismdavidism added this to the2.0.0 milestoneApr 7, 2020
@davidismdavidism merged commite69b49b intomasterApr 7, 2020
@davidismdavidism deleted the remove-simplejson branchApril 7, 2020 20:40
@anmol-dhingra
Copy link

@davidism I see we are no-longer importing json from itsdangerous library. When is the fix for removal of simplejson planned to be released as flask import is failing because of the simplejson raising an error.

@palletspallets locked asresolvedand limited conversation to collaboratorsOct 3, 2020
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

No reviews

Assignees

No one assigned

Labels

Projects

None yet

Milestone

2.0.0

Development

Successfully merging this pull request may close these issues.

Remove simplejson

2 participants

@davidism@anmol-dhingra

Comments


[8]ページ先頭

©2009-2026 Movatter.jp