Issue 299 in ulipad: ubuntu 下用 ulipad 运行的时候 parser.parse_args() 返回的参数问题

5 views
Skip to first unread message

uli...@googlecode.com

unread,
Aug 5, 2012, 10:29:04 PM8/5/12
to uli...@googlegroups.com
Status: New
Owner: ----

New issue 299 by zhangchu...@gmail.com: ubuntu 下用 ulipad 运行的时候
parser.parse_args() 返回的参数问题
http://code.google.com/p/ulipad/issues/detail?id=299

What steps will reproduce the problem?
1. 代码:
def main():
from optparse import OptionParser

parser = OptionParser()
options, args = parser.parse_args()

print repr(args)

2. 在 ubuntu 下运行打印出的是
['']
3. 如果直接在命令行下运行打印出的就是
[]

What is the expected output? What do you see instead?


What version of the product are you using? On what operating system?


Please provide any additional information below.


uli...@googlecode.com

unread,
Aug 6, 2012, 7:38:18 AM8/6/12
to uli...@googlegroups.com

Comment #1 on issue 299 by limo...@gmail.com: ubuntu 下用 ulipad 运行的时候
parser.parse_args() 返回的参数问题
http://code.google.com/p/ulipad/issues/detail?id=299

这个是有什么问题吗?不太明白。

uli...@googlecode.com

unread,
Aug 6, 2012, 8:48:19 PM8/6/12
to uli...@googlegroups.com

Comment #2 on issue 299 by zhangchu...@gmail.com: ubuntu 下用 ulipad 运行的
时候 parser.parse_args() 返回的参数问题
http://code.google.com/p/ulipad/issues/detail?id=299

应该要跟命令行一样是没有参数才对,传了一个空串的参数,象运行一些脚本的时候就会
有问题,例如我写的一个脚本,没参数的行为跟有参数的行为相差比较大

limodou

unread,
Aug 7, 2012, 2:46:45 AM8/7/12
to uli...@googlegroups.com


2012/8/7 <uli...@googlecode.com>

Comment #2 on issue 299 by zhangchu...@gmail.com: ubuntu 下用 ulipad 运行的时候 parser.parse_args() 返回的参数问题
http://code.google.com/p/ulipad/issues/detail?id=299

应该要跟命令行一样是没有参数才对,传了一个空串的参数,象运行一些脚本的时候就会有问题,例如我写的一个脚本,没参数的行为跟有参数的行为相差比较大


除非是特意处理,空参数和没传参数本来就是不同的。

--
I like python!
UliPad <<The Python Editor>>: http://code.google.com/p/ulipad/
UliWeb <<simple web framework>>: https://github.com/limodou/uliweb
My Blog: http://my.oschina.net/limodou
Reply all
Reply to author
Forward
0 new messages