[Win32 fetch chromium ERROR] TypeError: cannot use a string pattern on a bytes-like object

574 views
Skip to first unread message

Tao Tse

unread,
Aug 12, 2019, 4:23:30 AM8/12/19
to Chromium-discuss
Hi,

I followed the guide here to fetch the chromium source code, tried several times, it always reports the error message below.
What's the problem?

Thanks!

1>________ running 'git -c core.deltaBaseCacheLimit=512m clone --no-checkout --progress https://chromium.googlesource.com/chromium/src.git G:\projects\chromium\_gclient_src_ncv21bhq' in 'G:\projects\chromium'




src
(ERROR)
----------------------------------------
[0:00:00] Started.
[0:00:00]
Traceback (most recent call last):
 
File "G:\depot_tools\gclient_scm.py", line 1045, in _Clone
    print_stdout
=print_stdout, filter_fn=filter_fn)
 
File "G:\depot_tools\gclient_scm.py", line 1368, in _Run
    gclient_utils
.CheckCallAndFilter(cmd, env=env, **kwargs)
 
File "G:\depot_tools\gclient_utils.py", line 585, in CheckCallAndFilter
    stdout_write
(in_byte)
 
File "G:\depot_tools\third_party\colorama\ansitowin32.py", line 41, in write
   
self.__convertor.write(text)
 
File "G:\depot_tools\third_party\colorama\ansitowin32.py", line 162, in write
   
self.write_and_convert(text)
 
File "G:\depot_tools\third_party\colorama\ansitowin32.py", line 184, in write_and_convert
    text
= self.convert_osc(text)
 
File "G:\depot_tools\third_party\colorama\ansitowin32.py", line 246, in convert_osc
   
for match in self.ANSI_OSC_RE.finditer(text):
TypeError: cannot use a string pattern on a bytes-like object
[0:00:00] _____ removing non-empty tmp dir G:\projects\chromium\_gclient_src_ncv21bhq
----------------------------------------
Traceback (most recent call last):
 
File "G:\depot_tools\metrics.py", line 267, in print_notice_and_exit
   
yield
 
File "G:\depot_tools\gclient.py", line 3156, in <module>
    sys
.exit(main(sys.argv[1:]))
 
File "G:\depot_tools\gclient.py", line 3142, in main
   
return dispatcher.execute(OptionParser(), argv)
 
File "G:\depot_tools\subcommand.py", line 252, in execute
   
return command(parser, args[1:])
 
File "G:\depot_tools\gclient.py", line 2699, in CMDsync
    ret
= client.RunOnDeps('update', args)
 
File "G:\depot_tools\gclient.py", line 1737, in RunOnDeps
    patch_refs
=patch_refs, target_branches=target_branches)
 
File "G:\depot_tools\gclient_utils.py", line 907, in flush
    reraise
(e[0], e[1], e[2])
 
File "G:\depot_tools\gclient_utils.py", line 72, in reraise
   
raise value
 
File "G:\depot_tools\gclient_utils.py", line 984, in run
   
self.item.run(*self.args, **self.kwargs)
 
File "G:\depot_tools\gclient.py", line 914, in run
    file_list
)
 
File "G:\depot_tools\gclient_scm.py", line 133, in RunCommand
   
return getattr(self, command)(options, args, file_list)
 
File "G:\depot_tools\gclient_scm.py", line 548, in update
   
self._Clone(revision, url, options)
 
File "G:\depot_tools\gclient_scm.py", line 1045, in _Clone
    print_stdout
=print_stdout, filter_fn=filter_fn)
 
File "G:\depot_tools\gclient_scm.py", line 1368, in _Run
    gclient_utils
.CheckCallAndFilter(cmd, env=env, **kwargs)
 
File "G:\depot_tools\gclient_utils.py", line 585, in CheckCallAndFilter
    stdout_write
(in_byte)
 
File "G:\depot_tools\third_party\colorama\ansitowin32.py", line 41, in write
   
self.__convertor.write(text)
 
File "G:\depot_tools\third_party\colorama\ansitowin32.py", line 162, in write
   
self.write_and_convert(text)
 
File "G:\depot_tools\third_party\colorama\ansitowin32.py", line 184, in write_and_convert
    text
= self.convert_osc(text)
 
File "G:\depot_tools\third_party\colorama\ansitowin32.py", line 246, in convert_osc
   
for match in self.ANSI_OSC_RE.finditer(text):
TypeError: cannot use a string pattern on a bytes-like object
Subprocess failed with return code 1.

PhistucK

unread,
Aug 12, 2019, 4:43:54 AM8/12/19
to g.xi...@gmail.com, Chromium-discuss
Just a guess - make sure the depot_tools directory is the first in the PATH environmental variable, if you already had Python installed and in PATH.

PhistucK


--
--
Chromium Discussion mailing list: chromium...@chromium.org
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-discuss

---
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-discu...@chromium.org.

Tao Tse

unread,
Aug 12, 2019, 4:54:32 AM8/12/19
to Chromium-discuss, g.xi...@gmail.com
Yes, it works!

Thank you very much!

How did you figure out the issue?


On Monday, August 12, 2019 at 4:43:54 PM UTC+8, PhistucK wrote:
Just a guess - make sure the depot_tools directory is the first in the PATH environmental variable, if you already had Python installed and in PATH.

PhistucK


To unsubscribe from this group and stop receiving emails from it, send an email to chromium...@chromium.org.

PhistucK

unread,
Aug 12, 2019, 5:12:58 AM8/12/19
to g.xi...@gmail.com, Chromium-discuss
It was a weird error message and in was in Python. That usually means that an incompatible version is installed that returns unexpected values from certain functions.

PhistucK


To unsubscribe from this group and stop receiving emails from it, send an email to chromium-discu...@chromium.org.

Tao Tse

unread,
Aug 12, 2019, 10:25:05 PM8/12/19
to Chromium-discuss, g.xi...@gmail.com
Thank you!

I've checked my env settings, there's exactly a version of python installed, and its path was added before the depot_tools'.


On Monday, August 12, 2019 at 5:12:58 PM UTC+8, PhistucK wrote:
It was a weird error message and in was in Python. That usually means that an incompatible version is installed that returns unexpected values from certain functions.

PhistucK


To unsubscribe from this group and stop receiving emails from it, send an email to chromium...@chromium.org.

胡海

unread,
Jul 22, 2020, 6:31:33 AM7/22/20
to Chromium-discuss, g.xi...@gmail.com
I met almost the same problem today, I run 'fetch --nohooks webrtc' to download webrtc sources, but the script stop at 'TypeError: cannot use a string pattern on a bytes-like object' error in the same python file.I check my 'PATH' environment virable and make sure that the 'depot_tools' path is the first one in 'PATH'.I run a 'Windows 7' host and I had downloaded webrtc sources successfully via depot tools about 3 months ago!Could someone give me some suggestion?

在 2019年8月12日星期一 UTC+8下午4:23:30,Tao Tse写道:

3125...@qq.com

unread,
Aug 9, 2020, 8:29:53 AM8/9/20
to Chromium-discuss, g.xi...@gmail.com
I met almost the same problem. How did you fix it?   Only depot_tools  in my environmental 



在 2019年8月12日星期一 UTC-7上午1:54:32,Tao Tse写道:

Bill Han

unread,
Aug 20, 2020, 6:15:20 PM8/20/20
to Chromium-discuss, g.xi...@gmail.com
You must be using python3, use pyenv to install an old version(2.7) will fix this error.

Shiladkumar Devaramani

unread,
Aug 25, 2020, 4:24:25 PM8/25/20
to Chromium-discuss, Bill Han, g.xi...@gmail.com
Hi,

I am also facing the same issue. Using  pyenv , I have installed the python version (2.7), still getting the same error. Please help me with this. 

C:\epic84\chromium>fetch chromium
Running: 'C:\Users\Administrator\.vpython-root\5217f6\Scripts\python.exe' 'C:\sr
c\depot_tools\gclient.py' root
Running: 'C:\Users\Administrator\.vpython-root\5217f6\Scripts\python.exe' 'C:\sr
c\depot_tools\gclient.py' config --spec 'solutions = [
  {
    "name": "src",
    "managed": False,
    "custom_deps": {},
    "custom_vars": {},
  },
]
'
Running: 'C:\Users\Administrator\.vpython-root\5217f6\Scripts\python.exe' 'C:\sr
c\depot_tools\gclient.py' sync


src (ERROR)
----------------------------------------
[0:00:00] Started.
[0:00:00]
Traceback (most recent call last):
  File "C:\src\depot_tools\gclient_scm.py", line 1043, in _Clone
    self._Run(clone_cmd, options, cwd=self._root_dir, retry=True,
  File "C:\src\depot_tools\gclient_scm.py", line 1411, in _Run
    gclient_utils.CheckCallAndFilter(cmd, env=env, **kwargs)
  File "C:\src\depot_tools\gclient_utils.py", line 616, in CheckCallAndFilter
    show_header_if_necessary(needs_header, attempt)
  File "C:\src\depot_tools\gclient_utils.py", line 566, in show_header_if_necess
ary
    stdout_write(header.encode())
  File "C:\src\depot_tools\third_party\colorama\ansitowin32.py", line 41, in wri
te
    self.__convertor.write(text)
  File "C:\src\depot_tools\third_party\colorama\ansitowin32.py", line 162, in wr
ite
    self.write_and_convert(text)
  File "C:\src\depot_tools\third_party\colorama\ansitowin32.py", line 184, in wr
ite_and_convert
    text = self.convert_osc(text)
  File "C:\src\depot_tools\third_party\colorama\ansitowin32.py", line 246, in co
nvert_osc
    for match in self.ANSI_OSC_RE.finditer(text):
TypeError: cannot use a string pattern on a bytes-like object
[0:00:00] _____ removing non-empty tmp dir C:\epic84\chromium\_gclient_src_mhrgr
kd0
----------------------------------------
Traceback (most recent call last):
  File "C:\src\depot_tools\metrics.py", line 267, in print_notice_and_exit
    yield
  File "C:\src\depot_tools\gclient.py", line 3195, in <module>
    sys.exit(main(sys.argv[1:]))
  File "C:\src\depot_tools\gclient.py", line 3181, in main
    return dispatcher.execute(OptionParser(), argv)
  File "C:\src\depot_tools\subcommand.py", line 252, in execute
    return command(parser, args[1:])
  File "C:\src\depot_tools\gclient.py", line 2737, in CMDsync
    ret = client.RunOnDeps('update', args)
  File "C:\src\depot_tools\gclient.py", line 1779, in RunOnDeps
    work_queue.flush(revision_overrides, command, args, options=self._options,
  File "C:\src\depot_tools\gclient_utils.py", line 947, in flush
    reraise(e[0], e[1], e[2])
  File "C:\src\depot_tools\gclient_utils.py", line 66, in reraise
    raise value
  File "C:\src\depot_tools\gclient_utils.py", line 1024, in run
    self.item.run(*self.args, **self.kwargs)
  File "C:\src\depot_tools\gclient.py", line 925, in run
    self._got_revision = self._used_scm.RunCommand(command, options, args,
  File "C:\src\depot_tools\gclient_scm.py", line 132, in RunCommand
    return getattr(self, command)(options, args, file_list)
  File "C:\src\depot_tools\gclient_scm.py", line 546, in update
    self._Clone(revision, url, options)
  File "C:\src\depot_tools\gclient_scm.py", line 1043, in _Clone
    self._Run(clone_cmd, options, cwd=self._root_dir, retry=True,
  File "C:\src\depot_tools\gclient_scm.py", line 1411, in _Run
    gclient_utils.CheckCallAndFilter(cmd, env=env, **kwargs)
  File "C:\src\depot_tools\gclient_utils.py", line 616, in CheckCallAndFilter
    show_header_if_necessary(needs_header, attempt)
  File "C:\src\depot_tools\gclient_utils.py", line 566, in show_header_if_necess
ary
    stdout_write(header.encode())
      stdout_write(header.encode())
  File "C:\src\depot_tools\third_party\colorama\ansitowin32.py", line 41, in wri
te
    self.__convertor.write(text)
  File "C:\src\depot_tools\third_party\colorama\ansitowin32.py", line 162, in wr
ite
    self.write_and_convert(text)
  File "C:\src\depot_tools\third_party\colorama\ansitowin32.py", line 184, in wr
ite_and_convert
    text = self.convert_osc(text)
  File "C:\src\depot_tools\third_party\colorama\ansitowin32.py", line 246, in co
nvert_osc
    for match in self.ANSI_OSC_RE.finditer(text):
TypeError: cannot use a string pattern on a bytes-like object
Subprocess failed with return code 1.

C:\epic84\chromium>python -V
Python 2.7
fetch chromium bug.png

Meraj Jilani

unread,
Oct 15, 2020, 3:27:17 AM10/15/20
to Chromium-discuss, shilad...@gmail.com, Bill Han, g.xi...@gmail.com
Hi,

Are you able to fix it? I am also facing exactly same issue.

Thanks,
Meraj

Reply all
Reply to author
Forward
0 new messages