Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

gist-buffer/gist-region fails with (wrong-type-argument listp empty) #33

Closed
suhailshergill opened this issue Jul 15, 2012 · 8 comments
Closed

Comments

@suhailshergill
Copy link

minimal failure case: a buffer with the single character '%' in it
additional failure cases: buffer containing quoted/unquoted strings such as "%", "%h" etc

emacs-version: "GNU Emacs 23.3.1 (x86_64-pc-linux-gnu, GTK+ Version 2.24.10) of 2012-03-25 on allspice, modified by Debian"
emacs-version: "GNU Emacs 23.4.1 (i486-pc-linux-gnu) of 2012-03-21 on murphy, modified by Debian"

backtrace output:

Debugger entered--Lisp error: (wrong-type-argument listp empty)
signal(wrong-type-argument (listp empty))
(if (or (null num) (zerop num)) (signal (car err) (cdr err)) (logito:info api "Retrying request %s %s" (oref req :method) (oref req :url)) (let (...) (gh-api-run-request api req transform resp num)))
(condition-case err (gh-api-response-init resp (current-buffer) transform) (error (if ... ... ... ...)))
(let* ((--cl-rest-- retry-data) (api ...) (req ...) (transform ...) (resp ...) (num ...)) (condition-case err (gh-api-response-init resp ... transform) (error ...)))
(progn (let* (... ... ... ... ... ...) (condition-case err ... ...)))
(destructuring-bind (api req transform resp num) retry-data (condition-case err (gh-api-response-init resp ... transform) (error ...)))
gh-api-set-response((:error (error http 500)) ([object gh-gist-api "api" nil [object gh-cache "gh/gh-gist-api/suhailshergill" "/.emacs.d/var/pcache/gh/gh-gist-api/suhailshergill" 0.1 #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8 data (... [object pcache-entry "pcache-entry" 1342385494.137677 nil ...] ...)) pcache-entry 1342385466.029175 300] "https://api.github.com" [object gh-oauth-authenticator "auth" "suhailshergill" "OAUTH_TOKEN"] :json 1 nil] [object gh-api-request "request" "POST" "https://api.github.com/gists" (...) "{"description":"", "public":true, "files":{"scratch.el":{"content":";; This buffer is for notes you don't want to save, and for Lisp evaluation.\n;; If you want to create a file, visit that file with C-x C-f,\n;; then enter the text in that file's own buffer.\n\n%h"}}}"](lambda %28&rest --cl-rest--%29 %28apply #[... "303�J304 Jn""207" [G69903 G69902 args2 apply append] 5] ... ... --cl-rest--)) [object gh-api-response "async" nil nil (gist-created-callback) [object gh-gist-api "api" nil [object gh-cache "gh/gh-gist-api/suhailshergill" "/.emacs.d/var/pcache/gh/gh-gist-api/suhailshergill" 0.1 #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8 data (... [object pcache-entry "pcache-entry" 1342385494.137677 nil ...] ...)) pcache-entry 1342385466.029175 300] "https://api.github.com" [object gh-oauth-authenticator "auth" "suhailshergill" "OAUTH_TOKEN"] :json 1 nil]] 0))
apply(gh-api-set-response ((:error (error http 500)) ([object gh-gist-api "api" nil [object gh-cache "gh/gh-gist-api/suhailshergill" "/.emacs.d/var/pcache/gh/gh-gist-api/suhailshergill" 0.1 #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8 data (... [object pcache-entry "pcache-entry" 1342385494.137677 nil ...] ...)) pcache-entry 1342385466.029175 300] "https://api.github.com" [object gh-oauth-authenticator "auth" "suhailshergill" "OAUTH_TOKEN"] :json 1 nil] [object gh-api-request "request" "POST" "https://api.github.com/gists" ... "{"description":"", "public":true, "files":{"scratch.el":{"content":";; This buffer is for notes you don't want to save, and for Lisp evaluation.\n;; If you want to create a file, visit that file with C-x C-f,\n;; then enter the text in that file's own buffer.\n\n%h"}}}"](lambda ... ...) [object gh-api-response "async" nil nil ... [object gh-gist-api "api" nil [object gh-cache "gh/gh-gist-api/suhailshergill" "/.emacs.d/var/pcache/gh/gh-gist-api/suhailshergill" 0.1 #s(hash-table size 65 test equal rehash-size 1.5 rehash-threshold 0.8 data (... [object pcache-entry "pcache-entry" 1342385494.137677 nil ...] ...)) pcache-entry 1342385466.029175 300] "https://api.github.com" [object gh-oauth-authenticator "auth" "suhailshergill" "OAUTH_TOKEN"] :json 1 nil]] 0)))
url-http-activate-callback()
url-http-chunked-encoding-after-change-function(143 155 12)
url-http-wait-for-headers-change-function(1 155 154)
url-http-generic-filter(# "HTTP/1.1 500 Internal Server Error
\nServer: nginx/1.0.13
\nDate: Sun, 15 Jul 2012 20:52:58 GMT
\nTransfer-Encoding: chunked
\nConnection: keep-alive
\n
\n0
\n
\n")

@suhailshergill
Copy link
Author

@sigma: similar behaviour observed on "GNU Emacs 24.1.50.1"

@suhailshergill
Copy link
Author

a very dirty hack which might be of value to others till this issue is properly
resolved : https://gist.github.com/3127107

it's based on the observation that it's only the creation of new gists
(containing '%') which is affected, you can still edit in the problematic '%'
characters just fine

@mgalgs
Copy link

mgalgs commented Nov 2, 2012

@suhailshergill haha wow, that's truly awesome. Creating a gist with nothing but `foo', then immediately overwriting it. Well done, kind sir. Works for me.

@suhailshergill
Copy link
Author

@mgalgs you're welcome :)

@mgalgs
Copy link

mgalgs commented Mar 15, 2013

This hack doesn't seem to play nicely with GH enterprise API instances

I.e., the fix for this (gh.el) doesn't work too well with the defadvice hack... Can %'s simply be escaped as gist sends the data to the server?

:(

@sigma
Copy link
Collaborator

sigma commented Mar 15, 2013

can you try with gist.el 1.1.1 and gh 0.7.2 (both just released) ?
If that doesn't work for you, please provide an example as I can't reproduce anymore

Thanks

@sigma
Copy link
Collaborator

sigma commented Mar 15, 2013

closing as I believe it's now fixed. Please reopen if that's not the case

@sigma sigma closed this as completed Mar 15, 2013
@mgalgs
Copy link

mgalgs commented Mar 15, 2013

Confirmed working, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants