You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Spent the last hour poking around about this. I saw a few issues in this repo discussed by @wbond and some others, and while it appears that this was working with ST3 build 3120, the current stable build (3126) is not working again, and I cannot install Floobits either via package installer or manually via git.
The from urllib import parse seems to be the offending line; and it looks like the script is trying to gracefully accommodate that in the exception block import urllib as parse.
Attempting these in the ST3 terminal, I get:
>>> from urllib import parse
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: cannot import name parse
>>> import urllib as parse
>>> parse.unquote
Traceback (most recent call last):
File "<string>", line 1, in <module>
AttributeError: 'module' object has no attribute 'unquote'
However, in 3.3, these methods are found in the urllib.parse module, and I was able to get a confirmation of loading for parse.unquote by doing this:
>>> from urllib.parse import quote
>>> quote
<function quote at 0x7f1a41b82290>
>>> from urllib.parse import unquote
>>> unquote
<function unquote at 0x7f1a41b82050>
So it appears that these methods are available, but the existing code in that file (.../diff_match_patch.py) is not importing them correctly.
Just on a lark, I tried changing that opening block to:
try:
# from urllib import parse # omitted this
# assert parse # omitted this
from urllib.parse import quote # added this
from urllib.parse import unquote # added this
# def unquote_py3(x): # omitted this
# return parse.unquote(x) # omitted this
# unquote = unquote_py3 # omitted this
str_instances = str
unichr = chr
except ImportError:
import urllib as parse
def unquote_py2(x):
return parse.unquote(x.encode('utf-8')).decode('utf-8')
unquote = unquote_py2
import __builtin__
str_instances = (str, __builtin__.basestring)
And then did a find/replace (s/parse.quote/quote/).
When I closed and reopened ST3, the errors about urllib.parse were no longer showing, however I did see a couple other errors related to urllib, including:
HTTPError = urllib.error.HTTPError
AttributeError: 'module' object has no attribute 'error'
and
Traceback (most recent call last):
File "/home/aaron/.config/sublime-text-3/Packages/Floobits/floo/common/reactor.py", line 11, in <module>
from . import api, msg
File "/home/aaron/.config/sublime-text-3/Packages/Floobits/floo/common/api.py", line 28, in <module>
import urllib2
ImportError: No module named 'urllib2'
So I suspect that the module refactoring they did in this version has had some effects in other places as well.
I'm super rusty in python (and am looking through this repo for the first time ever tonight) and while I'd be happy to submit a PR for these superficial changes, someone more experienced should really audit this as well.
Happy to answer any followup questions about this issue or provide additional information, if that's needed. (I'm on Ubuntu 17.04)
The text was updated successfully, but these errors were encountered:
Spent the last hour poking around about this. I saw a few issues in this repo discussed by @wbond and some others, and while it appears that this was working with ST3 build 3120, the current stable build (3126) is not working again, and I cannot install Floobits either via package installer or manually via git.
It seems that the issue is the splitting of the
urllib
module, discussed on this SO post: https://stackoverflow.com/a/29358613(Relevant PY3 docs: https://docs.python.org/3.3/library/urllib.parse.html#module-urllib.parse )
My instance of ST3 is indeed using PY3 v3.3.6
and
urllib
is sourcing from there as well:In file
.../Floobits/floo/common/lib/diff_match_patch.py
, line 32, it has this:The
from urllib import parse
seems to be the offending line; and it looks like the script is trying to gracefully accommodate that in the exception blockimport urllib as parse
.Attempting these in the ST3 terminal, I get:
However, in 3.3, these methods are found in the
urllib.parse
module, and I was able to get a confirmation of loading forparse.unquote
by doing this:So it appears that these methods are available, but the existing code in that file (
.../diff_match_patch.py
) is not importing them correctly.Just on a lark, I tried changing that opening block to:
And then did a find/replace (
s/parse.quote/quote/
).When I closed and reopened ST3, the errors about
urllib.parse
were no longer showing, however I did see a couple other errors related to urllib, including:and
So I suspect that the module refactoring they did in this version has had some effects in other places as well.
I'm super rusty in python (and am looking through this repo for the first time ever tonight) and while I'd be happy to submit a PR for these superficial changes, someone more experienced should really audit this as well.
Happy to answer any followup questions about this issue or provide additional information, if that's needed. (I'm on Ubuntu 17.04)
The text was updated successfully, but these errors were encountered: