atexit and tracing during teardown

20 views
Skip to first unread message

zooko

unread,
May 7, 2010, 12:14:05 PM5/7/10
to Coverage.py Development
I wrote a patch to remove the atexit handler:

http://bitbucket.org/zooko/coverage.py/changeset/4e7054a5a627

Ned didn't like it.

Later I had the same problem again in a different case (something
about uncaught exception or exception during exception handler I
think) and realized that the *real* problem is that coverage.py is
still attempting to do tracing after it has had part of its brain
turned off. This patch fixed that:

http://bitbucket.org/zooko/coverage.py/changeset/2a9e9e411314

This patch should remove the need for the no-atexit patch.

Regards,

Zooko

Ned Batchelder

unread,
May 8, 2010, 7:29:41 AM5/8/10
to coverag...@googlegroups.com
Zooko, thanks for finding the deeper reason, but I'm still a bit
baffled how you are invoking coverage that causes this problem. Do you
have a reproducible case?

--Ned.

Zooko O'Whielacronx

unread,
May 8, 2010, 2:28:48 PM5/8/10
to coverag...@googlegroups.com
On Sat, May 8, 2010 at 5:29 AM, Ned Batchelder <n...@nedbatchelder.com> wrote:
> Zooko,  thanks for finding the deeper reason, but I'm still a bit baffled
> how you are invoking coverage that causes this problem.  Do you have a
> reproducible case?

I'm sorry, I didn't make one.

It may have something to do with the way trial works different than
pyunit or nosetests.

What I'll do is revert that patch on my branch which I'm using in
production at simplegeo and let you know if I can reproduce the
problem.

Regards,

Zooko

Zooko O'Whielacronx

unread,
May 10, 2010, 12:34:08 AM5/10/10
to coverag...@googlegroups.com
On Sat, May 8, 2010 at 12:28 PM, Zooko O'Whielacronx <zoo...@gmail.com> wrote:

> What I'll do is revert that patch on my branch which I'm using in
> production at simplegeo and let you know if I can reproduce the
> problem.

I have a better idea! Please pull my branch from here:

http://bitbucket.org/zooko/coverage.py/overview

This branch should not have anything that you object to in it. I fixed
a couple of bugs revealed by the unit tests (as you earlier told me).

Then I can switch my workplace to using your tip. If you revert the
part about not tracing when os.path is None,

http://bitbucket.org/zooko/coverage.py/changeset/2a9e9e411314

then if that condition is still arising for us I'll see it happen and
this time I'll make a reproducible case of it.

Regards,

Zooko

Ned Batchelder

unread,
May 15, 2010, 7:49:47 PM5/15/10
to coverag...@googlegroups.com
I've transplanted your addition of --requires (but renamed it --include) onto the trunk.  I'll send a separate message about the details of that.

It looks like you've re-removed the atexit handler.  I definitely would like to get to the bottom of the trouble it's causing you.

--Ned.

Zooko O'Whielacronx

unread,
Jun 8, 2010, 8:51:53 PM6/8/10
to Ned Batchelder, coverag...@googlegroups.com
I guess I need to release a new version of zbase32 that doesn't try to
use this variant of "use_setuptools()"...

Meanwhile, you could work-around this by getting the zbase32 sdist and
commenting out the line about "use_setuptools()" in it and then
installing it.

Regards,

Zooko

Zooko O'Whielacronx

unread,
Jun 8, 2010, 9:16:49 PM6/8/10
to Ned Batchelder, coverag...@googlegroups.com
On Tue, Jun 8, 2010 at 6:51 PM, Zooko O'Whielacronx <zoo...@gmail.com> wrote:
> I guess I need to release a new version of zbase32 that doesn't try to
> use this variant of "use_setuptools()"...

Okay I've done so:

http://pypi.python.org/pypi/zbase32/1.1.2

Regards,

Zooko

Zooko O'Whielacronx

unread,
Jun 8, 2010, 10:23:46 PM6/8/10
to Ned Batchelder, coverag...@googlegroups.com
Unfortunately I don't know why it sometimes happens and sometimes
doesn't. It seems to be deterministic though -- if I have a set of
software on a machine where it happens then it happens every time
until I change the software.

I have trialcoverage on a hudson instance now (currently failing due
to a different problem) so I will hopefully stumble on a fully
reproducible instance of this soon:

http://ci.pub.simplegeo.com:8080/

Regards,

Zooko

Ned Batchelder

unread,
Jun 8, 2010, 8:33:31 PM6/8/10
to coverag...@googlegroups.com, Zooko O'Whielacronx
I saw your ticket #71 come in, and I tried to install trialcoverage to
try it out. It failed with this:

...
...
Installed c:\vpy\trialcov\lib\site-packages\trialcoverage-0.3.11-py2.6.egg
Processing dependencies for trialcoverage==0.3.11
Searching for zbase32>=1.0
Reading http://pypi.python.org/simple/zbase32/
Reading http://allmydata.org/trac/zbase32
Best match: zbase32 1.1.1
Downloading
http://pypi.python.org/packages/source/z/zbase32/zbase32-1.1.1.tar.gz#md5=b46a97a869f4aa2932182cc555e2f7e1
Processing zbase32-1.1.1.tar.gz
Running zbase32-1.1.1\setup.py -q bdist_egg --dist-dir
c:\users\batcheln\appdata\local\temp\easy_install-rvpqci\zbase32-
1.1.1\egg-dist-tmp-vmlu5o
Traceback (most recent call last):
File "setup.py", line 93, in <module>
test_suite='trialcoverage.test',
File "c:\python26\Lib\distutils\core.py", line 152, in setup
dist.run_commands()
File "c:\python26\Lib\distutils\dist.py", line 975, in run_commands
self.run_command(cmd)
File "c:\python26\Lib\distutils\dist.py", line 995, in run_command
cmd_obj.run()
File "build/bdist.linux-i686/egg/setuptools/command/install.py", line
76, in run
File "build/bdist.linux-i686/egg/setuptools/command/install.py", line
104, in do_egg_install
File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py",
line 211, in run
File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py",
line 427, in easy_install
File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py",
line 478, in install_item
File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py",
line 519, in process_distribution
File "build/bdist.linux-i686/egg/pkg_resources.py", line 563, in resolve
File "build/bdist.linux-i686/egg/pkg_resources.py", line 799, in
best_match
File "build/bdist.linux-i686/egg/pkg_resources.py", line 811, in obtain
File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py",
line 446, in easy_install
File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py",
line 476, in install_item
File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py",
line 655, in install_eggs
File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py",
line 930, in build_and_install
File "build/bdist.linux-i686/egg/setuptools/command/easy_install.py",
line 919, in run_setup
File "build/bdist.linux-i686/egg/setuptools/sandbox.py", line 62, in
run_setup
File "build/bdist.linux-i686/egg/setuptools/sandbox.py", line 105, in run
File "build/bdist.linux-i686/egg/setuptools/sandbox.py", line 64, in
<lambda>
File "setup.py", line 18, in <module>
use_setuptools(download_delay=0)
TypeError: use_setuptools() got an unexpected keyword argument 'min_version'


Any advice?

--Ned.

Ned Batchelder

unread,
Jun 8, 2010, 10:11:05 PM6/8/10
to coverag...@googlegroups.com, Zooko O'Whielacronx
Thanks, I've got trialcoverage fully installed and running its tests.
I've tried changing a failIf to failUnless to get a test to fail, and I
don't see the atexit issue. Do you know how the tests had been failing
to get the issue to appear?

--Ned.

Reply all
Reply to author
Forward
0 new messages