Python Error :(

L

Legend

I wasn't able to run a Python script. But then later I was able to run
it through the Shell. I was experimenting with cron jobs and set up
the python execution in as a cron. The first time it ran, It was fine
but then after that, it started giving me some errors. Now when I try
to run the script directly, I get the following error:



Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "userbot.py", line 637, in ?
con = connect()
File "userbot.py", line 607, in connect
con.requestRoster()
File "user.py", line 531, in requestRoster
self.SendAndWaitForResponse(rost_iq)
File "user.py", line 326, in SendAndWaitForResponse
return self.waitForResponse(ID)
File "user.py", line 300, in waitForResponse
self.process(1)
File "xmlstream.py", line 459, in process
if not len(self.read()): # length of 0 means disconnect
File "xmlstream.py", line 398, in read
data_in=data_in+self._sslObj.read(BLOCK_SIZE).decode('utf-8')
socket.sslerror: (6, 'TLS/SSL connection has been closed')


Any help please?
 
J

Jarek Zgoda

Legend napisa³(a):
I wasn't able to run a Python script. But then later I was able to run
it through the Shell. I was experimenting with cron jobs and set up
the python execution in as a cron. The first time it ran, It was fine
but then after that, it started giving me some errors. Now when I try
to run the script directly, I get the following error:



Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "userbot.py", line 637, in ?
con = connect()
File "userbot.py", line 607, in connect
con.requestRoster()
File "user.py", line 531, in requestRoster
self.SendAndWaitForResponse(rost_iq)
File "user.py", line 326, in SendAndWaitForResponse
return self.waitForResponse(ID)
File "user.py", line 300, in waitForResponse
self.process(1)
File "xmlstream.py", line 459, in process
if not len(self.read()): # length of 0 means disconnect
File "xmlstream.py", line 398, in read
data_in=data_in+self._sslObj.read(BLOCK_SIZE).decode('utf-8')
socket.sslerror: (6, 'TLS/SSL connection has been closed')


Any help please?

Yes.
 
K

kyosohma

I wasn't able to run a Python script. But then later I was able to run
it through the Shell. I was experimenting with cron jobs and set up
the python execution in as a cron. The first time it ran, It was fine
but then after that, it started giving me some errors. Now when I try
to run the script directly, I get the following error:

Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "userbot.py", line 637, in ?
con = connect()
File "userbot.py", line 607, in connect
con.requestRoster()
File "user.py", line 531, in requestRoster
self.SendAndWaitForResponse(rost_iq)
File "user.py", line 326, in SendAndWaitForResponse
return self.waitForResponse(ID)
File "user.py", line 300, in waitForResponse
self.process(1)
File "xmlstream.py", line 459, in process
if not len(self.read()): # length of 0 means disconnect
File "xmlstream.py", line 398, in read
data_in=data_in+self._sslObj.read(BLOCK_SIZE).decode('utf-8')
socket.sslerror: (6, 'TLS/SSL connection has been closed')

Any help please?

I'll hazard a guess: Are you opening the socket explicitly when you
run this script? If not, be sure to do so. And when you are finished
doing whatever it is you're doing, be sure to close it as well. You
may need to put in some kind of logic to check if the socket is still
open if you are transferring large files.

Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,430
Messages
2,571,676
Members
48,796
Latest member
Greg L.

Latest Threads

Top