← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] lp:~wgrant/launchpad/sqlvalues-fix into lp:launchpad

 

William Grant has proposed merging lp:~wgrant/launchpad/sqlvalues-fix into lp:launchpad.

Commit message:
Fix sqlvalues and co to escape quotes by doubling them, as otherwise Storm turns '?' into '%s'.

Requested reviews:
  William Grant (wgrant): code

For more details, see:
https://code.launchpad.net/~wgrant/launchpad/sqlvalues-fix/+merge/252191

Fix sqlvalues and co to escape quotes by doubling them, as otherwise Storm turns '?' into '%s'. This is probably only visible as failed lookups for translation strings containing '?', including the quotes.
-- 
Your team Launchpad code reviewers is subscribed to branch lp:launchpad.
=== modified file 'lib/lp/translations/doc/pomsgid.txt'
--- lib/lp/translations/doc/pomsgid.txt	2009-07-02 17:16:50 +0000
+++ lib/lp/translations/doc/pomsgid.txt	2015-03-07 01:41:24 +0000
@@ -9,3 +9,7 @@
 >>> got == created
 True
 
+>>> created = POMsgID(msgid="This is a very \t\n\b'?'\\ odd test")
+>>> got = POMsgID.byMsgid("This is a very \t\n\b'?'\\ odd test")
+>>> got == created
+True

=== modified file 'lib/sqlobject/__init__.py'
--- lib/sqlobject/__init__.py	2015-02-19 05:49:54 +0000
+++ lib/sqlobject/__init__.py	2015-03-07 01:41:24 +0000
@@ -20,7 +20,7 @@
 
 _sqlStringReplace = [
     ('\\', '\\\\'),
-    ("'", "\\'"),
+    ("'", "''"),
     ('\000', '\\0'),
     ('\b', '\\b'),
     ('\n', '\\n'),


References