[issue31051] IDLE, configdialog, General tab: re-arrange, test user entries

2017-08-02 Thread Louie Lu

Louie Lu added the comment:

I don't like the name "gentab". There is a "genobject.c" in source code but 
stand for "generator object". In the code, both docstring and the name didn't 
mention "General", it only mention at `note.add(self.genpage, 'General')`. That 
is why I got ambiguous when I look back to the code. 

Or maybe it just because I'm not familiar for the abbr., I take a search and 
found that in US Army that General abbr. is Gen.

---

I'm a +0 of MainPage, since in the page, it used for general setting. I'm not 
sure about this changed.

--

___
Python tracker 

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



[issue31112] cannot run module with double quotes

2017-08-02 Thread Eryk Sun

Eryk Sun added the comment:

Python uses the C runtime wmain entry point, which parses the commandline 
string into an argument array using documented rules [1]. The quoted string "-m 
locust.main -V" is passed as a single argument instead of the expected three 
arguments: ["-m", "locust.main", "-V"].

[1]: https://msdn.microsoft.com/en-us/library/17w5ykft

--
nosy: +eryksun
resolution:  -> not a bug
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



[issue31112] cannot run module with double quotes

2017-08-02 Thread ericshenjs

New submission from ericshenjs:

(vPy3X64) test01@NJNU f:\Src\localCode\python\py3_eric
> python "-m locust.main -V"
f:\SDKs\Python\vPy3X64\Scripts\python.exe: Error while finding module 
specification for ' locust.main -V' (ModuleNotFoundError: No module named ' 
locust')

(vPy3X64) test01@NJNU f:\Src\localCode\python\py3_eric
> python -m locust.main -V
[2017-08-03 10:53:19,111] NJNU/INFO/stdout: Locust 0.8a2
[2017-08-03 10:53:19,111] NJNU/INFO/stdout:

(vPy3X64) test01@NJNU f:\Src\localCode\python\py3_eric
> python -V
Python 3.6.1 :: Anaconda 4.4.0 (64-bit)

--
components: Windows
messages: 299681
nosy: ericshenjs, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: cannot run module with double quotes
type: resource usage
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



[issue31085] Add option for namedtuple to name its result type automatically

2017-08-02 Thread Raymond Hettinger

Raymond Hettinger added the comment:

> Also it's far from clear that the pre-renaming field names are 
> what is wanted in the auto-generated typename.

I concur.


> Anyway I think I'm probably out at this point.

Okay, marking this as closed.  Thank you for the suggestion.  Sorry this didn't 
pan out.


> I think Python development is not a good cultural fit
> for me, based on this discussion. 

This particular proposal didn't seem compelling to us.  Other suggestions are 
welcome.  If you're the same Isaac Morlund who participated in the initial 
development of namedtuple() ten years ago, then you should know that the design 
of the _replace() method was principally due to your suggestion.

--
resolution:  -> rejected
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



[issue31085] Add option for namedtuple to name its result type automatically

2017-08-02 Thread Isaac Morland

Isaac Morland added the comment:

Not if one of the attributes is something that cannot be part of a typename:

>>> fields = ['def', '-']

>>> namedtuple ('test', fields, rename=True).__doc__

'test(_0, _1)'

>>> namedtuple ('__'.join (fields), fields, rename=True).__doc__

Traceback (most recent call last):

  File "", line 1, in 

  File
"/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/collections.py",
line 339, in namedtuple

'alphanumeric characters and underscores: %r' % name)

ValueError: Type names and field names can only contain alphanumeric
characters and underscores: 'def_-'

>>>

Which I admit is a weird thing to be doing, but duplicating attribute names
or trying to use a keyword as an attribute name (or anything else that
requires rename=True) is also weird.

Also it's far from clear that the pre-renaming field names are what is
wanted in the auto-generated typename. If I was actually using attribute
names that required renaming I would want the auto-generated typename to
match the renamed attributes. The original fieldnames play no part in the
operation of the namedtuple class or its instances once it has been
created: only the renamed fieldnames even remain reachable from the
namedtuple object.

Anyway I think I'm probably out at this point. I think Python development
is not a good cultural fit for me, based on this discussion. Which is
weird, since I love working in Python. I even like the whitespace
indentation, although admittedly not quite as much as I thought I would
before I tried it. I hugely enjoy the expressiveness of the language
features, combined with the small but useful set of immediately-available
library functions, together with the multitude of importable standard
modules backing it all up. But I should have known when functools.compose
(which ought to be almost the first thing in any sort of "functional
programming" library) was rejected that I should stay away from attempting
to get involved in the enhancement side of things.

--

___
Python tracker 

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



[issue31002] IDLE: Add tests for configdialog keys tab

2017-08-02 Thread Cheryl Sabella

Cheryl Sabella added the comment:

I'm making good progress on this.  I should be able to open the PR tomorrow.  
It's definitely non-trivial, but using your font and general tests as a guide 
has been invaluable.

--

___
Python tracker 

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



[issue31080] Allow `logging.config.fileConfig` to accept kwargs

2017-08-02 Thread Preston Landers

Preston Landers added the comment:

A colleague pointed out that I used single quotes in the defaults where the 
line uses double quotes for another argument. I'm not sure if this is 
considered a problem but I could submit an update if it is.

--

___
Python tracker 

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



[issue31103] Windows Installer Product Version 3.6.2150.0 Offset By 0.0.150.0

2017-08-02 Thread Eryk Sun

Eryk Sun added the comment:

The docs [1] are clear that this property must be of the form 
major.minor.build. It can include at least one additional field, which the 
installer ignores. The major and minor version numbers can be up to 255, and 
the build number can be up to 65535. Python's ProductVersion property complies 
with this:

db = msilib.OpenDatabase('core.msi', msilib.MSIDBOPEN_READONLY)
v = db.OpenView("select * from Property where Property='ProductVersion'")
v.Execute(None)
r = v.Fetch()

>>> r.GetString(2)
'3.6.2150.0'

It would be unorthodox to use the build version field for Python's micro 
release version number. I don't see why it's really important since micro 
releases are ABI compatible for in-place upgrades.

[1]: https://msdn.microsoft.com/en-us/library/windows/desktop/aa370859

--
nosy: +eryksun

___
Python tracker 

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



[issue31085] Add option for namedtuple to name its result type automatically

2017-08-02 Thread Raymond Hettinger

Raymond Hettinger added the comment:

> Your code will not work if rename=True is needed.

It works just fine:

>>> NT = auto_namedtuple('name', 'name', 'def', rename=True)
>>> print(NT.__doc__)
name_name_def(name, _1, _2)

--

___
Python tracker 

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



[issue31080] Allow `logging.config.fileConfig` to accept kwargs

2017-08-02 Thread Vinay Sajip

Changes by Vinay Sajip :


--
resolution:  -> fixed
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



[issue31085] Add option for namedtuple to name its result type automatically

2017-08-02 Thread Isaac Morland

Isaac Morland added the comment:

OK, so it's pretty clear this is heading towards a rejection, but I can't
help but respond to your points:

On 2 August 2017 at 01:12, Raymond Hettinger  wrote:

* This would be a potentially  confusing addition to the API.
>

I'm giving a natural meaning to providing a None where it is not permitted
now. The meaning is to provide a reasonable value for the missing
parameter. How could that be confusing? Also it's completely ignorable -
people don't have to pass None and get the auto-generated typename if they
don't want to.

> * It may also encourage bad practices that we don't want to see in real
> code.
>

What bad practices? There are lots of times when providing an explicit name
is a waste of effort. This provides a simple way of telling the library to
figure it out. Aren't there supposedly just two hard things in computer
science? Naming things, and cache invalidation. An opportunity to avoid
naming things that don't need to be specifically named is something worth
taking.

> * We want to be able to search for the namedtuple definition, want to have
> a meaningful repr, and want pickling to be easy.
>

You mean by searching for the typename in the source code? In my primary
usecase, the typename is computed regardless, so it doesn't appear in the
source code and can't be searched for. The other suggestion which appeared
at one point was passing "_" as the typename. This is going to be somewhat
challenging to search for also.

As to the meaningful repr, that is why I want auto-generation of the
typename. This is not for uses like this:

MyType = namedtuple ('MyType', ['a', 'b', 'c'])

It is for ones more like this:

rowtype = namedtuple (None, row_headings)

Or as it currently has to be:

rowtype = namedtuple ('rowtype', row_headings)

(leading to all the rowtypes being the same name, so less meaningful)

Or:

rowtype = namedtuple ('__'.join (row_headings), row_headings)

(which repeats the irrelevant-in-its-details computation wherever it is
needed and doesn't support rename=True, unless a more complicated
computation that duplicates code inside of namedtuple() is repeated)

Finally I'm not clear on how pickling is made more difficult by having
namedtuple() generate a typename. The created type still has a typename.
But I'm interested - this is the only point I don't think I understand.

* This doesn't have to be shoe-horned into the namedtuple API.  If an
> actual need did arise, it is trivial to write a wrapper that specifies
> whatever auto-naming logic happens to make sense for a particular
> application:
>
> >>> from collections import namedtuple
> >>> def auto_namedtuple(*attrnames, **kwargs):
> typename = '_'.join(attrnames)
> return namedtuple(typename, attrnames, **kwargs)
>
> >>> NT = auto_namedtuple('name', 'rank', 'serial')
> >>> print(NT.__doc__)
> name_rank_serial(name, rank, serial)

Your code will not work if rename=True is needed. I don't want to repeat
the rename logic as doing so is a code smell.

In short, I'm disappointed. I'm not surprised to make a suggestion, and
have people point out problems. For example, my original proposal ignored
the difficulties of creating the C implementation, and the issue of
circular imports, and I very much appreciated those criticisms. But I am
disappointed at the quality of the objections to these modified proposals.

--

___
Python tracker 

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



[issue31085] Add option for namedtuple to name its result type automatically

2017-08-02 Thread R. David Murray

R. David Murray added the comment:

Yeah, different developers have different opinions.  We discuss (I'd say argue, 
which is accurate, but has acquired negative connotations) until we reach a 
consensus.  And if we don't reach a consensus we leave it alone ("status quo 
wins a stalemate").

--

___
Python tracker 

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



[issue31085] Add option for namedtuple to name its result type automatically

2017-08-02 Thread Isaac Morland

Isaac Morland added the comment:

On 1 August 2017 at 14:32, R. David Murray  wrote:

>
> R. David Murray added the comment:
>
> I wrote a "parameterized tests" extension for unittest, and it has the
> option of autogenerating the test name from the parameter names and
> values.  I've never used that feature, and I am considering ripping it out
> before I release the package, to simplify the code.  If I do I might
> replace it with a hook for generating the test name so that the user can
> choose their own auto-naming scheme.
>
> Perhaps that would be an option here: a hook for generating the name, that
> would be called where you want your None processing to be?  That would not
> be simpler than your proposal, but it would be more general (satisfy more
> use cases) and might be worth the cost.  On the other hand, other
> developers might not like the API bloat ;)
>

It's August, not April. Raymond Hettinger is accusing my proposed API of
being potentially confusing, while you're suggesting providing a hook? All
I want is the option of telling namedtuple() to make up its own typename,
for situations where there should be one but I don't want to provide it.

Having said that, if people really think a hook like this is worth doing,
I'll implement it. But I agree that it seems excessively complicated. Let's
see if auto-generation is useful first, then if somebody wants a different
auto-generation, provide the capability.

--

___
Python tracker 

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



[issue31080] Allow `logging.config.fileConfig` to accept kwargs

2017-08-02 Thread Vinay Sajip

Vinay Sajip added the comment:


New changeset 6ea56d2ebcae69257f8dd7af28c357b25bf394c3 by Vinay Sajip (Preston 
Landers) in branch 'master':
bpo-31080: Allowed logging.config.fileConfig() to accept both args and kwargs. 
(GH-2979)
https://github.com/python/cpython/commit/6ea56d2ebcae69257f8dd7af28c357b25bf394c3


--

___
Python tracker 

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



[issue31111] Python 3.6 has an inaccessible attribute on FileNotFoundError

2017-08-02 Thread R. David Murray

R. David Murray added the comment:

It is intended.  See issue 30554.

--
nosy: +r.david.murray
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Inaccessible attribute characters_written on OSError instances

___
Python tracker 

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



[issue31111] Python 3.6 has an inaccessible attribute on FileNotFoundError

2017-08-02 Thread Charles Ferguson

New submission from Charles Ferguson:

Whilst debugging a problem in some of my code (which turned out to be a 
misspelt filename), I found that I could not access one of the properties of 
the FileNotFoundError object.

Essentially, if you get a 'FileNotFoundError' for opening a file that does not 
exist, you expect to be able to enumerate the attributes on that object. And if 
you try to access them, that they be accessible.
However, there is an attribute - 'characters_written' - which claims to be 
present according to 'dir()' but not according to 'hasattr()' and trying to 
access it with 'getattr()' confirms that it's not really there.

Looking at the documentation at 
https://docs.python.org/3/library/exceptions.html#OSError I see that it is a 
subclass of OSError(), and that the BlockingIOError can have this attribute. 
But none of the other OSError subclasses are documented as having the attribute.

It is still reasonable that any attribute access could generate another 
exception (including an AttributeError), as their implementation may have other 
issues, but I do not feel that this applies here, as this is an internal 
exception object that probably ought not to have an issue.

Since 'characters_written' doesn't seem to have any meaning in the context of 
'FileNotFound', it seems like it's an oversight from the other exception 
subclass.

What I conclude from this is that the documentation, hasattr() and getattr() 
are correct, but dir() is acting wrongly. Principle of least surprise also 
suggests that having inconsistent returns from these functions probably isn't 
correct. I guess it could be the other way around, and the documentation, 
hasattr and getattr could be returning incorrectly, but that feels like 
something of a stretch.

I would wonder if the other OSError subclasses also suffer from this extraneous 
attribute name, and that it's been implemented at the wrong level, but I have 
no evidence to suggest that's the case (just that that's something I'd probably 
look at if I had the time).

Reproduction code:


#!/usr/bin/python3.6
##
# Demonstrate oddity of FileNotFoundError.
#

try:
fh = open('/nothing/at/all', 'r')
except Exception as ex:
print("Exception: {}".format(ex))
for attrname in dir(ex):
if attrname.startswith('__'):
# Ignore dunders for the sake of brevity
continue

print("  Attribute name: {}".format(attrname))
if not hasattr(ex, attrname):
print(" hasattr: False - surprising!")
print("   value: {}".format(getattr(ex, attrname)))


On 3.6 this generates:


Charles@charlesmbp:~/Coding/terraspock-develop (develop)$ python 
python3.6.2-filenotfound.py 
Exception: [Errno 2] No such file or directory: '/nothing/at/all'
  Attribute name: args
   value: (2, 'No such file or directory')
  Attribute name: characters_written
 hasattr: False - surprising!
Traceback (most recent call last):
  File "python3.6.2-filenotfound.py", line 7, in 
fh = open('/nothing/at/all', 'r')
FileNotFoundError: [Errno 2] No such file or directory: '/nothing/at/all'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "python3.6.2-filenotfound.py", line 18, in 
print("   value: {}".format(getattr(ex, attrname)))
AttributeError: characters_written


On 2.7 this works fine, but I've not tested the other 3.x series versions as I 
don't have them to hand.

Testing performed on macOS using Python 3.6.2.

I find it hard to think that this is intended behaviour, but whether it's 
something that debugging tools (and users) would expect or find useful I don't 
know.

--
components: Library (Lib)
messages: 299669
nosy: gerph
priority: normal
severity: normal
status: open
title: Python 3.6 has an inaccessible attribute on FileNotFoundError
type: behavior
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



[issue31107] copyreg does not properly mangle __slots__ names

2017-08-02 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
assignee:  -> serhiy.storchaka
nosy: +serhiy.storchaka
stage:  -> patch review
versions: +Python 3.7 -Python 3.3, Python 3.4, Python 3.5

___
Python tracker 

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



[issue31107] copyreg does not properly mangle __slots__ names

2017-08-02 Thread Shane Harvey

Changes by Shane Harvey :


--
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



[issue31109] zipimport argument clinic conversion

2017-08-02 Thread Yaron de Leeuw

Changes by Yaron de Leeuw :


--
pull_requests: +3028

___
Python tracker 

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



[issue31110] Small typo in plistlib docs

2017-08-02 Thread cwee

New submission from cwee:

Starting with 3.4, the docs for plistlib have had a typo:
https://docs.python.org/3.4/library/plistlib.html#plistlib.readPlist
https://docs.python.org/3.5/library/plistlib.html#plistlib.readPlist
https://docs.python.org/3.6/library/plistlib.html#plistlib.readPlist
https://docs.python.org/3.7/library/plistlib.html#plistlib.readPlist

Functions `readPlist` and `readPlistFromBytes` reference the `__getitem_` 
method, which should be `__getitem__`.

I'd be happy to submit a PR if there's a repo for the site's documentation.

--
assignee: docs@python
components: Documentation
messages: 299668
nosy: cwee, docs@python
priority: normal
severity: normal
status: open
title: Small typo in plistlib docs
type: enhancement
versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue31109] zipimport argument clinic conversion

2017-08-02 Thread Yaron de Leeuw

New submission from Yaron de Leeuw:

Convert zipimport to use the argument clinic.
I will submit the PR shortly.

--
components: Argument Clinic, Library (Lib)
messages: 299667
nosy: jarondl, larry, twouters
priority: normal
severity: normal
status: open
title: zipimport argument clinic conversion
type: enhancement
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



[issue31107] copyreg does not properly mangle __slots__ names

2017-08-02 Thread Roundup Robot

Changes by Roundup Robot :


--
pull_requests: +3027

___
Python tracker 

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



[issue31108] add __contains__ for list_iterator (and others) for better performance

2017-08-02 Thread Sergey Fedoseev

New submission from Sergey Fedoseev:

> python -mtimeit -s "l = list(range(10))" "l[-1] in l"
1000 loops, best of 3: 1.34 msec per loop
> python -mtimeit -s "l = list(range(10))" "l[-1] in iter(l)"   
>  
1000 loops, best of 3: 1.59 msec per loop

--
messages: 299666
nosy: sir-sigurd
priority: normal
severity: normal
status: open
title: add __contains__ for list_iterator (and others) for better performance
type: performance

___
Python tracker 

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



[issue31107] copyreg does not properly mangle __slots__ names

2017-08-02 Thread Shane Harvey

New submission from Shane Harvey:

This line in copyreg._slotnames does not properly calculate mangled attribute 
names:
https://github.com/python/cpython/blob/v3.6.2/Lib/copyreg.py#L131

The problem is that it does not strip leading underscores from the class name:

>>> class _LeadingUnderscoreClassName(object):
... __slots__ = ("__bar",)
...
>>> import copy_reg
>>> copy_reg._slotnames(_LeadingUnderscoreClassName)
['__LeadingUnderscoreClassName__bar']

The result is that copy, pickle, and anything else that relies on _slotnames() 
do not work on classes with leading underscores and private __slots__. This bug 
is present in all versions of Python.

--
components: Library (Lib)
messages: 299665
nosy: Shane Harvey
priority: normal
severity: normal
status: open
title: copyreg does not properly mangle __slots__ names
type: behavior
versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue31108] add __contains__ for list_iterator (and others) for better performance

2017-08-02 Thread Sergey Fedoseev

Changes by Sergey Fedoseev :


--
pull_requests: +3025

___
Python tracker 

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



[issue30576] http.server should support HTTP compression (gzip)

2017-08-02 Thread Pierre Quentel

Pierre Quentel added the comment:

In the latest version of the PR, following Martin's comments :
- apply Chunk Transfer for HTTP/1.1 only, change implementation of compression 
for previous protocols (send gzipped data without Content-Length)
- use http.cookiejar to parse the Accept-Encoding header
- fix a bug with chunk length (conversion to hex)
- support x-gzip besides gzip
- handle Python builds without zlib / gzip

Headers parsing is done in several places in the standard distribution. It 
should probably be done in a single module, but I think it would be better to 
open a new issue for that, as it would impact more modules than just 
http.server.

I couldn't find a simple way to reuse code from http.client to generate HTTP 
chunks (it's in HTTPConnection._send_output()), but I'm not sure it's worth it, 
the code to generate a chunk is a one-liner.

--

___
Python tracker 

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



[issue31061] asyncio segfault when using threadpool and "_asyncio" native module

2017-08-02 Thread Yury Selivanov

Yury Selivanov added the comment:

Thank you, Alexander. Bugs like this are notoriously hard to fix, you saved us 
from hours, if not days, of debugging.

--
resolution:  -> fixed
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



[issue31061] asyncio segfault when using threadpool and "_asyncio" native module

2017-08-02 Thread Alexander Mohr

Alexander Mohr added the comment:

I've verified that this along with the changes in 31095 resolve the crashes 
I've been seeing in our production environment

--

___
Python tracker 

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



[issue30717] str.center() is not unicode aware

2017-08-02 Thread Guillaume Sanchez

Guillaume Sanchez added the comment:

Hi,

Are you guys still interested? I haven't heard from you in a while

--

___
Python tracker 

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



[issue31106] os.posix_fallocate() generate exception with errno 0

2017-08-02 Thread Марк Коренберг

New submission from Марк Коренберг:

===
os.posix_fallocate(os.open('qwe.qwe', os.O_RDONLY|os.O_CREAT), 0, 1024*1024)
===

generates OSError with errno 0. Suppose this happen due to O_RDONLY flag.

strace :


open("qwe.qwe", O_RDONLY|O_CREAT|O_CLOEXEC, 0777) = 3
fallocate(3, 0, 0, 1048576) = -1 EBADF (Bad file descriptor)



Python 3.5.3, Ubuntu 64-bit.

--
components: Library (Lib)
messages: 299660
nosy: socketpair
priority: normal
severity: normal
status: open
title: os.posix_fallocate() generate exception with errno 0
type: behavior
versions: Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue28427] WeakValueDictionary next bug (with multithreading)

2017-08-02 Thread dubiousjim

dubiousjim added the comment:

In response to Issue #7105, self._pending_removals was added to 
WeakValueDictionaries (and also WeakKeyDictionaries, but they're not relevant 
to what I'm about to discuss). This was in changesets 58194 to tip and 58195 to 
3.1, back in Jan 2010. In those changesets, the implementation of 
WeakValueDictionary.setdefault acquired a check on self._pending_removals, but 
only after the key lookup had failed. (See lines starting 5.127 in both those 
changesets.)

In changeset 87778, in Dec 2013, this same patch was backported to 2.7.

More recently, in response to the issue discussed above (Issue #28427), similar 
checks were added to WeakValueDictionary.get, but now BEFORE the  key lookup. 
This was in changesets 105851 to 3.5, 105852 to 3.6, 105853 to tip, and 105854 
to 2.7, in Dec 2016. Notably, in the last changeset, the check on 
self._pending_removals on WeakValueDictionary.setdefault is also moved to the 
top of the function, before the key lookup is attempted. This parallels the 
change being made to WeakValueDictionary.get.

However, that change to WeakValueDictionary.setdefault was only made to the 2.7 
branch. If it's correct, then why wasn't the same also done for 3.5, 3.6, and 
tip?

--
nosy: +dubiousjim

___
Python tracker 

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



[issue31103] Windows Installer Product Version 3.6.2150.0 Offset By 0.0.150.0

2017-08-02 Thread Steve Dower

Steve Dower added the comment:

Can you link to those guidelines please? Microsoft release plenty of software 
with version numbers over 256.

Also, since people already rely on the current scheme, we'd need a very 
compelling reason to break them. I don't believe you've made that case yet.

--

___
Python tracker 

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



[issue29456] bugs in unicodedata.normalize: u1176, u11a7 and u11c3

2017-08-02 Thread Wonsup Yoon

Wonsup Yoon added the comment:

I added some test cases for this issue. Please, someone check this.

--

___
Python tracker 

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



[issue31105] Cyclic GC threshold may need tweaks

2017-08-02 Thread Armin Rigo

New submission from Armin Rigo:

The cyclic GC uses a simple and somewhat naive policy to know when it must run. 
 It is based on counting "+1" for every call to _PyObject_GC_Alloc().  Explicit 
calls to PyObject_GC_Del() are counted as "-1".  The cyclic GC will only be 
executed after the count reaches 700.  There is then a scheme with multiple 
generations, but the point is that nothing is done at all before 
_PyObject_GC_Alloc() has been called 700 times.

The problem is that each of these _PyObject_GC_Alloc() can be directly or 
indirectly responsible for a large quantity of memory.  Take this example:

while True:
l = [None] * 1000# 80 MB, on 64-bit
l[-1] = l
del l

This loop actually consumes 700 times 80 MB, which is unexpected to say the 
least, and looks like a very fast memory leak.  The same program on 32-bit 
architectures simply runs out of virtual address space and fails with a 
MemoryError---even if we lower the length of the list to 10**9/700 = 1428571.

The same problem exists whenever a single object is "large", we allocate and 
forget many such objects in sequence, and they are kept alive by a cycle.  This 
includes the case where the large object is not part of a cycle, but merely 
referenced from a cycle.  For examples of "large" objects with potentially low 
lifetimes, maybe more natural than large lists, would include bz2 objects (17MB 
each) or Numpy arrays.

To fix it, the basic idea would be to have the "large" allocations count for 
more than "+1" in _PyObject_GC_Alloc().  Maybe they would also need to decrease 
the count by the same amount in PyObject_GC_Del(), though that may be less 
important.  Still, I am unsure about how it could be implemented.  Maybe a new 
C API is needed, which could then be used by a few built-in types (lists, bz2 
objects, numpy arrays...) where the bulk of the memory allocation is not 
actually done by _PyObject_GC_Alloc() but by a separate call.  I am thinking 
about something like PyMem_AddPressure(size), which would simply increase the 
count by a number based on 'size'.

--
components: Interpreter Core
messages: 299656
nosy: arigo
priority: normal
severity: normal
status: open
title: Cyclic GC threshold may need tweaks
versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7

___
Python tracker 

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



[issue31102] deheader: double #incude of the same file

2017-08-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

"sre_lib.h" and "stringlib/*.h" are included multiple times for purpose. They 
are template files and different inclusions instantiate implementations for 
specific kind of Unicode strings.

"testcapi_long.h" also is a template file.

Modules/expat/xmltok.c is imported file. And it include some header files 
multiple times for purpose.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue31104] posixpath.normpath truncating forward slashes from URL

2017-08-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Is the string 'https://google.com' an URL or a path? If it is a path, 
posixpath.normpath() correctly collapses duplicated slashes. If it is an URL, 
using posixpath.normpath() is not correct.

--
nosy: +serhiy.storchaka
resolution:  -> not a bug
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



[issue31104] posixpath.normpath truncating forward slashes from URL

2017-08-02 Thread Govind S Menokee

Changes by Govind S Menokee :


--
pull_requests: +3024

___
Python tracker 

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



[issue31104] posixpath.normpath truncating forward slashes from URL

2017-08-02 Thread Govind S Menokee

New submission from Govind S Menokee:

Handle unwanted truncation of forward slash in case of URL input for normpath 
function.
For Example - path = 'https://google.com'
The current output of normpath function would be - 'https:/google.com'
After changes the output would be - 'https://google.com'

--

___
Python tracker 

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



[issue31104] posixpath.normpath truncating forward slashes from URL

2017-08-02 Thread Govind S Menokee

Changes by Govind S Menokee :


--
components: Library (Lib)
nosy: govindsmenokee
priority: normal
severity: normal
status: open
title: posixpath.normpath truncating forward slashes from URL
type: behavior
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



[issue31103] Windows Installer Product Version 3.6.2150.0 Offset By 0.0.150.0

2017-08-02 Thread Markus Kramer

Markus Kramer added the comment:

Screenshot of Product Version 3.6.2150.0

--
Added file: http://bugs.python.org/file47056/3.6.2.png

___
Python tracker 

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



[issue31103] Windows Installer Product Version 3.6.2150.0 Offset By 0.0.150.0

2017-08-02 Thread Markus Kramer

New submission from Markus Kramer:

Each Windows installation has a “product version”.

The Windows installer python-3.6.2.exe has product version "3.6.2150.0"  
(accessible with context menu / Properties / Details).

This causes at least 2 problems:
 - Automated software inventory relies on product version and therefore does 
not detect version 3.6.2
 - Microsoft installation guidelines require the first three fields to be 
smaller than 256.

Proposed alternatives for the value of product version:
- "3.6.2.0" to indicate the final release build.
- "3.6.2.150" to indicate the build number. The build number may be higher than 
256, but this is unusual for a final release.



Side note: 
This is a sub-problem of http://bugs.python.org/issue31077

--
components: Windows
messages: 299651
nosy: Damon Atkins, Markus Kramer, paul.moore, steve.dower, tim.golden, 
zach.ware
priority: normal
severity: normal
status: open
title: Windows Installer Product Version 3.6.2150.0 Offset By 0.0.150.0
type: behavior
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



[issue31102] deheader: double #incude of the same file

2017-08-02 Thread Дилян Палаузов

New submission from Дилян Палаузов:

For cpython 3.6 deheader (http://www.catb.org/esr/deheader/) reports:

Mac/Tools/pythonw.c has more than one inclusion of 
Modules/_sre.c has more than one inclusion of "sre_lib.h"
Modules/_testcapimodule.c has more than one inclusion of "testcapi_long.h"
Modules/_threadmodule.c has more than one inclusion of "structmember.h"
Modules/expat/xmltok.c has more than one inclusion of "asciitab.h"
Modules/expat/xmltok.c has more than one inclusion of "latin1tab.h"
Modules/expat/xmltok.c has more than one inclusion of "utf8tab.h"
Modules/faulthandler.c has more than one inclusion of 
Objects/unicodeobject.c has more than one inclusion of "stringlib/codecs.h"
Objects/unicodeobject.c has more than one inclusion of "stringlib/undef.h"
Objects/unicodeobject.c has more than one inclusion of "stringlib/fastsearch.h"
Objects/unicodeobject.c has more than one inclusion of "stringlib/split.h"
Objects/unicodeobject.c has more than one inclusion of "stringlib/ucs2lib.h"
Objects/unicodeobject.c has more than one inclusion of "stringlib/ucs1lib.h"
Objects/unicodeobject.c has more than one inclusion of "stringlib/partition.h"
Objects/unicodeobject.c has more than one inclusion of 
"stringlib/find_max_char.h"
Objects/unicodeobject.c has more than one inclusion of "stringlib/ucs4lib.h"
Objects/unicodeobject.c has more than one inclusion of "stringlib/asciilib.h"
Objects/unicodeobject.c has more than one inclusion of "stringlib/find.h"
Objects/unicodeobject.c has more than one inclusion of "stringlib/replace.h"
Objects/unicodeobject.c has more than one inclusion of "stringlib/localeutil.h"
Objects/unicodeobject.c has more than one inclusion of "stringlib/count.h"

--
components: Build
messages: 299650
nosy: dilyan.palauzov
priority: normal
severity: normal
status: open
title: deheader: double #incude of the same file
type: enhancement
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



[issue29902] copy breaks staticmethod

2017-08-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you Benjamin.

--
resolution:  -> fixed
stage: patch review -> 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



[issue29902] copy breaks staticmethod

2017-08-02 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset 3dd1ccbb0950b2b83713a495958c35d60b453fa9 by Serhiy Storchaka in 
branch '2.7':
bpo-29902: Emit a Py3k deprecation warning when pickling or copying (#2823)
https://github.com/python/cpython/commit/3dd1ccbb0950b2b83713a495958c35d60b453fa9


--

___
Python tracker 

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



[issue31061] asyncio segfault when using threadpool and "_asyncio" native module

2017-08-02 Thread INADA Naoki

INADA Naoki added the comment:


New changeset f142e85d22ba135d5205280240f3a2fe1df2649f by INADA Naoki in branch 
'3.6':
bpo-31061: fix crash in asyncio speedup module (GH-2984)
https://github.com/python/cpython/commit/f142e85d22ba135d5205280240f3a2fe1df2649f


--

___
Python tracker 

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



[issue31101] os.remove() auto add \ in Windows2012R2

2017-08-02 Thread Paul Moore

Paul Moore added the comment:

There are two problems with your code and bug report:

1. By using a single quoted string, some of the backslashes in the path are 
being interpreted as starting a special character (specifically \t is 
interpreted as a tab character). You should either double the backslashes to 
prevent this interpretation (dir_path='d:\\c\\d\\e\\t\\c\\t.xf'), use forward 
slashes (dir_path='d:/c/d/e/t/c/t.xf') or use a raw string 
(dir_path=r'd:\c\d\e\t\c\t.xf').

2. You're reporting that Python "auto adds \". It doesn't, it's just that the 
repr of the string shows a single quoted string with backslashes doubled - 
that's the standard repr for strings.

So, Python is behaving as expected, and there's no bug here.

--
resolution:  -> not a bug
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



[issue31101] os.remove() auto add \ in Windows2012R2

2017-08-02 Thread Re-ax

New submission from Re-ax:

I need to remove a file in python at Windows2012R2, but, os.remove()auto add \ 
in each seq.

code:
#coding=utf-8
import os
dir_path='d:\c\d\e\t\c\t.xf'
os.remove(dir_path)


result:
Python 2.7.13 (v2.7.13:a06454b1afa1, Dec 17 2016, 20:53:40) [MSC v.1500 64 bit 
(AMD64)] on win32
Type "copyright", "credits" or "license()" for more information.
>>>  RESTART 
>>> 

Traceback (most recent call last):
  File "D:\test\script\test.py", line 4, in 
os.remove(dir_path)
WindowsError: [Error 3] The system cannot find the path specified: 
'd:\\c\\d\\e\t\\c\t.xf'
>>>

--
components: Windows
messages: 299645
nosy: 007hengxyx, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: os.remove() auto add \ in Windows2012R2
type: resource usage
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



[issue31061] asyncio segfault when using threadpool and "_asyncio" native module

2017-08-02 Thread INADA Naoki

Changes by INADA Naoki :


--
pull_requests: +3023

___
Python tracker 

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



[issue31061] asyncio segfault when using threadpool and "_asyncio" native module

2017-08-02 Thread INADA Naoki

INADA Naoki added the comment:


New changeset de34cbe9cdaaf7b85fed86f99c2fd071e1a7b1d2 by INADA Naoki 
(Alexander Mohr) in branch 'master':
bpo-31061: fix crash in asyncio speedup module (GH-2966)
https://github.com/python/cpython/commit/de34cbe9cdaaf7b85fed86f99c2fd071e1a7b1d2


--

___
Python tracker 

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