DataLakeDirectoryClient::ListPaths() throws exception for folders whose names contain spaces.
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
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
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di Azure/azure-sdk-for-cpp
-
bug EngSys
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
Azure/azure-sdk-for-cpp#7362 ·
I maintainer di solito rispondono entro 1 giorno
-
Client needs-team-attention Service Attention Storage
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
Azure/azure-sdk-for-cpp#7347 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Client Event Hubs needs-team-attention Service Attention
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
Azure/azure-sdk-for-cpp#7333 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Azure Storage STG105 Feature TestsForse già presa @Jinming-Hu l’ha presa 23 giorni fa. ApertaClient Storage
Azure/azure-sdk-for-cpp#7449 · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Azure.Core bug test-enhancement
Difficoltà 3/5 1-2 giorni Idoneità per principianti 66/100
Azure/azure-sdk-for-cpp#7401 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di Azure/azure-sdk-for-cpp
Issue simili
-
.NET ep:WebGPU platform:web
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
microsoft/onnxruntime#33755 ·
I maintainer di solito rispondono entro 2 giorni
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
grumpycoders/pcsx-redux#2530 ·
-
A-tools P-medium S-ready-to-start studio task
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
I maintainer di solito rispondono entro 1 giorno
-
Status: Needs confirmation Status: Needs triage Type: Code Quality
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
I maintainer di solito rispondono entro 1 giorno
-
Image.resolveAssetSource's TypeScript declaration drops the null it returns for an unknown assetAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
react/react-native#59648 ·
I maintainer di solito rispondono entro 2 giorni