[issue16328] win_add2path.py sets wrong user path

2015-03-23 Thread Paul Moore
Paul Moore added the comment: One further thought - the installer can't create the user scripts directory if you're doing an all-users install, that's sort of the point of "all users". It could do so for a per-user install, but then there would be an inconsistency tha

[issue16328] win_add2path.py sets wrong user path

2015-03-23 Thread Paul Moore
Paul Moore added the comment: Here is a patch to fix the issue. -- keywords: +patch Added file: http://bugs.python.org/file38659/addpath.patch ___ Python tracker <http://bugs.python.org/issue16

[issue16328] win_add2path.py sets wrong user path

2015-03-23 Thread Paul Moore
Paul Moore added the comment: Cool. I'll try to set up a test (it's not covered by the testsuite AFAICT) on a VM or something, just to confirm I haven't broken anything. -- ___ Python tracker <http://bugs.pyt

[issue16328] win_add2path.py sets wrong user path

2015-03-23 Thread Paul Moore
Paul Moore added the comment: One further thought. This is a change in behaviour (albeit to a script in Tools), so I'm inclined to say it's a new feature for 3.5, rather than a bugfix to be backported to 2.7 and 3.4. For users of 2.7/3.4, the workaround is simply to rerun the s

[issue16328] win_add2path.py sets wrong user path

2015-03-23 Thread Paul Moore
Paul Moore added the comment: There's actually a bug in the pre-3.5 script beyond the "does the directory exist" check. The code is if hasattr(site, "USER_SITE"): userpath = site.USER_SITE.replace(appdata, "%APPDATA%") userscripts = os.pa

[issue21319] WindowsRegistryFinder never added to sys.meta_path

2015-03-25 Thread Paul Moore
Paul Moore added the comment: I think the main (only?) user of having sys.path entries in the registry is pywin32. It might be worth asking them if they can switch to a more mainstream approach, and then maybe the whole registry finder thing can be removed completely. -- nosy

[issue7511] msvc9compiler.py: ValueError when trying to compile with VC Express

2015-03-27 Thread Paul Moore
Paul Moore added the comment: The correct solution to this issue now is to install the Microsoft supplied "Visual C++ Compiler for Python 2.7" package (available as a free download from MSDN). That has all the components needed to build 32 and 64-bit extensions. Your setup.py ne

[issue23789] decimal.Decimal: __format__ behaviour

2015-03-27 Thread Paul Moore
Paul Moore added the comment: I believe it's the way it is because Python follows the Standard Decimal Specification, which includes tests for conformance to the current formatting behaviour. -- nosy: +paul.moore ___ Python tracker

[issue23808] Symlink to directory on Windows 8

2015-03-29 Thread Paul Moore
Paul Moore added the comment: It returns True. -- ___ Python tracker <http://bugs.python.org/issue23808> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue14243] tempfile.NamedTemporaryFile not particularly useful on Windows

2015-03-30 Thread Paul Moore
Changes by Paul Moore : -- nosy: +paul.moore ___ Python tracker <http://bugs.python.org/issue14243> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue10395] new os.path function to extract common prefix based on path components

2015-03-31 Thread Paul Moore
Paul Moore added the comment: The patch looks good to me. rhettinger: I'm not sure I see a problem with the doc changes in the latest patch - noting that commonprefix may return an invalid path is fine, and what the current docs say. Directing people to commonpath if they don't wa

[issue11344] Add os.path.splitpath(path) function

2015-03-31 Thread Paul Moore
Paul Moore added the comment: Assuming new code should be using pathlib, I agree this should probably be closed now as obsolete. One proviso - pathlib objects don't take a bytestring path in the constructor. If there's a need for a low-level splitpath taking bytes objects, there may

[issue23731] Implement PEP 488

2015-04-01 Thread Paul Moore
Paul Moore added the comment: A few minor review comments. Nothing substantial, tbh. Looks good. -- ___ Python tracker <http://bugs.python.org/issue23731> ___ ___

[issue23862] subprocess popen arguments using double quotes

2015-04-03 Thread Paul Moore
Paul Moore added the comment: On Windows, subprocess.Popen has to convert an argument list to a command line (because that's what the OS expects for CreateProcess). It does so internally, using subprocess.list2cmdline, which follows the quoting rules for the MS C runtime (because that&#

[issue22343] Install bash activate script on Windows when using venv

2015-04-06 Thread Paul Moore
Paul Moore added the comment: Presumably this would just be a case of moving "activate" from venv/scripts/posix to venv/scripts/common? I don't think including csh or fish scripts on Windows is worthwhile... Attached is a patch on that basis. I didn't see any tests for

[issue23901] Force console stdout to use UTF8 on Windows

2015-04-09 Thread Paul Moore
Paul Moore added the comment: Doh. That latter approach (a RawIOBase implementation) is *precisely* what win_unicode_console does for stdout (using utf16le rather than utf8 as that's the native Windows encoding used by WriteConsole). So (a) yes it would work, and (b) it has al

[issue23901] Force console stdout to use UTF8 on Windows

2015-04-09 Thread Paul Moore
New submission from Paul Moore: Console code page issues are a consistent source of problems on Windows. It would be nice, given that the Windows console has Unicode support, if Python could write the full range of Unicode to the console by default. The MSVC runtime appears to have a flag

[issue23901] Force console stdout to use UTF8 on Windows

2015-04-09 Thread Paul Moore
Paul Moore added the comment: Generally, my understanding is that the console does pretty badly at supporting Unicode via the normal WriteFile APIs and the "code page" support (mainly because support for the UTF8 code page is rubbish). But the WriteConsole API does, I believe, h

[issue23901] Force console stdout to use UTF8 on Windows

2015-04-13 Thread Paul Moore
Paul Moore added the comment: My proof-of-concept attempt to use _O_U8TEXT resulted in some very bizarre behaviour - odd buffering of the interactive interpreter output and what appear to be Chinese characters being displayed for normal (ASCII) interactions. I suspect there is some oddity

[issue23970] Update distutils.msvccompiler for VC14

2015-04-16 Thread Paul Moore
Paul Moore added the comment: Hmm, I thought everyone was too scared to change distutils. Brave man :-) More seriously, I'm not sure I can comment usefully, I don't really understand any of this code, and the changes are pretty big. I guess the biggest risk is that someone directly

[issue23970] Update distutils.msvccompiler for VC14

2015-04-16 Thread Paul Moore
Paul Moore added the comment: Sounds fair enough to me. I guess you have most of the bases covered, and AFAIK, we've never actually supported building extensions with anything other than the compiler python.org uses, so that seems a reasonable view to take. Apart from the numpy/scipy

[issue23975] numbers.Rational implements __float__ incorrectly

2015-04-20 Thread Paul Moore
Paul Moore added the comment: Is it not reasonable to simply say that implementations of numbers.Rational which allow the numerator and denominator to have types for which true division doesn't return a float, have to provide their own implementation of __float__()? It's cert

[issue23975] numbers.Rational implements __float__ incorrectly

2015-04-20 Thread Paul Moore
Paul Moore added the comment: Alternatively, return int(self.numerator) / int(self.denominator). After all, a fraction whose numerator can't be represented as a Python (unlimited precision) integer is a pretty odd sort of fraction... -- ___ P

[issue24020] threading.local() must be run at module level (doc improvement)

2015-04-21 Thread Paul Moore
Paul Moore added the comment: Link to the SO answer? Does it explain *why* this is a requirement? -- nosy: +paul.moore ___ Python tracker <http://bugs.python.org/issue24

[issue24020] threading.local() must be run at module level (doc improvement)

2015-04-21 Thread Paul Moore
Paul Moore added the comment: That seems to merely be saying that each threading.local() object is distinct, so if you want to share threadlocal data between workers, creating local objects won't work. I think I see what the confusion is (although I can't quite explain it yet, I&

[issue24020] threading.local() must be run at module level (doc improvement)

2015-04-21 Thread Paul Moore
Paul Moore added the comment: I should also say, I'll try to work up a doc patch for this, once I've got my head round how to explain it :-) -- ___ Python tracker <http://bugs.python.o

[issue24020] threading.local() must be run at module level (doc improvement)

2015-04-21 Thread Paul Moore
Paul Moore added the comment: You're right, the SO answer is simply wrong. I've posted a (hopefully clearer) answer. If anyone wants to check it for accuracy, that'd be great. Agreed this can probably be closed as "not a bug". On first reading, I thought the docs co

[issue24020] threading.local() must be run at module level (doc improvement)

2015-04-21 Thread Paul Moore
Paul Moore added the comment: On 21 April 2015 at 23:11, Ethan Furman wrote: > Hmmm... could my problem be that even though function locals are thread-safe, > the globals are not, so trying to create a threading.local via a global > statement was clobbering other threading.local

[issue23955] Add python.ini file for embedded/applocal installs

2015-04-25 Thread Paul Moore
Paul Moore added the comment: As described. this seems to be a Windows-only feature (it's replacing a registry lookup with a config file alongside the Python DLL). So I'm not sure I understand Nick's comment - Nick, are you suggesting this should be a cross-platform feature? If

[issue24075] list.sort() should do quick exit if len(list) <= 1

2015-04-29 Thread Paul Moore
Paul Moore added the comment: I think the documentation is fine: """ The key corresponding to each item in the list is calculated once and then used for the entire sorting process. """ This corresponds with the standard "decorate-sort-undecorate" appr

[issue24075] list.sort() should do quick exit if len(list) <= 1

2015-04-29 Thread Paul Moore
Paul Moore added the comment: On 29 April 2015 at 19:42, Sergey B Kirpichev wrote: >> It's a common computer science technique > > Could you provide any language that avoid this optimization? > > Here is Perl 5: > http://perl5.git.perl.org/perl.git/blob/HEAD:/pp_sort

[issue24087] Documentation doesn't explain the term "coroutine" (PEP 342)

2015-04-30 Thread Paul Moore
New submission from Paul Moore: Although the new generator methods introduced in PEP 342 are documented, the term "coroutine" is not defined anywhere. In particular, the fact that Python coroutines work in conjunction with an event loop rather than transferring control directly be

[issue23572] functools.singledispatch fails when "not BaseClass" is True

2015-05-01 Thread Paul Moore
Changes by Paul Moore : -- nosy: +paul.moore ___ Python tracker <http://bugs.python.org/issue23572> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue24127] Fatal error in launcher: Job information querying failed

2015-05-05 Thread Paul Moore
Changes by Paul Moore : -- nosy: +paul.moore ___ Python tracker <http://bugs.python.org/issue24127> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue24127] Fatal error in launcher: Job information querying failed

2015-05-05 Thread Paul Moore
Paul Moore added the comment: Install is noted as being on Windows 10 tech preview. I don't have a Windows 10 installation present, but the similar issues reported in Wine seem to be related to limited support in Wine for Windows job objects. Have there been any changes to Job object su

[issue24132] Direct sub-classing of pathlib.Path

2015-05-06 Thread Paul Moore
Paul Moore added the comment: One issue with your code - what would you expect str(test) to produce? "dir/test.txt" or "dir\test.txt"? That's the point of the "flavour" - is it a Windows path or a Unix path? Agreed that an easier method of creating Path s

[issue24127] Fatal error in launcher: Job information querying failed

2015-05-06 Thread Paul Moore
Paul Moore added the comment: It looks like something in the QueryInformationJobObject API has changed with Windows 10. The code says: ok = QueryInformationJobObject(job, JobObjectExtendedLimitInformation, &info, sizeof(info), &rc); if (!o

[issue24127] Fatal error in launcher: Job information querying failed

2015-05-06 Thread Paul Moore
Paul Moore added the comment: Cheers. I missed a bit of code, job comes from "job = CreateJobObject(NULL, NULL)" so it shouldn't be NULL unless that call failed. Rather than speculate though, I'll leave it with you.

[issue24132] Direct sub-classing of pathlib.Path

2015-05-06 Thread Paul Moore
Paul Moore added the comment: For that type of function, I'd suggest you use a standalone function rather than subclassing and methods or operator overloading. You don't gain enough to be worth the complexity of having to subclass path objects. And duck typing means that your func

[issue24127] Fatal error in launcher: Job information querying failed

2015-05-06 Thread Paul Moore
Paul Moore added the comment: Adding Jason Coombs and Vinay Sajip, as if this needs a fix to the launcher code, then the launchers used by distlib and setuptools (for exe wrappers of console entry points) will need to be changed as well. It would be really useful if all 3 projects used a

[issue24132] Direct sub-classing of pathlib.Path

2015-05-06 Thread Paul Moore
Paul Moore added the comment: I have no problem with that - it's a style choice certainly. As I said, I'd like to see simpler subclassing of pathlib objects. I just think it'll be quite hard to do (given the complexities of classes for Windows/Unix as well as pure and concret

[issue24132] Direct sub-classing of pathlib.Path

2015-05-06 Thread Paul Moore
Paul Moore added the comment: > Are you the author of path lib ? Nope, that's Antoine. -- ___ Python tracker <http://bugs.python.org/issue24132> ___ _

[issue24132] Direct sub-classing of pathlib.Path

2015-05-06 Thread Paul Moore
Paul Moore added the comment: > What is the good way to propose a patch ? If you have a patch, attach it here, and it will get reviewed. -- ___ Python tracker <http://bugs.python.org/issu

[issue17620] Python interactive console doesn't use sys.stdin for input

2015-05-10 Thread Paul Moore
Changes by Paul Moore : -- nosy: +paul.moore ___ Python tracker <http://bugs.python.org/issue17620> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue1602] windows console doesn't print or input Unicode

2015-05-11 Thread Paul Moore
Changes by Paul Moore : -- nosy: +paul.moore ___ Python tracker <http://bugs.python.org/issue1602> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue23970] Update distutils.msvccompiler for VC14

2015-05-11 Thread Paul Moore
Paul Moore added the comment: I agree with Steve, we shouldn't be constrained to preserve all the undocumented internals of distutils - doing that in the past is what has made distutils essentially unmaintainable. I don't think there's a concrete example of real code that wi

[issue24195] Add `Executor.filter`

2015-05-14 Thread Paul Moore
Paul Moore added the comment: You should add docs for the new method, as well. -- nosy: +paul.moore ___ Python tracker <http://bugs.python.org/issue24195> ___ ___

[issue24195] Add `Executor.filter` to concurrent.futures

2015-05-15 Thread Paul Moore
Paul Moore added the comment: Just as a note - to test a pure Pthon patch like this, you can apply the patch to your installed Python 3.4 installation, and just run the test using that. There should be no need to build your own Python. >python C:\Apps\Python34\Lib\t

[issue24198] please align the platform tag for windows

2015-05-15 Thread Paul Moore
Paul Moore added the comment: So just to be clear - this proposal would *only* affect the tagged filename used for loading ".pyd" files? (And in practice, the untagged form is normally used for Windows .pyd files anyway...) -- nosy: +

[issue24202] Multiprocessing Pool not working for userdefined function

2015-05-15 Thread Paul Moore
Paul Moore added the comment: Multiprocessing works by firing up additional processes. Those processes won't have access to functions defined in the interactive interpreter. Can you reproduce this problem in a standalone script? I suspect not, but if you can please post the script

[issue24202] Multiprocessing Pool not working for userdefined function

2015-05-15 Thread Paul Moore
Paul Moore added the comment: OK, if it's not reproducible in a standalone script, I'll close this as it's expected behaviour. Correcting the typo in your script (__name__ == "__main__"), I ran it and it worked as expected on my system: >type multi.py import mult

[issue24195] Add `Executor.filter` to concurrent.futures

2015-05-17 Thread Paul Moore
Paul Moore added the comment: I'm not a heavy user of concurrent.futures, so I don't have a strong opinion. I've never felt a need for this function, though, so I guess I'm -0. A recipe in the docs would be good, though. -- __

[issue24229] pathlib.Path should have a copy() method

2015-05-18 Thread Paul Moore
Paul Moore added the comment: I presume the copy method is intended as a file copy, not for copying the object. But calling the method copy() is likely to be confusing, precisely as happened here :-) -- nosy: +paul.moore ___ Python tracker <h

[issue4709] Mingw-w64 and python on windows x64

2015-05-18 Thread Paul Moore
Paul Moore added the comment: Supporting mingw building of extensions has always been a complicated process, mainly because there appear to be many variants of mingw (and in particular, there seem to be multiple 64-bit builds). Add to this the fact that cygwin is sometimes used as a cross

[issue4709] Mingw-w64 and python on windows x64

2015-05-18 Thread Paul Moore
Paul Moore added the comment: Not at all. Mingw support is important for the scientific community, as I understand it, and I'm willing to help there if I can. That won't be at the cost of other areas I can contribute to, but I consider packaging as much my area of expertise as Win

[issue4709] Mingw-w64 and python on windows x64

2015-05-19 Thread Paul Moore
Paul Moore added the comment: Ruben, Thanks for the detailed explanations. Just to be clear, I am *not* the person that will take this aspect of the process forward - that will be the community of people building (or wanting to build) extensions for Python with mingw. I don't know if

[issue4709] Mingw-w64 and python on windows x64

2015-05-19 Thread Paul Moore
Paul Moore added the comment: > If there is no interest in having a (community-supported, semi- > official) GCC-built Python on Windows, I'm sure something else > can also be worked out, which would include stripping the current > dinosaur -mno-cygwin code which is what this b

[issue4709] Mingw-w64 and python on windows x64

2015-05-19 Thread Paul Moore
Paul Moore added the comment: On 19 May 2015 at 17:09, Руслан Ижбулатов wrote: > 3) Use MSVC for CPython and MinGW-w64 for the rest and somehow ensure that > FDs are converted when passing the CRT barrier. And stat structs as well. And > everything else that differs. This is

[issue22107] tempfile module misinterprets access denied error on Windows

2015-05-19 Thread Paul Moore
Paul Moore added the comment: == ERROR: test_read_only_directory (test.test_tempfile.TestMkdtemp) -- Traceback (most recent call last): File "C:\Work\Pro

[issue24127] Fatal error in launcher: Job information querying failed

2015-05-19 Thread Paul Moore
Paul Moore added the comment: Fantastic news, thanks for the feedback. Closing this as a third party issue. -- resolution: -> third party status: open -> closed ___ Python tracker <http://bugs.python.org/i

[issue22107] tempfile module misinterprets access denied error on Windows

2015-05-19 Thread Paul Moore
Paul Moore added the comment: Works fine with the new patch: >.\rt.bat -x64 -q test_tempfile C:\Work\Projects\cpython\PCbuild>"C:\Work\Projects\cpython\PCbuild\amd64\python.exe" -Wd -E -bb "C:\Work\Projects\cpython\PCbuild\..\lib\test\regrtest.py" test_tempfile

[issue4709] Mingw-w64 and python on windows x64

2015-05-19 Thread Paul Moore
Paul Moore added the comment: Ralf, thanks for the comments. The scientific community is definitely the key group that *need* mingw (as opposed to people who merely want to use it because they don't want to buy into MS compilers, or for similar personal reasons). My personal view is th

[issue24250] Optimization for strcpy(..., "") in file 'install.c'

2015-05-21 Thread Paul Moore
Paul Moore added the comment: The patch looks fine to me, although I don't think you need the comment showing the old code. The new code is perfectly clear on its own. -- nosy: +paul.moore ___ Python tracker <http://bugs.python.org/is

[issue22107] tempfile module misinterprets access denied error on Windows

2015-05-21 Thread Paul Moore
Paul Moore added the comment: I'm not sure I follow. Isn't the point of this patch to try again in certain cases of a PermissionError, where currently the code breaks out of the loop early? How can the result be worse than the current behaviour? Suerly sometimes (maybe not always

[issue2528] Change os.access to check ACLs under Windows

2015-05-23 Thread Paul Moore
Changes by Paul Moore : -- nosy: +paul.moore ___ Python tracker <http://bugs.python.org/issue2528> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue27998] Add support of bytes paths in os.scandir()

2016-09-07 Thread Paul Moore
Paul Moore added the comment: In the light of Steve Dower's work to "un-deprecate" bytes paths, I agree this should be added. -- ___ Python tracker <http://bugs.pyt

[issue28137] Windows sys.path file should be renamed

2016-09-15 Thread Paul Moore
Paul Moore added the comment: You can actually handle this already, with a simple wrapper program (based on the one in PC\WinMain.c): /* Minimal main program -- everything is loaded from the library. */ #include "Python.h" #define WIN32_LEAN_AND_MEAN #include int wmain() {

[issue28137] Windows sys.path file should be renamed

2016-09-15 Thread Paul Moore
Paul Moore added the comment: I'd prefer not to hard code __main__.py, as I'd quite like to be able to have a number of copies of the executable, each running its own script. (I foresee putting all my little Python utility scripts in a directory with a Python installation an

[issue28245] Embeddable Python does not use PYTHONPATH.

2016-09-22 Thread Paul Moore
Paul Moore added the comment: See https://docs.python.org/3/using/windows.html#embedded-distribution - "When extracted, the embedded distribution is (almost) fully isolated from the user’s system, including environment variables, system registry settings, and installed packages."

[issue28247] Add an option to zipapp to produce a Windows executable

2016-09-22 Thread Paul Moore
New submission from Paul Moore: The zipapp module allows users to bundle their application as a single file "executable". On Windows, the file is given a ".pyz" extension which is associated with the Python launcher. However, this approach is not always equivalent to a na

[issue28247] Add an option to zipapp to produce a Windows executable

2016-09-22 Thread Paul Moore
Paul Moore added the comment: (1) It starts an extra process (unless you're running the application from cmd.exe) and (2) in some cases, the system won't recognise a cmd file as an executable. For a simple example, t.cmd: @echo Hello from t example.py: from subprocess import r

[issue28247] Add an option to zipapp to produce a Windows executable

2016-09-27 Thread Paul Moore
Paul Moore added the comment: I'm still unsure whether this would be a good idea. On the plus side, it provides (in conjunction with the "embedded" distribution) a really good way of producing a standalone application on Windows. On the minus side there are some limitations wh

[issue28247] Add an option to zipapp to produce a Windows executable

2016-09-28 Thread Paul Moore
Paul Moore added the comment: OK, here's a first draft documentation patch. As it's purely a documentation change, I guess it should go into the 3.5, 3.6 and trunk branches? For now it's against trunk (it's not like that file has changed recently anyway), and I'll

[issue28299] DirEntry.is_dir() evaluates True for a file on Windows

2016-09-28 Thread Paul Moore
Paul Moore added the comment: is_dir is a *method*. To find out if an entry is a directory, you need to call it. So you need from os import DirEntry, scandir def test_is_dir(): for item in os.scandir(TEST_DIR): if item.is_dir(): # ^^ note change

[issue28365] 3.5.2 syntax issue

2016-10-05 Thread Paul Moore
Paul Moore added the comment: I can recreate this (based on the screenshots from #28366). To reproduce, open IDLE. You get the console banner and prompt. Save that file using File-Save. The close IDLE. Reopen it, do File-Open to open your saved console session, then use the "Run" m

[issue28686] py.exe ignored PATH when using python3 shebang

2016-11-14 Thread Paul Moore
Paul Moore added the comment: 1. I don't think searching . should be included - on Unix /usr/bin/env searches PATH, and I believe we should do the same here. 2. The PATH search does happen (from my reading of the code) but it looks for a "python3" command, which isn't avai

[issue28686] py.exe ignored PATH when using python3 shebang

2016-11-14 Thread Paul Moore
Paul Moore added the comment: I agree that the docs are a little confusing on this. Having said that, though, I'm not entirely sure the behaviour needs fixing. The scenario where there's a problem is: 1. User has written a script that needs Python 3 and won't run with Python

<    2   3   4   5   6   7