# Su2rad: malformed format string-%S

**URL:** <https://discourse.radiance-online.org/t/su2rad-malformed-format-string-s/5160>\
**Category:** radiance-general\
**Created:** [March 14, 2020, 2:16am UTC](https://discourse.radiance-online.org/t/su2rad-malformed-format-string-s/5160 "2020-03-14T02:16:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jing\_Gao](https://discourse.radiance-online.org/letter_avatar_proxy/v4/letter/j/9e8a1a/32.png) [@Jing\_Gao](https://discourse.radiance-online.org/u/Jing_Gao)\
**Post date:** [March 14, 2020, 2:16am UTC](https://discourse.radiance-online.org/t/su2rad-malformed-format-string-s/5160/1 "2020-03-14T02:16:42Z")

</div>

Hello everyone,  
i installed sketchup 2019, and su2rad(2014.0.0) recently. But when i run su2rad to export, the following occurs:

 ![微信图片_20200314101114](https://discourse.radiance-online.org/uploads/default/original/1X/bf54d47f26c79e5125ba7b8e9fc85974b26d1759.png)  
My computer system is Window10. I also try to install other versions of sketchup such as 2017,2018. But the same situation occurs.How to solve this problem?  
Thanks a lot.  
Best,  
Jing

---

<div class="post-metadata">

**Author:** ![German\_Molina](https://discourse.radiance-online.org/user_avatar/discourse.radiance-online.org/german_molina/32/492_2.png) [@German\_Molina](https://discourse.radiance-online.org/u/German_Molina)\
**Post date:** [March 22, 2020, 8:53pm UTC](https://discourse.radiance-online.org/t/su2rad-malformed-format-string-s/5160/2 "2020-03-22T20:53:08Z")

</div>

I cannot be sure, but this looks like a bug that has already been solved… I think the reason is that the “%S” (uppercase S) is incorrect, and they should have written “%s” (lowercase).

[Here](https://github.com/tbleicher/su2rad/blob/4874befa4c1b7af5e95d6fc9b2da6c6f2027c7d5/su2rad/su2radlib/config_class.rb#L219), it seems to be fixed already. Just download the newest version and try again!

---

<div class="post-metadata">

**Author:** ![Olivier](https://discourse.radiance-online.org/letter_avatar_proxy/v4/letter/o/d2c977/32.png) [@Olivier](https://discourse.radiance-online.org/u/Olivier)\
**Post date:** [September 23, 2021, 7:12am UTC](https://discourse.radiance-online.org/t/su2rad-malformed-format-string-s/5160/3 "2021-09-23T07:12:01Z")

</div>

I know this is an old post, but I want to give my solution to it for people who still stumble upon this.  
It seems to be an issue that the line 221: printf “%s” % msg.rstrip() uses two formatting methods. In ruby printf is a format function, but calling % outside a string is also a string formatting method. In other words, printf “%s” % msg.rstrip() is equivalent to printf(printf("%s",msg.rstrip())) which makes no sense and should never work.  
As such you should change the line to printf “%s”,msg.rstrip() and it should be fixed.
