You are viewing a plain text version of this content. The canonical link for it is here.
Posted to mod_python-dev@quetz.apache.org by "Graham Dumpleton (JIRA)" <ji...@apache.org> on 2005/01/28 10:00:17 UTC

[jira] Commented: (MODPYTHON-9) mod_python.publisher does not support modules with the same name but in different directories

     [ http://issues.apache.org/jira/browse/MODPYTHON-9?page=comments#action_58210 ]
     
Graham Dumpleton commented on MODPYTHON-9:
------------------------------------------

Additional information from the mailing list which clarifies this issue.

Sticky modules obscuring real module
------------------------------------

Create and "index.py", "subdir-1/index.py" and "subdir-2/index.py" all
containing:

  import os
  def index():
    return os.getpid(),__file__

Now cycle through accessing these in the order:

  index.py
  subdir-1/index.py
  index.py
  subdir-2/index.py
  index.py
  subdir-1/index.py
  index.py
  subdir-2/index.py
  ...

In my case this is:

  /~grahamd/publisher
  /~grahamd/publisher/subdir-1
  /~grahamd/publisher
  /~grahamd/publisher/subdir-2
  /~grahamd/publisher
  /~grahamd/publisher/subdir-1
  /~grahamd/publisher
  /~grahamd/publisher/subdir-2
  /~grahamd/publisher
  ...

The result for this is:

  (521, '/Users/grahamd/Sites/publisher/index.py')
  (521, '/Users/grahamd/Sites/publisher/subdir-1/index.py')
  (521, '/Users/grahamd/Sites/publisher/subdir-1/index.py')
  (521, '/Users/grahamd/Sites/publisher/subdir-2/index.py')
  (521, '/Users/grahamd/Sites/publisher/subdir-2/index.py')
  (521, '/Users/grahamd/Sites/publisher/subdir-1/index.pyc')
  (521, '/Users/grahamd/Sites/publisher/subdir-1/index.pyc')
  (521, '/Users/grahamd/Sites/publisher/subdir-2/index.pyc')
  (521, '/Users/grahamd/Sites/publisher/subdir-2/index.pyc')

One can see that once one of the "index.py" files in the subdirectories is
accessed, they become sticky and the latest one accessed from a subdirectory
is returned instead of the top level one when it is accessed.

This one has got to be a bug.


> mod_python.publisher does not support modules with the same name but in different directories
> ---------------------------------------------------------------------------------------------
>
>          Key: MODPYTHON-9
>          URL: http://issues.apache.org/jira/browse/MODPYTHON-9
>      Project: mod_python
>         Type: Bug
>     Versions: 3.1.3
>     Reporter: Nicolas Lehuen
>     Assignee: Nicolas Lehuen
>      Fix For: 3.1.4

>
> Using mod_python.publisher, you have two modules :
> /index.py
> /subdir/index.py
> The problem is that due to the way published modules are imported, the resulting behaviour is unpredictable. Sometimes when calling /subdir/index.py the /index.py module is called, and vice versa.
> This bug is very annoying because new mod_python users encounter it frequently, and I don't think it gives good press to mod_python.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira