fix: keep non-ASCII text readable in task JSON files#133
Open
bluzername wants to merge 1 commit intoshareAI-lab:mainfrom
Open
fix: keep non-ASCII text readable in task JSON files#133bluzername wants to merge 1 commit intoshareAI-lab:mainfrom
bluzername wants to merge 1 commit intoshareAI-lab:mainfrom
Conversation
|
@bluzername is attempting to deploy a commit to the crazyboym's projects Team on Vercel. A member of the Team first needs to authorize it. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Task files in
.tasks/task_*.jsonsave Chinese and other non-ASCII characters as escaped Unicode sequences like\u6c47\u603b\u6210\u6700\u7ec8\u62a5\u544ainstead of the actual readable text汇总成最终报告.This makes it very hard to debug task files when you open them in editor or terminal. You cannot read what the task is about without running it through a decoder first.
Fix
Added
ensure_ascii=Falseparameter to all 4json.dumps()calls ins07_task_system.py:_save()method (line 65) - writes task to diskcreate()return value (line 74) - returns new task as JSON stringget()return value (line 77) - returns loaded task as JSON stringupdate()return value (line 103) - returns updated task as JSON stringBefore:
{"subject": "\u6c47\u603b\u6210\u6700\u7ec8\u62a5\u544a"}After:
{"subject": "汇总成最终报告"}Both formats are valid JSON and
json.loads()handles them identical, so this change is fully backward compatible with existing task files. The only difference is readability.Verification
Closes #106