开发者社区 问答 正文

Python XML-RPC问题,请多指教?报错

__author__ = 'Administrator'

import dba
import SimpleXMLRPCServer

if __name__ == '__main__':
    server = SimpleXMLRPCServer.SimpleXMLRPCServer(('localhost', 7000))
    server.register_function(dba.connect)
    server.serve_forever() 
对对对运行时会报错,但是Debug时是正常的。
输出:
"D:\Program Files\Python27\python.exe" D:/niux_bi/utils/dbaserver.py
Traceback (most recent call last):
  File "D:/niux_bi/utils/dbaserver.py", line 4, in <module>
    import SimpleXMLRPCServer
  File "D:\Program Files\Python27\lib\SimpleXMLRPCServer.py", line 102, in <module>
    import xmlrpclib
  File "D:\Program Files\Python27\lib\xmlrpclib.py", line 146, in <module>
    import gzip
  File "D:\Program Files\Python27\lib\gzip.py", line 36, in <module>
    class GzipFile(io.BufferedIOBase):
AttributeError: 'module' object has no attribute 'BufferedIOBase'

展开
收起
爱吃鱼的程序员 2020-06-22 22:44:26 415 分享 版权
1 条回答
写回答
取消 提交回答
  • https://developer.aliyun.com/profile/5yerqm5bn5yqg?spm=a2c6h.12873639.0.0.6eae304abcjaIB

    顶起。。。顶起.....

    2020-06-22 22:44:43
    赞同 展开评论