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

request 0.3.1 assumes utf-8 #53

Merged
merged 6 commits into from
Sep 22, 2019
Merged

Conversation

dickmao
Copy link
Contributor

@dickmao dickmao commented Jul 26, 2019

The tkf library now defaults to utf-8 encoding (so does not need to be
done in anki-editor). Further the synchronous bug has been fixed.

Closes #51 #49

dickmao added 2 commits July 26, 2019 08:34
The tkf library now defaults to utf-8 encoding (so does not need to be
done in anki-editor).  Further the synchronous bug has been fixed.
@rogorido rogorido mentioned this pull request Aug 5, 2019
@rogorido
Copy link

rogorido commented Aug 5, 2019

Which is the current status of this issue?

@louietan
Copy link
Owner

Thanks, but the changes to sync mode seems to make Emacs hanging.

@ejmg
Copy link

ejmg commented Aug 19, 2019

@dickmao I appreciate your effort into making this PR to work around this change.

It appears that in the PR, a snippet of code @louietan wrote to work around callbacks was removed. Could this be why emacs is hanging with this patch?

@dickmao was there a reason you removed this callback?

@louietan
Copy link
Owner

I'm debugging request.el, feels like the polling in request--curl-sync never ends and blocks the semaphore from being signaled.

I put some logs in that function and only get "Accepting process output..." and "Not finished yet, waiting...".

(let (finished)
    (prog1 (apply #'request--curl url
                  :semaphore (lambda (&rest _)
                               (request-log 'debug "Semaphore signaled !")
                               (setq finished t))
                  settings)
      (let ((proc (get-buffer-process (request-response--buffer response))))
        (with-local-quit
          (while (not finished)
            (if (request--process-live-p proc)
                (progn
                  (request-log 'debug "Accepting process output...")
                  (accept-process-output proc))
              (request-log 'debug "Not finished yet, waiting...")
              (sleep-for 0 300)))))))

@louietan
Copy link
Owner

Substitute sleep-for with sit-for works now. I'm gonna find out how they are different.

@louietan
Copy link
Owner

Not really works though, if I make some input events to emacs while it's requesting, it still deadlocks.

@louietan
Copy link
Owner

tkf/emacs-request#132

dickmao added 2 commits August 19, 2019 13:21
Hypothesis: synch bug is triggered depending on byte compilation of request-curl-callback.
@leezu
Copy link

leezu commented Aug 30, 2019

@dickmao can you remove the "synchronous bug has been fixed" related changes? Let's first fix the encoding issue. Once the "synchronous bug has been fixed" related changes have been debugged they can be merged in a separate PR. What do you think?

Package maintainer reports undowned semaphore with tkf/emacs-request library
f466ab1.  I don't believe restoring the "HACK" would cure this since
":sync t" remains.
@dickmao
Copy link
Contributor Author

dickmao commented Aug 30, 2019

You got it.

@leezu
Copy link

leezu commented Aug 30, 2019

Thanks! @louietan can the utf-8 fix be merged then?

@louietan louietan merged commit 084ffad into louietan:master Sep 22, 2019
@yszhang95
Copy link

Hi, I have an similar issue to #54 . The platform is WINDOWS 11 and the EMCAS version is 28, NT.

Inspired by comments from @moerrari , I revert the line back. Now the repository functions. I am not sure if this is an issue or if I should report it here or elsewhere.

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

Successfully merging this pull request may close these issues.

Coding systems errors
6 participants