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
unicode exception when using %run with failing script #1688
Comments
Interesting that this seems Windows-specific, because I get no such issue on a non-ascii path on OSX. |
I believe this is caused by ultratb and pycolorize that are completely unicode ignorant. Perhaps for some reason paths are generated as unicode on windows and str on osx thus not raising the error on osx. I would like to work on a fix for this by making ultratb and pycolorize unicode aware. Is there any other work currently on this code? |
That would be great. No, I don't think there is any other work going on in that code. |
Add git-mpr, to merge PR(s) from github just by number(s). Inspired by git-mrb and test_pr, I thougth it would be usefull to be able to merge PR only by giving their number. Hence `git merge-pull-request`or `git-mpr`. usage: ```bash $ git mpr -h ~/ipython/tools usage: git-mpr [-h] [-l | -a | -m [pr-number [pr-number ...]]] Merge (one|many) github pull request by their number. If pull request can't be merge as is, cancel merge, and continue to the next if any. optional arguments: -h, --help show this help message and exit -l, --list list PR, their number and their mergeability -a, --merge-all try to merge as many PR as possible, one by one -m [pr-number [pr-number ...]], --merge [pr-number [pr-number ...]] The pull request numbers ``` examples : ```bash $ git mpr --list * #1758 [√]: test_pr, fallback on http if git protocol fail, and SSL errors... * #1755 [√]: test for pygments before running qt tests * #1715 [√]: Fix for #1688, traceback-unicode issue [...] * #1493 [√]: Selenium web tests proof-of-concept * #1471 [ ]: simplify IPython.parallel connections and enable Controller Resume * #1343 [ ]: Add prototype shutdown button to Notebook dashboard * #1285 [√]: Implementation of grepping the input history using several patterns * #1215 [√]: updated %quickref to show short-hand for %sc and %sx ``` PR number, mergeability and title Quite slow, as it does 1 api call by PR, since api does not give mergeability anymore if you ask for the list of all PRs at once. merge one or more PR (skip the ones with conflict and present a nice list to copy and past to do it by hand) ```bash $ git mpr --merge [pr-number [pr-number ...]]] [...] ************************************************************************************* the following branch have not been merged automatically, considere doing it by hand : PR 1630: git pull https://github.com/minrk/ipython.git mergekernel PR 1343: git pull https://github.com/takluyver/ipython.git notebook-shutdown PR 1715: git pull https://github.com/jstenar/ipython.git ultratb-pycolorize-unicode PR 1732: git pull https://github.com/fperez/ipython.git cellmagics PR 1471: git pull https://github.com/minrk/ipython.git connection PR 1674: git pull https://github.com/mdboom/ipython.git notebook-carriage-return ************************************************************************************* ``` And last, ``` git mpr --merge-all ``` That is pretty self explainatory
I've confirmed this is an issue on linux. It should be very easy to write a test, just make a temp dir with a unicode character in the prefix, put a file with Does anyone have bandwith to tackle this very soon, so we could hope to ship with this bug fixed in 0.13? |
I'd look at it, but I can't replicate it here - I see the unicode character in the traceback. |
Mmh, I was able to replicate it trivially on an ubuntu 12.04 box, with this code:
see if this helps... |
Bizarre, this is on Ubuntu 12.04 as well:
|
Mmh... I guess that means I'll have to be the one fixing it :) |
OK, I give up, this is very, very weird: I can indeed reproduce a UnicodeError, but a different one than @jstenar is getting, and in my case I only manage to get the problem the first time I run a script. Witness the really weird traceback:
But if in the next line I immediately repeat the
Somehow this is being triggered by state deep in python's pkg_resources machinery, and the problem only appears once. I have no clue what's going on. Furthermore, I can only make this happen interactively. All my attempts at writing a test that would also show the problem have failed miserably. Given that this:
I'm going to demote it to having no milestone. There's no point in targeting with a milestone bugs we can't realistically fix, and I've burned already too much time on this. If anyone can find a reproducible way to cause the problem, great! We'll then have a PR and a fix. But there's no point in keeping it high on the radar otherwise. |
It looks like your traceback is occurring while trying to load simplejson - I don't have that installed, which might explain why I don't see it. |
Fernando Perez skrev 2012-06-26 07:34:
My first thought on reading that you only see it on the first time you |
What happens if you just do: |
Can you try #2043? |
This is the problem I'm working on in #1715 so I can indeed still reproduce the problem on master (it is fixed in that branch). |
Move RemoteError import to top-level, though still inside function to prevent circular import issue. A better fix is to fold parallel.error into core.error, but I don't want to do that this close to 0.13 release. Closes ipython#1688.
By importing unicode_literals from __future__ and casting to unicode at two locations a simple case now works. However I have not audited the code to find other locations where casts may be necessary. No new failures were noted when running the testsuite.
By importing unicode_literals from __future__ and casting to unicode at two locations a simple case now works. However I have not audited the code to find other locations where casts may be necessary. No new failures were noted when running the testsuite.
Fix for #1688, traceback-unicode issue
Closing after merge of #1715 |
Add git-mpr, to merge PR(s) from github just by number(s). Inspired by git-mrb and test_pr, I thougth it would be usefull to be able to merge PR only by giving their number. Hence `git merge-pull-request`or `git-mpr`. usage: ```bash $ git mpr -h ~/ipython/tools usage: git-mpr [-h] [-l | -a | -m [pr-number [pr-number ...]]] Merge (one|many) github pull request by their number. If pull request can't be merge as is, cancel merge, and continue to the next if any. optional arguments: -h, --help show this help message and exit -l, --list list PR, their number and their mergeability -a, --merge-all try to merge as many PR as possible, one by one -m [pr-number [pr-number ...]], --merge [pr-number [pr-number ...]] The pull request numbers ``` examples : ```bash $ git mpr --list * ipython#1758 [√]: test_pr, fallback on http if git protocol fail, and SSL errors... * ipython#1755 [√]: test for pygments before running qt tests * ipython#1715 [√]: Fix for ipython#1688, traceback-unicode issue [...] * ipython#1493 [√]: Selenium web tests proof-of-concept * ipython#1471 [ ]: simplify IPython.parallel connections and enable Controller Resume * ipython#1343 [ ]: Add prototype shutdown button to Notebook dashboard * ipython#1285 [√]: Implementation of grepping the input history using several patterns * ipython#1215 [√]: updated %quickref to show short-hand for %sc and %sx ``` PR number, mergeability and title Quite slow, as it does 1 api call by PR, since api does not give mergeability anymore if you ask for the list of all PRs at once. merge one or more PR (skip the ones with conflict and present a nice list to copy and past to do it by hand) ```bash $ git mpr --merge [pr-number [pr-number ...]]] [...] ************************************************************************************* the following branch have not been merged automatically, considere doing it by hand : PR 1630: git pull https://github.com/minrk/ipython.git mergekernel PR 1343: git pull https://github.com/takluyver/ipython.git notebook-shutdown PR 1715: git pull https://github.com/jstenar/ipython.git ultratb-pycolorize-unicode PR 1732: git pull https://github.com/fperez/ipython.git cellmagics PR 1471: git pull https://github.com/minrk/ipython.git connection PR 1674: git pull https://github.com/mdboom/ipython.git notebook-carriage-return ************************************************************************************* ``` And last, ``` git mpr --merge-all ``` That is pretty self explainatory
Still inside function to prevent circular imports A better fix is to fold parallel.error into core.error, but I don't want to do that this close to 0.13 release. should fix ipython#1688
Move RemoteError import to top-level, though still inside function to prevent circular import issue. A better fix is to fold parallel.error into core.error, but I don't want to do that this close to 0.13 release. Closes ipython#1688.
By importing unicode_literals from __future__ and casting to unicode at two locations a simple case now works. However I have not audited the code to find other locations where casts may be necessary. No new failures were noted when running the testsuite.
Fix for ipython#1688, traceback-unicode issue
When I %run the script below in a path containing non-ascii characters the traceback of a failing script is clobbered by a UnicodeDecodeError in IPython code.
Correct behaviour when running in ascii path
incorrect behaviour when running in non-ascii path
The text was updated successfully, but these errors were encountered: