Re: [Python-Dev] Removing memoryview object patch from Python 2.7

2016-12-14 Thread Robert Collins
On 14 December 2016 at 18:10, Sesha Narayanan Subbiah
 wrote:
> Hi Rob
>
> Thanks for your reply.
>
> From http://legacy.python.org/download/, I could see that the current
> production releases are Python 3.4 and Python 2.7.6.

Nope - https://www.python.org/downloads/ - 2.7.12 and 3.5.2 are
current. The 'legacy' domain there was from a site revamp, I think its
causing confusion at this point and we should look at retiring it
completely.

> Since we use python for some our legacy applications, we don't want to
> switch to Python 3.0 right now. Moreover, since Python 2.6 is not supported
> anymore, we want to upgrade to Python 2.7.

> Do you suggest I should use Python 2.7.12 which is the latest version in 2.7
> series? I picked up 2.7.6, since it was listed as production release and
> assumed it is the most stable version.

If you can, 3.5.2 is where to switch to. If that won't work, 2.7.12 yes.

-Rob
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Implementation difference of audioop.lin2lin in Python2 and Python3

2016-12-14 Thread KH Luke Kim
Yeah, but is it supposed to be avoided to apply new features in Python 3.x
to Python 2.x? Sorry if there's already a consensus.

2016-12-13 22:37 GMT+09:00 MRAB :

> On 2016-12-13 11:31, KH Luke Kim wrote:
>
>> Hello,
>> recently there had been some issues in audioread and librosa that 3-byte
>> samples can be loaded in Python 3 but 2.
>>
>> The documentation says that the audioop.lin2lin function in Python 3
>> support 1-, 2-, 3-, 4-byte samples but only 1-, 2-, 4-byte samples in
>> Python 2.
>>
>> I wonder why 3-byte support is not implemented in Python 2. If there is
>> any previous thread or history regarding this issue, could you refer it
>> to me?
>>
>> The Python docs say that support for 3-byte (24-bit) samples was added in
> Python 3.4, so anyone using a version before that one is out of luck!
>
> ___
> Python-Dev mailing list
> Python-Dev@python.org
> https://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe: https://mail.python.org/mailman/options/python-dev/khlukekim
> %40gmail.com
>
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Making sure dictionary adds/deletes during iteration always raise exception

2016-12-14 Thread Ronald Oussoren

> On 13 Dec 2016, at 17:52, Eric V. Smith  wrote:
> 
> 
>> On Dec 13, 2016, at 11:42 AM, Raymond Hettinger 
>>  wrote:
>> 
>> 
>>> On Dec 13, 2016, at 1:51 AM, Max Moroz  wrote:
>>> 
>>> Would it be worth ensuring that an exception is ALWAYS raised if a key
>>> is added to or deleted from a dictionary during iteration?
>>> 
>>> I suspect the cost of a more comprehensive error reporting is not
>>> worth the benefit, but I thought I'd ask anyway.
>> 
>> I think what we have has proven itself to be good enough to detect the 
>> common cases, and it isn't worth it to have dicts grow an extra field which 
>> has to be checked or updated on every operation.
>> 
> 
> I agree that we shouldn't complicate things, but wouldn't PEP 509 be a cheap 
> way to check this?

Doesn’t that update the version with every change to a dict instance? That is, 
not just when the set of keys for the dict changes.

Ronald

___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Making sure dictionary adds/deletes during iteration always raise exception

2016-12-14 Thread Joe Jevnik
> Is it possible to add a key, triggering a resize of the dict, then
remove one, and continue iterating through the old (deallocated)
memory?

You can add and remove keys between calling next which would resize the
dictionary; however, it will not iterate through uninitialized memory. The
dictiter holds the current index and each time next is called it goes
directly to ma_keys->dk_entries[saved_index] or ma_values[saved_index]

On Tue, Dec 13, 2016 at 12:55 PM, Chris Angelico  wrote:

> On Wed, Dec 14, 2016 at 4:48 AM, Guido van Rossum 
> wrote:
> > IIUC the private version gets updated every time the dict gets modified
> --
> > but what we need here should only trigger when a key is added or removed,
> > not when a value is updated.
>
> Is it possible to add a key, triggering a resize of the dict, then
> remove one, and continue iterating through the old (deallocated)
> memory? If so, that could potentially cause a crash.
>
> ChrisA
> ___
> Python-Dev mailing list
> Python-Dev@python.org
> https://mail.python.org/mailman/listinfo/python-dev
> Unsubscribe: https://mail.python.org/mailman/options/python-dev/
> joe%40quantopian.com
>
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Implementation difference of audioop.lin2lin in Python2 and Python3

2016-12-14 Thread KH Luke Kim
That helped a lot, thanks!

On Wed, 14 Dec 2016 at 4:58 AM Martin Panter  wrote:

> On 13 December 2016 at 13:37, MRAB  wrote:
>
> > On 2016-12-13 11:31, KH Luke Kim wrote:
>
> >>
>
> >> Hello,
>
> >> recently there had been some issues in audioread and librosa that 3-byte
>
> >> samples can be loaded in Python 3 but 2.
>
> >>
>
> >> The documentation says that the audioop.lin2lin function in Python 3
>
> >> support 1-, 2-, 3-, 4-byte samples but only 1-, 2-, 4-byte samples in
>
> >> Python 2.
>
> >>
>
> >> I wonder why 3-byte support is not implemented in Python 2. If there is
>
> >> any previous thread or history regarding this issue, could you refer it
>
> >> to me?
>
> >>
>
> > The Python docs say that support for 3-byte (24-bit) samples was added in
>
> > Python 3.4, so anyone using a version before that one is out of luck!
>
>
>
> The 3.4 reference leads you to What’s New, which leads to discussion
>
> in the bug tracker:
>
> https://docs.python.org/3/whatsnew/3.4.html#audioop
>
> https://bugs.python.org/issue12866
>
>
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Removing memoryview object patch from Python 2.7

2016-12-14 Thread Sesha Narayanan Subbiah
Hi Rob

Thanks for your reply.

>From http://legacy.python.org/download/, I could see that the current
production releases are Python 3.4 and Python 2.7.6.

Since we use python for some our legacy applications, we don't want to
switch to Python 3.0 right now. Moreover, since Python 2.6 is not supported
anymore, we want to upgrade to Python 2.7.

Do you suggest I should use Python 2.7.12 which is the latest version in
2.7 series? I picked up 2.7.6, since it was listed as production release
and assumed it is the most stable version.

Thanks
Sesha




On Tue, Dec 13, 2016 at 11:49 PM, Robert Collins 
wrote:

> On 14 December 2016 at 01:26, Sesha Narayanan Subbiah
>  wrote:
> > Hello
> >
> >
> > I have some implementation that currently uses python 2.6.4, which I m
> > trying to upgrade to Python 2.7.6. After upgrade, I get the following
> error:
> >
> >
> > "expected string or Unicode object, memoryview found"
> >
> >
> > On checking further, I could find that memory view object has been back
> > ported to python 2.7 using this patch:
> >
> >
> > https://bugs.python.org/issue2396
> >
> >
> > I would like to know if it is safe to revert this patch alone from Python
> > 2.7.6, or do we know if there are any other dependencies?
>
> I'm not sure - if you're going to run with old, custom, builds of
> Python, you're probably best served by testing comprehensively for
> this yourself.
>
> That said, I have to presume that the error you're getting is from
> some code that should be changed anyway, and will need to be changed
> when you move to Python 3. Please remember that Python 2.7.6 was
> released in 2013 - there have been many security issues since then,
> including some of the most egregious SSL issues ever, which should
> prompt you to run the latest 2.7 branch (if you're unable to migrate
> straight to 3.x.
>
> -Rob
>
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Removing memoryview object patch from Python 2.7

2016-12-14 Thread Sesha Narayanan Subbiah
Thanks Rob. I will try upgrade to 2.7.12. Any idea of this memory view
object that has been back ported to 2.7 can be disabled in any way?

Thanks
Regards
Sesha

On Wed, Dec 14, 2016, 17:33 Robert Collins 
wrote:

> On 14 December 2016 at 18:10, Sesha Narayanan Subbiah
>  wrote:
> > Hi Rob
> >
> > Thanks for your reply.
> >
> > From http://legacy.python.org/download/, I could see that the current
> > production releases are Python 3.4 and Python 2.7.6.
>
> Nope - https://www.python.org/downloads/ - 2.7.12 and 3.5.2 are
> current. The 'legacy' domain there was from a site revamp, I think its
> causing confusion at this point and we should look at retiring it
> completely.
>
> > Since we use python for some our legacy applications, we don't want to
> > switch to Python 3.0 right now. Moreover, since Python 2.6 is not
> supported
> > anymore, we want to upgrade to Python 2.7.
>
> > Do you suggest I should use Python 2.7.12 which is the latest version in
> 2.7
> > series? I picked up 2.7.6, since it was listed as production release and
> > assumed it is the most stable version.
>
> If you can, 3.5.2 is where to switch to. If that won't work, 2.7.12 yes.
>
> -Rob
>
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Implementation difference of audioop.lin2lin in Python2 and Python3

2016-12-14 Thread Paul Moore
On 13 December 2016 at 13:47, KH Luke Kim  wrote:
> Yeah, but is it supposed to be avoided to apply new features in Python 3.x
> to Python 2.x? Sorry if there's already a consensus.

Yes. Only security-related new features will ever be backported to
Python 2 (and even those will be subject to discussion and probably
need a PEP, it's not a guarantee).
Paul
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Removing memoryview object patch from Python 2.7

2016-12-14 Thread Paul Moore
On 14 December 2016 at 05:10, Sesha Narayanan Subbiah
 wrote:
> From http://legacy.python.org/download/, I could see that the current
> production releases are Python 3.4 and Python 2.7.6.

That URL seems to be out of date. You should refer to www.python.org,
specifically https://www.python.org/downloads/

Paul
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


[Python-Dev] 3.6.0: OpenSSL 1.1.0c is not supported

2016-12-14 Thread Christian Heimes
Hi Ned,

please add a reminder to the release docs that Python 3.6.0 is not
compatible with OpenSSL 1.1.0c, https://bugs.python.org/issue28689.
1.1.0 to 1.1.0b work fine. 1.1.0d will be compatible, too.

Regards,
Christian



signature.asc
Description: OpenPGP digital signature
___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Implementation difference of audioop.lin2lin in Python2 and Python3

2016-12-14 Thread Terry Reedy

On 12/13/2016 8:47 AM, KH Luke Kim wrote:

Yeah, but is it supposed to be avoided to apply new features in Python
3.x to Python 2.x? Sorry if there's already a consensus.


The feature set of every Pythonx.y version is frozen with the release of 
CPython x.y.0.  Thereafter, each x.y.1+ release only gets bug fixes. 
Note that the new audioop feature in 3.4.0 was not backported to the 
subsequent 3.3.? release.


Python 2.7 is generally no exception, but because of its extra long 
maintenance and projected life, a few security features *have* been 
backported.



--
Terry Jan Reedy

___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com


Re: [Python-Dev] Removing memoryview object patch from Python 2.7

2016-12-14 Thread Jeff Allen

Hi Sesha:

memoryview is part of the language. Even if you could hide or remove the 
feature, you would be running a specially broken version of Python, 
which can't be good. There is surely a better way to fix the code. If it 
helps any, you're landing here:


https://hg.python.org/cpython/file/v2.7.12/Objects/stringobject.c#l819

in a function used to convert strings to an array of bytes within 
built-in functions. So something that expected a string is being given a 
memoryview object. But it's not possible to guess what or why, and this 
isn't the place to explore your code.


Python-dev is about developing the language. Python-list is the place to 
ask questions about using the language. However, good hunting!


Jeff Allen

On 14/12/2016 12:09, Sesha Narayanan Subbiah wrote:


Thanks Rob. I will try upgrade to 2.7.12. Any idea of this memory view 
object that has been back ported to 2.7 can be disabled in any way?


Thanks
Regards
Sesha




___
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com