[issue29319] Embedded 3.6.0 distribution cannot run pyz files

2018-04-19 Thread Barry A. Warsaw
Change by Barry A. Warsaw : -- nosy: +barry ___ Python tracker ___ ___ Python-bugs-list

[issue29319] Embedded 3.6.0 distribution cannot run pyz files

2018-01-23 Thread Larry Hastings
Larry Hastings added the comment: New changeset 891c91d8d38848377a9f475242507510873eb9c3 by larryhastings (Nick Coghlan) in branch '3.5': [3.5] bpo-32551: Consistently configure sys.path[0] (#5197)

[issue29319] Embedded 3.6.0 distribution cannot run pyz files

2018-01-16 Thread Nick Coghlan
Nick Coghlan added the comment: Tweaking metadata to make it clear Py3.5 was also updated. -- versions: +Python 3.5 ___ Python tracker

[issue29319] Embedded 3.6.0 distribution cannot run pyz files

2018-01-15 Thread Nick Coghlan
Change by Nick Coghlan : -- pull_requests: +5051 ___ Python tracker ___ ___

[issue29319] Embedded 3.6.0 distribution cannot run pyz files

2017-03-31 Thread Donald Stufft
Changes by Donald Stufft : -- pull_requests: +980 ___ Python tracker ___ ___

[issue29319] Embedded 3.6.0 distribution cannot run pyz files

2017-03-24 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset d2977a3ae2cc6802921b1e3b6e9d13fcfbda872d by Nick Coghlan in branch 'master': bpo-29723: Consistently configure sys.path[0] (#575) https://github.com/python/cpython/commit/d2977a3ae2cc6802921b1e3b6e9d13fcfbda872d --

[issue29319] Embedded 3.6.0 distribution cannot run pyz files

2017-03-24 Thread Nick Coghlan
Nick Coghlan added the comment: New changeset c60948464fb0ec116ea227f6bce8a4bb8fb75257 by Nick Coghlan in branch '3.6': [3.6] bpo-29723: Consistently configure sys.path[0] (#636) https://github.com/python/cpython/commit/c60948464fb0ec116ea227f6bce8a4bb8fb75257 --

[issue29319] Embedded 3.6.0 distribution cannot run pyz files

2017-03-24 Thread Ned Deily
Ned Deily added the comment: New changeset 75345c552d0889f4f63039d6063f371846c8f41f by Ned Deily (Nick Coghlan) in branch '3.6': [3.6] bpo-29723: Consistently configure sys.path[0] (#636) https://github.com/python/cpython/commit/75345c552d0889f4f63039d6063f371846c8f41f -- nosy:

[issue29319] Embedded 3.6.0 distribution cannot run pyz files

2017-03-12 Thread Nick Coghlan
Nick Coghlan added the comment: With the fix for issue 29723 merged, this should be properly resolved now (and the fix available with 3.6.1). -- resolution: -> fixed stage: needs patch -> resolved status: open -> closed ___ Python tracker

[issue29319] Embedded 3.6.0 distribution cannot run pyz files

2017-03-12 Thread Nick Coghlan
Changes by Nick Coghlan : -- pull_requests: +525 ___ Python tracker ___ ___

[issue29319] Embedded 3.6.0 distribution cannot run pyz files

2017-03-10 Thread Paul Moore
Paul Moore added the comment: Thanks for that Steve. I had a recollection that there's a way of referencing the PR itself as a branch within the main repo (I guess it must *be* a branch, as how otherwise would github be able to do things like get Travis to build it?) but I don't recall the

[issue29319] Embedded 3.6.0 distribution cannot run pyz files

2017-03-10 Thread Steve Dower
Steve Dower added the comment: That will work fine. Thanks for checking The process for pulling someone's PR into your own repo is roughly branch then pull from the repo sending the PR. Github should show instructions for this under m hidden behind a "merge manually" button (though you want

[issue29319] Embedded 3.6.0 distribution cannot run pyz files

2017-03-10 Thread Paul Moore
Paul Moore added the comment: OK, cool, thanks. I was sort of hoping for a way to just pull direct from the PR (patches on Windows tend to be fiddly due to EOL issues), but I can go with old-style :-) Yes, with that patch applied it still works fine (I copied python3.dll and python36.dll

[issue29319] Embedded 3.6.0 distribution cannot run pyz files

2017-03-10 Thread Nick Coghlan
Nick Coghlan added the comment: If you append ".patch" to a GitHub PR URL, it will give you a patch file that can be applied to any branch with "git apply". In this case, the rendered patch is at https://patch-diff.githubusercontent.com/raw/python/cpython/pull/575.patch --

[issue29319] Embedded 3.6.0 distribution cannot run pyz files

2017-03-10 Thread Paul Moore
Paul Moore added the comment: Nick (or Steve) can you explain how I'd do that? I have a git checkout of the 3.6 branch that I can build. But, how do I merge in the changes from https://github.com/python/cpython/pull/575? The PR seems to be against master, so I'm not sure how to apply it to

[issue29319] Embedded 3.6.0 distribution cannot run pyz files

2017-03-09 Thread Nick Coghlan
Nick Coghlan added the comment: Issue 29723 is a follow up issue to this one, where these changes revealed some latent defects in how sys.path[0] was being initialised in general for directory and zipfile execution (those defects mean the change committed here adds an extra directory to

[issue29319] Embedded 3.6.0 distribution cannot run pyz files

2017-03-09 Thread Paul Moore
Paul Moore added the comment: Confirmed that 3.6.1rc1 fixes the issue in my original use case. -- ___ Python tracker ___

[issue29319] Embedded 3.6.0 distribution cannot run pyz files

2017-03-08 Thread Nick Coghlan
Changes by Nick Coghlan : -- pull_requests: +472 ___ Python tracker ___ ___

[issue29319] Embedded 3.6.0 distribution cannot run pyz files

2017-03-07 Thread Steve Dower
Steve Dower added the comment: Oh, well that's by design. Neither the current working directory nor the directory of the initial script are in sys.path by default - they need to be added explicitly. The intent of this distro is that you know exactly where relative to the executable your

[issue29319] Embedded 3.6.0 distribution cannot run pyz files

2017-03-07 Thread Eric Frederich
Eric Frederich added the comment: I can confirm that this is NOT fixed in 3.6.1rc1 embeddable zip. This is extremely easy to reproduce. Look at the contents of foo.py and bar.py. Just throw them in the same directory and try to run C:\path\to\extracted\python.exe foo.py --

[issue29319] Embedded 3.6.0 distribution cannot run pyz files

2017-03-07 Thread Steve Dower
Steve Dower added the comment: Eric - that sounds like the same issue. Can you test with 3.6.1rc1 to see if it is fixed for you? -- ___ Python tracker

[issue29319] Embedded 3.6.0 distribution cannot run pyz files

2017-03-07 Thread Eric Frederich
Eric Frederich added the comment: I'm wondering if I'm experiencing this same issue. In a simple directory with a foo.py and a bar.py where foo tries to import from bar I cannot get it to work with the embeddable 3.6.0 zip, but the standard 3.6.0 that gets "installed" works fine. Also 3.5.3

[issue29319] Embedded 3.6.0 distribution cannot run pyz files

2017-02-04 Thread Roundup Robot
Roundup Robot added the comment: New changeset baa426f44b86fb146dc17178f61b53ed5ffb08f0 by Steve Dower in branch '3.6': Issue #29319: Prevent RunMainFromImporter overwriting sys.path[0]. https://github.com/python/cpython/commit/baa426f44b86fb146dc17178f61b53ed5ffb08f0 New changeset

[issue29319] Embedded 3.6.0 distribution cannot run pyz files

2017-02-04 Thread Roundup Robot
Roundup Robot added the comment: New changeset baa426f44b86fb146dc17178f61b53ed5ffb08f0 by Steve Dower in branch 'master': Issue #29319: Prevent RunMainFromImporter overwriting sys.path[0]. https://github.com/python/cpython/commit/baa426f44b86fb146dc17178f61b53ed5ffb08f0 New changeset

[issue29319] Embedded 3.6.0 distribution cannot run pyz files

2017-02-04 Thread Roundup Robot
Roundup Robot added the comment: New changeset baa426f44b86fb146dc17178f61b53ed5ffb08f0 by Steve Dower in branch '3.5': Issue #29319: Prevent RunMainFromImporter overwriting sys.path[0]. https://github.com/python/cpython/commit/baa426f44b86fb146dc17178f61b53ed5ffb08f0 --

[issue29319] Embedded 3.6.0 distribution cannot run pyz files

2017-02-04 Thread Steve Dower
Steve Dower added the comment: That change fixes overwriting sys.path[0], the new logic is essentially: try: sys_path0 = sys.path[0] except: sys.path.append(argv0) else: if sys_path0: sys.path.insert(0, argv0) else: sys.path[0] = argv0 I'm leaving this open for

[issue29319] Embedded 3.6.0 distribution cannot run pyz files

2017-02-04 Thread Roundup Robot
Roundup Robot added the comment: New changeset c6506f759db1 by Steve Dower in branch '3.5': Issue #29319: Prevent RunMainFromImporter overwriting sys.path[0]. https://hg.python.org/cpython/rev/c6506f759db1 New changeset 0965e2967056 by Steve Dower in branch '3.6': Issue #29319: Prevent

[issue29319] Embedded 3.6.0 distribution cannot run pyz files

2017-01-20 Thread Nick Coghlan
Nick Coghlan added the comment: I think this is just a straight-up interaction bug where we never accounted for the combination of -I with directory and zipfile execution back when -I was added. >From a bug fix perspective, I think the right thing to do in all affected >versions would be to

[issue29319] Embedded 3.6.0 distribution cannot run pyz files

2017-01-19 Thread Steve Dower
Steve Dower added the comment: I'd say it definitely qualifies as a bug fix, even in 3.5 (which repros), assuming we don't break any existing APIs in the process. -- versions: +Python 3.5 ___ Python tracker

[issue29319] Embedded 3.6.0 distribution cannot run pyz files

2017-01-19 Thread Paul Moore
Paul Moore added the comment: Nice! Thanks for finding this. I don't suppose there's any chance this would qualify as a bugfix for 3.6.1? I've been holding off on working on https://github.com/pfmoore/pylaunch until 3.6 because 3.5 doesn't handle being in a subdirectory very well. It'd be a

[issue29319] Embedded 3.6.0 distribution cannot run pyz files

2017-01-19 Thread Steve Dower
Steve Dower added the comment: Found it in Modules/main.c in RunMainFromImporter(): /* argv0 is usable as an import source, so put it in sys.path[0] and import __main__ */ sys_path = PySys_GetObject("path"); if (sys_path == NULL) { PyErr_SetString(PyExc_RuntimeError,

[issue29319] Embedded 3.6.0 distribution cannot run pyz files

2017-01-19 Thread Steve Dower
Steve Dower added the comment: I just tried it and it makes no difference. Omitting the "._pth" file seems to fix it, but apart from issue29326 (benign) sys.path is fine. Still digging, but don't worry about testing on other machines. -- ___

[issue29319] Embedded 3.6.0 distribution cannot run pyz files

2017-01-19 Thread Paul Moore
Paul Moore added the comment: Sorry I should have thought of trying -v. The output (included below) doesn't seem to offer many hints, though. runpy.pyc is in python36.zip, I checked that. I'll see if I can find a machine without Python installed to test that case. >.\python.exe -v .\test.pyz

[issue29319] Embedded 3.6.0 distribution cannot run pyz files

2017-01-19 Thread Steve Dower
Steve Dower added the comment: Does running with -v provide any more hints? I'm also interested in whether the alphas work when you don't have a full install on the same machine. PC/getpathp.c changed for b1. But that's probably less important. Perhaps runpy just never made it into the

[issue29319] Embedded 3.6.0 distribution cannot run pyz files

2017-01-19 Thread Paul Moore
Paul Moore added the comment: Confirmed that it works with alpha 2, 3 and 4. But fails with beta 1 and the release version. -- ___ Python tracker ___

[issue29319] Embedded 3.6.0 distribution cannot run pyz files

2017-01-19 Thread Paul Moore
Paul Moore added the comment: I just checked, and 3.6.0b1 (the only prerelease version I had available) has the same problem. 3.5.2 works fine. I thought I'd had similar code working during the beta cycle, but I can't demonstrate that any more, so maybe my recollection is wrong :-(

[issue29319] Embedded 3.6.0 distribution cannot run pyz files

2017-01-19 Thread Paul Moore
New submission from Paul Moore: Trying to run a pyz file using the embedded distribution for 3.6.0, I get an error "Could not import runpy module". To reproduce, see below: >type .\__main__.py print('Hello, world') >zip test.pyz __main__.py adding: __main__.py (172 bytes security) (stored