{"action":"created","issue":{"url":"https://api.github.com/repos/eclipse/paho.mqtt.python/issues/130","repository_url":"https://api.github.com/repos/eclipse/paho.mqtt.python","labels_url":"https://api.github.com/repos/eclipse/paho.mqtt.python/issues/130/labels{/name}","comments_url":"https://api.github.com/repos/eclipse/paho.mqtt.python/issues/130/comments","events_url":"https://api.github.com/repos/eclipse/paho.mqtt.python/issues/130/events","html_url":"https://github.com/eclipse/paho.mqtt.python/pull/130","id":196389946,"number":130,"title":"Fix uninitialized variable in Websocket _recv_impl","user":{"login":"PierreF","id":359833,"avatar_url":"https://avatars.githubusercontent.com/u/359833?v=3","gravatar_id":"","url":"https://api.github.com/users/PierreF","html_url":"https://github.com/PierreF","followers_url":"https://api.github.com/users/PierreF/followers","following_url":"https://api.github.com/users/PierreF/following{/other_user}","gists_url":"https://api.github.com/users/PierreF/gists{/gist_id}","starred_url":"https://api.github.com/users/PierreF/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/PierreF/subscriptions","organizations_url":"https://api.github.com/users/PierreF/orgs","repos_url":"https://api.github.com/users/PierreF/repos","events_url":"https://api.github.com/users/PierreF/events{/privacy}","received_events_url":"https://api.github.com/users/PierreF/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-12-19T11:20:39Z","updated_at":"2016-12-19T22:39:00Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/eclipse/paho.mqtt.python/pulls/130","html_url":"https://github.com/eclipse/paho.mqtt.python/pull/130","diff_url":"https://github.com/eclipse/paho.mqtt.python/pull/130.diff","patch_url":"https://github.com/eclipse/paho.mqtt.python/pull/130.patch"},"body":"This is the fix for #126.\r\n\r\nIt use bytearray() as initial value for payload (and not empty string  \"\") since payload is normally a bytearray().\r\n\r\nAs I didn't known how to produce OPCODE_CONNCLOSE using Mosquitto, I've used a dummy tornado Websocket server that just close Websocket:\r\n```\r\nimport tornado.websocket\r\nimport tornado.ioloop\r\nclass EchoWebSocket(tornado.websocket.WebSocketHandler):\r\n    def open(self):\r\n        self.close()\r\n    def on_message(self, *args, **kwargs):\r\n        pass\r\n\r\ndef make_app():\r\n    return tornado.web.Application([\r\n        (r\"/mqtt\", EchoWebSocket),\r\n    ])\r\n\r\napp = make_app()\r\napp.listen(8888)\r\ntornado.ioloop.IOLoop.current().start()\r\n```\r\n\r\nThen a client connection to this server fail with the UnboundLocalError & stack from #126 :+1: \r\n```\r\n>>> import paho.mqtt.client\r\n>>> cl = paho.mqtt.client.Client(transport='websockets')\r\n>>> cl.connect('127.0.0.1', 8888)\r\n>>> cl.loop_forever()\r\nTraceback (most recent call last):\r\n[...]\r\n  File \"/home/pierref/dev/ext/github.com/eclipse/paho.mqtt.python/src/paho/mqtt/client.py\", line 2893, in _recv_impl\r\n    frame = self._create_frame(WebsocketWrapper.OPCODE_CONNCLOSE, payload, 0)\r\nUnboundLocalError: local variable 'payload' referenced before assignment\r\n```"},"comment":{"url":"https://api.github.com/repos/eclipse/paho.mqtt.python/issues/comments/268099614","html_url":"https://github.com/eclipse/paho.mqtt.python/pull/130#issuecomment-268099614","issue_url":"https://api.github.com/repos/eclipse/paho.mqtt.python/issues/130","id":268099614,"user":{"login":"ralight","id":79578,"avatar_url":"https://avatars.githubusercontent.com/u/79578?v=3","gravatar_id":"","url":"https://api.github.com/users/ralight","html_url":"https://github.com/ralight","followers_url":"https://api.github.com/users/ralight/followers","following_url":"https://api.github.com/users/ralight/following{/other_user}","gists_url":"https://api.github.com/users/ralight/gists{/gist_id}","starred_url":"https://api.github.com/users/ralight/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ralight/subscriptions","organizations_url":"https://api.github.com/users/ralight/orgs","repos_url":"https://api.github.com/users/ralight/repos","events_url":"https://api.github.com/users/ralight/events{/privacy}","received_events_url":"https://api.github.com/users/ralight/received_events","type":"User","site_admin":false},"created_at":"2016-12-19T22:39:00Z","updated_at":"2016-12-19T22:39:00Z","body":"@swails The model is a very simplified version of http://nvie.com/posts/a-successful-git-branching-model/\r\n\r\n`master` is always stable. Bug fixes go into the `fixes` branch, new features go into `develop`. When a new release is made, if it is going to be a bugfix release (1.2.x) then the changes from the `fixes` branch are merged into `master` and the release is tagged. If it is a feature release (1.x.0 or x.0.0) then everything from `develop` and `fixes` gets merged into `master`.\r\n\r\nDoes that make sense?"}}
{"actor":{"display_login":"ralight"}}