public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Zac Medico" <zmedico@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/portage:master commit in: lib/portage/util/_async/
Date: Wed,  4 Oct 2023 04:01:48 +0000 (UTC)	[thread overview]
Message-ID: <1696390998.73eb44fce683a8cbfca195f01783b94eea6e7eca.zmedico@gentoo> (raw)

commit:     73eb44fce683a8cbfca195f01783b94eea6e7eca
Author:     Zac Medico <zmedico <AT> gentoo <DOT> org>
AuthorDate: Wed Oct  4 03:42:41 2023 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Wed Oct  4 03:43:18 2023 +0000
URL:        https://gitweb.gentoo.org/proj/portage.git/commit/?id=73eb44fc

FileCopier: multiprocessing spawn compat

Bug: https://bugs.gentoo.org/915099
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 lib/portage/util/_async/FileCopier.py | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/lib/portage/util/_async/FileCopier.py b/lib/portage/util/_async/FileCopier.py
index da0e85ee4e..d53ff08591 100644
--- a/lib/portage/util/_async/FileCopier.py
+++ b/lib/portage/util/_async/FileCopier.py
@@ -1,4 +1,4 @@
-# Copyright 2013-2019 Gentoo Authors
+# Copyright 2013-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 import os as _os
@@ -20,16 +20,20 @@ class FileCopier(AsyncTaskFuture):
 
     def _start(self):
         self.future = asyncio.ensure_future(
-            self.scheduler.run_in_executor(ForkExecutor(loop=self.scheduler), self._run)
+            self.scheduler.run_in_executor(
+                ForkExecutor(loop=self.scheduler),
+                self._target,
+                self.src_path,
+                self.dest_path,
+            )
         )
         super()._start()
 
-    def _run(self):
-        src_path = _unicode_encode(
-            self.src_path, encoding=_encodings["fs"], errors="strict"
-        )
+    @staticmethod
+    def _target(src_path, dest_path):
+        src_path = _unicode_encode(src_path, encoding=_encodings["fs"], errors="strict")
         dest_path = _unicode_encode(
-            self.dest_path, encoding=_encodings["fs"], errors="strict"
+            dest_path, encoding=_encodings["fs"], errors="strict"
         )
         copyfile(src_path, dest_path)
         apply_stat_permissions(dest_path, _os.stat(src_path))


             reply	other threads:[~2023-10-04  4:01 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-04  4:01 Zac Medico [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-02-14 15:45 [gentoo-commits] proj/portage:master commit in: lib/portage/util/_async/ Zac Medico
2024-02-07  2:35 Zac Medico
2024-02-03 22:54 Zac Medico
2023-12-06 16:25 Zac Medico
2023-10-05  6:28 Zac Medico
2023-10-04  3:25 Zac Medico
2023-10-03 14:48 Zac Medico
2023-10-03 14:48 Zac Medico
2021-09-21  5:51 Zac Medico
2021-05-02  0:00 Zac Medico
2021-03-07 15:17 Zac Medico
2021-03-07 15:17 Zac Medico
2021-02-15  4:38 Zac Medico
2020-08-09  0:46 Zac Medico
2020-08-03 23:28 Zac Medico
2020-06-24  4:36 Zac Medico
2020-06-14  0:02 Zac Medico
2020-04-08  5:56 Zac Medico
2020-03-01  1:22 Zac Medico
2020-02-29  7:51 Zac Medico
2020-02-29  7:51 Zac Medico

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

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

  git send-email \
    --in-reply-to=1696390998.73eb44fce683a8cbfca195f01783b94eea6e7eca.zmedico@gentoo \
    --to=zmedico@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox