[New-bugs-announce] [issue34384] os.readlink does not accept pathlib.Path on Windows

Girts Folkmanis report at bugs.python.org
Sat Aug 11 23:41:11 EDT 2018


New submission from Girts Folkmanis <girts.folkmanis at gmail.com>:

Documentation for os.readlink says "Changed in version 3.6: Accepts a path-like object.". This works fine on macOS, but blows up on Windows:

Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:06:47) [MSC v.1914 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> import pathlib
>>> os.readlink(pathlib.Path('foo'))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: readlink() argument 1 must be str, not WindowsPath

----------
components: Library (Lib)
messages: 323427
nosy: girtsf
priority: normal
severity: normal
status: open
title: os.readlink does not accept pathlib.Path on Windows
type: behavior
versions: Python 3.7

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34384>
_______________________________________


More information about the New-bugs-announce mailing list