[issue21322] Pathlib .owner() and .group() methods fail on broken links

2017-11-09 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
resolution:  -> rejected
stage:  -> resolved
status: pending -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21322] Pathlib .owner() and .group() methods fail on broken links

2017-03-25 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
status: open -> pending

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21322] Pathlib .owner() and .group() methods fail on broken links

2014-04-22 Thread Antoine Pitrou

Antoine Pitrou added the comment:

> - It can make programs crash *unexpectedly*

A broken link is an error, so it's normal to have an exception raised
here. An exception can always be caught if you were expecting the error.

> - Pathlib should provide a complete and uniform API for dealing with
> all types of files. If not, users would need to use Pathlib for some
> kind of files and go to os and os.path for others, then why the reason
> to use Pathlib?

I sympathize with this. But you can already use Path.lstat() and inspect
the st_uid and st_gid fields if you are really interested in the link's
owner and group (rather than the target's).

The fact that most Path methods dereference symlinks reflects the
semantics of other common filesystem calls (such as those in the os
module, or the underlying functions of the POSIX API).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21322] Pathlib .owner() and .group() methods fail on broken links

2014-04-22 Thread Iñigo Serna

Iñigo Serna added the comment:

Mainly, 2 reasons:

- It can make programs crash *unexpectedly*

- Pathlib should provide a complete and uniform API for dealing with all types 
of files. If not, users would need to use Pathlib for some kind of files and go 
to os and os.path for others, then why the reason to use Pathlib?

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21322] Pathlib .owner() and .group() methods fail on broken links

2014-04-21 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Most other Path methods operate on the link target, not the link itself, so I 
don't see why these methods would work otherwise.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21322] Pathlib .owner() and .group() methods fail on broken links

2014-04-21 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +pitrou

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21322] Pathlib .owner() and .group() methods fail on broken links

2014-04-21 Thread Iñigo Serna

New submission from Iñigo Serna:

Pathlib .owner() and .group() methods fail on broken symlinks.

They use:
return pwd.getpwuid(self.stat().st_uid).pw_name
and:
return grp.getgrgid(self.stat().st_gid).gr_name

It should be self.lstat().

Attached simple fix as unified diff.

--
components: Library (Lib)
files: pathlib-34-owner_group_fixed.diff
keywords: patch
messages: 216950
nosy: inigoserna
priority: normal
severity: normal
status: open
title: Pathlib .owner() and .group() methods fail on broken links
type: crash
versions: Python 3.4
Added file: http://bugs.python.org/file34992/pathlib-34-owner_group_fixed.diff

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com