mirror of
https://git.launchpad.net/ubuntu-dev-tools
synced 2025-03-13 08:01:09 +00:00
Use regex to filter unwanted characters in filename
This commit is contained in:
parent
32a85dc172
commit
8a6502aaa4
@ -21,6 +21,7 @@
|
|||||||
# of the GNU General Public License license.
|
# of the GNU General Public License license.
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
import re
|
||||||
import sys
|
import sys
|
||||||
import smtplib
|
import smtplib
|
||||||
import socket
|
import socket
|
||||||
@ -163,7 +164,7 @@ Content-Type: text/plain; charset=UTF-8
|
|||||||
confirmation_prompt()
|
confirmation_prompt()
|
||||||
|
|
||||||
# save mail in temporary file
|
# save mail in temporary file
|
||||||
f=open("/tmp/requestsync-" + bugtitle.replace(" ","_"), "w")
|
f=open("/tmp/requestsync-" + re.sub("[^a-zA-Z0-9_\-]","",bugtitle.replace(" ","_")), "w")
|
||||||
f.write(mail)
|
f.write(mail)
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user