{"action":"created","comment":{"url":"https://api.github.com/repos/elixir-lang/elixir/pulls/comments/41965542","id":41965542,"diff_hunk":"@@ -591,7 +591,12 @@ defmodule List do\n   \"\"\"\n   @spec to_string(:unicode.charlist) :: String.t\n   def to_string(list) when is_list(list) do\n-    case :unicode.characters_to_binary(list) do\n+    try do\n+       :unicode.characters_to_binary(list)\n+    rescue\n+      ArgumentError ->\n+        raise ArgumentError, \"cannot make this list into a string (use 'inspect(list)' for its internal representation as a string)\"","path":"lib/elixir/lib/list.ex","position":9,"original_position":9,"commit_id":"195d013290e22f94fd46b124e5e8ccab2c99f417","original_commit_id":"195d013290e22f94fd46b124e5e8ccab2c99f417","user":{"login":"josevalim","id":9582,"avatar_url":"https://avatars.githubusercontent.com/u/9582?v=3","gravatar_id":"","url":"https://api.github.com/users/josevalim","html_url":"https://github.com/josevalim","followers_url":"https://api.github.com/users/josevalim/followers","following_url":"https://api.github.com/users/josevalim/following{/other_user}","gists_url":"https://api.github.com/users/josevalim/gists{/gist_id}","starred_url":"https://api.github.com/users/josevalim/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/josevalim/subscriptions","organizations_url":"https://api.github.com/users/josevalim/orgs","repos_url":"https://api.github.com/users/josevalim/repos","events_url":"https://api.github.com/users/josevalim/events{/privacy}","received_events_url":"https://api.github.com/users/josevalim/received_events","type":"User","site_admin":false},"body":"Good direction! I would go with:\r\n\r\n    cannot convert list to string. The list must contain only integers, strings or a list of such lists, got: [:a]","created_at":"2015-10-14T08:12:17Z","updated_at":"2015-10-14T08:12:17Z","html_url":"https://github.com/elixir-lang/elixir/pull/3865#discussion_r41965542","pull_request_url":"https://api.github.com/repos/elixir-lang/elixir/pulls/3865","_links":{"self":{"href":"https://api.github.com/repos/elixir-lang/elixir/pulls/comments/41965542"},"html":{"href":"https://github.com/elixir-lang/elixir/pull/3865#discussion_r41965542"},"pull_request":{"href":"https://api.github.com/repos/elixir-lang/elixir/pulls/3865"}}},"pull_request":{"url":"https://api.github.com/repos/elixir-lang/elixir/pulls/3865","id":47568831,"html_url":"https://github.com/elixir-lang/elixir/pull/3865","diff_url":"https://github.com/elixir-lang/elixir/pull/3865.diff","patch_url":"https://github.com/elixir-lang/elixir/pull/3865.patch","issue_url":"https://api.github.com/repos/elixir-lang/elixir/issues/3865","number":3865,"state":"open","locked":false,"title":"More helpful error for keyword list to_string","user":{"login":"henrik","id":216,"avatar_url":"https://avatars.githubusercontent.com/u/216?v=3","gravatar_id":"","url":"https://api.github.com/users/henrik","html_url":"https://github.com/henrik","followers_url":"https://api.github.com/users/henrik/followers","following_url":"https://api.github.com/users/henrik/following{/other_user}","gists_url":"https://api.github.com/users/henrik/gists{/gist_id}","starred_url":"https://api.github.com/users/henrik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/henrik/subscriptions","organizations_url":"https://api.github.com/users/henrik/orgs","repos_url":"https://api.github.com/users/henrik/repos","events_url":"https://api.github.com/users/henrik/events{/privacy}","received_events_url":"https://api.github.com/users/henrik/received_events","type":"User","site_admin":false},"body":"Replaces the confusing \":unicode.characters_to_binary([a: 1])\" error you would get when interpolating a keyword list. Developers used to Ruby may expect this to just work.\r\n\r\nAs discussed here: https://groups.google.com/forum/#!topic/elixir-lang-core/ZmxsVo4JO5E","created_at":"2015-10-13T18:17:45Z","updated_at":"2015-10-14T08:12:17Z","closed_at":null,"merged_at":null,"merge_commit_sha":"20e968cfcf1d3a7f0a9b609844b8cb77cc1773e6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/elixir-lang/elixir/pulls/3865/commits","review_comments_url":"https://api.github.com/repos/elixir-lang/elixir/pulls/3865/comments","review_comment_url":"https://api.github.com/repos/elixir-lang/elixir/pulls/comments{/number}","comments_url":"https://api.github.com/repos/elixir-lang/elixir/issues/3865/comments","statuses_url":"https://api.github.com/repos/elixir-lang/elixir/statuses/195d013290e22f94fd46b124e5e8ccab2c99f417","head":{"label":"henrik:keyword-list-to-string","ref":"keyword-list-to-string","sha":"195d013290e22f94fd46b124e5e8ccab2c99f417","user":{"login":"henrik","id":216,"avatar_url":"https://avatars.githubusercontent.com/u/216?v=3","gravatar_id":"","url":"https://api.github.com/users/henrik","html_url":"https://github.com/henrik","followers_url":"https://api.github.com/users/henrik/followers","following_url":"https://api.github.com/users/henrik/following{/other_user}","gists_url":"https://api.github.com/users/henrik/gists{/gist_id}","starred_url":"https://api.github.com/users/henrik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/henrik/subscriptions","organizations_url":"https://api.github.com/users/henrik/orgs","repos_url":"https://api.github.com/users/henrik/repos","events_url":"https://api.github.com/users/henrik/events{/privacy}","received_events_url":"https://api.github.com/users/henrik/received_events","type":"User","site_admin":false},"repo":{"id":37819652,"name":"elixir","full_name":"henrik/elixir","owner":{"login":"henrik","id":216,"avatar_url":"https://avatars.githubusercontent.com/u/216?v=3","gravatar_id":"","url":"https://api.github.com/users/henrik","html_url":"https://github.com/henrik","followers_url":"https://api.github.com/users/henrik/followers","following_url":"https://api.github.com/users/henrik/following{/other_user}","gists_url":"https://api.github.com/users/henrik/gists{/gist_id}","starred_url":"https://api.github.com/users/henrik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/henrik/subscriptions","organizations_url":"https://api.github.com/users/henrik/orgs","repos_url":"https://api.github.com/users/henrik/repos","events_url":"https://api.github.com/users/henrik/events{/privacy}","received_events_url":"https://api.github.com/users/henrik/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/henrik/elixir","description":"Elixir is a dynamic, functional language designed for building scalable and maintainable applications","fork":true,"url":"https://api.github.com/repos/henrik/elixir","forks_url":"https://api.github.com/repos/henrik/elixir/forks","keys_url":"https://api.github.com/repos/henrik/elixir/keys{/key_id}","collaborators_url":"https://api.github.com/repos/henrik/elixir/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/henrik/elixir/teams","hooks_url":"https://api.github.com/repos/henrik/elixir/hooks","issue_events_url":"https://api.github.com/repos/henrik/elixir/issues/events{/number}","events_url":"https://api.github.com/repos/henrik/elixir/events","assignees_url":"https://api.github.com/repos/henrik/elixir/assignees{/user}","branches_url":"https://api.github.com/repos/henrik/elixir/branches{/branch}","tags_url":"https://api.github.com/repos/henrik/elixir/tags","blobs_url":"https://api.github.com/repos/henrik/elixir/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/henrik/elixir/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/henrik/elixir/git/refs{/sha}","trees_url":"https://api.github.com/repos/henrik/elixir/git/trees{/sha}","statuses_url":"https://api.github.com/repos/henrik/elixir/statuses/{sha}","languages_url":"https://api.github.com/repos/henrik/elixir/languages","stargazers_url":"https://api.github.com/repos/henrik/elixir/stargazers","contributors_url":"https://api.github.com/repos/henrik/elixir/contributors","subscribers_url":"https://api.github.com/repos/henrik/elixir/subscribers","subscription_url":"https://api.github.com/repos/henrik/elixir/subscription","commits_url":"https://api.github.com/repos/henrik/elixir/commits{/sha}","git_commits_url":"https://api.github.com/repos/henrik/elixir/git/commits{/sha}","comments_url":"https://api.github.com/repos/henrik/elixir/comments{/number}","issue_comment_url":"https://api.github.com/repos/henrik/elixir/issues/comments{/number}","contents_url":"https://api.github.com/repos/henrik/elixir/contents/{+path}","compare_url":"https://api.github.com/repos/henrik/elixir/compare/{base}...{head}","merges_url":"https://api.github.com/repos/henrik/elixir/merges","archive_url":"https://api.github.com/repos/henrik/elixir/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/henrik/elixir/downloads","issues_url":"https://api.github.com/repos/henrik/elixir/issues{/number}","pulls_url":"https://api.github.com/repos/henrik/elixir/pulls{/number}","milestones_url":"https://api.github.com/repos/henrik/elixir/milestones{/number}","notifications_url":"https://api.github.com/repos/henrik/elixir/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/henrik/elixir/labels{/name}","releases_url":"https://api.github.com/repos/henrik/elixir/releases{/id}","created_at":"2015-06-21T18:03:11Z","updated_at":"2015-06-21T18:03:14Z","pushed_at":"2015-10-13T19:51:06Z","git_url":"git://github.com/henrik/elixir.git","ssh_url":"git@github.com:henrik/elixir.git","clone_url":"https://github.com/henrik/elixir.git","svn_url":"https://github.com/henrik/elixir","homepage":"http://elixir-lang.org/","size":31192,"stargazers_count":0,"watchers_count":0,"language":"Elixir","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"elixir-lang:master","ref":"master","sha":"d5a0db2940c7761fff13efae6196d36dd08168b9","user":{"login":"elixir-lang","id":1481354,"avatar_url":"https://avatars.githubusercontent.com/u/1481354?v=3","gravatar_id":"","url":"https://api.github.com/users/elixir-lang","html_url":"https://github.com/elixir-lang","followers_url":"https://api.github.com/users/elixir-lang/followers","following_url":"https://api.github.com/users/elixir-lang/following{/other_user}","gists_url":"https://api.github.com/users/elixir-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/elixir-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elixir-lang/subscriptions","organizations_url":"https://api.github.com/users/elixir-lang/orgs","repos_url":"https://api.github.com/users/elixir-lang/repos","events_url":"https://api.github.com/users/elixir-lang/events{/privacy}","received_events_url":"https://api.github.com/users/elixir-lang/received_events","type":"Organization","site_admin":false},"repo":{"id":1234714,"name":"elixir","full_name":"elixir-lang/elixir","owner":{"login":"elixir-lang","id":1481354,"avatar_url":"https://avatars.githubusercontent.com/u/1481354?v=3","gravatar_id":"","url":"https://api.github.com/users/elixir-lang","html_url":"https://github.com/elixir-lang","followers_url":"https://api.github.com/users/elixir-lang/followers","following_url":"https://api.github.com/users/elixir-lang/following{/other_user}","gists_url":"https://api.github.com/users/elixir-lang/gists{/gist_id}","starred_url":"https://api.github.com/users/elixir-lang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/elixir-lang/subscriptions","organizations_url":"https://api.github.com/users/elixir-lang/orgs","repos_url":"https://api.github.com/users/elixir-lang/repos","events_url":"https://api.github.com/users/elixir-lang/events{/privacy}","received_events_url":"https://api.github.com/users/elixir-lang/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/elixir-lang/elixir","description":"Elixir is a dynamic, functional language designed for building scalable and maintainable applications","fork":false,"url":"https://api.github.com/repos/elixir-lang/elixir","forks_url":"https://api.github.com/repos/elixir-lang/elixir/forks","keys_url":"https://api.github.com/repos/elixir-lang/elixir/keys{/key_id}","collaborators_url":"https://api.github.com/repos/elixir-lang/elixir/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/elixir-lang/elixir/teams","hooks_url":"https://api.github.com/repos/elixir-lang/elixir/hooks","issue_events_url":"https://api.github.com/repos/elixir-lang/elixir/issues/events{/number}","events_url":"https://api.github.com/repos/elixir-lang/elixir/events","assignees_url":"https://api.github.com/repos/elixir-lang/elixir/assignees{/user}","branches_url":"https://api.github.com/repos/elixir-lang/elixir/branches{/branch}","tags_url":"https://api.github.com/repos/elixir-lang/elixir/tags","blobs_url":"https://api.github.com/repos/elixir-lang/elixir/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/elixir-lang/elixir/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/elixir-lang/elixir/git/refs{/sha}","trees_url":"https://api.github.com/repos/elixir-lang/elixir/git/trees{/sha}","statuses_url":"https://api.github.com/repos/elixir-lang/elixir/statuses/{sha}","languages_url":"https://api.github.com/repos/elixir-lang/elixir/languages","stargazers_url":"https://api.github.com/repos/elixir-lang/elixir/stargazers","contributors_url":"https://api.github.com/repos/elixir-lang/elixir/contributors","subscribers_url":"https://api.github.com/repos/elixir-lang/elixir/subscribers","subscription_url":"https://api.github.com/repos/elixir-lang/elixir/subscription","commits_url":"https://api.github.com/repos/elixir-lang/elixir/commits{/sha}","git_commits_url":"https://api.github.com/repos/elixir-lang/elixir/git/commits{/sha}","comments_url":"https://api.github.com/repos/elixir-lang/elixir/comments{/number}","issue_comment_url":"https://api.github.com/repos/elixir-lang/elixir/issues/comments{/number}","contents_url":"https://api.github.com/repos/elixir-lang/elixir/contents/{+path}","compare_url":"https://api.github.com/repos/elixir-lang/elixir/compare/{base}...{head}","merges_url":"https://api.github.com/repos/elixir-lang/elixir/merges","archive_url":"https://api.github.com/repos/elixir-lang/elixir/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/elixir-lang/elixir/downloads","issues_url":"https://api.github.com/repos/elixir-lang/elixir/issues{/number}","pulls_url":"https://api.github.com/repos/elixir-lang/elixir/pulls{/number}","milestones_url":"https://api.github.com/repos/elixir-lang/elixir/milestones{/number}","notifications_url":"https://api.github.com/repos/elixir-lang/elixir/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/elixir-lang/elixir/labels{/name}","releases_url":"https://api.github.com/repos/elixir-lang/elixir/releases{/id}","created_at":"2011-01-09T08:43:57Z","updated_at":"2015-10-14T05:32:22Z","pushed_at":"2015-10-13T21:21:00Z","git_url":"git://github.com/elixir-lang/elixir.git","ssh_url":"git@github.com:elixir-lang/elixir.git","clone_url":"https://github.com/elixir-lang/elixir.git","svn_url":"https://github.com/elixir-lang/elixir","homepage":"http://elixir-lang.org/","size":51331,"stargazers_count":5081,"watchers_count":5081,"language":"Elixir","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":689,"mirror_url":null,"open_issues_count":54,"forks":689,"open_issues":54,"watchers":5081,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/elixir-lang/elixir/pulls/3865"},"html":{"href":"https://github.com/elixir-lang/elixir/pull/3865"},"issue":{"href":"https://api.github.com/repos/elixir-lang/elixir/issues/3865"},"comments":{"href":"https://api.github.com/repos/elixir-lang/elixir/issues/3865/comments"},"review_comments":{"href":"https://api.github.com/repos/elixir-lang/elixir/pulls/3865/comments"},"review_comment":{"href":"https://api.github.com/repos/elixir-lang/elixir/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/elixir-lang/elixir/pulls/3865/commits"},"statuses":{"href":"https://api.github.com/repos/elixir-lang/elixir/statuses/195d013290e22f94fd46b124e5e8ccab2c99f417"}}}}