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

Python-Markdown calls logging.captureWarnings on import #384

Closed
mitya57 opened this issue Jan 30, 2015 · 6 comments
Closed

Python-Markdown calls logging.captureWarnings on import #384

mitya57 opened this issue Jan 30, 2015 · 6 comments

Comments

@mitya57
Copy link
Collaborator

mitya57 commented Jan 30, 2015

Forwarding from Debian bug 776591:

python-markdown in jessie calls logging.captureWarnings(True) on import,
unconditionally. For a library, this is unbelievably antisocial.
Logging should be left in control of the application.

Can I remove that maybe? That call is in two places: in __init__.py and extensions/headerid.py.

@waylan
Copy link
Member

waylan commented Jan 31, 2015

Just be sure that when the commandline script (defined in markdown__main__.py) runs, that captureWarnings is True. My recollection is that captureWarnings has to be set in the module the warnings are issued in, but perhaps I'm wrong about that. Have at it.

@mitya57
Copy link
Collaborator Author

mitya57 commented Jan 31, 2015

What should be the expected behaviour? When running the commandline script with, for example, -v and -x headerid, I don't get the warning about headerid being deprecated even with the current code.

Do you have a test case that I can use to make sure I don't change the commandline script behavior?

@waylan waylan closed this as completed in 17123ea Jan 31, 2015
@waylan
Copy link
Member

waylan commented Jan 31, 2015

@mitya57 by the time I figured out why the warnings weren't being logged, I had a solution, so I just committed it.

@mitya57
Copy link
Collaborator Author

mitya57 commented Jan 31, 2015

Thank you!

@waylan
Copy link
Member

waylan commented Jan 31, 2015

Oh and one other thing, if Debian doesn't want to wait for the next release, I don't see any reason why this one commit couldn't be backported as 2.5.3. Yes, I realize that they are listing the current version as 2.5.1-2 and would probably up the version to 2.5.1-3. Personally, I install all Python packages via pip not the system package manager (yes I realize not everyone does and there even some legitimate reasons to support both). I just am not interested in getting involved in the politics there and will always ignore Debian's weird insistence on some alternate version numbering system. Besides, they update to newer versions way to slowly for me. I want the latest stable release from the developer, not the lasted stable release from Debian (which can be multiple versions behind and likely has bugs fixed in later releases -- not so stable in my view). But that's just my personal opinion. Whatever they want to do.

@mitya57
Copy link
Collaborator Author

mitya57 commented Jan 31, 2015

Debian is frozen currently, so I can't do any updates in testing/unstable, and they will probably stay on 2.5.1.

2.5.2 is already available in experimental, and if you do another release I will put it there as well. But there is no need for you to do a new release just because of us.

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

No branches or pull requests

2 participants