You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can't pickle apparently means multiprocessing module from python-base can't serialize non-top module level functions. So move the two functions/classes in question to the top level in tests/test_expect.py
Second set of failures in test_socket.py and test_socket_fd.py
______________________________________________________________ExpectTestCase.test_fd_isalive_______________________________________________________________self=<tests.test_socket.ExpectTestCasetestMethod=test_fd_isalive>defsetUp(self):
print(self.id())
PexpectTestCase.PexpectTestCase.setUp(self)
self.af=socket.AF_INETself.host='127.0.0.1'try:
socket.socket(socket.AF_INET, socket.SOCK_STREAM)
exceptsocket.error:
try:
socket.socket(socket.AF_INET6, socket.SOCK_STREAM)
self.af=socket.AF_INET6self.host='::1'exceptsocket.error:
passself.port=49152+10000self.motd=b"""\ ------------------------------------------------------------------------------ * Welcome to the SOCKET UNIT TEST code! * ------------------------------------------------------------------------------ * * * This unit test code is our best effort at testing the ability of the * * pexpect library to handle sockets. We need some text to test buffer size * * handling. * * * * A page is 1024 bytes or 1K. 80 x 24 = 1920. So a standard terminal window * * contains more than one page. We actually want more than a page for our * * tests. * * * * This is the twelfth line, and we need 24. So we need a few more paragraphs.* * We can keep them short and just put lines between them. * * * * The 80 x 24 terminal size comes from the ancient past when computers were * * only able to display text in cuneiform writing. * * * * The cunieform writing system used the edge of a reed to make marks on clay * * tablets. * * * * It was the forerunner of the style of handwriting used by doctors to write * * prescriptions. Thus the name: pre (before) script (writing) ion (charged * * particle). * ------------------------------------------------------------------------------ """.replace(b'\n', b'\n\r') +b"\r\n"self.prompt1=b'Press Return to continue:'self.prompt2=b'Rate this unit test>'self.prompt3=b'Press X to exit:'self.enter=b'\r\n'self.exit=b'X\r\n'self.server_up=multiprocessing.Event()
self.server_process=multiprocessing.Process(target=self.socket_server, args=(self.server_up,))
self.server_process.daemon=True>self.server_process.start()
/opt/sw/build.build/pexpect-py310-4.9.0-1/pexpect-4.9.0/tests/test_socket.py:89:
_______________________________________________________________________________/opt/sw/lib/python3.10/multiprocessing/process.py:121: instartself._popen=self._Popen(self)
/opt/sw/lib/python3.10/multiprocessing/context.py:224: in_Popenreturn_default_context.get_context().Process._Popen(process_obj)
/opt/sw/lib/python3.10/multiprocessing/context.py:284: in_PopenreturnPopen(process_obj)
/opt/sw/lib/python3.10/multiprocessing/popen_spawn_posix.py:32: in__init__super().__init__(process_obj)
/opt/sw/lib/python3.10/multiprocessing/popen_fork.py:19: in__init__self._launch(process_obj)
/opt/sw/lib/python3.10/multiprocessing/popen_spawn_posix.py:47: in_launchreduction.dump(process_obj, fp)
_______________________________________________________________________________obj=<Processname='Process-1'parent=85362initialdaemon>, file=<_io.BytesIOobjectat0x1061113f0>, protocol=Nonedefdump(obj, file, protocol=None):
'''Replacement for pickle.dump() using ForkingPickler.'''>ForkingPickler(file, protocol).dump(obj)
EAttributeError: Can't pickle local object 'ArgumentParser.__init__.<locals>.identity'
/opt/sw/lib/python3.10/multiprocessing/reduction.py:60: AttributeError-------------------------------------------------------------------Capturedstdoutcall--------------------------------------------------------------------
Solution from upstream bug report and commit referenced there: Don't use spawn() but force fork() on macOS.
Third set of failures in test_socket_pexpect.py
____________________________________________________________ExpectTestCase.test_socket_isalive_____________________________________________________________self=<tests.test_socket_pexpect.ExpectTestCasetestMethod=test_socket_isalive>deftest_socket_isalive (self):
socket=open_file_socket('TESTDATA.txt')
s=socket_pexpect.SocketSpawn(socket)
asserts.isalive()
>s.close()
tests/test_socket_pexpect.py:59:
_______________________________________________________________________________self=<pexpect.socket_pexpect.SocketSpawnobjectat0x1038ef9a0>defclose(self):
"""Close the socket. Calling this method a second time does nothing, but if the file descriptor was closed elsewhere, :class:`OSError` will be raised. """ifself.child_fd==-1:
returnself.flush()
>self.socket.shutdown(socket.SHUT_RDWR)
EOSError: [Errno57] Socketisnotconnectedpexpect/socket_pexpect.py:78: OSError-------------------------------------------------------------------Capturedstdoutcall--------------------------------------------------------------------
Don't have a solution to this one yet.
The text was updated successfully, but these errors were encountered:
This is to keep things in a known location while things get solved.
First set of failing tests in
test_pexpect.py
Can't pickle apparently means
multiprocessing
module from python-base can't serialize non-top module level functions. So move the two functions/classes in question to the top level in tests/test_expect.pySecond set of failures in
test_socket.py
andtest_socket_fd.py
pexpect/pexpect#665
Solution from upstream bug report and commit referenced there: Don't use spawn() but force fork() on macOS.
Third set of failures in
test_socket_pexpect.py
Don't have a solution to this one yet.
The text was updated successfully, but these errors were encountered: