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

"unknown error" #98

Closed
robdecker opened this issue Aug 13, 2013 · 26 comments
Closed

"unknown error" #98

robdecker opened this issue Aug 13, 2013 · 26 comments

Comments

@robdecker
Copy link

Getting "Gist: unknown error (please, report a bug!)" popup when trying to insert a gist. I never see the list of my gists either.

Running ST3 build 3047 on Linux. I have installed Gist via package control as well as via git. Just tried the newest code in the master branch. I have deleted my GitHub token and regenerated.

Read through #87 & #94. Tried all the steps in #94.

Not sure what else I can try...

@robdecker
Copy link
Author

The error log:

Traceback (most recent call last):
File "/home/rob/.config/sublime-text-3/Packages/Gist/gist.py", line 104, in _fn
return fn(_args, *_kwargs)
File "/home/rob/.config/sublime-text-3/Packages/Gist/gist.py", line 580, in run
filtered = gists_filter(get_gists(GISTS_URL))
File "/home/rob/.config/sublime-text-3/Packages/Gist/gist.py", line 249, in get_gists
return api_request(url)
File "/home/rob/.config/sublime-text-3/Packages/Gist/gist.py", line 381, in api_request_curl
response, _ = process.communicate('\n'.join(config))
File "X/subprocess.py", line 906, in communicate
File "X/subprocess.py", line 1513, in _communicate
File "X/subprocess.py", line 1608, in _communicate_with_poll
TypeError: 'str' does not support the buffer interface
error: Gist: unknown error (please, report a bug!)

@Frique
Copy link

Frique commented Aug 15, 2013

Same here. ST3 on mac, installed via package control.

@thnt
Copy link

thnt commented Aug 16, 2013

Same here. ST3 3052, linux x64, installed via PC

@Suor
Copy link

Suor commented Aug 18, 2013

Same on ST3 3047, Ubuntu 13.04 64bit

@zQueal
Copy link

zQueal commented Aug 19, 2013

Same; Ubuntu.

Linux xanza 3.2.0-51-generic #77-Ubuntu SMP Wed Jul 24 20:18:19 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux

@joshmfrankel
Copy link

Same on Linux Mint 13

@condemil
Copy link
Owner

Must be fixed now.

@robdecker
Copy link
Author

Inserting a Gist works again. Yeah!

Unfortunately, saving a Gist doesn't. Here's the log:

Traceback (most recent call last):
File "/home/rob/.config/sublime-text-3/Packages/Gist/gist.py", line 103, in _fn
return fn(_args, *_kwargs)
File "/home/rob/.config/sublime-text-3/Packages/Gist/gist.py", line 444, in on_gist_filename
gist = create_gist(self.public, description, gist_data)
File "/home/rob/.config/sublime-text-3/Packages/Gist/gist.py", line 147, in create_gist
gist = api_request(GISTS_URL, data)
File "/home/rob/.config/sublime-text-3/Packages/Gist/gist.py", line 375, in api_request_curl
data_file.write(data)
TypeError: 'str' does not support the buffer interface
error: Gist: unknown error (please, report a bug!)

@condemil
Copy link
Owner

Thanks for the report, fixed too.

@robdecker
Copy link
Author

Confirmed fixed. Thank you for getting this working again.

@zQueal
Copy link

zQueal commented Aug 25, 2013

I'm still getting issues, although I'm able to return my Gist list now.

Traceback (most recent call last):
  File "gist in C:\Users\xanza\AppData\Roaming\Sublime Text 3\Installed Packages\Gist.sublime-package", line 103, in _fn
  File "gist in C:\Users\xanza\AppData\Roaming\Sublime Text 3\Installed Packages\Gist.sublime-package", line 647, in handle_gist
  File "gist in C:\Users\xanza\AppData\Roaming\Sublime Text 3\Installed Packages\Gist.sublime-package", line 235, in insert_gist
AttributeError: 'NoneType' object has no attribute 'run_command'
error: Gist: unknown error (please, report a bug!)

Additionally, I was required (to get it working this much) to uninstall, then reinstall the module and I noticed something weird; the plugin is attempting to load %appdata%\Roaming\Sublime Text 3\Packages\Gist\Gist.sublime-settings which does NOT exist. I was forced to manually create the Gist directory and copy Gist.sublime-settings from %appdata%\Roaming\Sublime Text 3\Packages\User\Gist.sublime-settings.

@condemil condemil reopened this Aug 27, 2013
@condemil
Copy link
Owner

@Xanza Regarding the error, it seems that your view is not active now. Can you describe how you are inserting new gist?

There is no missing file in the repository, you can check it by browsing main project page on GitHub and see the file list.

@zQueal
Copy link

zQueal commented Aug 29, 2013

After some minor hacking I've been able to get this plugin to finally work, however, it's totally unusable. Once inserting a Gist, this is the output:

image

For larger files, it continues to move the code to the right until I'm forced to scroll to view.

image2

Very disappointing. Additionally, opening Gists still does not work. Much more hassle than it's worth.

@robdecker
Copy link
Author

Confirming @Xanza bug when inserting gists. I'm currently using the version of Gist from package control. It's a quick remedy to reindent the code from Edit -> Line -> Reindent, but obviously we shouldn't have to do that.

Still happy that it'll create/insert tho!

@zQueal
Copy link

zQueal commented Sep 16, 2013

@robdecker thanks for that, I hadn't known!

@adeelshahid
Copy link
Contributor

This should be fixed in the next update.

There was a bug on line number 54 in gist.py, I have updated the code to prefix GISTS_URL with settings.GISTS_URL that worked for me.

I have tested this on Ubuntu 14.04

Now I am just waiting for merge to take place from my code.

@zQueal
Copy link

zQueal commented Jun 29, 2014

@adeelshahid Did you submit a pull request? I don't see an active one, nor do I see you in the list of contributory developers. I'd be interested in testing it on Windows to see if it's fixed.

@adeelshahid
Copy link
Contributor

@Xanza yup, and it's already been accepted into code as well, you may clone the latest repo now. Creating GISTS should work smoothly

@condemil
Copy link
Owner

@Xanza unfortunately, pull request from @adeelshahid not solves the indentation issue.

@zQueal
Copy link

zQueal commented Jun 29, 2014

Booo! Even broken, though, this is still the best Gist plugin.

@adeelshahid
Copy link
Contributor

it was only to fix the create gists functionality

@adeelshahid
Copy link
Contributor

@Xanza do you have some sample code to share here so we can test indentation issue with it.

For me this simple code snippet saves into a GIST and opens up inside sublime text without any issues,

if (1) {
    $data = $conn->query('');
    $conn->exec();

    foreach ($data as $row) {
        print_r(json_encode($row));
    }

} else {
    file_get_contents('');
}

@condemil
Copy link
Owner

@adeelshahid to reproduce the issue you should use insert gist on the empty file instead of open gist. You can star the following gist https://gist.github.com/rooseveltrp/6453919 to reproduce it.

@adeelshahid
Copy link
Contributor

On line #118 just before running the insert command inside insert_gist function

If add a line like the second one below. Basically to append any character it will solve the problem of indentation but the character will show up at the very beginning of every line.

@condemil can you try below and use a replace all function for now that way we have the bug fixed at-least temporarily. Because I think the problem is something to do with running the "insert" command itself inside sublime text which gives the indentation issue.

view = sublime.active_window().active_view()

gist['files'][gist_filename]['content'] = gist['files'][gist_filename]['content'].replace("\n", "\nअ")

        if PY3:

@zQueal
Copy link

zQueal commented Jun 30, 2014

to reproduce the issue you should use insert gist on the empty file instead of open gist.

Correct. Just tried this again and got the same results. I've had to work around it by opening a new document, opening a gist, and copy and pasting into the document needed. A bit of a work around, but still working none-the-less.

@condemil
Copy link
Owner

@Xanza @adeelshahid indentation issue should be fixed now

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

No branches or pull requests

8 participants