Skip to content

Embedded GraalPy fails with LookupError after upgrading requests to 2.33.1 / charset_normalizer to 3.4.6 #719

@timfel

Description

@timfel

Summary

Upgrading the embedded Python dependencies from requests==2.32.5 / charset_normalizer==3.4.5 to requests==2.33.1 / charset_normalizer==3.4.6 causes an embedded GraalPy application to fail at runtime with:

LookupError: no such codec is supported.

We hit this in the graalvm/graal-languages-demos repo in the GraalPy Micronaut and Spring Boot guides. The checked-in GraalPy/GraalVM version did not change; only the resolved Python dependency set drifted.

Environment

  • GraalPy plugin / runtime: 25.0.2
  • JVM test runtime: Oracle GraalVM JDK 21.0.8+12.1
  • Embedded mode via GraalPy build tools / VFS
  • Reproduced locally on 2026-04-01

Dependency change

Last passing embedded env resolved:

  • requests==2.32.5
  • charset_normalizer==3.4.5
  • urllib3==2.6.3
  • idna==3.11
  • certifi==2026.2.25
  • vader-sentiment==3.2.1.1

Failing embedded env resolved:

  • requests==2.33.1
  • charset_normalizer==3.4.6
  • urllib3==2.6.3
  • idna==3.11
  • certifi==2026.2.25
  • vader-sentiment==3.2.1.1

Reproduction shape

In Java, we create an embedded GraalPy context and evaluate:

from vader_sentiment.vader_sentiment import SentimentIntensityAnalyzer
SentimentIntensityAnalyzer()

With the newer dependency set, bean initialization fails and the embedded eval throws:

Caused by: LookupError: LookupError: no such codec is supported.
    at <python>.<module>(Unknown)
    at org.graalvm.polyglot.Context.eval(Context.java:449)

This is the local failure we reproduced in the Micronaut example:

Message: LookupError: no such codec is supported.
Path Taken:
new o.e.SentimentAnalysisController(SentimentAnalysis sentimentAnalysis)
---> new o.e.SentimentAnalysisController([SentimentAnalysis sentimentAnalysis])
Caused by: LookupError: LookupError: no such codec is supported.
    at <python>.<module>(Unknown)
    at org.graalvm.polyglot.Context.eval(Context.java:449)
    at org.example.SentimentAnalysis.<init>(SentimentAnalysis.java:20)

Workaround

Pinning the embedded Python dependencies back to:

  • requests==2.32.5
  • charset_normalizer==3.4.5

makes the same local reproduction pass again.

Notes

The exact codec name is not included in the thrown exception text, but vader_sentiment initializes using codecs.open(..., encoding="utf-8"), so this may be related to codec availability / registration during embedded startup or transitive imports in this dependency combination.

If useful, I can provide a reduced reproducer based on the GraalPy Micronaut guide setup.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions