GithubHelp home page GithubHelp logo

Error running locally built image with pack: Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding about buildpacks-python HOT 4 CLOSED

heroku avatar heroku commented on June 9, 2024
Error running locally built image with pack: Fatal Python error: init_fs_encoding: failed to get the Python codec of the filesystem encoding

from buildpacks-python.

Comments (4)

edmorley avatar edmorley commented on June 9, 2024 2

@david-caro Thank you for the great bug report + testcase, that helped a lot with my being able to reproduce.

This looks like a potential bug in uWSGI (or at least a limitation of it), since it's not honouring Python's detection of stdlib location, and instead is using the original build time location of Python, before it was relocated. For example, if you run docker run --rm -it --entrypoint launcher wm-lol python -m sysconfig, you will see that the "Paths:" section right at the top has all the correct locations.

I'm planning on reporting this upstream to uWSGI, as well as having the Python CNB set PYTHONHOME as a workaround in the meantime (which may end up needing to be set long term, given there will be apps in the wild using old uWSGI versions that never get the fix, even if uWSGI do fix this).

from buildpacks-python.

edmorley avatar edmorley commented on June 9, 2024

I've reported this upstream to the uWSGI project here:
unbit/uwsgi#2525

from buildpacks-python.

ipmb avatar ipmb commented on June 9, 2024

This is more of a workaround than a fix, but I'm curious if using https://pypi.org/project/pyuwsgi/ resolves the issue.

from buildpacks-python.

edmorley avatar edmorley commented on June 9, 2024

I just noticed the GCP Python CNB sets PYTHONHOME because of uWSGI too:
https://github.com/GoogleCloudPlatform/buildpacks/blob/99553d0a2051834324d621f20ad5355453f675a1/cmd/python/runtime/main.go#L93-L96

from buildpacks-python.

Related Issues (18)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.