تخطي للذهاب إلى المحتوى
القائمة
لقد تم الإبلاغ عن هذا السؤال
3 الردود
12803 أدوات العرض

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 

الصورة الرمزية
إهمال

post your script to help you get fixed

الكاتب

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

أفضل إجابة

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 


الصورة الرمزية
إهمال
المنشورات ذات الصلة الردود أدوات العرض النشاط
1
ديسمبر 15
5873
1
فبراير 16
4803
1
مارس 21
19076
1
مايو 16
3981
python in v9 تم الحل
1
نوفمبر 15
6063