checkio / checkio-client Goto Github PK
View Code? Open in Web Editor NEWLicense: GNU General Public License v2.0
License: GNU General Public License v2.0
I have a failure with checkio command in javascript domain :
$ checkio --domain=js run multiply-intro --check
Start checking...
['err', 'Traceback (most recent call last):\n File "/opt/project/runners/ucheck/centertasks/uch.py", line 22, in <module>\n S.LISTENERS[S.ON_CONNECT](run_data)\n File "/opt/project/runners/ucheck/centertasks/checkio/referees/io.py", line 48, in on_ready\n {\nKeyError: \'js\'\n', 'uch']
['error', 'ErrUchIsDown']
But everything is fine in python domain :
$ checkio --domain=py run multiply-intro --check
Start checking...
*** Basics ***
->[3, 2]
<-6
->[0, 1]
<-0
*** Extra ***
->[6, 3]
<-18
->[6, 7]
<-42
!!! Congratulation !!!
Link for checking solution of other users: https://py.checkio.org/mission/multiply-intro/publications/
Link for sharing solution: https://py.checkio.org/mission/multiply-intro/publications/add/
Here my config.ini :
$ cat ~/.checkio/config.ini
[Main]
default_domain = js
[js_checkio]
executable = node
key = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
solutions = /home/user/checkio-js
[py_checkio]
key = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
solutions = /home/user/checkio-py
See comments on https://py.checkio.org/blog/new-tool-checkio-client/#comment-96651 for original report
I found that it was impossible to run the solution with the 2nd suggested command:
checkio_solutions/median.py --check
Workaround:
running using the 1st suggested command works fine
checkio init median checkio_solutions/median.py
Possible Fix?:
replace
call_args = sum(map(lambda a: shlex.split(a), sys.argv[1:]), [])
with
call_args = sys.argv[1:]
Since we have mission slug in file-header we can use it for testing. So run interface can be as simple as:
$ checkio run mysolution.py
$ checkio check mysolution.js
@oduvan For backup, I synced today (in a new private github repo located in my dropbox).
First sync checkio sync "P:\Dropbox\Python\py-checkio-solutions"
synced solutions in "P:\DropboxPythonpy-checkio-solutions"
, without backslashes.
I updated .checkio\config.ini
, did checkio sync
and it was (still long but) good this time.
I searched why \
s vanished but I failed. I think it has something to do with the parser, it is quite complicated.
PS: I use checkio-client 0.2.9 (so up to date), Python 3.7.4, windows 10.
And I don't think it is relevant but I installed it with pipx: pipx install checkio-client
the goal is to initiate files for making a translations
MacOS 10.13.6 (17G65)
Python 3.6.4 (v3.6.4:d48ecebad5, Dec 18 2017, 21:07:28)
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
$ checkio sync checkio/
Requesting...
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 1318, in do_open
encode_chunked=req.has_header('Transfer-encoding'))
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1239, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1285, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1234, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1026, in _send_output
self.send(msg)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 964, in send
self.connect()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/http/client.py", line 1400, in connect
server_hostname=server_hostname)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 407, in wrap_socket
_context=self, _session=session)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 814, in init
self.do_handshake()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 1068, in do_handshake
self._sslobj.do_handshake()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/ssl.py", line 689, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.6/bin/checkio", line 11, in
sys.exit(main())
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/checkio_client/runner.py", line 132, in main
getattr(module, func_name)(args)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/checkio_client/actions/sync.py", line 32, in main
data = get_user_missions()
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/checkio_client/api.py", line 32, in get_user_missions
return api_request('/api/user-missions/')
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/checkio_client/api.py", line 17, in api_request
res = urllib.request.urlopen(req) # TODO: all kind of errors
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 223, in urlopen
return opener.open(url, data, timeout)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 526, in open
response = self._open(req, data)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 544, in _open
'_open', req)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 504, in _call_chain
result = func(*args)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 1361, in https_open
context=self._context, check_hostname=self._check_hostname)
File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/urllib/request.py", line 1320, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:777)>
Instead of the path to the user folder, a folder with the name "~
" is created
Use os.path.expanduser("~")
on Windows systems.
My path now looks like: C:\Users\Alexey\~\checkio_solutions
And it should be like this: C:\Users\Alexey\checkio_solutions
running the command:
checkio check Incinerator/the_warriors.py
causes an exception in the checkio-client (exception trace is below)
This exception occurs on many of the missions in the "Incinerator" area.
What I believe is happening is that a call to the "ucheck" url returns testing data. That data has an unexpected format. Some of the "in" blocks have a fourth element that is "None". The client believes the "in" blocks should have only three elements or if it has a fourth it should be iterable.
Is the code for "ucheck" available on github? Which repository?
I will produce a PR that works around the exception. Not sure what the web interface is doing to get around this problem.
Traceback (most recent call last):
File "/Users/x/opt/anaconda3/bin/checkio", line 8, in <module>
sys.exit(main())
File "/Users/x/opt/anaconda3/lib/python3.9/site-packages/checkio_client/runner.py", line 229, in main
getattr(module, func_name)(args)
File "/Users/x/opt/anaconda3/lib/python3.9/site-packages/checkio_client/actions/check.py", line 23, in api_call
return globals()[func_name + '_' + conf.default_domain_data['game']](*args, **kwargs)
File "/Users/x/opt/anaconda3/lib/python3.9/site-packages/checkio_client/actions/check.py", line 234, in main_run_cio
return main(args)
File "/Users/x/opt/anaconda3/lib/python3.9/site-packages/checkio_client/actions/check.py", line 23, in api_call
return globals()[func_name + '_' + conf.default_domain_data['game']](*args, **kwargs)
File "/Users/x/opt/anaconda3/lib/python3.9/site-packages/checkio_client/actions/check.py", line 97, in main_check_cio
if len(block) >= 4 and 'assert' in block[3]:
TypeError: argument of type 'NoneType' is not iterable
The aiohttp lib fails to build under 3.11
We just need to update the version of aiohttp >= 3.8.4
When user do
checkio checkrepo /path/to/my/folder
client stars tcp server on port 2323 by default. But if the port is in use nothing happen. Which is an issue, user should know that there was an error.
Open command fails, perhaps I need some environment variable?
$ ๎ฐ checkio open multiply-intro
Traceback (most recent call last):
File "/home/henio/.local/bin/checkio", line 11, in <module>
sys.exit(main())
File "/home/henio/.local/lib/python3.6/site-packages/checkio_client/runner.py", line 217, in main
getattr(module, func_name)(args)
File "/home/henio/.local/lib/python3.6/site-packages/checkio_client/actions/open.py", line 26, in main
open_editor([domain_data['editor'], filename])
NameError: name 'open_editor' is not defined
Error after running pip install -U checkio_client
WARNING: Discarding https://files.pythonhosted.org/packages/7b/cc/a1a41b24c3236dffa740fd5d1318d755dbb0982d9749a400cca268f70f48/checkio_client-0.2.12.tar.gz#sha256=fb8db5471646daa21c1fa95b98 442175d0e800d6c0c96f1fff7b5cc89d149bed (from https://pypi.org/simple/checkio-client/) (requires-python:>=3.6). Command errored out with exit status 1: python setup.py egg_info Check the log s for full command output. Created temporary directory: C:\Users\Nick\AppData\Local\Temp\pip-unpack-ki4a5pp1 Looking up "https://files.pythonhosted.org/packages/c3/e0/1343385526fe916bc22202944aab306417056ab407a57c7a5fd1b046fb9b/checkio_client-0.2.11.tar.gz" in the cache Current age based on date: 3065 Ignoring unknown cache-control directive: immutable Freshness lifetime from max-age: 365000000 The response is "fresh", returning cached response 365000000 > 3065 Using cached checkio_client-0.2.11.tar.gz (33 kB) Added checkio_client from https://files.pythonhosted.org/packages/c3/e0/1343385526fe916bc22202944aab306417056ab407a57c7a5fd1b046fb9b/checkio_client-0.2.11.tar.gz#sha256=391892caca9d2e0fc0 f74b99da88df7ef50c8e9509e33a214520dfee42b3576c to build tracker 'C:\\Users\\Nick\\AppData\\Local\\Temp\\pip-req-tracker-cqttdg23' Running setup.py (path:C:\Users\Nick\AppData\Local\Temp\pip-install-jvlysbci\checkio-client_4e8a3a05277e4034b23c6aca2076ead0\setup.py) egg_info for package checkio-client Created temporary directory: C:\Users\Nick\AppData\Local\Temp\pip-pip-egg-info-8n50nex4 Running command python setup.py egg_info Traceback (most recent call last): File "<string>", line 1, in <module> File "C:\Users\Nick\AppData\Local\Temp\pip-install-jvlysbci\checkio-client_4e8a3a05277e4034b23c6aca2076ead0\setup.py", line 5, in <module> with open('requirements.txt') as f: FileNotFoundError: [Errno 2] No such file or directory: 'requirements.txt'
Possible Fix?:
Seems to be a common problem, the requirements.txt is actually checkio_client.egg-info/requires.txt
I unzipped checkio_client-0.2.12.tar.gz and modified line 5 of setup.py from
with open('requirements.txt') as f:
to
with open('checkio_client.egg-info/requires.txt') as f:
then checked that it worked by running
pip install -e C:\Users\Nick\Downloads\checkio\checkio_client-0.2.12
install succeeded and "pip list" showed that 0.2.12 was installed :)
More info:
Looks like this issue arose now because the .WHL file was not present for the last 2 versions whereas it was previously being used to successfully install via pip
checkio sync
fails with json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
. It sounds like it's receiving an empty string from the api.
Apparently, this had worked at some point before because I had a directory with all my solutions. But I wasn't able to sync when I tried again recently.
Remove configuration to start from scratch.
$ rm -rf ~/.checkio # or mv ~/.checkio ~/.checkio_old
$ rm -rf path/to/checkio_solutions # or simply use a new directory
Create a virtualenv (I'll be using poetry), re-setup configuration, and try to sync.
$ poetry init -n
$ poetry add [email protected]
$ poetry run checkio config
# ... Setup config ...
# I selected https://py.checkio.org for the code domain
$ poetry run checkio sync
!!Error!!
$ poetry run checkio sync
Using folder "/home/nmay/cur/checkio_test"
Requesting...
Traceback (most recent call last):
File "/home/nmay/.cache/pypoetry/virtualenvs/checkio-test-Cbfuw_NV-py3.8/bin/checkio", line 8, in <module>
sys.exit(main())
File "/home/nmay/.cache/pypoetry/virtualenvs/checkio-test-Cbfuw_NV-py3.8/lib/python3.8/site-packages/checkio_client/runner.py", line 218, in main
getattr(module, func_name)(args)
File "/home/nmay/.cache/pypoetry/virtualenvs/checkio-test-Cbfuw_NV-py3.8/lib/python3.8/site-packages/checkio_client/actions/sync.py", line 70, in main
data = get_user_missions()
File "/home/nmay/.cache/pypoetry/virtualenvs/checkio-test-Cbfuw_NV-py3.8/lib/python3.8/site-packages/checkio_client/api.py", line 17, in api_call
return globals()[func_name + '_' + conf.default_domain_data['game']](*args, **kwargs)
File "/home/nmay/.cache/pypoetry/virtualenvs/checkio-test-Cbfuw_NV-py3.8/lib/python3.8/site-packages/checkio_client/api.py", line 97, in get_user_missions_cio
return api_request('/api/user-missions/')
File "/home/nmay/.cache/pypoetry/virtualenvs/checkio-test-Cbfuw_NV-py3.8/lib/python3.8/site-packages/checkio_client/api.py", line 17, in api_call
return globals()[func_name + '_' + conf.default_domain_data['game']](*args, **kwargs)
File "/home/nmay/.cache/pypoetry/virtualenvs/checkio-test-Cbfuw_NV-py3.8/lib/python3.8/site-packages/checkio_client/api.py", line 36, in api_request_cio
resp = json.loads(e.read().decode('utf-8'))
File "/home/nmay/.asdf/installs/python/3.8.6/lib/python3.8/json/__init__.py", line 357, in loads
return _default_decoder.decode(s)
File "/home/nmay/.asdf/installs/python/3.8.6/lib/python3.8/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/home/nmay/.asdf/installs/python/3.8.6/lib/python3.8/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)
Kubuntu 18.10
Python 3.6.7
Installing from PyPI and GitHub seemed to work fine but in both cases checkio command could not be found in zsh and bash.
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 1319, in do_open
h.request(req.get_method(), req.selector, req.data, headers,
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1230, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1276, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1225, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1004, in _send_output
self.send(msg)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 944, in send
self.connect()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/http/client.py", line 1399, in connect
self.sock = self._context.wrap_socket(self.sock,
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py", line 500, in wrap_socket
return self.sslsocket_class._create(
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py", line 1040, in _create
self.do_handshake()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ssl.py", line 1309, in do_handshake
self._sslobj.do_handshake()
ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.8/bin/checkio", line 10, in
sys.exit(main())
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/checkio_client/runner.py", line 191, in main
getattr(module, func_name)(args)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/checkio_client/actions/sync.py", line 54, in main
data = get_user_missions()
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/checkio_client/api.py", line 17, in api_call
return globals()[func_name + '' + conf.default_domain_data['game']](*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/checkio_client/api.py", line 97, in get_user_missions_cio
return api_request('/api/user-missions/')
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/checkio_client/api.py", line 17, in api_call
return globals()[func_name + '' + conf.default_domain_data['game']](*args, **kwargs)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/checkio_client/api.py", line 34, in api_request_cio
res = urllib.request.urlopen(req) # TODO: all kind of errors
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 525, in open
response = self._open(req, data)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 542, in _open
result = self._call_chain(self.handle_open, protocol, protocol +
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 502, in _call_chain
result = func(*args)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 1362, in https_open
return self.do_open(http.client.HTTPSConnection, req,
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/urllib/request.py", line 1322, in do_open
raise URLError(err)
urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)>
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.