[issue26062] IPython4 bash magic ! with {} does not work with Python 3.5.1

2016-01-09 Thread Christoph Böddeker

New submission from Christoph Böddeker:

Hello, 

I found a wrong behavior with IPython 4 in combination with Python 3.5.1. 

Normally in a command like "In [2]: !echo {a}" everything inside {} is 
interpreted with python and inserted to executed the line with bash. After I 
done a upgrade tp Python 3.5.1 this wasn't working. After a downgrade (3.5.0) 
it was working.

In the bottom is an example, where "In [2]: !echo {a}" are the important lines.
In [2]: !echo {a}
 * Python 3.5.0 -> 3
 * Python 3.5.1 -> {a}

Best regards
Christoph 

---
$ ipython
Python 3.5.1 |Anaconda 2.4.0 (64-bit)| (default, Dec  7 2015, 11:16:01) 
Type "copyright", "credits" or "license" for more information.

IPython 4.0.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help  -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: a = 3

In [2]: !echo {a}
{a}

In [3]: 
---
conda install python=3.5.0
Fetching package metadata: 
Solving package specifications: 
Package plan for installation in environment /opt/anaconda3:

The following packages will be DOWNGRADED:

python: 3.5.1-0 --> 3.5.0-1

Proceed ([y]/n)? y

Unlinking packages ...
[  COMPLETE  ]|###| 100%
Linking packages ...
[  COMPLETE  ]|###| 100%

---

$ ipython
Python 3.5.0 |Anaconda 2.4.0 (64-bit)| (default, Oct 19 2015, 21:57:25) 
Type "copyright", "credits" or "license" for more information.

IPython 4.0.0 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help  -> Python's own help system.
object?   -> Details about 'object', use 'object??' for extra details.

In [1]: a = 3

In [2]: !echo {a}
3

In [3]:

--
messages: 257833
nosy: Christoph Böddeker
priority: normal
severity: normal
status: open
title: IPython4 bash magic ! with {} does not work with Python 3.5.1
type: behavior
versions: Python 3.5

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26062] IPython4 bash magic ! with {} does not work with Python 3.5.1

2016-01-09 Thread SilentGhost

SilentGhost added the comment:

> It seems to me, that this change in python is not nessesary.

> I don't, know how to find the commit, message who has changed this and why.

It was done in issue 13598. It's a bit puzzling that IPython decided to depend 
on behaviour of a private method. I'd suggest you take it up with them.

--
nosy: +SilentGhost

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26062] IPython4 bash magic ! with {} does not work with Python 3.5.1

2016-01-09 Thread Emanuel Barry

Emanuel Barry added the comment:

The choice of IPython to depend on a private, undocumented method means that 
they are subject to such bugs. A quick Google search tells me you should 
probably report the issue here: https://github.com/ipython/ipython/issues

--
nosy: +ebarry
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26062] IPython4 bash magic ! with {} does not work with Python 3.5.1

2016-01-09 Thread Christoph Böddeker

Christoph Böddeker added the comment:

ok, thanks, I have opend there an issue 
https://github.com/ipython/ipython/issues/9120

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26062] IPython4 bash magic ! with {} does not work with Python 3.5.1

2016-01-09 Thread Brett Cannon

Brett Cannon added the comment:

Python itself has nothing to do with IPython's shell commands (i.e., !). It 
would be best to report this bug to IPython to have them fix it on their end.

--
nosy: +brett.cannon
resolution:  -> third party
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26062] IPython4 bash magic ! with {} does not work with Python 3.5.1

2016-01-09 Thread Christoph Böddeker

Christoph Böddeker added the comment:

That's true. Now I have finde the reason.

Someone has changed a function in lib/python3.5/string.py : _vformat.
This function returns now a tuple (befor it was only one return value).

IPython inherits from this object in 
lib/python3.5/site-packages/IPython/utils/text.py
Because of this change the IPython code is not working.

It seems to me, that this change in python is not nessesary.

I don't, know how to find the commit, message who has changed this and why.



Python 3.5.0:
def _vformat( ..., auto_arg_index=0):
...
format_spec = self._vformat( ..., auto_arg_index=auto_arg_index)
...
return ''.join(result)

Python 3.5.1:
def _vformat( ..., auto_arg_index=0):
...
format_spec, auto_arg_index = self._vformat( ..., 
auto_arg_index=auto_arg_index)
...
return ''.join(result), auto_arg_index

--
status: closed -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com