Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug in pipes on windows #4

tomerfiliba opened this issue Mar 2, 2011 · 1 comment

bug in pipes on windows #4

tomerfiliba opened this issue Mar 2, 2011 · 1 comment


Copy link

@tomerfiliba tomerfiliba commented Mar 2, 2011

Thomas Higdon Show activity 9/23/10
Yep, we agree that pipes on windows suck, but thanks for attempting to
support it!

I ran into the following problem on python 2.4, windows server 2008:

  File "/tmp/tmpt9WdVU", line 28, in ? 
  File "c:\tmp\tmp9v5tb5\rpyc\utils\", line 28, in connect_pipes 
  File "c:\tmp\tmp9v5tb5\rpyc\utils\", line 38, in connect_pipes 
  File "c:\tmp\tmp9v5tb5\rpyc\utils\", line 30, in connect_stream 
  File "c:\tmp\tmp9v5tb5\rpyc\utils\", line 23, in connect_channel 
  File "c:\tmp\tmp9v5tb5\rpyc\core\", line 87, in __init__ 
  File "c:\tmp\tmp9v5tb5\rpyc\core\", line 90, in _init_service 
  File "c:\tmp\tmp9v5tb5\rpyc\core\", line 106, in on_connect 
  File "c:\tmp\tmp9v5tb5\rpyc\core\", line 365, in root 
  File "c:\tmp\tmp9v5tb5\rpyc\core\", line 339, in sync_request 
  File "c:\tmp\tmp9v5tb5\rpyc\core\", line 301, in serve 
  File "c:\tmp\tmp9v5tb5\rpyc\core\", line 261, in _recv 
  File "c:\tmp\tmp9v5tb5\rpyc\core\", line 38, in recv 
  File "c:\tmp\tmp9v5tb5\rpyc\core\", line 215, in read 
TypeError: Second param must be an integer or a buffer object 

It turns out there is a very simple fix, although I'm not completely
certain why it seems no one else has run into this.

---       2010-09-22 12:33:19.218556542 -0400 
+++   2010-09-22 16:57:29.108371675 -0400 
@@ -211,7 +211,7 @@ 
             data = [] 
             while count > 0: 
-                dummy, buf = win32file.ReadFile(self.incoming, min(self.MAX_IO_CHUNK, count)) 
+                dummy, buf = win32file.ReadFile(self.incoming, int(min(self.MAX_IO_CHUNK, count))) 
                 count -= len(buf) 
         except TypeError, ex: 

It looks like the result of the 'min' function is not something that
the C layer of win32file interprets as an integer. count comes from
the FRAME_HEADER struct in, which is using the 'L', or
unsigned long format, which I guess doesn't count as an integer.

Anyways, the maintainer may put this into the next release, but I hope
this can help someone else in the meantime.

Copy link
Collaborator Author

@tomerfiliba tomerfiliba commented Mar 2, 2011

fixes a28b882; closed by 7eb48a4; closed by 7eb48a4; closed by 7eb48a4; closed by 7eb48a4; closed by 7eb48a4; closed by 7eb48a4;

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant