This repository was archived by the owner on Dec 19, 2023. It is now read-only.
修改urls["is_json"] 为true时,response非json格式bug,导致异常退出,使得用户一直 登陆不上bug。#695
Open
Greedyu wants to merge 2 commits intotesterSunshine:masterfrom
Open
修改urls["is_json"] 为true时,response非json格式bug,导致异常退出,使得用户一直 登陆不上bug。#695Greedyu wants to merge 2 commits intotesterSunshine:masterfrom
Greedyu wants to merge 2 commits intotesterSunshine:masterfrom
Conversation
added 2 commits
January 2, 2020 12:47
比如打印response content内容: b'halo, world\n'
Traceback (most recent call last):
File "run.py", line 22, in <module>
select_ticket_info.select().main()
File "/Users/sun/Documents/workspace/python/12306/init/select_ticket_info.py", line 123, in main
self.call_login()
File "/Users/sun/Documents/workspace/python/12306/init/select_ticket_info.py", line 117, in call_login
self.login.go_login()
File "/Users/sun/Documents/workspace/python/12306/init/login.py", line 129, in go_login
uamtk = self.baseLogin(user, passwd)
File "/Users/sun/Documents/workspace/python/12306/init/login.py", line 66, in baseLogin
tresult = self.session.httpClint.send(logurl, loginData)
File "/Users/sun/Documents/workspace/python/12306/myUrllib/httpUtils.py", line 187, in send
response.content.decode() if isinstance(response.content, bytes) else response.content)
File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/__init__.py", line 348, in loads
return _default_decoder.decode(s)
File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
比如打印response content内容: b'halo, world\n'
Traceback (most recent call last):
File "run.py", line 22, in
select_ticket_info.select().main()
File "/Users/sun/Documents/workspace/python/12306/init/select_ticket_info.py", line 123, in main
self.call_login()
File "/Users/sun/Documents/workspace/python/12306/init/select_ticket_info.py", line 117, in call_login
self.login.go_login()
File "/Users/sun/Documents/workspace/python/12306/init/login.py", line 129, in go_login
uamtk = self.baseLogin(user, passwd)
File "/Users/sun/Documents/workspace/python/12306/init/login.py", line 66, in baseLogin
tresult = self.session.httpClint.send(logurl, loginData)
File "/Users/sun/Documents/workspace/python/12306/myUrllib/httpUtils.py", line 187, in send
response.content.decode() if isinstance(response.content, bytes) else response.content)
File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/init.py", line 348, in loads
return _default_decoder.decode(s)
File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)