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

AttributeError: characters_written #108

Closed
kopchik opened this issue Apr 2, 2013 · 13 comments
Closed

AttributeError: characters_written #108

kopchik opened this issue Apr 2, 2013 · 13 comments

Comments

@kopchik
Copy link

kopchik commented Apr 2, 2013

I've got AttributeError when exceptions are raised:

Client side:

r=rpyc.connect("172.16.5.66", port=6666)
P=r.root.Popen
P("testtesttest")

[skipped]
/usr/lib/python3.3/site-packages/rpyc/core/stream.py in write(self, data)
    184         try:
    185             while data:
--> 186                 count = self.sock.send(data[:self.MAX_IO_CHUNK])
    187                 data = data[count:]
    188         except socket.error:

/usr/lib/python3.3/site-packages/rpyc/core/stream.py in __getattr__(self, name)
     66         if name.startswith("__"): # issue 71
     67             raise AttributeError("stream has been closed")
---> 68         raise EOFError("stream has been closed")
     69     def close(self):
     70         pass

EOFError: stream has been closed

Server side:

Traceback (most recent call last):
  File "/usr/lib/python3.3/site-packages/rpyc/core/protocol.py", line 300, in _dispatch_request
    res = self._HANDLERS[handler](self, *args)
  File "/usr/lib/python3.3/site-packages/rpyc/core/protocol.py", line 532, in _handle_call
    return self._local_objects[oid](*args, **dict(kwargs))
  File "/home/sources/slave.py", line 36, in exposed_Popen
    p = MyPopen(cmd, **kwargs)
  File "/usr/lib/python3.3/subprocess.py", line 818, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.3/subprocess.py", line 1416, in _execute_child
    return self._local_objects[oid](*args, **dict(kwargs))
  File "/home/sources/slave.py", line 36, in exposed_Popen
    p = MyPopen(cmd, **kwargs)
  File "/usr/lib/python3.3/subprocess.py", line 818, in __init__
    restore_signals, start_new_session)
  File "/usr/lib/python3.3/subprocess.py", line 1416, in _execute_child
    raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: 'testtesttest'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.3/threading.py", line 639, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.3/threading.py", line 596, in run
    self._target(*self._args, **self._kwargs)
  File "/usr/lib/python3.3/site-packages/rpyc/utils/server.py", line 168, in _authenticate_and_serve_client
    self._serve_client(sock2, credentials)
  File "/usr/lib/python3.3/site-packages/rpyc/utils/server.py", line 194, in _serve_client
    conn.serve_all()
  File "/usr/lib/python3.3/site-packages/rpyc/core/protocol.py", line 395, in serve_all
    self.serve(0.1)
  File "/usr/lib/python3.3/site-packages/rpyc/core/protocol.py", line 386, in serve
    self._dispatch(data)
  File "/usr/lib/python3.3/site-packages/rpyc/core/protocol.py", line 354, in _dispatch
    self._dispatch_request(seq, args)
  File "/usr/lib/python3.3/site-packages/rpyc/core/protocol.py", line 311, in _dispatch_request
    self._send_exception(seq, t, v, tb)
  File "/usr/lib/python3.3/site-packages/rpyc/core/protocol.py", line 237, in _send_exception
    include_local_traceback = self._config["include_local_traceback"])
  File "/usr/lib/python3.3/site-packages/rpyc/core/vinegar.py", line 71, in dump
    attrval = getattr(val, name)
AttributeError: characters_written

Server-side script: https://github.com/kopchik/kvmtests/blob/master/slave.py

@tomerfiliba
Copy link
Collaborator

does it happen out side of ipython too?

@kopchik
Copy link
Author

kopchik commented Jun 3, 2013

Yes, server side is ipython-less.

@tomerfiliba
Copy link
Collaborator

i meant both client and server


Tomer Filiba
tomerfiliba.com http://www.facebook.com/tomerfiliba
http://il.linkedin.com/in/tomerfiliba

On Mon, Jun 3, 2013 at 7:48 PM, Alexandre Kandalintsev <
notifications@github.com> wrote:

Yes, server side is ipython-less.


Reply to this email directly or view it on GitHubhttps://github.com//issues/108#issuecomment-18854532
.

@kopchik
Copy link
Author

kopchik commented Jun 3, 2013

Yes, both client and server are run by normal python. I used ipython just for the demonstration.

@oliverdrake
Copy link

For what it's worth I tried this code in my python 2.7 setup and it works fine (rpyc 3.2.3). Havn't tried py3.3 though.

@kopchik
Copy link
Author

kopchik commented Jun 4, 2013

Could you please try on python 3.x?

@oliverdrake
Copy link

I get the same exceptions as you do when I run this on py3.3 (rpyc 3.2.3)

tomerfiliba added a commit that referenced this issue Jun 5, 2013
@tomerfiliba
Copy link
Collaborator

@kopchik or @oliverdrake - i pushed a small patch, could you verify if it works now?

@tomerfiliba
Copy link
Collaborator

(on master, not 3.2)

@kopchik
Copy link
Author

kopchik commented Jun 6, 2013

@tomerfiliba: now I got this:

[exe@ux32vd] /tmp$ python ./test.py
Traceback (most recent call last):
  File "./test.py", line 8, in <module>
    P("testtesttest")
  File "/usr/lib/python3.3/site-packages/rpyc-3.3.0-py3.3.egg/rpyc/core/netref.py", line 196, in __call__
    return syncreq(_self, consts.HANDLE_CALL, args, kwargs)
  File "/usr/lib/python3.3/site-packages/rpyc-3.3.0-py3.3.egg/rpyc/core/netref.py", line 71, in syncreq
    return conn.sync_request(handler, oid, *args)
  File "/usr/lib/python3.3/site-packages/rpyc-3.3.0-py3.3.egg/rpyc/core/protocol.py", line 435, in sync_request
    self.serve(0.1)
  File "/usr/lib/python3.3/site-packages/rpyc-3.3.0-py3.3.egg/rpyc/core/protocol.py", line 386, in serve
    self._dispatch(data)
  File "/usr/lib/python3.3/site-packages/rpyc-3.3.0-py3.3.egg/rpyc/core/protocol.py", line 358, in _dispatch
    self._dispatch_exception(seq, args)
  File "/usr/lib/python3.3/site-packages/rpyc-3.3.0-py3.3.egg/rpyc/core/protocol.py", line 326, in _dispatch_exception
    instantiate_oldstyle_exceptions = self._config["instantiate_oldstyle_exceptions"])
  File "/usr/lib/python3.3/site-packages/rpyc-3.3.0-py3.3.egg/rpyc/core/vinegar.py", line 152, in load
    setattr(exc, name, attrval)
TypeError: 'NoneType' object cannot be interpreted as an integer

tomerfiliba added a commit that referenced this issue Jun 6, 2013
@tomerfiliba
Copy link
Collaborator

okay, i think i know what the problem is. just pushed another patch. can
you try again?

btw, see http://docs.python.org/dev/library/exceptions.html (grep for
characters_written)

-tomer


Tomer Filiba
tomerfiliba.com http://www.facebook.com/tomerfiliba
http://il.linkedin.com/in/tomerfiliba

On Thu, Jun 6, 2013 at 2:49 PM, Alexandre Kandalintsev <
notifications@github.com> wrote:

@tomerfiliba https://github.com/tomerfiliba: now I got this:

[exe@ux32vd] /tmp$ python ./test.py
Traceback (most recent call last):
File "./test.py", line 8, in
P("testtesttest")
File "/usr/lib/python3.3/site-packages/rpyc-3.3.0-py3.3.egg/rpyc/core/netref.py", line 196, in call
return syncreq(_self, consts.HANDLE_CALL, args, kwargs)
File "/usr/lib/python3.3/site-packages/rpyc-3.3.0-py3.3.egg/rpyc/core/netref.py", line 71, in syncreq
return conn.sync_request(handler, oid, *args)
File "/usr/lib/python3.3/site-packages/rpyc-3.3.0-py3.3.egg/rpyc/core/protocol.py", line 435, in sync_request
self.serve(0.1)
File "/usr/lib/python3.3/site-packages/rpyc-3.3.0-py3.3.egg/rpyc/core/protocol.py", line 386, in serve
self._dispatch(data)
File "/usr/lib/python3.3/site-packages/rpyc-3.3.0-py3.3.egg/rpyc/core/protocol.py", line 358, in _dispatch
self._dispatch_exception(seq, args)
File "/usr/lib/python3.3/site-packages/rpyc-3.3.0-py3.3.egg/rpyc/core/protocol.py", line 326, in _dispatch_exception
instantiate_oldstyle_exceptions = self._config["instantiate_oldstyle_exceptions"])
File "/usr/lib/python3.3/site-packages/rpyc-3.3.0-py3.3.egg/rpyc/core/vinegar.py", line 152, in load
setattr(exc, name, attrval)
TypeError: 'NoneType' object cannot be interpreted as an integer


Reply to this email directly or view it on GitHubhttps://github.com//issues/108#issuecomment-19039999
.

@kopchik
Copy link
Author

kopchik commented Jun 6, 2013

@tomerfiliba : thanks a lot, now it works for me. I'm closing the ticket...

@kopchik kopchik closed this as completed Jun 6, 2013
@tomerfiliba
Copy link
Collaborator

great


Tomer Filiba
tomerfiliba.com http://www.facebook.com/tomerfiliba
http://il.linkedin.com/in/tomerfiliba

On Thu, Jun 6, 2013 at 3:14 PM, Alexandre Kandalintsev <
notifications@github.com> wrote:

@tomerfiliba https://github.com/tomerfiliba : thanks a lot, now it
works for me. I'm closing the ticket...


Reply to this email directly or view it on GitHubhttps://github.com//issues/108#issuecomment-19041060
.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants