git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* git p4 sync: "str expected, not %s"
@ 2019-06-28  9:57 Massimo B.
       [not found] ` <17077551562900174@sas1-9134aa144859.qloud-c.yandex.net>
  0 siblings, 1 reply; 3+ messages in thread
From: Massimo B. @ 2019-06-28  9:57 UTC (permalink / raw)
  To: git

Hello everybody,

since last updates, git p4 does not work anymore:

# git p4 sync --verbose
Reading pipe: ['git', '--git-dir', '/mnt/data/userspace/project-pb/MM6.test/.git', 'rev-parse', '--git-dir']
Reading pipe: git rev-parse --git-dir
Reading pipe: git rev-parse --show-cdup
Reading pipe: ['git', '--git-dir', b'.', 'rev-parse', '--git-dir']
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 4155, in main
    os.environ["GIT_DIR"] = cmd.gitdir
  File "/usr/lib64/python3.6/os.py", line 674, in __setitem__
    value = self.encodevalue(value)
  File "/usr/lib64/python3.6/os.py", line 744, in encode
    raise TypeError("str expected, not %s" % type(value).__name__)
TypeError: str expected, not bytes

git version 2.22.0
Gentoo Linux
Global Python is 3.6.

Last working version I found: 2.20.1

Best regards,
Massimo


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: git p4 sync: "str expected, not %s"
       [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>
  0 siblings, 1 reply; 3+ messages in thread
From: Massimo B. @ 2019-07-12 10:01 UTC (permalink / raw)
  To: Andrey, git@vger.kernel.org

On Thu, 2019-07-11 at 22:56 -0400, Andrey wrote:

> Strangely, I don't see any changes that could have broken it between 2.20.1
> and 2.22.0.

> Are you sure your git repository is not "bare", i.e. there's .git
> subdirectory?
> Looks like, it doesn't think that "MM6.test/.git" is a valid git repository
> while it would normally be.

I forgot to say, yes it is a bare repo, was created like this:
# git p4 clone --bare //MM6.test@all --verbose

> Anyway, could you, please, try the patch below to see if it helps?

I did, but this fails now like this:

fatal: cannot locate git repository at b'.'

Best regards,
Massimo


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: git p4 sync: "str expected, not %s"
       [not found]     ` <23610851562985541@iva7-634c9cb1f49d.qloud-c.yandex.net>
@ 2019-07-17 10:54       ` Massimo B.
  0 siblings, 0 replies; 3+ messages in thread
From: Massimo B. @ 2019-07-17 10:54 UTC (permalink / raw)
  To: Andrey, git@vger.kernel.org

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-07-17 10:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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.

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).