{"action":"created","issue":{"url":"https://api.github.com/repos/simon-weber/gmusicapi/issues/452","repository_url":"https://api.github.com/repos/simon-weber/gmusicapi","labels_url":"https://api.github.com/repos/simon-weber/gmusicapi/issues/452/labels{/name}","comments_url":"https://api.github.com/repos/simon-weber/gmusicapi/issues/452/comments","events_url":"https://api.github.com/repos/simon-weber/gmusicapi/issues/452/events","html_url":"https://github.com/simon-weber/gmusicapi/issues/452","id":151019635,"number":452,"title":"Error when uploading songs with Music Manager (part 1)","user":{"login":"azhou890","id":3608830,"avatar_url":"https://avatars.githubusercontent.com/u/3608830?v=3","gravatar_id":"","url":"https://api.github.com/users/azhou890","html_url":"https://github.com/azhou890","followers_url":"https://api.github.com/users/azhou890/followers","following_url":"https://api.github.com/users/azhou890/following{/other_user}","gists_url":"https://api.github.com/users/azhou890/gists{/gist_id}","starred_url":"https://api.github.com/users/azhou890/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/azhou890/subscriptions","organizations_url":"https://api.github.com/users/azhou890/orgs","repos_url":"https://api.github.com/users/azhou890/repos","events_url":"https://api.github.com/users/azhou890/events{/privacy}","received_events_url":"https://api.github.com/users/azhou890/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":12,"created_at":"2016-04-26T01:34:43Z","updated_at":"2016-09-23T11:22:07Z","closed_at":null,"body":"Encountering two (possibly unrelated) errors when uploading songs to Google Music, but songs still make it onto the service. This is the first of the two:\r\n\r\nThe error happens every time after calling MusicManager.upload(). No trancoding.\r\n\r\n```\r\nTraceback (most recent call last):\r\n  File \"/usr/lib/python2.7/logging/__init__.py\", line 859, in emit\r\n    msg = self.format(record)\r\n  File \"/usr/lib/python2.7/logging/__init__.py\", line 732, in format\r\n    return fmt.format(record)\r\n  File \"/usr/lib/python2.7/logging/__init__.py\", line 471, in format\r\n    record.message = record.getMessage()\r\n  File \"/usr/lib/python2.7/logging/__init__.py\", line 331, in getMessage\r\n    msg = str(self.msg)\r\n  File \"/media/sdv1/azhou890/.local/lib/python2.7/site-packages/google/protobuf/internal/python_message.py\", line 983, in __str__\r\n    return text_format.MessageToString(self)\r\n  File \"/media/sdv1/azhou890/.local/lib/python2.7/site-packages/google/protobuf/text_format.py\", line 129, in MessageToString\r\n    float_format=float_format)\r\n  File \"/media/sdv1/azhou890/.local/lib/python2.7/site-packages/google/protobuf/text_format.py\", line 172, in PrintMessage\r\n    float_format=float_format)\r\n  File \"/media/sdv1/azhou890/.local/lib/python2.7/site-packages/google/protobuf/text_format.py\", line 205, in PrintField\r\n    float_format=float_format)\r\n  File \"/media/sdv1/azhou890/.local/lib/python2.7/site-packages/google/protobuf/text_format.py\", line 239, in PrintFieldValue\r\n    float_format=float_format)\r\n  File \"/media/sdv1/azhou890/.local/lib/python2.7/site-packages/google/protobuf/text_format.py\", line 167, in PrintMessage\r\n    float_format=float_format)\r\n  File \"/media/sdv1/azhou890/.local/lib/python2.7/site-packages/google/protobuf/text_format.py\", line 205, in PrintField\r\n    float_format=float_format)\r\n  File \"/media/sdv1/azhou890/.local/lib/python2.7/site-packages/google/protobuf/text_format.py\", line 239, in PrintFieldValue\r\n    float_format=float_format)\r\n  File \"/media/sdv1/azhou890/.local/lib/python2.7/site-packages/google/protobuf/text_format.py\", line 172, in PrintMessage\r\n    float_format=float_format)\r\n  File \"/media/sdv1/azhou890/.local/lib/python2.7/site-packages/google/protobuf/text_format.py\", line 205, in PrintField\r\n    float_format=float_format)\r\n  File \"/media/sdv1/azhou890/.local/lib/python2.7/site-packages/google/protobuf/text_format.py\", line 258, in PrintFieldValue\r\n    out.write(text_encoding.CEscape(out_value, out_as_utf8))\r\n  File \"/media/sdv1/azhou890/.local/lib/python2.7/site-packages/google/protobuf/text_encoding.py\", line 79, in CEscape\r\n    return ''.join(_cescape_byte_to_str[Ord(c)] for c in text)\r\n  File \"/media/sdv1/azhou890/.local/lib/python2.7/site-packages/google/protobuf/text_encoding.py\", line 79, in <genexpr>\r\n    return ''.join(_cescape_byte_to_str[Ord(c)] for c in text)\r\nTypeError: ord() expected string of length 1, but int found\r\nLogged from file shared.py, line 244\r\n```\r\n\r\nCode: \r\n```\r\nimport os\r\nfrom gmusicapi import Musicmanager\r\napi = Musicmanager()\r\napi.login()\r\n\r\nmusicdir = '/media/sdv1/azhou890/directory/directory/data/sync/Music'\r\n\r\nprint('Adding files')\r\nfor subdir, dirs, files in os.walk(musicdir):\r\n  musiclist = []\r\n  for file in files:\r\n    _, file_ext = os.path.splitext(file)\r\n    if file_ext == '.mp3':\r\n      filename = os.path.join(subdir, file)\r\n      musiclist.append(filename)\r\n  if musiclist:\r\n    print('Uploading Music')\r\n    _,_,failed = api.upload(musiclist)\r\n\r\n    print('Checking Music')\r\n    for failed_upload in failed:\r\n      print(failed_upload)\r\n\r\napi.logout()\r\n```\r\n\r\n\r\nClient Info:\r\n--------------------------------------------------------\r\nPython Version: 2.7.9\r\n\r\nPip Freeze:\r\n```\r\nCheetah==2.4.4\r\nMako==1.0.0\r\nMarkupSafe==0.23\r\nMechanicalSoup==0.4.0\r\nPAM==0.4.2\r\nPyste==0.9.10\r\nTwisted==14.0.2\r\nTwisted-Conch==14.0.2\r\nTwisted-Core==14.0.2\r\nTwisted-Lore==14.0.2\r\nTwisted-Mail==14.0.2\r\nTwisted-Names==14.0.2\r\nTwisted-News==14.0.2\r\nTwisted-Runner==14.0.2\r\nTwisted-Web==14.0.2\r\nTwisted-Words==14.0.2\r\nappdirs==1.4.0\r\nargparse==1.2.1\r\nbeautifulsoup4==4.4.1\r\ncffi==0.8.6\r\ncharacteristic==0.1.0\r\nchardet==2.3.0\r\ncolorama==0.3.2\r\ncryptography==0.6.1\r\ndecorator==4.0.9\r\ndeluge==1.3.11\r\nfuncsigs==1.0.1\r\nfuture==0.15.2\r\ngmusicapi==9.0.0\r\ngpsoauth==0.2.0\r\nhtml5lib==0.999\r\nhttplib2==0.9.2\r\niotop==0.6\r\nmock==2.0.0\r\nmutagen==1.31\r\nndg-httpsclient==0.3.2\r\noauth2client==2.0.2\r\npbr==1.9.1\r\nply==3.4\r\nproboscis==1.2.6.0\r\nprotobuf==3.0.0b2\r\npyOpenSSL==0.14\r\npyasn1==0.1.7\r\npyasn1-modules==0.0.5\r\npycparser==2.10\r\npycrypto==2.6.1\r\npycryptodome==3.4\r\npyserial==2.6\r\npython-apt==0.9.3.12\r\npython-dateutil==2.5.3\r\npython-libtorrent==1.0.5\r\npyxdg==0.25\r\nrequests==2.4.3\r\nrsa==3.4.2\r\nservice-identity==1.0.0\r\nsix==1.8.0\r\nurllib3==1.9.1\r\nvalidictory==1.0.1\r\nwheel==0.24.0\r\nwsgiref==0.1.2\r\nzope.interface==4.1.1\r\n```"},"comment":{"url":"https://api.github.com/repos/simon-weber/gmusicapi/issues/comments/249166872","html_url":"https://github.com/simon-weber/gmusicapi/issues/452#issuecomment-249166872","issue_url":"https://api.github.com/repos/simon-weber/gmusicapi/issues/452","id":249166872,"user":{"login":"thebigmunch","id":118418,"avatar_url":"https://avatars.githubusercontent.com/u/118418?v=3","gravatar_id":"","url":"https://api.github.com/users/thebigmunch","html_url":"https://github.com/thebigmunch","followers_url":"https://api.github.com/users/thebigmunch/followers","following_url":"https://api.github.com/users/thebigmunch/following{/other_user}","gists_url":"https://api.github.com/users/thebigmunch/gists{/gist_id}","starred_url":"https://api.github.com/users/thebigmunch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thebigmunch/subscriptions","organizations_url":"https://api.github.com/users/thebigmunch/orgs","repos_url":"https://api.github.com/users/thebigmunch/repos","events_url":"https://api.github.com/users/thebigmunch/events{/privacy}","received_events_url":"https://api.github.com/users/thebigmunch/received_events","type":"User","site_admin":false},"created_at":"2016-09-23T11:22:07Z","updated_at":"2016-09-23T11:22:07Z","body":"So I've run down the starting point of this in gmusicapi. I think this is something we could be able to work around on our end since it seems like protobuf is having an issue with a Python 3-like bytes object appearing on Python 2, namely the difference in indexing. I think we also end up butting our head against a protobuf issue I found. Protobuf has an open issue regarding bytearray support on Python 2, which has the same indexing behavior as bytes on Python 3.\r\n\r\nSo, I'll look into what the proper solution will be for gmusicapi this weekend."}}
{"actor":{"display_login":"thebigmunch"}}