Suitable function in os module to get filename path

3 views
Skip to first unread message

Ronnie

unread,
Jan 27, 2009, 4:25:19 AM1/27/09
to Testoob
I had a quick look through the standard Python library, but after all,
I think I'll stick
with the common functions in os. I'll use os.getenv.
---
Ronnie van 't Westeinde to Ori, Misha

Yes, no problem to change it, but you got me thinking: isn't the whole
purpose of
the os module to offer os specific functions. It might be better to
use a different module,
I don't know which one yet.

Ori Peleg

unread,
Jan 27, 2009, 7:28:15 AM1/27/09
to tes...@googlegroups.com
Misha previously said it's important to comment that it's about Solaris, but if I understood correctly it's not about Solaris - it's about symlinks.
--
Check out my blog: http://orip.org

Ronnie

unread,
Jan 27, 2009, 8:16:19 AM1/27/09
to Testoob
Ori,

Yes, you're right, it's about symlinks, not about Solaris.
I've attached our e-mails for those who miss the context of this
discussion.

Ronnie

--Ori wrote:
Hi Ronnie,

...

I have a question about the changes to coverage in main.py in this
revision : why do you prefer to find a module's path through
function.func_code.filename instead of __file__?
BTW - I tested it with IronPython 2.0 and it works, I need to test it
with Jython as well.
--
--Ronnie wrote:
I changed the coverage because on our Solaris Systems, Python is
installed through softlinks.
This means that function.func_code.filename gives a different result
than __file__,
(In the coverage.py module, you also use func_code.filename to compare
with, so it's guaranteed
to be the same)
This in turn resulted in coverage statistics for all python packages
that were used.
--

On 27 jan, 13:28, Ori Peleg <ori...@gmail.com> wrote:
> Misha previously said it's important to comment that it's about Solaris, but
> if I understood correctly it's not about Solaris - it's about symlinks.
>
> On Tue, Jan 27, 2009 at 11:25 AM, Ronnie
> <ronnie.van.t.westei...@gmail.com>wrote:
Reply all
Reply to author
Forward
0 new messages