Opened 5 months ago

Closed 5 months ago

#7186 closed defect (fixed) fails if the filename contains "%" (percent) symbol.

Reported by: OlegSerov Owned by: warmerdam
Priority: normal Milestone:
Component: default Version: svn-trunk
Severity: normal Keywords:

Description fails if the filename contains "%" (percent) symbol..

Error message: `Traceback (most recent call last):

File "/home/ubuntu/.processing_server_env/bin/", line 1034, in <module>


File "/home/ubuntu/.processing_server_env/bin/", line 940, in main

dsCreatedTileIndex = tileImage(minfo,ti)

File "/home/ubuntu/.processing_server_env/bin/", line 355, in tileImage

tilename=getTileName(minfo,ti, xIndex, yIndex)

File "/home/ubuntu/.processing_server_env/bin/", line 697, in getTileName

return format % (yIndex,xIndex)

ValueError?: unsupported format character 'N' (0x4e) at index 59`

This happens on this line:

Because it uses python formatting to insert x y coordinates. However, it does not escape the original string and the parts of original string tries to be formated.

You should escape all % sign with %%. E.g. a = a.replace('%', '%%')

Attachments (1)

Change History (4)

comment:1 Changed 5 months ago by Even Rouault

Can you attach a patch or a modified version with your suggested fix ?

comment:2 Changed 5 months ago by OlegSerov

I've attached a patch for

!!! I have not tested the patch.

comment:3 Changed 5 months ago by Even Rouault

Resolution: fixed
Status: newclosed

In 41134: fix failure if the filename contains % (percent) symbol (fixes #7186, patch by OlegSerov?)

Note: See TracTickets for help on using tickets.