print ("процесс " + __name__)
процесс __main__
процесс __mp_main__
процесс __main__
HTTPSConnectionPool(host='api.vk.com', port=443): Max retries exceeded with url: /method/stories.search (Caused by SSLError(SSLError(1, '[SSL: WRONG_VERSION_NUMBER] wrong version number (_ssl.c:2309)'),))
2020-04-26T09:09:45.315403+00:00 app[worker.1]: Process Process-2:
2020-04-26T09:09:45.319317+00:00 app[worker.1]: Traceback (most recent call last):
2020-04-26T09:09:45.319321+00:00 app[worker.1]: File "mass.py", line 656, in <module>
2020-04-26T09:09:45.319960+00:00 app[worker.1]: Traceback (most recent call last):
2020-04-26T09:09:45.319965+00:00 app[worker.1]: for i in stories_search['items']:
2020-04-26T09:09:45.319999+00:00 app[worker.1]: NameError: name 'stories_search' is not defined
2020-04-26T09:09:45.320042+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/site-packages/urllib3/connectionpool.py", line 672, in urlopen
2020-04-26T09:09:45.320043+00:00 app[worker.1]: chunked=chunked,
2020-04-26T09:09:45.320045+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/site-packages/urllib3/connectionpool.py", line 421, in _make_request
2020-04-26T09:09:45.320045+00:00 app[worker.1]: six.raise_from(e, None)
2020-04-26T09:09:45.320046+00:00 app[worker.1]: File "<string>", line 3, in raise_from
2020-04-26T09:09:45.320047+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/site-packages/urllib3/connectionpool.py", line 416, in _make_request
2020-04-26T09:09:45.320048+00:00 app[worker.1]: httplib_response = conn.getresponse()
2020-04-26T09:09:45.320066+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/http/client.py", line 1354, in getresponse
2020-04-26T09:09:45.320067+00:00 app[worker.1]: response.begin()
2020-04-26T09:09:45.320068+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/http/client.py", line 307, in begin
2020-04-26T09:09:45.320070+00:00 app[worker.1]: version, status, reason = self._read_status()
2020-04-26T09:09:45.320071+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/http/client.py", line 268, in _read_status
2020-04-26T09:09:45.320072+00:00 app[worker.1]: line = str(self.fp.readline(_MAXLINE + 1), "iso-8859-1")
2020-04-26T09:09:45.320090+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/socket.py", line 586, in readinto
2020-04-26T09:09:45.320091+00:00 app[worker.1]: return self._sock.recv_into(b)
2020-04-26T09:09:45.320093+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/ssl.py", line 1012, in recv_into
2020-04-26T09:09:45.320093+00:00 app[worker.1]: return self.read(nbytes, buffer)
2020-04-26T09:09:45.320118+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/ssl.py", line 874, in read
2020-04-26T09:09:45.320118+00:00 app[worker.1]: return self._sslobj.read(len, buffer)
2020-04-26T09:09:45.320143+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/ssl.py", line 631, in read
2020-04-26T09:09:45.320144+00:00 app[worker.1]: v = self._sslobj.read(len, buffer)
2020-04-26T09:09:45.320192+00:00 app[worker.1]: ssl.SSLError: [SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC] decryption failed or bad record mac (_ssl.c:2309)
2020-04-26T09:09:45.320209+00:00 app[worker.1]:
2020-04-26T09:09:45.320209+00:00 app[worker.1]: During handling of the above exception, another exception occurred:
2020-04-26T09:09:45.320209+00:00 app[worker.1]:
2020-04-26T09:09:45.320211+00:00 app[worker.1]: Traceback (most recent call last):
2020-04-26T09:09:45.320246+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/site-packages/requests/adapters.py", line 449, in send
2020-04-26T09:09:45.320247+00:00 app[worker.1]: timeout=timeout
2020-04-26T09:09:45.320248+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/site-packages/urllib3/connectionpool.py", line 720, in urlopen
2020-04-26T09:09:45.320249+00:00 app[worker.1]: method, url, error=e, _pool=self, _stacktrace=sys.exc_info()[2]
2020-04-26T09:09:45.320266+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/site-packages/urllib3/util/retry.py", line 436, in increment
2020-04-26T09:09:45.320266+00:00 app[worker.1]: raise MaxRetryError(_pool, url, error or ResponseError(cause))
2020-04-26T09:09:45.320312+00:00 app[worker.1]: urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='api.vk.com', port=443): Max retries exceeded with url: /method/groups.getMembers (Caused by SSLError(SSLError(1, '[SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC] decryption failed or bad record mac (_ssl.c:2309)'),))
2020-04-26T09:09:45.320313+00:00 app[worker.1]:
2020-04-26T09:09:45.320313+00:00 app[worker.1]: During handling of the above exception, another exception occurred:
2020-04-26T09:09:45.320313+00:00 app[worker.1]:
2020-04-26T09:09:45.320314+00:00 app[worker.1]: Traceback (most recent call last):
2020-04-26T09:09:45.320358+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/multiprocessing/process.py", line 258, in _bootstrap
2020-04-26T09:09:45.320359+00:00 app[worker.1]: self.run()
2020-04-26T09:09:45.320361+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/multiprocessing/process.py", line 93, in run
2020-04-26T09:09:45.320361+00:00 app[worker.1]: self._target(*self._args, **self._kwargs)
2020-04-26T09:09:45.320377+00:00 app[worker.1]: File "mass.py", line 156, in group_viewer
2020-04-26T09:09:45.320377+00:00 app[worker.1]: 'last_seen')) # форч 132962823 #
2020-04-26T09:09:45.320379+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/site-packages/vk_api/vk_api.py", line 681, in __call__
2020-04-26T09:09:45.320379+00:00 app[worker.1]: return self._vk.method(self._method, kwargs)
2020-04-26T09:09:45.320395+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/site-packages/vk_api/vk_api.py", line 612, in method
2020-04-26T09:09:45.320395+00:00 app[worker.1]: values
2020-04-26T09:09:45.320397+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/site-packages/requests/sessions.py", line 581, in post
2020-04-26T09:09:45.320397+00:00 app[worker.1]: return self.request('POST', url, data=data, json=json, **kwargs)
2020-04-26T09:09:45.320413+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/site-packages/requests/sessions.py", line 533, in request
2020-04-26T09:09:45.320414+00:00 app[worker.1]: resp = self.send(prep, **send_kwargs)
2020-04-26T09:09:45.320415+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/site-packages/requests/sessions.py", line 646, in send
2020-04-26T09:09:45.320416+00:00 app[worker.1]: r = adapter.send(request, **kwargs)
2020-04-26T09:09:45.320431+00:00 app[worker.1]: File "/app/.heroku/python/lib/python3.6/site-packages/requests/adapters.py", line 514, in send
2020-04-26T09:09:45.320431+00:00 app[worker.1]: raise SSLError(e, request=request)
2020-04-26T09:09:45.320475+00:00 app[worker.1]: requests.exceptions.SSLError: HTTPSConnectionPool(host='api.vk.com', port=443): Max retries exceeded with url: /method/groups.getMembers (Caused by SSLError(SSLError(1, '[SSL: DECRYPTION_FAILED_OR_BAD_RECORD_MAC] decryption failed or bad record mac (_ssl.c:2309)'),))
from multiprocessing import Process
import time
print(1)
def func1():
print('test1')
time.sleep(10)
def func2():
print('test2')
time.sleep(5)
def test_multiprocessing():
if __name__ == '__main__':
p_func1 = Process(target=func1)
p_func2 = Process(target=func2)
p_func1.start()
p_func2.start()
p_func1.join()
p_func2.join()
print('done')
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Admin\AppData\Local\Programs\Python\Python35\lib\multiprocessing\spawn.py", line 106, in spawn_main
exitcode = _main(fd)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python35\lib\multiprocessing\spawn.py", line 115, in _main
prepare(preparation_data)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python35\lib\multiprocessing\spawn.py", line 226, in prepare
_fixup_main_from_path(data['init_main_from_path'])
File "C:\Users\Admin\AppData\Local\Programs\Python\Python35\lib\multiprocessing\spawn.py", line 278, in _fixup_main_from_path
run_name="__mp_main__")
File "C:\Users\Admin\AppData\Local\Programs\Python\Python35\lib\runpy.py", line 263, in run_path
pkg_name=pkg_name, script_name=fname)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python35\lib\runpy.py", line 96, in _run_module_code
mod_name, mod_spec, pkg_name, script_name)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python35\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\Admin\PycharmProjects\asy\main_asy.py", line 36, in <module>
test_multiprocessing()
File "C:\Users\Admin\PycharmProjects\asy\main_asy.py", line 28, in test_multiprocessing
p_func1.start()
File "C:\Users\Admin\AppData\Local\Programs\Python\Python35\lib\multiprocessing\process.py", line 105, in start
self._popen = self._Popen(self)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python35\lib\multiprocessing\context.py", line 212, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python35\lib\multiprocessing\context.py", line 313, in _Popen
return Popen(process_obj)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python35\lib\multiprocessing\popen_spawn_win32.py", line 34, in __init__
prep_data = spawn.get_preparation_data(process_obj._name)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python35\lib\multiprocessing\spawn.py", line 144, in get_preparation_data
_check_not_importing_main()
File "C:\Users\Admin\AppData\Local\Programs\Python\Python35\lib\multiprocessing\spawn.py", line 137, in _check_not_importing_main
is not going to be frozen to produce an executable.''')
RuntimeError:
An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.
This probably means that you are not using fork to start your
child processes and you have forgotten to use the proper idiom
in the main module:
if __name__ == '__main__':
freeze_support()
...
The "freeze_support()" line can be omitted if the program
is not going to be frozen to produce an executable.
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\Admin\AppData\Local\Programs\Python\Python35\lib\multiprocessing\spawn.py", line 106, in spawn_main
exitcode = _main(fd)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python35\lib\multiprocessing\spawn.py", line 115, in _main
prepare(preparation_data)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python35\lib\multiprocessing\spawn.py", line 226, in prepare
_fixup_main_from_path(data['init_main_from_path'])
File "C:\Users\Admin\AppData\Local\Programs\Python\Python35\lib\multiprocessing\spawn.py", line 278, in _fixup_main_from_path
run_name="__mp_main__")
File "C:\Users\Admin\AppData\Local\Programs\Python\Python35\lib\runpy.py", line 263, in run_path
pkg_name=pkg_name, script_name=fname)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python35\lib\runpy.py", line 96, in _run_module_code
mod_name, mod_spec, pkg_name, script_name)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python35\lib\runpy.py", line 85, in _run_code
exec(code, run_globals)
File "C:\Users\Admin\PycharmProjects\asy\main_asy.py", line 36, in <module>
test_multiprocessing()
File "C:\Users\Admin\PycharmProjects\asy\main_asy.py", line 28, in test_multiprocessing
p_func1.start()
File "C:\Users\Admin\AppData\Local\Programs\Python\Python35\lib\multiprocessing\process.py", line 105, in start
self._popen = self._Popen(self)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python35\lib\multiprocessing\context.py", line 212, in _Popen
return _default_context.get_context().Process._Popen(process_obj)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python35\lib\multiprocessing\context.py", line 313, in _Popen
return Popen(process_obj)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python35\lib\multiprocessing\popen_spawn_win32.py", line 34, in __init__
prep_data = spawn.get_preparation_data(process_obj._name)
File "C:\Users\Admin\AppData\Local\Programs\Python\Python35\lib\multiprocessing\spawn.py", line 144, in get_preparation_data
_check_not_importing_main()
File "C:\Users\Admin\AppData\Local\Programs\Python\Python35\lib\multiprocessing\spawn.py", line 137, in _check_not_importing_main
is not going to be frozen to produce an executable.''')
RuntimeError:
An attempt has been made to start a new process before the
current process has finished its bootstrapping phase.
This probably means that you are not using fork to start your
child processes and you have forgotten to use the proper idiom
in the main module:
if __name__ == '__main__':
freeze_support()
...
The "freeze_support()" line can be omitted if the program
is not going to be frozen to produce an executable.
done
У меня выполняется последний цикл
while
, далее с сервера приходит событиеevent
но оно получается не отслеживается т.к выполняется последний цикл. Так каким образом мнеevent
отловить?И у меня в основном в последнем цикле запускаются еще под процессы с циклами.