[issue32402] Coverity: CID 1426868/1426867: Null pointer dereferences in textio.c

2017-12-21 Thread INADA Naoki

Change by INADA Naoki :


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

___
Python tracker 

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



[issue32401] No module named '_ctypes'

2017-12-21 Thread Chi Hsuan Yen

Chi Hsuan Yen  added the comment:

Most likely the same issue as issue31652. Passing --without-ensurepip to 
./configure is a workaround.

--
nosy: +Chi Hsuan Yen

___
Python tracker 

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



[issue28236] In xml.etree.ElementTree Element can be created with empty and None tag

2017-12-21 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

I don't think this is worth fixing.  The package is under no obligation to make 
early type checks for arguments.  It is typical in the Python world to let 
those kinds of input errors surface downstream when they are used.  In 
contrast, C code typically does the checks when the arguments are passed in.

--
nosy: +rhettinger

___
Python tracker 

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



[issue32408] Performance regression in urllib.proxy_bypass_environment

2017-12-21 Thread Xiang Zhang

New submission from Xiang Zhang :

Recently we update our environment from Python2.7.5 to Python2.7.13. Then one 
process's CPU usage grow from 15% to 70%. The cause is 
urllib.proxy_bypass_environment, the commit I wrote in #26864. Our environments 
get a no_proxy environment variable which contains 4000+ items. See the 
performance difference:

cascading-controller:~ # time python2 -c 'import urllib; 
urllib.proxy_bypass_environment("1.1.1.1")'

real0m1.134s
user0m1.126s
sys 0m0.007s
cascading-controller:~ # time python2 -c 'import urllib; 
urllib.proxy_bypass_environment("1.1.1.1")'

real0m0.037s
user0m0.024s
sys 0m0.013s

Temporarily I increased regex cache size to 6000 and the CPU usage and time 
return to a reasonable range.

--
components: Library (Lib)
messages: 308924
nosy: xiang.zhang
priority: normal
severity: normal
status: open
title: Performance regression in urllib.proxy_bypass_environment
type: performance
versions: Python 2.7, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue32407] lib2to3 doesn't work when zipped

2017-12-21 Thread Benjamin Peterson

New submission from Benjamin Peterson :

2to3 pokes around on the file system to find the grammar files it needs in 
source or pickled form. This makes it not work if lib2to3 is running from a zip 
file. lib2to3 should use pkgutil.get_data() instead to load grammar files.

--
components: 2to3 (2.x to 3.x conversion tool)
messages: 308923
nosy: benjamin.peterson
priority: normal
severity: normal
status: open
title: lib2to3 doesn't work when zipped
type: behavior
versions: Python 2.7, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue32386] dynload_next.c is obsolete

2017-12-21 Thread Benjamin Peterson

Benjamin Peterson  added the comment:


New changeset 62ed6be8da5fd1142f838582ecdb338af539e85b by Benjamin Peterson in 
branch 'master':
remove the dynload_next.c file (closes bpo-32386) (#4957)
https://github.com/python/cpython/commit/62ed6be8da5fd1142f838582ecdb338af539e85b


--
nosy: +benjamin.peterson
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



[issue32405] clr: AttributeError: 'module' object has no attribute 'AddReference'

2017-12-21 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

I am 99.99% sure that this is not an IDLE issue.  IDLE submits your code to 
Python to be exec-ed.  The exception comes from Python.  You should get the 
same exception (though with a different fake file name) if you ran the same 
code directly with Python, without IDLE running.

--
assignee: terry.reedy -> 
components:  -IDLE

___
Python tracker 

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



Re: Python Learning

2017-12-21 Thread Rustom Mody
On Friday, December 22, 2017 at 12:12:58 AM UTC+5:30, Python wrote:
> On Fri, Dec 15, 2017 at 04:51:09PM -0500, Bill wrote:
> > >I'm new to programming, can anyone guide me, how to start learning python 
> > >programming language,...plz suggest some books also.
> > >
> > >Thanks all
> > 
> > Are you sure you want to learn Python first?
> > Python does enough things "behind the scene"
> > that it makes me question the wisdom of that.
> > Other points of view are welcome, of course.
> > Learning the primitives of C++ first, may make for an easier transition.
> 
> This suggestion seems completely backwards to me.

In the locution "computer programming" there are two words
One can choose which one emphasizes I guess??

My own teacher of programming used to relate that when his teacher taught him
assembly language was "programming" and Fortran as "advanced"
Obviously the world today is different from the 1960s

But Gödel's theorem remains true as ever: No formal system (aka language)
is complete (suitable) for expressing everything
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: property decorator?

2017-12-21 Thread Irv Kalb
Thanks to Rob, Cameron, Ian, Chris and Kirill for the detailed explanations.

Very helpful,

Irv

> On Dec 20, 2017, at 3:56 PM, Irv Kalb  wrote:
> 
> I am trying  to work through the concept of the @property decorator with 
> respect to object oriented programming.
> 
> I believe that I understand how the @property and @.setter work 
> - and that they are used to turn what looks like direct access to instance 
> variables into method calls in an object.It seems like these two 
> decorators are essentially fancy substitutes for traditional getter and 
> setter methods.  But, I'm having a hard time understanding why these names 
> were chosen. 
> 
> I have the following example code:
> 
> 
> class Employee():
> 
>def __init__(self, name, salary):
>self.__name = name
>self.__salary = salary
> 
>@property
>def salary(self):
>print('Getting salary of', self.__name, 'which is:', self.__salary)
>return self.__salary
> 
>@salary.setter
>def salary(self, newSalary):
>print('Setting salary of', self.__name, 'to:', newSalary)
>self.__salary = newSalary
> 
> 
> # Test code:
> employee1 = Employee('Joe Schmoe', 9)
> employee2 = Employee('Jane Smith', 123456)
> 
> print(employee1.salary)
> print(employee2.salary)
> 
> employee1.salary = 10
> employee2.salary = 22
> 
> print(employee1.salary)
> print(employee2.salary)
> 
> 
> When it runs, I get the results I expect:
> 
> Getting salary of Joe Schmoe which is: 9
> 9
> Getting salary of Jane Smith which is: 123456
> 123456
> Setting salary of Joe Schmoe to: 10
> Setting salary of Jane Smith to: 22
> Getting salary of Joe Schmoe which is: 10
> 10
> Getting salary of Jane Smith which is: 22
> 22
> 
> 
> My questions about this are really historical.  From my reading, it looks 
> like using an @property decorator is a reference to an older approach using a 
> built in "property" function.  But here goes:
> 
> 1) Why were these decorator names chosen?  These two names @property and 
> @.setter don't seem to be very clear to me.  At a minimum, they don't 
> match.  Wouldn't decorator names like @.getter and @.setter have 
> been better - more explicit?
> 
> 2)  Alternatively, if the getter was going to use the @property decorator, 
> then it would seem complimentary  to have the decorator name for the 
> associated setter function to have the word "property" in its also, something 
> like @propertySetter.  
> 
> 3)  If I create a method with the @property decorator, is there anything else 
> that is implied about the name of the method other than you can now refer to 
> the . - which calls the appropriate method?  My 
> guess/understanding is that in my example above, "salary" is considered the 
> property name, which is how you would refer to it outside of the object. 
> Inside the class, you use the property name as the name of both the setter 
> and the getter methods.  Is that the right way to think about it?
> 
> 
> Finally, it seems very odd to me that when you use the @property decorator 
> and the @.setter, that both of the methods that are decorated 
> need to have the same name (but of course different set of parameters.)  As a 
> teacher, this seems like it would be an extremely difficult concept to get 
> across to students, as this does not work the same way as other Python 
> functions (and methods).  Without a decorator, the second function of the 
> same name overrides an earlier function of the same name, as in this simple 
> example:
> 
> def myFunction( ):
>print('In first version of myFunction')
> 
> def myFunction( ):
>print('In second version of myFunction')
> 
> myFunction()
> 
> Which prints:  In second version of myFunction
> 
> 
> 
> 
> My most recent language before Python was ActionScript 3 (the language of 
> Flash).  It implemented a similar concept of being able to use what appeared 
> to be an explicit data reference which turns into a method call, like this 
> example (from StackOverflow):
> 
> private var _loggy:String;
> 
> public function get loggy ():String
> {
>  return _loggy;
> }
> 
> public function set loggy ( loggy:String ):void
> {
>  // checking to make sure loggy's new value is kosher etc...
>  _loggy = loggy;
> }
> This syntax made the concept easy to understand and implement in an 
> ActionScript class (even though it also uses the same name for both function).
> 
> I do NOT want to start any kind of language flame war.  I am really just 
> trying to understand the reasons behind why this concept is implemented in 
> Python this way, so that I can wrap my head around it and teach it 
> effectively in my classes.
> 
> Irv
> 
> -- 
> https://mail.python.org/mailman/listinfo/python-list
> 

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


[issue32216] Document PEP 557 Data Classes (dataclasses module)

2017-12-21 Thread STINNER Victor

STINNER Victor  added the comment:

My Issue32406 has been marked as a duplicate of this one. Copy of my message:

bpo-32214 "Implement PEP 557: Data Classes" added a new dataclasses module and 
was closed, but the new module is not documented:
https://docs.python.org/dev/library/dataclasses.html

And it's also missing from What's New in Python 3.7:
https://docs.python.org/dev/whatsnew/3.7.html

--
nosy: +vstinner

___
Python tracker 

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



[issue32406] Doc: The new dataclasses module is not documented

2017-12-21 Thread Eric V. Smith

Eric V. Smith  added the comment:

This is a duplicate of #32216, which is no doubt hard to find because the 
subject doesn't contain "dataclasses". I've fixed that.

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



[issue32216] Document PEP 557 Data Classes (dataclasses module)

2017-12-21 Thread Eric V. Smith

Change by Eric V. Smith :


--
title: Document PEP 557 Data Classes -> Document PEP 557 Data Classes 
(dataclasses module)

___
Python tracker 

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



[issue32406] Doc: The new dataclasses module is not documented

2017-12-21 Thread STINNER Victor

New submission from STINNER Victor :

bpo-32214 "Implement PEP 557: Data Classes" added a new dataclasses module and 
was closed, but the new module is not documented:
https://docs.python.org/dev/library/dataclasses.html

And it's also missing from What's New in Python 3.7:
https://docs.python.org/dev/whatsnew/3.7.html

--
assignee: docs@python
components: Documentation
messages: 308918
nosy: docs@python, eric.smith, vstinner
priority: normal
severity: normal
status: open
title: Doc: The new dataclasses module is not documented
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



[issue20891] PyGILState_Ensure on non-Python thread causes fatal error

2017-12-21 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 2e1ef00171179a8b906631b175cde2e68a804522 by Victor Stinner in 
branch '3.6':
bpo-20891: Skip test_embed.test_bpo20891() (#4967) (#4969)
https://github.com/python/cpython/commit/2e1ef00171179a8b906631b175cde2e68a804522


--

___
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

2017-12-21 Thread STINNER Victor

STINNER Victor  added the comment:

IHMO test_readline should be fixed by ignoring the UTF-8 mode in 
Py_EncodeLocale/Py_DecodeLocale, but only when called from the Python readline 
module. We need maybe new functions, something like: 
Py_EncodeCurrentLocale/Py_DecodeCurrentLocale.

I will work on a patch when I will be back from holiday. In the meanwhile, I 
skipped the test to repair FreeBSD 3.x buildbots.

--

___
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

2017-12-21 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 424315fa865b43f67e36a40647107379adf031da by Victor Stinner in 
branch 'master':
bpo-29240: Skip test_readline.test_nonascii() (#4968)
https://github.com/python/cpython/commit/424315fa865b43f67e36a40647107379adf031da


--

___
Python tracker 

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



[issue20891] PyGILState_Ensure on non-Python thread causes fatal error

2017-12-21 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +4861

___
Python tracker 

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



[issue20891] PyGILState_Ensure on non-Python thread causes fatal error

2017-12-21 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 550ee051d605b909dd75ef686d8e1244a0994394 by Victor Stinner in 
branch 'master':
bpo-20891: Skip test_embed.test_bpo20891() (#4967)
https://github.com/python/cpython/commit/550ee051d605b909dd75ef686d8e1244a0994394


--

___
Python tracker 

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



[issue32405] clr: AttributeError: 'module' object has no attribute 'AddReference'

2017-12-21 Thread Ranya

Ranya  added the comment:

Could you provide me a link to contact the clr community please?

--

___
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

2017-12-21 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +4860

___
Python tracker 

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



[issue20891] PyGILState_Ensure on non-Python thread causes fatal error

2017-12-21 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +4859

___
Python tracker 

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



[issue32405] clr: AttributeError: 'module' object has no attribute 'AddReference'

2017-12-21 Thread R. David Murray

R. David Murray  added the comment:

Whatever clr is, it doesn't look like it is part of the Python standard 
library.  Please contact the clr community for support on this package, or post 
to the python-list mailing list.

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



[issue32399] _uuidmodule.c cannot build on AIX - different typedefs of uuid_t, etc..

2017-12-21 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Keep in mind _uuid is an optional C extension that is used to accelerate the 
uuid module when available.  It doesn't bring any additional functionality by 
itself.

--
nosy: +pitrou

___
Python tracker 

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



[issue28236] In xml.etree.ElementTree Element can be created with empty and None tag

2017-12-21 Thread Gordon P. Hemsley

Gordon P. Hemsley  added the comment:

I decided to take a look at this, since it seems easy...

At first glance, this would appear to be a straightforward change--the docs 
state in multiple places that Element() takes a string as its tag argument.

But it turns out that a lot of internal functionality depends on passing in 
non-strings as the tag value.

--
nosy: +gphemsley

___
Python tracker 

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



[issue32405] clr: AttributeError: 'module' object has no attribute 'AddReference'

2017-12-21 Thread Ranya

New submission from Ranya :

Am trying to use clr.AddReference and clr.AddReferenceToFile to import an 
assembly, but python(2.7) keeps making this error:

Traceback (most recent call last):
  File "", line 1, in 
clr.AddReference("UnityEngine")
AttributeError: 'module' object has no attribute 'AddReference'

Can anyone tell me how to fix this.

--
assignee: terry.reedy
components: IDLE
messages: 308909
nosy: Rany, terry.reedy
priority: normal
severity: normal
status: open
title: clr: AttributeError: 'module' object has no attribute 'AddReference'
versions: Python 2.7

___
Python tracker 

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



[issue32404] fromtimestamp does not call __new__ in datetime subclasses

2017-12-21 Thread Paul Ganssle

New submission from Paul Ganssle :

In writing some tests for the alternate date constructors as part of my PR for 
issue 32403 (https://bugs.python.org/issue32403), I noticed that for 
`datetime`, the `fromtimestamp` bypasses the `__new__` call on the subclass:

from datetime import datetime

args = (2003, 4, 14)
ts = 1050292800.0   # Equivalent timestamp
d_ord = 731319  # Equivalent ordinal date


class DatetimeSubclass(datetime):
def __new__(cls, *args, **kwargs):
result = datetime.__new__(cls, *args, **kwargs)
result.extra = 7
return result


base_d = DatetimeSubclass(*args)
assert isinstance(base_d, DatetimeSubclass) # Passes
assert base_d.extra == 7# Passes

ord_d = DatetimeSubclass.fromordinal(d_ord)
assert isinstance(ord_d, DatetimeSubclass)  # Passes
assert ord_d.extra == 7 # Passes

ts_d = DatetimeSubclass.fromtimestamp(ts)
assert isinstance(ts_d, DatetimeSubclass)   # Passes
assert ts_d.extra == 7  # Fails

Replacing `datetime` with `date` in the above code we don't get a failure, but 
with `datetime`, it fails with:

AttributeError: 'DatetimeSubclass' object has no attribute 'extra'

Regardless of the status of 32403, I think this should be fixed (though I can 
try to fix them both at the same time).

--
messages: 308908
nosy: belopolsky, p-ganssle
priority: normal
severity: normal
status: open
title: fromtimestamp does not call __new__ in datetime subclasses
versions: Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue32403] date, time and datetime alternate constructors should take fast construction path

2017-12-21 Thread Paul Ganssle

New submission from Paul Ganssle :

In the addition of the `fromisoformat()` alternate constructor (bpo-15873: 
https://github.com/python/cpython/pull/4699), I noted that I was able to get 
some significant speedup by special-casing the `datetime` baseclass in the C 
code so that it bypasses the Python constructor, by replacing code that looks 
like this:

return PyObject_CallFunction(cls, "iii", year, month, day);

With code that looks like this:

PyObject *result;
if ( (PyTypeObject *)cls == & PyDateTime_DateType ) {
result = new_date_ex(year, month, day, (PyTypeObject *)cls);
} else {
result = PyObject_CallFunction(cls, "iii", year, month, day);
}

return result;

(This is for `date`, but the results are even more striking for `datetime`).

In my initial proof of concept implementation of a `new_date_subclass_ex` 
method, I've seen (this is not compiled with optimizations on, mind you) 
speedups for the other constructors as well:

Old constructor:

Class: date
constructor:940.5ns
date.fromordinal:   1544.8ns
date.fromtimestamp: 1941.9ns

Class: DateSubclass
constructor:1016.6ns
date.fromordinal:   1760.3ns
date.fromtimestamp: 2295.3ns


With fastpath:
==
Class: date
constructor:964.3ns
date.fromordinal:   997.6ns
date.fromtimestamp: 1130.2ns

Class: DateSubclass
constructor:1086.9ns
date.fromordinal:   1818.5ns
date.fromtimestamp: 2129.9ns

As you can see, this is a fairly significant speedup in the common case with no 
cost in the unusual case and no change in behavior. I propose that we switch 
over all the C constructors where it makes sense to do so in date, time and 
datetime.

I'll have a PR forthcoming soon.

--
messages: 308907
nosy: belopolsky, p-ganssle
priority: normal
severity: normal
status: open
title: date, time and datetime alternate constructors should take fast 
construction path
type: enhancement
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



[issue32394] socket lib beahavior change in 3.6.4

2017-12-21 Thread TJG

TJG  added the comment:

Excluding for now seems like a simple option. (Basically a reversion to 
previous behaviour). And allows us easily to include again later easily.

Messing with setsockopt seems a little more risky.

In short: I'm with you -- exclude for now.

--

___
Python tracker 

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



[issue32030] PEP 432: Rewrite Py_Main()

2017-12-21 Thread STINNER Victor

STINNER Victor  added the comment:

Hum, _PyCoreConfig.ignore_environment is redundant with 
Py_IgnoreEnvironmentFlag. I don't recall why I added it to _PyCoreConfig. Maybe 
it should be removed.

--

___
Python tracker 

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



[issue32394] socket lib beahavior change in 3.6.4

2017-12-21 Thread Steve Dower

Steve Dower  added the comment:

Okay, so it looks like we don't have any prior art to conditionally omit 
constants from _socket based on OS level, and nothing in the setsockopt() doc 
suggests that it may fail like this.

So we either need to explicitly exclude this symbol on Windows (at least until 
we drop support for pre-Windows 10 versions) or silently ignore setsockopt 
errors for future good arguments. I'm inclined to do the former - other 
opinions?

--
components: +Windows

___
Python tracker 

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



Re: What is wrong with this regex for matching emails?

2017-12-21 Thread Peter J. Holzer
On 2017-12-20 08:21:02 +1100, Chris Angelico wrote:
> If there are no MX records for a domain, either the domain doesn't
> exist, or it doesn't receive mail.

This is not necessarily correct. An MTA has to fall back to A and 
records if no MX record exists, so a domain can receive mail without an
MX record. This is rare, but I have seen it in the wild (although
usually not for email addresses for people but for services (e.g.
trouble ticket systems).

hp

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


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


[issue32402] Coverity: CID 1426868/1426867: Null pointer dereferences in textio.c

2017-12-21 Thread STINNER Victor

New submission from STINNER Victor :

The following warning may have been introduced by the commit 
507434fd504f3ebc1da72aa77544edc0d73f136e from bpo-15216.

New defect(s) Reported-by: Coverity Scan
Showing 2 of 2 defect(s)


** CID 1426868:  Null pointer dereferences  (NULL_RETURNS)
/Modules/_io/textio.c: 1251 in textiowrapper_change_encoding()


*** CID 1426868:  Null pointer dereferences  (NULL_RETURNS)
/Modules/_io/textio.c: 1251 in textiowrapper_change_encoding()
1245 encoding = self->encoding;
1246 if (errors == Py_None) {
1247 errors = self->errors;
1248 }
1249 }
1250 else if (errors == Py_None) {
>>> CID 1426868:  Null pointer dereferences  (NULL_RETURNS)
>>> Assigning: "errors" = null return value from "_PyUnicode_FromId".
1251 errors = _PyUnicode_FromId(_strict);
1252 }
1253
1254 const char *c_errors = PyUnicode_AsUTF8(errors);
1255 if (c_errors == NULL) {
1256 return -1;

** CID 1426867:  Null pointer dereferences  (NULL_RETURNS)
/Modules/_io/textio.c: 1153 in _io_TextIOWrapper___init___impl()



*** CID 1426867:  Null pointer dereferences  (NULL_RETURNS)
/Modules/_io/textio.c: 1153 in _io_TextIOWrapper___init___impl()
1147 }
1148
1149 /* XXX: Failures beyond this point have the potential to leak 
elements
1150  * of the partially constructed object (like self->encoding)
1151  */
1152
>>> CID 1426867:  Null pointer dereferences  (NULL_RETURNS)
>>> Dereferencing a null pointer "errors".
1153 Py_INCREF(errors);
1154 self->errors = errors;
1155 self->chunk_size = 8192;
1156 self->line_buffering = line_buffering;
1157 self->write_through = write_through;
1158 if (set_newline(self, newline) < 0) {

--
components: IO
messages: 308903
nosy: inada.naoki, vstinner
priority: normal
severity: normal
status: open
title: Coverity: CID 1426868/1426867:  Null pointer dereferences in textio.c
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



[issue32394] socket lib beahavior change in 3.6.4

2017-12-21 Thread Kamil

Kamil  added the comment:

websocket-client 0.44.0
https://pypi.python.org/pypi/websocket-client/0.44.0

My script gives the following Erroe:

  File "C:\Program Files\Python36\lib\site-packages\websocket\_http.py", line 
108, in _open_socket
sock.setsockopt(*opts)
OSError: [WinError 10042] Для вызова getsockopt или setsockopt был указан 
неизвестный, недопустимый или неподдерживаемый параметр
или уровень

--

___
Python tracker 

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



Re: Regarding the error: TypeError: can’t pickle _thread.lock objects

2017-12-21 Thread Terry Reedy

On 12/21/2017 8:11 AM, Winston Manuel Vijay wrote:

Hi,

It would be of immense help, if someone could provide a suitable solution or 
related information that helps to sort out the below stated issue-


Ø  I had installed the Python version 3.6.4

Ø  Then I installed the package: Tensorflow

Ø  Installed g2p.exe by downloading from GitHub

Ø  Then tried running the below command-

g2p-seq2seq --interactive --model  (model_folder_path: is 
the path to an English model 2-layer LSTM with 512 hidden units CMU Sphinx dictionary 
downloaded from the CMU Sphinx website)

Following the above procedure, I encountered the following error: TypeError: 
can’t pickle _thread.lock objects-please find the attached screenshot for your 
reference.


This is a text-only mailing list.  One should copy and paste an entire 
traceback.


That said, if Tensorflow or g2p are trying to pickle something that 
cannot be pickled, you would likely do better directing your inquiry to 
the authors.


If you possible can, omit the following nonsensical garbage.  When you 
submit to a public list like python-list, anyone in the world is an 
intended recipient and you implicitly authorize all of the listed 
activities.  If you do not want that, don't submit.





This e-mail and any files transmitted with it are for the sole use of the 
intended recipient(s) and may contain confidential and privileged information. 
This email is sent for the intended recipient(s) only. If by an addressing or 
transmission error, this mail has been misdirected to you, you are requested to 
delete this mail immediately. If you are not the intended recipient(s), please 
reply to the sender and destroy all copies of the original message. Any 
unauthorized review, use, disclosure, dissemination, forwarding, printing or 
copying of this email, and/or any action taken in reliance on the contents of 
this e-mail is strictly prohibited and may be unlawful. Where permitted by 
applicable law, this e-mail and other e-mail communications sent to and from 
GSR e-mail addresses may be monitored.




--
Terry Jan Reedy


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


[issue32394] socket lib beahavior change in 3.6.4

2017-12-21 Thread Steve Dower

Steve Dower  added the comment:

Yes, I recognise that the change happened. I don't understand what breaks as a 
result.

You said it breaks "many libraries" - can you name some of them and provide 
sample code?

--

___
Python tracker 

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



[issue32388] Remove cross-version binary compatibility

2017-12-21 Thread Ned Deily

Change by Ned Deily :


--
nosy: +njs, serhiy.storchaka

___
Python tracker 

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



[issue32388] Remove cross-version binary compatibility

2017-12-21 Thread Ned Deily

Change by Ned Deily :


--
nosy: +ncoghlan, ned.deily -njs, serhiy.storchaka
stage: patch review -> 

___
Python tracker 

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



Re: How to edit a function in an interactive python session?

2017-12-21 Thread Terry Reedy

On 12/20/2017 8:42 PM, Peng Yu wrote:


R has the function edit() which allows the editing of the definition
of a function. Does python have something similar so that users can
edit python functions on the fly? Thanks.

https://www.rdocumentation.org/packages/utils/versions/3.4.3/topics/edit


In general, no.  In general, it is not possible since the definition may 
not be in Python.  (The equivalent must be true in R also.)


In a decent Python IDE, like IDLE, that allows one to enter, retrieve, 
and edit complete statements, then yes for function definitions entered 
in the same session.  It is also possible to edit multi-line code 
line-by-line in the standard REPL, but it is more painful and error prone.


One can monkey-patch an edited function into an imported module written 
in Python.  The original code can be copied from an editor and pasted 
into the REPL.


--
Terry Jan Reedy

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


[issue32388] Remove cross-version binary compatibility

2017-12-21 Thread Ned Deily

Change by Ned Deily :


--
stage:  -> patch review

___
Python tracker 

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



[issue32394] socket lib beahavior change in 3.6.4

2017-12-21 Thread Kamil

Kamil  added the comment:

My OS version is Windows 7 x64.
I ran the script on the same computer, but with different versions of the 
python:

import socket
import platform

print('1) OS Info: ', platform.architecture(), platform.platform())
print('2) Python Info: ', platform.python_build(), platform.python_compiler())
print('3) TCP_KEEPCNT = ', hasattr(socket, 'TCP_KEEPCNT') )

Result for python 3.6.3:
1) OS Info:  ('64bit', 'WindowsPE') Windows-7-6.1.7601-SP1
2) Python Info:  ('v3.6.3:2c5fed8', 'Oct  3 2017 18:11:49') MSC v.1900 64 bit 
(AMD64)
3) TCP_KEEPCNT =  False

Result for python 3.6.4:
1) OS Info:  ('64bit', 'WindowsPE') Windows-7-6.1.7601-SP1
2) Python Info:  ('v3.6.4:d48eceb', 'Dec 19 2017 06:54:40') MSC v.1900 64 bit 
(AMD64)
3) TCP_KEEPCNT =  True

--

___
Python tracker 

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



[issue32387] Disallow untagged C extension import on major platforms

2017-12-21 Thread Ned Deily

Ned Deily  added the comment:

With my macOS hat on, I don't see a problem with doing this.  C extensions 
built via Distutils have been version-tagged on macOS since 3.5.0 (for some 
reason, macOS was skipped when PEP 3149 was originally implemented).

With my release manager hat on, it sounds like a good idea.  But it could 
introduce a compatibility problem for anyone who doesn't use Distutils to 
produce extension modules.  So I'd like to see this proposal get a little more 
visibility, at the minimum, bringing it up on the Distutils SIG mailing list.  
We should also ensure that the change gets mentioned in the 3.7 What's New 
document.  And somewhere in the docset there should be some documentation for 
the .so file name requirements.  AFAICT, today it's really not mentioned 
anywhere in the docs other than the reference to PEP 3149 in the 3.2 What's 
New.  Until the packaging documents for extension modules get overhauled 
perhaps something could be added to the Building chapter of the Extending and 
Embedding document:
https://docs.python.org/3/extending/building.html#building-c-and-c-extensions

--

___
Python tracker 

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



[issue32115] Ignored SIGCHLD causes asyncio.Process.wait to hang forever

2017-12-21 Thread Andrew Svetlov

Andrew Svetlov  added the comment:

Thank for bug report.
Do you know other widespread tools with this problem? 
plan9port sounds too esoteric to me.

--
nosy: +asvetlov
versions: +Python 3.6, Python 3.7 -Python 3.5

___
Python tracker 

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



Re: Problem with assignment. Python error or mine?

2017-12-21 Thread duncan smith
On 21/12/17 19:06, John Ladasky wrote:
> On Thursday, December 21, 2017 at 7:37:39 AM UTC-8, MRAB wrote:
> 
>> Python never makes a copy unless you ask it to.
>>
>> What x1=X does is make the name x1 refer to the same object that X 
>> refers to. No copying.
> 
> Well, except with very simple, mutable data types like scalars... compare 
> this:
> 
 x=5
 y=x
 x,y
> (5, 5)
 x+=1
 x,y
> (6, 5)
> 
> To this:
> 
 a=[1,2,3]
 b=a
 a,b
> ([1, 2, 3], [1, 2, 3])
 a[1]=9
 a,b
> ([1, 9, 3], [1, 9, 3])
> 

Except ints aren't mutable and there's still no copying.

For

x += 1

(where x is e.g. an int) read

x = x + 1

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


Re: Problem with assignment. Python error or mine?

2017-12-21 Thread Kirill Balunov
2017-12-21 22:06 GMT+03:00 John Ladasky :

> On Thursday, December 21, 2017 at 7:37:39 AM UTC-8, MRAB wrote:
>
> > Python never makes a copy unless you ask it to.
> >
> > What x1=X does is make the name x1 refer to the same object that X
> > refers to. No copying.
>
> Well, except with very simple, mutable data types like scalars... compare
> this:
>

No copy means no copy, it is the rule! What you see is really new binding
operation under the hood.
'x=1; x += 1', means calculate x+1 and bind it to the same name. Compare it
to this example:


>>> tpl = ((1,2),(3,4))
>>> tpl += ((1,2),)
>>> tpl

((1, 2), (3, 4), (1, 2))


No copy, new binding to the same name :)


With kind regards, -gdg
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue32401] No module named '_ctypes'

2017-12-21 Thread YoSTEALTH

New submission from YoSTEALTH :

I tried to install python3.7.0a3 just to test it out and i keep getting error:

Traceback (most recent call last):
  File "/tmp/psi/Python-3.7.0a3/Lib/runpy.py", line 193, in _run_module_as_main
"__main__", mod_spec)
  File "/tmp/psi/Python-3.7.0a3/Lib/runpy.py", line 85, in _run_code
exec(code, run_globals)
  File "/tmp/psi/Python-3.7.0a3/Lib/ensurepip/__main__.py", line 5, in 
sys.exit(ensurepip._main())
  File "/tmp/psi/Python-3.7.0a3/Lib/ensurepip/__init__.py", line 204, in _main
default_pip=args.default_pip,
  File "/tmp/psi/Python-3.7.0a3/Lib/ensurepip/__init__.py", line 117, in 
_bootstrap
return _run_pip(args + [p[0] for p in _PROJECTS], additional_paths)
  File "/tmp/psi/Python-3.7.0a3/Lib/ensurepip/__init__.py", line 27, in _run_pip
import pip
  File "/tmp/tmpuwh0fjm1/pip-9.0.1-py2.py3-none-any.whl/pip/__init__.py", line 
28, in 
  File "/tmp/tmpuwh0fjm1/pip-9.0.1-py2.py3-none-any.whl/pip/vcs/mercurial.py", 
line 9, in 
  File "/tmp/tmpuwh0fjm1/pip-9.0.1-py2.py3-none-any.whl/pip/download.py", line 
36, in 
  File "/tmp/tmpuwh0fjm1/pip-9.0.1-py2.py3-none-any.whl/pip/utils/glibc.py", 
line 4, in 
  File "/tmp/psi/Python-3.7.0a3/Lib/ctypes/__init__.py", line 7, in 
from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'
Makefile:1108: recipe for target 'install' failed
make: *** [install] Error 1

System:
Linux (4.10.0-42-generic) 64bit

I have installed 3.6.0 and 3.6.4 without any problems.

--
components: Installation
messages: 308897
nosy: YoSTEALTH
priority: normal
severity: normal
status: open
title: No module named '_ctypes'
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



[issue28459] _pyio module broken on Cygwin / setmode not usable

2017-12-21 Thread Zachary Ware

Change by Zachary Ware :


--
nosy: +zach.ware
stage:  -> patch review
versions:  -Python 3.5

___
Python tracker 

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



[issue32399] _uuidmodule.c cannot build on AIX - different typedefs of uuid_t, etc..

2017-12-21 Thread Michael Felt

Michael Felt  added the comment:

So - KISS principle:

This diff shows what can compile:

diff --git a/Modules/_uuidmodule.c b/Modules/_uuidmodule.c
index d4bc3c7..5550705 100644
--- a/Modules/_uuidmodule.c
+++ b/Modules/_uuidmodule.c
@@ -1,7 +1,11 @@
 #define PY_SSIZE_T_CLEAN

 #include "Python.h"
+#ifndef _AIX
 #include 
+#else
+#include 
+#endif


 static PyObject *
@@ -16,7 +20,11 @@ py_uuid_generate_time_safe(void)
 #else
 uuid_t out;
 uuid_generate_time(out);
+#ifndef _AIX
 return Py_BuildValue("y#O", (const char *) out, sizeof(out), Py_None);
+#else
+return Py_BuildValue("y#O", (const char *) , sizeof(out), Py_None);
+#endif
 #endif
 }

However, no uuid_generate_time(). So, ends with:
ld: 0711-317 ERROR: Undefined symbol: .uuid_generate_time

--

___
Python tracker 

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



Re: Problem with assignment. Python error or mine?

2017-12-21 Thread John Ladasky
On Thursday, December 21, 2017 at 7:37:39 AM UTC-8, MRAB wrote:

> Python never makes a copy unless you ask it to.
> 
> What x1=X does is make the name x1 refer to the same object that X 
> refers to. No copying.

Well, except with very simple, mutable data types like scalars... compare this:

>>> x=5
>>> y=x
>>> x,y
(5, 5)
>>> x+=1
>>> x,y
(6, 5)

To this:

>>> a=[1,2,3]
>>> b=a
>>> a,b
([1, 2, 3], [1, 2, 3])
>>> a[1]=9
>>> a,b
([1, 9, 3], [1, 9, 3])

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


[issue32400] inspect.isdatadescriptor false negative

2017-12-21 Thread Lior Cohen

Change by Lior Cohen :


--
title: inspect.isdatadescriptor  fasle negative -> inspect.isdatadescriptor  
false negative

___
Python tracker 

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



[issue32400] inspect.isdatadescriptor fasle negative

2017-12-21 Thread Lior Cohen

New submission from Lior Cohen :

According to the c code in Include/descrobject.h

#define PyDescr_IsData(d) (Py_TYPE(d)->tp_descr_set != NULL)

and according to the "data model" chapter,
a data descriptor is an object who has __set__ and /or __delete__.

the "inspect.isdatadescriptor" checks for existence of __get__ and __set__ 
which IMHO is wrong. an object with __set__/__delete__ only will return falsely 
False (should be True).  

This is related to @Serhiy Storchaka comment in issue 26103 opened by @Aaron 
Hall.

--
assignee: docs@python
components: Documentation, Library (Lib)
messages: 308895
nosy: chnlior, docs@python
priority: normal
severity: normal
status: open
title: inspect.isdatadescriptor  fasle negative
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



[issue32399] _uuidmodule.c cannot build on AIX - different typedefs of uuid_t, etc..

2017-12-21 Thread Michael Felt

New submission from Michael Felt :

I was hoping for something simple - as in:

+1  #define PY_SSIZE_T_CLEAN
+2
+3  #include "Python.h"
+4  #ifndef _AIX
+5  #include 
+6  #else
+7  #include 
+8  #endif

However, it dies - instantly.

   11 | static PyObject *
   12 | py_uuid_generate_time_safe(void)
   13 | {
   14 | #ifdef HAVE_UUID_GENERATE_TIME_SAFE
   15 | uuid_t out;
   16 | int res;
   17 |
   18 | res = uuid_generate_time_safe(out);
   19 | return Py_BuildValue("y#i", (const char *) out, sizeof(out), 
res);
   20 | #else
   21 | uuid_t out;
   22 | uuid_generate_time(out);
   23 | return Py_BuildValue("y#O", (const char *) out, sizeof(out), 
Py_None);
   23 + return _Py_BuildValue_SizeT("y#O", (const char *) out, 
sizeof(out), (&_Py_NoneStruct));
"/data/prj/python/git/python3-3.7.0.a3/Modules/_uuidmodule.c", line 23.48: 
1506-117 (S) Operand must be a scalar type.
   24 | #endif
   25 | }
   26 |

On a linux system I see:

typedef unsigned char uuid_t[16];

while on AIX the typedef is:

/*
 * Universal Unique Identifier (UUID) types.
 */
typedef struct _uuid_t
{
unsigned32  time_low;
unsigned16  time_mid;
unsigned16  time_hi_and_version;
unsigned8   clock_seq_hi_and_reserved;
unsigned8   clock_seq_low;
byte   node[6];
} uuid_t, *uuid_p_t;

So, mentioning this for now - as I do not yet know the module. If someone with 
intimate knowledge of the current implementation is willing to help me - I'll 
dabble and learn - and see if we can make it work on AIX as well.

p.s. - guessing on the "Extension Modules" label. If not the right choice, 
please update.

--
components: Extension Modules
messages: 308894
nosy: Michael.Felt
priority: normal
severity: normal
status: open
title: _uuidmodule.c cannot build on AIX - different typedefs of uuid_t, etc..
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: Python Learning

2017-12-21 Thread Python
On Fri, Dec 15, 2017 at 04:51:09PM -0500, Bill wrote:
> >I'm new to programming, can anyone guide me, how to start learning python 
> >programming language,...plz suggest some books also.
> >
> >Thanks all
> 
> Are you sure you want to learn Python first?
> Python does enough things "behind the scene"
> that it makes me question the wisdom of that.
> Other points of view are welcome, of course.
> Learning the primitives of C++ first, may make for an easier transition.

This suggestion seems completely backwards to me.  One of Python's
greatest strengths is its relative simplicity, as compared to
lower level languages like C++ or assembly, or even other scripting
languages like Perl (which is comparitively large lexicographically
and syntactically).  Part of the process of learning is being rewarded
for what you have learned; Python does this exceptionally well by
enabling the student to write useful programs with simple syntax in a
very short time.

Pyhon is extremely well suited to teaching basic programming skills
like *using* data structures, flow control, subroutines, etc.
*without* having to grasp more difficult concepts like addressing and
pointers, static typing, low-level data structure implementation, etc..
Those topics would perhaps be better suited to a subsequent course,
once the student has mastered (or at least gained familiarity) with
some of the more introductory concents.

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


[issue28009] core logic of uuid.getnode() is broken for AIX - all versions

2017-12-21 Thread Michael Felt

Michael Felt  added the comment:

Sure - I'll work on a PR. This will be the easier one.

Where I am currently 'lost' is to correct _uuidmodule.c - another thing that 
has always been broken (new issue, about to open).

--

___
Python tracker 

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



[issue22908] ZipExtFile in zipfile can be seekable

2017-12-21 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +4858
stage: needs patch -> patch review

___
Python tracker 

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



[issue31821] pause_reading() doesn't work from connection_made()

2017-12-21 Thread Andrew Svetlov

Change by Andrew Svetlov :


--
nosy: +asvetlov

___
Python tracker 

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



[issue32398] OSX C++ linking workaround in distutils breaks other packages

2017-12-21 Thread R. David Murray

R. David Murray  added the comment:

I doubt we can make the change this way for backward compatibility reasons.  
That doesn't mean the situation can't be improved, though.

--
components: +macOS
nosy: +ned.deily, ronaldoussoren

___
Python tracker 

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



[issue32398] OSX C++ linking workaround in distutils breaks other packages

2017-12-21 Thread Eduardo Suarez-Santana

Eduardo Suarez-Santana  added the comment:

When compiling GDAL with python support, before 
Lib/distutils/unixccompiler.py:180,

self.compiler_cxx = ['/bin/sh', '/usr/x86_64-pc-linux-gnu/bin/libtool', 
'--mode=compile', '--tag=CXX', 'x86_64-pc-linux-gnu-c++']
linker = ['x86_64-pc-linux-gnu-cc', '-pthread', '-shared', '-march=native', 
'-pipe', '-O2', '-Wall', '-Wdeclaration-after-statement', '-Wextra', 
'-Winit-self', '-Wunused-parameter', '-Wmissing-prototypes', 
'-Wmissing-declarations', '-Wformat', '-Werror=format-security', 
'-Wno-format-nonliteral', '-Wlogical-op', '-Wshadow', '-Werror=vla', 
'-Wdeclaration-after-statement', '-Wnull-dereference', '-Wduplicated-cond', 
'-DOGR_ENABLED', '-march=native', '-pipe', '-O2', 
'-I/var/tmp/paludis/build/sci-libs-gdal-2.1.1/work/gdal-2.1.1/port', 
'-DGDAL_COMPILATION']

and after the workaround code:

linker = ['/bin/sh', '-pthread', '-shared', '-march=native', '-pipe', '-O2', 
'-Wall', '-Wdeclaration-after-statement', '-Wextra', '-Winit-self', 
'-Wunused-parameter', '-Wmissing-prototypes', '-Wmissing-declarations', 
'-Wformat', '-Werror=format-security', '-Wno-format-nonliteral', 
'-Wlogical-op', '-Wshadow', '-Werror=vla', '-Wdeclaration-after-statement', 
'-Wnull-dereference', '-Wduplicated-cond', '-DOGR_ENABLED', '-march=native', 
'-pipe', '-O2', 
'-I/var/tmp/paludis/build/sci-libs-gdal-2.1.1/work/gdal-2.1.1/port', 
'-DGDAL_COMPILATION']

which leads to next error:

/bin/sh: -d: invalid option

Some fixes to compilation (https://www.michael-joost.de/gdal_install.html) have 
been found, but anyway the existing workaround:

1. ...is a hack about OSX but there is no platform checking,

2. ...assumes linker and compiler commands have similar structure and
environment settings (no documentation reference found about that), and

3. ...assumes `env`, if used, does not come with any modifier.

My proposal is to remove the workaround and delegate right environmental 
variables to packagers.

--

___
Python tracker 

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



[issue26133] asyncio: ugly error related to signal handlers at exit if the loop is not closed explicitly

2017-12-21 Thread Andrew Svetlov

Andrew Svetlov  added the comment:


New changeset 3bc68cff5b821e83ee5df8b8cd13f4f54151b406 by Andrew Svetlov (Miss 
Islington (bot)) in branch '3.6':
bpo-26133: Dont unsubscribe signals in UNIX even loop on interpreter shutdown 
(GH-4956) (#4962)
https://github.com/python/cpython/commit/3bc68cff5b821e83ee5df8b8cd13f4f54151b406


--

___
Python tracker 

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



[issue32398] OSX C++ linking workaround in distutils breaks other packages

2017-12-21 Thread Eduardo Suarez-Santana

Change by Eduardo Suarez-Santana :


--
title: GDAL compilation error -> OSX C++ linking workaround in distutils breaks 
other packages

___
Python tracker 

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



[issue32398] GDAL compilation error

2017-12-21 Thread R. David Murray

R. David Murray  added the comment:

Please describe the problem and your proposed solution in more detail and in 
terms of CPython, so that it can be discussed by the relevant experts.  GDAL is 
a third party product and only relevant as an example, so it would also be good 
to come up with a better title for the issues ;)

--
nosy: +r.david.murray

___
Python tracker 

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



[issue32394] socket lib beahavior change in 3.6.4

2017-12-21 Thread Steve Dower

Steve Dower  added the comment:

Yeah, I updated the build machine before doing 3.6.4rc1 (I never update between 
rc and final releases). I'm intrigued to see why it breaks libraries though - 
typically unsupported enum values like this are silently ignored on older 
Windows versions.

--

___
Python tracker 

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



[issue32398] GDAL compilation error

2017-12-21 Thread Eduardo Suarez-Santana

New submission from Eduardo Suarez-Santana :

When compiling GDAL with python support, under certain build chain environment 
variables, next error may appear when building and linking python extensions 
(https://www.mail-archive.com/freebsd-ports@freebsd.org/msg41030.html):

/bin/sh: -d: invalid option

See the Github PR for proposed solution.

--
components: Distutils
messages: 308887
nosy: dstufft, eric.araujo, esuarezsantana
priority: normal
pull_requests: 4857
severity: normal
status: open
title: GDAL compilation error
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



Re: Problem with assignment. Python error or mine?

2017-12-21 Thread MarkA
On Thu, 21 Dec 2017 07:05:33 -0800, rafaeltfreire wrote:
From docs.python.org:

8.10. copy — Shallow and deep copy operations

Source code: Lib/copy.py

Assignment statements in Python do not copy objects, they create bindings 
between a target and an object. For collections that are mutable or 
contain mutable items, a copy is sometimes needed so one can change one 
copy without changing the other. This module provides generic shallow and 
deep copy operations (explained below)...


> Dear community, I am having the following problem when I am assigning
> the elements of a vector below a certain number to zero or any other
> value.
> I am creating a new variable but Python edits the root variable. Why?
> 
> import numpy as np
> 
> X=np.arange(1, 1, 1) #root variable x1=X x1[x1<1]=0
> 
> print(X)
> Out[1]: array([ 0.,  0.,  0., ...,  0.,  0.,  0.])
> 
> Why? It is supposed to be the original value Thank you for your
> time Rafael



-- 
MarkA

We hang petty theives, and appoint the great theives to public office
  -- Aesop
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue32323] urllib.parse.urlsplit() must not lowercase() IPv6 scope value

2017-12-21 Thread R. David Murray

R. David Murray  added the comment:

I don't think a zone id in that form is actually valid in a URI, but I agree 
that not messing with whatever is there is probably the best policy as long as 
we aren't directly supporting whatever *is* valid.

--

___
Python tracker 

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



[issue23428] Use the monotonic clock for thread conditions on POSIX platforms

2017-12-21 Thread Erik Bray

Change by Erik Bray :


--
pull_requests: +4856
stage:  -> patch review

___
Python tracker 

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



[issue32243] Tests that set aggressive switch interval hang in Cygwin on a VM

2017-12-21 Thread Erik Bray

Change by Erik Bray :


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

___
Python tracker 

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



[issue32394] socket lib beahavior change in 3.6.4

2017-12-21 Thread TJG

TJG  added the comment:

It's a compile-time option in socketmodule.c.

https://github.com/python/cpython/blob/3.6/Modules/socketmodule.c#L7466

The MSDN page suggests that it was added for Win10:

https://msdn.microsoft.com/en-us/library/windows/desktop/ms738596(v=vs.85).aspx

Is it possible that the build machine has changed its OS/SDK between 
building 3.6.3 and 3.6.4?

--
nosy: +tjguk

___
Python tracker 

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



[issue32388] Remove cross-version binary compatibility

2017-12-21 Thread Steve Dower

Steve Dower  added the comment:

Good to know. As I said on the other issue, Windows won't load extension 
modules built for a different version anyway unless they use the stable ABI, so 
there's no real reason these flags need to be binary compatible between 3.x 
versions.

--

___
Python tracker 

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



[issue32394] socket lib beahavior change in 3.6.4

2017-12-21 Thread Steve Dower

Steve Dower  added the comment:

Which libraries break? And which version of Windows are you running on?

If TCP_KEEPCNT was only added recently (perhaps in an SDK update) then it may 
not really be available on all versions.

(+Ned for awareness of the regression - not sure we need to respin immediately, 
but let's figure it out asap)

--
keywords: +3.6regression
nosy: +ned.deily
priority: normal -> release blocker
stage:  -> test needed

___
Python tracker 

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



[issue32388] Remove cross-version binary compatibility

2017-12-21 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

That's basically exact.  Actually, there is no ABI guarantee at all (when not 
using the stable ABI), just a best effort for advanced users who know what 
they're doing.

Actually, this PR stems from Nathaniel's message here:
https://mail.python.org/pipermail/python-dev/2017-December/151345.html

--

___
Python tracker 

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



[issue32388] Remove cross-version binary compatibility

2017-12-21 Thread Steve Dower

Steve Dower  added the comment:

Totally okay with this in theory, but wanted to clarify that the linked PR is 
really just taking advantage of removing the guarantee?

That is, the change isn't necessary to remove the requirement.

--

___
Python tracker 

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



[issue32326] Update Build projects to version 10.0.16299.0 of the Windows 10 SDK.

2017-12-21 Thread Steve Dower

Steve Dower  added the comment:

Apparently Tk has something in its e_capi.c file that does not work with the 
latest SDK (I guess they're redefining macros).

In master, we use prebuilt binaries, which is why this is not a problem. But 
we'll either need to fix Tk's sources or backport the code that uses the 
prebuilt binaries (just for Tcl and Tk - the OpenSSL part is not compatible) 
before we can merge this.

I'll try and take a look at it over the next few weeks. An a workaround, you 
should be able to "SET WindowsSDKVersion=10.0.16299.0" and pass "--no-tkinter" 
to build.bat to compile without the change.

--

___
Python tracker 

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



[issue32387] Disallow untagged C extension import on major platforms

2017-12-21 Thread Antoine Pitrou

Antoine Pitrou  added the comment:

Thanks for the heads-up Steve.

> Considering a .pyd file linking against pythonXY.dll is only going to load in 
> the context of that version anyway, this is hardly urgent.

I see.  That's a good argument for keeping the current extensions list, then.  
We can narrow the change to POSIX platforms.

--

___
Python tracker 

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



[issue32387] Disallow untagged C extension import on major platforms

2017-12-21 Thread Steve Dower

Steve Dower  added the comment:

Please don't rush this in, at least for Windows. I deliberately decided to keep 
the included pyd files untagged for a reason, and need to recall what that was. 
(It might be in the issue when we added the tags.)

Considering a .pyd file linking against pythonXY.dll is only going to load in 
the context of that version anyway, this is hardly urgent. There is also no 
supported tag on Windows for building against the stable ABI, so that would 
have to be added and enabled in the various build tools.

--

___
Python tracker 

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



[issue30607] Extract documentation theme into a separate package

2017-12-21 Thread Julien Palard

Change by Julien Palard :


--
nosy: +mdk

___
Python tracker 

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



[issue32030] PEP 432: Rewrite Py_Main()

2017-12-21 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 9bee329130aae5a13050c08dab9d349b76e66835 by Victor Stinner in 
branch 'master':
bpo-32030: Add _Py_FindEnvConfigValue() (#4963)
https://github.com/python/cpython/commit/9bee329130aae5a13050c08dab9d349b76e66835


--

___
Python tracker 

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



Re: Problem with assignment. Python error or mine?

2017-12-21 Thread MRAB

On 2017-12-21 15:05, rafaeltfre...@gmail.com wrote:

Dear community, I am having the following problem when I am assigning the 
elements of a vector below a certain number to zero or any other value.
I am creating a new variable but Python edits the root variable. Why?

import numpy as np

X=np.arange(1, 1, 1) #root variable
x1=X
x1[x1<1]=0

print(X)
Out[1]: array([ 0.,  0.,  0., ...,  0.,  0.,  0.])

Why? It is supposed to be the original value
Thank you for your time
Rafael


Python never makes a copy unless you ask it to.

What x1=X does is make the name x1 refer to the same object that X 
refers to. No copying.


As you're using numpy, you can use the .copy method:

x1 = X.copy()

This makes the name x1 refer to a new copy of the object that X refers to.
--
https://mail.python.org/mailman/listinfo/python-list


Re: Problem with assignment. Python error or mine?

2017-12-21 Thread rafaeltfreire
Em quinta-feira, 21 de dezembro de 2017 16:21:57 UTC+1, Neil Cerutti  escreveu:
> On 2017-12-21, rafaeltfre...@gmail.com  wrote:
> > Dear community, I am having the following problem when I am
> > assigning the elements of a vector below a certain number to
> > zero or any other value. I am creating a new variable but
> > Python edits the root variable. Why?
> >
> > import numpy as np
> >
> > X=np.arange(1, 1, 1) #root variable
> 
> np.arange creates an object. The assignment makes X refer to that
> object.
> 
> > x1=X 
> 
> X refers to the previous object, and then the assignment makes x1
> refer to that same object.
> 
> -- 
> Neil Cerutti

Ok, great thank you. I am kind of new in python. I use to program in MATLAB but 
I am trying to migrate. 
So, to fix it what should I do? because my X is an NMR spectrum of many 
samples. 
Thank you very much!
Rafael
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue32393] nav menu jitter in old documentation

2017-12-21 Thread Julien Palard

Change by Julien Palard :


--
nosy: +mdk

___
Python tracker 

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



Re: Problem with assignment. Python error or mine?

2017-12-21 Thread Neil Cerutti
On 2017-12-21, rafaeltfre...@gmail.com  wrote:
> Dear community, I am having the following problem when I am
> assigning the elements of a vector below a certain number to
> zero or any other value. I am creating a new variable but
> Python edits the root variable. Why?
>
> import numpy as np
>
> X=np.arange(1, 1, 1) #root variable

np.arange creates an object. The assignment makes X refer to that
object.

> x1=X 

X refers to the previous object, and then the assignment makes x1
refer to that same object.

-- 
Neil Cerutti

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


[issue32030] PEP 432: Rewrite Py_Main()

2017-12-21 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +4854

___
Python tracker 

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



[issue32030] PEP 432: Rewrite Py_Main()

2017-12-21 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset 9dd762013fd9fcf975ad51700b55d050ca9ed60e by Victor Stinner in 
branch 'master':
bpo-32030: Add _Py_EncodeLocaleRaw() (#4961)
https://github.com/python/cpython/commit/9dd762013fd9fcf975ad51700b55d050ca9ed60e


--

___
Python tracker 

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



Re: property decorator?

2017-12-21 Thread Cholo Lennon

On 20/12/17 21:39, Stefan Ram wrote:

Irv Kalb  writes:
about property decorators.

   The code

@property
def salary(self): pass

@salary.setter
def salary(self, newSalary): pass

   is an abbreviation for

def salary_get(self): pass
salary = property( salary_get )

def salary_set(self, newSalary): pass
salary = salary.setter( salary_set )

   . »property« is a class, »property( salaray )« constructs an
   instance with salary_get as getter and no setter. Later,
   »salary.setter« adds »salaray_set« as a setter to that
   instance.

   One cannot use »@salary.getter« instead of »@property«,
   because at that point in time, the instance »salaray« does
   not already exist.



Best answser IMHO, it's clear and concise.

--
Cholo Lennon
Bs.As.
ARG
--
https://mail.python.org/mailman/listinfo/python-list


Problem with assignment. Python error or mine?

2017-12-21 Thread rafaeltfreire
Dear community, I am having the following problem when I am assigning the 
elements of a vector below a certain number to zero or any other value. 
I am creating a new variable but Python edits the root variable. Why?

import numpy as np

X=np.arange(1, 1, 1) #root variable
x1=X 
x1[x1<1]=0

print(X)
Out[1]: array([ 0.,  0.,  0., ...,  0.,  0.,  0.])

Why? It is supposed to be the original value
Thank you for your time
Rafael
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue26133] asyncio: ugly error related to signal handlers at exit if the loop is not closed explicitly

2017-12-21 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +4853

___
Python tracker 

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



Regarding the error: TypeError: can’t pickle _thread.lock objects

2017-12-21 Thread Winston Manuel Vijay
Hi,

It would be of immense help, if someone could provide a suitable solution or 
related information that helps to sort out the below stated issue-


Ø  I had installed the Python version 3.6.4

Ø  Then I installed the package: Tensorflow

Ø  Installed g2p.exe by downloading from GitHub

Ø  Then tried running the below command-

g2p-seq2seq --interactive --model  (model_folder_path: is 
the path to an English model 2-layer LSTM with 512 hidden units CMU Sphinx 
dictionary downloaded from the CMU Sphinx website)

Following the above procedure, I encountered the following error: TypeError: 
can’t pickle _thread.lock objects-please find the attached screenshot for your 
reference.


Thanks,
A.Winston Manuel Vijay




This e-mail and any files transmitted with it are for the sole use of the 
intended recipient(s) and may contain confidential and privileged information. 
This email is sent for the intended recipient(s) only. If by an addressing or 
transmission error, this mail has been misdirected to you, you are requested to 
delete this mail immediately. If you are not the intended recipient(s), please 
reply to the sender and destroy all copies of the original message. Any 
unauthorized review, use, disclosure, dissemination, forwarding, printing or 
copying of this email, and/or any action taken in reliance on the contents of 
this e-mail is strictly prohibited and may be unlawful. Where permitted by 
applicable law, this e-mail and other e-mail communications sent to and from 
GSR e-mail addresses may be monitored.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python Learning

2017-12-21 Thread Larry Martell
On Mon, Dec 18, 2017 at 3:22 PM, Marko Rauhamaa  wrote:
>
> Larry Martell :
>
> > On Mon, Dec 18, 2017 at 11:33 AM, Marko Rauhamaa  wrote:
> >> However, one great way to stand out is a portfolio of GitHub
> >> projects. Several people have gotten an offer largely based on those
> >> (after they aced the technical interviews). For example, we just
> >> hired someone who had written a game in sed. That doesn't make him an
> >> "interesting person," nor do we look for game or sed developers. But
> >> that silly exercise deeply resonated with our team. We expect to have
> >> great synergy with him.
> >
> > I have been excluded from even getting an interview because I did not
> > have a portfolio of GitHub projects. I think that is a bad filter. I
> > work 60-70 hours a week for pay, and I have a family and personal
> > interests.
>
> Personal programming projects are not a requirement. They are just a
> very effective advertising tool.
>
> As for 60—70 hours a week... sounds horrible. My sympathies.

Nah - I get paid by the hour and I love what I do.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue26133] asyncio: ugly error related to signal handlers at exit if the loop is not closed explicitly

2017-12-21 Thread Andrew Svetlov

Andrew Svetlov  added the comment:


New changeset 4a02543cf97e8cbf9293741379f977b85531e4c2 by Andrew Svetlov in 
branch 'master':
bpo-26133: Dont unsubscribe signals in UNIX even loop on interpreter shutdown 
(#4956)
https://github.com/python/cpython/commit/4a02543cf97e8cbf9293741379f977b85531e4c2


--

___
Python tracker 

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



[issue17972] inspect module docs omits many functions

2017-12-21 Thread Anand Reddy Pandikunta

Change by Anand Reddy Pandikunta :


--
nosy: +chillaranand

___
Python tracker 

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



[issue32030] PEP 432: Rewrite Py_Main()

2017-12-21 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +4852

___
Python tracker 

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



Re: Problems with imports on multiple threads, with embedded Python

2017-12-21 Thread geoff . bache
On Thursday, 21 December 2017 00:33:54 UTC+1, Lawrence D’Oliveiro  wrote:
> On Thursday, December 21, 2017 at 5:13:33 AM UTC+13, geoff...@gmail.com wrote:
> > 
> > I have a multithreaded application using an embedded Python 3.6.4 ...
> 
> Avoid multithreading if you can. Is your application CPU-bound? If not, you 
> are getting no benefit from it.

Unfortunately that's not an option. As I say, Python is embedded and is only a 
part of what the application does. The multithreading is not there for the 
Python part but is a well-established fact in the application.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue32030] PEP 432: Rewrite Py_Main()

2017-12-21 Thread STINNER Victor

STINNER Victor  added the comment:


New changeset e47e698da6bd982da277960c14afa9d9939e3155 by Victor Stinner in 
branch 'master':
bpo-32030: Add _Py_EncodeUTF8_surrogateescape() (#4960)
https://github.com/python/cpython/commit/e47e698da6bd982da277960c14afa9d9939e3155


--

___
Python tracker 

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



[issue32030] PEP 432: Rewrite Py_Main()

2017-12-21 Thread STINNER Victor

Change by STINNER Victor :


--
pull_requests: +4851

___
Python tracker 

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



[issue32397] textwrap output may change if you wrap a paragraph twice

2017-12-21 Thread Larry Hastings

Larry Hastings  added the comment:

FWIW, the test program produces this output:

--

 original: '    .  '
  wrapped: '    .\n'
wrapped twice: '    . '

Traceback (most recent call last):
  File "textwrap.isnt.stable.py", line 24, in 
assert wrapped == wrapped2
AssertionError

--

___
Python tracker 

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



[issue32397] textwrap output may change if you wrap a paragraph twice

2017-12-21 Thread Larry Hastings

New submission from Larry Hastings :

If you word-wrap a paragraph twice with textwrap, you may get different 
results.  Specifically, you *will* get different results when:
* the original text has a line that is too long by one character,
* the last word on the line is the first word in a new sentence, and
* there are two spaces after the period.

The first textwrap will replace the two spaces after the period with a newline; 
the second textwrap will replace the newline with a single space.

Attached is a test case demonstrating the problem.

It's not a big problem, but it did cause an assertion failure in blurb.  The 
workaround was to word-wrap all paragraphs twice, which works but is kind of 
dumb.

--
components: Library (Lib)
files: textwrap.isnt.stable.py
messages: 308872
nosy: larry
priority: low
severity: normal
status: open
title: textwrap output may change if you wrap a paragraph twice
versions: Python 3.7
Added file: https://bugs.python.org/file47344/textwrap.isnt.stable.py

___
Python tracker 

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



[issue32323] urllib.parse.urlsplit() must not lowercase() IPv6 scope value

2017-12-21 Thread Andrew Svetlov

Andrew Svetlov  added the comment:

RFC doesn't specify a case for Zone ID, let's keep it untouched (no lowercasing)

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions:  -Python 3.8

___
Python tracker 

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



[issue32323] urllib.parse.urlsplit() must not lowercase() IPv6 scope value

2017-12-21 Thread Andrew Svetlov

Andrew Svetlov  added the comment:


New changeset fdb148f949e3ae66036b75163ff68042d19cf0fc by Andrew Svetlov (Miss 
Islington (bot)) in branch '3.6':
bpo-32323: urllib.parse.urlsplit() must not lowercase() IPv6 scope value 
(GH-4867) (#4959)
https://github.com/python/cpython/commit/fdb148f949e3ae66036b75163ff68042d19cf0fc


--
nosy: +asvetlov

___
Python tracker 

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



[issue32396] Implement method to write/read to serials without blocking on windows with asyncio

2017-12-21 Thread jabdoa

New submission from jabdoa :

This is a follow up to Issue30539. The main issue is that serial ports on 
windows do not behave like socket on unix. Therefore, pyserial-asyncio cannot 
use the asyncio socket api.

Can we implement serial_recv and serial_send in asyncio? This would help to 
create a true platform independent implementation. On Linux and Mac 
serial_send/recv could probably just call to socket_sendall/recv. On Windows 
this would map to ProactorEventLoop.send/recv.

--
components: asyncio
messages: 308869
nosy: asvetlov, jabdoa, yselivanov
priority: normal
severity: normal
status: open
title: Implement method to write/read to serials without blocking on windows 
with asyncio
versions: Python 3.4, Python 3.5, Python 3.6, Python 3.7, Python 3.8

___
Python tracker 

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



[issue25749] asyncio.Server class documented but not exported

2017-12-21 Thread Ron Frederick

Ron Frederick  added the comment:

> I think you're doing it the right way.  It's a rather niche requirement, so I 
> don't think we should make create_server to somehow support this use case.

Agreed.


> asyncssh looks absolutely amazing, btw.

Thanks so much!

--

___
Python tracker 

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



[issue32323] urllib.parse.urlsplit() must not lowercase() IPv6 scope value

2017-12-21 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +4850

___
Python tracker 

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



  1   2   >