Skip to main content
replaced http://stackoverflow.com/ with https://stackoverflow.com/
Source Link
URL Rewriter Bot
URL Rewriter Bot

It might not be relevant to actual question but, in addition to Alex Martelli'sAlex Martelli's answer, I would also check if buildVersion ever exists in the first place, because otherwise all solutions posted here will give you another errors:

import re

buildVersion = request.values.get('buildVersion')
if buildVersion is not None:
    return 'processedImages/{}/'.format(re.sub('\W+', '', buildVersion))
else:
    return None

It might not be relevant to actual question but, in addition to Alex Martelli's answer, I would also check if buildVersion ever exists in the first place, because otherwise all solutions posted here will give you another errors:

import re

buildVersion = request.values.get('buildVersion')
if buildVersion is not None:
    return 'processedImages/{}/'.format(re.sub('\W+', '', buildVersion))
else:
    return None

It might not be relevant to actual question but, in addition to Alex Martelli's answer, I would also check if buildVersion ever exists in the first place, because otherwise all solutions posted here will give you another errors:

import re

buildVersion = request.values.get('buildVersion')
if buildVersion is not None:
    return 'processedImages/{}/'.format(re.sub('\W+', '', buildVersion))
else:
    return None
Source Link
Ozgur Vatansever
  • 52.5k
  • 17
  • 89
  • 122

It might not be relevant to actual question but, in addition to Alex Martelli's answer, I would also check if buildVersion ever exists in the first place, because otherwise all solutions posted here will give you another errors:

import re

buildVersion = request.values.get('buildVersion')
if buildVersion is not None:
    return 'processedImages/{}/'.format(re.sub('\W+', '', buildVersion))
else:
    return None