#8754: PYTHONPATH not passed through to
regressiontests/admin_scripts/AdminScriptTestCase.run_test()
-----------------------------------------------------------------------+----
Reporter: Richard Davies <[email protected]> |
Owner: nobody
Status: new |
Milestone: 1.1
Component: Testing framework |
Version: SVN
Resolution: |
Keywords:
Stage: Accepted |
Has_patch: 1
Needs_docs: 0 |
Needs_tests: 0
Needs_better_patch: 0 |
-----------------------------------------------------------------------+----
Changes (by Richard Davies <[email protected]>):
* milestone: => 1.1
Comment:
Apologies - I had assumed that Jacob's "Accepted" was in reply to Karen.
I'm not a Jython user, but have now read Karen's comments and references.
There are two scenarios:
A) external database backends (which all of the patches refer to. so is
presumably more common),
B) built-in database backends which need to import the actual database
driver (i.e. psycopg itself; my case)
In either case, PYTHONPATH, etc. may be needed to locate the relevant
modules.
r8149 identified problem A, fixed for standard Python it by passing
PYTHONPATH through, and hence also fixed B.
r8238 realized that the above did not work for Jython of that time, where
PYTHONPATH is not used and JYTHONPATH did not yet exist. Hence it replaced
r8149 with _ext_backend_path() which locates external database backends
under either Python or Jython. This fixes A on Jython too, but
coincidentally breaks B on both platforms.
r8400 doesn't address either A or B. It deal with the fact that Jython
started to support configuration using JYTHONPATH (rather than
-J-Dpython.path=), and hence we should be using that to configure the
subprocesses. I think the comment on #8268 that Karen refers to is poorly
phrased - JYTHONPATH does not need to be cleared for subprocesses (and
indeed is not today!), but rather should be set and reset just like
PYTHONPATH. [**] What I'm not clear about with r8400 is whether we can not
safely __read__ JYTHONPATH, as well as __writing__ to it. If this were the
case, then we could back out all the complexity of r8238 and
_ext_backend_path() completely.
So, in conclusion, r8238 did indeed inadvertently break scenario B (only
scenario A was considered). I don't believe that there is ever any danger
in adding to the end of either PYTHONPATH or JYTHONPATH - the code was
just removed for cleanliness, given that _ext_backend_path() was meant to
provide the same functionality.
Given that _ext_backend_path() does not in fact provide this functionality
in scenario B, my original patch remains a valid fix, under Python or (I
believe) Jython.
--
Ticket URL: <http://code.djangoproject.com/ticket/8754#comment:7>
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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---