[@sobolevn wrote this originally.
I used hub pull-request --draft -i 129 -b andreoliwa:master -h andreoliwa:offline-mode
, and then it replaced the description... 😐 ]
Hi!
I faced an issue with running nitpick
while offline.
That's what it shows:
» flake8 .
multiprocessing.pool.RemoteTraceback:
"""
Traceback (most recent call last):
File "/Users/sobolev/Documents/github/returns/.venv/lib/python3.7/site-packages/urllib3/connection.py", line 157, in _new_conn
(self._dns_host, self.port), self.timeout, **extra_kw
File "/Users/sobolev/Documents/github/returns/.venv/lib/python3.7/site-packages/urllib3/util/connection.py", line 61, in create_connection
for res in socket.getaddrinfo(host, port, family, socket.SOCK_STREAM):
File "/Users/sobolev/.pyenv/versions/3.7.4/lib/python3.7/socket.py", line 748, in getaddrinfo
for res in _socket.getaddrinfo(host, port, family, type, proto, flags):
socket.gaierror: [Errno 8] nodename nor servname provided, or not known
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/sobolev/Documents/github/returns/.venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 672, in urlopen
chunked=chunked,
File "/Users/sobolev/Documents/github/returns/.venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 376, in _make_request
self._validate_conn(conn)
File "/Users/sobolev/Documents/github/returns/.venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 994, in _validate_conn
conn.connect()
File "/Users/sobolev/Documents/github/returns/.venv/lib/python3.7/site-packages/urllib3/connection.py", line 334, in connect
conn = self._new_conn()
File "/Users/sobolev/Documents/github/returns/.venv/lib/python3.7/site-packages/urllib3/connection.py", line 169, in _new_conn
self, "Failed to establish a new connection: %s" % e
urllib3.exceptions.NewConnectionError: <urllib3.connection.VerifiedHTTPSConnection object at 0x10d03cc10>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/sobolev/Documents/github/returns/.venv/lib/python3.7/site-packages/requests/adapters.py", line 449, in send
timeout=timeout
File "/Users/sobolev/Documents/github/returns/.venv/lib/python3.7/site-packages/urllib3/connectionpool.py", line 720, in urlopen
method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
File "/Users/sobolev/Documents/github/returns/.venv/lib/python3.7/site-packages/urllib3/util/retry.py", line 436, in increment
raise MaxRetryError(_pool, url, error or ResponseError(cause))
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='raw.githubusercontent.com', port=443): Max retries exceeded with url: /wemake-services/wemake-python-styleguide/master/styles/nitpick-style-wemake.toml (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x10d03cc10>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/sobolev/.pyenv/versions/3.7.4/lib/python3.7/multiprocessing/pool.py", line 121, in worker
result = (True, func(*args, **kwds))
File "/Users/sobolev/.pyenv/versions/3.7.4/lib/python3.7/multiprocessing/pool.py", line 44, in mapstar
return list(map(*args))
File "/Users/sobolev/Documents/github/returns/.venv/lib/python3.7/site-packages/flake8/checker.py", line 666, in _run_checks
return checker.run_checks()
File "/Users/sobolev/Documents/github/returns/.venv/lib/python3.7/site-packages/flake8/checker.py", line 598, in run_checks
self.run_ast_checks()
File "/Users/sobolev/Documents/github/returns/.venv/lib/python3.7/site-packages/flake8/checker.py", line 502, in run_ast_checks
for (line_number, offset, text, check) in runner:
File "/Users/sobolev/Documents/github/returns/.venv/lib/python3.7/site-packages/nitpick/plugin.py", line 50, in run
Nitpick.current_app().config.merge_styles(), self.check_files(True), self.check_files(False)
File "/Users/sobolev/Documents/github/returns/.venv/lib/python3.7/site-packages/nitpick/config.py", line 65, in merge_styles
style.find_initial_styles(configured_styles)
File "/Users/sobolev/Documents/github/returns/.venv/lib/python3.7/site-packages/nitpick/style.py", line 61, in find_initial_styles
self.include_multiple_styles(chosen_styles)
File "/Users/sobolev/Documents/github/returns/.venv/lib/python3.7/site-packages/nitpick/style.py", line 76, in include_multiple_styles
style_path = self.get_style_path(style_uri) # type: Optional[Path]
File "/Users/sobolev/Documents/github/returns/.venv/lib/python3.7/site-packages/nitpick/style.py", line 105, in get_style_path
style_path = self.fetch_style_from_url(clean_style_uri)
File "/Users/sobolev/Documents/github/returns/.venv/lib/python3.7/site-packages/nitpick/style.py", line 134, in fetch_style_from_url
response = requests.get(new_url)
File "/Users/sobolev/Documents/github/returns/.venv/lib/python3.7/site-packages/requests/api.py", line 75, in get
return request('get', url, params=params, **kwargs)
File "/Users/sobolev/Documents/github/returns/.venv/lib/python3.7/site-packages/requests/api.py", line 60, in request
return session.request(method=method, url=url, **kwargs)
File "/Users/sobolev/Documents/github/returns/.venv/lib/python3.7/site-packages/requests/sessions.py", line 533, in request
resp = self.send(prep, **send_kwargs)
File "/Users/sobolev/Documents/github/returns/.venv/lib/python3.7/site-packages/requests/sessions.py", line 646, in send
r = adapter.send(request, **kwargs)
File "/Users/sobolev/Documents/github/returns/.venv/lib/python3.7/site-packages/requests/adapters.py", line 516, in send
raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='raw.githubusercontent.com', port=443): Max retries exceeded with url: /wemake-services/wemake-python-styleguide/master/styles/nitpick-style-wemake.toml (Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection object at 0x10d03cc10>: Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known'))
"""
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/Users/sobolev/Documents/github/returns/.venv/bin/flake8", line 10, in <module>
sys.exit(main())
File "/Users/sobolev/Documents/github/returns/.venv/lib/python3.7/site-packages/flake8/main/cli.py", line 18, in main
app.run(argv)
File "/Users/sobolev/Documents/github/returns/.venv/lib/python3.7/site-packages/flake8/main/application.py", line 393, in run
self._run(argv)
File "/Users/sobolev/Documents/github/returns/.venv/lib/python3.7/site-packages/flake8/main/application.py", line 381, in _run
self.run_checks()
File "/Users/sobolev/Documents/github/returns/.venv/lib/python3.7/site-packages/flake8/main/application.py", line 300, in run_checks
self.file_checker_manager.run()
File "/Users/sobolev/Documents/github/returns/.venv/lib/python3.7/site-packages/flake8/checker.py", line 329, in run
self.run_parallel()
File "/Users/sobolev/Documents/github/returns/.venv/lib/python3.7/site-packages/flake8/checker.py", line 293, in run_parallel
for ret in pool_map:
File "/Users/sobolev/.pyenv/versions/3.7.4/lib/python3.7/multiprocessing/pool.py", line 354, in <genexpr>
return (item for chunk in result for item in chunk)
File "/Users/sobolev/.pyenv/versions/3.7.4/lib/python3.7/multiprocessing/pool.py", line 748, in next
raise value
requests.exceptions.ConnectionError: None: Max retries exceeded with url: /wemake-services/wemake-python-styleguide/master/styles/nitpick-style-wemake.toml (Caused by None)
I guess that there two things to be improved:
--offline
flag to skip nitpick
check
- Better exception message that would say: "you probably should add
--offline
flag because it seems that your network is unreachable. Or fix your connection."
What do you think?
bug released