invalid syntax (<string>, line 1)

For many objects, when I attempt to view them in the debugger by clicking the 'view' button, I get this error:

    invalid syntax (<string>, line 1)

This even happens when I right-click on the object and select 'Copy Value' - so the value is lost to me.

Does anybody else see this? Is there any chance of a fix soon?
4
正式评论

Hi! This bug already exists in our tracker: https://youtrack.jetbrains.com/issue/PY-16866
Thank you for the report!

Hi Ben! What are the types of these objects? Maybe you can provide a script and steps for reproducing the issue?
0
I get this with all sorts of objects, but it seems to be certain unicode strings that are broken (and probably, therefore, any object that holds strings like that). I'd copy and paste one here, but 'Copy Value' doesn't work, as noted above.

Sometimes I get 'unexpected EOF while parsing (<string>, line 1)' instead.
0

I have this problem with different values periodically too.

For example in PyCharm 5.0.4 + Python 2.7.6 on Ubuntu 14.04 64b

PyCharm 5.0.4
Build #PY-143.1919, built on January 28, 2016
JRE: 1.7.0_80-b15 amd64
JVM: Java HotSpot(TM) 64-Bit Server VM by Oracle Corporation

I've tried to copy necessary list value which contains more than 2 dicts and this list is an subelement of a parent dict.

https://i.gyazo.com/41c17eaa72ecbd30300104d86412c691.png

So I've got "invalid syntax (<string>, line 1)" in my clipboard

I can correctly get necessary list value from Evaluate Expression window or Watches choosing exactly its key from the parent dict as res['data']:

https://i.gyazo.com/196ea09a5c3dc24058add268f4378e14.png

But a list with two included dicts has been copied successful:

https://i.gyazo.com/b67ad0792b1fa37f7a6857b2450f72e2.png

It will be OK also if the internal dicts are a little bit shorter.

You can try my test in debugger:

{{{

import unittest

class Test(unittest.TestCase):
    def test_copy_value(self):
        d = {
            'isSuccess': True,
            'errors': [],
            'data': [
                {u'sabreId': None, u'lastName': u'FAMILIYA', u'firstName': u'IMYA', u'birthDate': u'2010-02-20', u'id': u'0'},
                {u'sabreId': None, u'lastName': u'LEEVCHENKOV', u'firstName': u'LEV', u'birthDate': u'1915-02-18', u'id': u'1'},
                {u'sabreId': None, u'lastName': u'QQQ', u'firstName': u'QQQ', u'birthDate': u'2013-03-21', u'id': u'2'},
            ],
        }

        pass

if __name__ == '__main__':
    unittest.main()

}}}

0

请先登录再写评论。