# \#python

**URL:** https://community.sonarsource.com/tag/python/97.md

[Latest](https://community.sonarsource.com/latest.md) · [Categories](https://community.sonarsource.com/categories.md) · [Tags](https://community.sonarsource.com/tags.md)

---

## [FastAPI dependency injection being detected as typing.Union, python:S6546](https://community.sonarsource.com/t/fastapi-dependency-injection-being-detected-as-typing-union-python-s6546/190788)

<div class="topic-metadata">

**Author:** [@gmilway](https://community.sonarsource.com/u/gmilway)\
**Replies:** 1\
**Last updated:** [November 6, 2026, 7:58am UTC](https://community.sonarsource.com/t/fastapi-dependency-injection-being-detected-as-typing-union-python-s6546/190788 "2026-11-06T07:58:05Z")

</div>

Version: Developer Edition v2026.1.6 (131977) Annotated type hinting for FastAPI dependency injection is being flagged as a typing.Union: AuthDep = Depends(some\_auth\_func) def update\_event( event\_data: EventUpda…

---

## [SonarQube Cloud scan 4.1.0 hangs on minimal Python project in Bitbucket Pipelines](https://community.sonarsource.com/t/sonarqube-cloud-scan-4-1-0-hangs-on-minimal-python-project-in-bitbucket-pipelines/189168)

<div class="topic-metadata">

**Author:** [@frvingstdk](https://community.sonarsource.com/u/frvingstdk)\
**Replies:** 3\
**Last updated:** [October 15, 2026, 10:44am UTC](https://community.sonarsource.com/t/sonarqube-cloud-scan-4-1-0-hangs-on-minimal-python-project-in-bitbucket-pipelines/189168 "2026-10-15T10:44:09Z")

</div>

ALM used Bitbucket Cloud CI system used Bitbucket Cloud Pipelines Scanner pipe: sonarsource/sonarcloud-scan:4.1.0 Scanner configuration: sonar.python.version=3.12 Verbose logging is enabled using: EXTRA\_ARGS: \> -…

---

## [Sonar-python 5.24: OutOfMemoryError in flattenAmbiguousSymbols / AmbiguousSymbolImpl.copyWithoutUsag](https://community.sonarsource.com/t/sonar-python-5-24-outofmemoryerror-in-flattenambiguoussymbols-ambiguoussymbolimpl-copywithoutusag/185262)

<div class="topic-metadata">

**Author:** [@Brian\_C](https://community.sonarsource.com/u/Brian_C)\
**Replies:** 1\
**Last updated:** [August 24, 2026, 8:46am UTC](https://community.sonarsource.com/t/sonar-python-5-24-outofmemoryerror-in-flattenambiguoussymbols-ambiguoussymbolimpl-copywithoutusag/185262 "2026-08-24T08:46:04Z")

</div>

ALM used: GitHub CI system used: GitHub Actions (ubuntu-latest) Scanner command used (private details masked): GitHub Actions step name: SonarCloud Scan uses: SonarSource/sonarqube-scan-action@v8.2.0 env: SONAR\_TO…

---

## [Does SonarQube scan supports PySpark and SparkSQL?](https://community.sonarsource.com/t/does-sonarqube-scan-supports-pyspark-and-sparksql/108022)

<div class="topic-metadata">

**Author:** [@Soumyadip\_Dutta](https://community.sonarsource.com/u/Soumyadip_Dutta)\
**Replies:** 2\
**Last updated:** [August 13, 2026, 6:24pm UTC](https://community.sonarsource.com/t/does-sonarqube-scan-supports-pyspark-and-sparksql/108022 "2026-08-13T18:24:21Z")

</div>

Must-share information (formatted with Markdown): which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension) SonarQube Enterprise Edition Version 9.9 how is SonarQube deployed: zip, Docker, …

---

## [SCA (uv): transitive dependency of a dev-only package is reported in Production scope](https://community.sonarsource.com/t/sca-uv-transitive-dependency-of-a-dev-only-package-is-reported-in-production-scope/186467)

<div class="topic-metadata">

**Author:** [@PavelS](https://community.sonarsource.com/u/PavelS)\
**Replies:** 0\
**Last updated:** [July 23, 2026, 2:06pm UTC](https://community.sonarsource.com/t/sca-uv-transitive-dependency-of-a-dev-only-package-is-reported-in-production-scope/186467 "2026-07-23T14:06:25Z")

</div>

Environment: SonarQube Server Enterprise with Advanced Security, v2026.3.1 Scanner: pysonar (Python) Package manager: uv (pyproject.toml + uv.lock) Description SonarQube reports the prohibited-license risk with Product…

---

## [New Python rules for Testing & Pydantic](https://community.sonarsource.com/t/new-python-rules-for-testing-pydantic/186248)

<div class="topic-metadata">

**Author:** [@jean.jimbo](https://community.sonarsource.com/u/jean.jimbo)\
**Replies:** 0\
**Last updated:** [July 20, 2026, 8:32am UTC](https://community.sonarsource.com/t/new-python-rules-for-testing-pydantic/186248 "2026-07-20T08:32:20Z")

</div>

We’ve added 13 new Python rules to help teams write clearer, more reliable tests and use Pydantic models safely. The new testing rules encourage precise exception checks, parameterized tests for similar cases, one invoc…

---

## [New Python rules for Beautiful Soup](https://community.sonarsource.com/t/new-python-rules-for-beautiful-soup/186081)

<div class="topic-metadata">

**Author:** [@adam.wilson](https://community.sonarsource.com/u/adam.wilson)\
**Replies:** 0\
**Last updated:** [July 17, 2026, 10:33am UTC](https://community.sonarsource.com/t/new-python-rules-for-beautiful-soup/186081 "2026-07-17T10:33:54Z")

</div>

Hi Python Developers The Python analyzer adds new rules for web scraping with Beautiful Soup and reduces false positives. Issues classified as main-code issues are no longer raised on test files. New rules: S8900: De…

---

## [PySonar 1.7.0 drops support for Python 3.9](https://community.sonarsource.com/t/pysonar-1-7-0-drops-support-for-python-3-9/185102)

<div class="topic-metadata">

**Author:** [@sebastian.zumbrunn](https://community.sonarsource.com/u/sebastian.zumbrunn)\
**Replies:** 0\
**Last updated:** [July 8, 2026, 8:31am UTC](https://community.sonarsource.com/t/pysonar-1-7-0-drops-support-for-python-3-9/185102 "2026-07-08T08:31:38Z")

</div>

Hey folks, In the latest version of pysonar, aka Scanner for Python, support for Python 3.9 will be dropped, meaning that pysonar will no longer run in a Python 3.9 environment. Importantly, the analyzer itself still s…

---

## [SonarQube for Eclipse 12.4 - Analyzers updates and fix for Eclipse 2026-06 Compatibility](https://community.sonarsource.com/t/sonarqube-for-eclipse-12-4-analyzers-updates-and-fix-for-eclipse-2026-06-compatibility/183990)

<div class="topic-metadata">

**Author:** [@Farah](https://community.sonarsource.com/u/Farah)\
**Replies:** 0\
**Last updated:** [June 24, 2026, 10:22am UTC](https://community.sonarsource.com/t/sonarqube-for-eclipse-12-4-analyzers-updates-and-fix-for-eclipse-2026-06-compatibility/183990 "2026-06-24T10:22:50Z")

</div>

This release delivers updated language analyzers across all supported programming languages, along with important bug fixes and platform improvements. Enhanced analyzer versions for Java, Python, PHP, HTML, XML, and Text…

---

## [SonarQube for IntelliJ 12.4 - Analyzers updates and UI freezes fix](https://community.sonarsource.com/t/sonarqube-for-intellij-12-4-analyzers-updates-and-ui-freezes-fix/183984)

<div class="topic-metadata">

**Author:** [@Farah](https://community.sonarsource.com/u/Farah)\
**Replies:** 0\
**Last updated:** [June 24, 2026, 9:58am UTC](https://community.sonarsource.com/t/sonarqube-for-intellij-12-4-analyzers-updates-and-ui-freezes-fix/183984 "2026-06-24T09:58:18Z")

</div>

This release brings updated language analyzers across multiple programming languages, along with important stability improvements. Enhanced analyzer versions for Java, Python, PHP, HTML, XML, and Text provide deeper code…

---

## [Detecting Code Duplications Within the Same Python File in SonarQube](https://community.sonarsource.com/t/detecting-code-duplications-within-the-same-python-file-in-sonarqube/140038)

<div class="topic-metadata">

**Author:** [@PythonDeveloper](https://community.sonarsource.com/u/PythonDeveloper)\
**Replies:** 14\
**Last updated:** [June 18, 2026, 2:25am UTC](https://community.sonarsource.com/t/detecting-code-duplications-within-the-same-python-file-in-sonarqube/140038 "2026-06-18T02:25:57Z")

</div>

Hi everyone, I’m quite new to SonarQube and currently exploring its features. As part of my evaluation, I created two simple Python scripts that share some duplicated code. SonarQube successfully detects duplicated line…

---

## [False positive lock file requirement because of pyproject.toml](https://community.sonarsource.com/t/false-positive-lock-file-requirement-because-of-pyproject-toml/182774)

<div class="topic-metadata">

**Author:** [@VShkaberda](https://community.sonarsource.com/u/VShkaberda)\
**Replies:** 1\
**Last updated:** [May 29, 2026, 10:07am UTC](https://community.sonarsource.com/t/false-positive-lock-file-requirement-because-of-pyproject-toml/182774 "2026-05-29T10:07:35Z")

</div>

The repo contains a list of scripts deployed to S3 and used by AWS Glue. pyproject.toml is used to configure linters and triggers the Sonar rule text:S8565 “Python dependency lock file should be committed to source cont…

---

## [False positive on githubactions:S8544 "Python dependencies should be locked to verified versions"](https://community.sonarsource.com/t/false-positive-on-githubactions-s8544-python-dependencies-should-be-locked-to-verified-versions/182307)

<div class="topic-metadata">

**Author:** [@Nicolas\_Baumann](https://community.sonarsource.com/u/Nicolas_Baumann)\
**Replies:** 1\
**Last updated:** [May 22, 2026, 2:28pm UTC](https://community.sonarsource.com/t/false-positive-on-githubactions-s8544-python-dependencies-should-be-locked-to-verified-versions/182307 "2026-05-22T14:28:42Z")

</div>

Hi, I’m using SonarQube cloud on Github. This rule is labelled beta "The rule has been recently implemented and we haven’t gotten enough feedback from users yet, so there may be false positives or false negatives." It…

---

## [Python Cobertura coverage sensor does not resolve \<source\> paths relative to sonar.projectBaseDir](https://community.sonarsource.com/t/python-cobertura-coverage-sensor-does-not-resolve-source-paths-relative-to-sonar-projectbasedir/180837)

<div class="topic-metadata">

**Author:** [@szabolcs](https://community.sonarsource.com/u/szabolcs)\
**Replies:** 9\
**Last updated:** [April 30, 2026, 1:47pm UTC](https://community.sonarsource.com/t/python-cobertura-coverage-sensor-does-not-resolve-source-paths-relative-to-sonar-projectbasedir/180837 "2026-04-30T13:47:39Z")

</div>

Must-share information (formatted with Markdown): which versions are you using (SonarQube Server / Community Build, Scanner, Plugin, and any relevant extension) Enterprise Edition v2026.1.2 (121356) how is SonarQu…

---

## [SonarQube displays suggestions for file outside the workspace when using GitHub Copilot code review](https://community.sonarsource.com/t/sonarqube-displays-suggestions-for-file-outside-the-workspace-when-using-github-copilot-code-review/178005)

<div class="topic-metadata">

**Author:** [@hb20007](https://community.sonarsource.com/u/hb20007)\
**Replies:** 1\
**Last updated:** [March 2, 2026, 7:42pm UTC](https://community.sonarsource.com/t/sonarqube-displays-suggestions-for-file-outside-the-workspace-when-using-github-copilot-code-review/178005 "2026-03-02T19:42:48Z")

</div>

Operating system: Windows 11 SonarQube for VS Code plugin version: 4.43.0 (latest) Programming language: Python Is connected mode used: No. Steps to reproduce: Open a clean installation or new profile of VS Code. Dow…

---

## [8 New Rules for Flask Applications](https://community.sonarsource.com/t/8-new-rules-for-flask-applications/177648)

<div class="topic-metadata">

**Author:** [@jean.jimbo](https://community.sonarsource.com/u/jean.jimbo)\
**Replies:** 0\
**Last updated:** [February 13, 2026, 3:00pm UTC](https://community.sonarsource.com/t/8-new-rules-for-flask-applications/177648 "2026-02-13T15:00:56Z")

</div>

Hi Pythonistas, We’ve expanded our support for Flask to help you build more robust, secure, and standard-compliant Python web applications. Security These rules reduce your attack surface by preventing accidental publ…

---

## [14 New FastAPI Rules for Python Projects](https://community.sonarsource.com/t/14-new-fastapi-rules-for-python-projects/177643)

<div class="topic-metadata">

**Author:** [@jean.jimbo](https://community.sonarsource.com/u/jean.jimbo)\
**Replies:** 0\
**Last updated:** [February 13, 2026, 1:39pm UTC](https://community.sonarsource.com/t/14-new-fastapi-rules-for-python-projects/177643 "2026-02-13T13:39:55Z")

</div>

We’ve rolled out a set of new rules specifically for developers building applications with FastAPI. These rules are designed to help you catch subtle bugs, security vulnerabilities, and “gotchas” before they hit producti…

---

## [Exclusions don't work in pysonar](https://community.sonarsource.com/t/exclusions-dont-work-in-pysonar/177482)

<div class="topic-metadata">

**Author:** [@afandian](https://community.sonarsource.com/u/afandian)\
**Replies:** 8\
**Last updated:** [February 13, 2026, 10:35am UTC](https://community.sonarsource.com/t/exclusions-dont-work-in-pysonar/177482 "2026-02-13T10:35:11Z")

</div>

I’m trying to get started with SonarCloud on a Python and web project. I’m trying to diagnose an issue with pysonar miscounting the number of lines. This mis-count is a separate issue. To do this I want to temporarily …

---

## [SonarCloud dashboards not generated for Microsoft Fabric notebooks – supported or not?](https://community.sonarsource.com/t/sonarcloud-dashboards-not-generated-for-microsoft-fabric-notebooks-supported-or-not/158565)

<div class="topic-metadata">

**Author:** [@bisiri](https://community.sonarsource.com/u/bisiri)\
**Replies:** 5\
**Last updated:** [February 6, 2026, 12:22pm UTC](https://community.sonarsource.com/t/sonarcloud-dashboards-not-generated-for-microsoft-fabric-notebooks-supported-or-not/158565 "2026-02-06T12:22:02Z")

</div>

Hi Team, We have configured SonarCloud analysis successfully in an Azure DevOps pipeline, and the scan completes without errors. However, we do not see the usual dashboards (Security, Reliability, Maintainability). Rep…

---

## [New version of our bug detection engine for Java and Python](https://community.sonarsource.com/t/new-version-of-our-bug-detection-engine-for-java-and-python/143287)

<div class="topic-metadata">

**Author:** [@denis.troller](https://community.sonarsource.com/u/denis.troller)\
**Replies:** 1\
**Last updated:** [January 26, 2026, 11:18am UTC](https://community.sonarsource.com/t/new-version-of-our-bug-detection-engine-for-java-and-python/143287 "2026-01-26T11:18:17Z")

</div>

Hi there, dear Java and Python users, Today we release version 2.1 of our bug detection engine for Java and Python. For a long time, Java users have been complaining about duplicate rules (java:S2259 and javabugs:S6555…

---

## [Support for astral ty](https://community.sonarsource.com/t/support-for-astral-ty/172625)

<div class="topic-metadata">

**Author:** [@kayoub5](https://community.sonarsource.com/u/kayoub5)\
**Replies:** 1\
**Last updated:** [January 20, 2026, 10:42am UTC](https://community.sonarsource.com/t/support-for-astral-ty/172625 "2026-01-20T10:42:17Z")

</div>

The company that created ruff, has created a new python type checker ty It would be nice if SonarQube supported importing reports from it.

---

## [Python Issue Suppression Improvements (NOSONAR) and New Rules](https://community.sonarsource.com/t/python-issue-suppression-improvements-nosonar-and-new-rules/145017)

<div class="topic-metadata">

**Author:** [@sebastian.zumbrunn](https://community.sonarsource.com/u/sebastian.zumbrunn)\
**Replies:** 4\
**Last updated:** [December 12, 2025, 1:23pm UTC](https://community.sonarsource.com/t/python-issue-suppression-improvements-nosonar-and-new-rules/145017 "2025-12-12T13:23:10Z")

</div>

Hello Python Developers, It fills us with great pleasure to announce the long-awaited feature to finally be able to suppress individual rules with # NOSONAR(SXXXX, ...). The most recent release allows you to specify whi…

---

## [Getting java.lang.StackOverflowError: null error during Sonar Run for Python Repository](https://community.sonarsource.com/t/getting-java-lang-stackoverflowerror-null-error-during-sonar-run-for-python-repository/153550)

<div class="topic-metadata">

**Author:** [@nickbhasin](https://community.sonarsource.com/u/nickbhasin)\
**Replies:** 3\
**Last updated:** [December 10, 2025, 10:34am UTC](https://community.sonarsource.com/t/getting-java-lang-stackoverflowerror-null-error-during-sonar-run-for-python-repository/153550 "2025-12-10T10:34:20Z")

</div>

When running Sonar Cloud workflow for our python repository we are getting java.lang.StackOverflowError: null error. We narrowed down the problem and the issue existed here plugins/module\_utils/network/ios/rm\_templates .…

---

## [🐍 SonarQube supports Python 3.14 with new rules!](https://community.sonarsource.com/t/sonarqube-supports-python-3-14-with-new-rules/153139)

<div class="topic-metadata">

**Author:** [@jean.jimbo](https://community.sonarsource.com/u/jean.jimbo)\
**Replies:** 0\
**Last updated:** [November 27, 2025, 9:12am UTC](https://community.sonarsource.com/t/sonarqube-supports-python-3-14-with-new-rules/153139 "2025-11-27T09:12:07Z")

</div>

Hello Pythonistas, Early adopters of Python 3.14 for its great new features, such as t-strings, SonarQube helps you ensure best practice use with 5 new rules : S7931: “NotImplemented” should not be used in boolean con…

---

## [VS Code Extensions Terminate When SonarLint Runs Async Tasks on Multiple PDF Files](https://community.sonarsource.com/t/vs-code-extensions-terminate-when-sonarlint-runs-async-tasks-on-multiple-pdf-files/151344)

<div class="topic-metadata">

**Author:** [@Kartik\_Shastrakar](https://community.sonarsource.com/u/Kartik_Shastrakar)\
**Replies:** 3\
**Last updated:** [November 24, 2025, 1:38pm UTC](https://community.sonarsource.com/t/vs-code-extensions-terminate-when-sonarlint-runs-async-tasks-on-multiple-pdf-files/151344 "2025-11-24T13:38:52Z")

</div>

Title: VS Code Extensions Terminate When SonarLint Runs Async Tasks on Multiple PDF Files Operating system:Windows 11 / Ubuntu 24.04 LTS Sonarqube for VS Code plugin version:v4.9.1 (latest at time of testing) Programm…

---

## [python:S7502 False Positive when using type hints](https://community.sonarsource.com/t/python-s7502-false-positive-when-using-type-hints/152415)

<div class="topic-metadata">

**Author:** [@MarshTheBacca](https://community.sonarsource.com/u/MarshTheBacca)\
**Replies:** 2\
**Last updated:** [November 17, 2025, 8:18pm UTC](https://community.sonarsource.com/t/python-s7502-false-positive-when-using-type-hints/152415 "2025-11-17T20:18:05Z")

</div>

Please provide Operating system: Ubuntu 25.04 SonarQube for VS Code plugin version: 4.35.0 Programming language you’re coding in: Python Is connected mode used: No And a thorough description of the problem / question: …

---

## [Take our survey: Data Science and ML Practitioners - We want to hear from you!](https://community.sonarsource.com/t/take-our-survey-data-science-and-ml-practitioners-we-want-to-hear-from-you/152567)

<div class="topic-metadata">

**Author:** [@caroline.connaire](https://community.sonarsource.com/u/caroline.connaire)\
**Replies:** 0\
**Last updated:** [November 14, 2025, 2:57pm UTC](https://community.sonarsource.com/t/take-our-survey-data-science-and-ml-practitioners-we-want-to-hear-from-you/152567 "2025-11-14T14:57:09Z")

</div>

Data Science and ML Practitioners, Please help us better support you at Sonar by taking this short survey. :link: Take the survey here: Code Quality in ML & Data Workflows Survey Why? We’d like your input on you man…

---

## [Python: S5864 FP using type\[Enum\]](https://community.sonarsource.com/t/python-s5864-fp-using-type-enum/152234)

<div class="topic-metadata">

**Author:** [@wieslander](https://community.sonarsource.com/u/wieslander)\
**Replies:** 1\
**Last updated:** [November 11, 2025, 12:46pm UTC](https://community.sonarsource.com/t/python-s5864-fp-using-type-enum/152234 "2025-11-11T12:46:01Z")

</div>

SonarQube Server Enterprise Edition v2025.4.3 (113915) Deployed using Docker I’m getting a false positive for Python static code analysis when trying to dynamically look up the value of a specific key for Enum subclass…

---

## [FP for S6663 (index method) and pyspark.sql.Row class](https://community.sonarsource.com/t/fp-for-s6663-index-method-and-pyspark-sql-row-class/151631)

<div class="topic-metadata">

**Author:** [@mbyrnepr2](https://community.sonarsource.com/u/mbyrnepr2)\
**Replies:** 1\
**Last updated:** [November 3, 2025, 12:49pm UTC](https://community.sonarsource.com/t/fp-for-s6663-index-method-and-pyspark-sql-row-class/151631 "2025-11-03T12:49:07Z")

</div>

Hi all, I’ve run the sonar-python test suite on the following code snippet on the latest version of the master branch: from pyspark.sql import Row row = Row(name="Alice") print(row\["name"\]) # S6663 emitted for this l…

---

## [Add noqa support to SonarLint for Python (and consider it for other languages)](https://community.sonarsource.com/t/add-noqa-support-to-sonarlint-for-python-and-consider-it-for-other-languages/42732)

<div class="topic-metadata">

**Author:** [@Josh\_Schneider](https://community.sonarsource.com/u/Josh_Schneider)\
**Replies:** 5\
**Last updated:** [October 25, 2025, 3:41am UTC](https://community.sonarsource.com/t/add-noqa-support-to-sonarlint-for-python-and-consider-it-for-other-languages/42732 "2025-10-25T03:41:23Z")

</div>

Python static analysis tools, such as flake8 or pylint support the convention of adding a # noqa: \<rule\> or # pylint: \<rule\> comment line to disregard a rule on a specific line. I’d love to see this same kind of thing co…

[Next page](https://community.sonarsource.com/tag/python/97.md?match_all_tags=true&page=1&tags%5B%5D=python)
