Possible bug: generate.py with empty string as macro value

classic Classic list List threaded Threaded
3 messages Options
non
Reply | Threaded
Open this post in threaded view
|

Possible bug: generate.py with empty string as macro value

non
Hi,

If you pass any macro on command line with an empty string as value, generate.py throws an exception.

app$ ./generate.py -m TEST:
Traceback (most recent call last):
  File "/home/user/public_html/qooxdoo-3.0.1-sdk/tool/bin/generator.py", line 247, in <module>
    main()
  File "/home/user/public_html/qooxdoo-3.0.1-sdk/tool/bin/generator.py", line 117, in main
    (options, args) = GeneratorArguments(option_class=ExtendAction).parse_args(sys.argv[1:])
  File "/usr/lib/python2.7/optparse.py", line 1399, in parse_args
    stop = self._process_args(largs, rargs, values)
  File "/usr/lib/python2.7/optparse.py", line 1443, in _process_args
    self._process_short_opts(rargs, values)
  File "/usr/lib/python2.7/optparse.py", line 1550, in _process_short_opts
    option.process(opt, value, values, self)
  File "/usr/lib/python2.7/optparse.py", line 788, in process
    self.action, self.dest, opt, value, values, parser)
  File "/home/user/public_html/qooxdoo-3.0.1-sdk/tool/pylib/misc/ExtendAction.py", line 45, in take_action
    if keyval[1][0] in ["[", "{"]: # decode a Json value
IndexError: string index out of range

I think empty strings should be valid values. Anyway, if they're not, a proper error message would be fine.

I peeped into the code and think, it's just a matter of checking if keyval[1] is defined (ExtendAction). But I'm not a python coder and the whole configuration and generation process is still kind of black magic to me.



Regards,

Markus




Reply | Threaded
Open this post in threaded view
|

Re: Possible bug: generate.py with empty string as macro value

Thomas Herchenroeder
You're right, please open a bug for it. Please include the OS you're using
and the Shell implementation (as shells vary strongly in their quoting
regimen).

T.

> Hi,
>
> If you pass any macro on command line with an empty string as value,
> generate.py throws an exception.
>
> app$ ./generate.py -m TEST:
> Traceback (most recent call last):
>   File "/home/user/public_html/qooxdoo-3.0.1-sdk/tool/bin/generator.py",
> line 247, in <module>
>     main()
>   File "/home/user/public_html/qooxdoo-3.0.1-sdk/tool/bin/generator.py",
> line 117, in main
>     (options, args) =
> GeneratorArguments(option_class=ExtendAction).parse_args(sys.argv[1:])
>   File "/usr/lib/python2.7/optparse.py", line 1399, in parse_args
>     stop = self._process_args(largs, rargs, values)
>   File "/usr/lib/python2.7/optparse.py", line 1443, in _process_args
>     self._process_short_opts(rargs, values)
>   File "/usr/lib/python2.7/optparse.py", line 1550, in _process_short_opts
>     option.process(opt, value, values, self)
>   File "/usr/lib/python2.7/optparse.py", line 788, in process
>     self.action, self.dest, opt, value, values, parser)
>   File
> "/home/user/public_html/qooxdoo-3.0.1-sdk/tool/pylib/misc/ExtendAction.py",
> line 45, in take_action
>     if keyval[1][0] in ["[", "{"]: # decode a Json value
> IndexError: string index out of range
>
> I think empty strings should be valid values. Anyway, if they're not, a
> proper error message would be fine.
>
> I peeped into the code and think, it's just a matter of checking if
> keyval[1] is defined (ExtendAction). But I'm not a python coder and the
> whole configuration and generation process is still kind of black magic to
> me.
>
>
>
> Regards,
>
> Markus
>
>
>
>
>
>
>
>
> --
> View this message in context:
> http://qooxdoo.678.n2.nabble.com/Possible-bug-generate-py-with-empty-string-as-macro-value-tp7584605.html
> Sent from the qooxdoo mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> How ServiceNow helps IT people transform IT departments:
> 1. Consolidate legacy IT systems to a single system of record for IT
> 2. Standardize and globalize service processes across IT
> 3. Implement zero-touch automation to replace manual, redundant tasks
> http://pubads.g.doubleclick.net/gampad/clk?id=51271111&iu=/4140/ostg.clktrk
> _______________________________________________
> qooxdoo-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
>
>
>



------------------------------------------------------------------------------
LIMITED TIME SALE - Full Year of Microsoft Training For Just $49.99!
1,500+ hours of tutorials including VisualStudio 2012, Windows 8, SharePoint
2013, SQL 2012, MVC 4, more. BEST VALUE: New Multi-Library Power Pack includes
Mobile, Cloud, Java, and UX Design. Lowest price ever! Ends 9/22/13.
http://pubads.g.doubleclick.net/gampad/clk?id=64545871&iu=/4140/ostg.clktrk
_______________________________________________
qooxdoo-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
non
Reply | Threaded
Open this post in threaded view
|

Re: Possible bug: generate.py with empty string as macro value

non