.. so for example I get this rendered by wxg0.7.2 (and 0.7.1) in init():
self.the_path = wx.TextCtrl(self, wx.ID_ANY, "C:\some\where\")
=> compile SyntaxError. luck! :) because many backslashes go through and produce false chars silently without clear error message.
Same with wx.StaticText label strings (and probably other things).
wxg0.6.3 at least made it correct like
self.the_path = wx.TextCtrl(self, wx.ID_ANY, "c:\\some\\where\\")
This patch in codegen.init.BaseLangCodeWriter.quote_str solves:
I wonder why the language independent quotestr tries to (pre)escape things half way. And then the codegen.pycodegen.BaseLangCodeWriter._quote_str tryies 'additional' things. Doesn't the lang-specific quoter know best at all and do it all in one simple shift - e.g. python: repr(s.encode('ascii')) ; and on encoding failure: repr(s)
Diff:
Hi,
The changed escaping algorithm is a trade-off between more and less escaping. The current decision is to do a minimal escaping.
You can format your texts with tabs ("\t") and newline ("\n") characters currently.
More escaping should be implemented in the application logic.
Some thoughts about escaping:
input
shown
input
shown
But
generates
or
generates
What are your expectations? What do you suggest to handle this trade-off?
Regards,
Carsten
I've transferred this topic into a new feature request [features:#39] to discuss and implement a solution that handles both approaches in a appropriate manner.
Related
Feature Requests:
#39