Giter Club home page Giter Club logo

Comments (4)

polaksta avatar polaksta commented on June 3, 2024

This error is seen when I use python2. With python3 it is OK

from pympress.

FriedrichFroebel avatar FriedrichFroebel commented on June 3, 2024

I just added some additional logging to the method which produces this error: In line 546, I added print(type(w_desc)) and print(w_desc) before line 577.

Output for python -m pympress running the latest master with Python 2.7:

<type 'dict'>
<type 'dict'>
<type 'unicode'>
current
current

Output for python3 -m pympress running the latest master with Python 3.5 (I exited the application when the file chooser was shown):

<class 'dict'>
<class 'dict'>
<class 'str'>
current
<class 'str'>
annotations
<class 'str'>
next

Seems like the if condition in line 547 needs to be extended using something like

if type(w_desc) is str or type(w_desc) is unicode:
    w = self.placeable_widgets[w_desc]

The problem is that Python 3 does not have the unicode type, so this part of the code probably needs to be rewritten to be able to support both Python 2 and Python 3 (the snippet above does not work for Python 3):

is_string = False
try:
    is_string = type(w_desc) is unicode
except NameError:
    is_string = type(w_desc) is str

if is_string:
    w = self.placeable_widgets[w_desc]

from pympress.

Cimbali avatar Cimbali commented on June 3, 2024

Done! Thanks for reporting. Should work OK even on python2 now, as far as I can tell.

from pympress.

polaksta avatar polaksta commented on June 3, 2024

You are fast as lightning :-)

from pympress.

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.