Message383742
You say:
> after process python3 test_case.py
> json file's content like this
>
> @@@@@@@@@@{"how_dare_you": "how_dare_you"}
I cannot replicate that result.
I created a "data.json" with the following content:
```
>>> with open(FILE_PATH, 'w') as f:
... f.write('{"how_dare_you": "how_dare_you"}\n')
...
33
>>> with open(FILE_PATH, 'r') as f:
... print(f.read())
...
{"how_dare_you": "how_dare_you"}
```
Then I ran your `test` function and the only result was to delete the newline at the end of the file:
```
>>> test()
beginning tell 0
tell after read 33
tell after delete content 33
content 0
tell after write 65
content 0
>>>
>>> with open(FILE_PATH, 'r') as f:
... print(f.read())
...
{"how_dare_you": "how_dare_you"}
>>>
```
So I cannot replicate your reported bug. There is no sign of any garbage characters inserted at the start of the file as you state. |
|
Date |
User |
Action |
Args |
2020-12-25 13:05:19 | steven.daprano | set | recipients:
+ steven.daprano, ke265379ke |
2020-12-25 13:05:18 | steven.daprano | set | messageid: <1608901518.99.0.0678739799513.issue42733@roundup.psfhosted.org> |
2020-12-25 13:05:18 | steven.daprano | link | issue42733 messages |
2020-12-25 13:05:18 | steven.daprano | create | |
|