【问题标题】:Yahoo Pipes, simplejson and slashes雅虎管道、simplejson 和斜杠
【发布时间】:2009-03-04 11:42:25
【问题描述】:

我尝试使用 http://www.javarants.com/2008/04/13/using-google-app-engine-to-extend-yahoo-pipes/ 作为灵感,但我在输出时遇到了一些问题。

在使用控制台和 App Engine“django util simplejson”进行测试时很明显:

/cygdrive/c/Program Files/Google/google_appengine/lib/django
$ python
Python 2.5.2 (r252:60911, Dec  2 2008, 09:26:14) 
[GCC 3.4.4 (cygming special, gdc 0.12, using dmd 0.125)] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from django.utils import simplejson as json
>>> json.dumps('/')
'"\\/"'
>>> json.dumps('http://stackoverflow.com')
'"http:\\/\\/stackoverflow.com"

As far as I can read这是正常的行为:

在 JSON 中只有反斜杠,双 引号和 ASCII 控制字符 需要逃脱。正斜杠 可以像 URL 示例中那样进行转义 低于,但不一定是。

但是当输入回 yahoopipes 时,它们不会“取消转义”输出,并且我所有的 url 和 html 都不起作用。

我真的应该做一个

self.response.out.write(json.dumps(obj).replace('\\/','/'))

?

==== 编辑 ===

令我大吃一惊的是,我看到从 simplejson 网站下载的最新 simplejson 并没有做“斜线”的东西 :( 所以真正的问题在于应用引擎 django.util.simplejson 版本?

=== 再次编辑 ===

现在我在跟踪器中为它创建了一个问题:http://code.google.com/p/googleappengine/issues/detail?id=1128

【问题讨论】:

  • 标准 Django 中的 django.util.simplejson 也没有。

标签: python yahoo-pipes simplejson


【解决方案1】:

这里没什么可看的。票在那儿,但就我所见,仅此而已

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-01-20
    • 1970-01-01
    • 1970-01-01
    • 2011-03-26
    • 2015-05-12
    • 1970-01-01
    • 1970-01-01
    • 2011-01-02
    相关资源
    最近更新 更多