Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

File downloader alg can create a file with duplicated extension #60528

Open
2 tasks done
nicogodet opened this issue Feb 10, 2025 · 1 comment · May be fixed by #60543
Open
2 tasks done

File downloader alg can create a file with duplicated extension #60528

nicogodet opened this issue Feb 10, 2025 · 1 comment · May be fixed by #60543
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Processing Relating to QGIS Processing framework or individual Processing algorithms

Comments

@nicogodet
Copy link
Member

What is the bug or the crash?

Téléchargement de https://storage.sbg.cloud.ovh.net/v1/AUTH_63234f509d6048bca3c9fd7928720ca1/ppk-lidar/IQ/LHD_FXX_0558_6277_PTS_C_LAMB93_IGN69.copc.laz réussi
Résultats: {'OUTPUT': 'C:/Users/godet/AppData/Local/Temp/processing_bFuZpI/LHD_FXX_0558_6277_PTS_C_LAMB93_IGN69.copc.laz.laz'}

See duplicated .laz extension

Steps to reproduce the issue

from pathlib import Path

import processing
from qgis.core import (
    QgsProcessingUtils,
)

tempDir = Path(QgsProcessingUtils.tempFolder())
filename = "LHD_FXX_0558_6277_PTS_C_LAMB93_IGN69.copc.laz"
url = "https://storage.sbg.cloud.ovh.net/v1/AUTH_63234f509d6048bca3c9fd7928720ca1/ppk-lidar/IQ/LHD_FXX_0558_6277_PTS_C_LAMB93_IGN69.copc.laz"

tempFile = tempDir / filename 


alg_param = {
    "URL": url,
    "METHOD": 0,
    "DATA": "",
    "OUTPUT": tempFile.as_posix(),
}

out = processing.run(
    "native:filedownloader",
    alg_param,
)
print(out["OUTPUT"])

See result

Versions

3.40.3

Supported QGIS version

  • I'm running a supported QGIS version according to the roadmap.

New profile

Additional context

Faulty line:

if ( outputFile.startsWith( QgsProcessingUtils::tempFolder( &context ) ) )

it should instead check if output == QgsProcessing::TEMPORARY_OUTPUT

@nicogodet nicogodet added Bug Either a bug report, or a bug fix. Let's hope for the latter! Processing Relating to QGIS Processing framework or individual Processing algorithms labels Feb 10, 2025
@nicogodet
Copy link
Member Author

Is this change valid ?

if ( parameters.value( QStringLiteral( "OUTPUT" ) ) == QgsProcessing::TEMPORARY_OUTPUT )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Either a bug report, or a bug fix. Let's hope for the latter! Processing Relating to QGIS Processing framework or individual Processing algorithms
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant