Py3k error with "unicode" identifier in dotted_toc extension
See original GitHub issueI’ve seen port to py3K is in progress, thanks a lot for that!
Just in case, I tried launching my pdf build on today’s rst2pdf github master, under python3.7.3, it failed due to this line:
Traceback (most recent call last):
File "....a\lib\site-packages\reportlab\platypus\flowables.py", line
700, in wrap
W,H = _listWrapOn(self._content,aW,self.canv,dims=dims)
File "....\lib\site-packages\reportlab\platypus\flowables.py", line
624, in _listWrapOn
w,h = f.wrapOn(canv,availWidth,0xfffffff)
File "....\lib\site-packages\reportlab\platypus\flowables.py", line
125, in wrapOn
w, h = self.wrap(aW,aH)
File "....\lib\site-packages\rst2pdf\extensions\dotted_toc.py", line 137, in wrap
if not isinstance(text, unicode):
NameError: name 'unicode' is not defined
Maybe there is a need for a global search-replace of “unicode” with six utility, to batch-solve this kind?
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:10 (10 by maintainers)
Top Results From Across the Web
Cannot open text files in Python 3: Unicode error
In your first example, file_path = "c:\Users\username\Documents\folder1\some_file.txt" The \U in \Users represents a Unicode escape sequence ...
Read more >C/C++ extension does not work with Unicode identifiers #2034
I use Unicode identifiers everywhere in my C++ code. It is well supported in Visual Studio. There are some bugs with syntax highlighting...
Read more >Unicode Objects and Codecs — Python 3.11.1 documentation
This function checks that unicode is a Unicode object and the index is not out of bounds, in contrast to PyUnicode_READ_CHAR() , which...
Read more >UAX #31: Unicode Identifier and Pattern Syntax
A common task facing an implementer of the Unicode Standard is the provision of a parsing and/or lexing engine for identifiers, such as ......
Read more >Unicode & Character Encodings in Python: A Painless Guide
Unicode vs UTF-8; Encoding and Decoding in Python 3; Python 3: All-In on ... Most of these constants should be self-documenting in their...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Here’s a simple way around this problem, along with a couple of others )Ihave found in the code:
Add these statements to the top of the module that is failing, after the imports. Better would be to make these definitions conditional on the Python version, something like this:
I think we’re fully python3 compatible at this point so this should be solved. Going to close but if anyone has more information please do comment!