Bug#896271: python3-path: path fails to import

2018-04-26 Thread Matthias Klose
Control: severity -1 important
Control: tags -1 + patch
Control: retitle -1 python3-path: please avoid the usage of distutils at runtime

please avoid the usage of distutils at runtime, using os.copytree instead.
Could you also forward this upstream?



diff -Nru path.py-11.0.1/debian/changelog path.py-11.0.1/debian/changelog
--- path.py-11.0.1/debian/changelog	2018-04-23 08:19:55.0 +0200
+++ path.py-11.0.1/debian/changelog	2018-04-26 08:00:11.0 +0200
@@ -1,3 +1,11 @@
+path.py (11.0.1-2.1) UNRELEASED; urgency=medium
+
+  * Non-maintainer upload.
+  * Avoid usage of distutils.
+  * python3-path: Remove dependency on python3-distutils.
+
+ -- Matthias Klose   Thu, 26 Apr 2018 08:00:11 +0200
+
 path.py (11.0.1-2) unstable; urgency=medium
 
   * Refresh packaging:
diff -Nru path.py-11.0.1/debian/patches/avoid-distutils.diff path.py-11.0.1/debian/patches/avoid-distutils.diff
--- path.py-11.0.1/debian/patches/avoid-distutils.diff	1970-01-01 01:00:00.0 +0100
+++ path.py-11.0.1/debian/patches/avoid-distutils.diff	2018-04-26 08:00:11.0 +0200
@@ -0,0 +1,26 @@
+Index: b/path.py
+===
+--- a/path.py
 b/path.py
+@@ -49,7 +49,6 @@ import operator
+ import re
+ import contextlib
+ import io
+-import distutils.dir_util
+ import importlib
+ import itertools
+ 
+@@ -1407,11 +1406,10 @@ class Path(text_type):
+ self.copytree(stage, symlinks, *args, **kwargs)
+ # now copy everything from the stage directory using
+ #  the semantics of dir_util.copy_tree
+-distutils.dir_util.copy_tree(
++shutil.copytree(
+ stage,
+ dst,
+-preserve_symlinks=symlinks,
+-update=update,
++symlinks=symlinks
+ )
+ 
+ #
diff -Nru path.py-11.0.1/debian/patches/series path.py-11.0.1/debian/patches/series
--- path.py-11.0.1/debian/patches/series	2018-04-23 08:19:55.0 +0200
+++ path.py-11.0.1/debian/patches/series	2018-04-26 08:00:11.0 +0200
@@ -1 +1,2 @@
 missing_flake8.patch
+avoid-distutils.diff


Bug#896271: python3-path: path fails to import

2018-04-20 Thread Helmut Grohne
Package: python3-path
Version: 11.0.1-1
Severity: serious
User: helm...@debian.org
Usertags: python-import

After installing python3-path importing the module path
into a python interpreter fails with the following error:

Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python3/dist-packages/path.py", line 52, in 
import distutils.dir_util
ModuleNotFoundError: No module named 'distutils.dir_util'

The vast majority of import failures is attributed to missing dependencies.
Often times that manifests as an ImportError or ModuleNotFoundError.
Typically, dependencies should be inserted by dh-python via ${python:Depends}
or ${python3:Depends}. Thus a missing dependency can be caused by incomplete
install_requires in setup.py. Sometimes a missing dependency of a dependency
is the cause, in such cases this bug should be reassigned.

Helmut