This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author davin
Recipients belopolsky, bli, davin, eric.snow, ezio.melotti, flox, georg.brandl, ncoghlan, serhiy.storchaka, tati_alchueyr
Date 2017-01-30.14:08:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Though this issue is specifically concerned with runpy APIs and their impact especially in running unittest test scripts, it's worth commenting here for people who need a workaround in the short term:  code such as that shared in can be made to run happily by creating a second script which imports the first and simply runs the test(s) from there.

In the specific case of the '' from, one would create a '' with the contents:

from forkiter import main

if __name__ == "__main__":

Now this invocation of cProfile runs happily because pickle is able to see the module where all the needed classes/functions were defined:
python3.6 -m cProfile -o ./
Date User Action Args
2017-01-30 14:08:10davinsetrecipients: + davin, georg.brandl, ncoghlan, belopolsky, ezio.melotti, flox, eric.snow, serhiy.storchaka, tati_alchueyr, bli
2017-01-30 14:08:10davinsetmessageid: <>
2017-01-30 14:08:10davinlinkissue9914 messages
2017-01-30 14:08:10davincreate