Skip to content

Commit 783b794

Browse files
authored
Revert "[3.7] bpo-34977: Add Windows App Store package (GH-10245)" (GH-11021)
This reverts commit 2532091.
1 parent 0d5730e commit 783b794

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

51 files changed

+338
-3097
lines changed

.azure-pipelines/windows-appx-test.yml

Lines changed: 0 additions & 65 deletions
This file was deleted.

.gitattributes

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919

2020
# Specific binary files
2121
Lib/test/sndhdrdata/sndhdr.* binary
22-
PC/classicAppCompat.* binary
2322

2423
# Text files that should not be subject to eol conversion
2524
Lib/test/cjkencodings/* -text

Lib/test/test_pathlib.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1519,7 +1519,7 @@ def test_resolve_common(self):
15191519
# resolves to 'dirB/..' first before resolving to parent of dirB.
15201520
self._check_resolve_relative(p, P(BASE, 'foo', 'in', 'spam'), False)
15211521
# Now create absolute symlinks
1522-
d = support._longpath(tempfile.mkdtemp(suffix='-dirD', dir=os.getcwd()))
1522+
d = support._longpath(tempfile.mkdtemp(suffix='-dirD'))
15231523
self.addCleanup(support.rmtree, d)
15241524
os.symlink(os.path.join(d), join('dirA', 'linkX'))
15251525
os.symlink(join('dirB'), os.path.join(d, 'linkY'))

Lib/test/test_venv.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,6 @@ def test_isolation(self):
243243
self.assertIn('include-system-site-packages = %s\n' % s, data)
244244

245245
@unittest.skipUnless(can_symlink(), 'Needs symlinks')
246-
@unittest.skipIf(os.name == 'nt', 'Symlinks are never used on Windows')
247246
def test_symlinking(self):
248247
"""
249248
Test symlinking works as expected

Lib/venv/__init__.py

Lines changed: 37 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import shutil
1010
import subprocess
1111
import sys
12-
import sysconfig
1312
import types
1413

1514
logger = logging.getLogger(__name__)
@@ -64,11 +63,10 @@ def create(self, env_dir):
6463
self.system_site_packages = False
6564
self.create_configuration(context)
6665
self.setup_python(context)
67-
if not self.upgrade:
68-
self.setup_scripts(context)
6966
if self.with_pip:
7067
self._setup_pip(context)
7168
if not self.upgrade:
69+
self.setup_scripts(context)
7270
self.post_setup(context)
7371
if true_system_site_packages:
7472
# We had set it to False before, now
@@ -159,6 +157,14 @@ def create_configuration(self, context):
159157
f.write('include-system-site-packages = %s\n' % incl)
160158
f.write('version = %d.%d.%d\n' % sys.version_info[:3])
161159

160+
if os.name == 'nt':
161+
def include_binary(self, f):
162+
if f.endswith(('.pyd', '.dll')):
163+
result = True
164+
else:
165+
result = f.startswith('python') and f.endswith('.exe')
166+
return result
167+
162168
def symlink_or_copy(self, src, dst, relative_symlinks_ok=False):
163169
"""
164170
Try symlinking a file, and if that fails, fall back to copying.
@@ -188,9 +194,9 @@ def setup_python(self, context):
188194
binpath = context.bin_path
189195
path = context.env_exe
190196
copier = self.symlink_or_copy
197+
copier(context.executable, path)
191198
dirname = context.python_dir
192199
if os.name != 'nt':
193-
copier(context.executable, path)
194200
if not os.path.islink(path):
195201
os.chmod(path, 0o755)
196202
for suffix in ('python', 'python3'):
@@ -202,33 +208,32 @@ def setup_python(self, context):
202208
if not os.path.islink(path):
203209
os.chmod(path, 0o755)
204210
else:
205-
# For normal cases, the venvlauncher will be copied from
206-
# our scripts folder. For builds, we need to copy it
207-
# manually.
208-
if sysconfig.is_python_build(True):
209-
suffix = '.exe'
210-
if context.python_exe.lower().endswith('_d.exe'):
211-
suffix = '_d.exe'
212-
213-
src = os.path.join(dirname, "venvlauncher" + suffix)
214-
dst = os.path.join(binpath, context.python_exe)
215-
copier(src, dst)
216-
217-
src = os.path.join(dirname, "venvwlauncher" + suffix)
218-
dst = os.path.join(binpath, "pythonw" + suffix)
219-
copier(src, dst)
220-
221-
# copy init.tcl over
222-
for root, dirs, files in os.walk(context.python_dir):
223-
if 'init.tcl' in files:
224-
tcldir = os.path.basename(root)
225-
tcldir = os.path.join(context.env_dir, 'Lib', tcldir)
226-
if not os.path.exists(tcldir):
227-
os.makedirs(tcldir)
228-
src = os.path.join(root, 'init.tcl')
229-
dst = os.path.join(tcldir, 'init.tcl')
230-
shutil.copyfile(src, dst)
231-
break
211+
subdir = 'DLLs'
212+
include = self.include_binary
213+
files = [f for f in os.listdir(dirname) if include(f)]
214+
for f in files:
215+
src = os.path.join(dirname, f)
216+
dst = os.path.join(binpath, f)
217+
if dst != context.env_exe: # already done, above
218+
copier(src, dst)
219+
dirname = os.path.join(dirname, subdir)
220+
if os.path.isdir(dirname):
221+
files = [f for f in os.listdir(dirname) if include(f)]
222+
for f in files:
223+
src = os.path.join(dirname, f)
224+
dst = os.path.join(binpath, f)
225+
copier(src, dst)
226+
# copy init.tcl over
227+
for root, dirs, files in os.walk(context.python_dir):
228+
if 'init.tcl' in files:
229+
tcldir = os.path.basename(root)
230+
tcldir = os.path.join(context.env_dir, 'Lib', tcldir)
231+
if not os.path.exists(tcldir):
232+
os.makedirs(tcldir)
233+
src = os.path.join(root, 'init.tcl')
234+
dst = os.path.join(tcldir, 'init.tcl')
235+
shutil.copyfile(src, dst)
236+
break
232237

233238
def _setup_pip(self, context):
234239
"""Installs or upgrades pip in a virtual environment"""
@@ -315,7 +320,7 @@ def install_scripts(self, context, path):
315320
dstfile = os.path.join(dstdir, f)
316321
with open(srcfile, 'rb') as f:
317322
data = f.read()
318-
if not srcfile.endswith(('.exe', '.pdb')):
323+
if not srcfile.endswith('.exe'):
319324
try:
320325
data = data.decode('utf-8')
321326
data = self.replace_variables(data, context)

Misc/NEWS.d/next/Windows/2018-10-30-13-39-17.bpo-34977.0l7_QV.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

PC/classicAppCompat.can.xml

Lines changed: 0 additions & 1 deletion
This file was deleted.

PC/classicAppCompat.cat

-10.7 KB
Binary file not shown.

PC/classicAppCompat.sccd

Lines changed: 0 additions & 28 deletions
This file was deleted.

PC/getpathp.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -536,16 +536,10 @@ static _PyInitError
536536
get_program_full_path(const _PyCoreConfig *core_config,
537537
PyCalculatePath *calculate, _PyPathConfig *config)
538538
{
539-
const wchar_t *pyvenv_launcher;
540539
wchar_t program_full_path[MAXPATHLEN+1];
541540
memset(program_full_path, 0, sizeof(program_full_path));
542541

543-
/* The launcher may need to force the executable path to a
544-
* different environment, so override it here. */
545-
pyvenv_launcher = _wgetenv(L"__PYVENV_LAUNCHER__");
546-
if (pyvenv_launcher && pyvenv_launcher[0]) {
547-
wcscpy_s(program_full_path, MAXPATHLEN+1, pyvenv_launcher);
548-
} else if (!GetModuleFileNameW(NULL, program_full_path, MAXPATHLEN)) {
542+
if (!GetModuleFileNameW(NULL, program_full_path, MAXPATHLEN)) {
549543
/* GetModuleFileName should never fail when passed NULL */
550544
return _Py_INIT_ERR("Cannot determine program path");
551545
}

PC/icons/pythonwx150.png

-8 KB
Binary file not shown.

PC/icons/pythonwx44.png

-2.18 KB
Binary file not shown.

PC/icons/pythonx150.png

-8.08 KB
Binary file not shown.

PC/icons/pythonx44.png

-2.13 KB
Binary file not shown.

PC/icons/pythonx50.png

-2.14 KB
Binary file not shown.

0 commit comments

Comments
 (0)