sigma / gh.el

GitHub API library for Emacs
274 stars 74 forks source link

magit-gh-pulls and gist.el broken since commit e227f19803ef15f17b772e4b23e028ed34071f71 #76

Closed travisbhartwell closed 8 years ago

travisbhartwell commented 8 years ago

I use Spacemacs and thus the latest packages from MELPA. I fetched the latest packages from MELPA a few days ago and both gist.el and magit-gh-pulls stopped working.

I was able to get them working by rolling back the revision of gh.el used to 248ac04ac1ab0458453f4af52672768fcf8670ec.

With the latest from MELPA installed, I get this backtrace (after toggle-debug-on-error) when running gist-list (and similarly when trying to use magit-gh-pulls functionality):

Debugger entered--Lisp error: (wrong-type-argument listp "https://developer.github.com/v3")
  signal(wrong-type-argument (listp "https://developer.github.com/v3"))
  (if (or (null num) (zerop num)) (signal (car err) (cdr err)) (eieio-oset req (quote :num-retries) (1- num)) (gh-url-run-request req resp))
  (let ((num (eieio-oref req (quote :num-retries)))) (if (or (null num) (zerop num)) (signal (car err) (cdr err)) (eieio-oset req (quote :num-retries) (1- num)) (gh-url-run-request req resp)))
  (condition-case err (let ((responses-req (clone req))) (eieio-oset resp (quote :-req) responses-req) (gh-url-response-init resp (current-buffer))) (error (let ((num (eieio-oref req (quote :num-retries)))) (if (or (null num) (zerop num)) (signal (car err) (cdr err)) (eieio-oset req (quote :num-retries) (1- num)) (gh-url-run-request req resp)))))
  (let* ((--cl-rest-- req-resp) (req (if (= (length --cl-rest--) 2) (car-safe (prog1 --cl-rest-- (setq --cl-rest-- (cdr --cl-rest--)))) (signal (quote wrong-number-of-arguments) (list nil (length --cl-rest--))))) (resp (car --cl-rest--))) (condition-case err (let ((responses-req (clone req))) (eieio-oset resp (quote :-req) responses-req) (gh-url-response-init resp (current-buffer))) (error (let ((num (eieio-oref req (quote :num-retries)))) (if (or (null num) (zerop num)) (signal (car err) (cdr err)) (eieio-oset req (quote :num-retries) (1- num)) (gh-url-run-request req resp))))))
  (progn (let* ((--cl-rest-- req-resp) (req (if (= (length --cl-rest--) 2) (car-safe (prog1 --cl-rest-- (setq --cl-rest-- ...))) (signal (quote wrong-number-of-arguments) (list nil (length --cl-rest--))))) (resp (car --cl-rest--))) (condition-case err (let ((responses-req (clone req))) (eieio-oset resp (quote :-req) responses-req) (gh-url-response-init resp (current-buffer))) (error (let ((num (eieio-oref req ...))) (if (or (null num) (zerop num)) (signal (car err) (cdr err)) (eieio-oset req (quote :num-retries) (1- num)) (gh-url-run-request req resp)))))))
  gh-url-set-response(nil ([object gh-api-paged-request "gh-api-paged-request" "GET" "https://api.github.com/users/travisbhartwell/gists" nil (("Authorization" . "token nil") ("Content-Type" . "application/json")) "null" nil 0 nil nil] [object gh-api-paged-response "gh-api-paged-response" nil nil (("X-GitHub-Request-Id" . "AE7EB81A:18CF:AD85451:577EFF65") ("X-XSS-Protection" . "1; mode=block") ("X-Frame-Options" . "deny") ("X-Content-Type-Options" . "nosniff") ("Strict-Transport-Security" . "max-age=31536000; includeSubdomains; preload") ("Content-Security-Policy" . "default-src 'none'") ("Access-Control-Allow-Origin" . "*") ("Access-Control-Expose-Headers" . "ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval") ("X-RateLimit-Reset" . "1467943531") ("X-RateLimit-Remaining" . "58") ("X-RateLimit-Limit" . "60") ("X-GitHub-Media-Type" . "github.v3") ("Status" . "401 Unauthorized") ("Content-Length" . "83") ("Content-Type" . "application/json; charset=utf-8") ("Date" . "Fri, 08 Jul 2016 01:18:29 GMT") ("Server" . "GitHub.com") (status-string . "Unauthorized") (status-code . "401") (status-version . "1.1")) 401 nil (closure (t) (&rest args) (apply (quote gh-object-list-read) (quote gh-gist-gist) args)) [object gh-api-paged-request "gh-api-paged-request-1" "GET" "https://api.github.com/users/travisbhartwell/gists" nil (("Authorization" . "token nil") ("Content-Type" . "application/json")) "null" nil 0 nil nil]]))
  #[(req &optional resp) "\306\307\310\311\"\310\312\"\310\313\"\310\314\"\310\315\"\211\203!�\316  !\202\"�\317)P\310\320\"\203\\�\206>�\321\310\322\"!Dr\323\n\324C#q\210\325\326!\210+\202|�\206g�\321\310\322\"!Dr\327\n!q\210\324\330\"\210+.\331\332\310\333\"\"\210\207" [req params url url-request-extra-headers url-request-data url-request-method (("basic" ignore . 4)) high eieio-oref :method :data :headers :url :query gh-url-params-encode "" :async make-instance default-response-cls url-retrieve gh-url-set-response make-local-variable url-registered-auth-schemes url-retrieve-synchronously nil mapc #[(cb) "\302 \"\207" [resp cb gh-url-add-response-callback] 3] :install-callbacks url-privacy-level resp req-resp] 10]([object gh-api-paged-request "gh-api-paged-request" "GET" "https://api.github.com/users/travisbhartwell/gists" nil (("Authorization" . "token nil") ("Content-Type" . "application/json")) "null" nil 0 nil nil] [object gh-api-paged-response "gh-api-paged-response" nil nil (("X-GitHub-Request-Id" . "AE7EB81A:18CF:AD85451:577EFF65") ("X-XSS-Protection" . "1; mode=block") ("X-Frame-Options" . "deny") ("X-Content-Type-Options" . "nosniff") ("Strict-Transport-Security" . "max-age=31536000; includeSubdomains; preload") ("Content-Security-Policy" . "default-src 'none'") ("Access-Control-Allow-Origin" . "*") ("Access-Control-Expose-Headers" . "ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval") ("X-RateLimit-Reset" . "1467943531") ("X-RateLimit-Remaining" . "58") ("X-RateLimit-Limit" . "60") ("X-GitHub-Media-Type" . "github.v3") ("Status" . "401 Unauthorized") ("Content-Length" . "83") ("Content-Type" . "application/json; charset=utf-8") ("Date" . "Fri, 08 Jul 2016 01:18:29 GMT") ("Server" . "GitHub.com") (status-string . "Unauthorized") (status-code . "401") (status-version . "1.1")) 401 nil (closure (t) (&rest args) (apply (quote gh-object-list-read) (quote gh-gist-gist) args)) [object gh-api-paged-request "gh-api-paged-request-1" "GET" "https://api.github.com/users/travisbhartwell/gists" nil (("Authorization" . "token nil") ("Content-Type" . "application/json")) "null" nil 0 nil nil]])
  apply(#[(req &optional resp) "\306\307\310\311\"\310\312\"\310\313\"\310\314\"\310\315\"\211\203!�\316    !\202\"�\317)P\310\320\"\203\\�\206>�\321\310\322\"!Dr\323\n\324C#q\210\325\326!\210+\202|�\206g�\321\310\322\"!Dr\327\n!q\210\324\330\"\210+.\331\332\310\333\"\"\210\207" [req params url url-request-extra-headers url-request-data url-request-method (("basic" ignore . 4)) high eieio-oref :method :data :headers :url :query gh-url-params-encode "" :async make-instance default-response-cls url-retrieve gh-url-set-response make-local-variable url-registered-auth-schemes url-retrieve-synchronously nil mapc #[(cb) "\302 \"\207" [resp cb gh-url-add-response-callback] 3] :install-callbacks url-privacy-level resp req-resp] 10] ([object gh-api-paged-request "gh-api-paged-request" "GET" "https://api.github.com/users/travisbhartwell/gists" nil (("Authorization" . "token nil") ("Content-Type" . "application/json")) "null" nil 0 nil nil] [object gh-api-paged-response "gh-api-paged-response" nil nil (("X-GitHub-Request-Id" . "AE7EB81A:18CF:AD85451:577EFF65") ("X-XSS-Protection" . "1; mode=block") ("X-Frame-Options" . "deny") ("X-Content-Type-Options" . "nosniff") ("Strict-Transport-Security" . "max-age=31536000; includeSubdomains; preload") ("Content-Security-Policy" . "default-src 'none'") ("Access-Control-Allow-Origin" . "*") ("Access-Control-Expose-Headers" . "ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval") ("X-RateLimit-Reset" . "1467943531") ("X-RateLimit-Remaining" . "58") ("X-RateLimit-Limit" . "60") ("X-GitHub-Media-Type" . "github.v3") ("Status" . "401 Unauthorized") ("Content-Length" . "83") ("Content-Type" . "application/json; charset=utf-8") ("Date" . "Fri, 08 Jul 2016 01:18:29 GMT") ("Server" . "GitHub.com") (status-string . "Unauthorized") (status-code . "401") (status-version . "1.1")) 401 nil (closure (t) (&rest args) (apply (quote gh-object-list-read) (quote gh-gist-gist) args)) [object gh-api-paged-request "gh-api-paged-request-1" "GET" "https://api.github.com/users/travisbhartwell/gists" nil (("Authorization" . "token nil") ("Content-Type" . "application/json")) "null" nil 0 nil nil]]))
  gh-url-run-request([object gh-api-paged-request "gh-api-paged-request" "GET" "https://api.github.com/users/travisbhartwell/gists" nil (("Authorization" . "token nil") ("Content-Type" . "application/json")) "null" nil 0 nil nil] [object gh-api-paged-response "gh-api-paged-response" nil nil (("X-GitHub-Request-Id" . "AE7EB81A:18CF:AD85451:577EFF65") ("X-XSS-Protection" . "1; mode=block") ("X-Frame-Options" . "deny") ("X-Content-Type-Options" . "nosniff") ("Strict-Transport-Security" . "max-age=31536000; includeSubdomains; preload") ("Content-Security-Policy" . "default-src 'none'") ("Access-Control-Allow-Origin" . "*") ("Access-Control-Expose-Headers" . "ETag, Link, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval") ("X-RateLimit-Reset" . "1467943531") ("X-RateLimit-Remaining" . "58") ("X-RateLimit-Limit" . "60") ("X-GitHub-Media-Type" . "github.v3") ("Status" . "401 Unauthorized") ("Content-Length" . "83") ("Content-Type" . "application/json; charset=utf-8") ("Date" . "Fri, 08 Jul 2016 01:18:29 GMT") ("Server" . "GitHub.com") (status-string . "Unauthorized") (status-code . "401") (status-version . "1.1")) 401 nil (closure (t) (&rest args) (apply (quote gh-object-list-read) (quote gh-gist-gist) args)) [object gh-api-paged-request "gh-api-paged-request-1" "GET" "https://api.github.com/users/travisbhartwell/gists" nil (("Authorization" . "token nil") ("Content-Type" . "application/json")) "null" nil 0 nil nil]])
  #[(api transformer method resource &optional data params page-limit) "\306\307\"\211\310=\203�\311\202�   \312=\205�\313\306\314\"\f
\315\316\3170\"!E1\2057�
\306\320\"\235\2057�1\2112\205B�\3212\"\2113\205M�\3222\"43\205Y�\3232\"\2115\205d�\3242\"63\203p�5\205\270�\325\306\326\"\327\330\331
\332\306\333\"\334\f\"P\3357\3366\203\225�\3376B\nB\202\226�\n\340 \312=\203\244�\3418!\206\262�  \310=\203\261�\3428!\206\262�\343\3449&
\":3\203\317�5\204\317�\327\345\346\347\3404%\202'2\203\376�\327\306:\350\"\3510#;\352:;\"\210\353;\327\354\314\3552\3566&\"\210;)\202'\203\3571\"\210\352:\327\306:\350\"\3510#\"\202'\352:\327\306:\350\"\3510#\".\n\207" [api fmt headers cache resource method eieio-oref :data-format :form (("Content-Type" . "application/x-www-form-urlencoded")) :json (("Content-Type" . "application/json")) :cache sha1 format "%s" safe-methods pcache-has pcache-get gh-cache-outdated-p gh-cache-etag gh-auth-modify-request :auth make-instance gh-api-paged-request :method :url :base gh-api-expand-resource :query :headers "If-None-Match" :data gh-api-json-encode gh-url-form-encode "" :page-limit gh-api-response :data-received t default-response-cls :transform gh-url-run-request gh-url-add-response-callback gh-api-callback :key :revive pcache-invalidate transformer key ...] 17]([object gh-gist-api "gh-gist-api" nil [object gh-cache "gh/gh-gist-api/travisbhartwell" "/Users/travisbhartwell/.emacs.d/.cache/pcache/gh/gh-gist-api/travisbhartwell" unbound #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8 data ( ...)) gh-cache-entry 1467940708.997538 300] "https://api.github.com" "github" [object gh-oauth-authenticator "auth" "travisbhartwell" nil] :json 1 nil] (closure (t) (&rest args) (apply (quote gh-object-list-read) (quote gh-gist-gist) args)) "GET" "/users/travisbhartwell/gists")
  apply(#[(api transformer method resource &optional data params page-limit) "\306\307\"\211\310=\203�\311\202� \312=\205�\313\306\314\"\f
\315\316\3170\"!E1\2057�
\306\320\"\235\2057�1\2112\205B�\3212\"\2113\205M�\3222\"43\205Y�\3232\"\2115\205d�\3242\"63\203p�5\205\270�\325\306\326\"\327\330\331
\332\306\333\"\334\f\"P\3357\3366\203\225�\3376B\nB\202\226�\n\340 \312=\203\244�\3418!\206\262�  \310=\203\261�\3428!\206\262�\343\3449&
\":3\203\317�5\204\317�\327\345\346\347\3404%\202'2\203\376�\327\306:\350\"\3510#;\352:;\"\210\353;\327\354\314\3552\3566&\"\210;)\202'\203\3571\"\210\352:\327\306:\350\"\3510#\"\202'\352:\327\306:\350\"\3510#\".\n\207" [api fmt headers cache resource method eieio-oref :data-format :form (("Content-Type" . "application/x-www-form-urlencoded")) :json (("Content-Type" . "application/json")) :cache sha1 format "%s" safe-methods pcache-has pcache-get gh-cache-outdated-p gh-cache-etag gh-auth-modify-request :auth make-instance gh-api-paged-request :method :url :base gh-api-expand-resource :query :headers "If-None-Match" :data gh-api-json-encode gh-url-form-encode "" :page-limit gh-api-response :data-received t default-response-cls :transform gh-url-run-request gh-url-add-response-callback gh-api-callback :key :revive pcache-invalidate transformer key ...] 17] ([object gh-gist-api "gh-gist-api" nil [object gh-cache "gh/gh-gist-api/travisbhartwell" "/Users/travisbhartwell/.emacs.d/.cache/pcache/gh/gh-gist-api/travisbhartwell" unbound #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8 data ( ...)) gh-cache-entry 1467940708.997538 300] "https://api.github.com" "github" [object gh-oauth-authenticator "auth" "travisbhartwell" nil] :json 1 nil] (closure (t) (&rest args) (apply (quote gh-object-list-read) (quote gh-gist-gist) args)) "GET" "/users/travisbhartwell/gists"))
  gh-api-authenticated-request([object gh-gist-api "gh-gist-api" nil [object gh-cache "gh/gh-gist-api/travisbhartwell" "/Users/travisbhartwell/.emacs.d/.cache/pcache/gh/gh-gist-api/travisbhartwell" unbound #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8 data ( ...)) gh-cache-entry 1467940708.997538 300] "https://api.github.com" "github" [object gh-oauth-authenticator "auth" "travisbhartwell" nil] :json 1 nil] (closure (t) (&rest args) (apply (quote gh-object-list-read) (quote gh-gist-gist) args)) "GET" "/users/travisbhartwell/gists")
  #[(api &optional username) "\302\303\304\305\"!\306\307\310 \206�\311!\"$\207" [api username gh-api-authenticated-request gh-object-list-reader eieio-oref gist-cls "GET" format "/users/%s/gists" gh-api-get-username] 8]([object gh-gist-api "gh-gist-api" nil [object gh-cache "gh/gh-gist-api/travisbhartwell" "/Users/travisbhartwell/.emacs.d/.cache/pcache/gh/gh-gist-api/travisbhartwell" unbound #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8 data ( ...)) gh-cache-entry 1467940708.997538 300] "https://api.github.com" "github" [object gh-oauth-authenticator "auth" "travisbhartwell" nil] :json 1 nil] "travisbhartwell")
  apply(#[(api &optional username) "\302\303\304\305\"!\306\307\310   \206�\311!\"$\207" [api username gh-api-authenticated-request gh-object-list-reader eieio-oref gist-cls "GET" format "/users/%s/gists" gh-api-get-username] 8] ([object gh-gist-api "gh-gist-api" nil [object gh-cache "gh/gh-gist-api/travisbhartwell" "/Users/travisbhartwell/.emacs.d/.cache/pcache/gh/gh-gist-api/travisbhartwell" unbound #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8 data ( ...)) gh-cache-entry 1467940708.997538 300] "https://api.github.com" "github" [object gh-oauth-authenticator "auth" "travisbhartwell" nil] :json 1 nil] "travisbhartwell"))
  gh-gist-list([object gh-gist-api "gh-gist-api" nil [object gh-cache "gh/gh-gist-api/travisbhartwell" "/Users/travisbhartwell/.emacs.d/.cache/pcache/gh/gh-gist-api/travisbhartwell" unbound #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8 data ( ...)) gh-cache-entry 1467940708.997538 300] "https://api.github.com" "github" [object gh-oauth-authenticator "auth" "travisbhartwell" nil] :json 1 nil] "travisbhartwell")
  (let ((resp (gh-gist-list api username))) (gh-url-add-response-callback resp (let ((--cl-buffer-- (make-symbol "--buffer--"))) (let* ((v --cl-buffer--)) (set v bufname)) (list (quote lambda) (quote (&rest --cl-rest--)) (list (quote apply) (list (quote quote) (function (lambda ... ...))) (list (quote quote) --cl-buffer--) (quote --cl-rest--))))) (gh-url-add-response-callback resp (let ((--cl-profile-- (make-symbol "--profile--")) (--cl-buffer-- (make-symbol "--buffer--"))) (progn (let* ((v --cl-profile--)) (set v (eieio-oref api (quote :profile)))) (let* ((v --cl-buffer--)) (set v bufname))) (list (quote lambda) (quote (&rest --cl-rest--)) (list (quote apply) (list (quote quote) (function (lambda ... ...))) (list (quote quote) --cl-buffer--) (list (quote quote) --cl-profile--) (quote --cl-rest--))))))
  (if (and background (not (get-buffer bufname))) nil (let ((resp (gh-gist-list api username))) (gh-url-add-response-callback resp (let ((--cl-buffer-- (make-symbol "--buffer--"))) (let* ((v --cl-buffer--)) (set v bufname)) (list (quote lambda) (quote (&rest --cl-rest--)) (list (quote apply) (list (quote quote) (function ...)) (list (quote quote) --cl-buffer--) (quote --cl-rest--))))) (gh-url-add-response-callback resp (let ((--cl-profile-- (make-symbol "--profile--")) (--cl-buffer-- (make-symbol "--buffer--"))) (progn (let* ((v --cl-profile--)) (set v (eieio-oref api ...))) (let* ((v --cl-buffer--)) (set v bufname))) (list (quote lambda) (quote (&rest --cl-rest--)) (list (quote apply) (list (quote quote) (function ...)) (list (quote quote) --cl-buffer--) (list (quote quote) --cl-profile--) (quote --cl-rest--)))))))
  (let* ((gh-profile-current-profile (or gh-profile-current-profile (gh-profile-completing-read))) (bufname (if (null username) (if (not (equal major-mode (quote gist-list-mode))) (error "Current buffer isn't a gist-list-mode buffer") (buffer-name)) (format "*%s:%sgists*" gh-profile-current-profile (if (or (equal "" username) (eq ... username)) "" (format "%s's-" username))))) (api (gist-get-api nil)) (username (or (and (null username) gist-list-buffer-user) (and (not (or (null username) (equal "" username) (eq ... username))) username) (gh-api-get-username api)))) (if force-reload (progn (pcache-clear (eieio-oref api (quote :cache))) (or background (message "Retrieving list of gists...")))) (if (and background (not (get-buffer bufname))) nil (let ((resp (gh-gist-list api username))) (gh-url-add-response-callback resp (let ((--cl-buffer-- (make-symbol "--buffer--"))) (let* ((v --cl-buffer--)) (set v bufname)) (list (quote lambda) (quote (&rest --cl-rest--)) (list (quote apply) (list ... ...) (list ... --cl-buffer--) (quote --cl-rest--))))) (gh-url-add-response-callback resp (let ((--cl-profile-- (make-symbol "--profile--")) (--cl-buffer-- (make-symbol "--buffer--"))) (progn (let* (...) (set v ...)) (let* (...) (set v bufname))) (list (quote lambda) (quote (&rest --cl-rest--)) (list (quote apply) (list ... ...) (list ... --cl-buffer--) (list ... --cl-profile--) (quote --cl-rest--))))))))
  gist-list-user(current-user nil nil)
  gist-list(nil)
  call-interactively(gist-list nil nil)
  command-execute(gist-list)

I am running Emacs 24.5.1. I have seen this error on both Linux and OS X. If important, I have 2FA enabled for my Github account.

Anything else I can do to help debug this?

agzam commented 8 years ago

I can confirm, it is broken. I also have 2FA enabled.

sigma commented 8 years ago

ok, I reset master to the last working version. Now I guess I need to find a creative way to write code that's compatible with 24.x and 25.x... :(

agzam commented 8 years ago

I just tried latest from MELPA - still appears to be broken :(

sigma commented 8 years ago

should be all good now (including for emacs 25)