Re: ESR "Waning of Python" post

2018-10-15 Thread Chris Angelico
On Tue, Oct 16, 2018 at 4:18 PM dieter  wrote:
>
> Marko Rauhamaa  writes:
> > Or you could blame the parts of the software that create too many
> > long-term objects.
>
> I do not do that because I understand why in my application
> there are many long living objects.
>
> > You shouldn't blame the parts of the software that churn out zillions of
> > short-term objects.
>
> I do precisely that: the blamed component produced a very large
> number of short living objects -- without need and while it should
> have been aware that it operates on mass data - among others from the
> fact that its complete environment took special care to work with
> this mass data efficiently.

Exactly. Long-term objects are NOT a problem. Tell me, how many
objects get created as a web app boots up and then are never destroyed
for the lifetime of that process? To find out, I added this line just
before a very VERY small Flask app of mine goes into its main loop:

import gc; print(len(gc.get_objects()), "objects currently tracked")

There are over 40,000 of them. Now, I can't say for sure that every
one of those objects will stick around till the process shuts down,
but I'd say a lot of them will. They're modules, functions, types,
class dictionaries... oh, and the GC doesn't track strings or numbers,
so that's another whole huge slab of objects that you'd have to count.
If you replace the refcounting GC with a pure mark-and-sweep, you have
to check every single one of them every time you do a GC pass.

(For reference, running the same GC check in an empty Python
interpreter gives around five thousand tracked objects, still mostly
functions.)

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue16965] 2to3 should rewrite execfile() to open in 'rb' mode

2018-10-15 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue16965] 2to3 should rewrite execfile() to open in 'rb' mode

2018-10-15 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset f5e00f490ab5abfcf5e38e58bf969c7b5dcb4818 by Serhiy Storchaka 
(Zackery Spytz) in branch '2.7':
[2.7] bpo-16965: 2to3 now rewrites execfile() to open with rb. (GH-8569) 
(GH-9890)
https://github.com/python/cpython/commit/f5e00f490ab5abfcf5e38e58bf969c7b5dcb4818


--

___
Python tracker 

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



[issue34995] functools.cached_property does not maintain the wrapped method's __isabstractmethod__

2018-10-15 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

What is the use case of this?

--
nosy: +serhiy.storchaka

___
Python tracker 

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



Re: Email parsing and unicode/utf8

2018-10-15 Thread dieter
Thomas Jollans  writes:
> I just stumbled over some curious behaviour of the stdlib email parsing
> APIs which accept strings rather than bytes. It appears that you can't
> parse an 8-bit UTF-8 message you have as a str without first encoding it.

The primary purpose of an email parser is likely the parsing
of RFC 822/2045 messages which are a sequence of bytes,
encoded as dictated by RFC 822.
Therefore, I would expect some peculiarities when you feed such
a parser with general text.

-- 
https://mail.python.org/mailman/listinfo/python-list


[issue34953] Implement `mmap.mmap.__repr__`

2018-10-15 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I think that performing any IO operations in repr() is not a good idea.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



Re: ESR "Waning of Python" post

2018-10-15 Thread dieter
Marko Rauhamaa  writes:
> dieter :
>> Marko Rauhamaa  writes:
>>> Keeping the number of long-term objects low is key.
>>
>> Right, if I need near realtime behaviour and must live
>> with [C]Python's garbage collector.
>
> Or any other GC ever invented.

There are "realtime garbage collection" algorithms. For them,
the creation of new objects must cooperate with the garbage
collection - likely with the need to acquire a lock for a short
period. But there is no (principle) need to block all
"normal" activity during the complete garbage collection (as [C]Python's
garbage collector has done this at the time of my problem).

>> But, a web application does usually not need near realtime behaviour.
>> An occasional (maybe once in a few days) garbage collection and
>> associated reduced response time is acceptable.
>> A problem only arises if a badly designed component produces
>> quite frequently hundreds of thousands of temporary objects
>> likely triggering (frequent) garbage collections.
>
> But I think you are barking up the wrong tree. You could rightly blame
> GC itself as an unworkable paradigm and switch to, say, C++ or Rust.

I am happy that [C]Python uses mainly reference counting for
its memory management and that GC is used quite sparingly.

> Or you could blame the parts of the software that create too many
> long-term objects.

I do not do that because I understand why in my application
there are many long living objects.

> You shouldn't blame the parts of the software that churn out zillions of
> short-term objects.

I do precisely that: the blamed component produced a very large
number of short living objects -- without need and while it should
have been aware that it operates on mass data - among others from the
fact that its complete environment took special care to work with
this mass data efficiently.

I solved my problem by replacing this single component by
one knowing what it does. No need to rewrite the complete
application, get rid of Python object caches or even
switch to a different language.

-- 
https://mail.python.org/mailman/listinfo/python-list


[issue34953] Implement `mmap.mmap.__repr__`

2018-10-15 Thread Eric V. Smith


Eric V. Smith  added the comment:

I agree with Xiang Zhang: I don't think we should show any content. Especially 
since basically every file will be truncated, and more often than not the 
interesting content isn't at the start or end of the file.

--

___
Python tracker 

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



[issue34953] Implement `mmap.mmap.__repr__`

2018-10-15 Thread Xiang Zhang


Xiang Zhang  added the comment:

I don't like the idea to display the contents in the repr, no matter entire or 
clipped. I think it's not suitable and for contents, just read the object 
manually. For me, a closed status plus the constructor arguments is a good 
choice.

--
nosy: +xiang.zhang

___
Python tracker 

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



Is it dangeous when using custom metaclass?

2018-10-15 Thread jfong
class StructureMeta(type):
def __init__(self, clsname, bases, clsdict):
offset = 0
...
...
setattr(self, 'struct_size', offset)

class Structure(metaclass=StructureMeta):
...
...

class PolyHeader(Structure):
...
...

As my understanding, the metaclass's __init__ was called when a class was 
created. In the above example, both the Structure and PolyHeader called it. My 
question is: because the PolyHeader inherited Structure, is it reasonable for 
PolyHeader to call this __init__ again? Will it cause any possible trouble?

--Jach
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue34995] functools.cached_property does not maintain the wrapped method's __isabstractmethod__

2018-10-15 Thread Matt Wilber


Change by Matt Wilber :


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

___
Python tracker 

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



[issue34995] functools.cached_property does not maintain the wrapped method's __isabstractmethod__

2018-10-15 Thread Matt Wilber


Change by Matt Wilber :


--
components: Library (Lib)
nosy: mwilbz
priority: normal
severity: normal
status: open
title: functools.cached_property does not maintain the wrapped method's 
__isabstractmethod__
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



[issue34565] Launcher does not validate major versions

2018-10-15 Thread Ned Deily


Ned Deily  added the comment:

I assume we can close this now.  Thanks, all!

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



[issue34158] Documentation of datetime '%z' format code is odd

2018-10-15 Thread Ned Deily


Ned Deily  added the comment:

I assume this can now be closed. Thanks, everyone!

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
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



[issue34780] Hang on startup if stdin refers to a pipe with an outstanding concurrent operation on Windows

2018-10-15 Thread Alexey Izbyshev


Alexey Izbyshev  added the comment:

Ping!

Thanks to @eryksun for providing feedback here and for the patch review.

--

___
Python tracker 

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



Re: Python indentation (3 spaces)

2018-10-15 Thread Ethan Furman

On 10/15/2018 12:37 PM, Chris Angelico wrote:

On Tue, Oct 16, 2018 at 6:34 AM Peter J. Holzer  wrote:

On 2018-10-15 14:12:54 +0200, Antoon Pardon wrote:



Spaces that replaced a tab by accident, are easy to catch too. They are all
those lines that show up when you do a diff with the previous version that
shouldn't show up.


And where is the AI that decides which lines in a diff are should show
up?

Whether a line in a diff should or should not show up seems to me to be
even harder to determine than whether a tab fits the syntax.



If there's a change, it shows up. If there's no change, it doesn't show up.

Ergo, if you accidentally replace a tab with spaces, it's a change,
and it shows up.


Unless you have your diff tool set to ignore whitespace-only changes.  :(

--
~Ethan~
--
https://mail.python.org/mailman/listinfo/python-list


[issue11233] clarifying Availability: Unix

2018-10-15 Thread Cheryl Sabella


Cheryl Sabella  added the comment:

And thank you, Victor, for reviewing and merging!  :-)

--

___
Python tracker 

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



[issue34805] Explicitly specify `MyClass.__subclasses__()` returns classes in definition order

2018-10-15 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Hi and thank you for the proposal. Could you detail a bit more about your 
use-case? Thanks

--
nosy: +pablogsal

___
Python tracker 

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



Re: Python indentation (3 spaces)

2018-10-15 Thread Chris Angelico
On Tue, Oct 16, 2018 at 9:16 AM D'Arcy Cain  wrote:
>
> On 10/15/18 5:54 PM, Gregory Ewing wrote:
> > Cameron Simpson wrote:
> >> I can't express how pleasing it is to see the traditional vi-vs-emacs
> >> wars supplanted by emacs-vs-emacs :-)
> >
> > We're the People's Front of Emacs, not the Emacs People's Front!
>
> I thought we were the People's Emacs Front.
>

No, that's just a front for a tab-laundering enterprise...

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue33450] unexpected EPROTOTYPE returned by sendto on MAC OSX

2018-10-15 Thread Ned Deily


Change by Ned Deily :


--
components: +asyncio
nosy: +asvetlov, yselivanov

___
Python tracker 

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



[issue34783] [3.7] segmentation-fault/core dump when try to run non-existing file specified on commandline

2018-10-15 Thread miss-islington


miss-islington  added the comment:


New changeset 350aeab8127da551fcd0090230575b7aabff03c9 by Miss Islington (bot) 
in branch '3.7':
bpo-34783: Fix test_nonexisting_script() (GH-9896)
https://github.com/python/cpython/commit/350aeab8127da551fcd0090230575b7aabff03c9


--

___
Python tracker 

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



[issue34988] Rc2 candidates: "gcc" not found on AIX

2018-10-15 Thread Ned Deily


Ned Deily  added the comment:

Do you know if the behavior has changed here for 3.7.1rc2 and 3.6.7rc2 from 
earlier 3.7.x and 3.6.x releases?  I did a quick check of the configure.ac 
history and did not see any obvious change.  It looks like one way to handle 
this would be be to specify the desired compiler using the CC variable to 
configure:

./configure CC=gcc

Does that work?

Looking at the master branch (for the next feature release, 3.8), I see that 
this area has been changed substantially for 3.8 by the PR 6790 changes for 
Issue33483.  If you haven't already, you might want to test that and see if the 
behavior is reasonable for AIX.  Explicitly specifying CC=gcc should still work.

--

___
Python tracker 

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



Re: Python indentation (3 spaces)

2018-10-15 Thread D'Arcy Cain
On 10/15/18 5:54 PM, Gregory Ewing wrote:
> Cameron Simpson wrote:
>> I can't express how pleasing it is to see the traditional vi-vs-emacs
>> wars supplanted by emacs-vs-emacs :-)
> 
> We're the People's Front of Emacs, not the Emacs People's Front!

I thought we were the People's Emacs Front.

-- 
D'Arcy J.M. Cain
System Administrator, Vex.Net
http://www.Vex.Net/ IM:da...@vex.net
VoIP: sip:da...@vex.net
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue34890] Support functools.partial in inspect.is*function() checks

2018-10-15 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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

___
Python tracker 

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



[issue34985] python finds test modules from the wrong directory during PGO build

2018-10-15 Thread Brett Cannon


Brett Cannon  added the comment:

I think there might be more going on here as the build target as it uses the 
built Python which has special logic to notice it is being built in a checkout. 
Did you launch the build from a directory other than the git checkout? Or were 
you trying to do a build for a different platform?

--
nosy: +brett.cannon

___
Python tracker 

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



[issue34989] python-gdb.py fails with TypeError("'FakeRepr' object is not subscriptable") is gdb fails to read debug symbols

2018-10-15 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset aadb44ee98bc73bc5132acea5848ac6aef1ff8c0 by Victor Stinner in 
branch '2.7':
bpo-34989: python-gdb.py: fix current_line_num() (GH-9889) (GH-9899)
https://github.com/python/cpython/commit/aadb44ee98bc73bc5132acea5848ac6aef1ff8c0


--

___
Python tracker 

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



[issue23554] EchoServerClientProtocol class should be called EchoServerProtocol

2018-10-15 Thread miss-islington


miss-islington  added the comment:


New changeset 802de12d99d16e621537d454eac942d2f448afee by Miss Islington (bot) 
in branch '3.7':
bpo-23554: Change echo server example class name from EchoServerClientProtocol 
to EchoServerProtocol (GH-9859)
https://github.com/python/cpython/commit/802de12d99d16e621537d454eac942d2f448afee


--
nosy: +miss-islington

___
Python tracker 

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



Re: Python indentation (3 spaces)

2018-10-15 Thread Gregory Ewing

Cameron Simpson wrote:
I can't express how pleasing it is to see the traditional vi-vs-emacs 
wars supplanted by emacs-vs-emacs :-)


We're the People's Front of Emacs, not the Emacs People's Front!

--
Greg
--
https://mail.python.org/mailman/listinfo/python-list


[issue34909] StrEnum subclasses cannot be created

2018-10-15 Thread Ned Deily


Ned Deily  added the comment:

My concern was that it seemed like at least one user had run into this while 
running 3.7.1rc1 (?), if I understood your comment; if so, I think we should 
mention in the changelog that the problem was fixed in rc2.

In any case, the state of the code for any release is captured as a git tag as 
described in the devguide.  As always, when switching versions, it's important 
to start with a clean build directory (make distclean or git clean -fdxq may 
help).

git checkout v3.7.0

https://devguide.python.org/devcycle/#development-cycle

--

___
Python tracker 

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



[issue34783] [3.7] segmentation-fault/core dump when try to run non-existing file specified on commandline

2018-10-15 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9264

___
Python tracker 

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



[issue34783] [3.7] segmentation-fault/core dump when try to run non-existing file specified on commandline

2018-10-15 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset ea75187c68b374bb839f1172f310b206044bc3e5 by Victor Stinner in 
branch 'master':
bpo-34783: Fix test_nonexisting_script() (GH-9896)
https://github.com/python/cpython/commit/ea75187c68b374bb839f1172f310b206044bc3e5


--

___
Python tracker 

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



[issue34989] python-gdb.py fails with TypeError("'FakeRepr' object is not subscriptable") is gdb fails to read debug symbols

2018-10-15 Thread miss-islington


miss-islington  added the comment:


New changeset 71e601eb0857fb03c1dd3c349afb030ef84f95d0 by Miss Islington (bot) 
in branch '3.6':
bpo-34989: python-gdb.py: fix current_line_num() (GH-9889)
https://github.com/python/cpython/commit/71e601eb0857fb03c1dd3c349afb030ef84f95d0


--

___
Python tracker 

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



[issue34989] python-gdb.py fails with TypeError("'FakeRepr' object is not subscriptable") is gdb fails to read debug symbols

2018-10-15 Thread miss-islington


miss-islington  added the comment:


New changeset fcea3ddc4a7e756fa8f182789e886ccd3d524484 by Miss Islington (bot) 
in branch '3.7':
bpo-34989: python-gdb.py: fix current_line_num() (GH-9889)
https://github.com/python/cpython/commit/fcea3ddc4a7e756fa8f182789e886ccd3d524484


--
nosy: +miss-islington

___
Python tracker 

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



[issue34980] KillPython target doesn't detect 64-bit processes

2018-10-15 Thread Jeremy Kloth


Change by Jeremy Kloth :


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

___
Python tracker 

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



Email parsing and unicode/utf8

2018-10-15 Thread Thomas Jollans
Hi,

I just stumbled over some curious behaviour of the stdlib email parsing
APIs which accept strings rather than bytes. It appears that you can't
parse an 8-bit UTF-8 message you have as a str without first encoding it.

The docs
 do
mention some problems (which I saw after the fact):

> class email.parser.FeedParser(_factory=None, *, policy=policy.compat32)
> 
> Works like BytesFeedParser except that the input to the feed() method 
> must be a string. This is of limited utility, since the only way for such a 
> message to be valid is for it to contain only ASCII text or, if utf8 is True, 
> no binary attachments.
> 
> Changed in version 3.3: Added the policy keyword.

Okay, cool - let's try parsing a message with text only (no attachments,
no BINARYMIME), with a UTF-8 Content-Type, and a policy with utf8=True.

Python 3.7.1rc2 (default, Oct 14 2018, 15:27:05)
[GCC 8.2.1 20180831 [gcc-8-branch revision 264010]] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import email.parser, email.policy
>>> pol = email.policy.SMTPUTF8
>>> pol.utf8
True
>>> pol.cte_type
'8bit'
>>> msg = '''MIME-Version: 1.0
... Content-Type: text/plain; charset="utf-8"
... Content-Transfer-Encoding: 8bit
... Subject: ¿Will it parse? Нет.
...
... ¡This message contains two (٢) non-ASCII characters!
... '''
>>> fp = email.parser.FeedParser(policy=pol)
>>> fp.feed(msg)
>>> msg_obj = fp.close()
>>> msg_obj

>>> print(msg_obj.get_content())
�This message contains two (\u0662) non-ASCII characters!

>>> print(msg_obj['Subject'])
¿Will it parse? Нет.

I don't know WHAT it's doing with the body there... It doesn't look like
utf8 mode actually did anything. Interesting that the subject header
survived! Maybe this is what the utf8=True does?

>>> email.policy.default.utf8
False
>>> fp2 = email.parser.FeedParser(policy=email.policy.default)
>>> fp2.feed(msg)
>>> msg_obj2 = fp2.close()
>>> print(msg_obj2['Subject'])
¿Will it parse? Нет.

Nope. Apparently, contrary to what my reading of the docs suggests, the
utf8 flag does nothing at all when parsing.

Just to check that this was in fact a perfectly valid email:

>>> bfp = email.parser.BytesFeedParser(policy=pol)
>>> bfp.feed(msg.encode('utf-8'))
>>> msg_objb = bfp.close()
>>> print(msg_objb.get_content())
¡This message contains two (٢) non-ASCII characters!

>>> print(msg_objb['Subject'])
¿Will it parse? Нет.

BytesFeedParser is happy.

Question: Is this a bug? Am I missing something? Does the clause in the
docs about utf8 mean anything?

Cheers
Thomas
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue23554] EchoServerClientProtocol class should be called EchoServerProtocol

2018-10-15 Thread Yury Selivanov


Change by Yury Selivanov :


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



[issue23554] EchoServerClientProtocol class should be called EchoServerProtocol

2018-10-15 Thread Yury Selivanov


Yury Selivanov  added the comment:


New changeset 43a5bd7b458f0ad2d62b00b033d025689d48d591 by Yury Selivanov 
(Braden Groom) in branch 'master':
bpo-23554: Change echo server example class name from EchoServerClientProtocol 
to EchoServerProtocol (GH-9859)
https://github.com/python/cpython/commit/43a5bd7b458f0ad2d62b00b033d025689d48d591


--

___
Python tracker 

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



[issue23554] EchoServerClientProtocol class should be called EchoServerProtocol

2018-10-15 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9262

___
Python tracker 

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



[issue34989] python-gdb.py fails with TypeError("'FakeRepr' object is not subscriptable") is gdb fails to read debug symbols

2018-10-15 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +9261

___
Python tracker 

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



pipenv and wheel/pre-compiled packages

2018-10-15 Thread Florian Pelgrim

Hi there,

I'm currently using a buildhost for third party packages running

```
$ pip3 wheel --wheel-dir=/root/wheelhouse -r /requirements.txt
```

After successful build I copy the directory `/root/wheelhouse` onto a 
new machine and install the compiled packages by running


```
$ pip3 install -r /requirements.txt --no-index --find-links=/root/wheelhouse
```

Is there something similar in `pipenv`?
Everything I found in combination with `wheel` are bug reports on GitHub.

Note that copying the venv directory is not an option for me. I'm using 
a docker container and want to install the packages system wide.


Cheers
Flo
--
https://mail.python.org/mailman/listinfo/python-list


[issue34989] python-gdb.py fails with TypeError("'FakeRepr' object is not subscriptable") is gdb fails to read debug symbols

2018-10-15 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9260

___
Python tracker 

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



[issue34989] python-gdb.py fails with TypeError("'FakeRepr' object is not subscriptable") is gdb fails to read debug symbols

2018-10-15 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9259

___
Python tracker 

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



[issue34521] Multiple tests (test_socket, test_multiprocessing_*) fail due to incorrect recvmsg(2) buffer lengths, causing failures on FreeBSD CURRENT

2018-10-15 Thread miss-islington


miss-islington  added the comment:


New changeset d991ede16b34399c5ea9bd30e9a5c520bed6bea8 by Miss Islington (bot) 
in branch '3.7':
bpo-34521: Add NEWS entry for changes in GH-9613 (GH-9850)
https://github.com/python/cpython/commit/d991ede16b34399c5ea9bd30e9a5c520bed6bea8


--

___
Python tracker 

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



[issue34989] python-gdb.py fails with TypeError("'FakeRepr' object is not subscriptable") is gdb fails to read debug symbols

2018-10-15 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 2e438cc2554495b28480a3ffe5cdf41b6ab823a0 by Victor Stinner in 
branch 'master':
bpo-34989: python-gdb.py: fix current_line_num() (GH-9889)
https://github.com/python/cpython/commit/2e438cc2554495b28480a3ffe5cdf41b6ab823a0


--

___
Python tracker 

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



[issue11233] clarifying Availability: Unix

2018-10-15 Thread STINNER Victor


STINNER Victor  added the comment:

Thank you Sandro Tosi for the bug report, thanks Georg Brandl for initial 
patch, and thanks Cheryl Sabella for the final changes in 3.7 and master!

According to Yury Selivanov, it's not need to backport this change to 2.7 and 
3.6, so I close the issue.
https://github.com/python/cpython/pull/9692#issuecomment-429364037

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
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



[issue34783] [3.7] segmentation-fault/core dump when try to run non-existing file specified on commandline

2018-10-15 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +9258

___
Python tracker 

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



Re: Python indentation (3 spaces)

2018-10-15 Thread Chris Angelico
On Tue, Oct 16, 2018 at 8:03 AM Cameron Simpson  wrote:
>
> > [ Marko and Rhdri discussing emacs indentation modes ... ]
>
> I can't express how pleasing it is to see the traditional vi-vs-emacs
> wars supplanted by emacs-vs-emacs :-)
>

Which editor should I use - vi in emacs mode, or emacs in vi mode?

*diving for cover*

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue34994] sysconfig returns the git commands for GITBRANCH, GITVERSION and GITTAG

2018-10-15 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

yep, sure and now, after your explanations (you and victor) I just closed my 
PR, but to be honnest with your, I was really surprised when I have seen the 
git commands in the GIT* variables.

Thanks for your review and your time.

--
resolution: not a bug -> 
stage: resolved -> 
status: closed -> open

___
Python tracker 

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



Re: Python indentation (3 spaces)

2018-10-15 Thread Cameron Simpson

[ Marko and Rhdri discussing emacs indentation modes ... ]


I can't express how pleasing it is to see the traditional vi-vs-emacs 
wars supplanted by emacs-vs-emacs :-)


Cheers,
Cameron Simpson 
--
https://mail.python.org/mailman/listinfo/python-list


[issue34994] sysconfig returns the git commands for GITBRANCH, GITVERSION and GITTAG

2018-10-15 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


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



[issue34994] sysconfig returns the git commands for GITBRANCH, GITVERSION and GITTAG

2018-10-15 Thread Ned Deily


Ned Deily  added the comment:

Victor is correct.  Those GIT* variable are there to communicate between 
./configure and the Makefile; they are *not* intended to have actual values for 
change ids or branch names. Many variables in the Makefile are not intended to 
be used outside of the build except for those that are explicitly documented or 
are well-known autoconf variables, like CFLAGS.

While any Git VCS info for the build is captured in sys._git, the _ prefix 
indicates it is a Python private attribute and thus is not documented.  The 
documented way to get any VCS info is via the platform module:

$ /usr/local/bin/python3.7
Python 3.7.1rc2 (v3.7.1rc2:6c06ef7dc3, Oct 13 2018, 05:10:29)
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform
>>> platform.python_branch()
'v3.7.1rc2'
>>> platform.python_revision()
'6c06ef7dc3'
>>> platform.python_build()
('v3.7.1rc2:6c06ef7dc3', 'Oct 13 2018 05:10:29')

https://docs.python.org/3/library/platform.html#platform.python_revision

--
nosy: +ned.deily
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



[issue11233] clarifying Availability: Unix

2018-10-15 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset b248a8c9a5e7cf6b8e84a3efda493fccfc511316 by Victor Stinner 
(Cheryl Sabella) in branch '3.7':
[3.7] bpo-11233: Create availability directive for documentation (GH-9692) 
(GH-9830)
https://github.com/python/cpython/commit/b248a8c9a5e7cf6b8e84a3efda493fccfc511316


--

___
Python tracker 

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



[issue34994] sysconfig returns the git commands for GITBRANCH, GITVERSION and GITTAG

2018-10-15 Thread STINNER Victor


STINNER Victor  added the comment:

It seems like you misunderstood the purpose of these variables. They are only 
used to build getbuildinfo which is used to fill sys._git. Depending on the 
platform and git version, there are different ways to get the version, branch 
and tag. These variables should not be used to get the Git version, branch and 
tag: sys._git is here for that. Hum, sadly it's not documented. Or you can 
parse sys.version.

--

___
Python tracker 

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



[issue34994] sysconfig returns the git commands for GITBRANCH, GITVERSION and GITTAG

2018-10-15 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

sure, but you can also get these info from sysconfig. and for me, there is a 
problem with sysconfig. two solutions, remove GIT* from sysconfig or fix 
sysconfig with the right values.

--
stage: patch review -> 

___
Python tracker 

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



[issue34932] Add macOS TCP_KEEPALIVE to available socket options

2018-10-15 Thread Robert Wall


Robert Wall  added the comment:

I saw that article too but reading man tcp(4) [1], it says that this value is 
in seconds for macOS and testing appears to confirm this. 

Where the unit of time is different, however, is with the old and new Windows 
keepalive options discussed in #32394. The SIO_KEEPALIVE_VALS set via the 
WinSock ioctl is in milliseconds [2] whereas the newer TCP_KEEP* flags are set 
in seconds [3] but this doesn't seem too bad as they are different interfaces. 

I'll add the tcp_keepalive flag to the same win_runtime_flags structure as the 
other options with minimum version 1709 and update the failing test accordingly 
to take account of the new option. 


[1] 
https://github.com/apple/darwin-xnu/blob/xnu-4570.1.46/bsd/man/man4/tcp.4#L172
[2] 
https://msdn.microsoft.com/en-us/library/windows/desktop/dd877220(v=vs.85).aspx
[3] 
https://docs.microsoft.com/en-us/windows/desktop/winsock/ipproto-tcp-socket-options

--

___
Python tracker 

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



[issue34095] [2.7] Seg fault on archlinux 32 when run tests with xvfb-run

2018-10-15 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner

___
Python tracker 

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



[issue34994] sysconfig returns the git commands for GITBRANCH, GITVERSION and GITTAG

2018-10-15 Thread STINNER Victor


STINNER Victor  added the comment:

Git informations are available as:

>>> sys._git
('CPython', 'heads/fakerepr', 'd353239f83')
>>> sys.version
'3.8.0a0 (heads/fakerepr:d353239f83, Oct 15 2018, 13:20:43) \n[GCC 8.1.1 
20180712 (Red Hat 8.1.1-5)]'

--
nosy: +vstinner

___
Python tracker 

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



[issue34994] sysconfig returns the git commands for GITBRANCH, GITVERSION and GITTAG

2018-10-15 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


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

___
Python tracker 

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



[issue34994] sysconfig returns the git commands for GITBRANCH, GITVERSION and GITTAG

2018-10-15 Thread Stéphane Wirtel

New submission from Stéphane Wirtel :

> ./configure --prefix=$PWD-build --with-pydebug --quiet
> make -j 4 -s
> git --git-dir ./.git rev-parse --short HEAD
ee171a26c1
> ./python -m sysconfig | grep GIT
GITBRANCH = "git --git-dir ./.git name-rev --name-only HEAD"
GITTAG = "git --git-dir ./.git describe --all --always --dirty"
GITVERSION = "git --git-dir ./.git rev-parse --short HEAD"

Normally, I should get the real values in these variables and not the git 
commands.
I don't understand why there are the git commands, I don't want to execute the 
commands, just get the git information.

The result should be
GITBRANCH = "master"
GITTAG = "heads/master"
GITVERSION = "ee171a26c1"

I think there is an issue. Is it right?

--
messages: 327779
nosy: matrixise
priority: normal
severity: normal
status: open
title: sysconfig returns the git commands for GITBRANCH, GITVERSION and GITTAG
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



[issue34562] cannot install versions 3.6.5+ on Windows

2018-10-15 Thread Zyg


Zyg  added the comment:

Clarification. After getting that system error 3 times, I saw the message that 
installation succeeded. But I am unable to start Python because of this same 
error.

--

___
Python tracker 

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



[issue34562] cannot install versions 3.6.5+ on Windows

2018-10-15 Thread Zyg


Zyg  added the comment:

Thanks for the answer. As you instructed, I have downloaded all the 
installation files into a directory from another laptop, where I later 
successfully installed Python. However, on the old laptop, where I originally 
had this problem, I am still unable to install it. I believe it has something 
to do with missing Windows updates. Now I am receiving a "System Error" 
message: "The program can't start because api-ms-win-crt-runtime-l1-1-0.dll is 
missing from your computer. Try reinstalling the program to fix this problem."

--

___
Python tracker 

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



Re: Python indentation (3 spaces)

2018-10-15 Thread Chris Angelico
On Tue, Oct 16, 2018 at 6:34 AM Peter J. Holzer  wrote:
>
> On 2018-10-15 14:12:54 +0200, Antoon Pardon wrote:
> > On 13-10-18 09:37, Peter J. Holzer wrote:
> > > On 2018-10-09 09:55:34 +0200, Antoon Pardon wrote:
> > >> On 08-10-18 19:43, Peter J. Holzer wrote:
> > >>> In practice it doesn't work in my experience. There is always someone in
> > >>> a team who was "just testing that new editor" and replaced all tabs
> > >>> with spaces (or vice versa) or - worse - just some of them.
> > >> Isn't that caugth in the process of commiting to version control?
> > > Tabs are easy to catch. If a file contains a tab, reject it.
> > >
> > > Spaces aren't, because spaces are everywhere.
> >
> > Spaces that replaced a tab by accident, are easy to catch too. They are all
> > those lines that show up when you do a diff with the previous version that
> > shouldn't show up.
>
> And where is the AI that decides which lines in a diff are should show
> up?
>
> Whether a line in a diff should or should not show up seems to me to be
> even harder to determine than whether a tab fits the syntax.
>

If there's a change, it shows up. If there's no change, it doesn't show up.

Ergo, if you accidentally replace a tab with spaces, it's a change,
and it shows up.

ChrisA
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python indentation (3 spaces)

2018-10-15 Thread Peter J. Holzer
On 2018-10-15 14:12:54 +0200, Antoon Pardon wrote:
> On 13-10-18 09:37, Peter J. Holzer wrote:
> > On 2018-10-09 09:55:34 +0200, Antoon Pardon wrote:
> >> On 08-10-18 19:43, Peter J. Holzer wrote:
> >>> In practice it doesn't work in my experience. There is always someone in
> >>> a team who was "just testing that new editor" and replaced all tabs
> >>> with spaces (or vice versa) or - worse - just some of them.
> >> Isn't that caugth in the process of commiting to version control?
> > Tabs are easy to catch. If a file contains a tab, reject it.
> >
> > Spaces aren't, because spaces are everywhere.
> 
> Spaces that replaced a tab by accident, are easy to catch too. They are all
> those lines that show up when you do a diff with the previous version that
> shouldn't show up.

And where is the AI that decides which lines in a diff are should show
up?

Whether a line in a diff should or should not show up seems to me to be
even harder to determine than whether a tab fits the syntax. 

hp

-- 
   _  | Peter J. Holzer| we build much bigger, better disasters now
|_|_) || because we have much more sophisticated
| |   | h...@hjp.at | management tools.
__/   | http://www.hjp.at/ | -- Ross Anderson 


signature.asc
Description: PGP signature
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue34980] KillPython target doesn't detect 64-bit processes

2018-10-15 Thread Eryk Sun


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-bit [1]. This is because 
a 32-bit process can't sensibly read the PEB data of a 64-bit process, such as 
the loader's module data. 

It seems we have to P/Invoke QueryFullProcessImageName (which makes an 
NtQueryInformationProcess system call instead of reading data directly). We 
already have p.Handle, so the process doesn't have to be opened. Here's an 
example in 32-bit posh (i.e. 
%SystemRoot%\SysWOW64\WindowsPowerShell\v1.0\powershell.exe):

$MethodDefinition = @"
[DllImport("kernel32.dll", SetLastError=true, CharSet=CharSet.Unicode)]
public static extern bool QueryFullProcessImageName(
[In]IntPtr hProcess, [In]int dwFlags, [Out]StringBuilder lpExeName, 
ref int lpdwSize);
"@

$Kernel32 = Add-Type -Using "System.Text" -MemberDefinition `
$MethodDefinition -Name "Kernel32" -Namespace "Win32" -PassThru

$p = [System.Diagnostics.Process]::GetProcessesByName("explorer")[0]
$size = 32768
$name = [System.Text.StringBuilder]($size)

32-bit posh can't directly read the executable name:

PS C:\> $p.MainModule.FileName -eq $null
True

But QueryFullProcessImageName works fine:

PS C:\> $Kernel32::QueryFullProcessImageName($p.Handle, 0, $name, 
[ref]$size)
True
PS C:\> $name.ToString()
C:\Windows\explorer.exe

[1]: https://docs.microsoft.com/en-us/dotnet/api/system.diagnostics.process

--
nosy: +eryksun

___
Python tracker 

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



Re: Python indentation (3 spaces)

2018-10-15 Thread Peter J. Holzer
On 2018-10-15 12:06:06 +0100, Rhodri James wrote:
> On 14/10/18 09:06, Peter J. Holzer wrote:
> > If everybody used tabs, why would anyone care about your tab width?
> > Unless they look over your shoulder while you are typing, they won't
> > even know how wide your tabs are.
> 
> If you used two-space tab stops and I used (the normal :-) eight,
> comfortable indentations for you would rapidly become uncomfortably large
> indentations for me.  I'd care about that.

Buy a bigger monitor :-).

On a more serious note, I think the number of indentation levels should
be fairly low regardless of their width. If someone uses 2-space
indentation so they can fit 20 nested ifs, the other programmers should
complain during code review: Not because the lines are too long but
because the nesting is too deep.

> I'd also care if you used spaces to make sub-tab stop adjustments to
> line up appropriate text (inside brackets, for example).

I'm not sure what a "sub-tab stop adjustment" is. I think that for the
"1 tab per indentation level" style, tabs would be used only for
indentation, nothing else, and preferably only for block-level
indentation.

So a python function might look like this with 8 spaces per tab:

def·foo(a_parameter,·another_parameter,
an_optional_parameter=DEFAULT_VALUE,
another_optional_parameter=None
):
   →x·=·a_parameter
   →a·=·[
   →{·'x':·1,···'y':·2,'z':·3·},
   →{·'x':·0.4,·'y':·3.14,·'z':·1.618·},
   →]
   →if·another_optional_parameter:
   →   →r·=·(
   →   
→(another_optional_parameter·*·a[0]['x']·+·another_parameter·*·b[0]['y'])
   →   →/
   →   →(a[1]['x']·+·a[1]['y']·+·a[1]['z'])
   →   →)
   →else:
   →   →r·=·another_parameter·*·0
   →return·r

(I'using → to represent a tab here and · to represent a space.)

And like this with 2 spaces per tab:

def·foo(a_parameter,·another_parameter,
an_optional_parameter=DEFAULT_VALUE,
another_optional_parameter=None
):
 →x·=·a_parameter
 →a·=·[
 →{·'x':·1,···'y':·2,'z':·3·},
 →{·'x':·0.4,·'y':·3.14,·'z':·1.618·},
 →]
 →if·another_optional_parameter:
 → →r·=·(
 → →(another_optional_parameter·*·a[0]['x']·+·another_parameter·*·b[0]['y'])
 → →/
 → →(a[1]['x']·+·a[1]['y']·+·a[1]['z'])
 → →)
 →else:
 → →r·=·another_parameter·*·0
 →return·r

Note that everything still lines up nicely.

hp (a four spaces per indentation level guy)

-- 
   _  | Peter J. Holzer| we build much bigger, better disasters now
|_|_) || because we have much more sophisticated
| |   | h...@hjp.at | management tools.
__/   | http://www.hjp.at/ | -- Ross Anderson 


signature.asc
Description: PGP signature
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue34844] logging.Formatter enhancement - Checking on style and fmt fields

2018-10-15 Thread Guido van Rossum


Guido van Rossum  added the comment:

W00t! Congrats Luna and thanks for your contribution. Thanks Vinay for the 
prompt reviews!

--

___
Python tracker 

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



[issue34990] year 2038 problem in compileall.py

2018-10-15 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

Victor seems there was some discussion about 2038 problem in the original PR 
but I don't know if it's related to this. Reference : 
https://github.com/python/cpython/pull/4575#discussion_r153376173

Thanks

--

___
Python tracker 

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



Re: Python indentation (3 spaces)

2018-10-15 Thread Peter J. Holzer
On 2018-10-15 09:49:12 +1100, Cameron Simpson wrote:
> On 15Oct2018 00:33, Peter J. Holzer  wrote:
> > On 2018-10-15 09:06:11 +1100, Chris Angelico wrote:
> > > On Mon, Oct 15, 2018 at 8:56 AM Marko Rauhamaa  wrote:
> > > > Chris Angelico :
> > > > > Tabs for indentation have semantic meaning. Top-level has zero tabs.
> > > > > One indentation level is represented by one tab. Two indentation
> > > > > levels? Two tabs. It's about as perfect a representation as you could
> > > > > hope for.
> > > >
> > > > That *could* be the situation. However, it is trumped by an older
> > > > convention whereby the indentation levels go as follows:
> > > >
> > > >0:
> > > >1: SPC SPC
> > > >2: SPC SPC SPC SPC
> > > >3: SPC SPC SPC SPC SPC SPC
> > > >4: TAB
> > > >5: TAB SPC SPC
> > > >6: TAB SPC SPC SPC SPC
> > > >7: TAB SPC SPC SPC SPC SPC SPC
> > > >8: TAB TAB
> > 
> > That's not using tabs for indentation, that's using tabs for compressing
> > spaces (somebody already mentioned that in this thread).
> > 
> > 
> > > I've literally NEVER come across this as a convention. Not a single
> > > file that I have ever worked with has used it. Where is this
> > > convention from?
> > 
> > It's something vi does by default, and apparently emacs as well.
> > In the 1970's saving space by replacing sequences of 8 spaces
> > with tabs seemed lika a good idea.
> > 
> > There are workarounds in vi(m), but I'm not sure if you can get rid of
> > that behaviour completely. I'm sure it is possible in emacs.
> 
> I'm a "just use spaces" guy.

So am I. As I wrote somewhere near the start of this thread, I find the
"1 tab per indentation level" theoretically appealing but unworkable in
practice. 


> I use the tab _key_ as a shortcut to do a bunch
> of spaces.
> 
> My vim setup has this:
> 
>  set expandtab
> 
> which turns them into spaces.

Yep, mine, too. But that doesn't help you if you want to use tabs
(the character ASCII 0x09, not the tab key) to signify an indentation
level in your files.

So it's sort of off-topic in this sub-thread.

My point was that with expandtab off, vim sometimes "optimizes"
sequences of spaces into tabs in places where it shouldn't, and that
it's hard (maybe impossible) to get vim leave tabs where they belong and
not introduce them where they don't belong. So it isn't the ideal editor
for the "1 tab per indentation level" style.

hp

-- 
   _  | Peter J. Holzer| we build much bigger, better disasters now
|_|_) || because we have much more sophisticated
| |   | h...@hjp.at | management tools.
__/   | http://www.hjp.at/ | -- Ross Anderson 


signature.asc
Description: PGP signature
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue34909] StrEnum subclasses cannot be created

2018-10-15 Thread Ethan Furman


Ethan Furman  added the comment:

On 10/12/2018 09:52 PM, Ned Deily wrote:

 > Can you please merge a NEWS item for this issue using blurb since it
 > is a user-visible problem?  I'll cherry-pick it into the 3.7.1 final.

I don't believe the problem exists in 3.7.0 -- but I also don't know how 
to select the 3.7.0 "branch"/"bookmark"/"tag"/"whatever-it's-called" to 
build and test myself.

If you can tell me how to get to whatever commit represents 3.7.0 I'm 
happy to test.

--

___
Python tracker 

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



[issue34844] logging.Formatter enhancement - Checking on style and fmt fields

2018-10-15 Thread Vinay Sajip


Vinay Sajip  added the comment:


New changeset 18fb1fb943b7dbd7f8a76017ee2a67ef13effb85 by Vinay Sajip 
(BNMetrics) in branch 'master':
bpo-34844: logging.Formatter enhancement - Ensure style and format string 
matches in logging.Formatter  (GH-9703)
https://github.com/python/cpython/commit/18fb1fb943b7dbd7f8a76017ee2a67ef13effb85


--

___
Python tracker 

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



[issue34990] year 2038 problem in compileall.py

2018-10-15 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


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

___
Python tracker 

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



[issue34993] asyncio.streams.FlowControlMixin should be part of the API

2018-10-15 Thread Andrew Svetlov


Andrew Svetlov  added the comment:

1. Trio has *stappled* streams for the case, especially useful for starting TLS 
session over stdin/stdout.
We can master something too.
2. FlowControlMixin was always considered a **private** API. Would be nice to 
add an underscore prefix to the name if not too late. IIRC the official policy 
is: if you need the class -- copy and paste it into your project.
3. Even a person with very many stars on StackOverflow doesn't become an 
asyncio expert automatically; while I very respect the sie and so on.

--

___
Python tracker 

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



[issue12572] HP/UX compiler workarounds

2018-10-15 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Thank you for the update.  I think any problems with the current HP/UX compiler 
are best reported on a new issue.

--
resolution:  -> out of date
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



[issue34978] check type of object in fix_dict.py in 2to3

2018-10-15 Thread Pranav Devarakonda


Pranav Devarakonda  added the comment:

Thank you very much for pointing out some helpful things,  Karthikeyan. 

>True if 1 in list(a.keys()) if type(a) == dict else a.keys() else False

True that the fixer would return a syntax error in this case. I missed adding a 
pair of parenthesis to the whole if statement. I mean

True if 1 in (list(a.keys()) if type(a) == dict else  a.keys()) else False

is valid code. So adding parenthesis would solve the problem as I did in the 
updated patch I uploaded.

I don't see this updated fixer returning errors in other cases like nested if 
conditions or list comprehensions, since the fixer would convert the respective 
function calls of dict objects into separate statements, would not interfere 
with other if statements(or any other statements for that matter) and set the 
order of precedence appropriately.

Please do point out if there any other cases I missed. 

I know this is a less pythonic but is more accurate :) Thanks.

--
Added file: https://bugs.python.org/file47871/fix_dict.py

___
Python tracker 

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



[issue34095] [2.7] Seg fault on archlinux 32 when run tests with xvfb-run

2018-10-15 Thread Erich Eckner


Erich Eckner  added the comment:

yes, I'm also not sure what's different now - I executed the very same commands 
on the very same source tree :-/

--

___
Python tracker 

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



[issue34953] Implement `mmap.mmap.__repr__`

2018-10-15 Thread thautwarm


thautwarm  added the comment:

@Ram Rachum

Yes yes yes, actually the entire contents will be truncated when its length is 
bigger than a specific integer(now it's 50). For we use `...` to represent the 
ignored contents, `start ... end` could also be called *entire_contents* :-)

--

___
Python tracker 

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



[issue34095] [2.7] Seg fault on archlinux 32 when run tests with xvfb-run

2018-10-15 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

It is not clear what you did differently to get a different result. I changed 
the title since it seems that idlelib code is not the direct problem.

--
title: [2.7] test_idle fails with: /usr/bin/xvfb-run: line 181:  3617 
Segmentation fault -> [2.7] Seg fault on archlinux 32 when run tests with 
xvfb-run
type:  -> crash

___
Python tracker 

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



[issue34993] asyncio.streams.FlowControlMixin should be part of the API

2018-10-15 Thread Yury Selivanov


Yury Selivanov  added the comment:

asvetlov: need to handle this usecase with the new API; -1 on exposing 
FlowControlMixin though.

--

___
Python tracker 

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



[issue34993] asyncio.streams.FlowControlMixin should be part of the API

2018-10-15 Thread xitop


New submission from xitop :

This issue report is based on a SO question "How to create asyncio stream 
reader/writer for stdin/stdout?", its answer and comments. Link: 
https://stackoverflow.com/q/52089869/5378816

The key point is that two unidirectional pipes should be used the same way as 
one bidirectional network socket. The answer (more precisely the Linux/Unix 
part of it) and some following comments - both created by highly competent SO 
members - suggest that FlowControlMixin is a useful class required to write a 
proper code for this and similar usecases.

That's why the FlowControlMixin or an equivalent should be made available to 
asyncio programmers as a documented part of the library.

--
components: asyncio
messages: 327764
nosy: asvetlov, xitop, yselivanov
priority: normal
severity: normal
status: open
title: asyncio.streams.FlowControlMixin should be part of the API
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



[issue34980] KillPython target doesn't detect 64-bit processes

2018-10-15 Thread Jeremy Kloth


Jeremy Kloth  added the comment:

Alternatively, to test for yourself:

1) build a 64-bit python:

   > build -e -d -k -v -p x64

2) start the newly built interpreter:

   > amd64\python_d.exe

3) in a different command prompt (using dummy target to just do the KillPython)

   > build -e -d -k -v -p x64 -t foo

The expected result should be that the Python interpreter in the first window 
would by closed, but does not with the 32-bit MSBuild.  It does close however 
with the 64-bit MSBuild.

--

___
Python tracker 

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



RE: Single DB connection during class's lifetime. Metaclass,singletonand __new__() examples and references.

2018-10-15 Thread Ryan Johnson
Thank you. That clears everything up.

Sent from Mail for Windows 10

From: Cameron Simpson
Sent: Saturday, October 13, 2018 6:06 PM
To: Ryan Johnson
Cc: python-list@python.org
Subject: Re: Single DB connection during class's lifetime. 
Metaclass,singletonand __new__() examples and references.

On 12Oct2018 13:28, Ryan Johnson  wrote:
>Thanks for the clarification.
>
>If I am creating a class variable, are you suggesting I perform the “if it 
>exists, great, otherwise make it” logic in the __init__ block or in the class 
>definition block? Will that even run in a class definition?

The class definition code runs when the class is defined (as Python 
reads it in your code).

The __init__ block runs once each time a new instance of the class is 
initialised.

When do you _want_ this logic to run? That dictates where the logic 
goes.

If you run this in the class definition code it pretty much will 
unconditionally make a db connection. But in reality (a) you usually 
want to defer making the connection until you need it to reduce resource 
usage and (b) you often don't know enough to make the connection at 
class definition time i.e. you don't know the database host, the 
credentials, etc - they are often supplied to the initialiser (directly 
or via some config file).

>I never see examples do anything besides assignment operations and flow 
>control, although it would follow that if the block allows creation of 
>strings (an object), it would allow creation of connection objects. On 
>the other hand, the __init__ block seems like a natural place to put 
>the cursor instantiation.

You can do anything that is sensible in the __init__ block - it is just 
code. Your goal is to decide what is sensible.

Normally the initialiser mosts sets up various arrtributes to sane 
initial values. It can do complex things, but is usually relatively 
basic.

I'd note, as Thomas did, that the cursor is a control object associated 
with a query. You can have multiple cursors on a connection, and you 
often make one from a query, process the query results, then discard the 
cursor. SO you routinely use several during the lifetime of a 
connection.

Therefore you don't make cursors when you set up the connection; you 
make them in association with queries.

>From this answer ( 
>https://stackoverflow.com/questions/25577578/python-access-class-variable-from-instance/25577642#25577642
> ) the pythonic way to access the class variable is using type(self), but 
>doesn’t this access the local class’s variable, if someone subclasses my 
>class? Can I specify my class variable via the class name itself? Example: 
>instancevar = ClassName.classvar .
>I am hoping that because of the way python points labels to objects, this 
>should give my instance an instance var that refers to the class var. Am I 
>right?

_Usually_ I access class attributes (which you're calling variables, I 
believe - they're not) via the instance:

  def foo(self, blah=None):
if blah is None:
  blah = foo.DEFAULT_BLAH_VALUE
... work with blah ...

As you suggest, this will find DEFAULT_BLAH_VALUE from the subclass 
before it finds it from the superclass. Usually that is what I want - 
the purpose of subclassing is to (possibly) override the aspects of the 
superclass.

However, you _can_ always reach directly to a specific class to get a 
value:

  blah = MySuperCLass.DEFAULT_BLAH_VALUE

if that is sensible. All you're doing is changing the way in which the 
name "DEFAULT_BLAH_VALUE" is found: do I use the instance's name lookup 
or go somewhere direct?

In your case with a persistent database connection associated with a 
class it would be best to make the "get a connection" logic a class 
method because the "is there a connection" attribute is associated with 
the class, not the instance.

Methods are, by default, "instance" methods: they are defined like this:

  def method(self, ...):

and you largely work through "self", being the current instance. That is 
its "context".

Class method are defined like this:

  @classmethod
  def method(cls, ...)

and instead of having an instance as context (with the conventional name 
'self"), you have the class (with the conventional name "cls"). These 
are for methods which _do_ _not_ care about the instance, just the 
class. So in the case of your database connection, made on demand once 
per class, you might go:

  @classmethod
  def conn(cls):
c = cls.connection
if c is None:
  c = connect_to_the_db(.)
  cls.connection = c
return c

See that there's no "self" in here?

Then your instance methods can look like this:

  def lookup(self, ):
conn = self.conn()
cursor = conn.select()
... use the cursor to process the result ...

The instance finds the "conn" class method in the usual way: look in the 
instance, then look in the class hierarchy.

This in itself is an argument against making the connection in the 
__init__ block.

Does this help?

Cheers,
Cameron 

[issue34980] KillPython target doesn't detect 64-bit processes

2018-10-15 Thread Jeremy Kloth


Jeremy Kloth  added the comment:

My testing shows differently:

D:\Public\Devel\cpython\master\PCbuild>set MSBUILD="C:\Program Files 
(x86)\MSBuild\14.0\Bin\amd64\MSBuild.exe"

D:\Public\Devel\cpython\master\PCbuild>build -k -v -t foo
Using py -3.6 (found 3.6 with py.exe)
Fetching external libraries...
bzip2-1.0.6 already exists, skipping.
sqlite-3.21.0.0 already exists, skipping.
xz-5.2.2 already exists, skipping.
zlib-1.2.11 already exists, skipping.
Fetching external binaries...
openssl-bin-1.1.0i already exists, skipping.
tcltk-8.6.8.0 already exists, skipping.
Finished.
Using "C:\Program Files (x86)\MSBuild\14.0\Bin\amd64\MSBuild.exe" (found in the 
environment)

D:\Public\Devel\cpython\master\PCbuild>"C:\Program Files 
(x86)\MSBuild\14.0\Bin\amd64\MSBuild.exe" 
"D:\Public\Devel\cpython\master\PCbuild\\pythoncore.vcxproj" /t:KillPython /v:n 
/p:Configuration=Release /p:Platform=Win32 /p:KillPython=true
Microsoft (R) Build Engine version 14.0.25420.1
Copyright (C) Microsoft Corporation. All rights reserved.

Build started 10/15/2018 10:05:36 AM.
Project "D:\Public\Devel\cpython\master\PCbuild\pythoncore.vcxproj" on node 1 
(KillPython target(s)).
KillPython:
  Killing any running python.exe instances...
  Looking for D:\Public\Devel\cpython\master\PCbuild\win32\python.exe
  Found running process: C:\Program Files 
(x86)\Google\Chrome\Application\chrome.exe
  Found running process: C:\Program Files\Common 
Files\LogiShrd\sp6\LU1\LogitechUpdate.exe
  Found running process: C:\Program Files (x86)\Microsoft Visual 
Studio\Preview\Community\Common7\ServiceHub\Hosts\Serv
  iceHub.Host.Node.x86\ServiceHub.Host.Node.x86.exe
  Found running process: C:\Windows\System32\MicrosoftEdgeCP.exe
  Found running process: C:\Windows\System32\MicrosoftEdgeCP.exe
  Found running process: C:\Program Files 
(x86)\Google\Chrome\Application\chrome.exe
  Found running process: 
C:\Windows\SystemApps\Microsoft.Windows.Cortana_cw5n1h2txyewy\SearchUI.exe
  Found running process: C:\Program Files 
(x86)\Google\Chrome\Application\chrome.exe
  Found running process: C:\Program Files\TortoiseHg\TortoiseHgOverlayServer.exe
  Found running process: C:\Program Files 
(x86)\Google\Chrome\Application\chrome.exe
  Found running process: C:\Program Files (x86)\Common 
Files\Acronis\Schedule2\schedhlp.exe
  Found running process: C:\Program Files 
(x86)\Google\Chrome\Application\chrome.exe
  Found running process: C:\Program Files 
(x86)\Google\Chrome\Application\chrome.exe
  Found running process: C:\Program Files (x86)\Origin\QtWebEngineProcess.exe
  Found running process: C:\Program Files 
(x86)\Google\Chrome\Application\chrome.exe
  Found running process: C:\Program Files (x86)\Microsoft Visual 
Studio\Preview\Community\Common7\ServiceHub\Hosts\Serv
  iceHub.Host.CLR.x86\ServiceHub.SettingsHost.exe
  Found running process: C:\WINDOWS\system32\browser_broker.exe
  Found running process: C:\Program Files 
(x86)\Google\Chrome\Application\chrome.exe
  Found running process: C:\Program Files 
(x86)\Google\Chrome\Application\chrome.exe
  Found running process: C:\Program Files 
(x86)\Google\Chrome\Application\chrome.exe
  Found running process: C:\Program Files 
(x86)\Google\Chrome\Application\chrome.exe
  Found running process: C:\Windows\System32\GameBarPresenceWriter.exe
  Found running process: C:\Program Files 
(x86)\Google\Chrome\Application\chrome.exe
  Found running process: C:\Program 
Files\WindowsApps\Microsoft.Windows.Photos_2018.18091.13420.0_x64__8wekyb3d8bbwe\Mi
  crosoft.Photos.exe
  Found running process: C:\Windows\System32\MicrosoftEdgeCP.exe
  Found running process: C:\Program Files 
(x86)\Steam\bin\cef\cef.win7x64\steamwebhelper.exe
  Found running process: C:\Program Files 
(x86)\Google\Chrome\Application\chrome.exe
  Found running process: C:\Program Files 
(x86)\Google\Chrome\Application\chrome.exe
  Found running process: C:\Program Files 
(x86)\Google\Chrome\Application\chrome.exe
  Found running process: C:\WINDOWS\system32\conhost.exe
  Found running process: C:\Program Files 
(x86)\Google\Chrome\Application\chrome.exe
  Found running process: C:\Program Files 
(x86)\Google\Chrome\Application\chrome.exe
  Found running process: C:\Program Files 
(x86)\Steam\bin\cef\cef.win7x64\steamwebhelper.exe
  Found running process: C:\Program Files 
(x86)\Google\Chrome\Application\chrome.exe
  Found running process: C:\Program Files 
(x86)\Google\Chrome\Application\chrome.exe
  Found running process: C:\Program Files 
(x86)\Steam\bin\cef\cef.win7x64\steamwebhelper.exe
  Found running process: C:\Program Files 
(x86)\Google\Chrome\Application\chrome.exe
  Found running process: C:\Program Files 
(x86)\Google\Chrome\Application\chrome.exe
  Found running process: C:\Windows\System32\RuntimeBroker.exe
  Found running process: C:\Program Files 
(x86)\Google\Chrome\Application\chrome.exe
  Found running process: C:\Windows\System32\RuntimeBroker.exe
  Found running process: C:\Program Files (x86)\Microsoft Visual 

Re: Python indentation (3 spaces)

2018-10-15 Thread Rhodri James

On 15/10/18 16:41, Marko Rauhamaa wrote:

Rhodri James :


On 15/10/18 12:28, Marko Rauhamaa wrote:

Try running

  emacs -q abc.c

and observe the indentation depth.


"""User Option: c-basic-offset

 This style variable holds the basic offset between indentation
levels. It's factory default is 4, but all the built-in styles set it
themselves, to some value between 2 (for gnu style) and 8 (for bsd,
linux, and python styles)."""


To realize why 2 is the factory default despite the above statement, we
observe that the factory setting of c-default-style specifies "gnu" for
C-like files other than Java and awk.


In other words, only for some  C styles.  As I said.

--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list


Re: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-10-15 Thread pjmclenon
On Saturday, October 13, 2018 at 7:24:14 PM UTC-4, MRAB wrote:
> On 2018-10-14 00:13, pjmcle...@gmail.com wrote:
> > On Wednesday, June 13, 2018 at 7:14:06 AM UTC-4, INADA Naoki wrote:
> >> ​> 1st is this script is from a library module online open source
> >> 
> >> If it's open source, why didn't you show the link to the soruce?
> >> I assume your code is this:
> >> 
> >> https://github.com/siddharth2010/String-Search/blob/6770c7a1e811a5d812e7f9f7c5c83a12e5b28877/createIndex.py
> >> 
> >> And self.collFile is opened here:
> >> 
> >> https://github.com/siddharth2010/String-Search/blob/6770c7a1e811a5d812e7f9f7c5c83a12e5b28877/createIndex.py#L91
> >> 
> >> You need to add `encoding='utf-8'` argument.
> > 
> > 
> > 
> > hello i used this recommandtion in one of my projects in python and it 
> > worked fine im wrting today cuz i have this same unicode error in a slighty 
> > differn file code line and i added encoding utf 8 but i still get the same 
> > error
> > 
> > here is my line of code
> > 
> > with open(join("docs", path)) as f:
> > 
> > where can i add the encoding="utf8" line??
> > does anyone on this forum happen to know??
> > 
> > ok thank you jessica
> > 
> with open(join("docs", path), encoding="utf-8") as f:

THANK you very much
that works
i had forgot a comma , thats what gave me the error

thaxz again
Jesiica
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python indentation (3 spaces)

2018-10-15 Thread Marko Rauhamaa
Rhodri James :

> On 15/10/18 12:28, Marko Rauhamaa wrote:
>> Try running
>>
>>  emacs -q abc.c
>>
>> and observe the indentation depth.
>
> """User Option: c-basic-offset
>
> This style variable holds the basic offset between indentation
> levels. It's factory default is 4, but all the built-in styles set it
> themselves, to some value between 2 (for gnu style) and 8 (for bsd,
> linux, and python styles)."""

To realize why 2 is the factory default despite the above statement, we
observe that the factory setting of c-default-style specifies "gnu" for
C-like files other than Java and awk.


Marko
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue34991] variable type list [] referential integrity data loss

2018-10-15 Thread Eric V. Smith


Eric V. Smith  added the comment:

Agreed with Steven. In addition, please make sure you runnable example only 
uses imports from python's standard library.

--
nosy: +eric.smith

___
Python tracker 

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



[issue34991] variable type list [] referential integrity data loss

2018-10-15 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

I don't know what you mean by "referential integrity data loss".

I have absolutely no idea how to interpret the wall of output you have 
provided. If there is a bug here, how do you know it is a language bug rather 
than a bug in your own code?

We're not here to debug your code for you, especially when the code you provide 
is incomplete (what's Graph.isGoal?) and not the code you are actually running. 
There is no print inside the visitedPath function, so how are you getting the 
output checkvisit "inside def(visitedPath)" as you say?

If there is one difference between the code you run and the code you send us, 
there could be a hundred differences.

Please provide a *minimal* example of the problem, showing clear input, 
expected result, and actual result. You might find it helpful to read this page 
first:

http://sscce.org/

It is written for Java programmers, but the advice applies equally to Python 
too.

--
nosy: +steven.daprano

___
Python tracker 

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



[issue34953] Implement `mmap.mmap.__repr__`

2018-10-15 Thread Ram Rachum


Ram Rachum  added the comment:

thautwarm, your suggestions look good. I'm not sure why you used
`entire_contents`, do you want to show the entire content there? Because I saw 
that the sample you used had truncation. It might be unsafe to show the entire 
mmap, because it could be huge. I'd truncate in some way or other. (Either show 
just the beginning, or just the beginning and the end.)

--

___
Python tracker 

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



[issue34623] _elementtree.c doesn't call XML_SetHashSalt()

2018-10-15 Thread Charalampos Stratakis


Charalampos Stratakis  added the comment:

Will this change be backported to 3.5 and 3.4? It applied cleanly on both 
however on 3.4 there is a test failure:

==
ERROR: test_del_attribute (test.test_xml_etree_c.MiscTests)
--
Traceback (most recent call last):
  File "/builddir/build/BUILD/Python-3.4.9/Lib/test/test_xml_etree_c.py", line 
26, in test_del_attribute
element = cET.Element('tag')
AttributeError: 'NoneType' object has no attribute 'Element'
--

--
nosy: +cstratak

___
Python tracker 

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



[issue12572] HP/UX compiler workarounds

2018-10-15 Thread Michael Osipov


Michael Osipov <1983-01...@gmx.net> added the comment:

I believe this issue can be safely closed. It is a no-brainer to compile Python 
from master on HP-UX with aCC these days. It works for me at least.

--
nosy: +michael-o

___
Python tracker 

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



Re: Python indentation (3 spaces)

2018-10-15 Thread Rhodri James

On 15/10/18 12:28, Marko Rauhamaa wrote:

Rhodri James :


On 15/10/18 05:45, Marko Rauhamaa wrote:

The two-space indentation is the out-of-the-box default for emacs.


Ahem.  It's the default for certain C styles.  It's not even the default
for C-mode itself, which is 4.


You must be running a different version of emacs than all the versions
I've every run.

Try running

 emacs -q abc.c

and observe the indentation depth.


https://www.gnu.org/software/emacs/manual/html_node/ccmode/Customizing-Indentation.html#Customizing-Indentation

"""User Option: c-basic-offset

This style variable holds the basic offset between indentation 
levels. It's factory default is 4, but all the built-in styles set it 
themselves, to some value between 2 (for gnu style) and 8 (for bsd, 
linux, and python styles)."""


--
Rhodri James *-* Kynesim Ltd
--
https://mail.python.org/mailman/listinfo/python-list


[issue34980] KillPython target doesn't detect 64-bit processes

2018-10-15 Thread Steve Dower


Steve Dower  added the comment:

I haven't looked at the logs, but there shouldn't be any problem with 
33-bit/64-bit here. Windows doesn't separate processes like that.

Perhaps we have builds with slightly different names (casing?) that are failing 
the comparison?

--

___
Python tracker 

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



[issue34981] Unable to install Python from web-based installer and executable installer

2018-10-15 Thread Steve Dower


Steve Dower  added the comment:

When you run the installer, it should create log files in your %TEMP% 
directory. Could you find and attach those here please?

There's a chance it is detecting that your system is unsupported. If you are 
still using Windows Vista, ensure you have installed all available updates and 
service packs, and then try installing Python 3.6 (the latest version, 3.7, 
does not support Windows Vista any more).

--

___
Python tracker 

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



[issue33234] Improve list() pre-sizing for inputs with known lengths

2018-10-15 Thread Raymond Hettinger


Change by Raymond Hettinger :


--
nosy: +tim.peters

___
Python tracker 

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



[issue34990] year 2038 problem in compileall.py

2018-10-15 Thread Karthikeyan Singaravelan


Karthikeyan Singaravelan  added the comment:

A reproducer in Python that can be added to test_compileall if needed : 

def test_compile_all_2038(self):
with open(self.source_path, 'r') as f:
os.utime(f.name, (2147558400, 2147558400)) # Jan 20, 2038 as touch
self.assertTrue(compileall.compile_file(pathlib.Path(self.source_path)))


./python.exe -m unittest -v 
test.test_compileall.CompileallTestsWithSourceEpoch.test_compile_all_2038
test_compile_all_2038 (test.test_compileall.CompileallTestsWithSourceEpoch) ... 
ERROR

==
ERROR: test_compile_all_2038 
(test.test_compileall.CompileallTestsWithSourceEpoch)
--
Traceback (most recent call last):
  File 
"/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_py_compile.py",
 line 30, in wrapper
return fxn(*args, **kwargs)
  File 
"/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/test/test_compileall.py",
 line 114, in test_compile_all_2038
self.assertTrue(compileall.compile_file(pathlib.Path(self.source_path)))
  File "/Users/karthikeyansingaravelan/stuff/python/cpython/Lib/compileall.py", 
line 142, in compile_file
expect = struct.pack('<4sll', importlib.util.MAGIC_NUMBER,
struct.error: 'l' format requires -2147483648 <= number <= 2147483647

--


Thanks

--

___
Python tracker 

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



[issue33012] Invalid function cast warnings with gcc 8 for METH_NOARGS

2018-10-15 Thread STINNER Victor


STINNER Victor  added the comment:

I marked bpo-34992 as a duplicate of this issue:

I use Fedora 28 and gcc (GCC) 8.1.1 20180712 (Red Hat 8.1.1-5)

and I get a lot of warnings, with the standard config of Python (./configure)

Objects/call.c: In function '_PyMethodDef_RawFastCallDict':
Objects/call.c:515:24: warning: cast between incompatible function types from 
'PyCFunction' {aka 'struct _object * (*)(struct _object *, struct _object *)'} 
to 'PyObject * (*)(PyObject *, PyObject *, PyObject *)' {aka 'struct _object * 
(*)(struct _object *, struct _object *, struct _object *)'} 
[-Wcast-function-type]
 result = (*(PyCFunctionWithKeywords)meth) (self, argstuple, 
kwargs);
^
Objects/call.c:530:20: warning: cast between incompatible function types from 
'PyCFunction' {aka 'struct _object * (*)(struct _object *, struct _object *)'} 
to 'PyObject * (*)(PyObject *, PyObject * const*, Py_ssize_t)' {aka 'struct 
_object * (*)(struct _object *, struct _object * const*, long int)'} 
[-Wcast-function-type]
 result = (*(_PyCFunctionFast)meth) (self, args, nargs);
^
Objects/call.c:538:49: warning: cast between incompatible function types from 
'PyCFunction' {aka 'struct _object * (*)(struct _object *, struct _object *)'} 
to 'PyObject * (*)(PyObject *, PyObject * const*, Py_ssize_t,  PyObject *)' 
{aka 'struct _object * (*)(struct _object *, struct _object * const*, long int, 
 struct _object *)'} [-Wcast-function-type]
 _PyCFunctionFastWithKeywords fastmeth = 
(_PyCFunctionFastWithKeywords)meth;



+- 827 warnings

--

___
Python tracker 

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



[issue34992] many warnings with f28 and gcc 8.1.1

2018-10-15 Thread STINNER Victor


Change by STINNER Victor :


--
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> Invalid function cast warnings with gcc 8 for METH_NOARGS

___
Python tracker 

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



[issue34992] many warnings with f28 and gcc 8.1.1

2018-10-15 Thread Stéphane Wirtel

New submission from Stéphane Wirtel :

I use Fedora 28 and gcc (GCC) 8.1.1 20180712 (Red Hat 8.1.1-5)

and I get a lot of warnings, with the standard config of Python (./configure)

Objects/call.c: In function '_PyMethodDef_RawFastCallDict':
Objects/call.c:515:24: warning: cast between incompatible function types from 
'PyCFunction' {aka 'struct _object * (*)(struct _object *, struct _object *)'} 
to 'PyObject * (*)(PyObject *, PyObject *, PyObject *)' {aka 'struct _object * 
(*)(struct _object *, struct _object *, struct _object *)'} 
[-Wcast-function-type]
 result = (*(PyCFunctionWithKeywords)meth) (self, argstuple, 
kwargs);
^
Objects/call.c:530:20: warning: cast between incompatible function types from 
'PyCFunction' {aka 'struct _object * (*)(struct _object *, struct _object *)'} 
to 'PyObject * (*)(PyObject *, PyObject * const*, Py_ssize_t)' {aka 'struct 
_object * (*)(struct _object *, struct _object * const*, long int)'} 
[-Wcast-function-type]
 result = (*(_PyCFunctionFast)meth) (self, args, nargs);
^
Objects/call.c:538:49: warning: cast between incompatible function types from 
'PyCFunction' {aka 'struct _object * (*)(struct _object *, struct _object *)'} 
to 'PyObject * (*)(PyObject *, PyObject * const*, Py_ssize_t,  PyObject *)' 
{aka 'struct _object * (*)(struct _object *, struct _object * const*, long int, 
 struct _object *)'} [-Wcast-function-type]
 _PyCFunctionFastWithKeywords fastmeth = 
(_PyCFunctionFastWithKeywords)meth;



+- 827 warnings

--
messages: 327752
nosy: matrixise
priority: normal
severity: normal
status: open
title: many warnings with f28 and gcc 8.1.1
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



[issue34990] year 2038 problem in compileall.py

2018-10-15 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

So we need to fix compileall.py.

maybe we could add the label 'easy' to this issue.

--

___
Python tracker 

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



[issue34990] year 2038 problem in compileall.py

2018-10-15 Thread STINNER Victor


STINNER Victor  added the comment:

Timestamp with year >= 2038 are accepted: 
importlib._bootstrap_external._code_to_timestamp_pyc() uses (int(x) & 
0x). It's not a bug, but by design. compileall should just do the same. 
Sorry, I don't know if it's specified somewhere, but I know that it's done on 
purpose.

--
nosy: +vstinner

___
Python tracker 

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



  1   2   >