On Thu, 21 Jun 2012 10:23:25 -
"Armin Ronacher" wrote:
> Due to an user error on my part I was not using os.readlink correctly.
> Since links can be relative to their location I think it would make sense
> to provide an os.path.resolve helper that automatically returns the
> absolute path:
>
On 2012-06-21 06:23, Armin Ronacher wrote:
Due to an user error on my part I was not using os.readlink correctly.
Since links can be relative to their location I think it would make sense
to provide an os.path.resolve helper that automatically returns the
absolute path:
def resolve(filename
On Thu, Jun 21, 2012 at 11:16 PM, Antoine Pitrou wrote:
> On Thu, 21 Jun 2012 15:04:17 +0200
> Christian Heimes wrote:
>>
>> How about adding keyword support to OSError and derive the strerror from
>> errno if the second argument is not given?
>
> That's not the original behaviour:
>
> Python 3.2
On Thu, 21 Jun 2012 15:04:17 +0200
Christian Heimes wrote:
>
> How about adding keyword support to OSError and derive the strerror from
> errno if the second argument is not given?
That's not the original behaviour:
Python 3.2.2+ (3.2:9ef20fbd340f, Oct 15 2011, 21:22:07)
[GCC 4.5.2] on linux2
Am 21.06.2012 14:55, schrieb Nick Coghlan:
> On Thu, Jun 21, 2012 at 9:26 PM, Christian Heimes wrote:
>> BTW Is there a better way than raise OSError(errno.ELOOP,
>> os.strerror(errno.ELOOP), filename) to raise a correct OSError with
>> errno, errno message and filename? A classmethod like
>> "OSE
On Thu, Jun 21, 2012 at 9:26 PM, Christian Heimes wrote:
> BTW Is there a better way than raise OSError(errno.ELOOP,
> os.strerror(errno.ELOOP), filename) to raise a correct OSError with
> errno, errno message and filename? A classmethod like
> "OSError.from_errno(errno, filename=None) -> proper s
On Thu, Jun 21, 2012 at 11:10:44AM -, Armin Ronacher
wrote:
> would have to check the POSIX spec for a
> reasonable value
POSIX allows 8 links:
http://infohost.nmt.edu/~eweiss/222_book/222_book/0201433079/ch02lev1sec5.html
_POSIX_SYMLOOP_MAX - number of symbolic links that can be traver
Am 21.06.2012 13:10, schrieb Armin Ronacher:
Hello Armin,
> No, but that's a good point. It should attempt to resolve these in a loop
> until it either loops too often (would have to check the POSIX spec for a
> reasonable value) or until it terminates by finding an actual file or
> directory.
T
On Thu, 21 Jun 2012 11:10:44 -
"Armin Ronacher" wrote:
> Hi,
>
> > Am 21.06.2012 12:23, schrieb Armin Ronacher:
> > Does the code handle a chain of absolute and relative symlinks
> > correctly, for example a relative symlink that points to another
> > relative symlink in a different directory
Hi,
> Am 21.06.2012 12:23, schrieb Armin Ronacher:
> Does the code handle a chain of absolute and relative symlinks
> correctly, for example a relative symlink that points to another
> relative symlink in a different directory that points to a file in a
> third directry?
No, but that's a good poin
Am 21.06.2012 12:23, schrieb Armin Ronacher:
> Due to an user error on my part I was not using os.readlink correctly.
> Since links can be relative to their location I think it would make sense
> to provide an os.path.resolve helper that automatically returns the
> absolute path:
>
> def reso
Due to an user error on my part I was not using os.readlink correctly.
Since links can be relative to their location I think it would make sense
to provide an os.path.resolve helper that automatically returns the
absolute path:
def resolve(filename):
try:
target = os.readl
12 matches
Mail list logo