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

Projects
None yet
2 participants
@hwkns
Copy link
Contributor

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

This comment has been minimized.

Copy link
Owner

commented Jan 29, 2015

Sorry about that, agreed.

jschneier added a commit that referenced this pull request Jan 29, 2015

Merge pull request #21 from hwkns/master
Ripping out ridiculous 'always' warning filter

@jschneier jschneier merged commit 8d27109 into jschneier:master Jan 29, 2015

@jschneier

This comment has been minimized.

Copy link
Owner

commented Jan 29, 2015

I'll release 1.2.2 momentarily.

@hwkns

This comment has been minimized.

Copy link
Contributor Author

commented Jan 29, 2015

❤️

@jschneier

This comment has been minimized.

Copy link
Owner

commented Jan 29, 2015

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
You can’t perform that action at this time.