Eryk Sun added the comment:
In Unix, passing an args list with shell=True makes the first element the -c
command. The remaining elements are arguments for the shell itself, which makes
them $N variables. For example:
>>> subprocess.call(['echo $0, $1', 'sp
Eryk Sun added the comment:
Hiding the console is required often enough that a keyword-only parameter for
this would be useful. Other platforms could simply ignore it, in contrast to
writing platform-dependent code that passes startupinfo. Note that this option
would also hide the window of
Eryk Sun added the comment:
In case you didn't get notified by Rietveld, I made a couple suggestions on
your latest patch. Also, if you wouldn't mind, please update the patch to apply
cleanly to 3.7 -- especially since STARTUPINFO now has an __ini
Changes by Eryk Sun :
--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware
type: -> behavior
___
Python tracker
<http://bugs.python.org/issu
Eryk Sun added the comment:
Using a Windows job object should be paired with the creation flag
CREATE_SUSPENDED. Callers may also need CREATE_BREAKAWAY_FROM_JOB, but setting
that creation flag shouldn't be integrated into Popen.
The child has to be created suspended to ensure it doesn
Eryk Sun added the comment:
PathCchCombineEx isn't an import dependency. It's used dynamically via
LoadLibraryW and GetProcAddress, with a fallback to PathCombineW. Does Wine
maybe have a stub for this function that returns E_NOTIMPL (not implemented)?
--
nosy
Eryk Sun added the comment:
I didn't mean that there's support to fall back on PathCombineW if
PathCchCombineEx returns E_NOTIMPL. I was just guessing at what the stub in
Wine might be doing. I took a look at the source. It seems the Wine stub
function for unimplemented fu
Eryk Sun added the comment:
This issue tracker is only for CPython. win32com is part of PyWin32, which is
an independent project that's hosted at the following SourceForge site:
https://sourceforge.net/projects/pywin32
I suggest that you ask for help on the python-win32 list:
Eryk Sun added the comment:
For Windows, use os.replace instead of os.rename, which will replace the
destination file if it exists. However, a request to replace an existing file
will be denied access if the file is currently open. Unlinking an open file
isn't allowed, even if it's
Eryk Sun added the comment:
> the lack of Windows' os.rename() atomicity
rename/replace is two system calls: NtOpenFile to get a handle for the source
file and NtSetInformationFile to rename it. The difference is only that
replace() sets the ReplaceIfExists field in the FileRenameInf
New submission from Eryk Sun:
When ReadConsole is canceled by CancelSynchronousIo [1], for some reason the
call still succeeds. It's probably related to the hack that maps STATUS_ALERTED
to ERROR_OPERATION_ABORTED when a console read is interrupted by Ctrl+C.
The problem is that,
Eryk Sun added the comment:
Oops, I pasted the MSDN link for ReadConsole instead of CancelSynchronousIo [1].
[1]: https://msdn.microsoft.com/en-us/library/aa363794
--
___
Python tracker
<http://bugs.python.org/issue30
Eryk Sun added the comment:
It's documented that the default conversion for integer arguments is a 32-bit C
int, which is also the default for result types. Whenever pointers (and Windows
handles, which are sometimes 64-bit pointers, such as HMODULE values) are
passed as arguments, in
Eryk Sun added the comment:
I don't see a pressing need to support a -64 architecture suffix. If you run
3.6 and get a 32-bit version, you can assume there's no 64-bit version
installed and error out if you need 64-bit. That said, supporting this suffix
would make the interface
Changes by Eryk Sun :
--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware
___
Python tracker
<http://bugs.python.org/issue30295>
___
___
Eryk Sun added the comment:
msvcrt set_error_mode, CrtReportMode, CrtReportFile and the associated CRT
constants should be documented for use with debug builds. Also, msvcrt is
missing the set_error_mode constants _OUT_TO_DEFAULT, _OUT_TO_STDERR,
_OUT_TO_MSGBOX, and _REPORT_ERRMODE
Eryk Sun added the comment:
In older versions of ctypes, before it was added to the standard library, the
underlying length field was a C int, and CArrayType_new used the PyInt_AS_LONG
macro. ctypes was added to the standard library in 2.5, by which time the
length field is Py_ssize_t, but
Changes by Eryk Sun :
--
status: pending -> closed
___
Python tracker
<http://bugs.python.org/issue16283>
___
___
Python-bugs-list mailing list
Unsubscrib
Changes by Eryk Sun :
--
resolution: -> out of date
stage: -> resolved
status: open -> pending
___
Python tracker
<http://bugs.python.org/issue16283>
___
___
Eryk Sun added the comment:
>> It's a pain to try to install VS 2008 in 2017: it disappeared from
>> microsoft.com, at least the Express edition.
> I believe that is why Microsoft released the Visual C++ Compiler for
> Python 2.7
> (https://www.microsoft.com/en-u
Eryk Sun added the comment:
Are people actually using this script? Maybe it should simply be removed. I see
a few problems with it [1]:
* A default value of "%PATH%" is wrong. That causes the system
PATH to be concatenated with itself.
* For the user scripts directory,
Eryk Sun added the comment:
The launcher could be extended to support additional suffixes in the version
string. Currently -32 is supported after the minor version number (e.g.
3.6-32), and (per a recent update) the latest version of the launcher will also
support -64, with and without
Eryk Sun added the comment:
I'm -0 on the "-0" option, but I think printing the list of registered Python
installations would be useful in the --help text and when the launcher fails to
find a requested version.
--
nosy: +eryksun
___
Eryk Sun added the comment:
How about this?
The character encoding is platform-dependent. Non-Windows
platforms use the locale encoding (see
locale.getpreferredencoding()).
On Windows, UTF-8 is used for console character
devices (i.e. CON, CONIN$, and CONOUT$). However
Eryk Sun added the comment:
I discussed character devices mostly because of the NUL device. It could be
surprising that Python dies on an encoding error when output is redirected to
NUL:
C:\>chcp 1252
Active code page: 1252
C:\>python -c "print('\u20ac')&qu
Eryk Sun added the comment:
Seeing EINVAL here while the child process is alive could mean the read end of
the pipe was closed. For example:
>>> import time, subprocess
>>> cmd = 'python -c "import os, time; os.close(0); time.sleep(15)"'
Eryk Sun added the comment:
> but the error is only ignored when the child process is still alive.
This should instead be the error is only ignored when child process is *no
longer* alive.
--
___
Python tracker
<http://bugs.python.org/issu
Eryk Sun added the comment:
Addressing the underlying problem would require rewriting _Py_read and
_Py_write_impl to directly call ReadFile and WriteFile instead of the CRT read
and write functions. Barring that, on Windows _stdin_write would have to always
ignore EINVAL
Eryk Sun added the comment:
PyOS_Readline uses a null-terminated prompt string. So input() needs to raise a
ValueError if the prompt contains null characters, e.g. if PyBytes_GET_SIZE(po)
!= strlen(promptstr).
--
nosy: +eryksun
___
Python tracker
Eryk Sun added the comment:
Supporting PEP 514 tags is an interesting idea, but maybe you could go into
more detail about what you have in mind. Are you thinking of using the
SysVersion, SysArchitecture, and [Windowed]ExecutablePath fields where
available instead of parsing version tags and
Eryk Sun added the comment:
The existing code can be adapted to generalize support for version-number tags,
i.e. X.Y[-32|-64]. locate_all_pythons() would need to search every company key
to add executable installations that use version-number tags to the
installed_pythons array. Whether a tag
Eryk Sun added the comment:
How about "cannot be compared by value" or "cannot be ordered by value"?
Emphasizing the value aspect doesn't conflict with the default equality
comparison by identity.
Note that starting Python with the -b option causes the bytes type to
Eryk Sun added the comment:
It might be simplest to close this as 3rd party since it's similar to
bpo-29817. A workaround is to call f.seek(0, 1) to reset the stream state when
switching between reading and writing.
That said, a switch to writing at EOF should be supported. The probl
Eryk Sun added the comment:
It looks like slot_tp_descr_get bypasses call_method in order to unset
tp->tp_descr_get for descriptors that don't define __get__. I don't know where
that's an issue. If a class doesn't define __get__, its tp_descr_get slot
should already
New submission from Eryk Sun:
os.path.samefile (used by shutil copyfile and move), os.path.sameopenfile, and
pathlib.samefile rely on os.path.samestat (from genericpath.py), which compares
corresponding st_dev and st_ino values. POSIX assures that the tuple (st_dev,
st_ino) is unique. Windows
Changes by Eryk Sun :
--
resolution: -> duplicate
stage: -> resolved
status: open -> closed
superseder: -> subprocess.Popen(stderr=STDOUT) fails to redirect subprocess
stderr to stdout
___
Python tracker
<http://bugs.python
Eryk Sun added the comment:
The solution to raise a ValueError for the PyOS_Readline case won't change the
behavior of input() in cases where the prompt is written to sys.stdout.
As to copying what print() would do, I guess it's possible to fake it for
common platforms. You'd
Eryk Sun added the comment:
Your example works fine for me in Windows 10, and I see no reason why it would
fail in Windows 7. The crash dialog in your screenshot shows that the problem
occurred in a DLL named "winhadnt.dll". I suspect that this is malware injected
into the python.e
Eryk Sun added the comment:
We can't reliably distinguish file descriptors from OS handles. They're
overlapping sets of integers. A separate pass_handles parameter would be
needed. The bigger problem with that idea is that the handles in the list have
to be made inheritable befo
Eryk Sun added the comment:
You installed Python for all users, which defaults to installing in
%ProgramFiles% or %ProgramFiles(x86)%. Python's installation directory inherits
the security of its parent directory, which in this case grants full control
only to SYSTEM, TrustedInstaller
Eryk Sun added the comment:
> Ah, looks like they require symlinks for the whole test,
> which means you need to be admin when running them on Windows.
The privilege to create symlinks isn't filtered out of a standard user's token.
Are there any buildbots already running as
Eryk Sun added the comment:
The following is an example of the problem, right?
>>> fd = os.open('stdout.txt', os.O_CREAT | os.O_WRONLY)
>>> os.dup2(fd, 1)
>>> print('spam')
Traceback (most recent call last):
File ""
Eryk Sun added the comment:
The new launcher icon still has a rocket on it, which I especially like because
it's easily distinguished when using the GUI to associate .py[w] scripts.
However, it's not the icon used for .py[w] files, so it's rarely seen.
--
nosy: +ery
Eryk Sun added the comment:
Segev included a fix for this leak in PR 1927 for bpo30555, but I suppose it's
better to fix it separately.
--
nosy: +Segev Finer, eryksun
___
Python tracker
<http://bugs.python.org/is
Eryk Sun added the comment:
The memory leak is in os_spawnv_impl and os_spawnve_impl in
Modules/posixmodule.c. The call fails with a ValueError when the first argument
in the argv list is an empty string, in which case these functions both
mistakenly pass i (0) to free_string_array() as the
Eryk Sun added the comment:
It's undocumented that cast() should work to directly convert Python strings to
pointers. Even when it seems to work, it's a risky thing to depend on because
there's no source ctypes data object to reference. Thus there's neither
_b_base_ nor
Change by Eryk Sun :
--
superseder: -> Creating venv from venv no longer works in 3.7.2
___
Python tracker
<https://bugs.python.org/issue36080>
___
___
Py
Eryk Sun added the comment:
> Given that this requirement is not universal and because a leading
> slash controls other behaviors on platforms like Windows
Forward slash has no special meaning anywhere in the names of NT objects, such
as memory Section objects (aka file-mapping object
Eryk Sun added the comment:
In Windows, realpath is currently an alias for abspath. Issue 14094 has a
pending PR that implements realpath, but it's waiting on improved tests and
final approval. I'm afraid it won't make it into 3.8.
I suggest using the resolve() method of a pa
Change by Eryk Sun :
--
nosy: +eryksun
___
Python tracker
<https://bugs.python.org/issue32986>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eryk Sun added the comment:
> And depending on the OS, abort() calls (via Py_FatalError) sometimes
> appear to be segfaults, so it could be any number of issues.
> (Aside - I'd love to replace the abort() calls with specific exit
> codes for configuration errors - they r
Eryk Sun added the comment:
> Alternatively, I'm totally happy to make a three month exception to
> PEP 11 and just drop Win7 completely for 3.8. But I think that needs
> to be made official as early as possible
Windows 7 is still used on about 40% of Windows desktops, a
Eryk Sun added the comment:
Geoff, we probably need a new issue for this, but first, please report the
value of len(os.getcwd()) in a case where check_output() fails.
Prior to Windows 10, the working directory is limited to MAX_PATH - 2 (258)
characters. (Windows uses the last two
Eryk Sun added the comment:
> do you mind if I make a PR with your code(I will of course author you)?
Go for it. I prefer no credit, but you're free to do as you wish.
--
___
Python tracker
<https://bugs.python.org
Eryk Sun added the comment:
I'm closing this as third party. libzmq.dll is not part of a standard Python 3
distribution. Search for an existing issue at the site's for PyZMQ [1] and
ZeroMQ [2].
[1]: https://github.com/zeromq/pyzmq
[2]: https://github.com/zeromq/libzmq
-
Eryk Sun added the comment:
Long-path support in Windows 10 does not extend to the lpCurrentDirectory
parameter of CreateProcessW. If the path length exceeds the old limit of
MAX_PATH - 2 characters (not counting the required trailing backslash and
null), CreateProcessW fails with either
Eryk Sun added the comment:
If you're using a virtual environment, then this is most likely a duplicate of
issue 35797.
--
nosy: +eryksun
___
Python tracker
<https://bugs.python.org/is
Change by Eryk Sun :
--
superseder: -> concurrent.futures.ProcessPoolExecutor does not work in venv on
Windows
___
Python tracker
<https://bugs.python.org/issu
Eryk Sun added the comment:
> call SetDefaultDllDirectories() in Py_Main (i.e. not when embedded)
> to ensure secure search paths are always used
That will require rewriting many scripts and packages that use ctypes or cffi
to load DLLs. It would also break DLLs that internally r
Eryk Sun added the comment:
> `os.path.expanduser` in `ntpath` uses `HOME` in preference to
> `USERPROFILE` / `HOMEDRIVE\\HOMEPATH`
Guido intentionally added support for HOME in ntpath.expanduser way back in
Python 1.5 (circa 1997), and now we're removing it over 20 years later
Eryk Sun added the comment:
> will this change just affect the embedded Python, or will it affect
> the whole process
SetDefaultDllDirectories affects the whole process and cannot be reverted back
to the legacy search path that includes "%SystemRoot%", "%SystemRoot%
Eryk Sun added the comment:
Okay. Sorry for adding noise. My mental hiccup was in thinking it would
continue to use LOAD_WITH_ALTERED_SEARCH_PATH in conjunction with
SetDefaultDllDirectories: LOAD_LIBRARY_SEARCH_DEFAULT_DIRS. I forgot that it's
documented that they shouldn't b
Eryk Sun added the comment:
> Since I just dug enough to find it, the best way to diagnose problems
> with dependent DLLs not being found is probably to run Process Monitor
> [1] while doing the import and checking its logs. It should show the
> paths that were attempted to
Eryk Sun added the comment:
> It appears that the venv module did not get added to the 3.7.3 rc1
> embedded distribution. Was that an oversight, or had I misunderstood
> what was needed for this to have happened?
I think it was supposed to be added to the nuget package:
https://g
Eryk Sun added the comment:
> Is this only targeted at 3.8, then?
Steve said he was okay with adding it in 3.7.3, but it hasn't been added yet in
3.7.3-rc1. In msg337949 I linked to the 3.7.3-rc1 version of options.py, line
54, where "venv" would need to be added to the nu
Eryk Sun added the comment:
> WindowsPath('cc:').absolute() -> WindowsPath('C:/Users/maor/cc:')
This is correct. "cc:" is not a drive, i.e. the `drive` attribute is an empty
string. pathlib handles this as an unqualified filename that gets resolved
rel
Change by Eryk Sun :
--
nosy: +eryksun
___
Python tracker
<https://bugs.python.org/issue3905>
___
___
Python-bugs-list mailing list
Unsubscribe:
Eryk Sun added the comment:
For issue 7909, ntpath.normpath was modified to return the path unchanged if it
begins with exactly either ".\\" or "?\\". Normalization is not
skipped, however, if the prefix has one or more forward slashes instead of all
backslash
Eryk Sun added the comment:
I'm closing this as a resolved issue. Python 2 is approaching end of life, and
I don't see a pressing need for my suggestion in msg237007. We should be using
unicode for paths in Windows anyway since its file systems are natively Unicode.
--
Eryk Sun added the comment:
> I am closing this as out of date because the problem seems to have been
> fixed elsewise.
This is a problem only in Windows 7, which we should have addressed years ago.
It's common enough that we shouldn't leave it as just an unresolved third
Eryk Sun added the comment:
> A current test on a Win 7 machine similar to what I did
> would still be good.
Python 3.8 is the last version to support Windows 7 (i.e. NT 6.1). It should
get bug fixes through Spring 2021, so we have a couple more years to fix this.
We should con
Eryk Sun added the comment:
Windows Error Reporting should create a crash dump file. The default location
for dump files is "%LocalAppData%\CrashDumps". The file should be named either
"python.exe..dmp" (release build) or "python_d.exe..dmp" (debug
build).
You
Eryk Sun added the comment:
The drive is retained when a rooted path is joined to a drive-absolute or
UNC-absolute path. This is documented behavior [1]:
When several absolute paths are given, the last is taken as an
anchor (mimicking os.path.join()’s behaviour):
>>>
Eryk Sun added the comment:
Paul, I agree that joining Path(".") and Path("c:a") should yield Path("c:a").
However, I disagree that we should always be able to construct Path("a/b") from
components Path("a") and Path("b"). It doesn
Eryk Sun added the comment:
> Any comments, questions or more feedback on the PR?
I commented on the PR that I'm concerned that ctypes.CDLL will no longer open a
path with slashes in it (e.g. CDLL("./spam.dll") or CDLL("eggs/spam.dll"))
relative to th
Eryk Sun added the comment:
> There are no specific "import" tests, because it's such a pain to set
> those up (I need to delete files from the build directory during the
> test, and if other tests have already used them that will fail, or I
> need to copy the Pyt
Eryk Sun added the comment:
WinDLL('./_sqlite3.dll') succeeds, which just delays the call to
GetFullPathNameW to the CDLL constructor, so I don't see how the working
directory is a factor. The difference I see is the lack of the
LOAD_LIBRARY_SEARCH_DEFAULT_DIRS flag. Tr
Eryk Sun added the comment:
There's still a potential problem when Reg2Py calls wcslen(str[index]). This
could be addressed by having fixupMultiSZ take an int array to store the length
of each string. For example:
static void
fixupMultiSZ(wchar_t **strings, int *lengths, wc
Eryk Sun added the comment:
_sanitize_windows_name() fails to translate the reserved control characters
(0x01-0x1F) and backslash in names.
What I've seen done in some cases (e.g. Unix network shares mapped to SMB) is
to translate names using the private use area block, e.g. 0
Eryk Sun added the comment:
Windows doesn't implement POSIX signals in the kernel, so
_thread.interrupt_main (i.e. PyErr_SetInterrupt) can be useful as an
abstraction.
Currently PyErr_SetInterrupt (Modules/signalmodule.c) doesn't set our SIGINT
event in Windows. It was suggeste
Eryk Sun added the comment:
:ping: It seems this was ready to be merged a while ago.
--
___
Python tracker
<https://bugs.python.org/issue31512>
___
___
Pytho
Eryk Sun added the comment:
Why is the bash/zsh "activate" script getting distributed with CRLF line
endings? Apparently Windows builds of bash (e.g. git-bash) can handle CRLF line
endings, but Cygwin bash cannot.
As to Linux bash in WSL, the activate script from a virtual e
Eryk Sun added the comment:
> This is assuming that in all these cases people are installing Python
> for Windows and trying to use it from a non-Windows shell (both WSL
> and Cygwin have their own "native" Python builds that presumably
> work).
It should work from
Eryk Sun added the comment:
> Maybe a similar thing exists in Linux?
Back in the late 90s, Linux implemented threads as 'processes' (LinuxThreads),
but with shared resources such as virtual memory and file descriptors. (The
Linux kernel's clone system call is highly
Eryk Sun added the comment:
> my user path contains a stray double quotation mark (")
Steve, do you think we should work around this by first removing double quote
characters from PATH? This will fix the user's PATH, making one or more
directories searchable again, but it co
Eryk Sun added the comment:
Try os.listdir(u'L:\\Temp') in Python 2. Using a unicode string should result
in the same WINAPI FindFirstFileW call as in Python 3.
You're running `python3`, but the standard installation doesn't include
"python3.exe". Please sh
Eryk Sun added the comment:
> In contrast, in the case of CreateProcessW, both Path('./exec') and
> Path('exec') are the *correct* paths to the executable. The ./ is not
> necessary in that case to display the path correctly, but just to
> interact correctly
Eryk Sun added the comment:
Did you try os.listdir(u'L:\\Temp') in Python 2?
--
___
Python tracker
<https://bugs.python.org/issue36646>
___
___
Eryk Sun added the comment:
For me in Windows 10, os.listdir(u"C:\\Temp") uses the same sequence of WINAPI
and NT system calls in 2.7 and 3.6.
Setup the query for all files ("*"), and return the first matching entry:
FindFirstFileW
FindFirstFileExW
Eryk Sun added the comment:
> It'll probably be mbcs or oem encoding. Certainly not UTF-8
Unless the system locale's codepage is set to UTF-8 in Windows 10.
I stepped through this in the debugger. When writing to a pipe, typeperf.exe
calls WideCharToMultiByte(CP_OEMCP, ...),
Eryk Sun added the comment:
In Windows, Python defaults to the system ANSI codepage (e.g. 1252 in the West)
for non-console standard I/O. For the case of a `for /f` loop in CMD, stdout is
a pipe, so Python defaults to writing ANSI encoded text to its end of the pipe.
I recommend overriding
Eryk Sun added the comment:
It's "oem", not "mbcs".
--
___
Python tracker
<https://bugs.python.org/issue36670>
___
___
Python-bug
Eryk Sun added the comment:
> win32file.LockFileEx(h, win32con.LOCKFILE_EXCLUSIVE_LOCK, 5, 5, None)
This is a third-party issue in the PyWin32 package. win32file.LockFileEx
shouldn't allow passing None for the required 5th parameter `ol` (i.e. the
lpOverlapped parameter of WINAPI Lo
Eryk Sun added the comment:
In Windows 7, FindFirstFileA uses a per-thread static buffer to decode the
input bytes path to Unicode. This buffer limits the length to 259 characters
(MAX_PATH - 1), even if a "\\?\" device path is used. Windows 8+ uses a dynamic
buffer, but I don
Eryk Sun added the comment:
>> A new issue should be raised to fix the FormatMessage calls in the
>> standard library that mistakenly leave out
>> FORMAT_MESSAGE_IGNORE_INSERTS.
>
> Do you suggest to modify OSError constructor to modify the call to
> Forma
Eryk Sun added the comment:
> I suspect that we've not used the flags in those ones because we
> think we *can* properly format the message, so fixing the use of
> inserts is a better option than simply going back to the
> unformatted message.
We're advised that i
Change by Eryk Sun :
--
resolution: -> duplicate
stage: patch review -> resolved
status: open -> closed
superseder: -> venv activate.bat reset codepage fails on windows 10
___
Python tracker
<https://bugs.python
Eryk Sun added the comment:
> cp65001 is *not* utf-8: Microsoft decided to handle surrogates
> differently for some reasons.
Do you mean valid UTF-16 surrogate pairs? For example:
>>> codecs.code_page_encode(65001, '\ud800\udc00')
(b'\xf0\x90\x80\x80
Eryk Sun added the comment:
> I think it is better to just make the check in the test conditional.
Okay. The test verifies work done to minimize interpreter startup time, but
probably the relative cost of importing functools (and thus collections et al)
isn't significant compare
Eryk Sun added the comment:
> Note I am aware the actual problem is "utf8" vs "utf-8".
That shouldn't be an issue since "utf8" is an alias.
The fact that your test file has LF line endings is an issue. It should be
fixed in 3.7.4. See issue 20844.
1401 - 1500 of 2119 matches
Mail list logo