Skip to content

Commit

Permalink
Bug 1709690 [wpt PR 28849] - Fix setting os.environ["PATH"] to a bina…
Browse files Browse the repository at this point in the history
…ry string, a=testonly

Automatic update from web-platform-tests
Fix setting os.environ["PATH"] to a binary string (#28849)

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 web-platform-tests/wpt#28848.
--

wpt-commits: 3d2cc9904a08bf372bdc09c96628cc4c986278ee
wpt-pr: 28849
  • Loading branch information
foolip authored and moz-wptsync-bot committed May 8, 2021
1 parent 7ae1548 commit 417f08a
Showing 1 changed file with 1 addition and 3 deletions.
Original file line number Diff line number Diff line change
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 417f08a

Please sign in to comment.