[issue35041] urllib.parse.quote safe Parameter Not Optional

2018-10-21 Thread william.ayd


william.ayd  added the comment:

What if we instead just raised for anything that isn't a string or a byte? The 
docstring for quote suggests that it should only accept str or byte objects for 
safe, though it doesn't enforce that:

https://github.com/python/cpython/blob/121eb1694cab14df857ba6abe9839654cada15cf/Lib/urllib/parse.py#L791

Seems like it would be easier to enforce that rather than trying to accept any 
arbitrary iterable.

--

___
Python tracker 

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



[issue35041] urllib.parse.quote safe Parameter Not Optional

2018-10-21 Thread Ammar Askar


Ammar Askar  added the comment:

I agree that 

urllib.parse.quote("/", safe=['/'])

should probably work. It looks like the reason it doesn't is because quote 
tries to normalize the safe iterable to ASCII characters only. As part of this 
it attempts to run `< 128` on each element of safe.

As part of this it does

'/' < 128

and fails.

--

___
Python tracker 

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



[issue35041] urllib.parse.quote safe Parameter Not Optional

2018-10-21 Thread william.ayd


william.ayd  added the comment:

Hmm well I still personally feel that the implementation is somewhat off mores 
than the documentation. Specifically I think it is confusing that it accepts an 
empty iterable but not one containing elements.

This is fine:

urllib.parse.quote("/", safe=[])

Though this isn't:

urllib.parse.quote("/", safe=['/'])

Even though the following two calls are fine (though with different return 
values as expected):

urllib.parse.quote("/", safe='')
urllib.parse.quote("/", safe='/')

It might go against the spirit of duck typing but I find it very nuanced that 
empty iterables are allowed but if non-empty it must be a string. Would it not 
make more sense to raise if a non-String type is passed?

--

___
Python tracker 

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



[issue35041] urllib.parse.quote safe Parameter Not Optional

2018-10-21 Thread Ammar Askar


Ammar Askar  added the comment:

Does rewording that prior part to "safe parameter specifies an iterable of 
additional ASCII characters" make it less confusing?

--

___
Python tracker 

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



[issue19217] Calling assertEquals for moderately long list takes too long

2018-10-21 Thread Srinivas Reddy Thatiparthy


Change by Srinivas  Reddy Thatiparthy :


--
pull_requests: +9372

___
Python tracker 

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



[issue35041] urllib.parse.quote safe Parameter Not Optional

2018-10-21 Thread Ammar Askar


Ammar Askar  added the comment:

I would say so since the documentation says: safe parameter specifies 
additional ASCII characters

None isn't really a set of ASCII characters but the empty string and empty list 
are.

--

___
Python tracker 

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



[issue35040] functools.lru_cache does not work with coroutines

2018-10-21 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
nosy: +xtreak

___
Python tracker 

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



[issue35041] urllib.parse.quote safe Parameter Not Optional

2018-10-21 Thread william.ayd


william.ayd  added the comment:

Semantics aside is it still the intended behavior that these calls should work:

urllib.parse.quote("/", safe='')

AND 

urllib.parse.quote("/", safe=[])

But that this should raise?

urllib.parse.quote("/", safe=None)

IMO seems counterintuitive

--

___
Python tracker 

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



[issue35041] urllib.parse.quote safe Parameter Not Optional

2018-10-21 Thread Ammar Askar


Ammar Askar  added the comment:

The documentation also goes on to say that its default value is '/'. It is 
optional in the sense that the function can be called without providing it.

It doesn't mean that `None` is somehow a valid type for it. Consider the open 
function for example: https://docs.python.org/3/library/functions.html#open

The documentation says that, "mode is an optional string that specifies the 
mode in which the file is opened. It defaults to 'r' "

This doesn't mean you can just go off and do `open("file.txt", None)`

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

___
Python tracker 

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



[issue35041] urllib.parse.quote safe Parameter Not Optional

2018-10-21 Thread william.ayd


New submission from william.ayd :

The safe parameter in urllib.parse.quote is documented as optional. However, 
the following will raise TypeError: 'NoneType' object is not iterable:

urllib.parse.quote("/", safe=None)

whereas explicitly providing an iterable will allow the function to succeed:

urllib.parse.quote("/", safe=[])

--
messages: 328229
nosy: william.ayd
priority: normal
severity: normal
status: open
title: urllib.parse.quote safe Parameter Not Optional
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



[issue35040] functools.lru_cache does not work with coroutines

2018-10-21 Thread Liran Nuna


New submission from Liran Nuna :

lru_cache is a very useful method but it does not work well with coroutines 
since they can only be executed once.

Take for example, the attached code (test-case.py) - It will throw a 
RuntimeError because you cannot reuse an already awaited coroutine.

A solution would be to call `asyncio.ensure_future` on the result of the 
coroutine if detected.

--
components: asyncio
files: test-case.py
messages: 328228
nosy: Liran Nuna, asvetlov, yselivanov
priority: normal
severity: normal
status: open
title: functools.lru_cache does not work with coroutines
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8
Added file: https://bugs.python.org/file47887/test-case.py

___
Python tracker 

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



[issue33899] Tokenize module does not mirror "end-of-input" is newline behavior

2018-10-21 Thread Ned Deily


Ned Deily  added the comment:

Apparently this change also affected IPython.  Perhaps we should add an entry 
to the whatsnew documents for 3.7.1 and 3.7.6:

https://docs.python.org/3/whatsnew/3.7.html#notable-changes-in-python-3-7-1

https://docs.python.org/3.6/whatsnew/3.6.html#notable-changes-in-python-3-6-7

--
nosy: +ned.deily

___
Python tracker 

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



[issue33899] Tokenize module does not mirror "end-of-input" is newline behavior

2018-10-21 Thread Anthony Sottile

Anthony Sottile  added the comment:

I'm surprised this was classified as a bug!  Though that's subjective so I get 
that it's difficult to decide what is and what isn't ¯\(ツ)/¯

--

___
Python tracker 

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



[issue35033] Column or row spanning cells are not implemented.

2018-10-21 Thread Julien Palard


Julien Palard  added the comment:

Started implementing a POC sphinx-side so we may not have to "fix" our doc: 
https://github.com/JulienPalard/sphinx/tree/text-colspan-rowspan

--

___
Python tracker 

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



[issue34963] String representation for types created with typing.NewType(…) are opaque and unappealing

2018-10-21 Thread Ivan Levkivskyi


Ivan Levkivskyi  added the comment:

OK, so now we have two "competing" PRs. I think I like Serhiy's PR a bit more, 
since it is simpler. I would propose to look at benchmarks and then decide. Are 
there any other factors I am missing for choosing one or other approach?

--

___
Python tracker 

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



[issue35039] remove unused vars in Lib/turtledemo module

2018-10-21 Thread Srinivas Reddy Thatiparthy


Change by Srinivas  Reddy Thatiparthy :


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

___
Python tracker 

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



[issue35039] remove unused vars in Lib/turtledemo module

2018-10-21 Thread Srinivas Reddy Thatiparthy


Change by Srinivas  Reddy Thatiparthy :


--
components: Library (Lib)
nosy: thatiparthy
priority: normal
severity: normal
status: open
title: remove unused vars in  Lib/turtledemo module
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: UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to

2018-10-21 Thread Marko Rauhamaa
pjmcle...@gmail.com:

> not sure why utf-8 gives an error when thats the most wide all caracters
> inclusive right?/

Not all sequences of bytes are legal in UTF-8. For example,

   >>> b'\x80'.decode("utf-8")
   Traceback (most recent call last):
 File "", line 1, in 
   UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 0: 
invalid start byte

Not all sequences of bytes are legal in ASCII, either.

However, all sequences of bytes are legal in Latin-1 (among others). Of
course, decoding with Latin-1 gives you gibberish unless the data really
is Latin-1. But you'll never get a UnicodeDecodeError.


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


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

2018-10-21 Thread pjmclenon
On Saturday, October 20, 2018 at 1:23:50 PM UTC-4, Terry Reedy wrote:
> On 10/20/2018 8:24 AM, pjmcle...@gmail.com wrote:
> > On Saturday, October 13, 2018 at 7:24:14 PM UTC-4, MRAB wrote:
> 
> > i have a sort of decode error
> > UnicodeDecodeError; 'utf-8' can't decode byte 0xb0 in position 83064: 
> > invalid start byte
> > *
> > and it seems to refer to my code line:
> > ***
> > data = f.read()
> > ***
> > which is part of this block of code
> > 
> > # Read content of files
> >  for path in files:
> >  with open(join("docs", path), encoding="utf-8") as f:
> >  #with open(join("docs", path)) as f:
> >  data = f.read()
> >  process_data(data)
> > ***
> > 
> > would the solution fix be this?
> > **
> > data = f.read(), decoding = "utf-8"  #OR
> > data = f.read(), decoding = "ascii" # is this the right fix or previous or 
> > both wrong??
> 
> Both statements are invalid syntax.  The encoding is set in the open 
> statement.
> 
> What you need to find out: is '0xb0' a one-byte error or is 'utf-8' the 
> wrong encoding?  Things I might do:
> 
> 1. Change the encoding in open() to 'ascii' and see if the exception 
> message still refers to position 83064 or if there is a non-ascii 
> character earlier in the file.  The latter would mean that there is at 
> least one earlier non-ascii sequence that was decoded as uft-8.  This 
> would suggest that 'utf-8' might be correct and that the '0xb0' byte is 
> an error.
> 
> 2. In the latter case, add "errors='handler'", where 'handler' is 
> something other than the default 'strict'.  Look in the doc or see 
> help(open) for alternatives.
> 
> 3. In open(), replace "encoding='utf-8'" with "mode='rb'" so that 
> f.read() creates data as bytes instead of a text string.  Then print, 
> say, data[83000:83200] to see the context of the non-ascii byte.
> 
> 4. Change to encoding in open() to 'latin-1'.  The file will then be 
> read as text without error, even if latin-1 is the wrong encoding.
> 
> 
> 
> -- 
> Terry Jan Reedy

hello terry
just want to add
that i tried also setting in notepad ++ encoding to utf-8 from ansi and then i 
encoded utf-8 in my file but i got same error

then i tried encoding ascii in my file and it worked
so encdoong ascii and latin-1 work
not sure why utf-8 gives an error when thats the most wide all caracters 
inclusive right?/

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


[issue34282] Enum._convert shadows members named _convert

2018-10-21 Thread orlnub123


Change by orlnub123 :


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



[issue35027] distutils.core.setup does not raise TypeError when if classifiers, keywords and platforms fields are not specified as a list

2018-10-21 Thread Tilman Krummeck


Tilman Krummeck  added the comment:

I've submitted the PR just now: https://github.com/python/cpython/pull/10032.

The CLA is signed but most probably not processed yet.

--

___
Python tracker 

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



[issue35027] distutils.core.setup does not raise TypeError when if classifiers, keywords and platforms fields are not specified as a list

2018-10-21 Thread Tilman Krummeck


Change by Tilman Krummeck :


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

___
Python tracker 

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



[issue33899] Tokenize module does not mirror "end-of-input" is newline behavior

2018-10-21 Thread Tal Einat


Tal Einat  added the comment:

This was backported since it was considered a bug, but you are right that it 
broke backwards compatibility, and perhaps shouldn't have been backported.

Still, with 3.6.6 and 3.7.1 now released, that ship has sailed.

We could perhaps revert this on the 2.7 branch, but I feel that reverting this 
change only on 2.7 would just cause even more confusion.

--

___
Python tracker 

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



[issue34271] Please support logging of SSL master secret by env variable SSLKEYLOGFILE

2018-10-21 Thread Johannes Frank


Johannes Frank  added the comment:

Hello Christian,

much appreciated. Thank you so much.

Johannes

--

___
Python tracker 

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



[issue33899] Tokenize module does not mirror "end-of-input" is newline behavior

2018-10-21 Thread Anthony Sottile


Anthony Sottile  added the comment:

This change in behaviour is breaking pycodestyle: 
https://github.com/PyCQA/pycodestyle/issues/786

Perhaps it shouldn't have been backported (especially all the way to python2.7?)

--
nosy: +Anthony Sottile

___
Python tracker 

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



[issue34271] Please support logging of SSL master secret by env variable SSLKEYLOGFILE

2018-10-21 Thread Christian Heimes


Christian Heimes  added the comment:

Nathaniel, I created a PR with keylog and message callback patch. The message 
callback is really useful to investigate handshake and trace messages like 
close alert.

I decided against making the key log feature a callback and rather make it a 
filename attribute. In almost all case users want to log to a file anz way. 
It's easier to implement and makes locking simpler, too.

--

___
Python tracker 

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



[issue34271] Please support logging of SSL master secret by env variable SSLKEYLOGFILE

2018-10-21 Thread Christian Heimes


Change by Christian Heimes :


--
keywords: +patch
pull_requests: +9369
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



[issue29843] errors raised by ctypes.Array for invalid _length_ attribute

2018-10-21 Thread Tal Einat


Change by Tal Einat :


--
pull_requests: +9368

___
Python tracker 

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



[issue35038] AttributeError: 'frame' object has no attribute 'f_restricted'

2018-10-21 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
stage:  -> needs patch
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



[issue35038] AttributeError: 'frame' object has no attribute 'f_restricted'

2018-10-21 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

It is an issue with the documentation.

--
keywords: +easy
nosy: +serhiy.storchaka

___
Python tracker 

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



Re: PEP 394

2018-10-21 Thread eryk sun
On 10/20/18, Terry Reedy  wrote:
>
> On Windows, there is a better solution: the py launcher.
>  > py  # launches the most most recent version installed*
>  > py -x   # launches the most recent x.y
>  > py -x.y # launches x.y if installed, else lists installed versions
>
> * At first, 2.x took precedence over 3.x, but this has since been switched.

The py launcher still prefers Python 2 for scripts that have a virtual
shebang, such as #!python and #!/usr/bin/python.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue35038] AttributeError: 'frame' object has no attribute 'f_restricted'

2018-10-21 Thread Adrien


New submission from Adrien :

In the documentation 
(https://docs.python.org/3/library/inspect.html#types-and-members), the 
attribute `f_restricted` is listed as a member of `frame` objects. However, 
while trying to access it or even when calling `help()`, the object does not 
seem to have such attribute.

Is it a issue with the documentation that has not been updated?

I'm using Python 3.6.3 on Linux.

--
assignee: docs@python
components: Documentation
messages: 328217
nosy: Delgan, docs@python
priority: normal
severity: normal
status: open
title: AttributeError: 'frame' object has no attribute 'f_restricted'
type: enhancement
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



[issue29843] errors raised by ctypes.Array for invalid _length_ attribute

2018-10-21 Thread Tal Einat


Tal Einat  added the comment:

Should this be back-ported to 3.7 and 3.6? 2.7?

--
nosy: +taleinat

___
Python tracker 

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



[issue34081] Sphinx duplicate label warning in docs

2018-10-21 Thread Julien Palard


Change by Julien Palard :


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



[issue34081] Sphinx duplicate label warning in docs

2018-10-21 Thread Julien Palard


Julien Palard  added the comment:


New changeset 121eb1694cab14df857ba6abe9839654cada15cf by Julien Palard 
(Xtreak) in branch 'master':
bpo-34081: Fix wrong example link that was linking to distutils (GH-8248)
https://github.com/python/cpython/commit/121eb1694cab14df857ba6abe9839654cada15cf


--
nosy: +mdk

___
Python tracker 

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



[issue29743] Closing transport during handshake process leaks open socket

2018-10-21 Thread Tal Einat


Change by Tal Einat :


--
pull_requests: +9367

___
Python tracker 

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



[issue34876] Python3.8 changes how decorators are traced

2018-10-21 Thread Ned Batchelder

Ned Batchelder  added the comment:

Thanks, the fix looks good to me.

I made a comparison of some decorator tracing to check it out:  
https://gist.github.com/nedbat/d603a34136299f0c0b8e442fccadeb7d

TBH, the first time I tried it, something seemed wrong, but I can't see it now, 
so ¯\_(ツ)_/¯  :)

--

___
Python tracker 

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



[issue34973] Crash in bytes constructor with mutating list

2018-10-21 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue35036] logger failure in suspicious.py

2018-10-21 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:

Thanks @xtreak for the catch and PR!

--

___
Python tracker 

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



[issue35036] logger failure in suspicious.py

2018-10-21 Thread Pablo Galindo Salgado


Change by Pablo Galindo Salgado :


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



[issue35036] logger failure in suspicious.py

2018-10-21 Thread Pablo Galindo Salgado


Pablo Galindo Salgado  added the comment:


New changeset c3f52a59ce8406d9e59253ad4621e4749abdaeef by Pablo Galindo 
(Xtreak) in branch 'master':
bpo-35036: Remove empty log line in the suspicious.py tool (GH-10024)
https://github.com/python/cpython/commit/c3f52a59ce8406d9e59253ad4621e4749abdaeef


--

___
Python tracker 

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



[issue34973] Crash in bytes constructor with mutating list

2018-10-21 Thread miss-islington


miss-islington  added the comment:


New changeset 8bb037167cf3204a7d620ba11fbf43d2a9ec36e6 by Miss Islington (bot) 
in branch '3.6':
bpo-34973: Fix crash in bytes constructor. (GH-9841)
https://github.com/python/cpython/commit/8bb037167cf3204a7d620ba11fbf43d2a9ec36e6


--

___
Python tracker 

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



[issue34973] Crash in bytes constructor with mutating list

2018-10-21 Thread miss-islington


miss-islington  added the comment:


New changeset 7f34d550231e047c88a1817b58bda03a33817490 by Miss Islington (bot) 
in branch '3.7':
bpo-34973: Fix crash in bytes constructor. (GH-9841)
https://github.com/python/cpython/commit/7f34d550231e047c88a1817b58bda03a33817490


--
nosy: +miss-islington

___
Python tracker 

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



[issue34984] Improve error messages in bytes and bytearray constructors

2018-10-21 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue34984] Improve error messages in bytes and bytearray constructors

2018-10-21 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 2c2044e789875ea736ec42e216fdbe61816fbe28 by Serhiy Storchaka in 
branch 'master':
bpo-34984: Improve error messages for bytes and bytearray constructors. 
(GH-9874)
https://github.com/python/cpython/commit/2c2044e789875ea736ec42e216fdbe61816fbe28


--

___
Python tracker 

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



[issue34973] Crash in bytes constructor with mutating list

2018-10-21 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9366

___
Python tracker 

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



[issue34973] Crash in bytes constructor with mutating list

2018-10-21 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 914f9a078f997e58cfcfabcbb30fafdd1f277bef by Serhiy Storchaka in 
branch 'master':
bpo-34973: Fix crash in bytes constructor. (GH-9841)
https://github.com/python/cpython/commit/914f9a078f997e58cfcfabcbb30fafdd1f277bef


--

___
Python tracker 

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



[issue34973] Crash in bytes constructor with mutating list

2018-10-21 Thread miss-islington


Change by miss-islington :


--
pull_requests: +9365

___
Python tracker 

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



[issue34973] Crash in bytes constructor with mutating list

2018-10-21 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Thank you Xiang and Alexandre. I'll merge PR 9841.

--

___
Python tracker 

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



[issue35037] PYLONG_BITS_IN_DIGIT differs between MinGW and MSVC

2018-10-21 Thread Steve Dower


Steve Dower  added the comment:

That variable should be inferred somewhere, either in PC/pyconfig.h or 
pyport.h. If there's a way to also infer it on 64-bit MinGW then we would 
consider a patch for that.

--

___
Python tracker 

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



[issue34794] Memory leak in Tkinter

2018-10-21 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
title: memory leak in TkApp:_createbytearray -> Memory leak in Tkinter

___
Python tracker 

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



[issue34794] memory leak in TkApp:_createbytearray

2018-10-21 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
pull_requests: +9364

___
Python tracker 

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



[issue34794] memory leak in TkApp:_createbytearray

2018-10-21 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

Here is a simpler reproducer.

Actually the problem was not in _createbytearray(), but in converting the 
Python wrapper around Tcl_Obj into Tcl_Obj. _createbytearray() just exposed it. 
The leak exists in Python 3 too, but it is hard to reproduce it.

--
versions: +Python 3.6, Python 3.7, Python 3.8
Added file: https://bugs.python.org/file47886/leak_demo2.py

___
Python tracker 

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



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

2018-10-21 Thread pjmclenon
On Thursday, January 29, 2009 at 11:24:46 AM UTC-5, Anjanesh Lekshminarayanan 
wrote:
> Im reading a file. But there seems to be some encoding error.
> 
> >>> f = open(filename)
> >>> data = f.read()
> Traceback (most recent call last):
>   File "", line 1, in 
> data = f.read()
>   File "C:\Python30\lib\io.py", line 1724, in read
> decoder.decode(self.buffer.read(), final=True))
>   File "C:\Python30\lib\io.py", line 1295, in decode
> output = self.decoder.decode(input, final=final)
>   File "C:\Python30\lib\encodings\cp1252.py", line 23, in decode
> return codecs.charmap_decode(input,self.errors,decoding_table)[0]
> UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position
> 10442: character maps to 
> 
> The string at position 10442 is something like this :
> "query":"0 1Ȉ \u2021 0\u201a0 \u2021Ȉ ","
> 
> So what encoding value am I supposed to give ? I tried f =
> open(filename, encoding="cp1252") but still same error. I guess
> Python3 auto-detects it as cp1252
> -- 
> Anjanesh Lekshmnarayanan

hello peter, mrab and terry

thank you all for answering
i decided to use the last option by terrylatin -1cuz it seemed the 
easiest to try 

it does work but i read somewhere if im not wrong ..that this is not really the 
advised thing to do but also my file was just simple texti did see some 
weird caracters...and maybe that caused the utf-8 error..but i dont know how to 
post a pic here to show the caracters in my text file...but anyway for now i 
guess i will keep this setting..but not sure why this seems to be not the ideal 
thing to do with encoding at latin -1 , which is extened ascii right?/..and 
thats 256 options?/..and even with the unknown caraters i found in the 
file..isnt utf-8 like over 1 million options?

thzx alot  forum
Jessica
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue35037] PYLONG_BITS_IN_DIGIT differs between MinGW and MSVC

2018-10-21 Thread Stefan Behnel


Stefan Behnel  added the comment:

> There's PyLong_GetInfo ...

Thanks, I understand that this information can be found at runtime. However, in 
order to correctly compile C code against a given CPython runtime, there needs 
to be a guarantee that extension module builds use the same configuration as 
the CPython build.

> Misconfiguration

I searched some more, and it looks like this was already reported almost ten 
years ago in issue4709.

The work-around there is to pass -DMS_WIN64, which apparently is not defined by 
MinGW but required by the CPython headers.

--

___
Python tracker 

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



[issue35037] PYLONG_BITS_IN_DIGIT differs between MinGW and MSVC

2018-10-21 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

At runtime this information is available as sys.int_info.bits_per_digit.

> In MinGW, "SIZEOF_VOID_P" is 4, whereas "sizeof(void*)" resolves to 8.

Looks like a misconfiguration. I suppose this will cause more issues than just 
wrong PYLONG_BITS_IN_DIGIT.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue35037] PYLONG_BITS_IN_DIGIT differs between MinGW and MSVC

2018-10-21 Thread Mark Dickinson


Mark Dickinson  added the comment:

> Is there a reason why CPython cannot store its compile time value for the 
> PYLONG_BITS_IN_DIGIT setting somewhere?

There's PyLong_GetInfo [1], and at Python level, the corresponding 
sys.long_info (Python 2) / sys.int_info (Python 3). Does that help?





[1] 
https://github.com/python/cpython/blob/b2e2025941f6a4fdb716bd141d31acf720353d21/Objects/longobject.c#L5578-L5595

--

___
Python tracker 

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



[issue35037] PYLONG_BITS_IN_DIGIT differs between MinGW and MSVC

2018-10-21 Thread Mark Dickinson


Change by Mark Dickinson :


--
nosy: +mark.dickinson

___
Python tracker 

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



[issue34831] Asyncio Tutorial

2018-10-21 Thread Caleb Hattingh


Caleb Hattingh  added the comment:

I've added a few ideas for items in the "cookbook" page, which you'll see in 
the PR. If anyone has suggestions for more or better cookbook entries 
(recipes?), feel free to mention here or in the PR, I check both places. I 
expect to get more time to work on this next weekend, so it would be great to 
get ideas and reviews in during the week.

--

___
Python tracker 

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



[issue31500] IDLE: Tiny font on HiDPI display

2018-10-21 Thread Tal Einat


Tal Einat  added the comment:

Just tested on a 13" Retina MacBook Pro (2560x1600), everything looks fine.

--
nosy: +taleinat

___
Python tracker 

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



[issue34996] Add name to process and thread pool

2018-10-21 Thread Antoine Pitrou


Antoine Pitrou  added the comment:

Thanks for posting this.  I think this is a good idea, will take a look at the 
PR later.

--

___
Python tracker 

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



[issue35037] PYLONG_BITS_IN_DIGIT differs between MinGW and MSVC

2018-10-21 Thread Stefan Behnel


Stefan Behnel  added the comment:

Some more information. CPython uses this code snippet to decide on the PyLong 
digit size:

#ifndef PYLONG_BITS_IN_DIGIT
#if SIZEOF_VOID_P >= 8
#define PYLONG_BITS_IN_DIGIT 30
#else
#define PYLONG_BITS_IN_DIGIT 15
#endif
#endif

In MinGW, "SIZEOF_VOID_P" is 4, whereas "sizeof(void*)" resolves to 8.

--

___
Python tracker 

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



[issue35037] PYLONG_BITS_IN_DIGIT differs between MinGW and MSVC

2018-10-21 Thread Stefan Behnel


New submission from Stefan Behnel :

I see reports from Cython users on Windows-64 that extension modules that use 
"longintrepr.h" get miscompiled by MinGW. A failing setup looks as follows:

Stock 64 bit CPython on Windows, e.g.
Python 3.6.3 (v3.6.3:2c5fed8, Oct  3 2017, 18:11:49) [MSC v.1900 64 bit (AMD64)]

MinGW uses this compile time setup, i.e. 15 bit digits:
PyLong_BASE  0x8000
PyLong_MASK  7FFF
PyLong_SHIFT  15
sizeof(digit)  2
sizeof(sdigit)  2

Whereas CPython reports the following, indicating that it was in fact built 
with 30 bit digits:
sys.getsize(1, 2**14, 2**15, 2**29, 2**30, 2**63, 2**64)  (28, 28, 28, 28, 32, 
36, 36)

I'm not sure if this also applies to Py2.7, but I don't think the PyLong 
implementations differ in this regard.

The compile time PyLong digit size is not remembered by the CPython 
installation and instead determined on the fly by the extension compiler. It 
seems that the MSVC build of the stock CPython packages differs from what MinGW 
decides here. This renders MinGW unusable for code that uses "longintrepr.h", 
which Cython does by default in order to accelerate its unpacking of PyLong 
values.

Is there a reason why CPython cannot store its compile time value for the 
PYLONG_BITS_IN_DIGIT setting somewhere?

--
components: Extension Modules, Windows
messages: 328197
nosy: paul.moore, scoder, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: PYLONG_BITS_IN_DIGIT differs between MinGW and MSVC
type: compile error
versions: Python 2.7, 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



[issue35036] logger failure in suspicious.py

2018-10-21 Thread Caleb Hattingh


Change by Caleb Hattingh :


--
nosy: +cjrh

___
Python tracker 

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



[issue34996] Add name to process and thread pool

2018-10-21 Thread Raz Manor


Raz Manor  added the comment:

The default name of the threads does not allow differentiation between pool 
threads and other threads. This problem is more notable when you have several 
thread pools. Also, since there are some management threads to the pool, and 
one might want to know which is which. It was very helpful for me while 
debugging some memory issues in my project, this is where the idea came from.

The names themselves were my idea, but I welcome any change to them.

--

___
Python tracker 

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



[issue35029] Convert SyntaxWarning exception raised at code generation time to a SyntaxError

2018-10-21 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue8525] Display exceptions' subclasses in help()

2018-10-21 Thread Nick Coghlan


Nick Coghlan  added the comment:

I've merged the version that displays up to 4 builtin subclasses in a flat list 
when help() is called on a type. Thanks for the patch Sanyam, and for the 
comments and suggestions everyone else.

While I'm closing out this feature request as implemented, if anyone's 
interested in pursuing the more sophisticated showtree/getclasstree approach 
that would better show position in the class hierarchy (both parents *and* 
children), feel free to file a new enhancement issue that refers back to this 
one.

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



[issue8525] Display exceptions' subclasses in help()

2018-10-21 Thread Nick Coghlan


Nick Coghlan  added the comment:


New changeset a323cdcb33c8c856e5668acfb2c67ab5198672c4 by Nick Coghlan (Sanyam 
Khurana) in branch 'master':
bpo-8525: help() on a type now shows builtin subclasses (GH-5066)
https://github.com/python/cpython/commit/a323cdcb33c8c856e5668acfb2c67ab5198672c4


--

___
Python tracker 

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



[issue34936] tkinter.Spinbox.selection_element() raises TclError

2018-10-21 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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

___
Python tracker 

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



[issue34936] tkinter.Spinbox.selection_element() raises TclError

2018-10-21 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 427b8c7f7dcdbff21de78b10d9ad05c825480618 by Serhiy Storchaka in 
branch '2.7':
[2.7] bpo-34936: Fix TclError in tkinter.Spinbox.selection_element(). (GH-9760) 
(GH-9957) (GH-9968)
https://github.com/python/cpython/commit/427b8c7f7dcdbff21de78b10d9ad05c825480618


--

___
Python tracker 

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



[issue35029] Convert SyntaxWarning exception raised at code generation time to a SyntaxError

2018-10-21 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset d31e7730cd5d74efbd7320751dacd51d09cc415d by Serhiy Storchaka in 
branch 'master':
bpo-35029: Replace the SyntaxWarning exception with a SyntaxError. (GH-)
https://github.com/python/cpython/commit/d31e7730cd5d74efbd7320751dacd51d09cc415d


--

___
Python tracker 

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



[issue35036] logger failure in suspicious.py

2018-10-21 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


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

___
Python tracker 

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



[issue35036] logger failure in suspicious.py

2018-10-21 Thread Karthikeyan Singaravelan


Change by Karthikeyan Singaravelan :


--
assignee:  -> xtreak

___
Python tracker 

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



[issue35036] logger failure in suspicious.py

2018-10-21 Thread Karthikeyan Singaravelan


New submission from Karthikeyan Singaravelan :

There were some recent changes made in ee171a26c11 to fix Sphinx related 
deprecation warnings. During the change self.info() was changed to 
self.logger.info() . Logger expects a positional argument that contains the 
message thus causing failure. I think empty string can be passed here. I 
changed it back to self.info() and ran `make suspicious` locally and it only 
printed deprecation warning. Looking the source the previous method had message 
default to '' thus self.info() was working.

def info(self, message='', nonl=False):
# type: (unicode, bool) > None
"""Emit an informational message.

If *nonl* is true, don't emit a newline at the end (which implies that
more info output will follow soon.)

.. deprecated:: 1.6
   Use :mod:`sphinx.util.logging` instead.
"""
warnings.warn('app.info() is now deprecated. Use sphinx.util.logging 
instead.',
  RemovedInSphinx20Warning)
logger.info(message, nonl=nonl)


Sample failure : https://travis-ci.org/python/cpython/jobs/444263040#L560

I am adding @pablogsal for thoughts on the fix. I will add a PR shortly.

--
components: Build
messages: 328191
nosy: pablogsal, xtreak
priority: normal
severity: normal
status: open
title: logger failure in suspicious.py
type: behavior
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



[issue35035] Documentation for email.utils is named email.util.rst

2018-10-21 Thread Zhiming Wang


Change by Zhiming Wang :


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

___
Python tracker 

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



[issue35035] Documentation for email.utils is named email.util.rst

2018-10-21 Thread Zhiming Wang


New submission from Zhiming Wang :

Documentation for PSL module email.utils is named email.util.rst. See 
.

This seems to violate the principle of least surprise. (I have a command line 
tool to open documentation for any PSL module, and I found this name mismatch 
when I used that with email.utils.) It should be named email.utils.rst instead, 
unless there's a specific reason not to.

--
assignee: docs@python
components: Documentation
messages: 328190
nosy: docs@python, zmwangx
priority: normal
severity: normal
status: open
title: Documentation for email.utils is named email.util.rst
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