From mneeley at gmail.com  Sun Jul  8 18:58:01 2007
From: mneeley at gmail.com (Matthew Neeley)
Date: Sun, 8 Jul 2007 14:58:01 -0800
Subject: [IPython-dev] sort dynamic attributes on tab completion
Message-ID: <96be7bb00707081558ub59b008s4ce418557560d545@mail.gmail.com>

Dynamic attributes from trait_names and _getAttributeNames are added
to the list of tab completions, but when this happens, the attribute
list is turned into a set, so the attributes are unordered when
printed, which makes it hard to find the right completion.  Here's a
patch to turn this set back into a list and sort it.

-Matthew Neeley

PS- This is my first contribution to ipython, so I hope this is the
right place to send this.  I think ipython is great software, and want
to thank you all for your hard work!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: sort_attribute_completion.patch
Type: application/octet-stream
Size: 566 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20070708/c07f844e/attachment.obj>

From dfj225 at gmail.com  Mon Jul  9 10:59:33 2007
From: dfj225 at gmail.com (Doug Jones)
Date: Mon, 9 Jul 2007 10:59:33 -0400
Subject: [IPython-dev] ipython1 saw exception transport and raising
Message-ID: <1315be7e0707090759u6bedef93nea0d65e87fe2536@mail.gmail.com>

Hello IPython devs,

I've been testing the ipython1 saw branch and was testing some of the
new exception handling code. All in all, it seems to be working very
well, but I have come across one quirk that affects my code. Part of
the system that I use involves C++ code wrapped using Boost.Python.
For some reason, it seems that Boost.Python likes to create its own
classes for exceptions which aren't able to be pickled. So, whenever
one of these exceptions gets generated, I get a traceback about failed
pickling instead of the actual error that was generated.

I cooked up a little change that makes these types of errors able to
be serialized. I'm not too familiar with the internals of IPython1, so
there might be a much better way to do this, but at the very least I
hope my code serves as a good indication of where the problem lies.

Thanks,
~doug
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pbutil_exception.diff
Type: text/x-patch
Size: 716 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20070709/86f3528d/attachment.bin>

From ellisonbg.net at gmail.com  Thu Jul 12 22:51:04 2007
From: ellisonbg.net at gmail.com (Brian Granger)
Date: Thu, 12 Jul 2007 20:51:04 -0600
Subject: [IPython-dev] ipython1 saw exception transport and raising
In-Reply-To: <1315be7e0707090759u6bedef93nea0d65e87fe2536@mail.gmail.com>
References: <1315be7e0707090759u6bedef93nea0d65e87fe2536@mail.gmail.com>
Message-ID: <6ce0ac130707121951l1a5e4c8bt6d7b1e4fcc656dfc@mail.gmail.com>

Doug,

Can you do an svn up and try again.  You patch made it pretty clear
what the problem was.  However, I did make some changes to make sure
that the new type and value are something other than a string.  Here
is what I committed:

def packageFailure(f):
    """Clean and pickle a failure preappending the string FAILURE:"""

    f.cleanFailure()
    # This is sometimes helpful in debugging
    #f.raiseException()
    try:
        pString = pickle.dumps(f, 2)
    except pickle.PicklingError:
        # Certain types of exceptions are not pickleable, for instance ones
        # from Boost.Python.  We try to wrap them in something that is
        f.type = UnpickleableException
        f.value = UnpickleableException(str(f.type) + ": " + str(f.value))
        pString = pickle.dumps(f, 2)
    return 'FAILURE:' + pString

Let me know how this works - I don't have Boost.Python installed so I
can't reproduce your situation exactly.  I can modify it further if
needed.

Brian

On 7/9/07, Doug Jones <dfj225 at gmail.com> wrote:
> Hello IPython devs,
>
> I've been testing the ipython1 saw branch and was testing some of the
> new exception handling code. All in all, it seems to be working very
> well, but I have come across one quirk that affects my code. Part of
> the system that I use involves C++ code wrapped using Boost.Python.
> For some reason, it seems that Boost.Python likes to create its own
> classes for exceptions which aren't able to be pickled. So, whenever
> one of these exceptions gets generated, I get a traceback about failed
> pickling instead of the actual error that was generated.
>
> I cooked up a little change that makes these types of errors able to
> be serialized. I'm not too familiar with the internals of IPython1, so
> there might be a much better way to do this, but at the very least I
> hope my code serves as a good indication of where the problem lies.
>
> Thanks,
> ~doug
>
> _______________________________________________
> IPython-dev mailing list
> IPython-dev at scipy.org
> http://lists.ipython.scipy.org/mailman/listinfo/ipython-dev
>
>
>


From gawel at afpy.org  Sat Jul 14 15:31:21 2007
From: gawel at afpy.org (Gael Pasgrimaud)
Date: Sat, 14 Jul 2007 21:31:21 +0200
Subject: [IPython-dev] host completer patch
Message-ID: <622E5C19-8EC3-47E1-B940-3E5F7DFAE02C@afpy.org>

Hi,

I'm using ipython -p sh. It has very cool features. Thanks for this !

Unfortunately, when i need to ssh or scp something ipyhton can't  
complete my host name.

So, here is a small completer to get a list of hosts from ~/.ssh/ 
known_hosts. The patch is attached to this mail.

Hope you like this feature !

Regards,

Gael


From gawel at afpy.org  Sat Jul 14 15:46:33 2007
From: gawel at afpy.org (Gael Pasgrimaud)
Date: Sat, 14 Jul 2007 21:46:33 +0200
Subject: [IPython-dev] host completer patch
In-Reply-To: <622E5C19-8EC3-47E1-B940-3E5F7DFAE02C@afpy.org>
References: <622E5C19-8EC3-47E1-B940-3E5F7DFAE02C@afpy.org>
Message-ID: <4CF5ACBB-3A6F-4A7E-95A6-48926A4D0FE7@afpy.org>

It's better if i attach the file...

Le 14 juil. 07 ? 21:31, Gael Pasgrimaud a ?crit :

> Hi,
>
> I'm using ipython -p sh. It has very cool features. Thanks for this !
>
> Unfortunately, when i need to ssh or scp something ipyhton can't  
> complete my host name.
>
> So, here is a small completer to get a list of hosts from ~/.ssh/ 
> known_hosts. The patch is attached to this mail.
>
> Hope you like this feature !
>
> Regards,
>
> Gael

-------------- next part --------------
A non-text attachment was scrubbed...
Name: host_completer_patch.diff
Type: application/octet-stream
Size: 965 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20070714/12cc13b2/attachment.obj>

From fperez.net at gmail.com  Mon Jul 16 02:34:29 2007
From: fperez.net at gmail.com (Fernando Perez)
Date: Mon, 16 Jul 2007 00:34:29 -0600
Subject: [IPython-dev] host completer patch
In-Reply-To: <622E5C19-8EC3-47E1-B940-3E5F7DFAE02C@afpy.org>
References: <622E5C19-8EC3-47E1-B940-3E5F7DFAE02C@afpy.org>
Message-ID: <db6b5ecc0707152334q58c8057cle3fa87962c6a4901@mail.gmail.com>

Hi Gael,

On 7/14/07, Gael Pasgrimaud <gawel at afpy.org> wrote:
> Hi,
>
> I'm using ipython -p sh. It has very cool features. Thanks for this !
>
> Unfortunately, when i need to ssh or scp something ipyhton can't
> complete my host name.
>
> So, here is a small completer to get a list of hosts from ~/.ssh/
> known_hosts. The patch is attached to this mail.
>
> Hope you like this feature !

Thanks for your patch, but I have a question: is it really going to be
useful for much longer?  I think that SSH installations these days
have switched to fully encrypted hostnames in known_hosts for security
reasons.  For example, this is what my known_hosts file looks like:

|1|b4c6JaeXDN5RNoIY4FPJHC8/90c=|7BQAEHpygIjFv1Yj3h+1EMbVhq8= ssh-rsa
AAAAB3NzaC1yc2EAAAABI
wAAAQEA4n38wYb/Xcw2huw/3JwiL4nqZSup2n1byzID2WU6a6RmizbW/h5kBOHmzVajClPjxKy53klszKCBKcFeioY
Jof6qXpkrw0ZgpZVkDMbzyw4mvI9UtYLKhPw8iX9R3Jlv6RWnccqvSmz0OGz3GQY/ZDAczNahCapTyHYaYC/j/7BZT
xcxzG1odF+KQuA4fvqIhAD+Xl1kp4zDCWh6uRjqNQarNYUuGnlYgJpv4Fa6hAIxBc7TaU3R6mJSwett5kpCEd4c1oy
+4uUxsV9M6QlgUOGTUQrAB09KDJqTY0CAGfBGXl5fcPUEYFZnEe9yYf4gtcRyV5Om8/D2hs+x5znl/w==

... etc.

Not terribly useful for completion, I'm afraid :)

I'm on Ubuntu Feisty.  Have other distros not switched to this SSH
configuration?  I know Debian switched as of Etch to encrypted
known_hosts, and I'd imagine others will catch up in due time, no?

If this is not going to be generically useful for others, I'd rather
not have the code in the mainline, I'm afraid.

Regards,

f


From gawel at afpy.org  Mon Jul 16 03:21:25 2007
From: gawel at afpy.org (Gael Pasgrimaud)
Date: Mon, 16 Jul 2007 09:21:25 +0200
Subject: [IPython-dev] host completer patch
In-Reply-To: <db6b5ecc0707152334q58c8057cle3fa87962c6a4901@mail.gmail.com>
References: <622E5C19-8EC3-47E1-B940-3E5F7DFAE02C@afpy.org>
	<db6b5ecc0707152334q58c8057cle3fa87962c6a4901@mail.gmail.com>
Message-ID: <0E51D11E-409F-400B-8A13-201647480762@afpy.org>

Hello,

Le 16 juil. 07 ? 08:34, Fernando Perez a ?crit :

>
> Thanks for your patch, but I have a question: is it really going to be
> useful for much longer?  I think that SSH installations these days
> have switched to fully encrypted hostnames in known_hosts for security
> reasons.  For example, this is what my known_hosts file looks like:
>
> |1|b4c6JaeXDN5RNoIY4FPJHC8/90c=|7BQAEHpygIjFv1Yj3h+1EMbVhq8= ssh-rsa
> AAAAB3NzaC1yc2EAAAABI
> wAAAQEA4n38wYb/Xcw2huw/3JwiL4nqZSup2n1byzID2WU6a6RmizbW/ 
> h5kBOHmzVajClPjxKy53klszKCBKcFeioY
> Jof6qXpkrw0ZgpZVkDMbzyw4mvI9UtYLKhPw8iX9R3Jlv6RWnccqvSmz0OGz3GQY/ 
> ZDAczNahCapTyHYaYC/j/7BZT
> xcxzG1odF+KQuA4fvqIhAD 
> +Xl1kp4zDCWh6uRjqNQarNYUuGnlYgJpv4Fa6hAIxBc7TaU3R6mJSwett5kpCEd4c1oy
> +4uUxsV9M6QlgUOGTUQrAB09KDJqTY0CAGfBGXl5fcPUEYFZnEe9yYf4gtcRyV5Om8/ 
> D2hs+x5znl/w==
>
> ... etc.
>

Ouch... I don't know this... I think this will break a lot of shell  
completers :(

> Not terribly useful for completion, I'm afraid :)

Yes, but you can always put a HashKnownhosts no in your ~/.ssh/config

>
> I'm on Ubuntu Feisty.  Have other distros not switched to this SSH
> configuration?  I know Debian switched as of Etch to encrypted
> known_hosts, and I'd imagine others will catch up in due time, no?
>
>
> If this is not going to be generically useful for others, I'd rather
> not have the code in the mainline, I'm afraid.
>

Yep, i understand. No problem.

May be i can put this somewhere on your wiki as a tips ?

Regards,

--
Gael

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20070716/e64223ec/attachment.html>

From gael.varoquaux at normalesup.org  Mon Jul 16 03:29:00 2007
From: gael.varoquaux at normalesup.org (Gael Varoquaux)
Date: Mon, 16 Jul 2007 09:29:00 +0200
Subject: [IPython-dev] host completer patch
In-Reply-To: <0E51D11E-409F-400B-8A13-201647480762@afpy.org>
References: <622E5C19-8EC3-47E1-B940-3E5F7DFAE02C@afpy.org>
	<db6b5ecc0707152334q58c8057cle3fa87962c6a4901@mail.gmail.com>
	<0E51D11E-409F-400B-8A13-201647480762@afpy.org>
Message-ID: <20070716072900.GE23143@clipper.ens.fr>

On Mon, Jul 16, 2007 at 09:21:25AM +0200, Gael Pasgrimaud wrote:
>    May be i can put this somewhere on your wiki as a tips ?

Salut !

I don't know how the completion works in IPython, but is it possible to
add this from the ipythonrc file, rather than as a patch ? I think it
will make it much easier for the average user.

Another Ga?l


From vivainio at gmail.com  Mon Jul 16 04:03:25 2007
From: vivainio at gmail.com (Ville M. Vainio)
Date: Mon, 16 Jul 2007 11:03:25 +0300
Subject: [IPython-dev] host completer patch
In-Reply-To: <0E51D11E-409F-400B-8A13-201647480762@afpy.org>
References: <622E5C19-8EC3-47E1-B940-3E5F7DFAE02C@afpy.org>
	<db6b5ecc0707152334q58c8057cle3fa87962c6a4901@mail.gmail.com>
	<0E51D11E-409F-400B-8A13-201647480762@afpy.org>
Message-ID: <46cb515a0707160103m37b86901q45d3bdea26eca87a@mail.gmail.com>

On 7/16/07, Gael Pasgrimaud <gawel at afpy.org> wrote:

> If this is not going to be generically useful for others, I'd rather
> not have the code in the mainline, I'm afraid.
>
>
> Yep, i understand. No problem.
> May be i can put this somewhere on your wiki as a tips ?

No, it's ok to add it to Extensions directory. Just call it
ipy_sshcompleter.py and we'll enable it in ipy_app_completers.py
(after a new patch).

-- 
Ville M. Vainio - vivainio.googlepages.com
blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio'


From vivainio at gmail.com  Mon Jul 16 04:05:05 2007
From: vivainio at gmail.com (Ville M. Vainio)
Date: Mon, 16 Jul 2007 11:05:05 +0300
Subject: [IPython-dev] host completer patch
In-Reply-To: <20070716072900.GE23143@clipper.ens.fr>
References: <622E5C19-8EC3-47E1-B940-3E5F7DFAE02C@afpy.org>
	<db6b5ecc0707152334q58c8057cle3fa87962c6a4901@mail.gmail.com>
	<0E51D11E-409F-400B-8A13-201647480762@afpy.org>
	<20070716072900.GE23143@clipper.ens.fr>
Message-ID: <46cb515a0707160105k24793172ibe5b97bc666dc741@mail.gmail.com>

On 7/16/07, Gael Varoquaux <gael.varoquaux at normalesup.org> wrote:

> On Mon, Jul 16, 2007 at 09:21:25AM +0200, Gael Pasgrimaud wrote:
> >    May be i can put this somewhere on your wiki as a tips ?
>
> Salut !
>
> I don't know how the completion works in IPython, but is it possible to
> add this from the ipythonrc file, rather than as a patch ? I think it
> will make it much easier for the average user.

Of course, it can be enabled by putting "import ipy_sshcompleter.py"
in ipy_user_conf.py when such an extension is available.

ipythonrc is deprecated.

-- 
Ville M. Vainio - vivainio.googlepages.com
blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio'


From vivainio at gmail.com  Mon Jul 16 04:22:51 2007
From: vivainio at gmail.com (Ville M. Vainio)
Date: Mon, 16 Jul 2007 11:22:51 +0300
Subject: [IPython-dev] host completer patch
In-Reply-To: <46cb515a0707160105k24793172ibe5b97bc666dc741@mail.gmail.com>
References: <622E5C19-8EC3-47E1-B940-3E5F7DFAE02C@afpy.org>
	<db6b5ecc0707152334q58c8057cle3fa87962c6a4901@mail.gmail.com>
	<0E51D11E-409F-400B-8A13-201647480762@afpy.org>
	<20070716072900.GE23143@clipper.ens.fr>
	<46cb515a0707160105k24793172ibe5b97bc666dc741@mail.gmail.com>
Message-ID: <46cb515a0707160122ge0d7adet7196b5e2d4f5bda5@mail.gmail.com>

On 7/16/07, Ville M. Vainio <vivainio at gmail.com> wrote:

> Of course, it can be enabled by putting "import ipy_sshcompleter.py"
> in ipy_user_conf.py when such an extension is available.
>
> ipythonrc is deprecated.

And a clarification: of course you can just put the whole thing in you
ipy_user_conf.py, with the necessary expose_magic stuff. There should
never be a need to "patch" anything.

-- 
Ville M. Vainio - vivainio.googlepages.com
blog=360.yahoo.com/villevainio - g[mail | talk]='vivainio'


From steve at shrogers.com  Mon Jul 16 11:51:37 2007
From: steve at shrogers.com (Steven H. Rogers)
Date: Mon, 16 Jul 2007 09:51:37 -0600 (MDT)
Subject: [IPython-dev] host completer patch
In-Reply-To: <db6b5ecc0707152334q58c8057cle3fa87962c6a4901@mail.gmail.com>
References: <622E5C19-8EC3-47E1-B940-3E5F7DFAE02C@afpy.org>
	<db6b5ecc0707152334q58c8057cle3fa87962c6a4901@mail.gmail.com>
Message-ID: <60029.192.55.12.36.1184601097.squirrel@mail2.webfaction.com>

On Mon, July 16, 2007 00:34, Fernando Perez wrote:
> Hi Gael,
>
> On 7/14/07, Gael Pasgrimaud <gawel at afpy.org> wrote:
>> Hi,
>>
>> I'm using ipython -p sh. It has very cool features. Thanks for this !
>>
>> Unfortunately, when i need to ssh or scp something ipyhton can't
>> complete my host name.
>>
>> So, here is a small completer to get a list of hosts from ~/.ssh/
>> known_hosts. The patch is attached to this mail.
>>
>> Hope you like this feature !
>
> Thanks for your patch, but I have a question: is it really going to be
> useful for much longer?  I think that SSH installations these days
> have switched to fully encrypted hostnames in known_hosts for security
> reasons.  For example, this is what my known_hosts file looks like:
>
> |1|b4c6JaeXDN5RNoIY4FPJHC8/90c=|7BQAEHpygIjFv1Yj3h+1EMbVhq8= ssh-rsa
> AAAAB3NzaC1yc2EAAAABI
> wAAAQEA4n38wYb/Xcw2huw/3JwiL4nqZSup2n1byzID2WU6a6RmizbW/h5kBOHmzVajClPjxKy53klszKCBKcFeioY
> Jof6qXpkrw0ZgpZVkDMbzyw4mvI9UtYLKhPw8iX9R3Jlv6RWnccqvSmz0OGz3GQY/ZDAczNahCapTyHYaYC/j/7BZT
> xcxzG1odF+KQuA4fvqIhAD+Xl1kp4zDCWh6uRjqNQarNYUuGnlYgJpv4Fa6hAIxBc7TaU3R6mJSwett5kpCEd4c1oy
> +4uUxsV9M6QlgUOGTUQrAB09KDJqTY0CAGfBGXl5fcPUEYFZnEe9yYf4gtcRyV5Om8/D2hs+x5znl/w==
>
> ... etc.
>
> Not terribly useful for completion, I'm afraid :)
>
> I'm on Ubuntu Feisty.  Have other distros not switched to this SSH
> configuration?  I know Debian switched as of Etch to encrypted
> known_hosts, and I'd imagine others will catch up in due time, no?
>
My CentOS 4.3 and Fedora 6 systems have unencrypted known_hosts.  I
haven't looked at Fedora 7 yet.

# Steve


From fperez.net at gmail.com  Mon Jul 16 13:07:44 2007
From: fperez.net at gmail.com (Fernando Perez)
Date: Mon, 16 Jul 2007 11:07:44 -0600
Subject: [IPython-dev] host completer patch
In-Reply-To: <0E51D11E-409F-400B-8A13-201647480762@afpy.org>
References: <622E5C19-8EC3-47E1-B940-3E5F7DFAE02C@afpy.org>
	<db6b5ecc0707152334q58c8057cle3fa87962c6a4901@mail.gmail.com>
	<0E51D11E-409F-400B-8A13-201647480762@afpy.org>
Message-ID: <db6b5ecc0707161007l7505cf5cq9bddedaec609b226@mail.gmail.com>

On 7/16/07, Gael Pasgrimaud <gawel at afpy.org> wrote:

> Ouch... I don't know this... I think this will break a lot of shell
> completers :(
>
> Not terribly useful for completion, I'm afraid :)
>
> Yes, but you can always put a HashKnownhosts no in your ~/.ssh/config

Which is a seriously bad idea from a security standpoint.  The hashing
of known_hosts is meant to contain the severity of a breakin of the
following type:

1. A host is compromised, and its password file taken.  The attacker
runs it through a password cracker, and then collects all the
passwords that did break.

2. The attacker inspects ~HOME/.ssh/known_hosts for all users
collected in #1, and now tries to log into other hosts with their same
passwords.  Chances are, in many cases he will succeed (people do
reuse passwords).

3. Go to 1.  The open known_hosts makes the spread of the problem
much, much faster (combined with other things, of course).


This is NOT hypothetical, in fact the only breakin I've ever been a
victim of had this pattern, and was made MUCH more serious thanks to
an unhashed known_hosts (it was an old mismanaged Solaris box, years
ago).


But we're in the business of being useful to people, not enforcing
policy on them.  I'd be happy to include your patch if you modify it
to include a docstring explaining the above, making very clear the
consequences of enabling it.  At least if people do this, they should
know *exactly* the exposure they are generating.

We will NOT enable the feature by default (since it's also quite
likely to not work in many new linux installations), but it will be
there for users who want it and are aware of the risks.

Cheers,

f


From dfj225 at gmail.com  Mon Jul 16 13:58:05 2007
From: dfj225 at gmail.com (Doug Jones)
Date: Mon, 16 Jul 2007 13:58:05 -0400
Subject: [IPython-dev] ipython1 saw exception transport and raising
In-Reply-To: <6ce0ac130707121951l1a5e4c8bt6d7b1e4fcc656dfc@mail.gmail.com>
References: <1315be7e0707090759u6bedef93nea0d65e87fe2536@mail.gmail.com>
	<6ce0ac130707121951l1a5e4c8bt6d7b1e4fcc656dfc@mail.gmail.com>
Message-ID: <1315be7e0707161058i6f958cb5sc8188928c3aad433@mail.gmail.com>

Hi Brian,

Thanks for looking into this. I did the svn up and tested it and
everything looks fine now. The  result is more or less the same as
what I cooked up, meaning the name of the original exception is
displayed in the traceback.

However, there still seems to be some data loss in the process. Let me
demonstrate what I mean.

If I use my module in IPython itself and do something that I know
invokes an exception from some code that uses Boost.Python, I get
output like so:

In [3]: a = attribute_random()
---------------------------------------------------------------------------
Boost.Python.ArgumentError                             Traceback (most
recent call last)

<cut traceback>

ArgumentError: Python argument types in
    _basin.attribute_random()
did not match C++ signature:
    attribute_random(int b, unsigned int seed)
    attribute_random(std::vector<int, std::allocator<int> > b,
unsigned int seed)

I've included this to give you some insight to how this particular
Exception is formed:

In [2]: try:
   ...:     a = attribute_random()
   ...: except Exception, inst:
   ...:     print type(inst)
   ...:     print inst.args
   ...:     print inst
   ...:
<type 'instance'>
('Python argument types in\n    _basin.attribute_random()\ndid not
match C++ signature:\n    attribute_random(int b, unsigned int seed)\n
   attribute_random(std::vector<int, std::allocator<int> > b, unsigned
int seed)',)
Python argument types in
    _basin.attribute_random()
did not match C++ signature:
    attribute_random(int b, unsigned int seed)
    attribute_random(std::vector<int, std::allocator<int> > b,
unsigned int seed)

Now, when this same Exception is generated in a remote session, I get
output like so:

In [6]: a = attribute_random()
2007/07/16 13:56 -0400 [-] Performing execute on all
---------------------------------------------------------------------------
ipython1.kernel.error.UnpickleableException
Traceback (most recent call last)

<cut traceback>

UnpickleableException: ipython1.kernel.error.UnpickleableException:
***************************************************************************
An exception occurred in the IPython Interpreter due to a user action.
This usually means that user code has a problem in it somewhere.

engine: 1
method: execute(lines)
lines = a = attribute_random()

A full traceback from the actual interpreter:
---------------------------------------------------------------------------
Boost.Python.ArgumentError                             Traceback (most
recent call last)


ArgumentError:
***************************************************************************

As you see, some of the information that is part of the ArgumentError
is either not transported or not displayed. Unlike last time, I don't
really have any ideas as to why.


Thanks,
~Doug

On 7/12/07, Brian Granger <ellisonbg.net at gmail.com> wrote:
> Doug,
>
> Can you do an svn up and try again.  You patch made it pretty clear
> what the problem was.  However, I did make some changes to make sure
> that the new type and value are something other than a string.  Here
> is what I committed:
>
> def packageFailure(f):
>     """Clean and pickle a failure preappending the string FAILURE:"""
>
>     f.cleanFailure()
>     # This is sometimes helpful in debugging
>     #f.raiseException()
>     try:
>         pString = pickle.dumps(f, 2)
>     except pickle.PicklingError:
>         # Certain types of exceptions are not pickleable, for instance ones
>         # from Boost.Python.  We try to wrap them in something that is
>         f.type = UnpickleableException
>         f.value = UnpickleableException(str(f.type) + ": " + str(f.value))
>         pString = pickle.dumps(f, 2)
>     return 'FAILURE:' + pString
>
> Let me know how this works - I don't have Boost.Python installed so I
> can't reproduce your situation exactly.  I can modify it further if
> needed.
>
> Brian
>
> On 7/9/07, Doug Jones <dfj225 at gmail.com> wrote:
> > Hello IPython devs,
> >
> > I've been testing the ipython1 saw branch and was testing some of the
> > new exception handling code. All in all, it seems to be working very
> > well, but I have come across one quirk that affects my code. Part of
> > the system that I use involves C++ code wrapped using Boost.Python.
> > For some reason, it seems that Boost.Python likes to create its own
> > classes for exceptions which aren't able to be pickled. So, whenever
> > one of these exceptions gets generated, I get a traceback about failed
> > pickling instead of the actual error that was generated.
> >
> > I cooked up a little change that makes these types of errors able to
> > be serialized. I'm not too familiar with the internals of IPython1, so
> > there might be a much better way to do this, but at the very least I
> > hope my code serves as a good indication of where the problem lies.
> >
> > Thanks,
> > ~doug
> >
> > _______________________________________________
> > IPython-dev mailing list
> > IPython-dev at scipy.org
> > http://lists.ipython.scipy.org/mailman/listinfo/ipython-dev
> >
> >
> >
>


From fperez.net at gmail.com  Mon Jul 16 15:07:51 2007
From: fperez.net at gmail.com (Fernando Perez)
Date: Mon, 16 Jul 2007 13:07:51 -0600
Subject: [IPython-dev] ipython1 saw exception transport and raising
In-Reply-To: <1315be7e0707161058i6f958cb5sc8188928c3aad433@mail.gmail.com>
References: <1315be7e0707090759u6bedef93nea0d65e87fe2536@mail.gmail.com>
	<6ce0ac130707121951l1a5e4c8bt6d7b1e4fcc656dfc@mail.gmail.com>
	<1315be7e0707161058i6f958cb5sc8188928c3aad433@mail.gmail.com>
Message-ID: <db6b5ecc0707161207v70275897l2a2f7fe743050580@mail.gmail.com>

On 7/16/07, Doug Jones <dfj225 at gmail.com> wrote:
> Hi Brian,
>
> Thanks for looking into this. I did the svn up and tested it and
> everything looks fine now. The  result is more or less the same as
> what I cooked up, meaning the name of the original exception is
> displayed in the traceback.
>
> However, there still seems to be some data loss in the process. Let me
> demonstrate what I mean.

Yup, this is in my immediate to-do list, to which I think I'll be able
to get to on Wednesday, as I'll finally get a small break from various
work-related things.

If Brian doesn't beat me to it, I hope to get this fixed soon, as it's
a *major* problem we have right now in terms of using the system.

If you have a small self-contained example that shows the problem and
does not require Boost, please send it this way, it will help to add
it to the test suite.

Cheers,

f


From gawel at afpy.org  Mon Jul 16 17:42:33 2007
From: gawel at afpy.org (Gael Pasgrimaud)
Date: Mon, 16 Jul 2007 23:42:33 +0200
Subject: [IPython-dev] host completer patch
In-Reply-To: <db6b5ecc0707161007l7505cf5cq9bddedaec609b226@mail.gmail.com>
References: <622E5C19-8EC3-47E1-B940-3E5F7DFAE02C@afpy.org>
	<db6b5ecc0707152334q58c8057cle3fa87962c6a4901@mail.gmail.com>
	<0E51D11E-409F-400B-8A13-201647480762@afpy.org>
	<db6b5ecc0707161007l7505cf5cq9bddedaec609b226@mail.gmail.com>
Message-ID: <759C3283-7BF8-4418-97B5-E9FB78209975@afpy.org>


Le 16 juil. 07 ? 19:07, Fernando Perez a ?crit :

> On 7/16/07, Gael Pasgrimaud <gawel at afpy.org> wrote:
>
> This is NOT hypothetical, in fact the only breakin I've ever been a
> victim of had this pattern, and was made MUCH more serious thanks to
> an unhashed known_hosts (it was an old mismanaged Solaris box, years
> ago).
>

Ouch ! But known_hosts is not the only file with host names.
What about ~/.ssh/config ? I don't think this one can be encrypted  
one day.

>
> But we're in the business of being useful to people, not enforcing
> policy on them.  I'd be happy to include your patch if you modify it
> to include a docstring explaining the above, making very clear the
> consequences of enabling it.  At least if people do this, they should
> know *exactly* the exposure they are generating.
>

Ok, done. My english is quite poor but i've tried to be as clear as  
possible.
I've also put a link to this thread since your example is really  
meaningful.

> We will NOT enable the feature by default (since it's also quite
> likely to not work in many new linux installations), but it will be
> there for users who want it and are aware of the risks.
>

That's cool. I've made a few searches and i've seen a lot of threads on
"how to enable host completion". Seems people need it :)

Since this feature will not be enable by default, i've added a few  
hooks in the
module with some common commands:

ip.set_hook('complete_command',host_completer,str_key='ping')
ip.set_hook('complete_command',host_completer,str_key='ssh')
ip.set_hook('complete_command',scp_completer,str_key='scp')
ip.set_hook('complete_command',scp_completer,str_key='sftp')

Then you only need to put the import in your profile. I hope it's ok  
for you.

I've also improved a bit my completer and added another one to get  
the final ':' with scp/sftp

The file is called ipy_host_completers.py since it's not really ssh  
specific.

Regards,

--
Gael

-------------- next part --------------
A non-text attachment was scrubbed...
Name: ipy_host_completers.diff
Type: application/octet-stream
Size: 2845 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20070716/d65786dd/attachment.obj>
-------------- next part --------------


From ellisonbg.net at gmail.com  Mon Jul 16 18:18:25 2007
From: ellisonbg.net at gmail.com (Brian Granger)
Date: Mon, 16 Jul 2007 16:18:25 -0600
Subject: [IPython-dev] ipython1 saw exception transport and raising
In-Reply-To: <db6b5ecc0707161207v70275897l2a2f7fe743050580@mail.gmail.com>
References: <1315be7e0707090759u6bedef93nea0d65e87fe2536@mail.gmail.com>
	<6ce0ac130707121951l1a5e4c8bt6d7b1e4fcc656dfc@mail.gmail.com>
	<1315be7e0707161058i6f958cb5sc8188928c3aad433@mail.gmail.com>
	<db6b5ecc0707161207v70275897l2a2f7fe743050580@mail.gmail.com>
Message-ID: <6ce0ac130707161518v4a890f41mb184dfaef92aff05@mail.gmail.com>

I am headed on vacation soon, so if Fernando can take this one that
would be great.

Thanks

Brian

On 7/16/07, Fernando Perez <fperez.net at gmail.com> wrote:
> On 7/16/07, Doug Jones <dfj225 at gmail.com> wrote:
> > Hi Brian,
> >
> > Thanks for looking into this. I did the svn up and tested it and
> > everything looks fine now. The  result is more or less the same as
> > what I cooked up, meaning the name of the original exception is
> > displayed in the traceback.
> >
> > However, there still seems to be some data loss in the process. Let me
> > demonstrate what I mean.
>
> Yup, this is in my immediate to-do list, to which I think I'll be able
> to get to on Wednesday, as I'll finally get a small break from various
> work-related things.
>
> If Brian doesn't beat me to it, I hope to get this fixed soon, as it's
> a *major* problem we have right now in terms of using the system.
>
> If you have a small self-contained example that shows the problem and
> does not require Boost, please send it this way, it will help to add
> it to the test suite.
>
> Cheers,
>
> f
>


From dfj225 at gmail.com  Mon Jul 16 18:58:07 2007
From: dfj225 at gmail.com (Doug Jones)
Date: Mon, 16 Jul 2007 18:58:07 -0400
Subject: [IPython-dev] ipython1 saw exception transport and raising
In-Reply-To: <db6b5ecc0707161207v70275897l2a2f7fe743050580@mail.gmail.com>
References: <1315be7e0707090759u6bedef93nea0d65e87fe2536@mail.gmail.com>
	<6ce0ac130707121951l1a5e4c8bt6d7b1e4fcc656dfc@mail.gmail.com>
	<1315be7e0707161058i6f958cb5sc8188928c3aad433@mail.gmail.com>
	<db6b5ecc0707161207v70275897l2a2f7fe743050580@mail.gmail.com>
Message-ID: <1315be7e0707161558u27450a57s19949d902db9f7ae@mail.gmail.com>

For a test, would something like this be sufficient:

raise Exception("Something extra")

in a normal ipython shell I get this:

In [16]: raise Exception("Something extra")
---------------------------------------------------------------------------
exceptions.Exception                                 Traceback (most
recent call last)

/home/djones/new_svn/basin_remote/trunk/usr/lib64/python2.4/site-packages/<ipython
console>

Exception: Something extra

Using rc.executeAll(), I get:

In [17]: rc.executeAll('raise Exception("Some extra info.")')
2007/07/16 18:57 -0400 [-] Performing execute on all
---------------------------------------------------------------------------
exceptions.Exception                                 Traceback (most
recent call last)

/home/djones/new_svn/basin_remote/trunk/usr/lib64/python2.4/site-packages/<ipython
console>

<cut traceback>

Exception:
***************************************************************************
An exception occurred in the IPython Interpreter due to a user action.
This usually means that user code has a problem in it somewhere.

engine: 0
method: execute(lines)
lines = raise Exception("Some extra info.")

A full traceback from the actual interpreter:
---------------------------------------------------------------------------
exceptions.Exception                                 Traceback (most
recent call last)


Exception:
***************************************************************************

Note the missing "Some extra info".


~doug



On 7/16/07, Fernando Perez <fperez.net at gmail.com> wrote:
> On 7/16/07, Doug Jones <dfj225 at gmail.com> wrote:
> > Hi Brian,
> >
> > Thanks for looking into this. I did the svn up and tested it and
> > everything looks fine now. The  result is more or less the same as
> > what I cooked up, meaning the name of the original exception is
> > displayed in the traceback.
> >
> > However, there still seems to be some data loss in the process. Let me
> > demonstrate what I mean.
>
> Yup, this is in my immediate to-do list, to which I think I'll be able
> to get to on Wednesday, as I'll finally get a small break from various
> work-related things.
>
> If Brian doesn't beat me to it, I hope to get this fixed soon, as it's
> a *major* problem we have right now in terms of using the system.
>
> If you have a small self-contained example that shows the problem and
> does not require Boost, please send it this way, it will help to add
> it to the test suite.
>
> Cheers,
>
> f
>


From fperez.net at gmail.com  Mon Jul 16 19:01:18 2007
From: fperez.net at gmail.com (Fernando Perez)
Date: Mon, 16 Jul 2007 17:01:18 -0600
Subject: [IPython-dev] ipython1 saw exception transport and raising
In-Reply-To: <1315be7e0707161558u27450a57s19949d902db9f7ae@mail.gmail.com>
References: <1315be7e0707090759u6bedef93nea0d65e87fe2536@mail.gmail.com>
	<6ce0ac130707121951l1a5e4c8bt6d7b1e4fcc656dfc@mail.gmail.com>
	<1315be7e0707161058i6f958cb5sc8188928c3aad433@mail.gmail.com>
	<db6b5ecc0707161207v70275897l2a2f7fe743050580@mail.gmail.com>
	<1315be7e0707161558u27450a57s19949d902db9f7ae@mail.gmail.com>
Message-ID: <db6b5ecc0707161601y361cfc92yb7bb64d6139c7343@mail.gmail.com>

On 7/16/07, Doug Jones <dfj225 at gmail.com> wrote:
> For a test, would something like this be sufficient:
>
> raise Exception("Something extra")
[...]
> Note the missing "Some extra info".


That will do it, thanks.  My local copy of saw is currently totally
borked due to changes I'm in the middle of, so I just wanted to make
sure we had a little easy-to-see example.  I'll take care of it later
this week and will post here.

Cheers,

f


From mg.graz at googlemail.com  Thu Jul 19 12:21:33 2007
From: mg.graz at googlemail.com (Michael Graz)
Date: Thu, 19 Jul 2007 17:21:33 +0100
Subject: [IPython-dev] pyreadline vi mode fix
Message-ID: <dd33050b0707190921oc944640sbffca1a7c54844ad@mail.gmail.com>

Greetings all, LTNS.  When I enable vi mode (set_mode("vi") in
~/pyreadlineconfig.ini) there is an exception and then nothing works.
However there is an easy fix in rlmain.py function parse_and_bind.

before:

    except AttributeError:
        log('unknown func key="%s" func="%s"' % (key, func_name))
        print 'unknown function to bind: "%s"' % func_name
    self.mode._bind_key (key, func)

after:

    except AttributeError:
        log('unknown func key="%s" func="%s"' % (key, func_name))
        print 'unknown function to bind: "%s"' % func_name
        return
    self.mode._bind_key(key, func)

It is simply the addition of a return call in the exception handling block.
If there is no return then "func" is an undefined variable resulting in an
exception in the statement: self.mode._bind_key(key, func)

    UnboundLocalError: local variable 'func' referenced before assignment

Would someone be able to checkin this fix?  Many thanks,
-Mike

(2nd attempt at mailing)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ipython-dev/attachments/20070719/0a9177a3/attachment.html>

From fperez.net at gmail.com  Thu Jul 19 20:07:16 2007
From: fperez.net at gmail.com (Fernando Perez)
Date: Thu, 19 Jul 2007 18:07:16 -0600
Subject: [IPython-dev] pyreadline vi mode fix
In-Reply-To: <dd33050b0707190921oc944640sbffca1a7c54844ad@mail.gmail.com>
References: <dd33050b0707190921oc944640sbffca1a7c54844ad@mail.gmail.com>
Message-ID: <db6b5ecc0707191707m7502e0e2oa489314a55d79277@mail.gmail.com>

On 7/19/07, Michael Graz <mg.graz at googlemail.com> wrote:
> Greetings all, LTNS.  When I enable vi mode (set_mode("vi") in
> ~/pyreadlineconfig.ini) there is an exception and then nothing works.
> However there is an easy fix in rlmain.py function parse_and_bind.

Thanks, Michael.  I see Jorgen already committed your fix.

Regards,

f


From fperez.net at gmail.com  Sat Jul 28 03:01:30 2007
From: fperez.net at gmail.com (Fernando Perez)
Date: Sat, 28 Jul 2007 01:01:30 -0600
Subject: [IPython-dev] New showmedo videos by Jeff Rush
Message-ID: <db6b5ecc0707280001s6be215c6x4f7a36a47d90c83f@mail.gmail.com>

Hi everyone,

Jeff Rush, the Python foundation advocacy lead, has just finished a
new series of ShowMeDo videos about ipython:

http://showmedo.com/videos/series?name=CnluURUTV

I have to admit that I (re)learned a few tricks watching it :)

I'd like to thank Jeff for the great work as well as Ian for ShowMeDo.
 And Ian has mentioned that there's a lot of interest in IPython
videos, so if any of you has a bit of time, this would be a great
little project with a guaranteed audience.

Here's more info about the process:

http://ipython.scipy.org/moin/ShowMeDo

feel free to edit that page with new ideas of a topic you'd either
want to see covered or would like to cover yourself (related to
ipython, I'm not trying to hijack the showmedo system :)

Cheers,

f