{"action":"opened","issue":{"url":"https://api.github.com/repos/spyder-ide/spyder/issues/432","labels_url":"https://api.github.com/repos/spyder-ide/spyder/issues/432/labels{/name}","comments_url":"https://api.github.com/repos/spyder-ide/spyder/issues/432/comments","events_url":"https://api.github.com/repos/spyder-ide/spyder/issues/432/events","html_url":"https://github.com/spyder-ide/spyder/issues/432","id":57864952,"number":432,"title":"Run Selection - Intendation Problem","user":{"login":"spyder-issues-migrator","id":11021581,"avatar_url":"https://avatars.githubusercontent.com/u/11021581?v=3","gravatar_id":"","url":"https://api.github.com/users/spyder-issues-migrator","html_url":"https://github.com/spyder-issues-migrator","followers_url":"https://api.github.com/users/spyder-issues-migrator/followers","following_url":"https://api.github.com/users/spyder-issues-migrator/following{/other_user}","gists_url":"https://api.github.com/users/spyder-issues-migrator/gists{/gist_id}","starred_url":"https://api.github.com/users/spyder-issues-migrator/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/spyder-issues-migrator/subscriptions","organizations_url":"https://api.github.com/users/spyder-issues-migrator/orgs","repos_url":"https://api.github.com/users/spyder-issues-migrator/repos","events_url":"https://api.github.com/users/spyder-issues-migrator/events{/privacy}","received_events_url":"https://api.github.com/users/spyder-issues-migrator/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-02-16T23:39:46Z","updated_at":"2015-02-16T23:39:46Z","closed_at":null,"body":"_From [hannes.k...@gmail.com](https://code.google.com/u/117299380433770174576/) on 2010-10-29T15:30:59Z_\n\n\n\nWhat steps will reproduce the problem?\n\n 1. Open the attached file. It is coded in utf8 and contains the following code:\r\n\r\nfor i in range(10):\r\n    print \"foo\"\r\n    print \"bar\"\r\n\r\nIf you press F5 to execute the whole file everything works as expected.\r\n\r\n2. Now mark only the two lines containing the print-statements (mark the whole lines) and press F9 to execute the selected lines. What is the expected output? What do you see instead? Expected Output: the words \"foo\" and \"bar\" printed to console\r\nActual Output: \"IndentationError: unexpected indent (<ipython console>, line 1)\" What version of the product are you using? On what operating system? OS: Ubuntu 10.04\r\nSpyder Version: 2.0.0beta5+947-0ubuntu2~lucid1  (installed via ubuntu ppa:pythonxy/individual-devel ) \n\nPlease provide any additional information below\n\n. I had a short look at the code ( spiderlib/widgets/editor.py , method __process_lines() to be precise) and I think the problem has something to do with line-separators: On my system the call to get_line_separator() returns '\\n' but the line-separator actually present in the selected text is the unicode character 2029. \r\n\r\nManually setting the line-sepeartor like this \r\n\r\nls= u'\\u2029' \r\n\r\nat the beginning of the __process_lines() method makes this problem go away for me. I know thats not a very good fix of course, but I hope it might help in tracking down the source of the problem.\n\n**Attachment:** [demo.py](http://code.google.com/p/spyderlib/issues/detail?id=432)\n\n_Original issue: http://code.google.com/p/spyderlib/issues/detail?id=432_"}}