[Python-modules-team] Bug#841726: ipython3: importing something from ipython has side effects

2016-10-25 Thread Dominik George
Hi,

> > Certainly, a module breaking the core Python interpreter qualifys for
> > "makes unrelated software break"?
> A module breaking the core Python interpreter only after being imported? 
> Do you have any other scenarios apart from "import all modules" ones?

Well, not technically, but, as already mentioned, "importing all modules" is
what completely normal things in core Python do when you don't expect it,
like help("modules").  Look at this:

8>< -- Console log -- ><8
nik@portux ~ % python3
Python 3.5.2+ (default, Sep 22 2016, 12:18:14) 
[GCC 6.2.0 20160927] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> help("modules")

Please wait a moment while I gather a list of all available modules...

[…] Warnings from other misbehaving modules […]

[…] list of modules […]

Enter any module name to get more help.  Or, type "modules spam" to search
for modules whose name or summary contain the string "spam".

In : <-- ipdb shell here - and no Python help shell anymore!
8>< -- Console log -- ><8

It is arguable that importing all modules is bad, but it is a sad fact that
it is necessary to gather enough information about a module, and it is
another sad fact that Python has to do it in things like its online help
system.  While this certainly is something that has to be changed, I think
that module developers have to cope with the fact right now and do their
best to not wreak havoc in such a way as the one depicted above.

Cheers,
Nik

-- 
PGP-Fingerprint: 3C9D 54A4 7575 C026 FB17  FD26 B79A 3C16 A0C4 F296

Dominik George · Hundeshagenstr. 26 · 53225 Bonn
Mobile: +49-1520-1981389 · https://www.dominik-george.de/

Teckids e.V. · FrOSCon e.V.
Fellowship of the FSFE · Piratenpartei Deutschland
Opencaching Deutschland e.V. · Debian Contributor

LPIC-3 Linux Enterprise Professional (Security)


signature.asc
Description: PGP signature
___
Python-modules-team mailing list
Python-modules-team@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/python-modules-team

[Python-modules-team] Bug#841726: ipython3: importing something from ipython has side effects

2016-10-25 Thread Andrey Rahmatullin
On Tue, Oct 25, 2016 at 01:48:00PM +0200, Dominik George wrote:
> >Control: severity -1 wishlist
> 
> Huh? The definition of the critical severity is very clear.
> 
> Certainly, a module breaking the core Python interpreter qualifys for "makes 
> unrelated software break"?
A module breaking the core Python interpreter only after being imported?
Do you have any other scenarios apart from "import all modules" ones?

-- 
WBR, wRAR


signature.asc
Description: PGP signature
___
Python-modules-team mailing list
Python-modules-team@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/python-modules-team

[Python-modules-team] Bug#841726: ipython3: importing something from ipython has side effects

2016-10-25 Thread Andrey Rahmatullin
Control: severity -1 wishlist

Please explain to the upstream how do you want the module to behave.

-- 
WBR, wRAR


signature.asc
Description: PGP signature
___
Python-modules-team mailing list
Python-modules-team@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/python-modules-team

[Python-modules-team] Bug#841726: ipython3: importing something from ipython has side effects

2016-10-25 Thread Dominik George
>Control: severity -1 wishlist

Huh? The definition of the critical severity is very clear.

Certainly, a module breaking the core Python interpreter qualifys for "makes 
unrelated software break"?

pgpwzXynlxrS6.pgp
Description: PGP signature
___
Python-modules-team mailing list
Python-modules-team@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/python-modules-team

[Python-modules-team] Bug#841726: ipython3: importing something from ipython has side effects

2016-10-23 Thread Chris Lamb
Dominik George wrote:

> I wouldn't open an RC bug against python-apt because it calls init_config(),

Sure; I explained poorly — packages that *use* apt_pkg would call init_config()
which presumably has side-effects (?), not python-apt itself…

There's no need to check this specific instance, it's just one example of a
potential side-effects that mean importing everything is, alas, by design
broken. Don't forget all the other import-time monkey-patching, etc. too.


Regards,

-- 
  ,''`.
 : :'  : Chris Lamb
 `. `'`  la...@debian.org / chris-lamb.co.uk
   `-

___
Python-modules-team mailing list
Python-modules-team@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/python-modules-team

[Python-modules-team] Bug#841726: ipython3: importing something from ipython has side effects

2016-10-23 Thread Dominik George
> There's no need to check this specific instance, it's just one example of a
> potential side-effects that mean importing everything is, alas, by design
> broken. Don't forget all the other import-time monkey-patching, etc. too.

Totally agreed.

-nik

-- 
PGP-Fingerprint: 3C9D 54A4 7575 C026 FB17  FD26 B79A 3C16 A0C4 F296

Dominik George · Hundeshagenstr. 26 · 53225 Bonn
Mobile: +49-1520-1981389 · https://www.dominik-george.de/

Teckids e.V. · FrOSCon e.V.
Fellowship of the FSFE · Piratenpartei Deutschland
Opencaching Deutschland e.V. · Debian Contributor

LPIC-3 Linux Enterprise Professional (Security)


signature.asc
Description: PGP signature
___
Python-modules-team mailing list
Python-modules-team@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/python-modules-team

[Python-modules-team] Bug#841726: ipython3: importing something from ipython has side effects

2016-10-23 Thread Dominik George
Hi,

> > Besides speech-dispatcher, against which I also reported a bug, I do not
> > have any packages on my system that show such behaviour.
> 
> Oh, really?  But surely some of them adjust sys.path (probably the most
> common?) as well as importing shared libraries and running stuff like
> ``apt_pkg.init_config()``.
> 
> The side-effects might be more subtle but they are still, alas, side-
> effects.

Yep.  That's not good either, but it doesn't make unrelated software, let
alone the core interpreter, misbehave (i.e. take control from it).

I wouldn't open an RC bug against python-apt because it calls init_config(),
but I did against speech-dispatcher because it configures argparse and
consumes sys.args and I did against ipython bacause it takes control over
parts of the core interpreter.

-nik

-- 
PGP-Fingerprint: 3C9D 54A4 7575 C026 FB17  FD26 B79A 3C16 A0C4 F296

Dominik George · Hundeshagenstr. 26 · 53225 Bonn
Mobile: +49-1520-1981389 · https://www.dominik-george.de/

Teckids e.V. · FrOSCon e.V.
Fellowship of the FSFE · Piratenpartei Deutschland
Opencaching Deutschland e.V. · Debian Contributor

LPIC-3 Linux Enterprise Professional (Security)


signature.asc
Description: PGP signature
___
Python-modules-team mailing list
Python-modules-team@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/python-modules-team

[Python-modules-team] Bug#841726: ipython3: importing something from ipython has side effects

2016-10-23 Thread Chris Lamb
Dominik George wrote:

> Besides speech-dispatcher, against which I also reported a bug, I do not
> have any packages on my system that show such behaviour.

Oh, really? But surely some of them adjust sys.path (probably the most
common?) as well as importing shared libraries and running stuff like 
``apt_pkg.init_config()``.

The side-effects might be more subtle but they are still, alas, side-
effects.


Regards,

-- 
  ,''`.
 : :'  : Chris Lamb
 `. `'`  la...@debian.org / chris-lamb.co.uk
   `-

___
Python-modules-team mailing list
Python-modules-team@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/python-modules-team


[Python-modules-team] Bug#841726: ipython3: importing something from ipython has side effects

2016-10-22 Thread Dominik George
> Not at all.  This is the only way to get a list of all available Python
> packages, and it is even what core Python's help("modules") does.

And no, I do not like that either ☹.  But it's a matter of sad fact.

-- 
PGP-Fingerprint: 3C9D 54A4 7575 C026 FB17  FD26 B79A 3C16 A0C4 F296

Dominik George · Hundeshagenstr. 26 · 53225 Bonn
Mobile: +49-1520-1981389 · https://www.dominik-george.de/

Teckids e.V. · FrOSCon e.V.
Fellowship of the FSFE · Piratenpartei Deutschland
Opencaching Deutschland e.V. · Debian Contributor

LPIC-3 Linux Enterprise Professional (Security)


signature.asc
Description: PGP signature
___
Python-modules-team mailing list
Python-modules-team@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/python-modules-team

[Python-modules-team] Bug#841726: ipython3: importing something from ipython has side effects

2016-10-22 Thread Dominik George
Hi,

> Many, many Python packages have import-time side-effects that are
> far more suble than this. Whilst this a regrettable state of affairs,
> fixing them all is just not possible anymore.

Well, this bug report is about this specific bug, not all bugs of this kind.

> 
> A script that imports all packages installed on a system as you
> suggest seems to be the problem, rather than ipython itself.

Not at all.  This is the only way to get a list of all available Python
packages, and it is even what core Python's help("modules") does.  So, when
ipython is installed, running help("modules") in a pure python3 interpreter
modifes the execution environment for good, in such a way that it drops to
an IPython shell at any point as it likes.

Besides speech-dispatcher, against which I also reported a bug, I do not
have any packages on my system that show such behaviour.

-nik

-- 
PGP-Fingerprint: 3C9D 54A4 7575 C026 FB17  FD26 B79A 3C16 A0C4 F296

Dominik George · Hundeshagenstr. 26 · 53225 Bonn
Mobile: +49-1520-1981389 · https://www.dominik-george.de/

Teckids e.V. · FrOSCon e.V.
Fellowship of the FSFE · Piratenpartei Deutschland
Opencaching Deutschland e.V. · Debian Contributor

LPIC-3 Linux Enterprise Professional (Security)


signature.asc
Description: PGP signature
___
Python-modules-team mailing list
Python-modules-team@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/python-modules-team

[Python-modules-team] Bug#841726: ipython3: importing something from ipython has side effects

2016-10-22 Thread Chris Lamb
Hi,

> ipython3: importing something from ipython has side effects

Many, many Python packages have import-time side-effects that are
far more suble than this. Whilst this a regrettable state of affairs,
fixing them all is just not possible anymore.

A script that imports all packages installed on a system as you
suggest seems to be the problem, rather than ipython itself.

(Thus I don't believe this bug warrants RC severity, but I'll let
someone else change it)


Regards,

-- 
  ,''`.
 : :'  : Chris Lamb
 `. `'`  la...@debian.org / chris-lamb.co.uk
   `-

___
Python-modules-team mailing list
Python-modules-team@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/python-modules-team


[Python-modules-team] Bug#841726: ipython3: importing something from ipython has side effects

2016-10-22 Thread Dominik George
Package: ipython3
Version: 2.4.1-1
Severity: critical
Justification: breaks unrelated software

-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256

Importing ipython in any other Python script has side effects.  This is
sometimes done, e.g.  in situations where a script wants to list all
packages installed on a system, like so:

  import pkgutil
  for i in pkgutil.walk_packages(onerror=lambda x: None):
pass

Python imports all packages discovered by that once, and simply importing
something must not have any side effects.

However, Python drops into an IPython shell afterwards and also behaves
oddly in other ways.

- -- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.7.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/lksh
Init: systemd (via /run/systemd/system)

Versions of packages ipython3 depends on:
ii  python3-decorator  4.0.6-1
ii  python3-pkg-resources  28.0.0-1
ii  python3-simplegeneric  0.8.1-1
pn  python3:any

ipython3 recommends no packages.

Versions of packages ipython3 suggests:
pn  ipython3-notebook   
pn  ipython3-qtconsole  
pn  python3-zmq 

- -- no debconf information

-BEGIN PGP SIGNATURE-

iQJhBAEBCABLBQJYC7K0MRpodHRwczovL3d3dy5kb21pbmlrLWdlb3JnZS5kZS9n
cGctcG9saWN5LnR4dC5hc2MSHG5pa0BuYXR1cmFsbmV0LmRlAAoJELeaPBagxPKW
GtYP/iI33ljNoBwJiBFclSShKCH08rlf8Sdthrd9ylC0hrkKXEbndRt1serItEeF
oTaf8wxN+GkxgCJk3Zr0Omks64HAM+QBNoTghXgwyLVYZNvSj5dGxkA84zvJQr/3
th4SJur8bGseUayOI1FMDV8dN2sxjV3ZcKrIbsl8oXeEnVyykT9fAbfpmAhlKDVv
TU0R1DocD9eCU60BGDxN/Fykr5n8EyQOkU1ct6SFB2v+HsLzFFEKMcOXFAK1wvRZ
GoPjh1LJwfLv50Lyjpurr17wzpVA2yF6I8hWtBBZ6/g8UllvnB6BEw4+EVRBiSE2
pek37QSU8scYQqgeNodqZx4AZqnQvMsYx78YHT7maVElMfkydfNT84iKBCTPda+f
gExl8nVcHF1ycfPogRIapdsvaIKdkui9B8zmz2PG16ddHovTzUA1y5IAswgLOdBU
yKksASUV8U3hsvPr+WI0VqBHitraufpzosuTNJLuVspbd8QTdCtfPqOVRvznMDUJ
xgJ45QmxYpn1KA1G6ltBRyUtmZiQSIqzLlB3u4s+sHpU1ffHjNZ2/mvdWYTsqj21
ExdQrefckQCg9usD68bWpZ3vfckTZYd6kYmxG9qRircgWRH6dxbbB4cyHh0RU/g5
OBPzk9wdbBH48ncO7xIMHGi/dm8H3WPw0+axug5EWWnTg3rM
=20Ku
-END PGP SIGNATURE-

___
Python-modules-team mailing list
Python-modules-team@lists.alioth.debian.org
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/python-modules-team