fedora-python / pyp2rpm

Tool to convert a package from PyPI to RPM SPECFILE or to generate SRPM.
MIT License
125 stars 39 forks source link

DandifiedNameConvertor causes stack overflow #78

Closed mcyprian closed 7 years ago

mcyprian commented 7 years ago

When the instance of DandifiedNameConvertor is created in interactive mode it causes stack overflow unless pyp2rpm.settings.CONSOLE_LOGGING is set to True explicitly:

In [1]: from pyp2rpm.name_convertor import DandifiedNameConvertor
In [2]: nc = DandifiedNameConvertor('fedora')
Fatal Python error: Cannot recover from stack overflow.
...

The reason of this issue is recursive redirection of stdout to log and log to stdout.

hroncok commented 7 years ago

Can we only redirect stdout to log when the logging is enabled?