{"action":"created","issue":{"url":"https://api.github.com/repos/foosel/OctoPrint/issues/1416","repository_url":"https://api.github.com/repos/foosel/OctoPrint","labels_url":"https://api.github.com/repos/foosel/OctoPrint/issues/1416/labels{/name}","comments_url":"https://api.github.com/repos/foosel/OctoPrint/issues/1416/comments","events_url":"https://api.github.com/repos/foosel/OctoPrint/issues/1416/events","html_url":"https://github.com/foosel/OctoPrint/pull/1416","id":165842754,"node_id":"MDExOlB1bGxSZXF1ZXN0Nzc2NTMyMzg=","number":1416,"title":"python3: [DO NOT MERGE] just for feedback","user":{"login":"ByReaL","id":3046965,"node_id":"MDQ6VXNlcjMwNDY5NjU=","avatar_url":"https://avatars3.githubusercontent.com/u/3046965?v=4","gravatar_id":"","url":"https://api.github.com/users/ByReaL","html_url":"https://github.com/ByReaL","followers_url":"https://api.github.com/users/ByReaL/followers","following_url":"https://api.github.com/users/ByReaL/following{/other_user}","gists_url":"https://api.github.com/users/ByReaL/gists{/gist_id}","starred_url":"https://api.github.com/users/ByReaL/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ByReaL/subscriptions","organizations_url":"https://api.github.com/users/ByReaL/orgs","repos_url":"https://api.github.com/users/ByReaL/repos","events_url":"https://api.github.com/users/ByReaL/events{/privacy}","received_events_url":"https://api.github.com/users/ByReaL/received_events","type":"User","site_admin":false},"labels":[{"id":557039014,"node_id":"MDU6TGFiZWw1NTcwMzkwMTQ=","url":"https://api.github.com/repos/foosel/OctoPrint/labels/pr:work%20in%20progress","name":"pr:work in progress","color":"fef2c0","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/foosel/OctoPrint/milestones/6","html_url":"https://github.com/foosel/OctoPrint/milestone/6","labels_url":"https://api.github.com/repos/foosel/OctoPrint/milestones/6/labels","id":1636688,"node_id":"MDk6TWlsZXN0b25lMTYzNjY4OA==","number":6,"title":"1.4.0","description":"","creator":{"login":"foosel","id":83657,"node_id":"MDQ6VXNlcjgzNjU3","avatar_url":"https://avatars0.githubusercontent.com/u/83657?v=4","gravatar_id":"","url":"https://api.github.com/users/foosel","html_url":"https://github.com/foosel","followers_url":"https://api.github.com/users/foosel/followers","following_url":"https://api.github.com/users/foosel/following{/other_user}","gists_url":"https://api.github.com/users/foosel/gists{/gist_id}","starred_url":"https://api.github.com/users/foosel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/foosel/subscriptions","organizations_url":"https://api.github.com/users/foosel/orgs","repos_url":"https://api.github.com/users/foosel/repos","events_url":"https://api.github.com/users/foosel/events{/privacy}","received_events_url":"https://api.github.com/users/foosel/received_events","type":"User","site_admin":false},"open_issues":7,"closed_issues":5,"state":"open","created_at":"2016-03-10T14:34:22Z","updated_at":"2018-07-06T15:26:30Z","due_on":null,"closed_at":null},"comments":9,"created_at":"2016-07-15T17:51:58Z","updated_at":"2018-07-11T10:15:33Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/foosel/OctoPrint/pulls/1416","html_url":"https://github.com/foosel/OctoPrint/pull/1416","diff_url":"https://github.com/foosel/OctoPrint/pull/1416.diff","patch_url":"https://github.com/foosel/OctoPrint/pull/1416.patch"},"body":"this is all work in progress but i would like everyone feedback on few aspects with will determine how i approach the actual change for further pull requests. on python3 compatibility.\n\n1) unicode, i will like to add \nfrom **future** import ....... unicode_literals \nin all the source code files, and mark with b'ABCxyz' wherever needed and remove u'' for eveywhere else to have everything compatible and conforming to the python3 while having same behavior also on python2. \nor\nu'' is recognized by python3  (redundant since all string in py3 are unicode anyway) so we could add u'' on all strings that are not b'' to make things very clear\nso is b'xyz' & 'abc' versus b'xyz' & u'abc'  with unicode_literals  imported in both cases. \nchoices have same behavior on both python2 and 3 so it's just a matter of preference.\n\n 2) for file opening instead of using open i will like to use io.open that is equivalent with python3 open\nand specify the file type as text or binary and the encoding to make things run same on both py2 and 3 and make things very clear\n\n3) update packages versions to include packages that are python 2 and 3 compatible\nall changes look more or less ok but i would like some feedback on below change and the reson is that netifaces is a bit abandoned and somebody else made fixes for python3 and renamed the package\n    - \"netifaces>=0.10,<0.11\",\n    + \"gns3-netifaces>=0.10,<0.11\",\n\n4) migrate doctest that looks for u'' strings to unitest so they can pass in both versions or use the doctest-ignore-unicode package to make doctest ignore the u'' and have the tests passing in both python2 and 3\n\n5) not exactly related to python3 migration but noticed it while doing unicode/bytes work is the dos8.3 file names function witch is not generating 8.3 names (as dos/windows) and planing to rewrite the function to behave exactly like what you will find under dos or windows in term of SFN DOS8.3 file names\n"},"comment":{"url":"https://api.github.com/repos/foosel/OctoPrint/issues/comments/404118702","html_url":"https://github.com/foosel/OctoPrint/pull/1416#issuecomment-404118702","issue_url":"https://api.github.com/repos/foosel/OctoPrint/issues/1416","id":404118702,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNDExODcwMg==","user":{"login":"razerraz","id":12051205,"node_id":"MDQ6VXNlcjEyMDUxMjA1","avatar_url":"https://avatars2.githubusercontent.com/u/12051205?v=4","gravatar_id":"","url":"https://api.github.com/users/razerraz","html_url":"https://github.com/razerraz","followers_url":"https://api.github.com/users/razerraz/followers","following_url":"https://api.github.com/users/razerraz/following{/other_user}","gists_url":"https://api.github.com/users/razerraz/gists{/gist_id}","starred_url":"https://api.github.com/users/razerraz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/razerraz/subscriptions","organizations_url":"https://api.github.com/users/razerraz/orgs","repos_url":"https://api.github.com/users/razerraz/repos","events_url":"https://api.github.com/users/razerraz/events{/privacy}","received_events_url":"https://api.github.com/users/razerraz/received_events","type":"User","site_admin":false},"created_at":"2018-07-11T10:15:33Z","updated_at":"2018-07-11T10:15:33Z","author_association":"NONE","body":"To have a more complete state of what need to be done :\r\n\r\n- all thoughts provided by @kevans91 are dawn right in fact\r\n\r\n- Slugify needs to be imported as \"from slugify import **s**lugify\" and doesn't have to be first instantiated anymore. safe_chars property is not used anymore, equivalent feature is done by regex_pattern (text = slugify(text, regex_pattern=r'[^-A-z0-9._()[\\] ]+'))\r\n\r\n- flask-login provides \"is_anonymous\" and \"is_admin\" as attributes, not functions\r\n\r\n- The minimal http server used during (at least) loading and in some plugins need import change : \"from BaseHTTPServer import BaseHTTPRequestHandler\" becomes \"from http.server import BaseHTTPRequestHandler\", SimpleHTTPRequestHandler doesn't exist anymore but BaseHTTPRequestHandler can be used instead.\r\n\r\n- Since tornado now use asyncio, the event loop need to be created in every thread (asyncio.set_event_loop(asyncio.new_event_loop())). Especially relevant for sockjs-tornado implemetation.\r\n\r\n- unicode/bytes/string conversion is a mess. It will be very hard to make something running on both python versions. Major modules (serial, hash) need bytes like objects nowdays"}}
{"actor":{"display_login":"razerraz"}}