6 ms·
Ubuntu Python: raise an exception, import 190 modules
- Kliment 17y agoVery useful. I was trying to freeze a Python module the other day and this exact madness happened. Now it makes sense.
- Erwin 17y agoThis affects the exception that causes the program to exit only. It does not affect exceptions caught and handled.
- gjm11 17y agoNot quite. Indeed it doesn't affect exceptions that are caught and handled; but in interactive Python use it affects exceptions that reach the toplevel (producing a traceback message) even though that doesn't make Python exit.
- amackera 17y agoYeah but in interactive Python, 60ms is not a long time.
- prodigal_erik 17y agoI'd be cranky if I were signed in to troubleshoot a busy production server and accidentally opened two hundred files because of one typo. Especially if it's uncommon stuff that probably isn't in the buffer cache.
- ajross 17y agoThis is a misdiagnosis. The fancy handling is invoked only when the exception reaches the top level (i.e. when the python interpreter is about to exit anyway). It is not done when an exception is raised, and adds no overhead to code that uses exceptions at runtime. Think of it as similar to the bash handler that searches for known executable names on failed commands and prompts you for an apt-get line to install the software. It takes significant time, but only runs on error.
- vladev 17y agoHmm. Using iPython ot bpython causes the modules to be 200+ from the start.
- ConceptDog 17y agoI love Ubuntu, particularly the package management, but the magical stuff they do in packages is extremely frustrating. The base PHP module includes suhosin, while there's also a suhosin module which just places the configuration file, that should be there by default. Suhosin can cause apps to run amock if you're dealing with large arrays or big posts. It's a nice to have feature, but it's also a feature that needs to be disclosed to a developer before trying to develop against it. Anything that modifies the behavior of the base language needs to be explicitly called out when the package is installed.
- mey 17y agoUbuntu also inherits Debian's wonky RubyGems approach. http://pkg-ruby-extras.alioth.debian.org/rubygems.html http://pkg-ruby-extras.alioth.debian.org/rubygems.html