[Touch-packages] [Bug 1814653] Re: get_python_lib() returns path to python3 instead of python3.6

2019-06-10 Thread vital
Reported this to the correct package:
https://bugs.launchpad.net/ubuntu/+source/python3-stdlib-
extensions/+bug/1832215

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to python3-defaults in
Ubuntu.
https://bugs.launchpad.net/bugs/1814653

Title:
   get_python_lib() returns path to python3 instead of python3.6

Status in python3-defaults package in Ubuntu:
  Confirmed

Bug description:
  Python version is Python 3.6.7 (default, Oct 22 2018, 11:32:17)
  Ubuntu 18.04.01

  When I call get_python_lib() function to get the Python lib path to install a 
module it returns '/usr/lib/python3/dist-packages' instead of python3.6 dir:
  python3 -c "from distutils.sysconfig import *;print(get_python_lib())"

  
  This is because the source code '/usr/lib/python3.6/distutils/sysconfig.py' 
has the branch on Ubuntu:

  Code:
  
  if os.name == "posix":
  libpython = os.path.join(prefix,
   "lib", "python" + get_python_version())
  if standard_lib:
  return libpython
  elif (is_default_prefix and
'PYTHONUSERBASE' not in os.environ and
'VIRTUAL_ENV' not in os.environ and
'real_prefix' not in sys.__dict__ and
sys.prefix == sys.base_prefix):
  return os.path.join(prefix, "lib", "python3", "dist-packages")
  

  However, this code does not present in the original cpython code 3.6.7:
  
https://github.com/python/cpython/blob/ca7d2933a388677cc3bbc621913b479452c0f25a/Lib/distutils/sysconfig.py#L109

  Is it the right behavior?

  Why the get_python_lib() result should depend on PYTHONUSERBASE and
  VIRTUAL_ENV and points to python3 instead of python3.6

  ProblemType: Bug
  DistroRelease: Ubuntu 18.04
  Package: python3 3.6.7-1~18.04
  ProcVersionSignature: Ubuntu 4.15.0-44.47-generic 4.15.18
  Uname: Linux 4.15.0-44-generic x86_64
  ApportVersion: 2.20.9-0ubuntu7.3
  Architecture: amd64
  CurrentDesktop: ubuntu:GNOME
  Date: Tue Feb  5 12:41:28 2019
  InstallationDate: Installed on 2018-09-06 (151 days ago)
  InstallationMedia: Ubuntu 18.04 LTS "Bionic Beaver" - Release amd64 (20180426)
  SourcePackage: python3-defaults
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/python3-defaults/+bug/1814653/+subscriptions

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp


[Touch-packages] [Bug 1814653] Re: get_python_lib() returns path to python3 instead of python3.6

2019-02-07 Thread vital
The issue is that if `get_python_lib()` is called with `prefix='/usr/local'` 
argument then Ubuntu version returns: 
``` sh
$ /usr/bin/python3 -c "from distutils.sysconfig import 
*;print(get_python_lib(prefix='/usr/local'))"
/usr/local/lib/python3/dist-packages
```

while mainstream Python returns:
```sh
$ python3 -c "from distutils.sysconfig import 
*;print(get_python_lib(prefix='/usr/local'))"
/usr/local/lib/python3.6/site-packages
```

`sys.path` (in both Ubuntu and mainstream Python) doesn't contain 
`/usr/local/lib/python3/dist-packages` path, it contains 
`/usr/local/lib/python3.6/dist-packages` instead, so when `/usr/local` prefix 
is used things don't work:
```
$ PYTHONPATH='' /usr/bin/python3 -c "import sys; print(sys.path)"
['', '/usr/lib/python36.zip', '/usr/lib/python3.6', 
'/usr/lib/python3.6/lib-dynload', 
'/home/vital/.local/lib/python3.6/site-packages', 
'/usr/local/lib/python3.6/dist-packages', '/usr/lib/python3/dist-packages']
```

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to python3-defaults in
Ubuntu.
https://bugs.launchpad.net/bugs/1814653

Title:
   get_python_lib() returns path to python3 instead of python3.6

Status in python3-defaults package in Ubuntu:
  Confirmed

Bug description:
  Python version is Python 3.6.7 (default, Oct 22 2018, 11:32:17)
  Ubuntu 18.04.01

  When I call get_python_lib() function to get the Python lib path to install a 
module it returns '/usr/lib/python3/dist-packages' instead of python3.6 dir:
  python3 -c "from distutils.sysconfig import *;print(get_python_lib())"

  
  This is because the source code '/usr/lib/python3.6/distutils/sysconfig.py' 
has the branch on Ubuntu:

  Code:
  
  if os.name == "posix":
  libpython = os.path.join(prefix,
   "lib", "python" + get_python_version())
  if standard_lib:
  return libpython
  elif (is_default_prefix and
'PYTHONUSERBASE' not in os.environ and
'VIRTUAL_ENV' not in os.environ and
'real_prefix' not in sys.__dict__ and
sys.prefix == sys.base_prefix):
  return os.path.join(prefix, "lib", "python3", "dist-packages")
  

  However, this code does not present in the original cpython code 3.6.7:
  
https://github.com/python/cpython/blob/ca7d2933a388677cc3bbc621913b479452c0f25a/Lib/distutils/sysconfig.py#L109

  Is it the right behavior?

  Why the get_python_lib() result should depend on PYTHONUSERBASE and
  VIRTUAL_ENV and points to python3 instead of python3.6

  ProblemType: Bug
  DistroRelease: Ubuntu 18.04
  Package: python3 3.6.7-1~18.04
  ProcVersionSignature: Ubuntu 4.15.0-44.47-generic 4.15.18
  Uname: Linux 4.15.0-44-generic x86_64
  ApportVersion: 2.20.9-0ubuntu7.3
  Architecture: amd64
  CurrentDesktop: ubuntu:GNOME
  Date: Tue Feb  5 12:41:28 2019
  InstallationDate: Installed on 2018-09-06 (151 days ago)
  InstallationMedia: Ubuntu 18.04 LTS "Bionic Beaver" - Release amd64 (20180426)
  SourcePackage: python3-defaults
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/python3-defaults/+bug/1814653/+subscriptions

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp


[Touch-packages] [Bug 1814653] Re: get_python_lib() returns path to python3 instead of python3.6

2019-02-05 Thread Launchpad Bug Tracker
Status changed to 'Confirmed' because the bug affects multiple users.

** Changed in: python3-defaults (Ubuntu)
   Status: New => Confirmed

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to python3-defaults in
Ubuntu.
https://bugs.launchpad.net/bugs/1814653

Title:
   get_python_lib() returns path to python3 instead of python3.6

Status in python3-defaults package in Ubuntu:
  Confirmed

Bug description:
  Python version is Python 3.6.7 (default, Oct 22 2018, 11:32:17)
  Ubuntu 18.04.01

  When I call get_python_lib() function to get the Python lib path to install a 
module it returns '/usr/lib/python3/dist-packages' instead of python3.6 dir:
  python3 -c "from distutils.sysconfig import *;print(get_python_lib())"

  
  This is because the source code '/usr/lib/python3.6/distutils/sysconfig.py' 
has the branch on Ubuntu:

  Code:
  
  if os.name == "posix":
  libpython = os.path.join(prefix,
   "lib", "python" + get_python_version())
  if standard_lib:
  return libpython
  elif (is_default_prefix and
'PYTHONUSERBASE' not in os.environ and
'VIRTUAL_ENV' not in os.environ and
'real_prefix' not in sys.__dict__ and
sys.prefix == sys.base_prefix):
  return os.path.join(prefix, "lib", "python3", "dist-packages")
  

  However, this code does not present in the original cpython code 3.6.7:
  
https://github.com/python/cpython/blob/ca7d2933a388677cc3bbc621913b479452c0f25a/Lib/distutils/sysconfig.py#L109

  Is it the right behavior?

  Why the get_python_lib() result should depend on PYTHONUSERBASE and
  VIRTUAL_ENV and points to python3 instead of python3.6

  ProblemType: Bug
  DistroRelease: Ubuntu 18.04
  Package: python3 3.6.7-1~18.04
  ProcVersionSignature: Ubuntu 4.15.0-44.47-generic 4.15.18
  Uname: Linux 4.15.0-44-generic x86_64
  ApportVersion: 2.20.9-0ubuntu7.3
  Architecture: amd64
  CurrentDesktop: ubuntu:GNOME
  Date: Tue Feb  5 12:41:28 2019
  InstallationDate: Installed on 2018-09-06 (151 days ago)
  InstallationMedia: Ubuntu 18.04 LTS "Bionic Beaver" - Release amd64 (20180426)
  SourcePackage: python3-defaults
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/python3-defaults/+bug/1814653/+subscriptions

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp