Re: Python 3.x progress

Peter Cock <[email protected]>
Newsgroups gmane.comp.python.reportlab.user
Message-ID <CAKVJ-_5zs+RYX_S3hpiEHiWBxBC0xp9hwhvAMRroN3ayuZi5iA@mail.gmail.com>
On Thu, Jan 9, 2014 at 2:22 PM, Peter Cock <[email protected]> wrote:
>>
>> can you abstract the problem to something simple that I can test elsewhere?
>> Andy & Ricardo both have macs that could be used. The _rl_accel.c code was
>> changed significantly to make things work with both 3.3 & 2.7 so I would
>> like to get at any seg faults in there asap.
>
> Try https://gist.github.com/peterjc/8334631 which extracts the
> failing Biopython unit test as a short script. I'm working on
> further simplifying it - currently in addition to ReportLab it
> requires Biopython (using Biopython 1.63 should be fine).

Gist updated to be self contained (by bundling a few classes
and functions from Biopython), same errors:

[Mac OS X] $ python2.7 reportlab_ps_test.py
Segmentation fault: 11

Recall this is using the Apple provided Python 2.7,

$ which python2.7
/usr/bin/python2.7

$ python2.7 --version
Python 2.7.5


[Mac OS X] $ python3.3 reportlab_ps_test.py
Traceback (most recent call last):
  File "reportlab_ps_test.py", line 544, in <module>
    simple_organism("organism.eps", "ps")
  File "reportlab_ps_test.py", line 542, in simple_organism
    test_organism.draw(filename, "Test organism")
  File "reportlab_ps_test.py", line 184, in draw
    return _write(cur_drawing, output_file, self.output_format)
  File "reportlab_ps_test.py", line 70, in _write
    return drawmethod.drawToFile(drawing, output_file)
  File "/Users/peterjc/lib/python3.3/site-packages/reportlab/graphics/renderPS.py",
line 879, in drawToFile
    c.save(fn)
  File "/Users/peterjc/lib/python3.3/site-packages/reportlab/graphics/renderPS.py",
line 155, in save
    file.write(self._sep.join(self.code))
TypeError: 'str' does not support the buffer interface

>
> I've not yet tried this under Linux, but could do so as well...

On my 64bit Linux desktop the segmentation fault does not
happen - the unicode/string issue under Python 3 is the same.

[linux] $ python2.7 reportlab_ps_test.py
(Good news - produces simple ugly postscript file)

[linux] $ python3.3 reportlab_ps_test.py
Traceback (most recent call last):
  File "reportlab_ps_test.py", line 544, in <module>
    simple_organism("organism.eps", "ps")
  File "reportlab_ps_test.py", line 542, in simple_organism
    test_organism.draw(filename, "Test organism")
  File "reportlab_ps_test.py", line 184, in draw
    return _write(cur_drawing, output_file, self.output_format)
  File "reportlab_ps_test.py", line 70, in _write
    return drawmethod.drawToFile(drawing, output_file)
  File "/home/peterjc/lib/python3.3/site-packages/reportlab/graphics/renderPS.py",
line 879, in drawToFile
    c.save(fn)
  File "/home/peterjc/lib/python3.3/site-packages/reportlab/graphics/renderPS.py",
line 155, in save
    file.write(self._sep.join(self.code))
TypeError: 'str' does not support the buffer interface

Does that help?

Peter
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.