476: Changes with certain regex characters can't be posted using post-review

zhi****@gmai***** (Google Code) (Is this you? Claim this profile.)
March 22, 2009
What steps will reproduce the problem?
1. Create a change with a file named "foo++bar"
2. Try to submit the review using post-review.

What is the expected output? What do you see instead?
Expected: The review is posted
Actual: An error message:

Traceback (most recent call last):
  File "/mts/home1/zhirsch/bin/post-review", line 452, in <module>
    main()
  File "/mts/home1/zhirsch/bin/post-review", line 448, in main
    tempt_fate(changenum, repository_path, client_root)
  File "/mts/home1/zhirsch/bin/post-review", line 390, in tempt_fate
    upload_diff(review_request, changenum)
  File "/mts/home1/zhirsch/bin/post-review", line 366, in upload_diff
    diff_content = generate_diff(changenum)
  File "/mts/home1/zhirsch/bin/post-review", line 298, in generate_diff
    m = re.match(r'\+?%s \/\/.+ (.+)$' % depot_path, where_info)
  File "/usr/lib/python2.5/re.py", line 137, in match
    return _compile(pattern, flags).match(string)
  File "/usr/lib/python2.5/re.py", line 241, in _compile
    raise error, v # invalid expression
sre_constants.error: multiple repeat

What operating system are you using? What browser?
64-bit Ubuntu 8.04

Please provide any additional information below.
This seems to be related to the ++ in the filename interacting badly with
regexes. This message
http://mail.python.org/pipermail/tutor/2003-November/026127.html seems to
be about the same problem.
chipx86
#1 chipx86
  • +Component-Scripts
    +Milestone-Release1.0
  • +Changes with certain regex characters can't be posted using post-review
chipx86
#2 chipx86
Turns out this is a dup of bug 423.
chipx86
#3 chipx86
Should be VMware-specific nowadays. This regex is gone. We can close this out once we
move to the new post-review internally.
  • +VMware
david
#4 david
Until then, maybe we can add an re.escape() to our internal version?
david
#5 david
Looks like we've moved to the new version. Closing out.
  • +Fixed