Closed Bug 1597731 Opened 3 months ago Closed 3 months ago

[python3][sync] TypeError when running with Python 3

Categories

(Webtools :: Pontoon, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: adrian, Unassigned)

Details

Testing sync on stage, this error appears in the logs:

[2019-11-19 16:53:53,292: ERROR/ForkPoolWorker-1] Task pontoon.sync.tasks.sync_project[d69f0bf3-d391-4b9a-85b8-837eecc68b91] raised unexpected: TypeError("a bytes-like object is required, not 'str'")
Traceback (most recent call last):
  File "/app/.heroku/python/lib/python3.7/site-packages/celery/app/trace.py", line 385, in trace_task
    R = retval = fun(*args, **kwargs)
  File "/app/.heroku/python/lib/python3.7/site-packages/newrelic/hooks/application_celery.py", line 84, in wrapper
    return wrapped(*args, **kwargs)
  File "/app/.heroku/python/lib/python3.7/site-packages/celery/app/trace.py", line 648, in __protected_call__
    return self.run(*args, **kwargs)
  File "/app/pontoon/sync/core.py", line 64, in wrapped_func
    return func(self, *args, **kwargs)
  File "/app/pontoon/sync/tasks.py", line 110, in sync_project
    source_changes = sync_sources(db_project, now, force, no_pull)
  File "/app/pontoon/sync/tasks.py", line 152, in sync_sources
    db_project, now, full_scan=force
  File "/app/pontoon/sync/core.py", line 32, in update_originals
    added_paths, removed_paths, changed_paths = update_resources(db_project, vcs_project)
  File "/app/pontoon/sync/core.py", line 108, in update_resources
    vcs_changed_files, vcs_removed_files = vcs_project.changed_source_files
  File "/app/.heroku/python/lib/python3.7/site-packages/django/utils/functional.py", line 35, in __get__
    res = instance.__dict__[self.name] = self.func(instance)
  File "/app/pontoon/sync/vcs/models.py", line 138, in changed_source_files
    source_resources_repo.type, source_directory, last_revision
  File "/app/pontoon/sync/vcs/repositories.py", line 421, in get_changed_files
    return repo.get_changed_files(path, revision), repo.get_removed_files(path, revision)
  File "/app/pontoon/sync/vcs/repositories.py", line 354, in get_changed_files
    return [line.split()[1] for line in output.split('\n') if line and line[0] in statuses]
TypeError: a bytes-like object is required, not 'str'
Status: NEW → RESOLVED
Closed: 3 months ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.