{"action":"created","issue":{"url":"https://api.github.com/repos/mtth/hdfs/issues/11","labels_url":"https://api.github.com/repos/mtth/hdfs/issues/11/labels{/name}","comments_url":"https://api.github.com/repos/mtth/hdfs/issues/11/comments","events_url":"https://api.github.com/repos/mtth/hdfs/issues/11/events","html_url":"https://github.com/mtth/hdfs/issues/11","id":58248360,"number":11,"title":"% in file names need to be automatically URL encoded","user":{"login":"opsmekanix","id":1399795,"avatar_url":"https://avatars.githubusercontent.com/u/1399795?v=3","gravatar_id":"","url":"https://api.github.com/users/opsmekanix","html_url":"https://github.com/opsmekanix","followers_url":"https://api.github.com/users/opsmekanix/followers","following_url":"https://api.github.com/users/opsmekanix/following{/other_user}","gists_url":"https://api.github.com/users/opsmekanix/gists{/gist_id}","starred_url":"https://api.github.com/users/opsmekanix/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/opsmekanix/subscriptions","organizations_url":"https://api.github.com/users/opsmekanix/orgs","repos_url":"https://api.github.com/users/opsmekanix/repos","events_url":"https://api.github.com/users/opsmekanix/events{/privacy}","received_events_url":"https://api.github.com/users/opsmekanix/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-02-19T18:28:30Z","updated_at":"2015-02-20T20:47:22Z","closed_at":"2015-02-20T20:47:22Z","body":"If I try to access a file with a percent in the filename, I need to manually url encode the % sign, otherwise I get a 500 response from the webhdfs API as %'s are reserved characters.  RFC 3986 Section 2.1 talks about percent encoding url characters. \r\n\r\n-=-=-=-=-=-=-\r\nFile name with %\r\n  Note: the blank error string showing the exception is not being caught.   \r\n-=-=-=-=-=-=-\r\nINFO:hdfs.client:<KerberosClient(url=http://mynamnodeserver01.example.com:50070, root=/home/opsmekanix)> :: Uploading /var/tmp/bigfile to /home/opsmekanix/bigfil%e.\r\nINFO:hdfs.client:<KerberosClient(url=http://mynamnodeserver01.example.com:50070, root=/home/opsmekanix)> :: Writing to /home/opsmekanix/bigfil%e.\r\nDEBUG:hdfs.client:<KerberosClient(url=http://mynamnodeserver01.example.com:50070, root=/home/opsmekanix)> :: Resolved path /home/opsmekanix/bigfil%e to /home/opsmekanix/bigfil%e.\r\nINFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): mynamnodeserver01.example.com\r\nDEBUG:requests.packages.urllib3.connectionpool:\"PUT /webhdfs/v1/home/opsmekanix/bigfil%e?overwrite=False&op=CREATE HTTP/1.1\" 401 0\r\nDEBUG:requests_kerberos.kerberos_:handle_401(): Handling: 401\r\nDEBUG:requests_kerberos.kerberos_:authenticate_user(): Authorization header: Negotiate YIICXwYJKoZIhvc ... ommited header here ... SQZ8qie6jMeIlxS7+ZaW186FDpdDrDYLa9BigK9qhT3qRXx7R0=\r\nDEBUG:requests.packages.urllib3.connectionpool:\"PUT /webhdfs/v1/home/opsmekanix/bigfil%e?overwrite=False&op=CREATE HTTP/1.1\" 500 0\r\nDEBUG:requests_kerberos.kerberos_:authenticate_user(): returning <Response [500]>\r\nDEBUG:requests_kerberos.kerberos_:handle_401(): returning <Response [500]>\r\nDEBUG:requests_kerberos.kerberos_:handle_response(): returning <Response [500]>\r\nDEBUG:requests_kerberos.kerberos_:handle_other(): Handling: 500\r\nDEBUG:requests_kerberos.kerberos_:handle_other(): Authenticating the server\r\nDEBUG:requests_kerberos.kerberos_:authenticate_server(): Authenticate header: YGYGCSqGSIb3EgECAgIAb1cwVaADAgEFoQMCAQ+iSTBHoAMCAReiQAQ+G5 ... ommitted header here ... NH6V8mO0OGfmbAxIYfpyIXyaeG8Xikdo8SQbry27Fiui0=\r\nDEBUG:requests_kerberos.kerberos_:authenticate_server(): returning <Response [500]>\r\nDEBUG:requests_kerberos.kerberos_:handle_other(): returning <Response [500]>\r\nDEBUG:requests_kerberos.kerberos_:handle_response(): returning <Response [500]>\r\nWARNING:hdfs.client:<KerberosClient(url=http://mynamnodeserver01.example.com:50070, root=/home/opsmekanix)> :: [500] /webhdfs/v1/home/opsmekanix/bigfil%e?overwrite=False&op=CREATE:\r\n\r\nERROR:\r\n\r\n\r\n-=-=-=-=-=-=-\r\nFile name where percent is represnted as %26\r\n    Note: I controll-c'd out of this request as I don't actually care about uploading the file\r\n-=-=-=-=-=-=-\r\nINFO:hdfs.client:<KerberosClient(url=http://mynamnodeserver01.example.com:50070, root=/home/opsmekanix)> :: Uploading /var/tmp/bigfile to /home/opsmekanix/bigfil%26e.\r\nINFO:hdfs.client:<KerberosClient(url=http://mynamnodeserver01.example.com:50070, root=/home/opsmekanix)> :: Writing to /home/opsmekanix/bigfil%26e.\r\nDEBUG:hdfs.client:<KerberosClient(url=http://mynamnodeserver01.example.com:50070, root=/home/opsmekanix)> :: Resolved path /home/opsmekanix/bigfil%26e to /home/opsmekanix/bigfil%26e.\r\nINFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): mynamnodeserver01.example.com\r\nDEBUG:requests.packages.urllib3.connectionpool:\"PUT /webhdfs/v1/home/opsmekanix/bigfil%26e?overwrite=False&op=CREATE HTTP/1.1\" 401 0\r\nDEBUG:requests_kerberos.kerberos_:handle_401(): Handling: 401\r\nDEBUG:requests_kerberos.kerberos_:authenticate_user(): Authorization header: Negotiate YIICXwYJKoZIhvc ... ommited header here ... SQZ8qie6jMeIlxS7+ZaW186FDpdDrDYLa9BigK9qhT3qRXx7R0=\r\nDEBUG:requests.packages.urllib3.connectionpool:\"PUT /webhdfs/v1/home/opsmekanix/bigfil%26e?overwrite=False&op=CREATE HTTP/1.1\" 307 0\r\nDEBUG:requests_kerberos.kerberos_:authenticate_user(): returning <Response [307]>\r\nDEBUG:requests_kerberos.kerberos_:handle_401(): returning <Response [307]>\r\nDEBUG:requests_kerberos.kerberos_:handle_response(): returning <Response [307]>\r\nDEBUG:requests_kerberos.kerberos_:handle_other(): Handling: 307\r\nDEBUG:requests_kerberos.kerberos_:handle_other(): Authenticating the server\r\nDEBUG:requests_kerberos.kerberos_:authenticate_server(): Authenticate header: YGYGCSqGSIb3EgECAgIAb1cwVaADAgEFoQMCAQ+iSTBHoAMCAReiQAQ+G5 ... ommitted header here ... NH6V8mO0OGfmbAxIYfpyIXyaeG8Xikdo8SQbry27Fiui0=\r\nDEBUG:requests_kerberos.kerberos_:authenticate_server(): returning <Response [307]>\r\nDEBUG:requests_kerberos.kerberos_:handle_other(): returning <Response [307]>\r\nDEBUG:requests_kerberos.kerberos_:handle_response(): returning <Response [307]>\r\nDEBUG:hdfs.client:<KerberosClient(url=http://mynamnodeserver01.example.com:50070, root=/home/opsmekanix)> :: [307] /webhdfs/v1/home/opsmekanixbigfil%26e?overwrite=False&op=CREATE\r\nINFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): mydatanode123.example.com\r\n^CTraceback (most recent call last):\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/mtth/hdfs/issues/comments/75316397","html_url":"https://github.com/mtth/hdfs/issues/11#issuecomment-75316397","issue_url":"https://api.github.com/repos/mtth/hdfs/issues/11","id":75316397,"user":{"login":"mtth","id":1216372,"avatar_url":"https://avatars.githubusercontent.com/u/1216372?v=3","gravatar_id":"","url":"https://api.github.com/users/mtth","html_url":"https://github.com/mtth","followers_url":"https://api.github.com/users/mtth/followers","following_url":"https://api.github.com/users/mtth/following{/other_user}","gists_url":"https://api.github.com/users/mtth/gists{/gist_id}","starred_url":"https://api.github.com/users/mtth/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mtth/subscriptions","organizations_url":"https://api.github.com/users/mtth/orgs","repos_url":"https://api.github.com/users/mtth/repos","events_url":"https://api.github.com/users/mtth/events{/privacy}","received_events_url":"https://api.github.com/users/mtth/received_events","type":"User","site_admin":false},"created_at":"2015-02-20T20:47:22Z","updated_at":"2015-02-20T20:47:22Z","body":"Addressed in 25f2c7a (version `>= 0.3.2`). Note that you might still get occasional errors with filenames that have `%` characters (cf. above comment)."}}