This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: [3.6.6 on macOS] os.listdir replacing "/" with ":"
Type: behavior Stage: resolved
Components: macOS Versions: Python 3.6
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: coleman45.1@hotmail.com, ned.deily, ronaldoussoren, zach.ware
Priority: normal Keywords:

Created on 2018-07-22 02:36 by coleman45.1@hotmail.com, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
Screen Shot 2018-07-21 at 9.29.59 PM.png coleman45.1@hotmail.com, 2018-07-22 02:36 Screenshot dispalying the issue
Messages (3)
msg322128 - (view) Author: Todd (coleman45.1@hotmail.com) Date: 2018-07-22 02:36
Short back story - I am organizing music where "/" appears in a lot a metadata for the songs. For instance, the artist "AC/DC" or "ACDC w/ Axl Rose". On macOS, it is acceptable to name a folder "AC/DC" while the slash would cause an issue in Windows.

Issue - While using os.listdir to list a number of artist folders inside my iTunes music folder os.listdir replaced "/" with ":" IF the "/" appears in the name itself. It does not replace the slash delimiters. 

I have included a screen shot. On the right side of the image is an example directory I made with a few folders. Two of the folders have "/" in their names.  On the left side of the image is the Python shell showing the use of os.listdir along with the output. You'll notice that the listed directories don't include "/", but instead include ":".
msg322130 - (view) Author: Zachary Ware (zach.ware) * (Python committer) Date: 2018-07-22 03:10
That's nothing to do with Python and everything to do with macOS.  As a test, open Terminal, do `ls ~/Example`, and you'll see `AC:DC` instead of `AC/DC`.  As a further test, do `mkdir ~/Example/dir:with:colons` and then have a look in Finder.

See here [1] for more information.

[1] https://apple.stackexchange.com/questions/173529/when-did-the-colon-character-become-an-allowed-character-in-the-filesystem
msg322145 - (view) Author: Todd (coleman45.1@hotmail.com) Date: 2018-07-22 13:57
Ah, thank you for the link. I looked for something like that, but I obviously didn’t use the right wording while searching. 

Sorry for the false report and thanks for the quick help.

-Todd

Sent from my iPhone

> On Jul 21, 2018, at 10:10 PM, Zachary Ware <report@bugs.python.org> wrote:
> 
> 
> Zachary Ware <zachary.ware@gmail.com> added the comment:
> 
> That's nothing to do with Python and everything to do with macOS.  As a test, open Terminal, do `ls ~/Example`, and you'll see `AC:DC` instead of `AC/DC`.  As a further test, do `mkdir ~/Example/dir:with:colons` and then have a look in Finder.
> 
> See here [1] for more information.
> 
> [1] https://apple.stackexchange.com/questions/173529/when-did-the-colon-character-become-an-allowed-character-in-the-filesystem
> 
> ----------
> nosy: +zach.ware
> resolution:  -> not a bug
> stage:  -> resolved
> status: open -> closed
> 
> _______________________________________
> Python tracker <report@bugs.python.org>
> <https://bugs.python.org/issue34186>
> _______________________________________
History
Date User Action Args
2022-04-11 14:59:03adminsetgithub: 78367
2018-07-22 13:57:13coleman45.1@hotmail.comsetmessages: + msg322145
2018-07-22 03:10:33zach.waresetstatus: open -> closed

nosy: + zach.ware
messages: + msg322130

resolution: not a bug
stage: resolved
2018-07-22 02:36:57coleman45.1@hotmail.comcreate