The problem is that c:/web2py should be the first item in PYTHONPATH. Do
you insert stuff in sys.path in your code?
On Sunday, 23 September 2012 13:32:40 UTC-5, Bill Thayer wrote:
>
> I am writing a parser to populate my database. when I used xmlprpxlib I
> got a malformed xml error. In reading the book it looked like simplejsonrpc
> was similar so figured I'd give it a shot and wrote a simple test script.
>
> # -*- coding: cp1252 -*-
> import os, sys
> print sys.path
> from xmlrpclib import ServerProxy
> from gluon.contrib.simplejsonrpc import ServerProxy
>
> jserver = ServerProxy('http://127.0.0.1:8000/TAMOTO_2012/core/call/xmlrpc'
> )
> jserver = ServerProxy('http://127.0.0.1:8000/TAMOTO_2012/core/call/jsonrpc
> ', verbose=True)
> #using the example from the book to test that the call works
> print server.add(3,4)
>
> #
> print jserver.add_process("VPIN", "0.25-µm Verticle Pin Diode 2MI", 0.25,
> 1, 1, "Test import process from xmlrpc call.")
>
> print xserver.add_process("VPIN", "0.25-µm Verticle Pin Diode 2MI", 0.25,
> 1, 1, "Test import process from xmlrpc call.")
>
>
>
>
> BTW. Looks like the example in the book has an incomplete import statement
> since the Idle editor tells me so. I changed
>
> from gluon.contrib.simplejsonrpc import
>
>
> to
> from gluon.contrib.simplejsonrpc import ServerProxy
>
> I added c:\web2py to PYTHONPATH and restarted the Idle editor and confirmed
> c:web2py in the path browser.
> It is further confirmed in the output from
> print sys.path
>
> my file is in C:\web2py\applications\TAMOTO_2012\private if that is relavant.
> This error message occurs from the simplejsonrpc:
> >>>
> ['C:\\web2py\\applications\\TAMOTO_2012\\private',
> 'C:\\Python27\\Lib\\idlelib',
> 'C:\\Python27\\lib\\site-packages\\setuptools-0.6c11-py2.7.egg',
> 'C:\\Python27\\lib\\site-packages\\generateds-2.6a-py2.7.egg',
> 'C:\\Python27', 'C:\\web2py', 'C:\\Windows\\system32\\python27.zip',
> 'C:\\Python27\\DLLs', 'C:\\Python27\\lib', 'C:\\Python27\\lib\\plat-win',
> 'C:\\Python27\\lib\\lib-tk', 'C:\\Python27\\lib\\site-packages',
> 'C:\\Python27\\lib\\site-packages\\win32',
> 'C:\\Python27\\lib\\site-packages\\win32\\lib',
> 'C:\\Python27\\lib\\site-packages\\Pythonwin']
> No handlers could be found for logger "web2py"
>
> Traceback (most recent call last):
> File "C:\web2py\gluon\__init__.py", line 15, in <module>
> from globals import current
> File "C:\web2py\gluon\globals.py", line 24, in <module>
> from serializers import json, custom_json
> File "C:\web2py\gluon\serializers.py", line 11, in <module>
> from languages import lazyT
> File "C:\web2py\gluon\languages.py", line 264, in <module>
> PLURAL_RULES = read_possible_plurals()
> File "C:\web2py\gluon\languages.py", line 250, in read_possible_plurals
> for pname in os.listdir(pdir):
> WindowsError: [Error 3] The system cannot find the path specified:
> 'C:\\web2py\\applications\\TAMOTO_2012\\private\\gluon\\contrib\\rules/*.*'
>
>
>
> Been working on this all morning. Any help is apreciated.
>
>
--