﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
36961	django_file_prefixes() raises TypeError if Django is imported by namespace	Jacob Walls	Jacob Walls	"cd one level above your django checkout, and launch a python shell.

Calling django_file_prefixes will fail:

{{{#!py
>>> import django
>>> django.__file__ is None
True
>>> from django.utils.deprecation import django_file_prefixes
>>> django_file_prefixes()
Traceback (most recent call last):
  File ""<python-input-1>"", line 5, in <module>
    django_file_prefixes()
    ~~~~~~~~~~~~~~~~~~~~^^
  File ""/Users/jwalls/django/django/utils/deprecation.py"", line 18, in django_file_prefixes
    return (os.path.dirname(file),)
            ~~~~~~~~~~~~~~~^^^^^^
  File ""<frozen posixpath>"", line 178, in dirname
TypeError: expected str, bytes or os.PathLike object, not NoneType
}}}
----
How I found this was by testing deprecation warnings, so what I'm concluding is that deprecation warnings might crash in 6.0 if you import Django by namespace."	Bug	closed	Utilities	6.0	Release blocker	fixed			Ready for checkin	1	0	0	0	0	0
