#10966: Management module imports project_module, considered evil -------------------------------------+-------------------------------------- Reporter: patrys | Owner: nobody Status: new | Milestone: Component: Core framework | Version: SVN Resolution: | Keywords: Stage: Unreviewed | Has_patch: 1 Needs_docs: 1 | Needs_tests: 1 Needs_better_patch: 0 | -------------------------------------+-------------------------------------- Comment (by c...@zetaweb.com):
patrys, Actually, simply removing the `__import__` call ''wouldn't'' be backwards compatible, because `setup_environ` has to add the parent directory to `sys.path` in order for `__import__` to work. It then removes this path immediately. The options seem to be: 1. Add the path and leave it there, but don't `__import__`. 2. Don't add the path and don't `__import__`. 3. Add/`__import__`/remove, but conditionally (per patch). !#1: You end up with at least a wart (an extraneous path on `sys.path`), and at most a bug (if siblings directories of the project are accidentally imported). !#2: This breaks the current behavior, forcing users to take the extra step of manually adding their project's parent directory to PYTHONPATH before using their project as a module. I think this is a no-go. !#3: I think this is the safest way to go. It exactly preserves current behavior, unless the user takes an explicit step to disable that behavior. chad -- Ticket URL: <http://code.djangoproject.com/ticket/10966#comment:8> Django <http://code.djangoproject.com/> The Web framework for perfectionists with deadlines. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django updates" group. To post to this group, send email to django-updates@googlegroups.com To unsubscribe from this group, send email to django-updates+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/django-updates?hl=en -~----------~----~----~----~------~----~------~--~---