Re: [Python-ideas] chdir context manager

Nick Coghlan <ncoghlan@...> writes:
-1 from me
I consider caring about the current directory to be an anti-pattern
I would agree, but in some places we unfortunately have to care about this, because of stdlib history - for example, distutils. Wherever you have to do "python setup.py ..." there is an implicit assumption that anything setup.py looks at will be relative to wherever the setup.py is - it's seldom invoked as "python /path/to/setup.py", and from what I've seen, very few projects do the right thing in their setup.py and code called from it in terms of getting an absolute path for the directory setup.py is in, and then using it in subsequent operations. I agree that we shouldn't encourage this kind of behaviour :-) Regards, Vinay Sajip
participants (1)
-
Vinay Sajip