Code Monkey home page Code Monkey logo

Comments (1)

jacobb avatar jacobb commented on August 20, 2024

This fix isn't recommended as it will break if you try and pass it an ascii string with out-of-position characters (done with above fix in place):

p.post(1,2,u'∆˙∂∆˚ƒ˙∆˚ß∂˙∆˚ƒ˙ß˚∂∆')
True
p.post(1,2,'∆˙∂∆˚ƒ˙∆˚ß∂˙∆˚ƒ˙ß˚∂∆')
Traceback (most recent call last):
File "", line 1, in
File "prowlpy.py", line 39, in post
'description': description.encode('utf-8'),
UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 0: ordinal not in range(128)

It will also break if you pass it a non-string type (urlencode does the type casting right now)

A work around for now would be to do the encoding before you pass the variable into function (quick scripts are likely to use non-unicode strings, whereas trying to port this into something like Django would probably use the unicode type).

That said, better UTF8 support that just works should become a priority, and I'll add it to the list and see what similar python libraries behave.

from prowlpy.

Related Issues (5)

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.