Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'ellipsis' object has no attribute 'items' #73

Open
ajamato opened this issue Sep 3, 2021 · 1 comment
Open

AttributeError: 'ellipsis' object has no attribute 'items' #73

ajamato opened this issue Sep 3, 2021 · 1 comment

Comments

@ajamato
Copy link

ajamato commented Sep 3, 2021

I encountered this when trying to run

gprof2dot -f pstats <file>

Traceback (most recent call last):
  File "/home/ajamato/.local/bin/gprof2dot", line 8, in <module>
    sys.exit(main())
  File "/home/ajamato/.local/lib/python3.9/site-packages/gprof2dot.py", line 3457, in main
    parser = Format(*args)
  File "/home/ajamato/.local/lib/python3.9/site-packages/gprof2dot.py", line 2685, in __init__
    self.stats = pstats.Stats(*filename)
  File "/usr/lib/python3.9/pstats.py", line 114, in __init__
    self.init(arg)
  File "/usr/lib/python3.9/pstats.py", line 130, in init
    self.get_top_level_stats()
  File "/usr/lib/python3.9/pstats.py", line 159, in get_top_level_stats
    for func, (cc, nc, tt, ct, callers) in self.stats.items():
AttributeError: 'ellipsis' object has no attribute 'items'

Unfortunately I can't share the file.
I am not sure if its related to the input files or not. But if you have any ideas what to look for I can look at the file and share findings to help debug

From pip list:
gprof2dot 2021.2.21

I also did try to load the sample pstat files on this repro, but got this error as well. Perhaps there is some reason this version can't process those files?

gprof2dot -f pstats cProfile.pstats 
error: failed to load cProfile.pstats, maybe they are generated by different python version?
gprof2dot -f pstats profile.pstats 
error: failed to load profile.pstats, maybe they are generated by different python version?

I also downloaded the standalone version and got that error as well

~/gprof2dot.py -f pstats profile.pstats 
error: failed to load profile.pstats, maybe they are generated by different python version?

/usr/bin/env python3 --version
Python 3.9.2
@jrfonseca
Copy link
Owner

The only explanation I see is different Python versions. If you used Python 2 when capturing the stat files, then try invoking gprof2dot as

python2 gprof2dot.py -f pstats cProfile.pstats

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants