Renaming file to remove extension does not hide extension

Originator:msschmitt
Number:rdar://48179975 Date Originated:2/18/2019
Status:Duplicate/35496756 Resolved:2/20/2019
Product:macOS + SDK Product Version:macOS 10.13.6 High Sierra
Classification:Finder Reproducible:Always
 
Summary:
Ever since OS X 10.1 Puma introduced file name extensions to OS X, a feature of the Finder has been that if you rename a file and remove the extension from the file name, the Finder will set the flag to hide the file extension.  Quoting from Apple's File Name Extension guidelines:

"when a user downloads a file "image.jpg" from the Internet, it does not magically rename itself to "image" in the Mac OS X Finder. What the user sees stays
consistent. If the user later renames the file to "mygroovyimage", the .jpg
extension is maintained, but becomes hidden."

This does not work in High Sierra.

Steps to Reproduce:

1. Have a file named "test.pdf", with the file name and extension visible in the Finder.  That is, the extension is not hidden.
2. Click on the file name in the Finder to rename.
3. When the Finder changes to let you rename the file, delete the extension from the file name, without changing anything else. In this case, you are changing the file from test.pdf to just test.

Expected Results:
The Finder should hide the .pdf extension, i.e. turn on the Hide Extension attribute.

Actual Results:
The Finder rejects the user rename of the file, leaving it just as it was before. That is, the file name does not change and the extension is still shown.

Notes:
- This does work in all OS X versions before High Sierra, including in Sierra
- It does hide the extension if the the extension is removed while also changing at least one character in the file name.
- The problem occurs regardless of the Finder "Show warning before changing an extension" preference.
- The same problem occurs in reverse: if you have a file with a hidden extension, and rename it to add the same extension to the visible file name (e.g. rename test to test.pdf, where the actual file name is test.pdf), the Finder rejects the rename, keeping the extension hidden.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!