[Python-Dev] pathlib handling of trailing slash (Issue #21039)

Antoine Pitrou antoine at python.org
Thu Aug 7 03:55:14 CEST 2014


Le 06/08/2014 20:50, Alexander Belopolsky a écrit :
> On Wed, Aug 6, 2014 at 8:11 PM, Antoine Pitrou <antoine at python.org
> <mailto:antoine at python.org>> wrote:
>
>     Am I overlooking other cases?
>
> There are many interfaces where trailing slash is significant.  For
> example, rsync uses trailing slash on the target directory to avoid
> creating an additional directory level at the destination.  Loosing it
> when passing path strings through pathlib.Path() may be a source of bugs.

pathlib is generally concerned with filesystem operations written in 
Python, not arbitrary third-party tools. Also it is probably easy to 
append the trailing slash in your command-line invocation, if so desired.

Regards

Antoine.





More information about the Python-Dev mailing list