[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.python

Re: Odd behaviour of *.pth files and Apache

Gabriel Genellina

2/27/2008 12:38:00 AM

En Tue, 26 Feb 2008 11:44:48 -0200, D'Arcy J.M. Cain <darcy@druid.net>
escribió:
> On Tue, 26 Feb 2008 03:01:33 -0200
> "Gabriel Genellina" <gagsl-py2@yahoo.com.ar> wrote:
>> En Sat, 23 Feb 2008 12:52:45 -0200, D'Arcy J.M. Cain <darcy@druid.net>
>> escribió:

>> > I have more information now. It seems that it recurses the .pth files
>> > it finds in PYTHONPATH but not for directories found in the .pth files
>> > in site-packages. Is this expected behaviour? The documentation
>> > suggests that it should pick up both.
>>
>> If a .pth file contains a valid directory, it is added to sys.path but
>> it's not searched for additional .pth files. From
>> http://docs.python.org/lib/module...
>>
>> "A path configuration file is a file whose name has the form
>> package.pth
>> AND EXISTS IN ONE OF THE FOUR DIRECTORIES MENTIONED ABOVE" (emphasis by
>> me)
>>
>> (the four directories being .../lib/python2.5/site-packages,
>> site-python,
>> etc.)
>
> But that is not true. If I add a path by setting PYTHONPATH and there
> is a .pth in that directory then it is read and recursively searched
> for more .pth files. It is only when the path is added because it is
> in site-packages that it doesn't load the .pth files found.

This is not the behavior I see, at least not with 2.5.1 on Windows.

> In http://www.python.org/doc/inst/search... there is
> more specific language:
>
> "Paths can be absolute or relative, in which case they're relative to
> the directory containing the .pth file. Any directories added to the
> search path will be scanned in turn for .pth files. See site module
> documentation for more information."
>
> Directories listed in .pth files in site-packages are "added to the
> search path" so they should be scanned for more .pth files.

There was a proposed patch to do that, rejected, basically because doing
so could potentially slow down the interpreter start up; see
http://bugs.python.org/iss... PEP 370
http://www.python.org/dev/peps... if approved, may be useful to you.

Note that you can always do the processing in sitecustomize.py, calling
site.addsitedir for all entries in sys.path until no more entries are
added.

> This really smells like a bug in either the code or the docs. I hope
> it is in the code and will eventually be fixed.

Looks like the docs are wrong; the code in site.py, its docstring, and the
above quoted docs are slightly different.

--
Gabriel Genellina

22 Answers

SpambustR

1/6/2013 2:39:00 AM

0

On 05/01/2013 11:19 AM, Swag wrote:


--
SPAMMED TO NON-RELEVANT NEWSGROUPS - AND CUT

SpambustR

1/6/2013 2:40:00 AM

0

On 05/01/2013 7:05 AM, NoBody wrote:


--
SPAMMED TO NON-RELEVANT NEWSGROUPS - AND CUT

SpambustR

1/6/2013 2:40:00 AM

0

On 05/01/2013 7:04 AM, NoBody wrote:


--
SPAMMED TO NON-RELEVANT NEWSGROUPS - AND CUT

AlleyCat

1/6/2013 4:01:00 AM

0

On Sat, 05 Jan 2013 16:00:24 -0700, In article
<3vbhe8hrgk3uf4hpgh38r4mki6oid4diic@4ax.com>, Yoorghis@Jurgis.net
says...

> Every night.

Where's the lie, homo? Damn... ask a homo to give me ONE example of Fox
lying on purpose to deceive it's viewers, and the troll can't come
through. No wonder you leftards have zero credibility... you have to lie
to get things done, just like Obama did to get elected.
Pathetic, dork, just pathetic.

One lie... that's all I'm asking, and you can't do it. You fail.

--
Check for Children Redirecting Newsgroups

John Doe

1/7/2013 10:40:00 AM

0

On Sat, 05 Jan 2013 09:41:20 -0700, Yoorghis@Jurgis.net wrote:

>On Sat, 05 Jan 2013 10:05:19 -0500, NoBody <NoBody@nowhere.com> wrote:
>
>>>Nothing did go wrong for NewsCorp ya dumb cocksucker
>>>
>>>They went to court and argued that it was OKAY to lie because: "They
>>>were not a news channel.....they were an "entertainment" channel"
>>
>>Actually they didn't. Perhaps you should read intelligent, reliable
>>sources and not the garbage you read now.
>
>The opinion isn't reliable?
>

The information you provide was wrong.

>The lie was deliberate

What lie?

>
>They knew the lie was deliberate

Prove it.

>
>The Corporation was forced to deny it was a legitimate news
>channel---calling itself an "entertainment channel" with a "news
>format"

You've never actually read the court opinions have you?

>
>IDIOT.

You most certainly are.

Yoorghis

1/7/2013 4:32:00 PM

0

On Mon, 07 Jan 2013 05:40:23 -0500, NoBody <NoBody@nowhere.com> wrote:

>>>
>>>Actually they didn't. Perhaps you should read intelligent, reliable
>>>sources and not the garbage you read now.
>>
>>The opinion isn't reliable?
>>
>
>The information you provide was wrong.
>
>>The lie was deliberate
>
>What lie?

PIck any lie.

Facts may not be at issue

What is---would be the conclusions and/or "inferences" they use to
suggest truth.

IDIOT>

AlleyCat

1/7/2013 8:57:00 PM

0

On Mon, 07 Jan 2013 09:32:18 -0700, In article
<o2ule81ti3d0k9cdrljrrltq0ireni69in@4ax.com>, Yoorghis@Jurgis.net
says...

> PIck any lie.

See? Loogie cannot provide ONE lie. He asks US to provide the lie, just
like him wanting the government to do everything for his sorry ass.
Still waiting for that Fox News Lie, Loogie. Can't provide one? Then
shut the fuck up about ONE court case in which a TV station, who happens
to be an affiliate and under ZERO control of "Fox News", reported
falsely. It was 14 fucking years ago, idiot.
--------
On April 2, 1998, two award-winning Florida TV producers, Jane Akre and
Steve Wilson, held press conferences in Tampa and Tallahassee to
announce a lawsuit against a Fox TV network television station, WTVT.
The reporters sued Fox for firing them after they refused to broadcast
false reports about Monsanto's controversial genetically engineered
Bovine Growth Hormone (rBGH or rBST).
--------
Do you SEE "Fox News" in there? Being a Fox affiliate has NOTHING to do
with the "Fox News Channel".

They were trying to do the public a favor. You act as though they were
lying about your Messiah, The Most High Ayatollah Husseini Obama.
--------
At the April 2 press conference, Jane Akre emphasized that the public
has a right to know the truth about the health hazards of rBGH, despite
the strong-arm tactics of Monsanto:

"Every parent and every consumer has the right to know what they're
pouring on their children's morning cereal. We set out to tell Florida
consumers the truth about a giant chemical company and a powerful dairy
lobby. That used to be something investigative reporters won awards for.
As we've learned the hard way, it's something you can be fired for these
days..."
--------

Loogie: Owned... again!



--
Check for Children Redirecting Newsgroups

SpambustR

1/7/2013 11:17:00 PM

0

On 07/01/2013 4:40 AM, NoBody wrote:


--
SPAMMED TO NON-RELEVANT NEWSGROUPS - AND CUT

SpambustR

1/7/2013 11:18:00 PM

0

On 05/01/2013 1:19 PM, Swag wrote:


--
SPAMMED TO NON-RELEVANT NEWSGROUPS - AND CUT

SpambustR

1/7/2013 11:19:00 PM

0

On 05/01/2013 1:23 PM, Cold Lazarus wrote:



--
SPAMMED TO NON-RELEVANT NEWSGROUPS - AND CUT