[wingide-users] Strange behaviour of Python Shell.

Maxim Lacrima lacrima.maxim at gmail.com
Wed May 26 04:54:30 MDT 2010


Hello!

My OS is Debian Lenny. Default Python version is 2.5.2.
I have quite strange behaviour of Python Shell in Wing IDE.
I have installed python-jsonrpc: http://json-rpc.org/wiki/python-json-rpc

Now, about strangeness. In Wing I can't import anything (classes,
modules etc.) from jsonrpc package, except json module, though if I
use Python from command line I can import any module from that package
and any class from the module.

In Wing Python shell:
>>> import jsonrpc
>>> dir(jsonrpc)
['__builtins__', '__doc__', '__file__', '__name__', '__path__', 'json']
>>> dir(jsonrpc.json)
['__builtins__', '__doc__', '__file__', '__name__']
>>> from jsonrpc.json import dumps
Traceback (most recent call last):
  File "<string>", line 1, in <fragment>
ImportError: cannot import name dumps
>>>


Now, when started Python from command line:
>>> import jsonrpc
>>> dir(jsonrpc)
['JSONDecodeException', 'JSONEncodeException', 'JSONRPCException',
'ServiceException', 'ServiceHandler', 'ServiceMethod',
'ServiceMethodNotFound', 'ServiceProxy', '__builtins__', '__doc__',
'__file__', '__name__', '__path__', 'cgiwrapper', 'dumps',
'handleCGI', 'handler', 'json', 'loads', 'modpywrapper', 'proxy',
'serviceHandler']
>>> dir(jsonrpc.json)
['BooleanType', 'BufferType', 'BuiltinFunctionType',
'BuiltinMethodType', 'CharReplacements', 'ClassType', 'CodeType',
'ComplexType', 'DictProxyType', 'DictType', 'DictionaryType',
'Digits', 'EllipsisType', 'EscapeCharToChar', 'FileType', 'FloatType',
'FrameType', 'FunctionType', 'GeneratorType', 'GetSetDescriptorType',
'InstanceType', 'IntType', 'JSONDecodeException',
'JSONEncodeException', 'LambdaType', 'ListType', 'LongType',
'MemberDescriptorType', 'MethodType', 'ModuleType', 'NoneType',
'NotImplementedType', 'ObjectType', 'SliceType', 'StringEscapeRE',
'StringType', 'StringTypes', 'TracebackType', 'TupleType', 'TypeType',
'UnboundMethodType', 'UnicodeType', 'XRangeType', '__builtins__',
'__doc__', '__file__', '__name__', 'dumpParts', 'dumps', 'escapeChar',
'loads', 're']
>>> from jsonrpc.json import dumps
>>>



-- 
with regards,
Maxim


More information about the wingide-users mailing list