Hi,
FYI, it looks like ReportLab accepts to this is an issue.
https://bitbucket.org/rptlab/reportlab/issue/6/file-name-changed-due-to-utf8str-in
Werner
On 28/04/2013 17:06, Werner F. Bruhin wrote:
> Hi,
>
> pdfdoc.SaveToFile is using "utf8str" on the file name passed.
>
> This changes the file name from:
> u'C:\\dev\\twcbv4\\data\\generatedReports\\Kellerbuch Liste -
> Portr\xe4t.pdf'
>
> to:
>
> 'C:\\dev\\twcbv4\\data\\generatedReports\\Kellerbuch Liste -
> Portr\xc3\xa4t.pdf'
>
> Is this for compatibility with older Python versions?
>
> As on Python 2.7.2 Windows 7 I end up with:
>
> Kellerbuch Liste - Porträt.pdf
>
> instead of:
> Kellerbuch Liste - Porträt.pdf
>
> If I just comment the line 234 in pdfdoc "filename = utf8str(filename)"
> then all works fine, at least on Py 2.7 Win7 and passing in the unicode
> value.
>
> Do you know why reportlab is changing the file name, shouldn't the
> caller be responsible to pass in a valid name.
>
> I use "get_output_file_name" to get the file name from the user and then
> pass this to pdf.write as a unicode value, should/can I do something
> different to prevent this change of the file name.
>
> Werner
>
> ------------------------------------------------------------------------------
> Try New Relic Now & We'll Send You this Cool Shirt
> New Relic is the only SaaS-based application performance monitoring service
> that delivers powerful full stack analytics. Optimize and monitor your
> browser, app, & servers with just a few lines of code. Try New Relic
> and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
> _______________________________________________
> PythonReports-users mailing list
> Pyt...@li...
> https://lists.sourceforge.net/lists/listinfo/pythonreports-users
>
>
|