Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

DataLakeDirectoryClient::ListPaths() throws exception for folders whose names contain spaces.

Chiusa
#7,475 2 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@Jinming-Hu ci sta già lavorando.

Dal 17/10/2026.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

Client customer-reported question Service Attention Storage

Describe the bug
DataLakeDirectoryClient::ListPaths() throws Azure::Storage::StorageException exception on folders whose names contain spaces.

For example, we have the code part below. Its throws Azure::Storage::StorageException exception with "404 The specified path does not exist." message, even when specified folder(which name contains space) exist.

      DataLakeDirectoryClient cleint = DataLakeDirectoryClient::CreateFromConnectionString(connectionString, containerName, folderPath, options);
      client.GetSubdirectoryClient("Test Folder/").ListPaths(includeSubfolders, ListPathsOptions{});

When we use this code part it works correct.

      DataLakeDirectoryClient cleint = DataLakeDirectoryClient::CreateFromConnectionString(connectionString, containerName, folderPath + "Test Folder/", options);
      client.ListPaths(includeSubfolders, ListPathsOptions{});

My investigation shows the root cause comes from the file ...\azure-sdk-for-cpp-azure-storage-common\sdk\storage\azure-storage-common\src\crypt.cpp and functions UrlEncodeQueryParameter().

Root cause

When we call the ListPaths it has nested call to the _internal::UrlEncodeQueryParameter to encode folder's path.
Meanwhile the GetSubdirectoryClient also has nested call to the function _internal::UrlEncodePath().
As a result, when we make a call client.GetSubdirectoryClient("Test Folder/").ListPaths(includeSubfolders, ListPathsOptions{}) the folder name "Test Folder/" encodes twice. After first encode from the GetSubdirectoryClient() the "Test Folder/" becomes "Test%20Folder/". And after second encode it becomes "Test%2520Folder/". If we decode the last string, it will be "Test%20Folder/", which is incorrect. The decoded path should be same "Test Folder/".

If we added '%' symbol to the doNotEncodeCharacters += "/:@?"; line in the function UrlEncodeQueryParameter(), it should fix the issue.

Exception or Stack Trace

Azure::Storage::StorageException with error message

404 The specified path does not exist.
The specified path does not exist.
RequestId:ec627031-101f-007a-1754-5df83a000000
Time:2026-10-16T09:55:26.3272893Z
Request ID: ec627031-101f-007a-1754-5df83a000000

Code Snippet

      DataLakeDirectoryClient cleint = DataLakeDirectoryClient::CreateFromConnectionString(connectionString, containerName, folderPath, options);
      client.GetSubdirectoryClient("Test Folder/").ListPaths(includeSubfolders, ListPathsOptions{});

Expected behavior
The folders should be visible and accessible regardless of whether the folder name contains spaces.

Setup (please complete the following information):

  • OS: [e.g. Windows]
  • IDE : [e.g. Visual Studio Professional 2022]
  • Version of the Library used: azure-core_1.16.4, azure-storage-common_12.15.0, azure-storage-files-datalake_12.17.0

Information Checklist
Kindly make sure that you have added all the following information above and checkoff the required fields otherwise we will treat the issuer as an incomplete report

  • Bug Description Added
  • Repro Steps Added
  • Setup information Added
    encodes
Lingua principale
C++
Stelle
206
Fork
177
Merge medio
2g 10h
PR unite (30g)
34

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di Azure/azure-sdk-for-cpp

Tutte le issue di Azure/azure-sdk-for-cpp

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.