architv / soccer-cli

:soccer: Football scores for hackers. :computer: A command line interface for all the football scores.
MIT License
1.09k stars 222 forks source link

Invalid Header Value #125

Closed ahezza closed 6 years ago

ahezza commented 6 years ago

$ soccer --standings --league=PL Traceback (most recent call last): File "/usr/local/bin/soccer", line 11, in load_entry_point('soccer-cli==0.1.0.0', 'console_scripts', 'soccer')() File "/home/alex/.local/lib/python2.7/site-packages/click/core.py", line 722, in call return self.main(args, kwargs) File "/home/alex/.local/lib/python2.7/site-packages/click/core.py", line 697, in main rv = self.invoke(ctx) File "/home/alex/.local/lib/python2.7/site-packages/click/core.py", line 895, in invoke return ctx.invoke(self.callback, ctx.params) File "/home/alex/.local/lib/python2.7/site-packages/click/core.py", line 535, in invoke return callback(args, kwargs) File "/usr/local/lib/python2.7/dist-packages/soccer_cli-0.1.0.0-py2.7.egg/soccer/main.py", line 178, in main rh.get_standings(league) File "/usr/local/lib/python2.7/dist-packages/soccer_cli-0.1.0.0-py2.7.egg/soccer/request_handler.py", line 74, in get_standings id=league_id)) File "/usr/local/lib/python2.7/dist-packages/soccer_cli-0.1.0.0-py2.7.egg/soccer/request_handler.py", line 19, in _get req = requests.get(RequestHandler.BASE_URL+url, headers=self.headers) File "/home/alex/.local/lib/python2.7/site-packages/requests/api.py", line 69, in get return request('get', url, params=params, kwargs) File "/home/alex/.local/lib/python2.7/site-packages/requests/api.py", line 50, in request response = session.request(method=method, url=url, kwargs) File "/home/alex/.local/lib/python2.7/site-packages/requests/sessions.py", line 465, in request resp = self.send(prep, send_kwargs) File "/home/alex/.local/lib/python2.7/site-packages/requests/sessions.py", line 573, in send r = adapter.send(request, kwargs) File "/home/alex/.local/lib/python2.7/site-packages/requests/adapters.py", line 370, in send timeout=timeout File "/home/alex/.local/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 544, in urlopen body=body, headers=headers) File "/home/alex/.local/lib/python2.7/site-packages/requests/packages/urllib3/connectionpool.py", line 349, in _make_request conn.request(method, url, httplib_request_kw) File "/usr/lib/python2.7/httplib.py", line 1042, in request self._send_request(method, url, body, headers) File "/usr/lib/python2.7/httplib.py", line 1081, in _send_request self.putheader(hdr, value) File "/usr/lib/python2.7/httplib.py", line 1020, in putheader raise ValueError('Invalid header value %r' % (one_value,)) ValueError: Invalid header value '***\n'

FYI - I have changed the value of the API key to *. However, there is a \n at the end which I cannot get rid of.

$ pwd /home/alex

$ cat .soccer-cli.ini


Again, changed the API key to *** - there is no \n in this file. Am I doing something wrong?

Thanks,

ahezza commented 6 years ago

Fixed it, apologies. Just run the program without the .soccer-cli.ini and it asks you to enter the API key.