[issue10513] sqlite3.InterfaceError after commit

2017-01-11 Thread Benjamin Peterson

Changes by Benjamin Peterson :


--
resolution: fixed -> 
status: closed -> open

___
Python tracker 

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



[issue29006] 2.7.13 _sqlite more prone to "database table is locked"

2017-01-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset dd13098a5dc2 by Benjamin Peterson in branch '2.7':
revert 030e100f048a (#29006, #10513)
https://hg.python.org/cpython/rev/dd13098a5dc2

--
nosy: +python-dev

___
Python tracker 

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



[issue10513] sqlite3.InterfaceError after commit

2017-01-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset dd13098a5dc2 by Benjamin Peterson in branch '2.7':
revert 030e100f048a (#29006, #10513)
https://hg.python.org/cpython/rev/dd13098a5dc2

--

___
Python tracker 

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



[issue29099] sqlite3 timestamp converter cannot handle timezone

2017-01-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Naive and aware objects should not be mixed. Their actually are different 
types. The converter doesn't return str or bytes when can't parse an input as a 
datetime, and it shouldn't return a naive datetime if can't find a timezone.

SQLite date and time functions imply UTC if timezone is omitted. This is a 
reason for returning aware UTC datetime objects. On other side, Python is more 
powerful programming language, it distinguish naive and aware datetime objects, 
and it is unlikely that these two types are mixed in one database column. It is 
better to raise an error that silently return possible wrong result. It 
exceptional case user can write special converter or just call SQLite 
datetime() for unifying data format.

I think the old code unlikely will be broken if preserve an exception type and 
don't change conditions for raising an error. New error message can contain 
full input string and suggest to use the timestamptz converter if it looks as a 
datetime with timezone.

--

___
Python tracker 

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



[issue29241] sys._enablelegacywindowsfsencoding() don't apply to os.fsencode and os.fsdecode

2017-01-11 Thread JGoutin

JGoutin added the comment:

import sys

# Force the use of legacy encoding like versions of Python prior to 3.6.
sys._enablelegacywindowsfsencoding()

# Show actual file system encoding
encoding = sys.getfilesystemencoding()
print('File system encoding:', encoding)

# os.fsencode(filename) VS filename.encode(File system encoding)
import os
print(os.fsencode('é'), 'é'.encode(encoding))

>>> File system encoding: mbcs
>>> b'\xc3\xa9' b'\xe9'


The result is the same.

--

___
Python tracker 

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



[issue29099] sqlite3 timestamp converter cannot handle timezone

2017-01-11 Thread Xiang Zhang

Xiang Zhang added the comment:

> I think the timestamptz converter should either interpret strings without 
> timezone as UTC (and perhaps understand the "Z" suffix as sqlite3 date() 
> function) or raises an error. It should never return naive datetime.

Currently timestamptz just convert back what the user passed in, no matter 
naive or aware objects. What to do with them is left to the app. If we raise an 
error, could users use naive and aware objects together? And interpreting 
strings without timezone as UTC seems will mistranslate the object. For 
example, pass in datetime.datetime.now() and translate it back as UTC may not 
be right.

> The timestamp converter needs better error reporting when get an input with a 
> timezone.

I thought about it but our intention to introduce a new converter is not to 
break old code. Doesn't add error reporting violate the intention? Users' code 
may not catch the error now.

--

___
Python tracker 

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



[issue29099] sqlite3 timestamp converter cannot handle timezone

2017-01-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I think the timestamptz converter should either interpret strings without 
timezone as UTC (and perhaps understand the "Z" suffix as sqlite3 date() 
function) or raises an error. It should never return naive datetime.

The timestamp converter needs better error reporting when get an input with a 
timezone.

--

___
Python tracker 

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



[issue29099] sqlite3 timestamp converter cannot handle timezone

2017-01-11 Thread Xiang Zhang

Xiang Zhang added the comment:

timestamptz.patch implements a new converter that's able to convert aware 
datetime objects.

--
stage: needs patch -> patch review
Added file: http://bugs.python.org/file46265/timestamptz.patch

___
Python tracker 

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



Re: just started

2017-01-11 Thread metal . suomi
along the above discussion, resuming my python after the Xmas break (hope you 
had a nice one!)

I want to install a number of scientific libraries, but I'm confused which 
packages it contains what. 

1) I see on scipy.org that scipy contains scipy library (fine, it makes sense), 
along with other ones  (numpy, matplotlib ). So, I would guess that the 
following command 

pip install --user scipy

install all the libraries I need, but instead it seems that I need to specify 
them too? I.e. to install them I need to name them

pip install --user scipy numpy matplotlib etc... etc...
(of course, I guess I can equivalently use the command python3.5 -m pip install 
--user scipy numpy matplotlib  right?)

2) I have already install matplotlib time ago. So, in the above commands I can 
avoid to add matplotlib, or I can included and a new installation will be 
overwritten, correct?

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


RE: reactiveX vs Async

2017-01-11 Thread Joseph L. Casale
> So you are saying that nuget-ing .Net core would be a workable pre-requisite 
> for
> Rx on mono?

Microsoft open sourced .net a while ago. With that came the movement to
bring .net to other platforms.

https://en.wikipedia.org/wiki/.NET_Framework#.NET_Core

As its currently being heavily developed, it only provides a subset of the full
.net base class library but its covering more ground constantly. A good intro
into what is covered is 
https://blogs.msdn.microsoft.com/dotnet/2016/09/26/introducing-net-standard/

So you can install the sdk and runtime on many supported Linux versions,
a mac or Windows. Get it at https://www.microsoft.com/net/download/core

Then use your text editor of choice, or something like visual studio code 
(another
free offering that supports multiple platforms), add the nuget package and hack
away on your platform of choice;).

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


Re: reactiveX vs Async

2017-01-11 Thread Rustom Mody
On Thursday, January 12, 2017 at 7:47:21 AM UTC+5:30, Joseph L. Casale wrote:
> > One more question: Do you know if (and how much) of these things would work
> > in Linux/C# (ie mono)?
> 
> Mono, I forgot what that is when .net core debuted:)

A brief elaboration on that please?? ∵ …
> 
> Looks like the .net Rx guys have a port, 
> https://github.com/Reactive-Extensions/Rx.NET/issues/148

All this makes little sense to me :-(
C# is a sweet language, in many small ways better than java
But Windows/.NET?? Hoo boy!
[Just an ol-nixer getting lost... No judgement really!]

> 
> A package for .net core is up on nuget.

So you are saying that nuget-ing .Net core would be a workable pre-requisite for
Rx on mono?
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue22343] Install bash activate script on Windows when using venv

2017-01-11 Thread Kevin Christopher Henry

Kevin Christopher Henry added the comment:

I can confirm that LF endings work fine on Cygwin, and it's hard to imagine any 
bash implementation not handling that properly.

--

___
Python tracker 

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



[issue29247] Document return value of epoll.poll

2017-01-11 Thread Nathaniel Smith

New submission from Nathaniel Smith:

The documentation for select.epoll.poll doesn't document the return value at 
all, which is somewhat important information :-)

I think it's a list of (fd, eventmask) tuples?

https://docs.python.org/3.7/library/select.html#select.epoll.poll

--
assignee: docs@python
components: Documentation
messages: 285285
nosy: docs@python, njs
priority: normal
severity: normal
status: open
title: Document return value of epoll.poll
versions: Python 2.7, 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



[issue29246] typing.Union raises RecursionError when comparing Union to other type

2017-01-11 Thread Jim Fasarakis-Hilliard

Changes by Jim Fasarakis-Hilliard :


--
type: crash -> behavior
versions:  -Python 2.7, Python 3.3, Python 3.4

___
Python tracker 

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



[issue11681] -b option undocumented

2017-01-11 Thread Nick Coghlan

Nick Coghlan added the comment:

Added some review comments on the patch. The only critical one was changing a 
:class:`bytes` reference to :class:`unicode`, but I also suggested it may be 
worth mentioning that it *doesn't* enable warnings about all binary/text 
comparisons the way the Python 3 one does.

--

___
Python tracker 

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



[issue11681] -b option undocumented

2017-01-11 Thread Nick Coghlan

Nick Coghlan added the comment:

Right, the lack of transitivity comes from the fact that:

>>> u"3" == str(3)
True

Is really shorthand for:

>>> u"3" == str(3).decode("ascii")
True

However, the implicit decoding only triggers for *exactly* bytes instances, so 
in the bytearray case it needs to be explicit:

>>> u"3" == bytearray(b"3").decode("ascii")
True

--

___
Python tracker 

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



[issue24875] pyvenv doesn´t install PIP inside a new venv with --system-site-package

2017-01-11 Thread Thomas Nyberg

Thomas Nyberg added the comment:

Hi Mark Haase,

I've gone through both of your patches and they both work for me as they 
should. I'm not sure why the first one isn't working for you, since it works 
for me. That one seems like it's solving the problem the "right" way. In any 
case, the second patch works for me as well so if that works for you, then at 
least we can confirm that it works for both your version of OSX and debian 8 
which I'm running.

To any other higher powers: is Mark's second patch acceptable?

--

___
Python tracker 

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



[issue29218] distutils: Remove unused install_misc class

2017-01-11 Thread Greg Ward

Greg Ward added the comment:

LGTM, after a cursory glance at the code history. Been a lng time since I 
understood this stuff deeply, though!

--

___
Python tracker 

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



RE: reactiveX vs Async

2017-01-11 Thread Joseph L. Casale
> One more question: Do you know if (and how much) of these things would work
> in Linux/C# (ie mono)?

Mono, I forgot what that is when .net core debuted:)

Looks like the .net Rx guys have a port, 
https://github.com/Reactive-Extensions/Rx.NET/issues/148

A package for .net core is up on nuget.

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


RE: reactiveX vs Async

2017-01-11 Thread Joseph L. Casale
> Thanks Joseph
> Trouble is there is stew of technologies/languages…
> (meta)-stewed with more abstract concepts, eg push vs pull, 
> Enumerable-Observable
> duality, continuous vs discrete time
> The last causing its own share of confusion with “functional reactive 
> programming” (FRP) meaning sometimes the one and sometimes the other:
> http://lambda-the-ultimate.org/node/4982

Heh,
Yeah I don't claim to be an expert, I have only just started using the syntax
in my own projects whereas I almost always used the classical thread model
with sync primitives and message passing.

> As for 'Overlook the “async/await can be used without significant buy-in” '
> I believe Ive seen people with considerable experience/understanding of the 
> area
> take the opposite view, usually along the lines: “Once you start going 
> non-blocking,
> you have to non-block all the way”

Right, as I mentioned overlook the pedantic argument just for the concept.
While you *can* do as I mentioned rather easily, it's not a useful or scalable
approach. Their suggestion is correct in reality but I only mentioned the 
minimal
buy-in it to illustrate that existing code *could* adopt the pattern trivially
whereas Rx is not simply two keywords, it's an entire framework.

Ultimately they accomplish the same thing, that is asynchronous execution
but use two different patterns. I'll paraphrase another source: "Rx adds a
convenient way to add callbacks and manage execution." The async/await
pattern is closer to the metal, it's not dealing with a sequence of observable
objects, it is however manipulating execution of the explicit block of code 
where
its applied.

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


Re: Cannot import GDAL

2017-01-11 Thread Terry Reedy

On 1/11/2017 12:31 PM, Falter, Donald [USA] wrote:

I am new to Python and I am trying to utilize GDAL.  I installed Python 3.6.  
The version I get when I activate IDLE is: MSC v.1900 32 bit (Intel)] on win32. 
 In downloading the GDAL bindings the latest version I can find is 
release-1800-gdal-2-1-2-mapserver-7-0-2 so I installed the following: 
gdal-201-1800-core.msi and GDAL-2.1.2.win32-py3.4.msi.

I added C:\Program Files\GDAL to my path and added the system variables 
GDAL_DATA = C:\Program Files\GDAL\gdal-data and\
GDAL_DRIVER_PATH = C:\Program Files\GDAL\gdalplugins

When I open IDLE and type the following: from osgeo import gdal I get the 
following error


IDLE does not normally cause imports to fail (though it often get 
blamed), but one can check by running, in this case, 3.6, from the 
Windows console (ie, Command Prompt) and trying the same import statement.



from osgeo import gdal

Traceback (most recent call last):
  File "", line 1, in 
from osgeo import gdal
ModuleNotFoundError: No module named 'osgeo'


Does C:\Program Files\GDAL contain a package 'osgeo' containing a module 
'gdal'?


I am not sure if the version mismatch pointed out by others would cause 
that particular error.  If replacing the 3.4 package with a 3.6 package 
fixes your problem completely, please let us know.


--
Terry Jan Reedy

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


Re: Cannot import GDAL

2017-01-11 Thread Terry Reedy

On 1/11/2017 5:06 PM, Fabien wrote:

On 01/11/2017 10:59 PM, Fabien wrote:

I would strongly recommend to use conda
(http://conda.pydata.org/miniconda.html) for managing your packages and
environments, and then use the conda-forge channel
(https://conda-forge.github.io/) to install gdal:

conda install -c conda-forge gdal



I forgot to mention that since py3.6 is quite recent, most packages
still don't have binaries ready for it. Staying with py3.5 is a better
idea for now.


http://www.lfd.uci.edu/~gohlke/pythonlibs/
has 32 and 64 bit 3.6 binaries for over 200 packages, including GDAL 2.1.2.


--
Terry Jan Reedy

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


Re: reactiveX vs Async

2017-01-11 Thread Rustom Mody
On Thursday, January 12, 2017 at 6:50:09 AM UTC+5:30, Joseph L. Casale wrote:
> However, I have only used the .NET implementations.

One more question: Do you know if (and how much) of these things would work
in Linux/C# (ie mono)?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: reactiveX vs Async

2017-01-11 Thread Rustom Mody
On Thursday, January 12, 2017 at 6:50:09 AM UTC+5:30, Joseph L. Casale wrote:
> >> There is the recent flurry around the new async additions to python
> >
> > I meant to add: “… which I dont pretend to understand…”
> 
> Try these links on for size:
> 
> https://msdn.microsoft.com/en-us/library/hh242982(v=vs.103).aspx which links 
> to
> https://msdn.microsoft.com/en-us/library/hh242983(v=vs.103).aspx near the end.
> 
> That summarizes the conceptual difference pretty well imho. It's also 
> summarized on
> the .NET versions GitHub page: 
> https://github.com/Reactive-Extensions/Rx.NET#a-brief-intro
> 
> I think you can summarize RX as a framework whereas async/await can be used 
> without
> significant buy-in (Overlook the "async top down or none at all" best 
> practice sound bite).
> That is, you can artificially convert a synchronous method into a threaded 
> operation and
> have it executely asynchronously while you do something else and wait on it 
> for completion
> at somne other time.
> 
> However, I have only used the .NET implementations.
> 
> jlc

Thanks Joseph
Trouble is there is stew of technologies/languages…
(meta)-stewed with more abstract concepts, eg push vs pull, 
Enumerable-Observable
duality, continuous vs discrete time
The last causing its own share of confusion with “functional reactive 
programming” (FRP) meaning sometimes the one and sometimes the other:
http://lambda-the-ultimate.org/node/4982

As for 'Overlook the “async/await can be used without significant buy-in” '
I believe Ive seen people with considerable experience/understanding of the area
take the opposite view, usually along the lines: “Once you start going 
non-blocking,
you have to non-block all the way”
-- 
https://mail.python.org/mailman/listinfo/python-list


RE: reactiveX vs Async

2017-01-11 Thread Joseph L. Casale
>> There is the recent flurry around the new async additions to python
>
> I meant to add: “… which I dont pretend to understand…”

Try these links on for size:

https://msdn.microsoft.com/en-us/library/hh242982(v=vs.103).aspx which links to
https://msdn.microsoft.com/en-us/library/hh242983(v=vs.103).aspx near the end.

That summarizes the conceptual difference pretty well imho. It's also 
summarized on
the .NET versions GitHub page: 
https://github.com/Reactive-Extensions/Rx.NET#a-brief-intro

I think you can summarize RX as a framework whereas async/await can be used 
without
significant buy-in (Overlook the "async top down or none at all" best practice 
sound bite).
That is, you can artificially convert a synchronous method into a threaded 
operation and
have it executely asynchronously while you do something else and wait on it for 
completion
at somne other time.

However, I have only used the .NET implementations.

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


RE: reactiveX vs Async

2017-01-11 Thread Joseph L. Casale
> Try these links on for size:
>
> https://msdn.microsoft.com/en-us/library/hh242982(v=vs.103).aspx which links 
> to
> https://msdn.microsoft.com/en-us/library/hh242983(v=vs.103).aspx near the end.

These two SO threads have a variation of pretty good explanations:

http://stackoverflow.com/questions/2550763/good-example-of-reactive-extensions-use
http://stackoverflow.com/questions/1596158/good-introduction-to-the-net-reactive-framework


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


[issue29240] Implementation of the PEP 540: Add a new UTF-8 mode

2017-01-11 Thread INADA Naoki

INADA Naoki added the comment:

> Hum, pep540-3.patch doesn't work if the locale encoding is different than 
> ASCII and UTF-8. argv must be reencoded:

I want to skip reencoding.
On UTF-8 mode, arbitrary bytes in cmdline (e.g. broken filename passed by xarg) 
should be able to roundtrip by UTF-8/surrogateescape.

I don't trust wcstombs/mbstowcs.  It may not guarantee round tripping of 
arbitrary bytes.

Can -X utf8 option be processed before Py_Main()?

--

___
Python tracker 

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



[issue29246] typing.Union raises RecursionError when comparing Union to other type

2017-01-11 Thread Spiro Sideris

New submission from Spiro Sideris:

The typing.Union module raises a RecursionError when comparing a Union with no 
additional tree_args to a type that is not a Union.

An example of the stack trace with the added test looks like the following:

0:00:00 [1/1] test_typing
test test_typing failed -- Traceback (most recent call last):
  File "/Users/spiro/Development/open_source/cpython/Lib/test/test_typing.py", 
line 221, in test_union_compare_other
self.assertNotEqual(Union, object)
  File "/Users/spiro/Development/open_source/cpython/Lib/unittest/case.py", 
line 827, in assertNotEqual
if not first != second:
  File "/Users/spiro/Development/open_source/cpython/Lib/typing.py", line 760, 
in __eq__
return self._subs_tree() == other#return self._subs_tree() is not self and 
self._subs_tree() == other
  File "/Users/spiro/Development/open_source/cpython/Lib/typing.py", line 760, 
in __eq__
return self._subs_tree() == other#return self._subs_tree() is not self and 
self._subs_tree() == other
  File "/Users/spiro/Development/open_source/cpython/Lib/typing.py", line 760, 
in __eq__
return self._subs_tree() == other#return self._subs_tree() is not self and 
self._subs_tree() == other
  [Previous line repeated 233 more times]
  File "/Users/spiro/Development/open_source/cpython/Lib/typing.py", line 759, 
in __eq__
if not isinstance(other, _Union):
RecursionError: maximum recursion depth exceeded in __instancecheck__

test_typing failed

1 test failed:
test_typing

Total duration: 316 ms
Tests result: FAILURE

The test compares a Union with no tree_args to another type.

--
components: Library (Lib)
files: spirowork.patch
keywords: patch
messages: 285279
nosy: spiside
priority: normal
severity: normal
status: open
title: typing.Union raises RecursionError when comparing Union to other type
type: crash
versions: Python 2.7, Python 3.3, Python 3.4, Python 3.5, Python 3.6, Python 3.7
Added file: http://bugs.python.org/file46264/spirowork.patch

___
Python tracker 

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



[issue29240] Implementation of the PEP 540: Add a new UTF-8 mode

2017-01-11 Thread STINNER Victor

STINNER Victor added the comment:

I only tested the the PEP 540 implementation on Linux.

The PEP and its implementation should adjusted for Windows, especially 
Windows-only env vars like PYTHONLEGACYWINDOWSFSENCODING.

Changes are maybe also needed for Mac OS X and Android, which always use UTF-8. 
Currently, the locale encoding is still used on these platforms (ex: by 
open()). Is it possible to a locale encoding different than UTF-8 on Android 
for example?

--

___
Python tracker 

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



[issue29240] Implementation of the PEP 540: Add a new UTF-8 mode

2017-01-11 Thread STINNER Victor

STINNER Victor added the comment:

Hum, pep540-3.patch doesn't work if the locale encoding is different than ASCII 
and UTF-8. argv must be reencoded:

$ LC_ALL=fr_FR ./python -X utf8 -c 'import sys; print(ascii(sys.argv))' $(echo 
-ne "\xff")
['-c', '\xff']

The result should not depend on the locale, it should be the same than:

$ LC_ALL=fr_FR.utf8 ./python -X utf8 -c 'import sys; print(ascii(sys.argv))' 
$(echo -ne "\xff")
['-c', '\udcff']

$ LC_ALL=C ./python -X utf8 -c 'import sys; print(ascii(sys.argv))' $(echo -ne 
"\xff")
['-c', '\udcff']

--

___
Python tracker 

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



RE: Using namedtuples field names for column indices in a list of lists

2017-01-11 Thread Deborah Swanson
Steven D'Aprano wrote, on January 10, 2017 6:19 PM
> 
> On Tuesday 10 January 2017 18:14, Deborah Swanson wrote:
> 
> > I'm guessing that you (and those who see things like you do) might 
> > not be used to working with quick learners who make mistakes at 
> > first but catch up with them real fast, or you're very judgemental 
> > about people who make mistakes, period. I certainly don't care if 
> > you want to judge me, you're entitled to your opinion.
> 
> Be fair. We're not mind-readers, and we're trying to help you, not 
> attack you.

You aren't, and I've never seen you as attacking me, but there's a few
others here who have attacked me, and they weren't trying to help me
either. But it's only a very few people who've harrassed me, and the
person I was writing to above wasn't one of them. 

> It is true that we're often extremely pedantic. Sometimes annoyingly
> so, but on the other hand precision is important, especially in 
> technical fields. > There's a *huge* difference between a MTA and a 
> MUA, even though they differ only by one letter and both are related 
> to email.
>
> One of the techs I work with has the same habit of correcting me, and 
> when I'm invariably forced to agree that he is technical correct, he 
> replies "technical correctness is the best kind of correctness". 
> Annoying as it is to be on the receiving end, he is right: at least 
> half the time I learn something from his pedantry. (The other half of 
> the time, its a difference that makes no difference.)

I'm sorry you have to work with someone like that, he sounds perfectly
awful. (But that doesn't give you license to do the same. You're better
than that.)

> What are we supposed to do when somebody asks a question based on an
> obvious mistake? Assume that they're a quick learner who has probably 
> already worked out their mistake and doesn't need an answer? That 
> would certainly make our life easier: we can just ignore everybody's 
> questions.

No, of course not. My advice to people who want to help is to not assume
that you know what the question asker does and doesn't know, and just
answer the questions without obsessing about what they know. If that's
impossible because they have something so wrong that you don't know what
they're asking, that would be a good time to point it out and give them
a chance to correct it. 

> Sometimes people make errors of terminology that doesn't affect the 
> semantics of what they're asking:
> 
> "I have an array [1, 2, 3, 4] and I want to ..."
> 
> It's very likely that they have a list and they're merely using a term

> they're familiar with from another language, rather than the array 
> module.
> 
> But what are we supposed to make of mistakes that *do* affect the 
> semantics of the question:
> 
> "I have a dict of ints {1, 2, 3, 4} and want to sort the values by

> key so that I get [4, 2, 3, 1], how do I do that?"
> 
> How can we answer that without correcting their misuse of terminology
> and asking for clarification of what data structure they *actually* 
> have?
>
> We get questions like this very frequently. How would you answer it?

Well, I'd tell them how to reverse sort a dictionary, and point out that
what they've given isn't a dictionary because it doesn't have any keys,
and on this occasion I'd just give them an example of what a dictionary
looks like (as part of showing them how to reverse sort it) with its
keys, including the curly braces, and see what they come back with. They
pretty clearly mean a dictionary and not a list, since they said "dict",
used curly braces, and said they want to sort the values by key" in the
first clause of their sentence. So they're just a little confused and
maybe absent-mindedly slipping back into the more familiar list notation
and concepts, or they don't exactly know what a dictionary is. I
wouldn't belabor the point at this time, unless they keep coming back
with the same issues. That would be the time to belabor it, in my
opinion.  When some people are learning it's hard to keep all the new
things firmly in mind and not confuse them with more familiar things
they already know. But if they get it all straight in reasonably good
time, that should be ok. 

> Or:
> 
> "I have a list l = namedtuple('l', 'field1 field2') and can't 
> extract fields by index, l[0] doesn't work..."
> 
> Of course it doesn't work. How would you respond to that if you were
> in our place?
> 
> - ignore the question because the poster is ever so smart and will
have
>   worked it out by now?
> 
> - point out that l is not a list, or even a tuple, and of course l[0] 
>   doesn't work because l is actually a class?

I'd go with some variant of option 2, depending on how well I knew the
person asking. If the asker had just dropped in out of the blue and I
knew nothing about them I'd say something like "You can't because 'l'
isn't a list." Then I'd try to gauge how useful it would be to them to
know exactly what 'l' is, but most likely 

Re: Cannot import GDAL

2017-01-11 Thread Fabien

On 01/11/2017 10:59 PM, Fabien wrote:

I would strongly recommend to use conda
(http://conda.pydata.org/miniconda.html) for managing your packages and
environments, and then use the conda-forge channel
(https://conda-forge.github.io/) to install gdal:

conda install -c conda-forge gdal



I forgot to mention that since py3.6 is quite recent, most packages 
still don't have binaries ready for it. Staying with py3.5 is a better 
idea for now.



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


[issue29240] Implementation of the PEP 540: Add a new UTF-8 mode

2017-01-11 Thread STINNER Victor

STINNER Victor added the comment:

Oops, I introduced an obvious bug in my latest refactoring. It's now fixed in 
the patch version 3: pep540-3.patch.

--
Added file: http://bugs.python.org/file46263/pep540-3.patch

___
Python tracker 

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



[issue29240] Implementation of the PEP 540: Add a new UTF-8 mode

2017-01-11 Thread STINNER Victor

STINNER Victor added the comment:

pep540-2.patch: Patch version 2, updated to the latest version of the PEP 540. 
It has no more FIXME/TODO and has more unit tests. The main change is that the 
strict mode doesn't use strict anymore for OS data, but keeps surrogateescape. 
See the PEP for the rationale (especially the "Use the strict error handler for 
operating system data" alternative).

--
Added file: http://bugs.python.org/file46262/pep540-2.patch

___
Python tracker 

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



Re: Cannot import GDAL

2017-01-11 Thread Fabien

On 01/11/2017 06:31 PM, Falter, Donald [USA] wrote:

I am new to Python and I am trying to utilize GDAL


GDAL is notoriously difficult to install :-(

I would strongly recommend to use conda 
(http://conda.pydata.org/miniconda.html) for managing your packages and 
environments, and then use the conda-forge channel 
(https://conda-forge.github.io/) to install gdal:


conda install -c conda-forge gdal

Good luck!

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


Re: Cannot import GDAL

2017-01-11 Thread Irmen de Jong
On 11-1-2017 18:31, Falter, Donald [USA] wrote:
> I am new to Python and I am trying to utilize GDAL.  I installed Python 3.6.
> I installed the following: gdal-201-1800-core.msi and 
> GDAL-2.1.2.win32-py3.4.msi.

Those don't match. You'll have to use a MSI built for py3.6, one thinks.

Either install and use Python 3.4 with this (rather than 3.6) or find the 
approprite
installer for python 3.6. It seems that you can get one here:
http://www.lfd.uci.edu/~gohlke/pythonlibs/#gdal


Irmen

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


[issue29057] Compiler failure on Mac OS X - sys/random.h

2017-01-11 Thread George King

George King added the comment:

I reinstalled the command line tools by downloading from 
developer.apple.com/download/more and the problem went away. No idea how they 
broke; I had previously installed the same version. In any case, sorry for the 
noise.

--

___
Python tracker 

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



[issue6331] Add unicode script info to the unicode database

2017-01-11 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy:  -pitrou

___
Python tracker 

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



[issue23407] os.walk always follows Windows junctions

2017-01-11 Thread Eric Fahlgren

Eric Fahlgren added the comment:

> # Junctions are not recognized as links.
> self.assertFalse(os.path.islink(self.junction))

If the above comment is intended as a statement of fact, then it's inconsistent 
with the implementation of Py_DeleteFileW ( 
https://hg.python.org/cpython/file/v3.6.0/Modules/posixmodule.c#l4178 ).

--
nosy: +eric.fahlgren

___
Python tracker 

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



[issue11681] -b option undocumented

2017-01-11 Thread Greg Bengeult

Greg Bengeult added the comment:

I have attached a patch for 2.7 that adds -b and -bb to the command line 
documentation in Modules/main.c and Doc/library/cmdline.rst, following the 
suggested text provided by Martin.

Interestingly, unicode(), bytearray(), and str() don't seem to be transitive in 
2.7.

>>> u"3" == str(3)
True

>>> str(3) == bytearray("3")
True

>>> u"3" == bytearray("3")
False

--
nosy: +gbengeult
Added file: http://bugs.python.org/file46261/b_option.patch

___
Python tracker 

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



[issue27603] Migrate IDLE context menu items to shell extension

2017-01-11 Thread Shane Smith

Shane Smith added the comment:

Since you're a developer, I'm sure you need a lot of versions installed so you 
can check for backwards combatibility (spelling intentional).  But until 
recently, only the most recent IDLE was in the context menu, so I'm guessing 
your workflow for that checking doesn't depend on the context menu.  (I liked 
the old way, BTW, but I can see how someone might not).

But so long as you're doing it the current way, it remains easily hacked back 
to the way I like it, so I don't have a whole lot to complain about.  Carry on, 
good sir.

--

___
Python tracker 

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



[issue6331] Add unicode script info to the unicode database

2017-01-11 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
versions: +Python 3.7 -Python 3.6

___
Python tracker 

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



[issue16684] Unicode property value abbreviated names and long names

2017-01-11 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
versions: +Python 3.7 -Python 3.4

___
Python tracker 

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



[issue16684] Unicode property value abbreviated names and long names

2017-01-11 Thread Pander

Pander added the comment:

Any updates or ideas on how to move this forward? Meanwhile, should the issue 
relate to version 3.6? Thanks. Ah, see also https://bugs.python.org/issue6331 
please

--

___
Python tracker 

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



[issue6331] Add unicode script info to the unicode database

2017-01-11 Thread Pander

Pander added the comment:

Any updates or ideas on how to move this forward? See also 
https://bugs.python.org/issue16684 Thanks.

--

___
Python tracker 

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



Re: Work between multiple processes

2017-01-11 Thread Irmen de Jong
On 10-1-2017 23:57, Patrick Zhou wrote:
> Hi Irmen,
> 
> I have successfully got it to work with both side as python but so far having 
> trouble with pyrolite.jar which is downloaded from 
> https://mvnrepository.com/artifact/net.razorvine/pyrolite/4.4
> 
> 

[...]

> 
> which "getDst" works on Java but hangs on handshake() in the call function. 
> 
> Any thought? Thanks. -P
> 

Yeah, don't use the oldest version of the library available, use the newest ;-)
https://mvnrepository.com/artifact/net.razorvine/pyrolite/4.15


Irmen

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


[issue29245] Can't write to NamedTemporaryFile

2017-01-11 Thread R. David Murray

R. David Murray added the comment:

Yes, it is intended behavior, and it is documented.  The default mode for 
NamedTemporaryFile (and TemporaryFile) is shown in the docs as "w+b".

I suppose that used to be more convenient in python2 where there was almost no 
distinction between binary and text on unix, but I think we are unlikely to 
change the default at this point.

--
nosy: +r.david.murray
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



[issue29231] Broken MSIs in Python 3.5+

2017-01-11 Thread KeyWeeUsr

KeyWeeUsr added the comment:

> Ah, you're using the full installer, which has the non-debug versions 
> embedded and therefore does not ever need to download them.

Hm, makes sense now, however, isn't that a bug? I mean, even if it's embeded... 
I'm just curious ^^

> If you start from the web installer...

Aha, there's my problem! After using the web installer everything seems ok for 
me. Python now runs happily!

RE the unsupported: yeah, I kind of ignored that intentionally. Don't get me 
wrong, but the functionality you so badly want to push away is a wonderful 
thing. Ok, there's venv, I'm mostly satisfied with that or system-wide 
interpreter, but there are cases when you have to debug some annoying problems 
and you might broke the installation before thus a hypotetical issue arises. 
Maybe you deleted a file unintentionally, put a header for compilation here or 
there, renamed something...

What is the first thing someone asks you on for example IRC? "Have you tried a 
fresh Python installation?" Uhm, sure, because it's so easy if the installer 
throws things everywhere it can (registry, p, ...).

That's mostly not an issue, simple "Repair" is enough unless... you have a 
large build environment and reinstalling the environment from scratch could 
take a **long** while depending on the complexity of the environment. How do 
you test a fresh installation then? <-- Really, that's a serious question. I 
could come only with this before, though nuget coule be usable too ^^

Also, the network installer is almost the same thing as common MSI, but without 
elevation. It's like ~500kB or something and does basically this - adds keys to 
registry, to p, etc with a folder that you choose for installing via the 
network installer afaik. I just skip the part that makes Python unportable or 
burned into the system. What I do is basically what you do after compilation. 
Take binaries and put them somewhere, so that they run, nothing less, nothing 
more.

Thanks for your help, guys :)

--
resolution: not a bug -> works for me

___
Python tracker 

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



[issue29245] Can't write to NamedTemporaryFile

2017-01-11 Thread Kevin Bonham

New submission from Kevin Bonham:

Python 3.6.0 (default, Dec 24 2016, 08:01:42) 
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from tempfile import NamedTemporaryFile
>>> tmp = NamedTemporaryFile()
>>> tmp.write("hello world!")
Traceback (most recent call last):
  File "", line 1, in 
  File 
"/usr/local/Cellar/python3/3.6.0/Frameworks/Python.framework/Versions/3.6/lib/python3.6/tempfile.py",
 line 483, in func_wrapper
return func(*args, **kwargs)
TypeError: a bytes-like object is required, not 'str'
>>> type(tmp)


The more verbose error points to issue #18879 
(http://bugs.python.org/issue18879), which seems very similar to my problem, 
but is marked as resolved.

---
TypeError Traceback (most recent call last)
 in ()
> 1 tmp_file.write("blah")

/usr/local/Cellar/python3/3.6.0/Frameworks/Python.framework/Versions/3.6/lib/python3.6/tempfile.py
 in func_wrapper(*args, **kwargs)
481 @_functools.wraps(func)
482 def func_wrapper(*args, **kwargs):
--> 483 return func(*args, **kwargs)
484 # Avoid closing the file as long as the wrapper is alive,
485 # see issue #18879.

TypeError: a bytes-like object is required, not 'str'

This also seems like it might be related to http://bugs.python.org/issue28867, 
though I'm getting the same behavior with TemporaryFile:

>>> from tempfile import TemporaryFile
>>> tmp2 = TemporaryFile()
>>> tmp2.write("Hello World")
Traceback (most recent call last):
  File "", line 1, in 
TypeError: a bytes-like object is required, not 'str'


I can do:

>>> with open(tmp.name, "w") as t:
... t.write("Hello world!")


Is this intended behavior? The docs still say that these functions should 
return file-like objects.

--
components: Library (Lib)
messages: 285266
nosy: Kevin Bonham
priority: normal
severity: normal
status: open
title: Can't write to NamedTemporaryFile
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



[issue29057] Compiler failure on Mac OS X - sys/random.h

2017-01-11 Thread Ned Deily

Ned Deily added the comment:

Sorry, George, but I'm unable to reproduce the failure you observe following 
your recipe.  The only thing I can suggest off the top of my head is that you 
might have out-of-date system header files installed in /usr/include.  Those 
files are installed with:

sudo xcode-select --install

They don't get installed or updated by just installing Xcode itself.  See if 
that helps.

--

___
Python tracker 

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



[issue29231] Broken MSIs in Python 3.5+

2017-01-11 Thread Paul Moore

Paul Moore added the comment:

> Fully usable, portable

*and unsupported* - you apparently ignored that point from Steve's comment

> and working Python interpreter

That's (essentially) pure luck. I don't think I've ever seen any
suggestion that the /a flag for *any* MSI installer (Python or
otherwise) will produce a working install - it's designed (and
documented by Microsoft) as being to allow system admins to unpack the
MSI onto a network share from where it can be installed onto user
machines (for details see
https://msdn.microsoft.com/en-us/library/windows/desktop/aa367541(v=vs.85).aspx).

--

___
Python tracker 

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



[issue29231] Broken MSIs in Python 3.5+

2017-01-11 Thread Steve Dower

Steve Dower added the comment:

Ah, you're using the full installer, which has the non-debug versions embedded 
and therefore does not ever need to download them.

If you start from the web installer, it will download the MSIs for the 
non-debug components as well. But as I said, you're in totally unsupported 
territory by not running the proper installer. See if the nuget packages are 
more helpful.

--

___
Python tracker 

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



[issue29231] Broken MSIs in Python 3.5+

2017-01-11 Thread KeyWeeUsr

KeyWeeUsr added the comment:

python-3.5.2.exe /layout 

11.01.2017  19:30  .
11.01.2017  19:30  ..
11.01.2017  19:30 3 035 136 core_d.msi
11.01.2017  19:30 2 240 512 core_pdb.msi
11.01.2017  19:3098 304 dev_d.msi
11.01.2017  19:30   110 592 exe_d.msi
11.01.2017  19:30   102 400 exe_pdb.msi
11.01.2017  19:30 5 378 048 lib_d.msi
11.01.2017  19:30 4 820 992 lib_pdb.msi
29.10.2016  11:1329 269 656 python-3.5.2.exe
11.01.2017  19:30 1 179 648 tcltk_d.msi
11.01.2017  19:30   139 264 tcltk_pdb.msi
11.01.2017  19:30   331 776 test_d.msi
11.01.2017  19:30   286 720 test_pdb.msi
  12 File(s) 46 993 048 bytes
   2 Dir(s)   1 245 736 960 bytes free
---
msiexec /a exe_d.msi targetdir=%cd%\

Msiexec window has title "Python 3.5.2 Executables (32-bit debug)" and the 
targetdir contains:

11.01.2017  19:36  .
11.01.2017  19:36  ..
25.06.2016  21:5751 712 pythonw_d.exe
25.06.2016  21:57   364 544 pythonw_d.pdb
25.06.2016  21:5751 712 python_d.exe
25.06.2016  21:57   364 544 python_d.pdb
   4 File(s)832 512 bytes
   2 Dir(s)   1 264 963 584 bytes free

Notice, that everywhere is "_d" I talk about so much.

> ...and puts them in a location where they will be used later without 
> redownloading...

Yes, in a state that only the EXE installer is able to use them.

> *hypothetical*

msiexec /a python-2.7.13.msi targetdir=%cd%\

11.01.2017  19:45  .
11.01.2017  19:45  ..
11.01.2017  19:45  DLLs
11.01.2017  19:45  Doc
11.01.2017  19:45  include
11.01.2017  19:45  Lib
11.01.2017  19:45  libs
17.12.2016  20:4938 591 LICENSE.txt
17.12.2016  20:34   474 595 NEWS.txt
11.01.2017  19:45   835 584 python-2.7.13.msi
17.12.2016  20:4427 136 python.exe
17.12.2016  20:43 2 639 872 python27.dll
17.12.2016  20:4427 648 pythonw.exe
03.12.2016  21:0156 938 README.txt
11.01.2017  19:45  tcl
11.01.2017  19:45  Tools
17.12.2016  20:44   111 104 w9xpopen.exe
   8 File(s)  4 211 468 bytes
   9 Dir(s)   1 162 199 040 bytes free

Fully usable, portable and working Python interpreter for Python installers 
<3.5.0 without a single beep about admin rights (kivy, numpy, scipy, cython, 
mingwpy, etc.). With some workaround probably even usable for ALLUSERS=1, but 
I'm not going to try that on my system.

How is Debug installer not an issue/bug in a Python Release? Am I missing 
something or is it ok to unpack Debug installers from an official installer and 
not the actually used ones, the ones that produce Release that works?

--

___
Python tracker 

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



[issue29244] Python 3.6 unnecessarily requires inttypes.h

2017-01-11 Thread rdb

rdb added the comment:

As far as I know, there should not be any ABI issues.  We've been building 
extension modules with non-matching MSVC versions for years without issues.

I find it hard to think of downsides to such a trivial fix.  It is somewhat 
frustrating that we will have to resort to shipping custom Python versions with 
patched headers.  Some people are constrained to older MSVC versions for 
reasons not in their control.

--

___
Python tracker 

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



[issue29244] Python 3.6 unnecessarily requires inttypes.h

2017-01-11 Thread Brett Cannon

Brett Cannon added the comment:

Everything Zach said is accurate, so closing as "wont fix".

--
nosy: +brett.cannon
resolution:  -> wont fix
status: open -> closed

___
Python tracker 

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



[issue29243] --enable-optimizations makes common build commands always need to compile from scratch

2017-01-11 Thread Brett Cannon

Brett Cannon added the comment:

Since optimizations uses PGO which should do a fresh run, that's why there's 
the clearing of the state.

I'm personally not bothered by it as you really should only being doing an 
optimized build once when you do the first install and then you're done. But if 
or anyone else can come up with a way to not clear out the results while not 
accidentally using stale PGO-collected stats or builds then I don't see why we 
can't speed it up.

--
nosy: +brett.cannon
type:  -> enhancement

___
Python tracker 

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



[issue29244] Python 3.6 unnecessarily requires inttypes.h

2017-01-11 Thread Zachary Ware

Zachary Ware added the comment:

VS 2010 is not a supported compiler version for 3.6 (or 3.5) and VS 2012 is not 
a supported compiler for any version of Python. Extension modules built by 
those versions for use with Python 3.6 as supplied by python.org will only work 
in very particular circumstances which cannot be relied upon. Furthermore, VS 
2015 community edition is free (as in beer) and perfectly suitable for building 
both Python and extension modules.

I'd recommend closing as won't fix, but if another committer feels strongly 
enough about it I'll defer to them.

--
nosy: +zach.ware

___
Python tracker 

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



[issue27603] Migrate IDLE context menu items to shell extension

2017-01-11 Thread Steve Dower

Steve Dower added the comment:

The last time I saw collected data on usage (based on Visual Studio users), 
there was no clear majority of "number of interpreter versions", but 3 was the 
most common (2 and 4 were roughly equal, 5 and 6 were more popular than 1).

The nesting also makes it considerably simpler for the installer to handle, 
since there are totally independent components contributing to the file 
association. This is very difficult to achieve in a reliable way (wrt 
upgrades/downgrades/uninstalls/repairs/order-of-install/etc.), and having the 
context menu here is the best balance of reliability, usability and ease of 
implementation.

Using the shell extension to generate the menu would also work well, as that is 
part of the launcher and independent of any particular Python installer. It can 
also automatically un-nest the menu when it's going to be short enough, or show 
the latest version at the top and nest all others. Ultimately though, 
implementing that requires somebody's time, and until somebody is motivated 
enough to do the work, it won't happen.

So your suggestion is valid, it just isn't motivating enough for me to make the 
change. That doesn't mean someone else can't do it, and from a personal level I 
will oppose a straight un-nesting (as I'm one of the outliers who has 20+ 
copies of Python installed on my machines :) ), but I'm totally in favour of a 
well implemented shell extension to make it more complete and easier to use.

--

___
Python tracker 

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



[issue29231] Broken MSIs in Python 3.5+

2017-01-11 Thread Steve Dower

Steve Dower added the comment:

"msiexec /a" does not install anything - it converts the MSI into a source 
layout for lazy network installs. It is, and always has been, completely 
unsupported as an approach to installing Python, and we are under no obligation 
to maintain it.

Copy-pasting the install folder after installation is also unsupported. We 
obviously can't stop you doing it, and at times it is the best way to achieve 
certain things, but it is not supported and we do not have to make it work 
better.

The /layout command is intended for full offline installs: it downloads all 
optional packages without evaluating any conditions and puts them in a location 
where they will be used later without redownloading.

You've always been able to use only a single micro version of Python at a time 
when installing it. That has not changed (and will not, as it's by design). We 
have added new package formats that do not install the full development kit, 
and it sounds like the nuget packages (a.k.a. zip files by a different name) 
are perfect for you.

I have no idea what the "-d" suffix is, unless you mean the "_d.msi" modules 
which contain different files from the non-"_d" versions. The internals of the 
installer are just that - internals - but FYI there are typically 3 installers 
for each component. For example, "exe.msi" contains the files related to 
launching an interactive shell (including licenses, shortcuts, and icons); 
"exe_pdb.msi" contains the PDB files associated with files in exe.msi; 
"exe_d.msi" contains a debug build for those who are debugging native 
extensions and want consistent build settings between Python and their 
extension.

Your criticism of the *hypothetical* single MSI installer doesn't make any 
sense, since that installer does not exist. I included those points to show 
what restrictions would be necessary to avoid any such single MSI installer 
breaking users who would prefer to use the EXE installer.

There is no bug here, so I'm closing the issue.

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



[issue29244] Python 3.6 unnecessarily requires inttypes.h

2017-01-11 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
components: +Build -Extension Modules
nosy: +benjamin.peterson
type:  -> compile error
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



[issue22343] Install bash activate script on Windows when using venv

2017-01-11 Thread Vinay Sajip

Vinay Sajip added the comment:

If we do this, the activate script will have LF (POSIX) line endings on 
Windows. Will this work for things like cygwin, Git-bash etc?

--

___
Python tracker 

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



[issue20804] Sentinels identity lost when pickled (unittest.mock)

2017-01-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Thank you for your review Michael.

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



[issue29213] python -m venv activate.bat has weird mix of line endings

2017-01-11 Thread Vinay Sajip

Vinay Sajip added the comment:

Although we don't currently have binaries under venv/scripts, that might change 
in the future. The logic could be changed to:

with open(srcfile, 'rb') as f:
data = f.read()
if not srcfile.endswith('.exe'):
try:
data = data.decode('utf-8')
data = self.replace_variables(data, context)
data = data.encode('utf-8')
except UnicodeError as e:
data = None
logger.warning('unable to copy script %r, '
   'may be binary: %s', srcfile, e)
if data is not None:
with open(dstfile, 'wb') as f:
f.write(data)
shutil.copymode(srcfile, dstfile)

All the files in the nt subdirectory have CRLF endings, and the above should 
preserve them (whatever they are).

--

___
Python tracker 

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



[issue20804] Sentinels identity lost when pickled (unittest.mock)

2017-01-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 398b73dbb1a0 by Serhiy Storchaka in branch '3.5':
Issue #20804: Document the limitation of the unittest.mock.sentinel attributes.
https://hg.python.org/cpython/rev/398b73dbb1a0

--

___
Python tracker 

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



[issue20804] Sentinels identity lost when pickled (unittest.mock)

2017-01-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 98f061402fcf by Serhiy Storchaka in branch 'default':
Issue #20804: The unittest.mock.sentinel attributes now preserve their
https://hg.python.org/cpython/rev/98f061402fcf

--
nosy: +python-dev

___
Python tracker 

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



[issue29244] Python 3.6 unnecessarily requires inttypes.h

2017-01-11 Thread rdb

New submission from rdb:

Python 3.6 now requires inttypes.h on all platforms.  However, this is not 
provided by MSVC 2010 and 2012, which is still used by some people who build 
extension modules for Python.

MSVC 2010 does provide stdint.h, and replacing the inttypes.h include with an 
include to stdint.h seems to work fine.

I would suggest a fix along the lines of this:

#if defined(_MSC_VER) && _MSC_VER < 1800
#include 
#else
#include 
#endif

Alternatively, the HAVE_INTTYPES_H definition could be used to fall back to 
stdint.h, and it could be undefined for the MSVC build.

--
components: Extension Modules
messages: 285250
nosy: rdb
priority: normal
severity: normal
status: open
title: Python 3.6 unnecessarily requires inttypes.h
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



[issue20804] Sentinels identity lost when pickled (unittest.mock)

2017-01-11 Thread Michael Foord

Michael Foord added the comment:

LGTM Serhiy - thank you for your work. Appreciated.

--

___
Python tracker 

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



[issue29220] Python 3.6 regression/change using logging.addLevelName() to clear a name

2017-01-11 Thread Vinay Sajip

Changes by Vinay Sajip :


--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue29220] Python 3.6 regression/change using logging.addLevelName() to clear a name

2017-01-11 Thread Roundup Robot

Roundup Robot added the comment:

New changeset adf8312f377f by Vinay Sajip in branch '3.5':
Issue #29220: Improved fix and test.
https://hg.python.org/cpython/rev/adf8312f377f

New changeset a76eed0baa0f by Vinay Sajip in branch 'default':
Issue #29220: Merged fixes from 3.6.
https://hg.python.org/cpython/rev/a76eed0baa0f

--

___
Python tracker 

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



Cannot import GDAL

2017-01-11 Thread Falter, Donald [USA]
I am new to Python and I am trying to utilize GDAL.  I installed Python 3.6.  
The version I get when I activate IDLE is: MSC v.1900 32 bit (Intel)] on win32. 
 In downloading the GDAL bindings the latest version I can find is 
release-1800-gdal-2-1-2-mapserver-7-0-2 so I installed the following: 
gdal-201-1800-core.msi and GDAL-2.1.2.win32-py3.4.msi.

I added C:\Program Files\GDAL to my path and added the system variables 
GDAL_DATA = C:\Program Files\GDAL\gdal-data and\
GDAL_DRIVER_PATH = C:\Program Files\GDAL\gdalplugins

When I open IDLE and type the following: from osgeo import gdal I get the 
following error

>>> from osgeo import gdal
Traceback (most recent call last):
  File "", line 1, in 
from osgeo import gdal
ModuleNotFoundError: No module named 'osgeo'
>>>

I have been all over the internet looking for answer but have found none that 
work.  Some real help here would be appreciated.

Thanks,
Don

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


[issue29231] Broken MSIs in Python 3.5+

2017-01-11 Thread KeyWeeUsr

KeyWeeUsr added the comment:

Re blog post "Why are there so many Python installers?"

> As a result, the old installer always requires administrative privileges just 
> in case you choose to install for all users. This prevents installation of 
> Python on machines where you do not have full control over the system.

So not true. Read the first command I used, that doesn't require any permission 
at all. I was able to install Python without any registry or P stuff at 
"Guest" account in an internet cafe where you couldn't even throw stuff to the 
Trash with the same MSI installer. Notice the "/a" switch, not "/i" (install).

Secondly, I'm glad for the change, but the installer is still in an imperfect 
shape - leaves traces. That makes you able to use only a single version (as 
mentioned before). Unless, of course, you don't want to copy the whole 
folder, which although works is also stupid and still requires at least one 
successful installation with traces in the system.

> Always requires administrator privileges <-- no
Only allows installation for all users <-- no
Only allows configuration at the command line (via msiexec) <-- not sure what 
the "configuration" means in this context
Prevents the executable installer from installing for all users <-- I didn't 
really use that, but... what? Seems weird. Have you tried with "/a ALLUSERS=1"? 
It should purge the elevation.

Anyway, this has nothing to do with the issue, because what I'm talking about 
are MSIs that are _extracted_ from the current EXE installer via "/layout" 
switch. There comes the problem - you can't install from those MSIs (not 
directly, but probably works with EXE as a casual python installation - I don't 
want that), because the MSIs are ***corrupted*** in some weird way, probably 
some debug command is called together with the "/layout" judging from the "-d" 
string in the filenames - useful only for debugging the inside of the MSIs, 
otherwise completely unusable. Please, just try to do what I wrote to see 
what's actually going on.

If there is any way how to fix the "/layout" to unpack correctly, ++ for the 
new installer. Otherwise, although the EXE has a lot of features I use for 
system-wide interpreter, I hate the change.

--

___
Python tracker 

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



[issue28759] access to mkfifo, mknod and hard links is controled by SELinux MAC on Android

2017-01-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I don't know what is a good name for such helper. supported_operation() looks 
too general. Maybe ask on Python-Dev?

--

___
Python tracker 

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



Re: Is there an peekable similar to peekable but in additional allowing one to put some data to it?

2017-01-11 Thread Ian Kelly
On Wed, Jan 11, 2017 at 10:07 AM, Ian Kelly  wrote:
> On Wed, Jan 11, 2017 at 8:51 AM, Peng Yu  wrote:
>> Hi, peekable from more-itertools only allow peeking an iterator. But
>> sometimes, one may want to take a look at an element, manipulate it,
>> then put it back to the iterator. Is there a class in python that can
>> help do this?
>
> Not that I'm aware of, but maybe this recipe will help.
>
>
> from collections import deque
>
> class PushIterator:
>
> def __init__(self, iterable, push=()):
> self._iter = iter(iterable)
> self._pushed = deque(push)
> self._stopped = False
>
> def push(self, item):
> if self._stopped:
> raise RuntimeError('Cannot push onto exhausted iterator')
> self._pushed.append(item)
>
> def __iter__(self):
> return self
>
> def __next__(self):
> if self._pushed:
> return self._pushed.pop()
> try:
> return next(self._iter)
> except StopIteration:
> self._stopped = True
> raise


And in case it's not obvious, adding a peek method to this is pretty simple:


from collections import deque

class PushIterator:

def __init__(self, iterable, push=()):
self._iter = iter(iterable)
self._pushed = deque(push)
self._stopped = False

def peek(self):
item = next(self)
self.push(item)
return item

def push(self, item):
if self._stopped:
raise RuntimeError('Cannot push onto exhausted iterator')
self._pushed.append(item)

def __iter__(self):
return self

def __next__(self):
if self._pushed:
return self._pushed.pop()
try:
return next(self._iter)
except StopIteration:
self._stopped = True
raise
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue29099] sqlite3 timestamp converter cannot handle timezone

2017-01-11 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

On 11.01.2017 17:04, Xiang Zhang wrote:
> I am not sure it's worth to make it even optional in 3.7. Discarding tzinfo 
> sounds weird, and worse, the behaviour is not deterministic, it could also 
> fail with an exception.

Best practice is to store all date/time values using UTC (or some
other fixed timezone) in databases and to manage the timezone/locale
information elsewhere.

The TZ info then becomes redundant and only results in more
database space being used as well as slower queries (due to the extra
TZ calculations being done; many databases internally store the
values as UTC to avoid having to do TZ calculations at query time).

Of course, there are use cases, where you'd still want to work
with TZ values in the database, so an extra converter for this
sounds like a good plan.

--

___
Python tracker 

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



Re: Is there an peekable similar to peekable but in additional allowing one to put some data to it?

2017-01-11 Thread Ian Kelly
On Wed, Jan 11, 2017 at 8:51 AM, Peng Yu  wrote:
> Hi, peekable from more-itertools only allow peeking an iterator. But
> sometimes, one may want to take a look at an element, manipulate it,
> then put it back to the iterator. Is there a class in python that can
> help do this?

Not that I'm aware of, but maybe this recipe will help.


from collections import deque

class PushIterator:

def __init__(self, iterable, push=()):
self._iter = iter(iterable)
self._pushed = deque(push)
self._stopped = False

def push(self, item):
if self._stopped:
raise RuntimeError('Cannot push onto exhausted iterator')
self._pushed.append(item)

def __iter__(self):
return self

def __next__(self):
if self._pushed:
return self._pushed.pop()
try:
return next(self._iter)
except StopIteration:
self._stopped = True
raise
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue29099] sqlite3 timestamp converter cannot handle timezone

2017-01-11 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


--
stage: commit review -> needs patch
type: behavior -> enhancement
versions:  -Python 3.5, Python 3.6

___
Python tracker 

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



[issue29099] sqlite3 timestamp converter cannot handle timezone

2017-01-11 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

On 11.01.2017 17:08, Serhiy Storchaka wrote:
> 
> The naive datetime converter is registered under the name "timestamp". The 
> aware datetime converter or the universal datetime converter (if it is 
> needed) can be registered under different names.

This sounds like a good idea.

Perhaps use "timestamptz" or something similar.

--

___
Python tracker 

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



[issue20804] Sentinels identity lost when pickled (unittest.mock)

2017-01-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Updated patch contains doc changes.

--
type: behavior -> enhancement
versions:  -Python 3.5, Python 3.6
Added file: http://bugs.python.org/file46260/mock_sentinel_pickle2.patch

___
Python tracker 

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



Re: reactiveX vs Async

2017-01-11 Thread Rustom Mody
On Wednesday, January 11, 2017 at 10:21:02 PM UTC+5:30, Rustom Mody wrote:
> There is the recent flurry around the new async additions to python

I meant to add: “… which I dont pretend to understand…”
-- 
https://mail.python.org/mailman/listinfo/python-list


reactiveX vs Async

2017-01-11 Thread Rustom Mody
There is the recent flurry around the new async additions to python

Also, addressing the same problem area, there is the slightly older reactiveX 
system that seems to have bindings for at least 15 mainstream languages… 
including python: http://reactivex.io/

Has someone been able to put these two in context? To relate one to the other?
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue27603] Migrate IDLE context menu items to shell extension

2017-01-11 Thread Shane Smith

Shane Smith added the comment:

I'm fine with a single implementation, so long as the implementation is what's 
best for the majority of users.  Not my intent to increase the burden of work.

So, let me ask the question alluded to in my first post: when is a nested menu 
actually desirable?  I would argue that the vast majority of users have one or 
two versions of Python installed at any given time.  And for that number, a 
flat menu is certainly preferred.

The X.Y version numbering in the context menu introduced as a result of 
issue23546 solves said issue.  I'm merely suggesting de-nesting the menu.

--

___
Python tracker 

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



[issue20804] Sentinels identity lost when pickled (unittest.mock)

2017-01-11 Thread Michael Foord

Michael Foord added the comment:

It's a new feature.

--

___
Python tracker 

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



[issue29231] Broken MSIs in Python 3.5+

2017-01-11 Thread Steve Dower

Steve Dower added the comment:

I discussed installers on my blog at http://stevedower.id.au a while back. 
There are some other options linked from there, and also rationale for why 
things are how they are.

--

___
Python tracker 

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



[issue20804] Sentinels identity lost when pickled (unittest.mock)

2017-01-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

sentinel-doc.patch documents the contrary behaviour -- not preserving an 
identity and equality.

I haven't included doc changes because I don't know how to treat this change. 
As a bug fix, as a new feature, or as a new feature backported to maintained 
releases? If this is a new feature, it needs an entry in Whant's New and a 
versionchanged directive in the module documentation. If this is a bug fix, it 
likely doesn't need any special documenting.

--

___
Python tracker 

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



[issue29241] sys._enablelegacywindowsfsencoding() don't apply to os.fsencode and os.fsdecode

2017-01-11 Thread Steve Dower

Steve Dower added the comment:

If you import os first then that's acceptable and we should document it more 
clearly. Try calling enable before importing os.

I wouldn't be surprised if os is imported automatically, in which case we need 
to figure out some alternate caching mechanism that can be reset by the enable 
call (or demonstrate that the caching is of no benefit).

--

___
Python tracker 

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



[issue27603] Migrate IDLE context menu items to shell extension

2017-01-11 Thread Steve Dower

Steve Dower added the comment:

More user choice here is actually an incredibly huge burden. Managing file 
associations across a range of versions, many of which can no longer be 
updated, is hard enough without offering options. Not to mention the extra user 
interface required.

Personally, I'd rather the options be third party installers or tools. There's 
nothing stopping someone making an idle "installer" that sets up context menus 
and default actions however it likes. It would probably break uninstall/upgrade 
scenarios for the core Python install, but at least it's not a burden on our 
(very few) volunteers to diagnose, fix and prevent.

If or when the shell extension takes over the context menu (currently blocked 
on someone volunteering to do the implementation and testing), it may be 
possible to have registry keys to change the behavior. But I wouldn't count on 
it being highly configurable - that's not the aim of the main distro.

--

___
Python tracker 

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



[issue29057] Compiler failure on Mac OS X - sys/random.h

2017-01-11 Thread George King

George King added the comment:

This is using the latest apple toolchain on latest macOS 10.12.2:

$ gcc --version
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr 
--with-gxx-include-dir=/usr/include/c++/4.2.1
Apple LLVM version 8.0.0 (clang-800.0.42.1)
Target: x86_64-apple-darwin16.3.0
Thread model: posix
InstalledDir: 
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

$ make --version
GNU Make 3.81
Copyright (C) 2006  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

This program built for i386-apple-darwin11.3.0

--

___
Python tracker 

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



[issue29057] Compiler failure on Mac OS X - sys/random.h

2017-01-11 Thread George King

George King added the comment:

Still seeing this problem. Here was my exact process:

$ git clone g...@github.com:python/cpython.git
$ cd cpython
$ git checkout 2.7
$ mkdir build
$ cd build
$ ../configure
$ make

In file included from ../Python/random.c:7:
/usr/include/sys/random.h:37:32: error: unknown type name 'u_int'

--

___
Python tracker 

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



[issue28231] zipfile does not support pathlib

2017-01-11 Thread Ethan Furman

Ethan Furman added the comment:

Any path/file attributes, etc, inside a ZipFile should be str.  ZipFile should 
also function properly if path/file requests are given as os.PathLike objects.

--

___
Python tracker 

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



[issue29240] Implementation of the PEP 540: Add a new UTF-8 mode

2017-01-11 Thread INADA Naoki

Changes by INADA Naoki :


--
nosy: +inada.naoki

___
Python tracker 

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



[issue29243] --enable-optimizations makes common build commands always need to compile from scratch

2017-01-11 Thread Xiang Zhang

New submission from Xiang Zhang:

In 3.6 we get --enable-optimizations. One thing I find annoyed with this flag 
is that it makes some build commands compile from scratch since it always 
clears the environment first. For example, with the commands listed at the top 
of Makefile:

./configure
make 
make test
make install

It compiles 3 times and considering the optimized build needs more time every 
time, it lasts long.

I am not sure this is a problem and feel free to close it.

--
components: Build
messages: 285233
nosy: xiang.zhang
priority: normal
severity: normal
status: open
title: --enable-optimizations makes common build commands always need to 
compile from scratch
versions: 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



[issue29099] sqlite3 timestamp converter cannot handle timezone

2017-01-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

The naive datetime converter is registered under the name "timestamp". The 
aware datetime converter or the universal datetime converter (if it is needed) 
can be registered under different names.

--

___
Python tracker 

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



[issue29099] sqlite3 timestamp converter cannot handle timezone

2017-01-11 Thread Xiang Zhang

Xiang Zhang added the comment:

I asked whether this should be treated as an enhancement or bug fix. Now with 
your concerns I think it fits as enhancement more.

> Is it possible to make the support optional for 3.5 and 3.6 and only enable 
> it for 3.7 (with the possibility of disabling it again) ?

How about just make it just into 3.7 and just document only naive datetime 
objects are supported in 3.5, 3.6 and 2.7.
I am not sure it's worth to make it even optional in 3.7. Discarding tzinfo 
sounds weird, and worse, the behaviour is not deterministic, it could also fail 
with an exception.

--

___
Python tracker 

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



Is there an peekable similar to peekable but in additional allowing one to put some data to it?

2017-01-11 Thread Peng Yu
Hi, peekable from more-itertools only allow peeking an iterator. But
sometimes, one may want to take a look at an element, manipulate it,
then put it back to the iterator. Is there a class in python that can
help do this?

https://pypi.python.org/pypi/more-itertools/

-- 
Regards,
Peng
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue29099] sqlite3 timestamp converter cannot handle timezone

2017-01-11 Thread Marc-Andre Lemburg

Marc-Andre Lemburg added the comment:

I don't think this can be considered a bug fix, since it changes behavior for 
applications that read data from SQLite databases which were not created by 
Python.

Those application may now see datetime values with tz infos and will likely not 
be prepared to handle all the problems associated with this.

Is it possible to make the support optional for 3.5 and 3.6 and only enable it 
for 3.7 (with the possibility of disabling it again) ?

--

___
Python tracker 

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



[issue29099] sqlite3 timestamp converter cannot handle timezone

2017-01-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

Agreed. And maybe raise more informative error for datetimes with a timezone.

I'm also not sure about 3.5 and 3.6. Datetimes with timezones were never 
supported. Currently all returned ditetime objects are naive. Getting an aware 
datetime can confuse applications.

--

___
Python tracker 

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



[issue29242] Crash on GC when compiling PyPy

2017-01-11 Thread Dingyuan Wang

New submission from Dingyuan Wang:

When compiling the PyPy default branch [1] on a Debian testing machine with 
Python 2.7.13, cpython randomly crashes.

(gdb) bt
#0  update_refs () at ../Modules/gcmodule.c:332
#1  collect.lto_priv () at ../Modules/gcmodule.c:924
#2  0x5562a804 in collect_generations () at ../Modules/gcmodule.c:1050
#3  _PyObject_GC_Malloc () at ../Modules/gcmodule.c:1511
#4  0x55640ef5 in PyType_GenericAlloc (nitems=0, type=0x55a9dd20 
<_PyExc_AttributeError>) at ../Objects/typeobject.c:781
#5  BaseException_new.lto_priv.68 () at ../Objects/exceptions.c:34
#6  0x55642093 in type_call.lto_priv () at ../Objects/typeobject.c:749
#7  0x5563c5f3 in PyObject_Call () at ../Objects/abstract.c:2547
#8  0x5565a490 in PyEval_CallObjectWithKeywords () at 
../Python/ceval.c:4221
#9  0x556695d0 in PyErr_NormalizeException () at ../Python/errors.c:192
#10 0x55656cad in PyEval_EvalFrameEx () at ../Python/ceval.c:3251
#11 0x5564e525 in PyEval_EvalCodeEx () at ../Python/ceval.c:3584
#12 0x5566ac2e in function_call.lto_priv () at 
../Objects/funcobject.c:523
#13 0x5563c5f3 in PyObject_Call () at ../Objects/abstract.c:2547
#14 0x5568102e in instancemethod_call.lto_priv () at 
../Objects/classobject.c:2602
#15 0x5563c5f3 in PyObject_Call () at ../Objects/abstract.c:2547
#16 0x556f333a in call_method.lto_priv () at 
../Objects/typeobject.c:1283
#17 0x5573eb8f in slot_tp_setattro.lto_priv () at 
../Objects/typeobject.c:5654
#18 0x556667e9 in PyObject_SetAttr () at ../Objects/object.c:1247
#19 0x55650ec3 in PyEval_EvalFrameEx () at ../Python/ceval.c:2253
#20 0x5564e525 in PyEval_EvalCodeEx () at ../Python/ceval.c:3584
#21 0x5566ac2e in function_call.lto_priv () at 
../Objects/funcobject.c:523
#22 0x5563c5f3 in PyObject_Call () at ../Objects/abstract.c:2547
#23 0x5568102e in instancemethod_call.lto_priv () at 
../Objects/classobject.c:2602
#24 0x5563c5f3 in PyObject_Call () at ../Objects/abstract.c:2547
#25 0x5565a4dd in PyEval_CallObjectWithKeywords () at 
../Python/ceval.c:4221
#26 0x556f3e31 in slot_tp_hash.lto_priv () at 
../Objects/typeobject.c:5506
#27 0x5568c908 in dict_subscript.lto_priv () at 
../Objects/dictobject.c:1202
#28 0x5565618e in PyEval_EvalFrameEx () at ../Python/ceval.c:1539
#29 0x5564e525 in PyEval_EvalCodeEx () at ../Python/ceval.c:3584
#30 0x5566ac2e in function_call.lto_priv () at 
../Objects/funcobject.c:523
#31 0x5563c5f3 in PyObject_Call () at ../Objects/abstract.c:2547
#32 0x5568102e in instancemethod_call.lto_priv () at 
../Objects/classobject.c:2602
#33 0x5563c5f3 in PyObject_Call () at ../Objects/abstract.c:2547
#34 0x5565a490 in PyEval_CallObjectWithKeywords () at 
../Python/ceval.c:4221
#35 0x5569ff3a in instance_subscript.lto_priv () at 
../Objects/classobject.c:1105
#36 0x5565618e in PyEval_EvalFrameEx () at ../Python/ceval.c:1539
#37 0x5564e525 in PyEval_EvalCodeEx () at ../Python/ceval.c:3584
#38 0x5566ac2e in function_call.lto_priv () at 
../Objects/funcobject.c:523
#39 0x5563c5f3 in PyObject_Call () at ../Objects/abstract.c:2547
#40 0x55672dd9 in slot_tp_new.lto_priv () at 
../Objects/typeobject.c:5849
#41 0x55642093 in type_call.lto_priv () at ../Objects/typeobject.c:749
#42 0x5563c5f3 in PyObject_Call () at ../Objects/abstract.c:2547
#43 0x55655e8f in do_call (nk=, na=1, 
pp_stack=0x7fffb950, func=) at 
../Python/ceval.c:4569
#44 call_function (oparg=, pp_stack=0x7fffb950) at 
../Python/ceval.c:4374
#45 PyEval_EvalFrameEx () at ../Python/ceval.c:2989
#46 0x55655c7f in fast_function (nk=, na=, n=, pp_stack=0x7fffbaa0, func=) at ../Python/ceval.c:4437
#47 call_function (oparg=, pp_stack=0x7fffbaa0) at 
../Python/ceval.c:4372
#48 PyEval_EvalFrameEx () at ../Python/ceval.c:2989
#49 0x55655c7f in fast_function (nk=, na=, n=, pp_stack=0x7fffbbf0, func=) at ../Python/ceval.c:4437
#50 call_function (oparg=, pp_stack=0x7fffbbf0) at 
../Python/ceval.c:4372
#51 PyEval_EvalFrameEx () at ../Python/ceval.c:2989
#52 0x55655c7f in fast_function (nk=, na=, n=, pp_stack=0x7fffbd40, func=) at ../Python/ceval.c:4437
---Type  to continue, or q  to quit---
#53 call_function (oparg=, pp_stack=0x7fffbd40) at 
../Python/ceval.c:4372
#54 PyEval_EvalFrameEx () at ../Python/ceval.c:2989
#55 0x55655c7f in fast_function (nk=, na=, n=, pp_stack=0x7fffbe90, func=) at ../Python/ceval.c:4437
#56 call_function (oparg=, pp_stack=0x7fffbe90) at 
../Python/ceval.c:4372
#57 PyEval_EvalFrameEx () at ../Python/ceval.c:2989
#58 0x55655c7f in fast_function (nk=, na=, n=, pp_stack=0x7fffbfe0, func=) at ../Python/ceval.c:4437
#59 call_function (oparg=, pp_stack=0x7fffbfe0) at 
../Python/ceval.c:4372
#60 

[issue29099] sqlite3 timestamp converter cannot handle timezone

2017-01-11 Thread Xiang Zhang

Xiang Zhang added the comment:

> LGTM except that arguments of assertEqual() should be swapped.

Thanks Serhiy! I'll take care of that. One problem remained is what to do with 
2.7. There is no timezone object in 2.7. My preference is just pointing out the 
limitation that only naive datetime object is supported in the doc.

--

___
Python tracker 

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



[issue29220] Python 3.6 regression/change using logging.addLevelName() to clear a name

2017-01-11 Thread Vinay Sajip

Vinay Sajip added the comment:

OK, will apply to 3.5 -> default.

--

___
Python tracker 

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



[issue29220] Python 3.6 regression/change using logging.addLevelName() to clear a name

2017-01-11 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I'm sure. e4b6faf22e8d is in 3.5 branch.

--

___
Python tracker 

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



  1   2   >