Code Monkey home page Code Monkey logo

Comments (4)

botherder avatar botherder commented on July 30, 2024

I've been experimenting with this and still haven't found a proper solution.

from viper.

kevthehermit avatar kevthehermit commented on July 30, 2024

Whilst not ideal for retaining the original name you could use the string_clean function. This would at least enable it to be stored. then warn that a file was renamed

from viper.

cvandeplas avatar cvandeplas commented on July 30, 2024

I have added a pull-request that should fix this issue.

Some more info given in the pull-request:
I had a look at this as this is affecting me too.
The main issue is that the __sessions__.current.file.name is used in different ways around in the code. (str, unicode). I would use unicode everywhere and only convert when legacy functions (like raw_imput) can't handle it. Unfortunately it is a massive and unrealistic job to fix this everywhere.

To resolve this I have added the verification and conversion steps in the most efficient locations.
Going from std_in, the storing of files and the database function.

I have tested opening files (with and without special chars), storing them, loading them from the db, and it seems to work. As a test I have also ran multiple modules with no issue.

I expect some issues to occur here and there, but only with files containing special chars. So this patch should not break existing functionality, but instead extend it.
Mostly solution for the encountered issues will be to encode the unicode variable as can be seen below.

__sessions__.current.file.name.encode('utf-8')

from viper.

Rafiot avatar Rafiot commented on July 30, 2024

Must be fixed since the py3 branch is merged.

from viper.

Related Issues (20)

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.