[New-bugs-announce] [issue34069] Fail to move file in Windows (AttributeError)

Joshua Avalon report at bugs.python.org
Sun Jul 8 06:57:23 EDT 2018


New submission from Joshua Avalon <joshuaavalon at gmail.com>:

from shutil import move
from pathlib import Path

a = Path("s")
b = Path("a.txt")

move(b, a)


This will throw AttributeError: 'WindowsPath' object has no attribute 'rstrip'

>From the document, it should able to move:

If the destination is an existing directory, then src is moved inside that directory. If the destination already exists but is not a directory, it may be overwritten depending on os.rename() semantics.

If a = Path("s/a.txt"), it does not throw error.

Enviroment:
  Window 10
  Python 3.7.0

----------
components: Windows
messages: 321270
nosy: joshuaavalon, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Fail to move file in Windows (AttributeError)
versions: Python 3.7

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


More information about the New-bugs-announce mailing list