Skip to Content
Menu
This question has been flagged
3 Replies
11454 Views

Hello, 

I did a script to import data. I can't access because the connection is refused. 

Look my error : 

Traceback (most recent call last):

File "account.py", line 33, in <module>

uid = sock_common.login(dbname, username, pwd)

File "/usr/lib/python2.7/xmlrpclib.py", line 1233, in __call__

return self.__send(self.__name, args)

File "/usr/lib/python2.7/xmlrpclib.py", line 1591, in __request

verbose=self.__verbose

File "/usr/lib/python2.7/xmlrpclib.py", line 1273, in request

return self.single_request(host, handler, request_body, verbose)

File "/usr/lib/python2.7/xmlrpclib.py", line 1301, in single_request

self.send_content(h, request_body)

File "/usr/lib/python2.7/xmlrpclib.py", line 1448, in send_content

connection.endheaders(request_body)

File "/usr/lib/python2.7/httplib.py", line 997, in endheaders

self._send_output(message_body)

File "/usr/lib/python2.7/httplib.py", line 850, in _send_output

self.send(msg)

File "/usr/lib/python2.7/httplib.py", line 812, in send

self.connect()

File "/usr/lib/python2.7/httplib.py", line 793, in connect

self.timeout, self.source_address)

File "/usr/lib/python2.7/socket.py", line 571, in create_connection

raise err

socket.error: [Errno 111] Connection refused



Thanks



Script : 

import re

import sys, os

import xmlrpclib

import csv

username = "admin"

pwd = "admin"

dbname = "full"

 comp =0

sock_common = xmlrpclib.ServerProxy("http://localhost:8069/xmlrpc/common")

uid = sock_common.login(dbname, username, pwd)

sock = xmlrpclib.ServerProxy("http://localhost:8069/xmlrpc/object")

reader = csv.reader(open('Contacts.csv','rb'),delimiter=';')

x = 1 

Avatar
Discard

post your script to help you get fixed

Author

import xmlrpclib import csv import re import sys, os username = "admin" pwd = "admin" dbname = "full" comp=0 # pour tester la connexion faudra enlever ce champ sock_common = xmlrpclib.ServerProxy("http://localhost:8069/xmlrpc/common") uid = sock_common.login(dbname, username, pwd) sock = xmlrpclib.ServerProxy("http://localhost:8069/xmlrpc/object") reader = csv.reader(open('Contacts.csv','rb'),delimiter=';') x = 1

Best Answer

Its seems your server is not started so please start the server and check the browser  with http://localhost:8069 if it is  connected and then run the script 

( or)
check with your terminal by 
telnet localhost 8069
 it will return connected to localhost if your server is running 
 else  it will return Connection refused 


Avatar
Discard
Related Posts Replies Views Activity
1
Dec 15
4628
1
Feb 16
3940
1
Mar 21
17202
1
May 16
2969
1
Nov 15
4805