From 86a22eb827e436ff4648552d4b6922c2c08b573a Mon Sep 17 00:00:00 2001 From: rlacko Date: Tue, 19 Feb 2013 09:16:13 +0100 Subject: Fix for PermissionError when installing on Python 3.3: __pycache__ dir inside distutils scripts metadata directory --HG-- branch : distribute extra : rebase_source : e6761715dec0e43a90b54c26f25fa68d97c97938 --- setuptools/command/easy_install.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'setuptools/command/easy_install.py') diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index 0d72f758..ba98fa13 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -522,6 +522,9 @@ Please make the appropriate changes for your system and try again. """Write all the scripts for `dist`, unless scripts are excluded""" if not self.exclude_scripts and dist.metadata_isdir('scripts'): for script_name in dist.metadata_listdir('scripts'): + if dist.metadata_isdir('scripts/' + script_name): + # Probably Python 3 __pycache__ directory. + continue self.install_script( dist, script_name, dist.get_metadata('scripts/'+script_name) -- cgit v1.2.1 From d9c4d3c51e93c08a76d310e549c6d5de260667bb Mon Sep 17 00:00:00 2001 From: Grigory Petrov Date: Wed, 3 Apr 2013 02:02:44 +0400 Subject: Added support for Windows RT (arm). --HG-- branch : distribute extra : rebase_source : c181b8cc551936e48bdc88d9435018d0d9de00b2 --- setuptools/command/easy_install.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'setuptools/command/easy_install.py') diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index 0d72f758..b675e559 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -19,6 +19,7 @@ import zipfile import re import stat import random +import platform from glob import glob from setuptools import Command, _dont_write_bytecode from setuptools.sandbox import run_setup @@ -1834,6 +1835,8 @@ def get_script_args(dist, executable=sys_executable, wininst=False): ext, launcher = '-script.py', 'cli.exe' old = ['.py','.pyc','.pyo'] new_header = re.sub('(?i)pythonw.exe','python.exe',header) + if platform.machine().lower() == 'arm' : + launcher = launcher.replace(".", "-arm.") if is_64bit(): launcher = launcher.replace(".", "-64.") else: -- cgit v1.2.1 From 15c27d768157550dd606e3a407eebb19c06c3823 Mon Sep 17 00:00:00 2001 From: Grigory Petrov Date: Wed, 3 Apr 2013 02:05:53 +0400 Subject: Respected PEP-8. --HG-- branch : distribute extra : rebase_source : 58252278f993ece0a9b96c58c58f2851fa07e048 --- setuptools/command/easy_install.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setuptools/command/easy_install.py') diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index b675e559..3a848269 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -1835,7 +1835,7 @@ def get_script_args(dist, executable=sys_executable, wininst=False): ext, launcher = '-script.py', 'cli.exe' old = ['.py','.pyc','.pyo'] new_header = re.sub('(?i)pythonw.exe','python.exe',header) - if platform.machine().lower() == 'arm' : + if platform.machine().lower() == 'arm': launcher = launcher.replace(".", "-arm.") if is_64bit(): launcher = launcher.replace(".", "-64.") -- cgit v1.2.1 From d8189bb53bbd7b3c38ee6c31844087f100143f51 Mon Sep 17 00:00:00 2001 From: Grigory Petrov Date: Wed, 3 Apr 2013 02:06:39 +0400 Subject: Respected project coding standard. --HG-- branch : distribute extra : rebase_source : ca79464fdbf6a8765b8928b99c8ef2ab69e35e42 --- setuptools/command/easy_install.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'setuptools/command/easy_install.py') diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index 3a848269..a6ca741f 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -1835,7 +1835,7 @@ def get_script_args(dist, executable=sys_executable, wininst=False): ext, launcher = '-script.py', 'cli.exe' old = ['.py','.pyc','.pyo'] new_header = re.sub('(?i)pythonw.exe','python.exe',header) - if platform.machine().lower() == 'arm': + if platform.machine().lower()=='arm': launcher = launcher.replace(".", "-arm.") if is_64bit(): launcher = launcher.replace(".", "-64.") -- cgit v1.2.1 From 463e07e68ee64bb15aea8516239908e3f6d4f40f Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Fri, 5 Apr 2013 17:10:55 -0400 Subject: Update release notes and comment to provide a bit more detail about the issue and to be more consistent with the solution. --HG-- branch : distribute extra : rebase_source : c813a29e831f266d427d4a4bce3da97f475a8eee --- setuptools/command/easy_install.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'setuptools/command/easy_install.py') diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index ba98fa13..98af2620 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -523,8 +523,9 @@ Please make the appropriate changes for your system and try again. if not self.exclude_scripts and dist.metadata_isdir('scripts'): for script_name in dist.metadata_listdir('scripts'): if dist.metadata_isdir('scripts/' + script_name): - # Probably Python 3 __pycache__ directory. - continue + # The "script" is a directory, likely a Python 3 + # __pycache__ directory, so skip it. + continue self.install_script( dist, script_name, dist.get_metadata('scripts/'+script_name) -- cgit v1.2.1 From aa5a03972360fdd48530183a60171ecbf477d1e6 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sat, 4 May 2013 22:05:52 -0400 Subject: Include a launcher manifest for console scripts to prevent undesirable UAC elevation for scripts detected as installers (such as easy_install). Fixes #143. --HG-- branch : distribute extra : rebase_source : be6f65eea9c10ce78b6698d8c220b6e5de577292 --- setuptools/command/easy_install.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'setuptools/command/easy_install.py') diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index 98af2620..7281d92d 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -20,6 +20,7 @@ import re import stat import random from glob import glob +import pkg_resources from setuptools import Command, _dont_write_bytecode from setuptools.sandbox import run_setup from distutils import log, dir_util @@ -1851,11 +1852,23 @@ def get_script_args(dist, executable=sys_executable, wininst=False): name+'.exe', resource_string('setuptools', launcher), 'b' # write in binary mode ) + if not is_64bit(): + # install a manifest for the launcher to prevent Windows + # from detecting it as an installer (which it will for + # launchers like easy_install.exe). Consider only + # adding a manifest for launchers detected as installers. + # See Distribute #143 for details. + m_name = name + '.exe.manifest' + yield (m_name, load_launcher_manifest(name), 't') else: # On other platforms, we assume the right thing to do is to # just write the stub with no extension. yield (name, header+script_text) +def load_launcher_manifest(name): + manifest = pkg_resources.resource_string(__name__, 'launcher manifest.xml') + return manifest % vars() + def rmtree(path, ignore_errors=False, onerror=auto_chmod): """Recursively delete a directory tree. -- cgit v1.2.1 From d7dec0f7e8cdc12ffc7c8ad42f8b0d4216d8864d Mon Sep 17 00:00:00 2001 From: "wyj1046@gmail.com" Date: Sun, 5 May 2013 17:07:31 +0800 Subject: decode manifest bytes(utf-8) to string first if py version is 3 --HG-- branch : distribute extra : rebase_source : 1038acda4912af8ac637d0e149630a95f3536dec --- setuptools/command/easy_install.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'setuptools/command/easy_install.py') diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index 7281d92d..dc851d1e 100755 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -1867,7 +1867,10 @@ def get_script_args(dist, executable=sys_executable, wininst=False): def load_launcher_manifest(name): manifest = pkg_resources.resource_string(__name__, 'launcher manifest.xml') - return manifest % vars() + if sys.version_info[0] < 3: + return manifest % vars() + else: + return manifest.decode('utf-8') % vars() def rmtree(path, ignore_errors=False, onerror=auto_chmod): """Recursively delete a directory tree. -- cgit v1.2.1