[issue30545] Enum equality across modules: comparing objects instead of values

2018-08-12 Thread Ethan Furman


Ethan Furman  added the comment:

What you have discovered is not Enum specific, but in fact can happen with any 
module (as stated in my first comment in this bug report).

Maybe these SO question will help:

https://stackoverflow.com/q/2489601/208880

https://stackoverflow.com/a/4798648/208880

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34376] Improve accuracy of math.hypot() and math.dist()

2018-08-12 Thread Stefan Behnel


Stefan Behnel  added the comment:

Could we maybe make an educated guess based on absmin and absmax whether 
scaling is needed or not?

--
nosy: +scoder

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34369] kqueue.control() documentation and implementation mismatch

2018-08-12 Thread Tal Einat


Tal Einat  added the comment:

In Python 3.8 this will have already been fixed (thanks to the recent 
conversion of the select module to use Argument Clinic); see below output from 
a recent build from the master branch.

Given that, is this worth fixing on 2.7 and <3.8?


Help on built-in function control:

control(changelist, maxevents, timeout=None, /) method of select.kqueue instance
Calls the kernel kevent function.

changelist
  Must be an iterable of kevent objects describing the changes to be made
  to the kernel's watch list or None.
maxevents
  The maximum number of events that the kernel will return.
timeout
  The maximum time to wait in seconds, or else None to wait forever.
  This accepts floats for smaller timeouts, too.

--
versions: +Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue21314] Document '/' in signatures

2018-08-12 Thread Berker Peksag


Berker Peksag  added the comment:

I'd suggest adding a FAQ entry to the "Core Language" section at 
https://docs.python.org/3/faq/programming.html#core-language then we can link 
to it from the places (except pydoc docs) Zachary listed in msg223893.

--
nosy: +berker.peksag

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30411] git doesn't support "-C" args under 1.8.5 occurs in configure.ac

2018-08-12 Thread Xiang Zhang


Change by Xiang Zhang :


--
keywords: +patch
pull_requests: +8227
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34386] Expose a dictionary of interned strings in sys module

2018-08-12 Thread Artem Golubin


New submission from Artem Golubin :

Python provides an ability to intern strings (sys.intern). It would be useful 
to expose a read-only dictionary of interned strings to the Python users so we 
can see what kind of strings are interned. 

It takes minimal changes since internally it's just a dictionary. Is this worth 
adding to the sys module?

--
components: Interpreter Core
messages: 323437
nosy: rushter
priority: normal
severity: normal
status: open
title: Expose a dictionary of interned strings in sys module
type: enhancement
versions: Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34369] kqueue.control() documentation and implementation mismatch

2018-08-12 Thread Martin Panter


Martin Panter  added the comment:

Even in 3.8, the main documentation is not fixed: 
https://docs.python.org/dev/library/select.html#kqueue-objects

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34369] kqueue.control() documentation and implementation mismatch

2018-08-12 Thread Tal Einat


Tal Einat  added the comment:

We can just remove the "=None" in the docs for select.kqueue.control() to 
conform with the rest of that doc.

We don't use the PEP 457 slash notation in the docs for select (or perhaps at 
all?).

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34386] Expose a dictionary of interned strings in sys module

2018-08-12 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

Could you explain why this would be useful?

--
nosy: +ronaldoussoren

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34213] Frozen dataclass __init__ fails for "object" property"

2018-08-12 Thread Eric V. Smith


Eric V. Smith  added the comment:


New changeset 4d12e4dc28b7c782c368bae2e8fd3815167ed37d by Eric V. Smith (Vadim 
Pushtaev) in branch 'master':
bpo-34213: Allow dataclasses to work with a field named 'object'. (GH-8452)
https://github.com/python/cpython/commit/4d12e4dc28b7c782c368bae2e8fd3815167ed37d


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34213] Frozen dataclass __init__ fails for "object" property"

2018-08-12 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8228

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34387] Deletion of attributes in dataclass is buggy!

2018-08-12 Thread Kamyar Inanloo


New submission from Kamyar Inanloo :

When using del or delattr on an instance of dataclass, attribute does not get 
deleted truly! using vars or getattr still returns the deleted attribute just 
using delattr again raises error!

--
components: Argument Clinic
messages: 323442
nosy: Kamyar Inanloo, larry
priority: normal
severity: normal
status: open
title: Deletion of attributes in dataclass is buggy!
type: behavior
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24076] sum() several times slower on Python 3 64-bit

2018-08-12 Thread Stefan Behnel


Stefan Behnel  added the comment:

FWIW, a PGO build of Py3.7 is now about 20% *faster* here than my Ubuntu 16/04 
system Python 2.7, and for some (probably unrelated) reason, the system Python 
3.5 is another 2% faster on my side.

IMHO, the only other thing that seems obvious to try would be to inline the 
unpacking of single digit PyLongs into sum(). I attached a simple patch that 
does that, in case someone wants to test it out. For non-PGO builds, it's about 
17% faster for me. Didn't take the time to benchmark PGO builds with it.

--
versions:  -Python 3.5
Added file: https://bugs.python.org/file47748/unpack_single_digits.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24076] sum() several times slower on Python 3 64-bit

2018-08-12 Thread Antoine Pitrou


Change by Antoine Pitrou :


--
nosy:  -pitrou

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34213] Frozen dataclass __init__ fails for "object" property"

2018-08-12 Thread miss-islington


Change by miss-islington :


--
pull_requests: +8229

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34387] Deletion of attributes in dataclass is buggy!

2018-08-12 Thread Berker Peksag


Change by Berker Peksag :


--
components: +Library (Lib) -Argument Clinic
nosy: +eric.smith -larry

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue22602] UTF-7 codec decodes ill-formed sequences starting with "+"

2018-08-12 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

What about a "+" character followed immediately by the end of the bytestring?

>>> b'+'.decode('utf-7')
''

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30871] Add test.pythoninfo

2018-08-12 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

pythoninfo is failing on several buildbots:


https://buildbot.python.org/all/#/builders/102/builds/55
https://buildbot.python.org/all/#/builders/79/builds/237
https://buildbot.python.org/all/#/builders/112/builds/161
https://buildbot.python.org/all/#/builders/118/builds/164
https://buildbot.python.org/all/#/builders/56/builds/105
https://buildbot.python.org/all/#/builders/18/builds/109

Example error:

./python -m test.pythoninfo
ERROR: collect_gdb() failed
Traceback (most recent call last):
  File 
"/usr/home/buildbot/python/2.7.koobs-freebsd-current.nondebug/build/Lib/test/pythoninfo.py",
 line 561, in collect_info
collect_func(info_add)
  File 
"/usr/home/buildbot/python/2.7.koobs-freebsd-current.nondebug/build/Lib/test/pythoninfo.py",
 line 300, in collect_gdb
version = version.splitlines()[0]
IndexError: list index out of range

--
nosy: +pablogsal

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30871] Add test.pythoninfo

2018-08-12 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
status: closed -> open

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34388] collect_gdb fails for test.pythoninfo in several buildbots

2018-08-12 Thread Pablo Galindo Salgado


New submission from Pablo Galindo Salgado :

collect_gdb fails for the test.pythoninfo step in several buildbots:

https://buildbot.python.org/all/#/builders/102/builds/55
https://buildbot.python.org/all/#/builders/79/builds/237
https://buildbot.python.org/all/#/builders/112/builds/161
https://buildbot.python.org/all/#/builders/118/builds/164
https://buildbot.python.org/all/#/builders/56/builds/105
https://buildbot.python.org/all/#/builders/18/builds/109

Example error:

./python -m test.pythoninfo
ERROR: collect_gdb() failed
Traceback (most recent call last):
  File 
"/usr/home/buildbot/python/2.7.koobs-freebsd-current.nondebug/build/Lib/test/pythoninfo.py",
 line 561, in collect_info
collect_func(info_add)
  File 
"/usr/home/buildbot/python/2.7.koobs-freebsd-current.nondebug/build/Lib/test/pythoninfo.py",
 line 300, in collect_gdb
version = version.splitlines()[0]
IndexError: list index out of range

--
components: Build, Tests
messages: 323446
nosy: pablogsal
priority: normal
severity: normal
status: open
title: collect_gdb fails for test.pythoninfo in several buildbots
type: crash
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30871] Add test.pythoninfo

2018-08-12 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

All of these failures seems related to `collect_gdb`  I am going to open a new 
issue:

https://bugs.python.org/issue34388

Please, re-open this one if you think is better to have both open.

--
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34376] Improve accuracy of math.hypot() and math.dist()

2018-08-12 Thread Tim Peters


Tim Peters  added the comment:

Sure, if we make more assumptions.  For 754 doubles, e.g., scaling isn't needed 
if `1e-100 < absmax < 1e100` unless there are a truly ludicrous number of 
points.  Because, if that holds, the true sum is between 1e-200 and 
number_of_points*1e200, both far from being near trouble.

Then the summation loop gets mostly duplicated (with and without scaling), a 
platform-dependent assumption is introduced, and we need two test-and-branches 
to determine which to run.  In the common two-argument cases, it saves one 
division in return.

Note that without the current form of scaling, we lose the guarantee that the 
sum is exact when all the arguments are the same (because they're all scaled to 
exactly 1.0 then, but in general each x*x loses half the product bits without 
scaling).  I don't care about that myself, but Serhiy seems to.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34388] collect_gdb fails for test.pythoninfo in several buildbots

2018-08-12 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

The origin of this can be related to https://bugs.python.org/issue30871

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34388] collect_gdb fails for test.pythoninfo in several AMD64 FreeBSD buildbots

2018-08-12 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
title: collect_gdb fails for test.pythoninfo in several buildbots -> 
collect_gdb fails for test.pythoninfo in several AMD64 FreeBSD buildbots

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34388] collect_gdb fails for test.pythoninfo in several AMD64 FreeBSD buildbots

2018-08-12 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


--
versions: +Python 2.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34386] Expose a dictionary of interned strings in sys module

2018-08-12 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

I wouldn't want a user to be able to mutate the dictionary directly (otherwise, 
non-strings could be added).

--
nosy: +rhettinger

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34385] Failed to build these modules: _ctypes on Solaris 10

2018-08-12 Thread LarBob Doomer


LarBob Doomer  added the comment:

This is due to it not finding the external libffi I have.

--
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34389] CPython may fail to build in the presence of a ~/.pydistutils.cfg

2018-08-12 Thread Antony Lee


New submission from Antony Lee :

I have a ~/.pydistutils.cfg with the following contents:

[build_ext]
force = true
inplace = true

(--force is useful because sometimes just comparing timestamps is insufficient 
to know whether a package needs to be rebuilt, e.g. in the presence of external 
dependencies -- and I use ccache anyways to avoid paying for excessive 
rebuilds; --inplace is useful as I have quite a few packages with extension 
modules that are editably-installed).

With this ~/.pydistutils.cfg, cpython fails to build.  For example, having 
checked out v3.7.0 from a git clone (otherwise clean git repo, per `git clean 
-xfd`),

mkdir build && cd build && ../configure && make

ultimately results in



gcc -pthread -shared 
build/temp.linux-x86_64-3.7/home/antony/src/extern/cpython/Modules/_ctypes/_ctypes.o
 
build/temp.linux-x86_64-3.7/home/antony/src/extern/cpython/Modules/_ctypes/callbacks.o
 
build/temp.linux-x86_64-3.7/home/antony/src/extern/cpython/Modules/_ctypes/callproc.o
 
build/temp.linux-x86_64-3.7/home/antony/src/extern/cpython/Modules/_ctypes/stgdict.o
 
build/temp.linux-x86_64-3.7/home/antony/src/extern/cpython/Modules/_ctypes/cfield.o
 -L/usr/local/lib -lffi -ldl -o 
/home/antony/src/extern/cpython/build/_ctypes.cpython-37m-x86_64-linux-gnu.so
*** WARNING: renaming "_struct" since importing it failed: 
build/lib.linux-x86_64-3.7/_struct.cpython-37m-x86_64-linux-gnu.so: cannot open 
shared object file: No such file or directory
Traceback (most recent call last):
File "../setup.py", line 442, in check_extension_import
importlib._bootstrap._load(spec)
File "", line 696, in _load
File "", line 670, in _load_unlocked
File "", line 583, in module_from_spec
File "", line 1043, in create_module
File "", line 219, in _call_with_frames_removed
ImportError: 
build/lib.linux-x86_64-3.7/_struct.cpython-37m-x86_64-linux-gnu.so: cannot open 
shared object file: No such file or directory

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "../setup.py", line 2363, in 
main()
File "../setup.py", line 2358, in main
"Tools/scripts/2to3", "Tools/scripts/pyvenv"]
File "/home/antony/src/extern/cpython/Lib/distutils/core.py", line 148, in 
setup
dist.run_commands()
File "/home/antony/src/extern/cpython/Lib/distutils/dist.py", line 966, in 
run_commands
self.run_command(cmd)
File "/home/antony/src/extern/cpython/Lib/distutils/dist.py", line 985, in 
run_command
cmd_obj.run()
File "/home/antony/src/extern/cpython/Lib/distutils/command/build.py", line 
135, in run
self.run_command(cmd_name)
File "/home/antony/src/extern/cpython/Lib/distutils/cmd.py", line 313, in 
run_command
self.distribution.run_command(command)
File "/home/antony/src/extern/cpython/Lib/distutils/dist.py", line 985, in 
run_command
cmd_obj.run()
File "/home/antony/src/extern/cpython/Lib/distutils/command/build_ext.py", 
line 339, in run
self.build_extensions()
File "../setup.py", line 308, in build_extensions
self.check_extension_import(ext)
File "../setup.py", line 447, in check_extension_import
assert not self.inplace
AssertionError
make: *** [Makefile:618: sharedmods] Error 1

Removing the ~/.pydistutils.cfg fixes the issue and leads to a successful build.

I think(?) CPython's build system should essentially make sure that distutils 
behaves as if `--no-user-cfg` was in effect.  Or at least the limitation should 
be documented, but it's not very practical to have to temporarily rename an 
existing ~/.pydistutils.cfg whenever building CPython.  See also 
https://bugs.python.org/issue9309, perhaps.

--
components: Build
messages: 323452
nosy: Antony.Lee
priority: normal
severity: normal
status: open
title: CPython may fail to build in the presence of a ~/.pydistutils.cfg
versions: Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34387] Deletion of attributes in dataclass is buggy!

2018-08-12 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
assignee:  -> eric.smith

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34386] Expose a dictionary of interned strings in sys module

2018-08-12 Thread Ronald Oussoren


Ronald Oussoren  added the comment:

Another reason for not wanting write access to the sys.intern dictionary is 
that this dictionary does not own references to its keys and values.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34387] Deletion of attributes in dataclass is buggy!

2018-08-12 Thread Kamyar Inanloo


Kamyar Inanloo  added the comment:

Actually it just sets the attribute to its default value, instead of removing 
it from the instance.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue24111] Valgrind suppression file should be updated

2018-08-12 Thread Benjamin Peterson


Change by Benjamin Peterson :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Update valgrind suppressions

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34386] Expose a dictionary of interned strings in sys module

2018-08-12 Thread Artem Golubin


Artem Golubin  added the comment:

Thank you, I agree. I can't come up with practical use cases other than my 
curiosity. 

Is it possible to somehow expose the dictionary in the debug build of Python? 
Currently, there is no way to access it from the interpreter even with ctypes.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34370] Tkinter scroll issues on macOS

2018-08-12 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
nosy: +serhiy.storchaka, wordtech

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33073] Add as_integer_ratio() to int() objects

2018-08-12 Thread Lisa Roach


Change by Lisa Roach :


--
keywords: +patch
pull_requests: +8230
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue4508] distutils compiler not handling spaces in path to output/src files

2018-08-12 Thread Greg Toombs


Greg Toombs  added the comment:

Confirmed still broken in 3.6.3.

I ran into this when running CFFI. It does very wrong things with the path to 
cl.exe and include files with path spaces.

My workaround is to monkeypatch distutils.ccompiler.gen_preprocess_options such 
that include paths are formed as -I"path" and not -Ipath; and to monkeypatch 
distutils.spawn._nt_quote_args so that it leaves all of the arguments unquoted 
except the first arg (path to cl.exe), which I only got working by using 
tilde-mangled short names.

--
nosy: +Greg Toombs
versions: +Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34387] Deletion of attributes in dataclass is buggy!

2018-08-12 Thread Eric V. Smith


Eric V. Smith  added the comment:

I think this is just normal behavior with classes. But since you haven't shown 
any code, I can't tell exactly what you're doing and what you're expecting.

When providing bug reports, you need to provide:
- Exactly what code you're executing.
- Exactly what output you're seeing.
- What you expect if it's different from what you're seeing.

Please provide this in the body of a message as text, not (for example) as an 
attached image file.

Thanks.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34390] arparse.ArgumentParser misparses list arguments followed by undefined arguments

2018-08-12 Thread Matthias Fripp


New submission from Matthias Fripp :

The code below demonstrates this bug.

import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--list-arg', nargs='+', default=[])
parser.parse_known_args(['--list-arg', 'a', '--text-arg=hello world'])

The result should be (Namespace(list_arg=['a']), ['--text-arg=hello world']), 
but is actually (Namespace(list_arg=['a', '--text-arg=hello world']), []). 
i.e., --list-arg consumes the next argument if that argument hasn't been 
defined and uses an equal sign and has a space in the assigned value.

Note that both of the following work correctly:

parser.parse_known_args(['--list-arg', 'a', '--text-arg', 'hello world'])
parser.parse_known_args(['--list-arg', 'a', '--text-arg=hello'])

Further, the next line should cause an error, but doesn't, due to the behavior 
noted above:

parser.parse_args(['--list-arg', 'a', '--text-arg=hello world'])

--
components: Library (Lib)
messages: 323458
nosy: Matthias Fripp
priority: normal
severity: normal
status: open
title: arparse.ArgumentParser misparses list arguments followed by undefined 
arguments
type: behavior
versions: Python 2.7, Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34213] Frozen dataclass __init__ fails for "object" property"

2018-08-12 Thread miss-islington


miss-islington  added the comment:


New changeset 32e58fc32188753d2a3604feacdf9540fe9515fb by Miss Islington (bot) 
in branch '3.7':
bpo-34213: Allow dataclasses to work with a field named 'object'. (GH-8452)
https://github.com/python/cpython/commit/32e58fc32188753d2a3604feacdf9540fe9515fb


--
nosy: +miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34384] os.readlink does not accept pathlib.Path on Windows

2018-08-12 Thread Berker Peksag


Berker Peksag  added the comment:

Steve and/or Eryk, I was adding some tests for os.readlink() in PR 8740 and I 
noticed that os.readlink() always returns str on Windows. However, the 
documentation for os.readlink() says:

If the path is a bytes object (direct or indirectly), the result will
be a bytes object.

The question is, should I add support for bytes as part of PR 8740? And what is 
the best way to implement it? (e.g. use CreateFileA() if 
PyUnicode_Check(path.object) returns false?)

--
nosy: +eryksun

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue13837] test_shutil fails with symlinks enabled under Windows

2018-08-12 Thread Berker Peksag


Berker Peksag  added the comment:

Issue 20055 was a duplicate of this one. Both tests have been adjusted in 
https://github.com/python/cpython/commit/3f48ac98c04fc17f12c63dcf593dd0c19379c7df.

--
dependencies:  -os.chmod() does not follow symlinks on Windows, 
os.path.realpath on Windows does not follow symbolic links
nosy: +berker.peksag
resolution:  -> duplicate
stage: needs patch -> resolved
status: open -> closed
superseder:  -> On Windows NT 6 with administrator account, there are two 
failing tests on test_shutil.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue34384] os.readlink does not accept pathlib.Path on Windows

2018-08-12 Thread Berker Peksag


Berker Peksag  added the comment:

In msg235615 (Issue 9949), Zachary said using bytes paths on Windows is 
deprecated, but I can't see the actual conversation because Rietveld seems to 
be down: https://bugs.python.org/review/9949/#ps5077 I think the os.readlink() 
documentation needs to be updated if we decide to keep the status quo.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue18597] On Windows sys.stdin.readline() doesn't handle Ctrl-C properly

2018-08-12 Thread Joshua Kinard


Joshua Kinard  added the comment:

I was able to modify eryksun's patch for Python-2.7.15, at least the bulk of 
it.  It looks like the '_PyOS_SigintEvent' function is new to the 3.x branch, 
and despite it being a fairly simple function, it's used in a few core Python 
modules.  So I'm not sure the difficulty of adding it for Python-2.7.  Is there 
an alternative function available in the 2.7 code that I can replace it with?

I also don't have a clue how anyone even builds Python-2.7 on Windows, because 
getting the required tools properly installed borders on the arcane (esp VS2008 
tools).  So testing it might be a bit difficult.  Is there a cheat sheet 
somewhere?

--
nosy: +kumba

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com