<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Case-sensitivity of path_display with renamed parent folder in Dropbox API Support &amp; Feedback</title>
    <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Case-sensitivity-of-path-display-with-renamed-parent-folder/m-p/260043#M15136</link>
    <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am using the Python dropbox SDK and I encounter a problem when modifying the case of directories that have already been declared&amp;nbsp;(same name but different case) in the past.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example, going from a dir:&lt;/P&gt;
&lt;PRE&gt;/testdir/NewTest&lt;/PRE&gt;
&lt;P&gt;To the same renamed one (only the case is modified):&lt;/P&gt;
&lt;PRE&gt;/testdir/nEWtEST&lt;/PRE&gt;
&lt;P&gt;After this kind of renaming, when listing the files with&amp;nbsp;dbx.files_list_folder, the FolderMetadata of the&amp;nbsp;renamed folder is OK (attribute path_display is correct), but the FileMetadata (and FolderMetada if any) of the subfiles (and subdirectories) are NOK:&amp;nbsp;&lt;SPAN&gt;attribute path_display keep writing the name of the parent folder (the one that has been renamed) with the wrong case.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;For example:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;/testdir/NewTest/subfile.txt&lt;/PRE&gt;
&lt;P&gt;Instead of:&lt;/P&gt;
&lt;PRE&gt;/testdir/nEWtEST/subfile.txt&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Complete code to reproduce the problem:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;import dropbox
dbx = dropbox.Dropbox(TOKEN)

# create test dir
path_1 = '/testdir'
dbx.files_create_folder(path_1)

# create a subdir and upload a file in this sub dir
path_2 = '/testdir/NewTest'
dbx.files_create_folder(path_2)

dbx_file_path = '/testdir/NewTest/file.txt'
with open(local_file_path, 'rb') as local_file:
    dbx.files_upload(f=local_file.read(), path=dbx_file_path)

# list content of test dir
lfr = dbx.files_list_folder(path=path_1, recursive=True)
print(lfr.entries)

# Gives 3 entries with correct spelling of path_display: 
# FolderMetadata(name='testdir', path_lower='/testdir', path_display='/testdir'),
# FolderMetadata(name='NewTest', path_lower='/testdir/newtest', path_display='/testdir/NewTest'),
# FileMetadata(name='file.txt', rev='73d511ef48f', size=8, path_lower='/testdir/newtest/file.txt', path_display='/testdir/NewTest/file.txt')

# Then delete and recreate subdir under a new name, and re-upload file
dbx.files_delete_v2(path=path_2)
renamed_path_2 = '/testdir/nEWtEST'
dbx_file_path2 = '/testdir/nEWtEST/file2.txt'
dbx.files_create_folder(renamed_path_2)
with open(local_file_path, 'rb') as local_file:
    dbx.files_upload(f=local_file.read(), path=dbx_file_path2)
    
# list content of test dir
lfr = dbx.files_list_folder(path=path_1, recursive=True)
print(lfr.entries)

# Gives 3 entries with correct spelling of path_display for the FolderMetadata but not for the sub FileMetadata: 
# FolderMetadata(name='testdir', path_lower='/testdir', path_display='/testdir'),
# FolderMetadata(name='NewTest', path_lower='/testdir/newtest', path_display='/testdir/nEWtEST'),
# FileMetadata(name='file2.txt', rev='741511ef48f', size=8, path_lower='/testdir/newtest/file2.txt', path_display='/testdir/NewTest/file2.txt')

# Try the same with double rename subdir with uppercase
renamed_path_aux = '/testdir/NEWTEST2'
renamed_path_2 = '/testdir/NEWTEST'
dbx.files_move_v2(from_path=path_2, to_path=renamed_path_aux)
dbx.files_move_v2(from_path=renamed_path_aux, to_path=renamed_path_2)

# list content of test dir
lfr = dbx.files_list_folder(path=path_1, recursive=True)
print(lfr.entries)

# Gives 3 entries with incorrect spelling (still the same problem): 
# FolderMetadata(name='testdir', path_lower='/testdir', path_display='/testdir'),
# FolderMetadata(name='NewTest', path_lower='/testdir/newtest', path_display='/testdir/NEWTEST'),
# FileMetadata(name='file2.txt', rev='749511ef48f', size=8, path_lower='/testdir/newtest/file2.txt', path_display='/testdir/NewTest/file2.txt')&lt;BR /&gt;
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PS: I read after typing that the problem was known and assumed for API v1. But with API v2, it seems that the problem does not concern anymore the whole attribute path_display, but only the parent folder that have been renamed (as we can see in the above first list, where the case sensitivity works well for parent folder :&amp;nbsp;path_display='/testdir/NewTest/file2.txt')&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your support.&lt;/P&gt;
&lt;P&gt;Are you planning to correct this behavior?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Clément W.&lt;/P&gt;</description>
    <pubDate>Wed, 29 May 2019 09:16:10 GMT</pubDate>
    <dc:creator>warniiiz</dc:creator>
    <dc:date>2019-05-29T09:16:10Z</dc:date>
    <item>
      <title>Case-sensitivity of path_display with renamed parent folder</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Case-sensitivity-of-path-display-with-renamed-parent-folder/m-p/260043#M15136</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am using the Python dropbox SDK and I encounter a problem when modifying the case of directories that have already been declared&amp;nbsp;(same name but different case) in the past.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;For example, going from a dir:&lt;/P&gt;
&lt;PRE&gt;/testdir/NewTest&lt;/PRE&gt;
&lt;P&gt;To the same renamed one (only the case is modified):&lt;/P&gt;
&lt;PRE&gt;/testdir/nEWtEST&lt;/PRE&gt;
&lt;P&gt;After this kind of renaming, when listing the files with&amp;nbsp;dbx.files_list_folder, the FolderMetadata of the&amp;nbsp;renamed folder is OK (attribute path_display is correct), but the FileMetadata (and FolderMetada if any) of the subfiles (and subdirectories) are NOK:&amp;nbsp;&lt;SPAN&gt;attribute path_display keep writing the name of the parent folder (the one that has been renamed) with the wrong case.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;For example:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;PRE&gt;/testdir/NewTest/subfile.txt&lt;/PRE&gt;
&lt;P&gt;Instead of:&lt;/P&gt;
&lt;PRE&gt;/testdir/nEWtEST/subfile.txt&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Complete code to reproduce the problem:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;import dropbox
dbx = dropbox.Dropbox(TOKEN)

# create test dir
path_1 = '/testdir'
dbx.files_create_folder(path_1)

# create a subdir and upload a file in this sub dir
path_2 = '/testdir/NewTest'
dbx.files_create_folder(path_2)

dbx_file_path = '/testdir/NewTest/file.txt'
with open(local_file_path, 'rb') as local_file:
    dbx.files_upload(f=local_file.read(), path=dbx_file_path)

# list content of test dir
lfr = dbx.files_list_folder(path=path_1, recursive=True)
print(lfr.entries)

# Gives 3 entries with correct spelling of path_display: 
# FolderMetadata(name='testdir', path_lower='/testdir', path_display='/testdir'),
# FolderMetadata(name='NewTest', path_lower='/testdir/newtest', path_display='/testdir/NewTest'),
# FileMetadata(name='file.txt', rev='73d511ef48f', size=8, path_lower='/testdir/newtest/file.txt', path_display='/testdir/NewTest/file.txt')

# Then delete and recreate subdir under a new name, and re-upload file
dbx.files_delete_v2(path=path_2)
renamed_path_2 = '/testdir/nEWtEST'
dbx_file_path2 = '/testdir/nEWtEST/file2.txt'
dbx.files_create_folder(renamed_path_2)
with open(local_file_path, 'rb') as local_file:
    dbx.files_upload(f=local_file.read(), path=dbx_file_path2)
    
# list content of test dir
lfr = dbx.files_list_folder(path=path_1, recursive=True)
print(lfr.entries)

# Gives 3 entries with correct spelling of path_display for the FolderMetadata but not for the sub FileMetadata: 
# FolderMetadata(name='testdir', path_lower='/testdir', path_display='/testdir'),
# FolderMetadata(name='NewTest', path_lower='/testdir/newtest', path_display='/testdir/nEWtEST'),
# FileMetadata(name='file2.txt', rev='741511ef48f', size=8, path_lower='/testdir/newtest/file2.txt', path_display='/testdir/NewTest/file2.txt')

# Try the same with double rename subdir with uppercase
renamed_path_aux = '/testdir/NEWTEST2'
renamed_path_2 = '/testdir/NEWTEST'
dbx.files_move_v2(from_path=path_2, to_path=renamed_path_aux)
dbx.files_move_v2(from_path=renamed_path_aux, to_path=renamed_path_2)

# list content of test dir
lfr = dbx.files_list_folder(path=path_1, recursive=True)
print(lfr.entries)

# Gives 3 entries with incorrect spelling (still the same problem): 
# FolderMetadata(name='testdir', path_lower='/testdir', path_display='/testdir'),
# FolderMetadata(name='NewTest', path_lower='/testdir/newtest', path_display='/testdir/NEWTEST'),
# FileMetadata(name='file2.txt', rev='749511ef48f', size=8, path_lower='/testdir/newtest/file2.txt', path_display='/testdir/NewTest/file2.txt')&lt;BR /&gt;
&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;PS: I read after typing that the problem was known and assumed for API v1. But with API v2, it seems that the problem does not concern anymore the whole attribute path_display, but only the parent folder that have been renamed (as we can see in the above first list, where the case sensitivity works well for parent folder :&amp;nbsp;path_display='/testdir/NewTest/file2.txt')&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you for your support.&lt;/P&gt;
&lt;P&gt;Are you planning to correct this behavior?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Clément W.&lt;/P&gt;</description>
      <pubDate>Wed, 29 May 2019 09:16:10 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Case-sensitivity-of-path-display-with-renamed-parent-folder/m-p/260043#M15136</guid>
      <dc:creator>warniiiz</dc:creator>
      <dc:date>2019-05-29T09:16:10Z</dc:date>
    </item>
    <item>
      <title>Re: Case-sensitivity of path_display with renamed parent folder</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Case-sensitivity-of-path-display-with-renamed-parent-folder/m-p/260166#M15141</link>
      <description>&lt;P&gt;Thanks for writing this up! Unfortunately, this behavior is sometimes expected. Even in&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;CODE&gt;path_display&lt;/CODE&gt;, the original casing isn't always available for all components. There's a note about this in&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://www.dropbox.com/developers/documentation/http/documentation" rel="nofollow" target="_blank"&gt;the API v2 documentation&lt;/A&gt;, under "Case insensitivity":&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;BLOCKQUOTE&gt;
&lt;P&gt;Also, while Dropbox is case-insensitive, it makes efforts to be case-preserving. Metadata.name will contain the correct case. Metadata.path_display usually will contain the correct case, but sometimes only in the last path component. If your app needs the correct case for all components, it can get it from the Metadata.name or last path component of each relevant Metadata.path_display entry.&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;
&lt;P&gt;We understand this is non-ideal of course, and I'll forward this on to the team as feedback, but I can't make any promises as to if or when this might be improved in the future.&lt;/P&gt;</description>
      <pubDate>Fri, 12 Jan 2018 16:21:16 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Case-sensitivity-of-path-display-with-renamed-parent-folder/m-p/260166#M15141</guid>
      <dc:creator>Greg-DB</dc:creator>
      <dc:date>2018-01-12T16:21:16Z</dc:date>
    </item>
    <item>
      <title>Re: Case-sensitivity of path_display with renamed parent folder</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Case-sensitivity-of-path-display-with-renamed-parent-folder/m-p/260433#M15153</link>
      <description>Thanks for your answer. I implemented the non-ideal method, looking recursively at each parent's metadata, to get the full path with correct case-sensitivity. It's not very efficient but it will do the job. Looking forward to see new improvements in the API &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@41457EF40051AFF130FDBFE21B496926/emoticons/1f609.png" alt=":winking_face:" title=":winking_face:" /&gt;</description>
      <pubDate>Mon, 15 Jan 2018 11:20:42 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Case-sensitivity-of-path-display-with-renamed-parent-folder/m-p/260433#M15153</guid>
      <dc:creator>warniiiz</dc:creator>
      <dc:date>2018-01-15T11:20:42Z</dc:date>
    </item>
    <item>
      <title>Re: Case-sensitivity of path_display with renamed parent folder</title>
      <link>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Case-sensitivity-of-path-display-with-renamed-parent-folder/m-p/265993#M15603</link>
      <description>&lt;P&gt;I'm having the same problem.. it's difficult to imagine such an error when it's so visible and unusable getting a path that is not the correct one..&lt;BR /&gt;I'm looking forward to a good solution because I thought about doing the same as you @warnizz... but I'm managing hundreds&amp;nbsp;of files...&lt;BR /&gt;will reduce performance so much that it's not worth it.&lt;BR /&gt;&lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@B0F70D28791EB05FA3EA0C3BDDF08EE3/emoticons/1f61e.png" alt=":disappointed_face:" title=":disappointed_face:" /&gt; &lt;img class="lia-deferred-image lia-image-emoji" src="https://www.dropboxforum.com/html/@B0F70D28791EB05FA3EA0C3BDDF08EE3/emoticons/1f61e.png" alt=":disappointed_face:" title=":disappointed_face:" /&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Feb 2018 20:11:32 GMT</pubDate>
      <guid>https://www.dropboxforum.com/t5/Dropbox-API-Support-Feedback/Case-sensitivity-of-path-display-with-renamed-parent-folder/m-p/265993#M15603</guid>
      <dc:creator>mmolledo</dc:creator>
      <dc:date>2018-02-21T20:11:32Z</dc:date>
    </item>
  </channel>
</rss>

