{"action":"created","comment":{"url":"https://api.github.com/repos/rg3/youtube-dl/pulls/comments/36108250","id":36108250,"diff_hunk":"@@ -1291,6 +1290,25 @@ def process_info(self, info_dict):\n             self.report_error('unable to create directory ' + compat_str(err))\n             return\n \n+        filesystem_enc = get_filesystem_encoding()\n+        if filesystem_enc is None:\n+            filesystem_enc = 'utf-8'\n+        max_filename_len = 200\n+        if hasattr(os, 'pathconf') and hasattr(os, 'pathconf_names'):\n+            try:\n+                max_filename_len = int(os.pathconf(os.path.abspath(dn), os.pathconf_names['PC_NAME_MAX']))\n+            except OSError as err:\n+                self.report_error('the system does not support PC_NAME_MAX ' + compat_str(err))\n+        if len((info_dict['title'] + '.part.' + info_dict['ext']).encode(filesystem_enc)) > max_filename_len:\n+            trun_len = max_filename_len - len(('....part.' + info_dict['ext']).encode(filesystem_enc))\n+            decoded = False\n+            while not decoded:","path":"youtube_dl/YoutubeDL.py","position":33,"original_position":33,"commit_id":"c167cf17bb8ce23941fb04c479ed5f265b1a979b","original_commit_id":"c167cf17bb8ce23941fb04c479ed5f265b1a979b","user":{"login":"jaimeMF","id":1239727,"avatar_url":"https://avatars.githubusercontent.com/u/1239727?v=3","gravatar_id":"","url":"https://api.github.com/users/jaimeMF","html_url":"https://github.com/jaimeMF","followers_url":"https://api.github.com/users/jaimeMF/followers","following_url":"https://api.github.com/users/jaimeMF/following{/other_user}","gists_url":"https://api.github.com/users/jaimeMF/gists{/gist_id}","starred_url":"https://api.github.com/users/jaimeMF/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jaimeMF/subscriptions","organizations_url":"https://api.github.com/users/jaimeMF/orgs","repos_url":"https://api.github.com/users/jaimeMF/repos","events_url":"https://api.github.com/users/jaimeMF/events{/privacy}","received_events_url":"https://api.github.com/users/jaimeMF/received_events","type":"User","site_admin":false},"body":"why don't you do:\r\n```python\r\nwhile True:\r\n    try:\r\n       info_dict['title'] = ...\r\n   except ...:\r\n     trun_len -= 1\r\n   break\r\n```\r\n?","created_at":"2015-08-03T17:25:32Z","updated_at":"2015-08-03T17:25:32Z","html_url":"https://github.com/rg3/youtube-dl/pull/6442#discussion_r36108250","pull_request_url":"https://api.github.com/repos/rg3/youtube-dl/pulls/6442","_links":{"self":{"href":"https://api.github.com/repos/rg3/youtube-dl/pulls/comments/36108250"},"html":{"href":"https://github.com/rg3/youtube-dl/pull/6442#discussion_r36108250"},"pull_request":{"href":"https://api.github.com/repos/rg3/youtube-dl/pulls/6442"}}},"pull_request":{"url":"https://api.github.com/repos/rg3/youtube-dl/pulls/6442","id":41428264,"html_url":"https://github.com/rg3/youtube-dl/pull/6442","diff_url":"https://github.com/rg3/youtube-dl/pull/6442.diff","patch_url":"https://github.com/rg3/youtube-dl/pull/6442.patch","issue_url":"https://api.github.com/repos/rg3/youtube-dl/issues/6442","number":6442,"state":"open","locked":false,"title":"[YoutubeDL] check for NAME_MAX on linux systems","user":{"login":"remitamine","id":10879694,"avatar_url":"https://avatars.githubusercontent.com/u/10879694?v=3","gravatar_id":"","url":"https://api.github.com/users/remitamine","html_url":"https://github.com/remitamine","followers_url":"https://api.github.com/users/remitamine/followers","following_url":"https://api.github.com/users/remitamine/following{/other_user}","gists_url":"https://api.github.com/users/remitamine/gists{/gist_id}","starred_url":"https://api.github.com/users/remitamine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/remitamine/subscriptions","organizations_url":"https://api.github.com/users/remitamine/orgs","repos_url":"https://api.github.com/users/remitamine/repos","events_url":"https://api.github.com/users/remitamine/events{/privacy}","received_events_url":"https://api.github.com/users/remitamine/received_events","type":"User","site_admin":false},"body":"related to this issue https://github.com/rg3/youtube-dl/issues/5908.","created_at":"2015-08-03T00:50:07Z","updated_at":"2015-08-03T17:25:32Z","closed_at":null,"merged_at":null,"merge_commit_sha":"3eb2e7eb06216e4d944c6fb245100c27300b6f78","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/rg3/youtube-dl/pulls/6442/commits","review_comments_url":"https://api.github.com/repos/rg3/youtube-dl/pulls/6442/comments","review_comment_url":"https://api.github.com/repos/rg3/youtube-dl/pulls/comments{/number}","comments_url":"https://api.github.com/repos/rg3/youtube-dl/issues/6442/comments","statuses_url":"https://api.github.com/repos/rg3/youtube-dl/statuses/c167cf17bb8ce23941fb04c479ed5f265b1a979b","head":{"label":"remitamine:max_filename_len","ref":"max_filename_len","sha":"c167cf17bb8ce23941fb04c479ed5f265b1a979b","user":{"login":"remitamine","id":10879694,"avatar_url":"https://avatars.githubusercontent.com/u/10879694?v=3","gravatar_id":"","url":"https://api.github.com/users/remitamine","html_url":"https://github.com/remitamine","followers_url":"https://api.github.com/users/remitamine/followers","following_url":"https://api.github.com/users/remitamine/following{/other_user}","gists_url":"https://api.github.com/users/remitamine/gists{/gist_id}","starred_url":"https://api.github.com/users/remitamine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/remitamine/subscriptions","organizations_url":"https://api.github.com/users/remitamine/orgs","repos_url":"https://api.github.com/users/remitamine/repos","events_url":"https://api.github.com/users/remitamine/events{/privacy}","received_events_url":"https://api.github.com/users/remitamine/received_events","type":"User","site_admin":false},"repo":{"id":37925718,"name":"youtube-dl","full_name":"remitamine/youtube-dl","owner":{"login":"remitamine","id":10879694,"avatar_url":"https://avatars.githubusercontent.com/u/10879694?v=3","gravatar_id":"","url":"https://api.github.com/users/remitamine","html_url":"https://github.com/remitamine","followers_url":"https://api.github.com/users/remitamine/followers","following_url":"https://api.github.com/users/remitamine/following{/other_user}","gists_url":"https://api.github.com/users/remitamine/gists{/gist_id}","starred_url":"https://api.github.com/users/remitamine/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/remitamine/subscriptions","organizations_url":"https://api.github.com/users/remitamine/orgs","repos_url":"https://api.github.com/users/remitamine/repos","events_url":"https://api.github.com/users/remitamine/events{/privacy}","received_events_url":"https://api.github.com/users/remitamine/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/remitamine/youtube-dl","description":"Small command-line program to download videos from YouTube.com and other video sites","fork":true,"url":"https://api.github.com/repos/remitamine/youtube-dl","forks_url":"https://api.github.com/repos/remitamine/youtube-dl/forks","keys_url":"https://api.github.com/repos/remitamine/youtube-dl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/remitamine/youtube-dl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/remitamine/youtube-dl/teams","hooks_url":"https://api.github.com/repos/remitamine/youtube-dl/hooks","issue_events_url":"https://api.github.com/repos/remitamine/youtube-dl/issues/events{/number}","events_url":"https://api.github.com/repos/remitamine/youtube-dl/events","assignees_url":"https://api.github.com/repos/remitamine/youtube-dl/assignees{/user}","branches_url":"https://api.github.com/repos/remitamine/youtube-dl/branches{/branch}","tags_url":"https://api.github.com/repos/remitamine/youtube-dl/tags","blobs_url":"https://api.github.com/repos/remitamine/youtube-dl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/remitamine/youtube-dl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/remitamine/youtube-dl/git/refs{/sha}","trees_url":"https://api.github.com/repos/remitamine/youtube-dl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/remitamine/youtube-dl/statuses/{sha}","languages_url":"https://api.github.com/repos/remitamine/youtube-dl/languages","stargazers_url":"https://api.github.com/repos/remitamine/youtube-dl/stargazers","contributors_url":"https://api.github.com/repos/remitamine/youtube-dl/contributors","subscribers_url":"https://api.github.com/repos/remitamine/youtube-dl/subscribers","subscription_url":"https://api.github.com/repos/remitamine/youtube-dl/subscription","commits_url":"https://api.github.com/repos/remitamine/youtube-dl/commits{/sha}","git_commits_url":"https://api.github.com/repos/remitamine/youtube-dl/git/commits{/sha}","comments_url":"https://api.github.com/repos/remitamine/youtube-dl/comments{/number}","issue_comment_url":"https://api.github.com/repos/remitamine/youtube-dl/issues/comments{/number}","contents_url":"https://api.github.com/repos/remitamine/youtube-dl/contents/{+path}","compare_url":"https://api.github.com/repos/remitamine/youtube-dl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/remitamine/youtube-dl/merges","archive_url":"https://api.github.com/repos/remitamine/youtube-dl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/remitamine/youtube-dl/downloads","issues_url":"https://api.github.com/repos/remitamine/youtube-dl/issues{/number}","pulls_url":"https://api.github.com/repos/remitamine/youtube-dl/pulls{/number}","milestones_url":"https://api.github.com/repos/remitamine/youtube-dl/milestones{/number}","notifications_url":"https://api.github.com/repos/remitamine/youtube-dl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/remitamine/youtube-dl/labels{/name}","releases_url":"https://api.github.com/repos/remitamine/youtube-dl/releases{/id}","created_at":"2015-06-23T14:59:19Z","updated_at":"2015-06-23T14:59:31Z","pushed_at":"2015-08-03T17:03:27Z","git_url":"git://github.com/remitamine/youtube-dl.git","ssh_url":"git@github.com:remitamine/youtube-dl.git","clone_url":"https://github.com/remitamine/youtube-dl.git","svn_url":"https://github.com/remitamine/youtube-dl","homepage":"http://rg3.github.io/youtube-dl/","size":33711,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"rg3:master","ref":"master","sha":"2a04d2c799153778b4652a701e83f1d6d211fbf1","user":{"login":"rg3","id":53487,"avatar_url":"https://avatars.githubusercontent.com/u/53487?v=3","gravatar_id":"","url":"https://api.github.com/users/rg3","html_url":"https://github.com/rg3","followers_url":"https://api.github.com/users/rg3/followers","following_url":"https://api.github.com/users/rg3/following{/other_user}","gists_url":"https://api.github.com/users/rg3/gists{/gist_id}","starred_url":"https://api.github.com/users/rg3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rg3/subscriptions","organizations_url":"https://api.github.com/users/rg3/orgs","repos_url":"https://api.github.com/users/rg3/repos","events_url":"https://api.github.com/users/rg3/events{/privacy}","received_events_url":"https://api.github.com/users/rg3/received_events","type":"User","site_admin":false},"repo":{"id":1039520,"name":"youtube-dl","full_name":"rg3/youtube-dl","owner":{"login":"rg3","id":53487,"avatar_url":"https://avatars.githubusercontent.com/u/53487?v=3","gravatar_id":"","url":"https://api.github.com/users/rg3","html_url":"https://github.com/rg3","followers_url":"https://api.github.com/users/rg3/followers","following_url":"https://api.github.com/users/rg3/following{/other_user}","gists_url":"https://api.github.com/users/rg3/gists{/gist_id}","starred_url":"https://api.github.com/users/rg3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rg3/subscriptions","organizations_url":"https://api.github.com/users/rg3/orgs","repos_url":"https://api.github.com/users/rg3/repos","events_url":"https://api.github.com/users/rg3/events{/privacy}","received_events_url":"https://api.github.com/users/rg3/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/rg3/youtube-dl","description":"Small command-line program to download videos from YouTube.com and other video sites","fork":false,"url":"https://api.github.com/repos/rg3/youtube-dl","forks_url":"https://api.github.com/repos/rg3/youtube-dl/forks","keys_url":"https://api.github.com/repos/rg3/youtube-dl/keys{/key_id}","collaborators_url":"https://api.github.com/repos/rg3/youtube-dl/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/rg3/youtube-dl/teams","hooks_url":"https://api.github.com/repos/rg3/youtube-dl/hooks","issue_events_url":"https://api.github.com/repos/rg3/youtube-dl/issues/events{/number}","events_url":"https://api.github.com/repos/rg3/youtube-dl/events","assignees_url":"https://api.github.com/repos/rg3/youtube-dl/assignees{/user}","branches_url":"https://api.github.com/repos/rg3/youtube-dl/branches{/branch}","tags_url":"https://api.github.com/repos/rg3/youtube-dl/tags","blobs_url":"https://api.github.com/repos/rg3/youtube-dl/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/rg3/youtube-dl/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/rg3/youtube-dl/git/refs{/sha}","trees_url":"https://api.github.com/repos/rg3/youtube-dl/git/trees{/sha}","statuses_url":"https://api.github.com/repos/rg3/youtube-dl/statuses/{sha}","languages_url":"https://api.github.com/repos/rg3/youtube-dl/languages","stargazers_url":"https://api.github.com/repos/rg3/youtube-dl/stargazers","contributors_url":"https://api.github.com/repos/rg3/youtube-dl/contributors","subscribers_url":"https://api.github.com/repos/rg3/youtube-dl/subscribers","subscription_url":"https://api.github.com/repos/rg3/youtube-dl/subscription","commits_url":"https://api.github.com/repos/rg3/youtube-dl/commits{/sha}","git_commits_url":"https://api.github.com/repos/rg3/youtube-dl/git/commits{/sha}","comments_url":"https://api.github.com/repos/rg3/youtube-dl/comments{/number}","issue_comment_url":"https://api.github.com/repos/rg3/youtube-dl/issues/comments{/number}","contents_url":"https://api.github.com/repos/rg3/youtube-dl/contents/{+path}","compare_url":"https://api.github.com/repos/rg3/youtube-dl/compare/{base}...{head}","merges_url":"https://api.github.com/repos/rg3/youtube-dl/merges","archive_url":"https://api.github.com/repos/rg3/youtube-dl/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/rg3/youtube-dl/downloads","issues_url":"https://api.github.com/repos/rg3/youtube-dl/issues{/number}","pulls_url":"https://api.github.com/repos/rg3/youtube-dl/pulls{/number}","milestones_url":"https://api.github.com/repos/rg3/youtube-dl/milestones{/number}","notifications_url":"https://api.github.com/repos/rg3/youtube-dl/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/rg3/youtube-dl/labels{/name}","releases_url":"https://api.github.com/repos/rg3/youtube-dl/releases{/id}","created_at":"2010-10-31T14:35:07Z","updated_at":"2015-08-03T17:22:25Z","pushed_at":"2015-08-03T17:03:34Z","git_url":"git://github.com/rg3/youtube-dl.git","ssh_url":"git@github.com:rg3/youtube-dl.git","clone_url":"https://github.com/rg3/youtube-dl.git","svn_url":"https://github.com/rg3/youtube-dl","homepage":"http://rg3.github.io/youtube-dl/","size":82331,"stargazers_count":10709,"watchers_count":10709,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":2150,"mirror_url":null,"open_issues_count":1191,"forks":2150,"open_issues":1191,"watchers":10709,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/rg3/youtube-dl/pulls/6442"},"html":{"href":"https://github.com/rg3/youtube-dl/pull/6442"},"issue":{"href":"https://api.github.com/repos/rg3/youtube-dl/issues/6442"},"comments":{"href":"https://api.github.com/repos/rg3/youtube-dl/issues/6442/comments"},"review_comments":{"href":"https://api.github.com/repos/rg3/youtube-dl/pulls/6442/comments"},"review_comment":{"href":"https://api.github.com/repos/rg3/youtube-dl/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/rg3/youtube-dl/pulls/6442/commits"},"statuses":{"href":"https://api.github.com/repos/rg3/youtube-dl/statuses/c167cf17bb8ce23941fb04c479ed5f265b1a979b"}}}}