Error with trace.py

Discussion in 'Python' started by Felix Wiemann, Apr 13, 2004.

  1. $ cat test.py
    print "Hello World!"
    if 0:
    print "Never executed."
    if 1:
    print "Hi."

    $ python test.py
    Hello World!
    Hi.

    $ python /usr/lib/python2.3/trace.py --count test.py
    Hello World!
    Hi.
    trace: Could not open '/usr/lib/python2.3/threading.cover' for writing: [Errno 13] Permission denied: '/usr/lib/python2.3/threading.cover'- skipping
    Traceback (most recent call last):
    File "/usr/lib/python2.3/trace.py", line 690, in ?
    main()
    File "/usr/lib/python2.3/trace.py", line 687, in main
    results.write_results(missing, summary=summary, coverdir=coverdir)
    File "/usr/lib/python2.3/trace.py", line 271, in write_results
    lnotab, count)
    TypeError: unpack non-sequence

    Why doesn't it work?

    By the way, after running trace.py, there is a file test.cover in the
    directory:

    $ cat test.cover
    1: print "Hello World!"
    if 0:
    print "Never executed."
    1: if 1:
    1: print "Hi."

    --
    http://www.ososo.de/
     
    Felix Wiemann, Apr 13, 2004
    #1
    1. Advertising

  2. > Why doesn't it work?

    well, are you running as non-root, but trace.py is trying to write to
    a directory that only root has access to?

    I tried the example under Windows, since under Linux I only have
    Python 2.2 which doesn't have trace.py.

    ---
    D:\data\python>python d:\python23\lib\trace.py -c -f
    d:\data\python\counts test1.py

    creates a file counts and a file test.cover. The former is a binary
    file, while the latter is a marked-up version of the input file.

    S
     
    Stewart Midwinter, Apr 14, 2004
    #2
    1. Advertising

  3. Stewart Midwinter schrieb:

    > well, are you running as non-root, but trace.py is trying to write to
    > a directory that only root has access to?


    Yes, obviously. :)

    > I tried the example under Windows
    >
    > D:\data\python>python d:\python23\lib\trace.py -c -f d:\data\python\counts test1.py


    Doesn't work either.

    But I found out that it works when using "--coverdir=.":

    $ python /usr/lib/python2.3/trace.py --count --coverdir=. test.py

    --
    http://www.ososo.de/
     
    Felix Wiemann, Apr 14, 2004
    #3
  4. Stewart> I tried the example under Windows, since under Linux I only
    Stewart> have Python 2.2 which doesn't have trace.py.

    I believe it's there, just under Tools/scripts.

    Skip
     
    Skip Montanaro, Apr 15, 2004
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Rukmal Fernando
    Replies:
    4
    Views:
    862
    Richard Grimes [MVP]
    Oct 27, 2003
  2. Matthias S.
    Replies:
    1
    Views:
    667
    Daniel Fisher\(lennybacon\)
    Nov 30, 2005
  3. Jiho Han
    Replies:
    0
    Views:
    531
    Jiho Han
    Aug 22, 2006
  4. =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?=

    Adding my messages to the trace.axd trace?

    =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?=, Apr 6, 2007, in forum: ASP .Net
    Replies:
    3
    Views:
    602
    =?Utf-8?B?RGF2aWQgVGhpZWxlbg==?=
    Apr 6, 2007
  5. Chris Newby
    Replies:
    0
    Views:
    776
    Chris Newby
    Jul 28, 2008
Loading...

Share This Page