the debug of ipdl.py

来源:互联网 发布:达内php培训课程 编辑:程序博客网 时间:2024/05/16 17:11

debugging thoughts:


the question meet now:

the function in ipdl.py name parser.readf(open(options.syncMsgList)),it yield cannot find sync-messages.ini,the error yield ,IOError,

open() failed

how to fix open()?



so ,what may cause this error?

some assumptions here:

1.the path of ***.ini  can't be detected by python:

ways to test it ,

add the path of this file to the ipdl.py.

add the path of ini to PYTHONPATH.


PYTHONPATH=$PYTHONPATH:~/mozilla/gecko-dev/ipc/ipdl python




the result seemed upset,cannot solve this error,


where are parser and options?

find out parser.readf()


the related files research.


2.all refer to the path problem ,


what is options.syncMsgList stand for and where it go on to go?which directory?


the open() function contain a variable name ***.ini,

or the function readf() ,no it point to some thing ,the error must be take place in open();

the variable which contains the .ini file maybe syncMsgList?


so ,from here ,some questions in mind ,

   what is options?

   where can i find syncmsglist?

   which files contains the ini ,need to add the path to pythonpath or whatever .

  


so the error may be fixed by add the path of .ini in the options.syncmsglist.

the act you have to do now is find out this file  (syncmsglist.**,or options.**) then add the path.




the Rawconfigparser()


it import from configparser()


and goto configparser.py in python2.7/...


and below this class,has a readfp()


and it opened a file(options.syncmsglist)


find out the file today,and fix it.


you sucker!!!


op = optparse.optionparser


the options,files = op.parse_args()


don't really understand what is this line means "options,files = op.parse_args()"

why here is a ","?



finally,this problem solved by changing the directory of run the ipdl.py in which ipdl.py lives in.

n@zdos-build:~/mozilla/gecko-dev/ipc/ipdl$ python ipdl.py -d /tmp ../test-harness/PTest.ipdl

and the error move to PTest.ipdl.  go on to debug it.



原创粉丝点击