[IronPython] Ref to "." to be omitted from sys.path. Objections?

Daniel D. dvdotsenko at gmail.com
Sun Jan 23 23:24:47 CET 2011

I was just commenting on "." vs. "fully resolved" I just don't see a
point for "fully resolved" CWD ref from the start in console mode,
when "." is present.

Re cPy's use of "" instead of "."
I know it's pervasive on cPy side, and I used that form for .listdir()
(which, incidentally, works with "" on os. and nt. in latest build so
http://ironpython.codeplex.com/workitem/28207 can be closed).

However, the "" form is rather magical (not explicit) and I, nowdays,
prefer explicit "." in all uses, and, if a dev complains, would
suggest to be explicit in their code too.

In that frame of mind, i'd deemphasize the importance of accepting ""
for ".", unless there one central place where all path strings are
resolved. Is

Language.DomainManager.Platform.GetFullPath(string FileName)

that central place? If so, (and if all other code that resolves paths
use that method religiously), converting ""s to "." there, would be

Incidentally, that would allow us to make the last commit that deals
with sys.path do it the "right" way: "" instead of "."


On Sun, Jan 23, 2011 at 13:14, Jeff Hardy <jdhardy at gmail.com> wrote:
> On Sun, Jan 23, 2011 at 12:36 PM, Daniel D. <dvdotsenko at gmail.com> wrote:
>>> I committed the patch using '.' as  the current directory; if anyone
>>> (Dino?) needs the fully resolved path ...
>> The "." (rather "") in cPy is a neat trick. It's added only in
>> "interactive" (console, "-c") cases and allows you to change the CWD
>> to the dir you want and have your custom modules picked up as local
>> wherever dir you change to from within the console. Do that all the
>> time when deving. Setting fully-resolved path to CWD feels limiting in
>> that context.
> You mean switching using os.chdir, I presume? That works under ipy
> using '.' (which makes sense). Is there something special about how
> CPython uses '' instead of '.' that ipy should by emulating?
> - Jeff
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

More information about the Ironpython-users mailing list