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 -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/20220404201416.2A36A1C0561%40moolenaar.net.

Raspunde prin e-mail lui