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

cann't run in windows 7 by UnicodeDecodeError #11

Open
magic5650 opened this issue Jun 22, 2016 · 2 comments
Open

cann't run in windows 7 by UnicodeDecodeError #11

magic5650 opened this issue Jun 22, 2016 · 2 comments

Comments

@magic5650
Copy link

magic5650 commented Jun 22, 2016

Traceback (most recent call last):
File "C:\Python34\lib\runpy.py", line 170, in run_module_as_main
"main", mod_spec)
File "C:\Python34\lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "C:\Python34\Scripts\tickets.exe__main
.py", line 9, in
File "C:\Python34\lib\site-packages\tickets\core.py", line 92, in cli
q.query().pretty_print()
File "C:\Python34\lib\site-packages\tickets\trains.py", line 195, in query
params = self._build_params()
File "C:\Python34\lib\site-packages\tickets\trains.py", line 189, in _build_params
d['from_station'] = self._from_station_telecode
File "C:\Python34\lib\site-packages\tickets\trains.py", line 158, in _from_station_telecode
code = self.stations.get(self.from_station)
File "C:\Python34\lib\site-packages\tickets\trains.py", line 151, in stations
for line in f.readlines():
UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 2: illegal multibyte sequence

at last i make it run
https://segmentfault.com/q/1010000002515129/a-1020000002515648

File "C:\Python34\lib\site-packages\tickets\trains.py", line 151, in stations
with open(filepath, 'rb') as f:

@lzhr
Copy link

lzhr commented Jun 22, 2016

#8 [fix] gbk encode error on windows

@lniwn
Copy link

lniwn commented Jun 25, 2016

@magic5650
把你的查询参数贴下看看, stations.dat文件本身是utf-8编码的,报错有点奇怪

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants