Page MenuHomePhabricator

Port database reports to Python 3
Closed, ResolvedPublic

Description

Python 2 goes EOL on January 1, 2020. Before that happens, we need to switch to 3 to avoid hail Marys if fecal matter hits the ventilation device.

Event Timeline

@MaxSem: Which exact code repository / project tag is this about?

@Aklapper It's a small tool that's maintained by our team. It doesn't have its own tag.
Code is at https://github.com/wikimedia/database-reports

@Niharika: Thanks. I asked because potential contributors cannot contribute a patch if it is impossible for them to find out where the code base is located for a task which has no code base information / project tag. (And https://github.com/wikimedia/database-reports/issues looks like there is no canonical issue tracker.)

I've rolled out the update. Still investigating how well it works.

2019-08-15T18:30:30 Traceback (most recent call last):
  File "/data/project/database-reports/reports/database-reports/main.py", line 29, in main
    method()
  File "/data/project/database-reports/reports/database-reports/main.py", line 74, in deleted_prods
    self.rep.deleted_prods()
  File "/mnt/nfs/labstore-secondary-tools-project/database-reports/reports/database-reports/reports.py", line 306, in deleted_prods
    logtext = re.sub("{","<nowiki>{</nowiki>",logtext)
  File "/usr/lib/python3.5/re.py", line 182, in sub
    return _compile(pattern, flags).sub(repl, string, count)
TypeError: cannot use a string pattern on a bytes-like object