Patch 8.2.4690

5 views
Skip to first unread message

Bram Moolenaar

unread,
Apr 4, 2022, 4:14:20 PM4/4/22
to vim...@googlegroups.com

Patch 8.2.4690
Problem: Channel tests fail on MS-Windows.
Solution: Check if the AF_UNIX attribute exists. (closes #10083)
Files: src/testdir/test_channel.py, src/testdir/test_channel_unix.py


*** ../vim-8.2.4689/src/testdir/test_channel.py 2022-04-04 15:46:37.606126838 +0100
--- src/testdir/test_channel.py 2022-04-04 21:09:49.800215297 +0100
***************
*** 19,30 ****
# Python 2
import SocketServer as socketserver

! class ThreadedTCPRequestHandler(socketserver.BaseRequestHandler):
!
! def setup(self):
! if self.server.address_family != socket.AF_UNIX:
! self.request.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
!
def handle(self):
print("=== socket opened ===")
while True:
--- 19,25 ----
# Python 2
import SocketServer as socketserver

! class TestingRequestHandler(socketserver.BaseRequestHandler):
def handle(self):
print("=== socket opened ===")
while True:
***************
*** 240,245 ****
--- 235,244 ----
elif decoded[0] < 0:
last_eval = decoded

+ class ThreadedTCPRequestHandler(TestingRequestHandler):
+ def setup(self):
+ self.request.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
+
class ThreadedTCPServer(socketserver.ThreadingMixIn, socketserver.TCPServer):
pass

*** ../vim-8.2.4689/src/testdir/test_channel_unix.py 2022-04-04 15:46:37.606126838 +0100
--- src/testdir/test_channel_unix.py 2022-04-04 21:09:49.800215297 +0100
***************
*** 6,12 ****
# This requires Python 2.6 or later.

from __future__ import print_function
! from test_channel import ThreadedTCPServer, ThreadedTCPRequestHandler, \
writePortInFile
import socket
import threading
--- 6,12 ----
# This requires Python 2.6 or later.

from __future__ import print_function
! from test_channel import ThreadedTCPServer, TestingRequestHandler, \
writePortInFile
import socket
import threading
***************
*** 18,28 ****
# Python 2
FileNotFoundError = (IOError, OSError)

class ThreadedUnixServer(ThreadedTCPServer):
address_family = socket.AF_UNIX

def main(path):
! server = ThreadedUnixServer(path, ThreadedTCPRequestHandler)

# Start a thread with the server. That thread will then start a new thread
# for each connection.
--- 18,34 ----
# Python 2
FileNotFoundError = (IOError, OSError)

+ if not hasattr(socket, "AF_UNIX"):
+ raise NotImplementedError("Unix sockets are not supported on this platform")
+
class ThreadedUnixServer(ThreadedTCPServer):
address_family = socket.AF_UNIX

+ class ThreadedUnixRequestHandler(TestingRequestHandler):
+ pass
+
def main(path):
! server = ThreadedUnixServer(path, ThreadedUnixRequestHandler)

# Start a thread with the server. That thread will then start a new thread
# for each connection.
*** ../vim-8.2.4689/src/version.c 2022-04-04 21:03:49.180834694 +0100
--- src/version.c 2022-04-04 21:13:16.803905872 +0100
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 4690,
/**/

--
Citizens are not allowed to attend a movie house or theater nor ride in a
public streetcar within at least four hours after eating garlic.
[real standing law in Indiana, United States of America]

/// Bram Moolenaar -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages