Skip to content

Commit

Permalink
Fix setting os.environ["PATH"] to a binary string (#28849)
Browse files Browse the repository at this point in the history
This code would raise "TypeError: str expected, not bytes" is run using
Python 3, since setting os.environ keys implictly encodes using
sys.getfilesystemencoding():
https://docs.python.org/3/library/os.html#os.environ

This might be dead code, or simply not exercised in wpt's CI.

Spotted while preparing #28848.
  • Loading branch information
foolip committed May 7, 2021
1 parent e985799 commit 3d2cc99
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions tools/wptrunner/wptrunner/browsers/firefox.py
Expand Up @@ -3,7 +3,6 @@
import platform
import signal
import subprocess
import sys
from abc import ABCMeta, abstractmethod

import mozinfo
Expand Down Expand Up @@ -675,8 +674,7 @@ def _setup_ssl(self, profile):


env[env_var] = (os.path.pathsep.join([certutil_dir, env[env_var]])
if env_var in env else certutil_dir).encode(
sys.getfilesystemencoding() or 'utf-8', 'replace')
if env_var in env else certutil_dir)

def certutil(*args):
cmd = [self.certutil_binary] + list(args)
Expand Down

0 comments on commit 3d2cc99

Please sign in to comment.