[issue32612] pathlib.(Pure)WindowsPaths can compare equal but refer to different files

2018-01-22 Thread benrg

benrg  added the comment:

This bug is about paths that compare *equal*, but refer to *different* files. I 
agree that the opposite is not much of a problem (and I said so in the original 
comment).

The reason I classified this as a security bug is that Python scripts using 
pathlib on Windows could be vulnerable in certain cases to an attacker that can 
choose file names. For example, the order in which paths are added to a set or 
dict could affect which of two files is seen by the script. If different parts 
of the script add files in different orders - which would normally be safe - 
the result could be similar to a TOCTTOU race.

I don't disagree that "doing a good enough job of case folding is better than 
ignoring it." I just think that pathlib should not case-fold strings that 
Windows filesystems don't.

--
nosy: +pitrou
type: enhancement -> security

___
Python tracker 

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



[issue32633] Warnings from test_asyncio.test_tasks.SetMethodsTest

2018-01-22 Thread Nathaniel Smith

Change by Nathaniel Smith :


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

___
Python tracker 

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



[issue32633] Warnings from test_asyncio.test_tasks.SetMethodsTest

2018-01-22 Thread Nathaniel Smith

New submission from Nathaniel Smith :

The test_asyncio tests are generating some warnings:

0:00:00 load avg: 2.14 [1/1] test_asyncio.test_tasks
/home/njs/src/cpython/Lib/test/test_asyncio/test_tasks.py:100: RuntimeWarning: 
coroutine 'SetMethodsTest.test_set_exception_causes_invalid_state..foo' 
was never awaited
  gc.collect()
/home/njs/src/cpython/Lib/test/test_asyncio/test_tasks.py:100: RuntimeWarning: 
coroutine 'SetMethodsTest.test_set_result_causes_invalid_state..foo' 
was never awaited
  gc.collect()
/home/njs/src/cpython/Lib/test/test_asyncio/test_tasks.py:100: RuntimeWarning: 
coroutine 'SetMethodsTest.test_set_exception_causes_invalid_state..foo' 
was never awaited
  gc.collect()
/home/njs/src/cpython/Lib/test/test_asyncio/test_tasks.py:100: RuntimeWarning: 
coroutine 'SetMethodsTest.test_set_result_causes_invalid_state..foo' 
was never awaited
  gc.collect()
1 test OK.

It looks like these have been here for a while. Easy to fix though.

--
components: Tests, asyncio
messages: 310478
nosy: asvetlov, giampaolo.rodola, njs, yselivanov
priority: normal
severity: normal
status: open
title: Warnings from test_asyncio.test_tasks.SetMethodsTest
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



[issue30491] Add a lightweight mechanism for detecting un-awaited coroutine objects

2018-01-22 Thread Nathaniel Smith

Change by Nathaniel Smith :


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

___
Python tracker 

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



[issue32612] pathlib.(Pure)WindowsPaths can compare equal but refer to different files

2018-01-22 Thread Steve Dower

Steve Dower  added the comment:

Arguably, a WindowsPath instance only represents the *path* and not the file 
located by the path. So the programmer has to take just as much responsibility 
as if they were using plain strings, except there are some conveniences added 
to make those strings easier to manage.

I don't see anything in the docs suggesting that a Path instances have 
file-identity (that is, two Path objects are always equal if they refer to the 
same file). Even the "resolve()" method doesn't pretend to get the exact 
filename.

The best option for true comparison is to use stat() and compare st_inode and 
st_dev. Lacking that, doing a good enough job of case folding is better than 
ignoring it, as most workarounds are likely to do a worse job (e.g., they won't 
even correct for "A"=="B\..\A", let alone casing).

If you have a specific suggestion for how comparison could be improved here 
without having to go to kernel mode, feel free to make it. Unfortunately, your 
two suggestions here are not workable.

(And yes, PurePosixPath and "import posixpath" are the right way to handle 
case-sensitive paths explicitly, which is why they're available on all 
platforms.)

--
type: security -> enhancement
versions: +Python 3.8 -Python 3.4, 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



[issue32632] Mock does not create deepcopy of mutable args

2018-01-22 Thread Sergey

New submission from Sergey :

MagicMock allows to check parameters of calls by using "assert_has_calls". 
However it fails if argument has a mutable type and was changed in-place before 
the second call.

The example is provided in attached file.

In "func1" value in "data" changes for each iteration and as result:
call_args_list contains two same calls.
In "func2" variable "data" generates by function "get_dict" and in this case 
call_args_list contains correct values.

Obviously it happens because class _Call 
(https://github.com/python/cpython/blob/3.5/Lib/unittest/mock.py#L1929) does 
not create a deepcopy of call args/kwargs.

Will it be correct to add deep_copy logic in mock.py ? or may be it's wrong to 
use logic like in "func1"? 
I see only one disadvantage of using deepcopy: it will become slower.

--
components: Tests
files: test.py
messages: 310476
nosy: michael.foord, skraynev
priority: normal
severity: normal
status: open
title: Mock does not create deepcopy of mutable args
versions: Python 3.5
Added file: https://bugs.python.org/file47401/test.py

___
Python tracker 

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



[issue27099] IDLE: turn built-in extensions into regular modules

2018-01-22 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

These patches were first released with the 3.6.3 release candidate.  Nothing 
was changed for 3.6.4.  Rechecking the changes to autocomplete.py in PR 2494, 
the only expected effect, after the followup in #31488, PR 3612, is that 
changes to the popup wait time should take effect immediately instead of 
sometime later.  I considered making this happen for the 'extension' features, 
as with with other features, a type of bugfix.

If you have an issue with completions, other than those listed in #27609, 
please open a new issue.

I know zzdummy is listed.  An explanation that it is there for testing and 
example should have been added to the [Help] buttom text for the extension tab. 
 I opened #32631 for this and possible changes to zzdummy.py.

--

___
Python tracker 

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



[issue32436] Implement PEP 567

2018-01-22 Thread Yury Selivanov

Yury Selivanov  added the comment:


New changeset 83c8675edb4fe278c5d930f7865977a5d3c7168a by Yury Selivanov in 
branch 'master':
bpo-32436: Remove a redundant assert (#5275)
https://github.com/python/cpython/commit/83c8675edb4fe278c5d930f7865977a5d3c7168a


--

___
Python tracker 

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



[issue32630] Migrate decimal to use PEP 567 context variables

2018-01-22 Thread Yury Selivanov

Change by Yury Selivanov :


--
keywords: +patch
pull_requests: +5122

___
Python tracker 

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



[issue32631] IDLE: revise zzdummy.py

2018-01-22 Thread Terry J. Reedy

New submission from Terry J. Reedy :

zzdummy.py is needed for properly testing the extension mechanism.  It is 
intended to provide an example extension for users to follow.  When completed, 
enabled, and invoked, it will prefix every line of a window with some text, or 
remove the prefix from every line.  It would be even better to make it respect 
selections, as other format options do.

Needed: more comments, including what it does when enabled; docstring for 
z_in_event; uncomment z_in_event; code for z_out_event.

Should the extension have a different name? ZzTestExample? ZzIgnoreThis?  
Changing an extension name would normally be a bad idea, as it would disable 
any customizations.  But I think we could do it for this one if desired.

The default insertion text could be more informative: for instance, 'ignore 
this' or 'see-doc' or #ignore#.  The last would make it a configurable 
comment/uncomment.  Normally, changing a default is a no-no, as it can mess up 
user configurations.  But since the current text is inoperative, this should 
not matter here.

The menu defs are commented out because enabling the extension currently has no 
effect, so the menu entries would be useless.

***There should be help text for the extension tab explaining the presence and 
operation of the extension.  (This should have  been done already.)

Extension tests, last revised in #31480, will likely need more changes.

--
assignee: terry.reedy
components: IDLE
messages: 310473
nosy: terry.reedy
priority: normal
severity: normal
stage: needs patch
status: open
title: IDLE: revise zzdummy.py
type: behavior
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



[issue32630] Migrate decimal to use PEP 567 context variables

2018-01-22 Thread Yury Selivanov

New submission from Yury Selivanov :

PEP 567 allows decimal to be safely used in async/await code.

I couldn't observe any performance impact by the proposed PR.  The PR doesn't 
modify decimal context behaviour: instead of using a thread-local storage it 
now uses a context variable.

--
components: Library (Lib)
messages: 310472
nosy: gvanrossum, inada.naoki, skrah, vstinner, yselivanov
priority: normal
severity: normal
stage: patch review
status: open
title: Migrate decimal to use PEP 567 context variables
type: enhancement
versions: Python 3.7

___
Python tracker 

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



[issue32629] PyImport_ImportModule occasionally cause access violation

2018-01-22 Thread Jack Branson

New submission from Jack Branson :

I found that calling PyImport_ImportModule frequently may cause access 
violation error.

here is call stack:

00 0354f610 67d01605 0001 0020 007f python36!_PyObject_Alloc+0x5e 
[c:\build\cpython36\objects\obmalloc.c @ 1258]
01 (Inline)     python36!PyObject_Malloc+0x18 
[c:\build\cpython36\objects\obmalloc.c @ 479]
02 0354f638 67d18070 0008 007f 67e541e0 python36!PyUnicode_New+0xf5 
[c:\build\cpython36\objects\unicodeobject.c @ 1281]
03 0354f654 67d0963a 0354f69c 0008 007f 
python36!_PyUnicodeWriter_PrepareInternal+0x60 
[c:\build\cpython36\objects\unicodeobject.c @ 13534]
04 0354f6c0 67d02a66 67e541e0 0008  
python36!PyUnicode_DecodeUTF8Stateful+0xca 
[c:\build\cpython36\objects\unicodeobject.c @ 5034]
05 0354f6e4 67d59183 67e541e0 02a09db8 02a09de0 
python36!PyUnicode_FromString+0x46 [c:\build\cpython36\objects\unicodeobject.c 
@ 2077]
06 (Inline)     
python36!PyImport_ImportModuleLevel+0xa [c:\build\cpython36\python\import.c @ 
1652]
07 0354f704 67d5878f 02a09de0 02a09db8 02a09dd0 python36!PyImport_Import+0xe3 
[c:\build\cpython36\python\import.c @ 1732]
08 0354f718 00478639 02a09dd0 7651129a  
python36!PyImport_ImportModule+0x1f [c:\build\cpython36\python\import.c @ 1257]

pointer bp's value is 0x0001, which is NULL + 1. In this case, `assert(bp 
!= NULL)` will not let application crash for assert failure, and application 
will continue run until the line `pool->freeblock = *(block **)bp` which is 
defrencing bp, causes access violation.

0:009> .frame 0
00 0354f610 67d01605 python36!_PyObject_Alloc+0x5e 
[c:\build\cpython36\objects\obmalloc.c @ 1258]
0:009> r
eax=67ecfeb8 ebx=0021 ecx=02a09000 edx= esi=0001 edi=0001
eip=67cdda4e esp=0354f5f8 ebp=0354f610 iopl=0 nv up ei pl nz na pe cy
cs=0023  ss=002b  ds=002b  es=002b  fs=0053  gs=002b efl=00010207
python36!_PyObject_Alloc+0x5e:
67cdda4e 8b06mov eax,dword ptr [esi]  ds:002b:0001=
0:009> dv
 use_calloc = 0n0
  nelem = 1
 elsize = 
 nbytes = 0x21
   pool = 0x02a09000
   size = 4
   next = 0x67ecfeb8
 bp = 0x0001 "--- memory read error at address 0x0001 ---"
 result = 
  usable_arenas = 


/*
 * There is a used pool for this size class.
 * Pick up the head block of its free list.
 */
++pool->ref.count;
bp = pool->freeblock;
assert(bp != NULL);
if ((pool->freeblock = *(block **)bp) != NULL) {
UNLOCK();
if (use_calloc)
memset(bp, 0, nbytes);
return (void *)bp;
}
/*

--
components: ctypes
messages: 310471
nosy: Jack Branson
priority: normal
severity: normal
status: open
title: PyImport_ImportModule occasionally cause access violation
type: crash
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



[issue28716] Fractions instantiation revisited

2018-01-22 Thread Stefan Behnel

Stefan Behnel  added the comment:

Not sure if it's relevant for this specific change, but here's a benchmark that 
you could use for Fractions: issue22458

--
nosy: +scoder

___
Python tracker 

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



[issue32296] Implement asyncio._get_running_loop() and get_event_loop() in C

2018-01-22 Thread Yury Selivanov

Change by Yury Selivanov :


--
pull_requests: +5121

___
Python tracker 

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



[issue31860] IDLE: Make font sample editable

2018-01-22 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Postscript: I read a week or so ago that a new Windows 10 font chooser will 
have this feature.  There was not much detail and I believe it is currently 
only part of the Preview package.

--

___
Python tracker 

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



[issue32628] Add configurable DirectoryIndex to http.server

2018-01-22 Thread Erik Paulson

New submission from Erik Paulson :

In http.server and SimpleHTTPRequestHandler - the send_head function is 
hard-coded to treat index.html and index.htm as files to return in a directory 
- if neither of those files are present, it lists the directory. 

It would be very nice to be able to specify other files to use as a directory 
index, similar to the DirectoryIndex directive from Apache.

I think it'd be straight forward to add some kind of list you could set, just 
like you can modify extensions_map to include other types of MIME types. 

Would it be OK to just add a directory_index list with index.html and index.htm 
on by default that people could do like
Handler.directory_index.append("index.htmlx") in their setup? Or would such an 
API be better with some kind of helper?

--
components: Library (Lib)
messages: 310468
nosy: epaulson
priority: normal
severity: normal
status: open
title: Add configurable DirectoryIndex to http.server
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



[issue27099] IDLE: turn built-in extensions into regular modules

2018-01-22 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Leaving this as closed.  Just wanted to note that it was a rough upgrade to 
3.6.4 because of this backport.

--
status: open -> closed

___
Python tracker 

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



[issue27099] IDLE: turn built-in extensions into regular modules

2018-01-22 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

I don't think this should have been backported to 3.6.

This week, I'm teaching a class in Python3.6 and tab completion seems to be 
broken for everyone from a fresh install of 3.6.4 directly from www.python.org. 
 Also, the extension tab now shows ZzDummy.

--
nosy: +rhettinger
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: Why is there no functional xml?

2018-01-22 Thread Rustom Mody
On Sunday, January 21, 2018 at 4:51:34 PM UTC+5:30, Peter Otten wrote:
> Personally I'd probably avoid the extra layer and write a function that 
> directly maps dataclasses or database records to xml using the conventional 
> elementtree API.

Would appreciate your thoughts/comments Peter!

I find that you can get 'E' from lxml.objectify as well as lxml.builder
builder seems better in that its at least sparsely documented
objectify seems to have almost nothing beyond the original David Mertz' docs

builder.E seems to do what objectify.E does modulo namespaces

builder.E and objectify.E produce types that are different and look backwards
(at least to me — Elementbase is less base than _Element)

You seem to have some reservation against objectify, preferring the default 
Element — I'd like to know what

Insofar as builder seems to produce the same type as Element unlike objectify
which seems to be producing a grandchild type, do you have the same reservations
against builder.E?
--
$ python3
Python 3.5.3 (default, Nov 23 2017, 11:34:05) 
[GCC 6.3.0 20170406] on linux
Type "help", "copyright", "credits" or "license" for more information.

>>> from lxml.etree import Element, tostring
>>> from lxml.builder import E as Eb
>>> from lxml.objectify import E as Eo

>>> e = Element("tag")
>>> tostring(e)
b''
>>> o = Eb.tag()
>>> o

>>> tostring(o)
b''
>>> o = Eo.tag()
>>> tostring(o)
b'http://codespeak.net/lxml/objectify/pytype; 
xmlns:xsd="http://www.w3.org/2001/XMLSchema; 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>'
>>> b = Eb.tag()
>>> tostring(b)
b''
>>> type(b)

>>> type(b).__bases__
(,)
>>> type(e)

>>> type(o)

>>> type(o).__bases__
(,)
>>> type(o).__bases__[0].__bases__
(,)
>>> 

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


[issue32436] Implement PEP 567

2018-01-22 Thread Yury Selivanov

Change by Yury Selivanov :


--
pull_requests: +5120

___
Python tracker 

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



[issue32627] Header dependent _uuid build failure on Fedora 27

2018-01-22 Thread Nick Coghlan

Nick Coghlan  added the comment:

(Reducing priority since "sudo dnf remove uuid-devel" is a straightforward 
workaround)

--
priority: normal -> low

___
Python tracker 

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




[issue32102] Add "capture_output=True" option to subprocess.run

2018-01-22 Thread bbayles

Change by bbayles :


--
nosy: +bbayles

___
Python tracker 

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



[issue32502] uuid1() fails if only 64-bit interface addresses are available

2018-01-22 Thread bbayles

Change by bbayles :


--
nosy: +bbayles

___
Python tracker 

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



[issue32304] Upload failed (400): Digests do not match on .tar.gz ending with x0d binary code

2018-01-22 Thread bbayles

Change by bbayles :


--
nosy: +bbayles

___
Python tracker 

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



[issue32513] dataclasses: make it easier to use user-supplied special methods

2018-01-22 Thread Nick Coghlan

Nick Coghlan  added the comment:

I'd be fine with that recommendation (since `@dataclass(order=False)` and 
`@total_ordering` will compose without any problems), but in that case I'd 
suggest having "order=True" + any of the ordering methods result in an 
exception (as you've proposed for frozen=True and the methods that it needs to 
override).

--

___
Python tracker 

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



[issue32513] dataclasses: make it easier to use user-supplied special methods

2018-01-22 Thread Eric V. Smith

Eric V. Smith  added the comment:

Rather than re-implementing (and maintaining) functools.total_ordering 
semantics, I'd rather advise them to specify order=False and just use 
functools.total_ordering. It's an odd use case for dataclasses, anyway.

--

___
Python tracker 

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



Re: Help: 64bit python call c and got OSError: exception: access violation writing 0xFFFFFFFF99222A60

2018-01-22 Thread Jason Qian via Python-list
Thanks for the help,

Jason

On Mon, Jan 22, 2018 at 5:41 PM, eryk sun  wrote:

> On Mon, Jan 22, 2018 at 9:00 PM, Jason Qian via Python-list
>  wrote:
> >
> > I am using ctypes on Windows to interface with a dll  and it works fine
> > on Linux and windows 32-bit python.  But, when using 64-bit python, we
> got
> > error "exception: access violation writing 0x99222A60".
> >
> > from ctypes import *
>
> Try to avoid * imports if it's a public module.
>
> > lib = cdll.LoadLibrary('xxx.dll')
>
> Just use CDLL directly. cdll.LoadLibrary is pointless, and
> `cdll.xxx` is problematic in some cases because it caches CDLL
> instances, which cache function pointers. Also, the ".dll" filename
> extension isn't required in Windows.
>
> > lib.createService.argtypes=[c_int,ctypes.c_char_p]
> > lib.createService.restype=ctypes.c_int
> >
> > class myDriver(object):
> > def init(self):
> > self.obj = lib.loadInstance()
>
> Since you didn't set loadInstance.restype, the result gets truncated
> as a C int, the default result type.
>
> I recommend defining an opaque ctypes struct (i.e. no defined fields)
> for the C++ class. This provides type safety. Staying strict and
> literal on types is more work than using a `void *` everywhere, but it
> pays off in terms of easier debugging and more resilient code. A
> simple example is that ctypes returns a `void *` result (or gets a
> struct field or array item) as a Python integer. Then for any FFI call
> that you may have forgotten to define argtypes, ctypes will default to
> truncating this integer value as a C int. At best that causes an
> immediate crash. At worst it's a subtle bug that corrupts data.
>
> Here's an example implementation with an opaque struct:
>
> import ctypes
>
> lib = ctypes.CDLL('xxx')
>
> class myPythonAPI(ctypes.Structure):
> pass
>
> PmyPythonAPI = ctypes.POINTER(myPythonAPI)
>
> lib.loadInstance.restype = PmyPythonAPI
> lib.loadInstance.argtypes = ()
>
> lib.createService.restype = ctypes.c_int
> lib.createService.argtypes = (PmyPythonAPI, ctypes.c_char_p)
>
> class myDriver(object):
>
> def init(self):
> self.obj = lib.loadInstance()
>
> def create_services(self, servicename):
> return lib.createService(self.obj, servicename)
>
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue32513] dataclasses: make it easier to use user-supplied special methods

2018-01-22 Thread Nick Coghlan

Nick Coghlan  added the comment:

For the ordering operators, my only question would be whether or not I can rely 
on them to act like functools.total_ordering: if I supply __eq__ and one of the 
ordering operators (e.g. __lt__), will dataclasses make sure the other three 
ordering operators are consistent with those base methods? Or will it bypass 
them and act directly on the underlying fields?

My suggestion would be to say that if any of __lt__, __le__, __gt__ or __ge__ 
are defined, then data classes will implicitly generate the other methods based 
on functools.total_ordering semantics, and will only reference the underlying 
fields directly if *none* of them are defined. Otherwise I can see folks 
defining a single method like "__lt__", and being surprised when they end up 
with inconsistent comparison behaviour.

--
nosy: +ncoghlan

___
Python tracker 

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



[issue32620] [3.5] Travis CI fails on Python 3.5 with "pyenv: version `3.5' not installed"

2018-01-22 Thread Nick Coghlan

Change by Nick Coghlan :


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

___
Python tracker 

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



[issue31568] Configure thinks it finds python3.5 but doesn't

2018-01-22 Thread Nick Coghlan

Change by Nick Coghlan :


--
pull_requests: +5119

___
Python tracker 

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



[issue32620] [3.5] Travis CI fails on Python 3.5 with "pyenv: version `3.5' not installed"

2018-01-22 Thread Nick Coghlan

Nick Coghlan  added the comment:

I removed the snippet entirely from 
https://github.com/python/cpython/pull/5201, and while Travis didn't pass, it 
failed due to test suite failures, not anything environmental.

--
nosy: +ncoghlan

___
Python tracker 

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



[issue32627] Header dependent _uuid build failure on Fedora 27

2018-01-22 Thread Nick Coghlan

Nick Coghlan  added the comment:

Reverting my previous commit doesn't fix the problem: if both uuid-devel and 
libuuid-devel are installed, then it reports that the necessary bits to build 
_uuid weren't found, without even attempting to compile it at all.

--

___
Python tracker 

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



[issue32627] Header dependent _uuid build failure on Fedora 27

2018-01-22 Thread Nick Coghlan

New submission from Nick Coghlan :

I'm hitting a build failure relating to the new _uuid module on Fedora 27:

==
building '_uuid' extension
gcc -pthread -fPIC -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 
-Wall -Wstrict-prototypes -std=c99 -Wextra -Wno-unused-result 
-Wno-unused-parameter -Wno-missing-field-initializers 
-Werror=implicit-function-declaration -I./Include -I. -I/usr/local/include 
-I/home/ncoghlan/devel/cpython/Include -I/home/ncoghlan/devel/cpython -c 
/home/ncoghlan/devel/cpython/Modules/_uuidmodule.c -o 
build/temp.linux-x86_64-3.7/home/ncoghlan/devel/cpython/Modules/_uuidmodule.o
In file included from /home/ncoghlan/devel/cpython/Modules/_uuidmodule.c:8:0:
/usr/include/uuid.h:94:24: error: conflicting types for ‘uuid_t’
 typedef struct uuid_st uuid_t;
^~
In file included from /home/ncoghlan/devel/cpython/Modules/_uuidmodule.c:5:0:
/usr/include/uuid/uuid.h:44:23: note: previous declaration of ‘uuid_t’ was here
 typedef unsigned char uuid_t[16];
   ^~
In file included from /home/ncoghlan/devel/cpython/Modules/_uuidmodule.c:8:0:
/usr/include/uuid.h:107:22: error: conflicting types for ‘uuid_compare’
 extern uuid_rc_t uuid_compare  (const uuid_t  *_uuid, const uuid_t 
*_uuid2, int *_result);
  ^~~~
In file included from /home/ncoghlan/devel/cpython/Modules/_uuidmodule.c:5:0:
/usr/include/uuid/uuid.h:73:12: note: previous declaration of ‘uuid_compare’ 
was here
 extern int uuid_compare(const uuid_t uu1, const uuid_t uu2);
^~~~
/home/ncoghlan/devel/cpython/Modules/_uuidmodule.c: In function 
‘py_uuid_generate_time_safe’:
/home/ncoghlan/devel/cpython/Modules/_uuidmodule.c:15:12: error: storage size 
of ‘uuid’ isn’t known
 uuid_t uuid;
^~~~
/home/ncoghlan/devel/cpython/Modules/_uuidmodule.c:15:12: warning: unused 
variable ‘uuid’ [-Wunused-variable]
/home/ncoghlan/devel/cpython/Modules/_uuidmodule.c:29:1: warning: control 
reaches end of non-void function [-Wreturn-type]
 }
 ^
==

>From my initial investigation, I think the issue may be related to my previous 
>attempt to fix this in 
>https://github.com/python/cpython/commit/53efbf3977a44e382397e7994a2524b4f8c9d053#diff-2eeaed663bd0d25b7e608891384b7298
> and the fact that there are *two* "uuid.h" headers available in the Fedora 
>repos:

* /usr/include/uuid.h (provided by uuid-devel)
* /usr/include/uuid/uuid.h (provided by libuuid-devel)

Right now, the build works if you have "libuuid-devel" installed, but do *not* 
have "uuid-devel" installed.

With both installed, neither installed, or only uuid-devel installed, the build 
will fail, but the exact errors reported will vary. (There's also a distinct 
set of compile errors you can get if you forget to rerun configure after 
installing the additional headers)

Reverting my previous commit (and replacing it with a comment saying we're 
specifically looking for "uuid/uuid.h", not "uuid.h") may be enough to handle 
the case where both are installed.

--
messages: 310459
nosy: christian.heimes, ncoghlan, vstinner
priority: normal
severity: normal
stage: needs patch
status: open
title: Header dependent _uuid build failure on Fedora 27
type: compile error
versions: Python 3.7, Python 3.8

___
Python tracker 

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



[issue32436] Implement PEP 567

2018-01-22 Thread Yury Selivanov

Yury Selivanov  added the comment:

This one: https://github.com/python/cpython/pull/5273? I've left a comment with 
some questions there. Are there any other urgent PRs?

The main PEP 567 PR has been merged already, btw.

--

___
Python tracker 

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



[issue32436] Implement PEP 567

2018-01-22 Thread Guido van Rossum

Guido van Rossum  added the comment:

While you're waiting for code review maybe you can review some other PR?
(Lukasz mentioned that Serhiy seems very busy.)

--

___
Python tracker 

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



[issue32616] Significant performance problems with Python 2.7 built with clang 3.x or 4.x

2018-01-22 Thread Tim Smith

Change by Tim Smith :


--
nosy: +tdsmith

___
Python tracker 

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



[issue32436] Implement PEP 567

2018-01-22 Thread Yury Selivanov

Yury Selivanov  added the comment:

I'll try to find some time after beta-1.  Right now have a few other issues 
that I have to finish (and also create a PR to make decimal use PEP 567).

--

___
Python tracker 

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



[issue32436] Implement PEP 567

2018-01-22 Thread Guido van Rossum

Guido van Rossum  added the comment:

Hopefully sooner?

--

___
Python tracker 

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



[issue31368] Support asynchronous, non-blocking buffered reads (RWF_NONBLOCK)

2018-01-22 Thread STINNER Victor

STINNER Victor  added the comment:

Explanation for myself.

https://kernelnewbies.org/Linux_4.14#Asynchronous_buffered_I.2FO_support

"In this release, the preadv2(2) syscall with RWF_NONBLOCK will let userspace 
applications bypass enqueuing operation in the threadpool if it's already 
available in the pagecache."

For applications using a thread pool, like the aiofiles does for asyncio, 
preadv2() allows to bypass the thread pool which is obviously faster. If the 
read block, just uses thread pool as currently done.

Same rationale for pwritev2().

--
nosy: +vstinner

___
Python tracker 

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



[issue31333] Implement ABCMeta in C

2018-01-22 Thread Ivan Levkivskyi

Change by Ivan Levkivskyi :


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

___
Python tracker 

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



[issue32590] Proposal: add an "ensure(arg)" builtin for parameter validation

2018-01-22 Thread Nick Coghlan

Nick Coghlan  added the comment:

I agreed that this idea isn't really baked enough for an RFE yet, so I'm 
marking this as "postponed" for now.

The main requirement for getting it back out of "postponed" state would be 
having someone that's sufficiently interested to write a PEP and wrangle some 
related python-ideas threads.

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



[issue32607] After Python Installation Error

2018-01-22 Thread Pablo Galindo Salgado

Change by Pablo Galindo Salgado :


--
components: +Windows
nosy: +paul.moore, steve.dower, tim.golden, zach.ware
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

___
Python tracker 

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



[issue32436] Implement PEP 567

2018-01-22 Thread Yury Selivanov

Yury Selivanov  added the comment:

I'll keep the issue open -- a documentation for the new APIs will be merged in 
a separate PR in a couple of months.

--

___
Python tracker 

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



[issue32436] Implement PEP 567

2018-01-22 Thread Yury Selivanov

New submission from Yury Selivanov :


New changeset f23746a934177c48eff754411aba54c31d6be2f0 by Yury Selivanov in 
branch 'master':
bpo-32436: Implement PEP 567 (#5027)
https://github.com/python/cpython/commit/f23746a934177c48eff754411aba54c31d6be2f0


--

___
Python tracker 

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



[issue28980] ResourceWarning when imorting antigravity in 3.6

2018-01-22 Thread Ivan Levkivskyi

Ivan Levkivskyi  added the comment:

I have not seen this for quite some time so I'm closing this as fixed.

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

___
Python tracker 

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



[issue32493] UUID Module - FreeBSD build failure

2018-01-22 Thread Michael Felt

Michael Felt  added the comment:

On 1/17/2018 11:16 AM, David CARLIER wrote:
> David CARLIER  added the comment:
>
> Might comes from uuid1 function itself ... e.g. line 704 not setting version 
> "field".
IMHO: for uuid1 - the version number should be in the 16 bytes filled by 
uuid_create. The implementation of uuid4() in uuid.py "has to" specify 
the attribute by setting the UUID version attribute to 4, so that when 
an uuid4 instance gets asked it's version it says 4. A random number 
gives no such guarantee.

Taking a hint from the FreeBSD man page for uuid_create() - that says it 
provides a DCE 1.1 RPC implementation - I found this link:
http://pubs.opengroup.org/onlinepubs/9629399/apdxa.htm

Therein:

The timestamp is a 60 bit value. For UUID version 1, this is represented 
by Coordinated Universal Time (UTC) as a count of 100-nanosecond 
intervals since 00:00:00.00, 15 October 1582 (the date of Gregorian 
reform to the Christian calendar).

The version number is multiplexed in the 4 most significant bits of the 
*time_hi_and_version* field. UUID version Field 
 
lists currently defined versions of the UUID.

Again - a random number is not likely to correctly set the 4 most significant 
bits - so another way is needed to make an instance it is version 4.
IMHO - the output of uuid_create should satisfy the needs of uuid version 1.

>
> --
> nosy: +David CARLIER2
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



Re: Help: 64bit python call c and got OSError: exception: access violation writing 0xFFFFFFFF99222A60

2018-01-22 Thread Jason Qian via Python-list
Thanks you very much, fixed the problem :)

On Mon, Jan 22, 2018 at 4:28 PM, Random832  wrote:

> On Mon, Jan 22, 2018, at 16:00, Jason Qian via Python-list wrote:
> > Hello!
> >
> >   I am using ctypes on Windows to interface with a dll  and it works fine
> > on Linux and windows 32-bit python.  But, when using 64-bit python, we
> got
> > error "exception: access violation writing 0x99222A60".
>
> You are treating the obj type (myPythonAPI *) as c_int, which is only 32
> bits. You should be using a pointer type instead (ideally you should be
> using void * and c_void_p, so Python doesn't need the class definition.)
> Don't forget to set lib.loadInstance.restype as well.
>
> > __declspec(dllexport) myPythonAPI* loadInstance(){ return new
> > myPythonAPI(); }
> > __declspec(dllexport) int createService(myPythonAPI* obj, const char*
> > serviceName) { eturn obj->createService(serviceName);
>
> > lib = cdll.LoadLibrary('xxx.dll')
> >
> > lib.createService.argtypes=[c_int,ctypes.c_char_p]
> > lib.createService.restype=ctypes.c_int
> >
> > class myDriver(object):
> > def init(self):
> > self.obj = lib.loadInstance()
> --
> https://mail.python.org/mailman/listinfo/python-list
>
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Installing "kitchen" module

2018-01-22 Thread Paul Moore
On 22 January 2018 at 17:20,   wrote:
> On Tuesday, 23 January 2018 03:41:28 UTC+10:30, Paul  Moore  wrote:
>> "python -m pip install kitchen" is probably your best approach (from
>> the CMD prompt).
>>
>> On 22 January 2018 at 16:31,   wrote:
>> > On Tuesday, 23 January 2018 02:56:56 UTC+10:30, Paul  Moore  wrote:
>> >> You need to run that command from a CMD prompt, not from inside the
>> >> Python interpreter.
>> >>
>> >> On 22 January 2018 at 16:19,  cody wrote:
>> >> > On Tuesday, 23 January 2018 02:41:04 UTC+10:30, bream...@gmail.com  
>> >> > wrote:
>> >> >> On Monday, January 22, 2018 at 3:37:44 PM UTC, codyda...@gmail.com 
>> >> >> wrote:
>> >> >> > So here's the situation. I am unfamiliar with Python but need it to 
>> >> >> > export a wiki, so I have been following this tutorial, using the 
>> >> >> > latest version of Python 2 on Windows 7:
>> >> >> >
>> >> >> > https://github.com/WikiTeam/wikiteam/wiki/Tutorial#I_have_no_shell_access_to_server
>> >> >> >
>> >> >> > I have everything working up to the point where I run it and it 
>> >> >> > tells me this:
>> >> >> >
>> >> >> > "Please install the Kitchen module.
>> >> >> > Please install or update the Requests module."
>> >> >> >
>> >> >> > One suggestion was that I try "import kitchen", but that gives me 
>> >> >> > this error:
>> >> >> >
>> >> >> > "Traceback :
>> >> >> >   File "", line 1, in 
>> >> >> > ImportError: No module named kitchen"
>> >> >> >
>> >> >> > So I went to https://pypi.python.org/pypi/kitchen/ to download it, 
>> >> >> > but that hasn't helped. Maybe it needs to be in a specific folder to 
>> >> >> > work?
>> >> >> >
>> >> >> > Any help would be appreciated.
>> >> >> >
>> >> >> > P.S. Here is someone else running into the same problem but they 
>> >> >> > seemed to have fixed it through a solution that didn't work for me 
>> >> >> > (it doesn't recognise a command called sudo in the first place when 
>> >> >> > I type it): https://github.com/WikiTeam/wikiteam/issues/252
>> >> >>
>> >> >> Forget sudo as that's a *nix command.  From the command line you 
>> >> >> should be able to run:-
>> >> >>
>> >> >> pip install kitchen
>> >> >> pip install requests
>> >> >>
>> >> >> --
>> >> >> Kindest regards.
>> >> >>
>> >> >> Mark Lawrence.
>> >> >
>> >> > Here's what I see when I try that. Maybe I'm missing some kind of 
>> >> > initial setup? https://i.imgur.com/XQHO19W.png
>> >> > --
>> >> > https://mail.python.org/mailman/listinfo/python-list
>> >
>> > https://imgur.com/a/NfMJJ <- Still not much luck, unless I'm still at the 
>> > wrong place
>> > --
>> > https://mail.python.org/mailman/listinfo/python-list
>
> Thanks, that seems to have worked. Out of curiosity, what did that change?

The key is that you have to run the command at the CMD prompt, not at
the Python interpreter prompt. The two commands "pip" and "python -m
pip" are basically equivalent, but the executables "python.exe" and
"pip.exe" are installed in different places, and it's possible that
one might be on your PATH but not the other. I knew you were able to
run "python", so I recommended "python -m pip" to avoid the risk that
"pip" wouldn't work because of PATH issues.

Hope that clarifies.
Paul
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue32604] Expose the subinterpreters C-API in Python for testing use.

2018-01-22 Thread Ned Deily

Ned Deily  added the comment:

@Eric, given the breadth of change introduced in the PR (including adding a new 
extension), I think it would be best if at all possible to get it in for beta 1 
if we can resolve the review comments in time.  If necessary and if there are 
no objections from other core developers, I would be willing to consider making 
an exception and allowing it into beta 2 as long as it remains a private 
interface. If it looks like it won't be in releasable shape by then, I think 
you should hold off for 3.8; doing otherwise would be unfair to others and to 
our downstream beta users / testers, for example, even if it is private, adding 
a new extension and setup.py changes potentially affect downstream packagers.

--

___
Python tracker 

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



Re: Help: 64bit python call c and got OSError: exception: access violation writing 0xFFFFFFFF99222A60

2018-01-22 Thread eryk sun
On Mon, Jan 22, 2018 at 9:00 PM, Jason Qian via Python-list
 wrote:
>
> I am using ctypes on Windows to interface with a dll  and it works fine
> on Linux and windows 32-bit python.  But, when using 64-bit python, we got
> error "exception: access violation writing 0x99222A60".
>
> from ctypes import *

Try to avoid * imports if it's a public module.

> lib = cdll.LoadLibrary('xxx.dll')

Just use CDLL directly. cdll.LoadLibrary is pointless, and
`cdll.xxx` is problematic in some cases because it caches CDLL
instances, which cache function pointers. Also, the ".dll" filename
extension isn't required in Windows.

> lib.createService.argtypes=[c_int,ctypes.c_char_p]
> lib.createService.restype=ctypes.c_int
>
> class myDriver(object):
> def init(self):
> self.obj = lib.loadInstance()

Since you didn't set loadInstance.restype, the result gets truncated
as a C int, the default result type.

I recommend defining an opaque ctypes struct (i.e. no defined fields)
for the C++ class. This provides type safety. Staying strict and
literal on types is more work than using a `void *` everywhere, but it
pays off in terms of easier debugging and more resilient code. A
simple example is that ctypes returns a `void *` result (or gets a
struct field or array item) as a Python integer. Then for any FFI call
that you may have forgotten to define argtypes, ctypes will default to
truncating this integer value as a C int. At best that causes an
immediate crash. At worst it's a subtle bug that corrupts data.

Here's an example implementation with an opaque struct:

import ctypes

lib = ctypes.CDLL('xxx')

class myPythonAPI(ctypes.Structure):
pass

PmyPythonAPI = ctypes.POINTER(myPythonAPI)

lib.loadInstance.restype = PmyPythonAPI
lib.loadInstance.argtypes = ()

lib.createService.restype = ctypes.c_int
lib.createService.argtypes = (PmyPythonAPI, ctypes.c_char_p)

class myDriver(object):

def init(self):
self.obj = lib.loadInstance()

def create_services(self, servicename):
return lib.createService(self.obj, servicename)
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue32626] Subscript unpacking raises SyntaxError

2018-01-22 Thread Ben Burrill

New submission from Ben Burrill :

PEP 448 defines unpacking generalizations for tuples.  However, this does not 
currently work for subscripted tuples that are not delimited by parentheses.

Current behavior (Tested on 3.6/3.7a4):
>>> class Subscriptable:
... def __getitem__(self, item):
... return item
...
>>> ss = Subscriptable()
>>> 
>>> 1, 2, 3
(1, 2, 3)
>>> ss[1, 2, 3]
(1, 2, 3)
>>> *range(5), 42
(0, 1, 2, 3, 4, 42)
>>> ss[*range(5), 42]  # This should be the same as above
  File "", line 1
ss[*range(5), 42]
   ^
SyntaxError: invalid syntax
>>> ss[(*range(5), 42)]  # Workaround
(0, 1, 2, 3, 4, 42)

--
components: Interpreter Core
messages: 310447
nosy: Ben Burrill
priority: normal
severity: normal
status: open
title: Subscript unpacking raises SyntaxError
type: behavior
versions: Python 3.7

___
Python tracker 

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



Re: Help: 64bit python call c and got OSError: exception: access violation writing 0xFFFFFFFF99222A60

2018-01-22 Thread Random832
On Mon, Jan 22, 2018, at 16:00, Jason Qian via Python-list wrote:
> Hello!
> 
>   I am using ctypes on Windows to interface with a dll  and it works fine
> on Linux and windows 32-bit python.  But, when using 64-bit python, we got
> error "exception: access violation writing 0x99222A60".

You are treating the obj type (myPythonAPI *) as c_int, which is only 32 bits. 
You should be using a pointer type instead (ideally you should be using void * 
and c_void_p, so Python doesn't need the class definition.) Don't forget to set 
lib.loadInstance.restype as well.

> __declspec(dllexport) myPythonAPI* loadInstance(){ return new
> myPythonAPI(); }
> __declspec(dllexport) int createService(myPythonAPI* obj, const char*
> serviceName) { eturn obj->createService(serviceName);

> lib = cdll.LoadLibrary('xxx.dll')
> 
> lib.createService.argtypes=[c_int,ctypes.c_char_p]
> lib.createService.restype=ctypes.c_int
> 
> class myDriver(object):
> def init(self):
> self.obj = lib.loadInstance()
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue22872] multiprocessing.Queue raises AssertionError

2018-01-22 Thread Jason Qian

Change by Jason Qian :


--
components: +ctypes -Library (Lib)
versions:  -Python 3.4, Python 3.5

___
Python tracker 

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



Help: 64bit python call c and got OSError: exception: access violation writing 0xFFFFFFFF99222A60

2018-01-22 Thread Jason Qian via Python-list
Hello!

  I am using ctypes on Windows to interface with a dll  and it works fine
on Linux and windows 32-bit python.  But, when using 64-bit python, we got
error "exception: access violation writing 0x99222A60".

Checking our server, it seems work without any problem. but the python
gives an error and stop the application.

-- c --
class myPythonAPI
{
public:
myPythonAPI();
int createService(const char* serviceName){ /* run our application*/};
}
extern "C" {
__declspec(dllexport) myPythonAPI* loadInstance(){ return new
myPythonAPI(); }
__declspec(dllexport) int createService(myPythonAPI* obj, const char*
serviceName) { eturn obj->createService(serviceName);
};

-- python --
from ctypes import *
lib = cdll.LoadLibrary('xxx.dll')

lib.createService.argtypes=[c_int,ctypes.c_char_p]
lib.createService.restype=ctypes.c_int

class myDriver(object):
def init(self):
self.obj = lib.loadInstance()

def create_services(self,servicename):
result=lib.createService(self.obj,servicename)
return result

driver=myDriver()
driver.create_services(b"myExample")

Thanks for the help
Jason
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to use asyncore with SSL?

2018-01-22 Thread breamoreboy
On Thursday, January 18, 2018 at 11:25:58 PM UTC, Grant Edwards wrote:
> I've been trying to use the secure smtpd module from
> https://github.com/bcoe/secure-smtpd, but the SSL support seems to be
> fundamentally broken.  That module simply wraps a socket and then
> expects to use it in the normal way via asyncore.
> 
> Of course that fails the first time an ssl-wrapped-socket's send or
> recv method raises SSLWantReadError or SSLWantWriteError.  Those
> exceptions aren't handled and it crashes.
> 
> That makes the SSL support pretty much useless.
> 
> I'm trying to fix that, but I can't find any information or
> documentation about using asyncore with SSL.
> 
> Alternatively, a pointer to a simpler smtp server library that
> supports SSL would be great. The use of asyncore and multiprocessing
> process pools by this module is _way_ overkill for my needs and
> results in something that 1) doesn't work, and 2) can't be debugged.
> 
> -- 
> Grant Edwards   grant.b.edwardsYow! Pardon me, but do you
>   at   know what it means to be
>   gmail.comTRULY ONE with your BOOTH!

I haven't tried it myself but I've just stumbled across this 
https://github.com/aio-libs/aiosmtpd.

--
Kindest regards.

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


[issue32615] Inconsistent behavior if globals is a dict subclass

2018-01-22 Thread ppperry

Change by ppperry :


--
type:  -> behavior

___
Python tracker 

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



[issue22499] [SSL: BAD_WRITE_RETRY] bad write retry in _ssl.c:1636

2018-01-22 Thread Xavier G. Domingo

Change by Xavier G. Domingo :


--
nosy: +xgdomingo

___
Python tracker 

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



[issue31122] SSLContext.wrap_socket() throws OSError with errno == 0

2018-01-22 Thread Xavier G. Domingo

Change by Xavier G. Domingo :


--
nosy: +xgdomingo

___
Python tracker 

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



[issue32625] Update the dis module documentation to reflect switch to wordcode

2018-01-22 Thread Alexander Belopolsky

Change by Alexander Belopolsky :


--
nosy: +vstinner

___
Python tracker 

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



[issue20767] Some python extensions can't be compiled with clang 3.4

2018-01-22 Thread Stefan Krah

Stefan Krah  added the comment:

Well, they had ample time to articulate themselves. :)

--

___
Python tracker 

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



[issue32597] Bad detection of clang

2018-01-22 Thread Stefan Krah

Change by Stefan Krah :


--
nosy:  -skrah

___
Python tracker 

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



[issue29344] sock_recv not detected a coroutine

2018-01-22 Thread Yury Selivanov

Yury Selivanov  added the comment:

They have been documented as coroutines and were returning futures since Python 
3.4. I believe we can keep the status quo especially if only one user 
complained about it during the last 5 years.

--

___
Python tracker 

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



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

2018-01-22 Thread STINNER Victor

STINNER Victor  added the comment:

I partially reverted the commit 7ed7aead9503102d2ed316175f198104e0cd674c: on 
Android, UTF-8 is now always used, again. Paul Peny (aka pmpp) confirmed me 
that my commit broke Python on Android, at least with API 19 (locales don't 
work properly before API 21).

--

___
Python tracker 

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



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

2018-01-22 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 9089a265918754d95e105a7c4c409ac9352c87bb by Victor Stinner in 
branch 'master':
bpo-29240: PyUnicode_DecodeLocale() uses UTF-8 on Android (#5272)
https://github.com/python/cpython/commit/9089a265918754d95e105a7c4c409ac9352c87bb


--

___
Python tracker 

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



[issue29344] sock_recv not detected a coroutine

2018-01-22 Thread Berker Peksag

Berker Peksag  added the comment:

Well, the current status quo has already confused a user (see msg286011)

> (so that people don't write code that expects them to be not coroutines in 
> 3.6)

Even if people expect these methods to be coroutines, two functions of the 
asyncio public API (iscoroutinefunction() and iscoroutine()) disagree with them 
as described in msg286011.

In similar scenarios, we've always keep the code as is and clarified the docs 
in stable releases, then changed the code behave as documented in master.

--

___
Python tracker 

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



[issue32625] Update the dis module documentation to reflect switch to wordcode

2018-01-22 Thread Alexander Belopolsky

Alexander Belopolsky  added the comment:

There is an uncommitted update for the EXTENDED_ARG opcode documentation 
attached to issue 27095 as mkfu4.patch by Demur Rumed.

--
nosy: +Demur Rumed

___
Python tracker 

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



[issue32625] Update the dis module documentation to reflect switch to wordcode

2018-01-22 Thread Alexander Belopolsky

New submission from Alexander Belopolsky :

A switch to wordcode is implemented in Python 3.6, but the documentation in the 
dis module was mostly left unchanged.  See issue 26647, msg266388 and issue 
27095, msg268389.

--
assignee: docs@python
components: Documentation
messages: 310440
nosy: belopolsky, docs@python
priority: normal
severity: normal
stage: needs patch
status: open
title: Update the dis module documentation to reflect switch to wordcode
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



[issue32624] Implement WriteTransport.is_protocol_paused()

2018-01-22 Thread Andrew Svetlov

New submission from Andrew Svetlov :

The method should return True is write is suspended

--
components: asyncio
messages: 310439
nosy: asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: Implement WriteTransport.is_protocol_paused()
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



[issue26647] ceval: use Wordcode, 16-bit bytecode

2018-01-22 Thread Alexander Belopolsky

Change by Alexander Belopolsky :


--
components: +Interpreter Core -Documentation
stage: needs patch -> resolved

___
Python tracker 

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



[issue20767] Some python extensions can't be compiled with clang 3.4

2018-01-22 Thread STINNER Victor

STINNER Victor  added the comment:

> I guess the FreeBSD people are happy with the solution.

According to the discussion on https://github.com/python/cpython/pull/5233 : 
some FreeBSD people are unhappy :-)

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



[issue32593] Drop support of FreeBSD 9 and older in Python 3.7

2018-01-22 Thread STINNER Victor

STINNER Victor  added the comment:

For the PR 5233 : I suggest to continue the discussion on bpo-20767. This PR is 
unrelated to this issue (drop support for old FreeBSDs).

--

___
Python tracker 

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



[issue32593] Drop support of FreeBSD 9 and older in Python 3.7

2018-01-22 Thread STINNER Victor

Change by STINNER Victor :


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



[issue32593] Drop support of FreeBSD 9 and older in Python 3.7

2018-01-22 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 13ff24582c99dfb439b1af7295b401415e7eb05b by Victor Stinner in 
branch 'master':
bpo-32593: Drop FreeBSD 9 and older support (#5232)
https://github.com/python/cpython/commit/13ff24582c99dfb439b1af7295b401415e7eb05b


--

___
Python tracker 

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



Re: Installing "kitchen" module

2018-01-22 Thread codydaviestv
On Tuesday, 23 January 2018 03:41:28 UTC+10:30, Paul  Moore  wrote:
> "python -m pip install kitchen" is probably your best approach (from
> the CMD prompt).
> 
> On 22 January 2018 at 16:31,   wrote:
> > On Tuesday, 23 January 2018 02:56:56 UTC+10:30, Paul  Moore  wrote:
> >> You need to run that command from a CMD prompt, not from inside the
> >> Python interpreter.
> >>
> >> On 22 January 2018 at 16:19,  cody wrote:
> >> > On Tuesday, 23 January 2018 02:41:04 UTC+10:30, bream...@gmail.com  
> >> > wrote:
> >> >> On Monday, January 22, 2018 at 3:37:44 PM UTC, codyda...@gmail.com 
> >> >> wrote:
> >> >> > So here's the situation. I am unfamiliar with Python but need it to 
> >> >> > export a wiki, so I have been following this tutorial, using the 
> >> >> > latest version of Python 2 on Windows 7:
> >> >> >
> >> >> > https://github.com/WikiTeam/wikiteam/wiki/Tutorial#I_have_no_shell_access_to_server
> >> >> >
> >> >> > I have everything working up to the point where I run it and it tells 
> >> >> > me this:
> >> >> >
> >> >> > "Please install the Kitchen module.
> >> >> > Please install or update the Requests module."
> >> >> >
> >> >> > One suggestion was that I try "import kitchen", but that gives me 
> >> >> > this error:
> >> >> >
> >> >> > "Traceback :
> >> >> >   File "", line 1, in 
> >> >> > ImportError: No module named kitchen"
> >> >> >
> >> >> > So I went to https://pypi.python.org/pypi/kitchen/ to download it, 
> >> >> > but that hasn't helped. Maybe it needs to be in a specific folder to 
> >> >> > work?
> >> >> >
> >> >> > Any help would be appreciated.
> >> >> >
> >> >> > P.S. Here is someone else running into the same problem but they 
> >> >> > seemed to have fixed it through a solution that didn't work for me 
> >> >> > (it doesn't recognise a command called sudo in the first place when I 
> >> >> > type it): https://github.com/WikiTeam/wikiteam/issues/252
> >> >>
> >> >> Forget sudo as that's a *nix command.  From the command line you should 
> >> >> be able to run:-
> >> >>
> >> >> pip install kitchen
> >> >> pip install requests
> >> >>
> >> >> --
> >> >> Kindest regards.
> >> >>
> >> >> Mark Lawrence.
> >> >
> >> > Here's what I see when I try that. Maybe I'm missing some kind of 
> >> > initial setup? https://i.imgur.com/XQHO19W.png
> >> > --
> >> > https://mail.python.org/mailman/listinfo/python-list
> >
> > https://imgur.com/a/NfMJJ <- Still not much luck, unless I'm still at the 
> > wrong place
> > --
> > https://mail.python.org/mailman/listinfo/python-list

Thanks, that seems to have worked. Out of curiosity, what did that change?
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue29344] sock_recv not detected a coroutine

2018-01-22 Thread Yury Selivanov

Yury Selivanov  added the comment:

Since we made them coroutines in 3.7, I'd prefer to keep the 3.6 documentation 
as is (so that people don't write code that expects them to be not coroutines 
in 3.6).

Please let's keep the current status quo.

--

___
Python tracker 

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



Re: Installing "kitchen" module

2018-01-22 Thread Paul Moore
"python -m pip install kitchen" is probably your best approach (from
the CMD prompt).

On 22 January 2018 at 16:31,   wrote:
> On Tuesday, 23 January 2018 02:56:56 UTC+10:30, Paul  Moore  wrote:
>> You need to run that command from a CMD prompt, not from inside the
>> Python interpreter.
>>
>> On 22 January 2018 at 16:19,  cody wrote:
>> > On Tuesday, 23 January 2018 02:41:04 UTC+10:30, bream...@gmail.com  wrote:
>> >> On Monday, January 22, 2018 at 3:37:44 PM UTC, codyda...@gmail.com wrote:
>> >> > So here's the situation. I am unfamiliar with Python but need it to 
>> >> > export a wiki, so I have been following this tutorial, using the latest 
>> >> > version of Python 2 on Windows 7:
>> >> >
>> >> > https://github.com/WikiTeam/wikiteam/wiki/Tutorial#I_have_no_shell_access_to_server
>> >> >
>> >> > I have everything working up to the point where I run it and it tells 
>> >> > me this:
>> >> >
>> >> > "Please install the Kitchen module.
>> >> > Please install or update the Requests module."
>> >> >
>> >> > One suggestion was that I try "import kitchen", but that gives me this 
>> >> > error:
>> >> >
>> >> > "Traceback :
>> >> >   File "", line 1, in 
>> >> > ImportError: No module named kitchen"
>> >> >
>> >> > So I went to https://pypi.python.org/pypi/kitchen/ to download it, but 
>> >> > that hasn't helped. Maybe it needs to be in a specific folder to work?
>> >> >
>> >> > Any help would be appreciated.
>> >> >
>> >> > P.S. Here is someone else running into the same problem but they seemed 
>> >> > to have fixed it through a solution that didn't work for me (it doesn't 
>> >> > recognise a command called sudo in the first place when I type it): 
>> >> > https://github.com/WikiTeam/wikiteam/issues/252
>> >>
>> >> Forget sudo as that's a *nix command.  From the command line you should 
>> >> be able to run:-
>> >>
>> >> pip install kitchen
>> >> pip install requests
>> >>
>> >> --
>> >> Kindest regards.
>> >>
>> >> Mark Lawrence.
>> >
>> > Here's what I see when I try that. Maybe I'm missing some kind of initial 
>> > setup? https://i.imgur.com/XQHO19W.png
>> > --
>> > https://mail.python.org/mailman/listinfo/python-list
>
> https://imgur.com/a/NfMJJ <- Still not much luck, unless I'm still at the 
> wrong place
> --
> https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue29344] sock_recv not detected a coroutine

2018-01-22 Thread Berker Peksag

Berker Peksag  added the comment:

> We only fixed it in 3.7 and the doc was updated.  3.6 stays as is.

I'm not talking about fixing code in 3.6. In 3.6, sock_* methods still 
documented as coroutines but they are normal functions:

* 
https://docs.python.org/3.6/library/asyncio-eventloop.html#low-level-socket-operations
* 
https://github.com/python/cpython/blob/4002d5dbf4c058bbf2462f9f5dea057956d1caff/Doc/library/asyncio-eventloop.rst#low-level-socket-operations
* 
https://github.com/python/cpython/blob/4002d5dbf4c058bbf2462f9f5dea057956d1caff/Lib/asyncio/selector_events.py#L354

3.6 documentation still needs to be fixed. See my patch.

--

___
Python tracker 

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



[issue32623] Resize dict on del/pop

2018-01-22 Thread STINNER Victor

STINNER Victor  added the comment:

Note: It was recently discussed if "del dict[key]" should keep the insertion 
order. If I understood correctly: yes, the order must be preserved on deletion.

https://mail.python.org/pipermail/python-dev/2017-November/150142.html

--

___
Python tracker 

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



[issue31179] Speed-up dict.copy() up to 5.5 times.

2018-01-22 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



[issue31179] Speed-up dict.copy() up to 5.5 times.

2018-01-22 Thread Yury Selivanov

Yury Selivanov  added the comment:


New changeset b0a7a037b8fde56b62f886d5188bced7776777b4 by Yury Selivanov in 
branch 'master':
bpo-31179: Make dict.copy() up to 5.5 times faster. (#3067)
https://github.com/python/cpython/commit/b0a7a037b8fde56b62f886d5188bced7776777b4


--

___
Python tracker 

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



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

2018-01-22 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +5116

___
Python tracker 

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



[issue29344] sock_recv not detected a coroutine

2018-01-22 Thread Berker Peksag

Berker Peksag  added the comment:

Andrew, shouldn't we fix 3.6 documentation? sock_* methods still documented as 
coroutines.

--

___
Python tracker 

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



[issue29344] sock_recv not detected a coroutine

2018-01-22 Thread Yury Selivanov

Yury Selivanov  added the comment:

> Andrew, shouldn't we fix 3.6 documentation? sock_* methods still documented 
> as coroutines.

We only fixed it in 3.7 and the doc was updated.  3.6 stays as is.

--

___
Python tracker 

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



[issue32607] After Python Installation Error

2018-01-22 Thread Shrivatsa Hosabettu

Shrivatsa Hosabettu  added the comment:

Hi,

 Thanks for the information. I re-installed Python and Django again and the 
problem is resolved.

Now when I run the command py -E -S I got the below message and python is 
running fine.

3.6.4 (v3.6.4:d48eceb, Dec 19 2017, 06:04:45) [MSC v.1900 32 bit (Intel)]

you can mark this as closed.

--

___
Python tracker 

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



Re: Installing "kitchen" module

2018-01-22 Thread codydaviestv
On Tuesday, 23 January 2018 02:56:56 UTC+10:30, Paul  Moore  wrote:
> You need to run that command from a CMD prompt, not from inside the
> Python interpreter.
> 
> On 22 January 2018 at 16:19,  cody wrote:
> > On Tuesday, 23 January 2018 02:41:04 UTC+10:30, bream...@gmail.com  wrote:
> >> On Monday, January 22, 2018 at 3:37:44 PM UTC, codyda...@gmail.com wrote:
> >> > So here's the situation. I am unfamiliar with Python but need it to 
> >> > export a wiki, so I have been following this tutorial, using the latest 
> >> > version of Python 2 on Windows 7:
> >> >
> >> > https://github.com/WikiTeam/wikiteam/wiki/Tutorial#I_have_no_shell_access_to_server
> >> >
> >> > I have everything working up to the point where I run it and it tells me 
> >> > this:
> >> >
> >> > "Please install the Kitchen module.
> >> > Please install or update the Requests module."
> >> >
> >> > One suggestion was that I try "import kitchen", but that gives me this 
> >> > error:
> >> >
> >> > "Traceback :
> >> >   File "", line 1, in 
> >> > ImportError: No module named kitchen"
> >> >
> >> > So I went to https://pypi.python.org/pypi/kitchen/ to download it, but 
> >> > that hasn't helped. Maybe it needs to be in a specific folder to work?
> >> >
> >> > Any help would be appreciated.
> >> >
> >> > P.S. Here is someone else running into the same problem but they seemed 
> >> > to have fixed it through a solution that didn't work for me (it doesn't 
> >> > recognise a command called sudo in the first place when I type it): 
> >> > https://github.com/WikiTeam/wikiteam/issues/252
> >>
> >> Forget sudo as that's a *nix command.  From the command line you should be 
> >> able to run:-
> >>
> >> pip install kitchen
> >> pip install requests
> >>
> >> --
> >> Kindest regards.
> >>
> >> Mark Lawrence.
> >
> > Here's what I see when I try that. Maybe I'm missing some kind of initial 
> > setup? https://i.imgur.com/XQHO19W.png
> > --
> > https://mail.python.org/mailman/listinfo/python-list

https://imgur.com/a/NfMJJ <- Still not much luck, unless I'm still at the wrong 
place
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue31179] Speed-up dict.copy() up to 5.5 times.

2018-01-22 Thread Yury Selivanov

Yury Selivanov  added the comment:

Victor: done; https://bugs.python.org/issue32623

--

___
Python tracker 

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



[issue32623] Resize dict on del/pop

2018-01-22 Thread Yury Selivanov

New submission from Yury Selivanov :

We should investigate whether we want dicts to compact themselves on del/pop 
operations.  Currently we have to rely on workarounds to have compactable 
dict.copy (see issue 31179) etc.

--
components: Interpreter Core
messages: 310427
nosy: inada.naoki, serhiy.storchaka, vstinner, yselivanov
priority: normal
severity: normal
status: open
title: Resize dict on del/pop
type: enhancement
versions: Python 3.8

___
Python tracker 

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



Re: Installing "kitchen" module

2018-01-22 Thread alister via Python-list
On Mon, 22 Jan 2018 08:19:51 -0800, codydaviestv wrote:

> On Tuesday, 23 January 2018 02:41:04 UTC+10:30, bream...@gmail.com 
> wrote:
>> On Monday, January 22, 2018 at 3:37:44 PM UTC, codyda...@gmail.com
>> wrote:
>> > So here's the situation. I am unfamiliar with Python but need it to
>> > export a wiki, so I have been following this tutorial, using the
>> > latest version of Python 2 on Windows 7:
>> > 
>> > https://github.com/WikiTeam/wikiteam/wiki/
Tutorial#I_have_no_shell_access_to_server
>> > 
>> > I have everything working up to the point where I run it and it tells
>> > me this:
>> > 
>> > "Please install the Kitchen module.
>> > Please install or update the Requests module."
>> > 
>> > One suggestion was that I try "import kitchen", but that gives me
>> > this error:
>> > 
>> > "Traceback :
>> >   File "", line 1, in 
>> > ImportError: No module named kitchen"
>> > 
>> > So I went to https://pypi.python.org/pypi/kitchen/ to download it,
>> > but that hasn't helped. Maybe it needs to be in a specific folder to
>> > work?
>> > 
>> > Any help would be appreciated.
>> > 
>> > P.S. Here is someone else running into the same problem but they
>> > seemed to have fixed it through a solution that didn't work for me
>> > (it doesn't recognise a command called sudo in the first place when I
>> > type it): https://github.com/WikiTeam/wikiteam/issues/252
>> 
>> Forget sudo as that's a *nix command.  From the command line you should
>> be able to run:-
>> 
>> pip install kitchen pip install requests
>> 
>> --
>> Kindest regards.
>> 
>> Mark Lawrence.
> 
> Here's what I see when I try that. Maybe I'm missing some kind of
> initial setup? https://i.imgur.com/XQHO19W.png

run it from the windows command line not the Python prompt



-- 
Scientists will study your brain to learn more about your distant cousin, 
Man.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Installing "kitchen" module

2018-01-22 Thread Paul Moore
You need to run that command from a CMD prompt, not from inside the
Python interpreter.

On 22 January 2018 at 16:19,   wrote:
> On Tuesday, 23 January 2018 02:41:04 UTC+10:30, bream...@gmail.com  wrote:
>> On Monday, January 22, 2018 at 3:37:44 PM UTC, codyda...@gmail.com wrote:
>> > So here's the situation. I am unfamiliar with Python but need it to export 
>> > a wiki, so I have been following this tutorial, using the latest version 
>> > of Python 2 on Windows 7:
>> >
>> > https://github.com/WikiTeam/wikiteam/wiki/Tutorial#I_have_no_shell_access_to_server
>> >
>> > I have everything working up to the point where I run it and it tells me 
>> > this:
>> >
>> > "Please install the Kitchen module.
>> > Please install or update the Requests module."
>> >
>> > One suggestion was that I try "import kitchen", but that gives me this 
>> > error:
>> >
>> > "Traceback :
>> >   File "", line 1, in 
>> > ImportError: No module named kitchen"
>> >
>> > So I went to https://pypi.python.org/pypi/kitchen/ to download it, but 
>> > that hasn't helped. Maybe it needs to be in a specific folder to work?
>> >
>> > Any help would be appreciated.
>> >
>> > P.S. Here is someone else running into the same problem but they seemed to 
>> > have fixed it through a solution that didn't work for me (it doesn't 
>> > recognise a command called sudo in the first place when I type it): 
>> > https://github.com/WikiTeam/wikiteam/issues/252
>>
>> Forget sudo as that's a *nix command.  From the command line you should be 
>> able to run:-
>>
>> pip install kitchen
>> pip install requests
>>
>> --
>> Kindest regards.
>>
>> Mark Lawrence.
>
> Here's what I see when I try that. Maybe I'm missing some kind of initial 
> setup? https://i.imgur.com/XQHO19W.png
> --
> https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Installing "kitchen" module

2018-01-22 Thread breamoreboy
On Monday, January 22, 2018 at 3:37:44 PM UTC, codyda...@gmail.com wrote:
> So here's the situation. I am unfamiliar with Python but need it to export a 
> wiki, so I have been following this tutorial, using the latest version of 
> Python 2 on Windows 7:
> 
> https://github.com/WikiTeam/wikiteam/wiki/Tutorial#I_have_no_shell_access_to_server
> 
> I have everything working up to the point where I run it and it tells me this:
> 
> "Please install the Kitchen module.
> Please install or update the Requests module."
> 
> One suggestion was that I try "import kitchen", but that gives me this error:
> 
> "Traceback :
>   File "", line 1, in 
> ImportError: No module named kitchen"
> 
> So I went to https://pypi.python.org/pypi/kitchen/ to download it, but that 
> hasn't helped. Maybe it needs to be in a specific folder to work?
> 
> Any help would be appreciated.
> 
> P.S. Here is someone else running into the same problem but they seemed to 
> have fixed it through a solution that didn't work for me (it doesn't 
> recognise a command called sudo in the first place when I type it): 
> https://github.com/WikiTeam/wikiteam/issues/252

Forget sudo as that's a *nix command.  From the command line you should be able 
to run:-

pip install kitchen
pip install requests

--
Kindest regards.

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


Re: Installing "kitchen" module

2018-01-22 Thread codydaviestv
On Tuesday, 23 January 2018 02:41:04 UTC+10:30, bream...@gmail.com  wrote:
> On Monday, January 22, 2018 at 3:37:44 PM UTC, codyda...@gmail.com wrote:
> > So here's the situation. I am unfamiliar with Python but need it to export 
> > a wiki, so I have been following this tutorial, using the latest version of 
> > Python 2 on Windows 7:
> > 
> > https://github.com/WikiTeam/wikiteam/wiki/Tutorial#I_have_no_shell_access_to_server
> > 
> > I have everything working up to the point where I run it and it tells me 
> > this:
> > 
> > "Please install the Kitchen module.
> > Please install or update the Requests module."
> > 
> > One suggestion was that I try "import kitchen", but that gives me this 
> > error:
> > 
> > "Traceback :
> >   File "", line 1, in 
> > ImportError: No module named kitchen"
> > 
> > So I went to https://pypi.python.org/pypi/kitchen/ to download it, but that 
> > hasn't helped. Maybe it needs to be in a specific folder to work?
> > 
> > Any help would be appreciated.
> > 
> > P.S. Here is someone else running into the same problem but they seemed to 
> > have fixed it through a solution that didn't work for me (it doesn't 
> > recognise a command called sudo in the first place when I type it): 
> > https://github.com/WikiTeam/wikiteam/issues/252
> 
> Forget sudo as that's a *nix command.  From the command line you should be 
> able to run:-
> 
> pip install kitchen
> pip install requests
> 
> --
> Kindest regards.
> 
> Mark Lawrence.

Here's what I see when I try that. Maybe I'm missing some kind of initial 
setup? https://i.imgur.com/XQHO19W.png
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue31179] Speed-up dict.copy() up to 5.5 times.

2018-01-22 Thread STINNER Victor

STINNER Victor  added the comment:

Yury: Would you mind to open an issue to investigate why dict are not 
compatected automatically?

--

___
Python tracker 

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



[issue31801] vars() manipulation encounters problems with Enum

2018-01-22 Thread Ethan Furman

Ethan Furman  added the comment:


New changeset a4b1bb4801f7a941ff9e86b96da539be1c288833 by Ethan Furman in 
branch 'master':
bpo-31801:  Enum:  add _ignore_ as class option (#5237)
https://github.com/python/cpython/commit/a4b1bb4801f7a941ff9e86b96da539be1c288833


--

___
Python tracker 

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



Installing "kitchen" module

2018-01-22 Thread codydaviestv
So here's the situation. I am unfamiliar with Python but need it to export a 
wiki, so I have been following this tutorial, using the latest version of 
Python 2 on Windows 7:

https://github.com/WikiTeam/wikiteam/wiki/Tutorial#I_have_no_shell_access_to_server

I have everything working up to the point where I run it and it tells me this:

"Please install the Kitchen module.
Please install or update the Requests module."

One suggestion was that I try "import kitchen", but that gives me this error:

"Traceback :
  File "", line 1, in 
ImportError: No module named kitchen"

So I went to https://pypi.python.org/pypi/kitchen/ to download it, but that 
hasn't helped. Maybe it needs to be in a specific folder to work?

Any help would be appreciated.

P.S. Here is someone else running into the same problem but they seemed to have 
fixed it through a solution that didn't work for me (it doesn't recognise a 
command called sudo in the first place when I type it): 
https://github.com/WikiTeam/wikiteam/issues/252
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue32616] Significant performance problems with Python 2.7 built with clang 3.x or 4.x

2018-01-22 Thread Zhiming Wang

Zhiming Wang  added the comment:

My benchmarks above do contain py37 (master) stats.

--

___
Python tracker 

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



[issue32616] Significant performance problems with Python 2.7 built with clang 3.x or 4.x

2018-01-22 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

Has anyone done the same analysis with Python 3.6 or 3.7?

--
nosy: +barry

___
Python tracker 

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



close figure after plot

2018-01-22 Thread jorge . conrado

Hi,

I have several satellite data (500 images). I read it and plot using 
plt.show(). I would like know how can I delete the window after  I save 
the image. I use plt.close(), plt.close('all') but these options didn't 
work.


Thanks,

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


[issue32622] Implement loop.sendfile

2018-01-22 Thread Andrew Svetlov

Change by Andrew Svetlov :


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

___
Python tracker 

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



[issue32622] Implement loop.sendfile

2018-01-22 Thread Andrew Svetlov

Change by Andrew Svetlov :


--
components: asyncio
nosy: asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: Implement loop.sendfile
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



[issue32621] Problem of consistence in collection.abc documentation

2018-01-22 Thread Yahya Abou Imran

New submission from Yahya Abou Imran :

Opened after https://github.com/python/cpython/pull/5270 was closed.

Here:

https://docs.python.org/3/library/collections.abc.html

Some abstract methods are inherited from a superclass.
Most of the time the name of the method is mentioned in the subclass.

For example:

Collection inherit from Sized, Iterable and Contains.
But __len__, __iter__ and __contains__ are mentioned, even if they are 
inherited.

Mapping inherits from Collection, but __len__ and __iter__ appears in the table

There is one exception: Coroutine.
It inherits from Awaitable but we don't see __await__.

What would we do? Let all appear or not?

--
messages: 310422
nosy: yahya-abou-imran
priority: normal
severity: normal
status: open
title: Problem of consistence in collection.abc documentation
type: enhancement
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



  1   2   >