{"action":"created","issue":{"url":"https://api.github.com/repos/adafruit/circuitpython/issues/196","repository_url":"https://api.github.com/repos/adafruit/circuitpython","labels_url":"https://api.github.com/repos/adafruit/circuitpython/issues/196/labels{/name}","comments_url":"https://api.github.com/repos/adafruit/circuitpython/issues/196/comments","events_url":"https://api.github.com/repos/adafruit/circuitpython/issues/196/events","html_url":"https://github.com/adafruit/circuitpython/issues/196","id":251490041,"number":196,"title":"syntax errors on linux system","user":{"login":"jerryneedell","id":15856834,"avatar_url":"https://avatars0.githubusercontent.com/u/15856834?v=4","gravatar_id":"","url":"https://api.github.com/users/jerryneedell","html_url":"https://github.com/jerryneedell","followers_url":"https://api.github.com/users/jerryneedell/followers","following_url":"https://api.github.com/users/jerryneedell/following{/other_user}","gists_url":"https://api.github.com/users/jerryneedell/gists{/gist_id}","starred_url":"https://api.github.com/users/jerryneedell/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jerryneedell/subscriptions","organizations_url":"https://api.github.com/users/jerryneedell/orgs","repos_url":"https://api.github.com/users/jerryneedell/repos","events_url":"https://api.github.com/users/jerryneedell/events{/privacy}","received_events_url":"https://api.github.com/users/jerryneedell/received_events","type":"User","site_admin":false},"labels":[{"id":522005603,"url":"https://api.github.com/repos/adafruit/circuitpython/labels/atmel-samd","name":"atmel-samd","color":"fbca04","default":false},{"id":428115434,"url":"https://api.github.com/repos/adafruit/circuitpython/labels/bug","name":"bug","color":"ee0701","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/adafruit/circuitpython/milestones/5","html_url":"https://github.com/adafruit/circuitpython/milestone/5","labels_url":"https://api.github.com/repos/adafruit/circuitpython/milestones/5/labels","id":2674476,"number":5,"title":"3.0","description":"These are issues that need to be handled before we launch a Release Candidate of 3.0.0. We'll release beta versions while we work through these issues. Once this list has no entries, we'll do a release candidate and the issues on this list will then trigger further release candidates.","creator":{"login":"tannewt","id":52649,"avatar_url":"https://avatars1.githubusercontent.com/u/52649?v=4","gravatar_id":"","url":"https://api.github.com/users/tannewt","html_url":"https://github.com/tannewt","followers_url":"https://api.github.com/users/tannewt/followers","following_url":"https://api.github.com/users/tannewt/following{/other_user}","gists_url":"https://api.github.com/users/tannewt/gists{/gist_id}","starred_url":"https://api.github.com/users/tannewt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tannewt/subscriptions","organizations_url":"https://api.github.com/users/tannewt/orgs","repos_url":"https://api.github.com/users/tannewt/repos","events_url":"https://api.github.com/users/tannewt/events{/privacy}","received_events_url":"https://api.github.com/users/tannewt/received_events","type":"User","site_admin":false},"open_issues":22,"closed_issues":76,"state":"open","created_at":"2017-08-01T16:57:26Z","updated_at":"2018-05-14T20:38:37Z","due_on":null,"closed_at":null},"comments":6,"created_at":"2017-08-20T13:56:17Z","updated_at":"2018-05-14T20:45:58Z","closed_at":null,"author_association":"COLLABORATOR","body":"I have been seeing the same issue discussed in  Issue #111 \r\n\r\non  a linux (Ubuntu 16.04 on a Mac Mini box) system. Since #111 focused on the Windows platform, it was recommended that a new issue be opened for linux.\r\n\r\nWhat I have found is the when editing and  saving a file on the circuitPython device, I often get a \"syntax error\" the first time I try to execute the saved script. \r\n\r\nWith guidance from @dhalbert here are a few consistent observations:\r\nThe problem only occurs if sufficient time is not allowed after saving the file and executing it.\r\nIt also depends on the editor used to save the file.\r\nUsing \"gedit\" I found that I had to wait ~30 seconds after saving the file before rebooting and executing it to reliably avoid the syntax error. I tried several delay times and found anything less than 30 seconds to be unreliable.\r\nUsing \"nano\" to edit the file, I was unable to cause the error no mater how quickly I rebooted.\r\n\r\nOne other note is that the problem did not occur at all with a very short (~300 byte) script. This is consistent with the discussion in #111 \r\n\r\nThese tests were executed with CirCuitPython 2.0.0-beta-1.4 on  a Metro_M0_Express - with a Jewel(7 Neopixel) connected to D2\r\n\r\nHere is an example of the syntax error and the script.\r\n> Press any key to enter the REPL. Use CTRL-D to reload.\r\n\r\nAdafruit CircuitPython 2.0.0-beta.1-4-gf6a7025 on 2017-08-11; Adafruit Metro M0 Express with samd21g18\r\n>>> import jewel_rainbow\r\nTraceback (most recent call last):\r\n  File \"<stdin>\", line 1, in <module>\r\n  File \"jewel_rainbow.py\", line 45\r\nSyntaxError: invalid syntax\r\n\r\n\r\n\r\n````python\r\n# Gemma IO demo - NeoPixel\r\n \r\nfrom digitalio import *\r\nfrom board import *\r\nimport neopixel\r\nimport time\r\n \r\npixpin = D2\r\nnumpix = 7\r\n \r\n#led = DigitalInOut(D13)\r\n#led.direction = Direction.OUTPUT\r\n \r\nstrip = neopixel.NeoPixel(pixpin, numpix, brightness=0.3,auto_write=False)\r\n \r\n \r\ndef wheel(pos):\r\n    # Input a value 0 to 255 to get a color value.\r\n    # The colours are a transition r - g - b - back to r.\r\n    if (pos < 0):\r\n        return (0, 0, 0)\r\n    if (pos > 255):\r\n        return (0, 0, 0)\r\n    if (pos < 85):\r\n        return (int(pos * 3), int(255 - (pos*3)), 0)\r\n    elif (pos < 170):\r\n        pos -= 85\r\n        return (int(255 - pos*3), 0, int(pos*3))\r\n    else:\r\n        pos -= 170\r\n        return (0, int(pos*3), int(255 - pos*3))\r\n \r\ndef rainbow_cycle(wait):\r\n    for j in range(255):\r\n        for i in range(len(strip)):\r\n            idx = int ((i * 256 / len(strip)) + j)\r\n            strip[i] = wheel(idx & 255)\r\n        strip.show()\r\n        time.sleep(wait)\r\n \r\ntry:\r\n    while True:        \r\n        rainbow_cycle(0.001)\r\n\r\nexcept:\r\n    pass\r\n\r\nfinally:\r\n    for i in range(len(strip)):\r\n        strip[i] = (0,0,0)\r\n    strip.show()\r\n\r\n````\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/adafruit/circuitpython/issues/comments/388956962","html_url":"https://github.com/adafruit/circuitpython/issues/196#issuecomment-388956962","issue_url":"https://api.github.com/repos/adafruit/circuitpython/issues/196","id":388956962,"user":{"login":"tannewt","id":52649,"avatar_url":"https://avatars1.githubusercontent.com/u/52649?v=4","gravatar_id":"","url":"https://api.github.com/users/tannewt","html_url":"https://github.com/tannewt","followers_url":"https://api.github.com/users/tannewt/followers","following_url":"https://api.github.com/users/tannewt/following{/other_user}","gists_url":"https://api.github.com/users/tannewt/gists{/gist_id}","starred_url":"https://api.github.com/users/tannewt/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tannewt/subscriptions","organizations_url":"https://api.github.com/users/tannewt/orgs","repos_url":"https://api.github.com/users/tannewt/repos","events_url":"https://api.github.com/users/tannewt/events{/privacy}","received_events_url":"https://api.github.com/users/tannewt/received_events","type":"User","site_admin":false},"created_at":"2018-05-14T20:45:58Z","updated_at":"2018-05-14T20:45:58Z","author_association":"COLLABORATOR","body":"Once I revive Rosie I can see if its still an issue there."}}
{"actor":{"display_login":"tannewt"}}