On 2/13/22, Eric Fahlgren wrote:
>
> That may or may not work as Windows has inconsistent treatment of multiple
> separators depending on where they appear in a path. If TEMP is a drive
> spec, say "t:\", then it expands to "t:\\spam.csv", which is an invalid
> windows path. If TEMP is a directo
On 2/13/22, Paul Moore wrote:
>
> For better or worse, though, Windows (as an OS) doesn't have a "normal
> behaviour". %-expansion is a feature of CMD and .bat files, which
You're overlooking ExpandEnvironmentStringsW() [1],
ExpandEnvironmentStringsForUserW(), and PathUnExpandEnvStringsW() [2],
w
On 2/13/22, Christopher Barker wrote:
>
> Telling newbies that that means that it's either a property with no setter,
> or am object without a __dict__, or one with __slots__ defined is not
> really very helpful.
The __slots__ case is due to the lack of a __dict__ slot. It can be
manually added
I think the more useful message would be something along the lines of
AttributeError: can't set attribute 'f' on object of type 'D'
This will help you track down the error. Steven D'Aprano listed three
reasons why it might fail which sounds right but frequently the underlying
reason is so
On Sat, Feb 12, 2022 at 5:32 PM Steven D'Aprano wrote:
> > I have to say I agree with Neil here. I was trying to think about what
> > other reasons an attribute might be unsettable, and did not quickly come
> up
> > with that list.
>
> I'm curious what list you came up with if it excluded the thr
On Mon, 14 Feb 2022 at 05:15, Eric Fahlgren wrote:
>
> On Sun, 13 Feb 2022 at 15:43, Chris Angelico wrote:
>>
>> > it to. If I'm on Windows and I tell something to write to a file in
>> > "%TEMP%\spam.csv", then I expect it to understand what that means.
>> > Cross-platform support is nice, but t
On Sun, 13 Feb 2022 at 15:43, Chris Angelico wrote:
> > it to. If I'm on Windows and I tell something to write to a file in
> > "%TEMP%\spam.csv", then I expect it to understand what that means.
> > Cross-platform support is nice, but the most common need is for the
> > current platform's normal
On Sun, 13 Feb 2022 at 15:43, Chris Angelico wrote:
>
> Which is why the default should be to follow platform expectations. If
> I pass a parameter to a script saying "~/foo/bar", that script should
> be able to expanduser/expandvars to make that behave the way I expect
> it to. If I'm on Windows
On Mon, 14 Feb 2022 at 02:34, Paul Moore wrote:
> The main point I see of expandvars is to have a way of letting the
> *user* pass a string that might reference environment variables, and
> expand them. There's some problematic aspects of that already, namely
> the platform-dependent handling of %
On Sun, 13 Feb 2022 at 14:26, Stephen J. Turnbull
wrote:
>
> Paul Moore writes:
>
> > Let's keep it simple. I'm -1 on the request, I don't think expandvars
> > should be added to pathlib.
>
> Would you be happier with a getenv_as_path, so that one could do
>
> p = Path.getenv_as_path('HOME')
Paul Moore writes:
> Let's keep it simple. I'm -1 on the request, I don't think expandvars
> should be added to pathlib.
Would you be happier with a getenv_as_path, so that one could do
p = Path.getenv_as_path('HOME') / Path('.python_history')
and on my Mac p == Path('/Users/steve/.python
On Sun, 13 Feb 2022 at 21:47, Paul Moore wrote:
>
> On Sun, 13 Feb 2022 at 01:09, Steven D'Aprano wrote:
>
> > I'm sorry Paul, but this sort of made-up, utterly artificial toy example
> > adds no benefit to the discussion, it just adds fear, uncertainty and
> > doubt to an extremely straight-forw
On Sun, 13 Feb 2022 at 01:09, Steven D'Aprano wrote:
> I'm sorry Paul, but this sort of made-up, utterly artificial toy example
> adds no benefit to the discussion, it just adds fear, uncertainty and
> doubt to an extremely straight-forward feature request.
OK, if that's your view then fine. I a
13 matches
Mail list logo