jupyterlab-google-drive icon indicating copy to clipboard operation
jupyterlab-google-drive copied to clipboard

Problems with other languages

Open jochym opened this issue 8 years ago • 11 comments

The extension does not work with non-latin characters. If you switch to polish "My drive" becomes "Mój dysk" and you cannot enter the folder. You can still enter the folder corresponding to "Shared with me" in polish mode. I suspect that "ó" character may be the source of the problem.

jochym avatar Oct 12 '17 11:10 jochym

Hi @jochym, this was fixed in #81 and will be in the next release (following the release of JupyterLab today).

blink1073 avatar Oct 12 '17 11:10 blink1073

Great. Thus feel free to close this issue, or maybe you would like me to verify that this is indeed fixed? That may take few days - I'll be off-line for a week.

jochym avatar Oct 12 '17 12:10 jochym

Hi @jochym , we have just released JupyterLab 0.28 and jupyterlab-google-drive 0.7 which has this fix. If you still experience this problem, feel free to reopen.

ian-r-rose avatar Oct 16 '17 23:10 ian-r-rose

Unfortunately the fix is not complete. I can enter the directory now but if I open a notebook I get a dialog with stack dump with UTF-8 encoding problem. I can provide any logs and data you need. If I switch back to english the notebook opens just fine. How can I re-open the issue @ian-r-rose ?

jochym avatar Oct 20 '17 12:10 jochym

I have reopened the issue. This is puzzling. I have tested this with English, Spanish, and Polish, and it seems to work fine when I try. All of my test notebooks loaded correctly. Is there a chance you could share a minimal file that has this issue?

ian-r-rose avatar Oct 20 '17 14:10 ian-r-rose

Sure. I'll try to reduce it to the minimal case and share.

jochym avatar Oct 20 '17 15:10 jochym

Even a minimal notebook: https://drive.google.com/open?id=0Bzmd3wPy53nrT2NYcDhzRS12cnc shows following dump:

Traceback (most recent call last): File "/opt/miniconda/envs/jh/lib/python3.6/site-packages/tornado/web.py", line 1511, in _execute result = yield result File "/opt/miniconda/envs/jh/lib/python3.6/site-packages/tornado/gen.py", line 1055, in run value = future.result() File "/opt/miniconda/envs/jh/lib/python3.6/site-packages/tornado/concurrent.py", line 238, in result raise_exc_info(self._exc_info) File "<string>", line 4, in raise_exc_info File "/opt/miniconda/envs/jh/lib/python3.6/site-packages/tornado/gen.py", line 1063, in run yielded = self.gen.throw(*exc_info) File "/opt/miniconda/envs/jh/lib/python3.6/site-packages/notebook/services/sessions/handlers.py", line 73, in post type=mtype)) File "/opt/miniconda/envs/jh/lib/python3.6/site-packages/tornado/gen.py", line 1055, in run value = future.result() File "/opt/miniconda/envs/jh/lib/python3.6/site-packages/tornado/concurrent.py", line 238, in result raise_exc_info(self._exc_info) File "<string>", line 4, in raise_exc_info File "/opt/miniconda/envs/jh/lib/python3.6/site-packages/tornado/gen.py", line 1063, in run yielded = self.gen.throw(*exc_info) File "/opt/miniconda/envs/jh/lib/python3.6/site-packages/notebook/services/sessions/sessionmanager.py", line 79, in create_session kernel_id = yield self.start_kernel_for_session(session_id, path, name, type, kernel_name) File "/opt/miniconda/envs/jh/lib/python3.6/site-packages/tornado/gen.py", line 1055, in run value = future.result() File "/opt/miniconda/envs/jh/lib/python3.6/site-packages/tornado/concurrent.py", line 238, in result raise_exc_info(self._exc_info) File "<string>", line 4, in raise_exc_info File "/opt/miniconda/envs/jh/lib/python3.6/site-packages/tornado/gen.py", line 307, in wrapper yielded = next(result) File "/opt/miniconda/envs/jh/lib/python3.6/site-packages/notebook/services/sessions/sessionmanager.py", line 90, in start_kernel_for_session kernel_path = self.contents_manager.get_kernel_path(path=path) File "/opt/miniconda/envs/jh/lib/python3.6/site-packages/notebook/services/contents/filemanager.py", line 533, in get_kernel_path if self.dir_exists(path): File "/opt/miniconda/envs/jh/lib/python3.6/site-packages/notebook/services/contents/filemanager.py", line 215, in dir_exists return os.path.isdir(os_path) File "/opt/miniconda/envs/jh/lib/python3.6/genericpath.py", line 42, in isdir st = os.stat(s) UnicodeEncodeError: 'ascii' codec can't encode character '\xf3' in position 21: ordinal not in range(128)

It seems to be "ó" character in the path to the file ("Mój dysk/Notebooks/Problem.ipynb"). Maybe the sub-dir for notebooks causes the problem to show up. It looks like the kernel path routine does not handle unicode correctly?

jochym avatar Oct 20 '17 16:10 jochym

Woah. That is quite the error. It looks like the error is occurring when the kernel tries to start, and ASCII is assumed somewhere.

I still cannot reproduce the error (your Problem.ipynb opens just fine on my machine, with language settings set to Polish). What version of notebook are you running?

ian-r-rose avatar Oct 20 '17 19:10 ian-r-rose

Try copying my folder structure: Mój dysk/Notebooks/file.ipynb Version: 5.2.0 py36_1 conda-forge

jochym avatar Oct 20 '17 21:10 jochym

I have mirrored your directory structure (Mój dysk/Notebooks/file.ipynb), running notebook 5.2.0, python 3.6, JupyterLab 0.28.5, and @jupyterlab/google-drive 0.7, Ubuntu 17.10, and I still don't see this error.

What happens if you try to create that same directory structure on your local filesystem? If it is a problem with the Notebook server handling of a unicode path, then maybe that would also fail.

ian-r-rose avatar Oct 20 '17 21:10 ian-r-rose

I will try that.

jochym avatar Oct 21 '17 05:10 jochym