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

Ripping out ridiculous 'always' warning filter #21

Merged
merged 1 commit into from
Jan 29, 2015

Conversation

hwkns
Copy link
Contributor

@hwkns hwkns commented Jan 29, 2015

warnings.simplefilter('always')

  • This filter applies not just to the storages package, but to the entire Django project in which it's being used.
  • This filter causes warnings to be printed to the console every single time the code runs past them.

For example, the project I work on uses Django's strip_tags() function to create the text/plain part of multipart emails, and when using Django 1.6 and Python 3.3+, there are two DeprecationWarnings about impending changes to the HTMLParser API when strip_tags() is used:

/home/vagrant/.venv/lib/python3.4/site-packages/django/utils/html.py:121: DeprecationWarning: The strict argument and mode are deprecated.
  HTMLParser.__init__(self, strict=False)
/home/vagrant/.venv/lib/python3.4/site-packages/django/utils/html.py:121: DeprecationWarning: The value of convert_charrefs will become True in 3.5. You are encouraged to set the value explicitly.
  HTMLParser.__init__(self, strict=False)

These usages live in the Django codebase and are out of my control. Without django-storages-redux installed, I see these warnings once at the beginning of my unit test runs. After installing django-storages-redux, I see these warnings for nearly every test (almost 2,000 tests --> almost 4,000 warnings printed).

@jschneier
Copy link
Owner

Sorry about that, agreed.

jschneier added a commit that referenced this pull request Jan 29, 2015
Ripping out ridiculous 'always' warning filter
@jschneier jschneier merged commit 8d27109 into jschneier:master Jan 29, 2015
@jschneier
Copy link
Owner

I'll release 1.2.2 momentarily.

@hwkns
Copy link
Contributor Author

hwkns commented Jan 29, 2015

❤️

@jschneier
Copy link
Owner

Just released 1.2.2 to pypi.

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

Successfully merging this pull request may close these issues.

2 participants