vpelletier / pprofile

Line-granularity, thread-aware deterministic and statistic pure-python profiler
GNU General Public License v2.0
447 stars 28 forks source link

No cStringIO on Python 3 #26

Closed jakirkham closed 6 years ago

jakirkham commented 6 years ago

Appears that zpprofile is importing cStringIO, which does not exist as named on Python 3.

import: 'zpprofile'
Traceback (most recent call last):
  File "/home/conda/feedstock_root/build_artifacts/pprofile_1531119090784/test_tmp/run_test.py", line 5, in <module>
    import zpprofile
  File "/home/conda/feedstock_root/build_artifacts/pprofile_1531119090784/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold/lib/python3.6/site-packages/zpprofile.py", line 69, in <module>
    from cStringIO import StringIO
ModuleNotFoundError: No module named 'cStringIO'

ref: https://circleci.com/gh/conda-forge/pprofile-feedstock/10 ref: https://github.com/vpelletier/pprofile/blob/1.11.0/zpprofile.py#L69 ref: https://stackoverflow.com/a/18284900

vpelletier commented 6 years ago

The intended way to install pprofile is via running setup.py using the target python version, which when run on python3 invokes 2to3, which should replace all incompatibilities.

This said, python2.7 has io.StringIO, so it would be one thing less to replace by 2to3, so I will likely do this replacement.

vpelletier commented 6 years ago

This said, python2.7 has io.StringIO, so it would be one thing less to replace by 2to3, so I will likely do this replacement.

Implemented in b597894f7fb1dc342dc6df0f1b430b0eb9861487 .

jakirkham commented 6 years ago

...when run on python3 invokes 2to3...

Huh missed that. Thanks for pointing that out.