I'm having a problem when a new file arrives (by the way, the program is working almost perfect, just this little problem from time to time), the problem is I'm getting this error message when a new file arrives: "ValueError: specified file object does not have 'write' method for Put request". The error it's almost random.
Checking lightblueobex_server.c it seems you do a verification to see if the file can be writen when a put request arrive to the server
if (obex_cmd == OBEX_CMD_PUT && self->hasbodydata && !PyObject_HasAttrString(tmpfileobj, "write"))
{
obexserver_errorstr(self, PyExc_ValueError,"specified file object does not have 'write' method for Put request");
return NULL;
}
So I'm trying to understand where is the problem, maybe tmpfileobj isn't created properly?
Please help, any hint its welcomed. ;)
Cristian.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
That's there to check that the tmpfileobj actually has a write() method so that it doesn't try to call write() on the object if it doesn't actually have that method. It would print that message if you're passing something to recvfile() that isn't actually a file object, and thus doesn't have a write() method.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi Blam!
I'm having a problem when a new file arrives (by the way, the program is working almost perfect, just this little problem from time to time), the problem is I'm getting this error message when a new file arrives: "ValueError: specified file object does not have 'write' method for Put request". The error it's almost random.
Checking lightblueobex_server.c it seems you do a verification to see if the file can be writen when a put request arrive to the server
if (obex_cmd == OBEX_CMD_PUT && self->hasbodydata && !PyObject_HasAttrString(tmpfileobj, "write"))
{
obexserver_errorstr(self, PyExc_ValueError,"specified file object does not have 'write' method for Put request");
return NULL;
}
So I'm trying to understand where is the problem, maybe tmpfileobj isn't created properly?
Please help, any hint its welcomed. ;)
Cristian.
That's there to check that the tmpfileobj actually has a write() method so that it doesn't try to call write() on the object if it doesn't actually have that method. It would print that message if you're passing something to recvfile() that isn't actually a file object, and thus doesn't have a write() method.