git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: "Massimo B." <massimo.b@gmx.net>
To: Andrey <ahippo@yandex.ru>, "git@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: git p4 sync: "str expected, not %s"
Date: Wed, 17 Jul 2019 12:54:46 +0200	[thread overview]
Message-ID: <61d7947142367c3abf6d6f0af60181a0677ce954.camel@gmx.net> (raw)
In-Reply-To: <23610851562985541@iva7-634c9cb1f49d.qloud-c.yandex.net>

Still failing:

On Fri, 2019-07-12 at 22:39 -0400, Andrey wrote:

> Could you, please, try the patch below?
>
> diff --git a/git-p4.py b/git-p4.py
> index 5b79920f46..f5be048348 100755
> --- a/git-p4.py
> +++ b/git-p4.py
> @@ -4137,13 +4137,13 @@ def main():
>      if cmd.needsGit:
>          if cmd.gitdir == None:
>              cmd.gitdir = os.path.abspath(".git")
>              if not isValidGitDir(cmd.gitdir):
>                  # "rev-parse --git-dir" without arguments will try $PWD/.git
> -                cmd.gitdir = read_pipe("git rev-parse --git-dir").strip()
> +                cmd.gitdir = read_pipe("git rev-parse --git-
> dir").strip().decode()
>                  if os.path.exists(cmd.gitdir):
> -                    cdup = read_pipe("git rev-parse --show-cdup").strip()
> +                    cdup = read_pipe("git rev-parse --show-
> cdup").strip().decode()
>                      if len(cdup) > 0:
>                          chdir(cdup);
>
>          if not isValidGitDir(cmd.gitdir):
>              if isValidGitDir(cmd.gitdir + "/.git"):

# git p4 sync
Traceback (most recent call last):
  File "/usr/libexec/git-core/git-p4", line 4163, in <module>
    main()
  File "/usr/libexec/git-core/git-p4", line 4157, in main
    if not cmd.run(args):
  File "/usr/libexec/git-core/git-p4", line 3569, in run
    branches = p4BranchesInGit(self.importIntoRemotes)
  File "/usr/libexec/git-core/git-p4", line 844, in p4BranchesInGit
    if not line.startswith('p4/'):
TypeError: startswith first arg must be bytes or a tuple of bytes, not str


> Or, even this one:
>
> diff --git a/git-p4.py b/git-p4.py
> index 5b79920f46..2bf6720911 100755
> --- a/git-p4.py
> +++ b/git-p4.py
> @@ -196,6 +196,10 @@ def read_pipe_full(c):
>      expand = isinstance(c,basestring)
>      p = subprocess.Popen(c, stdout=subprocess.PIPE, stderr=subprocess.PIPE,
> shell=expand)
>      (out, err) = p.communicate()
> +    if out is not None:
> +        out = out.decode()
> +    if err is not None:
> +        err = err.decode()
>      return (p.returncode, out, err)
>
>  def read_pipe(c, ignore_error=False):

# git p4 sync
Traceback (most recent call last):
  File "/usr/libexec/git-core/git-p4", line 4167, in <module>
    main()
  File "/usr/libexec/git-core/git-p4", line 4146, in main
    cmd.gitdir = read_pipe("git rev-parse --git-dir").strip().decode()
AttributeError: 'str' object has no attribute 'decode'

Best regards,
Massimo


      parent reply	other threads:[~2019-07-17 10:59 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-28  9:57 git p4 sync: "str expected, not %s" Massimo B.
     [not found] ` <17077551562900174@sas1-9134aa144859.qloud-c.yandex.net>
2019-07-12 10:01   ` Massimo B.
     [not found]     ` <23610851562985541@iva7-634c9cb1f49d.qloud-c.yandex.net>
2019-07-17 10:54       ` Massimo B. [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=61d7947142367c3abf6d6f0af60181a0677ce954.camel@gmx.net \
    --to=massimo.b@gmx.net \
    --cc=ahippo@yandex.ru \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).