New submission from Eryk Sun :
For \\?\ extended device paths, pathlib removes the trailing slash for the root
directory if the device isn't UNC or a logical (A-Z) drive.
Correct:
>>> str(Path('//?/UNC/'))
'?\\UNC\\'
>>> str(Pa
Eryk Sun added the comment:
In some of these cases, it would be simpler to just remove the explicit dynamic
linking. 3.6+ doesn't support XP, so CancelIoEx, CreateSymbolicLinkW,
RegDeleteKeyExW, RegDisableReflectionKey, RegEnableReflectionKey, and
RegQueryReflectionKey can be l
Eryk Sun added the comment:
Limiting to 64-bit is already implemented in the latest version of the
launcher. For example, below I've renamed the registry key for 64-bit Python
3.5 to "xxx3.5" to prevent the launcher from finding it:
C:\>py -3.5-64
Pytho
Eryk Sun added the comment:
David, this is a bug in Python, and the proposed patch is insufficient. We use
the volume serial number as st_dev, and this is not guaranteed to be unique in
Windows, and may be 0, just as a file's index number is also allowed to be 0.
Both possibilities are
Change by Eryk Sun :
--
resolution: -> duplicate
stage: -> resolved
status: open -> closed
superseder: -> Add non-elevated symlink support for dev mode Windows 10
type: -> enhancement
___
Python tracker
<https://bugs.pyt
Change by Eryk Sun :
--
stage: needs patch -> patch review
versions: +Python 3.7, Python 3.8
___
Python tracker
<https://bugs.python.org/issue29097>
___
___
Py
Eryk Sun added the comment:
Sebastian, the problem in this case is that
startupinfo.lpAttributeList['handle_list'] contains the duplicated
standard-handle values from the previous call, which were closed and are no
longer valid. subprocess.Popen has always modified STARTUPINF
Eryk Sun added the comment:
Offhand I don't know why it copies PYD and DLL files from the DLLs directory.
It's part of the standard library. The virtual environment should only need to
copy or symlink the binaries in the application directory, such as python.exe,
pythonw.exe,
Change by Eryk Sun :
--
versions: +Python 3.7, Python 3.8
___
Python tracker
<https://bugs.python.org/issue34011>
___
___
Python-bugs-list mailing list
Unsub
Change by Eryk Sun :
--
assignee: -> docs@python
components: +Documentation
dependencies: +Allow windows launcher to specify bit lengths with & without
minor version
nosy: +docs@python
resolution: duplicate ->
stage: resolved -> patch review
status: closed -> open
s
Eryk Sun added the comment:
I don't think the launcher has unit tests.
The if statement in process() that calls show_python_list only checks for "-0".
It needs to check for the long names as well, e.g.:
if (argc == 2) {
/* First check for -0[p], --list,
Eryk Sun added the comment:
This PR works around a bug in CMD, so I'm inclined to close it as a third-party
issue.
CMD is supposed to implement the following behavior:
1. If all of the following conditions are met, then quote
characters on the command line are pres
Eryk Sun added the comment:
This issue isn't specific to Windows. It's a bug in shutil._basename:
def _basename(path):
# A basename() variant which first strips the trailing slash, if
present.
# Thus we always get the last component of the path, even for
d
Eryk Sun added the comment:
Serhiy, an empty file path shouldn't crash the interpreter. The per-thread
invalid parameter handler is suppressed before calling _wspawnv, so it should
raise OSError (EINVAL) if the file path is empty. That's what I observe in 3.7.
Are you suggestin
Eryk Sun added the comment:
> I don't understand why Python behaves differently in debug mode.
> For me, if Python is able to trigger an exception on EINVAL, we
> should also get a regular Python exception in debug mode (and not
> a crash)
The debug build's behavio
Eryk Sun added the comment:
This line in the docs is incorrect:
If PY_PYTHON=3 and PY_PYTHON3=3.1, the commands python and python3
will both use specifically 3.1
It implies that setting the `python` virtual command to "3" or "2" will use the
configured version
Eryk Sun added the comment:
> all the input before the ignored Ctrl+C is lost
The console host process doesn't know that Python is ignoring Ctrl+C, so it
cancels the read and flushes the input buffer. For now, we have to accept this
as a limitation of relying on the high-level con
New submission from Eryk Sun :
The _WindowsConsoleIO implementation of fileno should raise a ValueError if the
internal handle value is INVALID_HANDLE_VALUE. Currently it raises
io.UnsupportedOperation, and only if closefd=True.
>>> f = open('conin$', &
Eryk Sun added the comment:
> On Windows Console, sys.stdin.close() does not prevent a second
> interact call. This might be considered a bug.
This is a bug in io._WindowsConsoleIO.
In Python 3, the sys.std* file objects that get created at startup use
closefd
Eryk Sun added the comment:
os__getvolumepathname_impl in Modules/posixmodule.c doesn't directly modify the
case. So that leaves WinAPI GetVolumePathNameW as the culprit, but, according
to the following test, apparently not in Windows 10.0.17134:
kernel32 = ctypes.WinDLL(
Eryk Sun added the comment:
> the directory in which I'm building (c:\work-in-progress) is actually
> a junction to c:\users\\work-in-progress
That makes sense. GetVolumePathName traverses backwards from the final
component. If it reaches a reparse point (other than a junction t
Eryk Sun added the comment:
Please refrain from using the issue tracker to satisfy your curiosity. This is
a question about compiler optimizations that should be asked on python-list, or
maybe python-dev.
You can use the dis module to get a superficial answer in terms of the
constants in
Eryk Sun added the comment:
`cmd.exe dir` ignores the unrecognized `dir` argument and runs the interactive
shell. The shell is waiting for input on stdin. You can type "exit" and press
enter to return to Python.
When you run this from IDLE (i.e. via pythonw.exe), there's n
Eryk Sun added the comment:
> tests are competing with each other to delete and recreate the file
When is this an issue? Each parallel test process should have its own working
directory under "{TEMPDIR}/test_python_{pid}".
--
n
Eryk Sun added the comment:
To clarify, TEMPDIR in this case is from the following code in
Lib/test/libregrtest/main.py:
# When tests are run from the Python build directory, it is best practice
# to keep the test files in a subfolder. This eases the cleanup of leftover
# files
Eryk Sun added the comment:
See the discussion in issue 28686 regarding the use of version detection and/or
versioned executable names with env shebangs. I think the launcher should at
least support searching PATH for pythonX.exe and pythonX.Y.exe, so users can at
least manually copy or
Eryk Sun added the comment:
> New windows will support case sensitive filesystem too.
NTFS in Windows 10 supports a flag to mark a directory as case sensitive [*]
via NtSetInformationFile: FileCaseSensitiveInformation, which can be set from
the command line via fsutil.exe. In recent bui
Eryk Sun added the comment:
The Windows implementation shouldn't map file-descriptor values 0, 1, and 2 to
the process standard handles. fileno(stdout) may not even be 1 in some cases.
It should use `handle = _get_osfhandle(fd)`, which is more generally correct
and not limited to hard-
Eryk Sun added the comment:
Changing the system timer resolution doesn't appear to help, given the current
design combined with what looks like a bug in Windows (at least in Windows 10).
We can set the system clock resolution below a millisecond via
NtSetTimerResolution. I tested at 0
Change by Eryk Sun :
--
resolution: -> third party
stage: -> resolved
status: open -> closed
type: -> behavior
___
Python tracker
<https://bugs.python
Eryk Sun added the comment:
The interpreter uses the system ANSI codepage for non-console files. In your
case this is codepage 1252. In my current setup I can't reproduce this issue
since I'm using the new (beta) support in Windows 10 to configure the ANSI
codepage as UTF-8 (65
Change by Eryk Sun :
--
resolution: -> third party
stage: test needed -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.or
Eryk Sun added the comment:
This may be the same problem as issue 32245, which was a third-party bug that
Microsoft fixed in the last Spring update of Windows 10. Which version of
Windows are you using?
--
nosy: +eryksun
___
Python tracker
Eryk Sun added the comment:
Python doesn't go out of its way to fake a cross-platform POSIX environment in
Windows, complete with emulated fork and exec. I don't recommend using
nt.execv[e] or the os.exec* functions in Windows. Their behavior is almost
always undesired. I'd
Eryk Sun added the comment:
With Windows 10 release 1803, I can't reproduce either this problem or the
problems from issue 32245. I'm marking this issue closed as a duplicate. Open a
new issue if you still experience the problem after updating to Windows 10
release 18
Eryk Sun added the comment:
nt.execv[e] wraps calling the C runtime _wexecv[e] function. The other os.exec*
functions are in turn based on these calls. As to spawn, for Windows _P_OVERLAY
just means to exit the current process. The source code is published, so you
can see how simple the
Eryk Sun added the comment:
> lseek() succeeds on pipes on Windows, but is nearly useless
lseek isn't meaningful for pipe and character files (i.e. FILE_TYPE_PIPE and
FILE_TYPE_CHAR). While SEEK_SET and SEEK_CUR operations trivially succeed in
these cases, the underlying devic
Eryk Sun added the comment:
In a patch review [1] for issue 24505, I had a discussion with Toby Tobkin
about extending the behavior of shutil.which() on Windows. This was to match
the behavior of the CMD shell, including securing the search path via
NeedCurrentDirectoryForExePath, searching
Eryk Sun added the comment:
ctypes.windll is an instance of ctypes.LibraryLoader, which has a __getattr__
method that calls ctypes.WinDLL(name) and caches the result as an instance
attribute. I suppose with chained exceptions it's reasonable to handle OSError
in __getattr__ by ra
Eryk Sun added the comment:
> I confirm that in a junction point
This path-parsing bug that strips a trailing slash occurs when a traversed
directory is a reparse point, such as a mount-point (junction) or directory
symbolic link. It may be limited to just the NTFS and ReFS file-sys
Eryk Sun added the comment:
> FWIW, the method does not exist on Windows
In Windows it's FreeLibrary, for which the implementation in NT calls loader
and runtime library functions such as LdrUnloadDll and RtlImageNtHeaderEx.
These OS functions internally use structured exception
Eryk Sun added the comment:
> there shouldn't be any problem with 33-bit/64-bit here. Windows
> doesn't separate processes like that.
Accessing the MainModule property of a .NET Process object raises an exception
if the current process is 32-bit and the process is 64-
Eryk Sun added the comment:
This is due to the ps command itself. You'd have the same problem when piping
to grep or redirecting output to a file. I don't know how it determines
terminal size. I tried overriding stdin, stdout and stderr to pipes and calling
setsid() in the fo
Eryk Sun added the comment:
> Windows getcwd() returns a path without resolved symbolic links
This provides consistency. If the working directory were resolved, then
accessing "../file.ext" after chdir("C:/Temp/link") could be inconsistent with
accessing "C:/Tem
Eryk Sun added the comment:
The Windows command line often has inconsistently localized strings. In this
case it's from the ulib.dll utility library. For German, message 0x7692 in
"de-DE\ulib.dll.mui" is "Aktive Codepage: %1.\r\n", which has a period after
the %1
Eryk Sun added the comment:
Serhiy, do you also plan to work around immutable files in POSIX? What about
permissions on directories that prevent deleting files?
In BSD and macOS, we have os.chflags for modifying file flags. Modifying the
immutable flag requires superuser access. In Linux
Eryk Sun added the comment:
In case you don't know, on Windows an args sequence has to be converted to a
command line that's compatible with CreateProcess[AsUser]. If the executable
path isn't passed separately, the system has to parse it from the command line,
and in this
Eryk Sun added the comment:
> file mode and flags which can be set by os.chmod() and os.chflags()
> by unprivileged user.
I remembered incorrectly about chflags. It's not a single immutable flag, but
several (depending on the OS). The owner or superuser can modify U
Eryk Sun added the comment:
> he himself puts double quotes or calls CommandLineToArgvW
CommandLineToArgvW has nothing to do with creating a command line for use with
CreateProcess. It's used by a process to parse its own command line using the
common VC++ rules.
> subprocess.l
Eryk Sun added the comment:
Assign an errcheck function to check the return value and raise an OSError
exception on failure. Load the C library with use_errno=True to get the value
of C errno. Make sure to properly handle encoding Unicode strings for the
file-system encoding, including
Change by Eryk Sun :
--
resolution: -> fixed
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue35205>
___
Change by Eryk Sun :
--
resolution: -> fixed
stage: -> resolved
status: open -> closed
___
Python tracker
<https://bugs.python.org/issue34949>
___
Eryk Sun added the comment:
The EINVAL error in Windows also needs improvement, but I don't what can be
done after the fact. If there's a trailing slash when opening or creating a
regular file, the NtCreateFile system call returns STATUS_OBJECT_INVALID_NAME.
The Windows API ma
Eryk Sun added the comment:
os.path.join and pathlib are working as designed and documented. Similarly in
POSIX we have the following:
>>> p = os.path.join("/123/345", "/", "folder///filename.bin")
>>> print(p)
/folder///filename.bi
Eryk Sun added the comment:
0xC01D is STATUS_ILLEGAL_INSTRUCTION. This is probably due to a third-party
bug that's corrupting the return address on the stack, so I'm closing this
issue for now. It can be reopened if the developers of the face_recognition
module determine t
Eryk Sun added the comment:
> I am not sure what a 'post-installation script' means in practice.
IIRC, there's no way to prevent environment-variable expansion when shortcuts
are created by an MSI, so the shortcuts need to be created or modified after
installing IDLE. P
Eryk Sun added the comment:
No, Python 3.5 is the first version to always place the interpreter DLL in the
installation directory, beside python.exe. Installing for all users does not
place python35.dll in "%SystemRoot%\System32".
--
nosy
Eryk Sun added the comment:
Please zip and upload the installation logs since your most recent attempt in
msg281849. They might help to figure out why it's doing a per-user uninstall
that removes python35.dll.
--
___
Python tracker
Eryk Sun added the comment:
I've come across a few problems when passing a modified os.environ.copy() to a
child process via subprocess.Popen. Ideally it shouldn't be an issue, as long
as the OS or C runtime functions are used, but some troublesome programs do
their own case-sensit
Eryk Sun added the comment:
As shown above, exec and eval default to calling PyEval_GetBuiltins when the
globals dict doesn't define '__builtins__'. PyEval_GetBuiltins uses the current
frame's f_builtins. If there isn't a current frame, it defaults to the
interpreter
Eryk Sun added the comment:
You should be able to directly pass the socket to the child process.
multiprocessing registers a reduction for this. On Windows it uses the
DupSocket class from multiprocessing.resource_sharer:
class DupSocket(object):
'''Picklable wrapp
Changes by Eryk Sun :
--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware
___
Python tracker
<http://bugs.python.org/issue28906>
___
___
Changes by Eryk Sun :
--
stage: -> resolved
___
Python tracker
<http://bugs.python.org/issue28906>
___
___
Python-bugs-list mailing list
Unsubscrib
Changes by eryk sun :
--
components: +Installation, Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware
type: performance -> behavior
___
Python tracker
<http://bugs.python.org/issu
eryk sun added the comment:
It looks like you've accidentally created and selected an auto-generated
association between .py and python.exe. You should be able to restore the
original file association to get the "Edit with IDLE" menu back. In Windows 10
the "open with&qu
eryk sun added the comment:
When you change the association for executing scripts (either via Default
Programs or the Open with => Choose another app menu), do not "look for another
app on this PC". Manually associating files with an executable such as py.exe
creates a ProgI
eryk sun added the comment:
> There's no reason to for IDLE to be a system-level association if
> the user has not chosen the association
Ok, to clarify, SystemFileAssociations can be defined in either the system or
user hive. It's fine if the IDLE menu is added this way whe
eryk sun added the comment:
Python 3 does not skip names in __all__ that start with an underscore.
wintypes in 2.x uses `from ctypes import *`, so it needs to define __all__. In
3.x it uses `import ctypes`, so it doesn't define __all__, and the private
names _COORD, _FILETIME, _LARGE_IN
eryk sun added the comment:
There are many possible points of failure, so I'd like to get a clearer picture
of your system configuration. Please download and run the attached batch file
"dump_py_config.bat" and upload the "py_config.txt" file that it creates.
--
Changes by eryk sun :
Removed file: http://bugs.python.org/file45988/dump_py_config.bat
___
Python tracker
<http://bugs.python.org/issue29014>
___
___
Python-bugs-list m
Changes by Eryk Sun :
Added file: http://bugs.python.org/file45989/dump_py_config.bat
___
Python tracker
<http://bugs.python.org/issue29014>
___
___
Python-bugs-list m
Eryk Sun added the comment:
Let's do a bit of house cleaning. Run the following commands in a command
prompt:
reg delete HKCU\SOFTWARE\Classes\.py /f
reg delete HKCU\SOFTWARE\Classes\py_auto_file /f
reg delete HKCU\SOFTWARE\Classes\Applications\python.exe /f
reg delete
Changes by Eryk Sun :
--
nosy: +eryksun
resolution: -> not a bug
stage: -> resolved
status: open -> closed
___
Python tracker
<http://bugs.python.or
Eryk Sun added the comment:
To remove the broken "Edit with IDLE" entry, open an elevated (administrator)
command prompt and run the following:
reg delete "HKLM\SOFTWARE\Classes\Python.File\shell\Edit with IDLE" /f
--
___
P
Eryk Sun added the comment:
> I did that, and now all the options are gone.
Removing the broken HKLM entry shouldn't have removed all of the options. The
"Edit with IDLE" menu should be there as long as Python.File is selected for
the file association. It's defined
Eryk Sun added the comment:
> I want this to be a regular installation of Python wherein I can
> associate .py files with IDLE
That isn't a regular installation. It's not even an optional configuration, and
never has been. You'd have to set that up manually. Are you loo
Eryk Sun added the comment:
openwithidle_for_frostyelsa.reg adds an open command for the current user that
opens the target file in IDLE. This will take precedence over the per-machine
open command that executes the file using the launcher.
It also adds "Run" and "Run a
Eryk Sun added the comment:
PyErr_SetFromWindowsErrWithFilenameObject was never implemented. See issue
11210.
Since 3.3 WindowsError is simply an alias for OSError. See PEP 3151.
--
nosy: +eryksun
___
Python tracker
<http://bugs.python.
Eryk Sun added the comment:
> It's presumably failing to read nonblocking random from CrpytGen
> and falling back to seeding using time and pid.
Yes and no. CryptGenRandom is not failing, but it is nonetheless calling
random_seed_time_pid:
>>> r = random.Random()
Eryk Sun added the comment:
In the cmd shell, run `where python` to confirm that "python" runs 2.7
python.exe, and not a python.bat or python.lnk file. Also, check whether stdin
is an interactive terminal by running `python -c "import sys; print
sys.stdin.isatty()"
Eryk Sun added the comment:
You have pyreadline installed, a 3rd party module that takes over reading from
the console. Try disabling it temporarily by deleting
"E:\Python27\lib\site-packages\readline.pyc" and renaming
"E:\Python27\lib\site-packages\readline.py"
Changes by Eryk Sun :
--
Removed message: http://bugs.python.org/msg284186
___
Python tracker
<http://bugs.python.org/issue29037>
___
___
Python-bugs-list mailin
Eryk Sun added the comment:
The secrets module uses SystemRandom, which overrides random() and
getrandbits() to use os.urandom, so it's not affected.
--
___
Python tracker
<http://bugs.python.org/is
Eryk Sun added the comment:
> As there is no good interface in core Python to the kernel32 console
> operations (and there probably shouldn't be, it would be better to be
> consistent), I suggest just flipping the bit at startup on Windows.
I don't follow your statemen
Eryk Sun added the comment:
git-bash.exe runs bash.exe via cmd.exe, which means the console (conhost.exe)
ends up with 5 attached processes:
cmd.exe
bash.exe
bash.exe
py.exe
python.exe
The default console configuration uses 4 history
Eryk Sun added the comment:
Using platform.architecture [1] is fine here. `bits` defaults to the size of a
pointer in the current process, i.e. `struct.calcsize('P') * 8`.
On Windows, it's useless for anything except the default parameters. It doesn't
call GetBinaryType [
Eryk Sun added the comment:
> from ctypes import *
> msvcrt = cdll.msvcrt
> message_string = "Hello World!\n"
> msvcrt.printf("Testing: %s", message_string)
Avoid using libraries as attributes of cdll and windll. They get cached, and in
turn they cache fun
Changes by Eryk Sun :
--
Removed message: http://bugs.python.org/msg284525
___
Python tracker
<http://bugs.python.org/issue29131>
___
___
Python-bugs-list mailin
Eryk Sun added the comment:
> from ctypes import *
> msvcrt = cdll.msvcrt
> message_string = "Hello World!\n"
> msvcrt.printf("Testing: %s", message_string)
Avoid using libraries as attributes of cdll and windll. They get cached, and in
turn they cache fun
Eryk Sun added the comment:
> I am following the "Gray Hat Python - Python Programming for Hackers and
> Reverse Engineers"
>From what I've seen in Stack Overflow questions asked by people reading that
>book, its ctypes code is generally of poor quality. It only
Changes by Eryk Sun :
--
stage: -> resolved
___
Python tracker
<http://bugs.python.org/issue29173>
___
___
Python-bugs-list mailing list
Unsubscrib
Eryk Sun added the comment:
Implementing pass_fds on Windows is a problem if Popen has to implement the
undocumented use of the STARTUPINFO cbReserved2 and lpReserved2 fields to
inherit CRT file descriptors. I suppose we could implement this ourselves in
_winapi since it's unlikely tha
Eryk Sun added the comment:
> Python already has a multiprocessing module which is able to pass
> handles (maybe also FD? I don't know) to child processes on
> Windows.
Popen doesn't implement the undocumented CRT protocol that's used to smuggle
the file-descriptor ma
Eryk Sun added the comment:
Isn't the proposed workaround also relying on CPython reference counting to
immediately deallocate the sliced view? It fails if I keep a reference to the
sliced view:
byteslike = bytearray(b'abc')
with memoryview(byteslike) as m1:
Changes by Eryk Sun :
--
resolution: -> out of date
stage: -> resolved
___
Python tracker
<http://bugs.python.org/issue24699>
___
___
Python-bugs-list
Eryk Sun added the comment:
As a workaround, the platform's default Ctrl+C handler should allow killing the
process:
>>> signal.signal(signal.SIGINT, signal.SIG_DFL)
>>> counter = itertools.count()
>>> 'count' in counter
Changes by Eryk Sun :
--
stage: -> resolved
___
Python tracker
<http://bugs.python.org/issue29224>
___
___
Python-bugs-list mailing list
Unsubscrib
New submission from Eryk Sun:
win_readlink in Modules/posixmodule.c mistakenly treats the PrintNameOffset
field of the reparse data buffer as a number of characters instead of bytes.
Thus, if the offset is non-zero, the value returned is incorrect stack garbage.
For example, the following
New submission from Eryk Sun:
win32_xstat_impl in Modules/posixmodule.c doesn't check the value of
reparse_tag to limit traversal to only tags that are considered links. So we
have cases in which os.path.islink returns False (e.g. junctions, pending the
resolution of issue 23407), but os
Eryk Sun added the comment:
I opened issue 29248 for the os.readlink bug and issue 29250 for the
inconsistency between os.path.islink and os.stat.
Handling junctions as links is new behavior, so I've changed this issue to be
an enhancement for 3.7.
If the notion of a link is generaliz
1601 - 1700 of 2119 matches
Mail list logo