[issue38015] inline function generates slightly inefficient machine code

2019-09-07 Thread Sergey Fedoseev


Sergey Fedoseev  added the comment:

I use GCC 9.2.

--

___
Python tracker 

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



[issue38015] inline function generates slightly inefficient machine code

2019-09-07 Thread Ma Lin


Ma Lin  added the comment:

> This change produces tiny, but measurable speed-up for handling small ints

I didn't get measurable change, I run this command a dozen times and take the 
best result:

D:\dev\cpython\PCbuild\amd64\python.exe -m pyperf timeit -s "from collections 
import deque; consume = deque(maxlen=0).extend; r = range(256)" "consume(r)"  
--duplicate=1000

before: Mean +- std dev: 771 ns +- 16 ns
after:  Mean +- std dev: 770 ns +- 10 ns

Environment:
64-bit release build by MSVC 2017
CPU: i3 4160, System: latest Windows 10 64-bit

Check the machine code from godbolt.org, x64 MSVC v19.14 only saves one 
instruction:
movsxd  rax, ecx

x86-64 GCC 9.2 saves two instructions:
lea eax, [rdi+5]
cdqe

--

___
Python tracker 

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



[issue25457] json dump fails for mixed-type keys when sort_keys is specified

2019-09-07 Thread Roundup Robot


Change by Roundup Robot :


--
pull_requests: +15382
pull_request: https://github.com/python/cpython/pull/15691

___
Python tracker 

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



Re: issue in handling CSV data

2019-09-07 Thread Sharan Basappa
On Saturday, 7 September 2019 21:18:11 UTC-4, MRAB  wrote:
> On 2019-09-08 01:19, Sharan Basappa wrote:
> > I am trying to read a log file that is in CSV format.
> > 
> > The code snippet is below:
> > 
> > ###
> > import matplotlib.pyplot as plt
> > import seaborn as sns; sns.set()
> > import numpy as np
> > import pandas as pd
> > import os
> > import csv
> > from numpy import genfromtxt
> > 
> > # read the CSV and get into X array
> > os.chdir(r'D:\Users\sharanb\OneDrive - HCL Technologies 
> > Ltd\Projects\MyBackup\Projects\Initiatives\machine 
> > learning\programs\constraints')
> > X = []
> > #with open("constraints.csv", 'rb') as csvfile:
> > #reader = csv.reader(csvfile)
> > #data_as_list = list(reader)
> > #myarray = np.asarray(data_as_list)
> > 
> > my_data = genfromtxt('constraints.csv', delimiter = ',', dtype=None)
> > print (my_data)
> > 
> > my_data_1 = np.delete(my_data, 0, axis=1)
> > print (my_data_1)
> > 
> > my_data_2 = np.delete(my_data_1, 0, axis=1)
> > print (my_data_2)
> > 
> > my_data_3 = my_data_2.astype(np.float)
> > 
> > 
> > Here is how print (my_data_2) looks like:
> > ##
> > [['"\t"81' '"\t5c']
> >   ['"\t"04' '"\t11']
> >   ['"\t"e1' '"\t17']
> >   ['"\t"6a' '"\t6c']
> >   ['"\t"53' '"\t69']
> >   ['"\t"98' '"\t87']
> >   ['"\t"5c' '"\t4b']
> > ##
> > 
> > Finally, I am trying to get rid of the strings and get array of numbers 
> > using Numpy's astype function. At this stage, I get an error.
> > 
> > This is the error:
> > my_data_3 = my_data_2.astype(np.float)
> > could not convert string to float: " "81
> > 
> > As you can see, the string "\t"81 is causing the error.
> > It seems to be due to char "\t".
> > 
> > I don't know how to resolve this.
> > 
> > Thanks for your help.
> > 
> Are you sure it's CSV (Comma-Separated Value) and not TSV (Tab-Separated 
> Value)?
> 
> Also the values look like hexadecimal to me. I think that 
> .astype(np.float) assumes that the values are decimal.
> 
> I'd probably start by reading them using the csv module, convert the 
> values to decimal, and then pass them on to numpy.

yes. it is CSV. The commas are gone once csv.reader processed the csv file.
The tabs seem to be there also which seem to be causing the issue.

Thanks for your response
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue24416] Have date.isocalendar() return a structseq instance

2019-09-07 Thread Tim Peters


Change by Tim Peters :


--
assignee:  -> rhettinger

___
Python tracker 

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



Is it 'fine' to instantiate a widget without parent parameter?

2019-09-07 Thread jfong
I know it is valid, according to the Tkinter source, every widget constructor 
has a 'master=None' default. What happens on doing this? In what circumstance, 
we do it this way? and will it cause any trouble?

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


[issue24416] Have date.isocalendar() return a structseq instance

2019-09-07 Thread Raymond Hettinger


Raymond Hettinger  added the comment:

[Tim Peters]
> I favor making this a structseq

If there are no further objections to upgrading isocalendar() to return a 
structseq, I would like to take the issue back so I can supervise  Dong-hee Na 
writing a patch and then help bring it fruition.

--

___
Python tracker 

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



Re: issue in handling CSV data

2019-09-07 Thread MRAB

On 2019-09-08 01:19, Sharan Basappa wrote:

I am trying to read a log file that is in CSV format.

The code snippet is below:

###
import matplotlib.pyplot as plt
import seaborn as sns; sns.set()
import numpy as np
import pandas as pd
import os
import csv
from numpy import genfromtxt

# read the CSV and get into X array
os.chdir(r'D:\Users\sharanb\OneDrive - HCL Technologies 
Ltd\Projects\MyBackup\Projects\Initiatives\machine 
learning\programs\constraints')
X = []
#with open("constraints.csv", 'rb') as csvfile:
#reader = csv.reader(csvfile)
#data_as_list = list(reader)
#myarray = np.asarray(data_as_list)

my_data = genfromtxt('constraints.csv', delimiter = ',', dtype=None)
print (my_data)

my_data_1 = np.delete(my_data, 0, axis=1)
print (my_data_1)

my_data_2 = np.delete(my_data_1, 0, axis=1)
print (my_data_2)

my_data_3 = my_data_2.astype(np.float)


Here is how print (my_data_2) looks like:
##
[['"\t"81' '"\t5c']
  ['"\t"04' '"\t11']
  ['"\t"e1' '"\t17']
  ['"\t"6a' '"\t6c']
  ['"\t"53' '"\t69']
  ['"\t"98' '"\t87']
  ['"\t"5c' '"\t4b']
##

Finally, I am trying to get rid of the strings and get array of numbers using 
Numpy's astype function. At this stage, I get an error.

This is the error:
my_data_3 = my_data_2.astype(np.float)
could not convert string to float: " "81

As you can see, the string "\t"81 is causing the error.
It seems to be due to char "\t".

I don't know how to resolve this.

Thanks for your help.

Are you sure it's CSV (Comma-Separated Value) and not TSV (Tab-Separated 
Value)?


Also the values look like hexadecimal to me. I think that 
.astype(np.float) assumes that the values are decimal.


I'd probably start by reading them using the csv module, convert the 
values to decimal, and then pass them on to numpy.

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


Re: issue in handling CSV data

2019-09-07 Thread Joel Goldstick
On Sat, Sep 7, 2019 at 8:28 PM Joel Goldstick  wrote:
>
> On Sat, Sep 7, 2019 at 8:21 PM Sharan Basappa  
> wrote:
> >
> > I am trying to read a log file that is in CSV format.
> >
> > The code snippet is below:
> >
> > ###
> > import matplotlib.pyplot as plt
> > import seaborn as sns; sns.set()
> > import numpy as np
> > import pandas as pd
> > import os
> > import csv
> > from numpy import genfromtxt
> >
> > # read the CSV and get into X array
> > os.chdir(r'D:\Users\sharanb\OneDrive - HCL Technologies 
> > Ltd\Projects\MyBackup\Projects\Initiatives\machine 
> > learning\programs\constraints')
> > X = []
> > #with open("constraints.csv", 'rb') as csvfile:
> > #reader = csv.reader(csvfile)
> > #data_as_list = list(reader)
> > #myarray = np.asarray(data_as_list)
> >
> > my_data = genfromtxt('constraints.csv', delimiter = ',', dtype=None)
> > print (my_data)
> >
> > my_data_1 = np.delete(my_data, 0, axis=1)
> > print (my_data_1)
> >
> > my_data_2 = np.delete(my_data_1, 0, axis=1)
> > print (my_data_2)
> >
> > my_data_3 = my_data_2.astype(np.float)
> > 
> >
> > Here is how print (my_data_2) looks like:
> > ##
> > [['"\t"81' '"\t5c']
> >  ['"\t"04' '"\t11']
> >  ['"\t"e1' '"\t17']
> >  ['"\t"6a' '"\t6c']
> >  ['"\t"53' '"\t69']
> >  ['"\t"98' '"\t87']
> >  ['"\t"5c' '"\t4b']
> > ##
> >
> > Finally, I am trying to get rid of the strings and get array of numbers 
> > using Numpy's astype function. At this stage, I get an error.
> >
> > This is the error:
> > my_data_3 = my_data_2.astype(np.float)
> > could not convert string to float: " "81
> >
> > As you can see, the string "\t"81 is causing the error.
> > It seems to be due to char "\t".
> >
> > I don't know how to resolve this.
> >
> > Thanks for your help.
> >
> > --
> > https://mail.python.org/mailman/listinfo/python-list
>
> how about (strip(my_data_2).astype(np.float))
>
> I haven't used numpy, but if your theory is correct, this will clean
> up the string
>
oops, I think I was careless at looking at your data.  so this doesn't
seem like such a good idea
> --
> Joel Goldstick
> http://joelgoldstick.com/blog
> http://cc-baseballstats.info/stats/birthdays



-- 
Joel Goldstick
http://joelgoldstick.com/blog
http://cc-baseballstats.info/stats/birthdays
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: issue in handling CSV data

2019-09-07 Thread Joel Goldstick
On Sat, Sep 7, 2019 at 8:21 PM Sharan Basappa  wrote:
>
> I am trying to read a log file that is in CSV format.
>
> The code snippet is below:
>
> ###
> import matplotlib.pyplot as plt
> import seaborn as sns; sns.set()
> import numpy as np
> import pandas as pd
> import os
> import csv
> from numpy import genfromtxt
>
> # read the CSV and get into X array
> os.chdir(r'D:\Users\sharanb\OneDrive - HCL Technologies 
> Ltd\Projects\MyBackup\Projects\Initiatives\machine 
> learning\programs\constraints')
> X = []
> #with open("constraints.csv", 'rb') as csvfile:
> #reader = csv.reader(csvfile)
> #data_as_list = list(reader)
> #myarray = np.asarray(data_as_list)
>
> my_data = genfromtxt('constraints.csv', delimiter = ',', dtype=None)
> print (my_data)
>
> my_data_1 = np.delete(my_data, 0, axis=1)
> print (my_data_1)
>
> my_data_2 = np.delete(my_data_1, 0, axis=1)
> print (my_data_2)
>
> my_data_3 = my_data_2.astype(np.float)
> 
>
> Here is how print (my_data_2) looks like:
> ##
> [['"\t"81' '"\t5c']
>  ['"\t"04' '"\t11']
>  ['"\t"e1' '"\t17']
>  ['"\t"6a' '"\t6c']
>  ['"\t"53' '"\t69']
>  ['"\t"98' '"\t87']
>  ['"\t"5c' '"\t4b']
> ##
>
> Finally, I am trying to get rid of the strings and get array of numbers using 
> Numpy's astype function. At this stage, I get an error.
>
> This is the error:
> my_data_3 = my_data_2.astype(np.float)
> could not convert string to float: " "81
>
> As you can see, the string "\t"81 is causing the error.
> It seems to be due to char "\t".
>
> I don't know how to resolve this.
>
> Thanks for your help.
>
> --
> https://mail.python.org/mailman/listinfo/python-list

how about (strip(my_data_2).astype(np.float))

I haven't used numpy, but if your theory is correct, this will clean
up the string


-- 
Joel Goldstick
http://joelgoldstick.com/blog
http://cc-baseballstats.info/stats/birthdays
-- 
https://mail.python.org/mailman/listinfo/python-list


issue in handling CSV data

2019-09-07 Thread Sharan Basappa
I am trying to read a log file that is in CSV format.

The code snippet is below:

###
import matplotlib.pyplot as plt
import seaborn as sns; sns.set()
import numpy as np
import pandas as pd
import os
import csv
from numpy import genfromtxt

# read the CSV and get into X array
os.chdir(r'D:\Users\sharanb\OneDrive - HCL Technologies 
Ltd\Projects\MyBackup\Projects\Initiatives\machine 
learning\programs\constraints')
X = []
#with open("constraints.csv", 'rb') as csvfile:
#reader = csv.reader(csvfile)
#data_as_list = list(reader)
#myarray = np.asarray(data_as_list)

my_data = genfromtxt('constraints.csv', delimiter = ',', dtype=None)
print (my_data)

my_data_1 = np.delete(my_data, 0, axis=1)
print (my_data_1)

my_data_2 = np.delete(my_data_1, 0, axis=1)
print (my_data_2)

my_data_3 = my_data_2.astype(np.float)


Here is how print (my_data_2) looks like:
##
[['"\t"81' '"\t5c']
 ['"\t"04' '"\t11']
 ['"\t"e1' '"\t17']
 ['"\t"6a' '"\t6c']
 ['"\t"53' '"\t69']
 ['"\t"98' '"\t87']
 ['"\t"5c' '"\t4b']
##

Finally, I am trying to get rid of the strings and get array of numbers using 
Numpy's astype function. At this stage, I get an error.

This is the error:
my_data_3 = my_data_2.astype(np.float)
could not convert string to float: " "81 

As you can see, the string "\t"81 is causing the error.
It seems to be due to char "\t". 

I don't know how to resolve this.

Thanks for your help.

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


3 cubes that sum to 42

2019-09-07 Thread Terry Reedy
>>> (-80538738812075974)**3 + 80435758145817515**3 + 
12602123297335631**3 == 42

True  # Impressively quickly, in a blink of an eye.

This is the last number < 100, not theoretically excluded, to be solved. 
 Compute power provided by CharityEngine.  For more, see Numberphile...

https://www.youtube.com/watch?v=zyG8Vlw5aAw

--
Terry Jan Reedy

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


[issue38052] Include sspipe Module with Core Python

2019-09-07 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Before proposing a third party module for inclusion in the standard library, 
you should check:

- is the module mature and stable?

- does it have an FOSS licence compatible with Python, and if not, are the 
authors willing to re-licence it?

- are the authors willing to donate the module to Python?

- are the authors happy to change their release schedule to match Python?

- are they happy to adhere to Python's policy on backwards compatibility and 
new functionality?

- are you (or the authors) willing to write a PEP proposing to add this module 
to the standard library? https://www.python.org/dev/peps/

- can you find a Core Developer willing to sponsor this PEP? (You can probably 
ask on the Python-Dev or Python-Ideas mailing lists, or the Python Discuss, or 
face-to-face in person at a sprint, etc.)

Only after you have done all those things, and got Yes answers to them all, 
should you propose adding the module. (A single No means there is no chance.)

--
nosy: +steven.daprano

___
Python tracker 

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



[issue26868] Document PyModule_AddObject's behavior on error

2019-09-07 Thread Ma Lin


Change by Ma Lin :


--
nosy: +Ma Lin

___
Python tracker 

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



[issue38014] Python 3.7 does not compile

2019-09-07 Thread Bill Minasian


Bill Minasian  added the comment:

Under OSX 10.15 beta and Xcode 11.0 beta the following does not work:
./configure --enable-framework

DYLD_FRAMEWORK_PATH=/Users/bill/cpython ./python.exe -E -S -m sysconfig 
--generate-posix-vars ;\
if test $? -ne 0 ; then \
echo "generate-posix-vars failed" ; \
rm -f ./pybuilddir.txt ; \
exit 1 ; \
fi
/bin/sh: line 1: 78734 Segmentation fault: 11  
DYLD_FRAMEWORK_PATH=/Users/bill/cpython ./python.exe -E -S -m sysconfig 
--generate-posix-vars
generate-posix-vars failed

The following seems to work:
./configure --disable-framework

My guess is that this is an Xcode 11 beta issue.

--
nosy: +BMinas

___
Python tracker 

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



[issue38048] unususal behavior

2019-09-07 Thread Zachary Ware


Zachary Ware  added the comment:

To reiterate, there is no bug in Python here.  The code that you attached here 
has a typo that turns this example into an infinite loop, and the Windows 
Command Prompt will happily take any input and echo it, even though Python is 
not actually consuming any of it.

--

___
Python tracker 

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



Re: How python knows where non standard libraries are stored ?

2019-09-07 Thread Terry Reedy

On 9/7/2019 5:51 AM, ast wrote:


'C:\\Program Files\\Python36-32\\lib\\site-packages']

The last path is used as a location to store libraries
you install yourself.

If I am using a virtual environment (with venv) this last
path is different

'C:\\Users\\jean-marc\\Desktop\\myenv\\lib\\site-packages'

I looked for windows environment variables to tell python
how to fill sys.path at startup but I didn't found.

So how does it work ?


I believe that the short answer, skipping the gory details provided by 
Eryk, is that the result is the same as

os.path.dirname(sys.executable) + r"\lib\site-packages"

You can check if this works for the venv.

--
Terry Jan Reedy

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


2to3, str, and basestring

2019-09-07 Thread Terry Reedy
2to3 converts syntactically valid 2.x code to syntactically valid 3.x 
code.  It cannot, however, guarantee semantic correctness.  A particular 
problem is that str is semantically ambiguous in 2.x, as it is used both 
for text encoded as bytes and binary data.


To resolve the ambiguity for conversions to 3.x, 2.6 introduced 'bytes' 
as a synonym for 'str'. The intention is that one use 'bytes' to create 
or refer to 2.x bytes that should remain bytes in 3.x and use 'str' to 
create or refer to 2.x text bytes that should become or will be unicode 
in 3.x.  3.x and hence 2to3 *assume* that one is using 'bytes' and 'str' 
this way, so that 'unicode' becomes an unneeded synonym for 'str' and 
2to3 changes 'unicode' to 'str'.  If one does not use 'str' and 'bytes' 
as intended, 2to3 may produce semantically different code.


2.3 introduced abstract superclass 'basestring', which can be viewed as 
Union(unicode, str).  "isinstance(value, basestring)" is defined as 
"isinstance(value, (unicode, str))"  I believe the intended meaning was 
'text, whether unicode or encoded bytes'.  Certainly, any code following

  if isinstance(value, basestring):
would likely only make sense if that were true.

In any case, after 2.6, one should only use 'basestring' when the 'str' 
part has its restricted meaning of 'unicode in 3.x'.  "(unicode, bytes)" 
is semantically different from "basestring" and "(unicode, str)" when 
used in isinstance.  2to3 converts then to "(std, bytes)", 'str', and 
'(str, str)' (the same as 'str' when used in isinstance).  If one uses 
'basestring' when one means '(unicode, bytes)', 2to3 may produce 
semantically different code.


Example based on https://bugs.python.org/issue38003:

if isinstance(value, basestring):
if not isinstance(value, unicode):
value = value.decode(encoding)
process_text(value)
else:
process_nontext(value)

2to3 produces

if isinstance(value, str):
if not isinstance(value, str):
value = value.decode(encoding)
process_text(value)
else:
process_nontext(value)

If, in 3.x, value is always unicode, then the inner conditional is dead 
and can be removed.  But if, in 3.x, value might be byte-encoded text, 
it will not be decoded and the code is wrong.  Fixes:


1. Instead of decoding value after the check, do it before the check.  I 
think this is best for new code.


if isinstance(value, bytes):
value = value.decode(encoding)
...
if isinstance(value, unicode):
process_text(value)
else:
process_nontext(value)

2. Replace 'basestring' with '(unicode, bytes)'.  This is easier with 
existing code.


if isinstance(value, basestring):
if not isinstance(value, unicode):
value = value.decode(encoding)
process_text(value)
else:
process_nontext(value)

(I believe but have not tested that) 2to3 produces correct 3.x code from 
either 1 or 2 after replacing 'unicode' with 'str'.


In both cases, the 'unicode' to 'str' replacement should result in 
correct 3.x code.


3. Edit Lib/lib2to3/fixes/fix_basestring.py to replace 'basestring' with 
'(str, bytes)' instead of 'str'.  This should be straightforward if one 
understands the ast format.



Note that 2to3 is not meant for 2&3 code using exception tricks and 
six/future imports.  Turning 2&3 code into idiomatic 3-only code is a 
separate subject.


--
Terry Jan Reedy

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


[issue38003] Change 2to3 to replace 'basestring' with '(str,bytes)'

2019-09-07 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Replace 2. above with "2. Replace 'basestring' with '(unicode, bytes)'."

--

___
Python tracker 

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



[issue38053] Update plistlib documentation

2019-09-07 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


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



[issue38053] Update plistlib documentation

2019-09-07 Thread Jon Janzen


New submission from Jon Janzen :

* Update "Mac OS X" to "Apple" since plists are used more widely than just macOS
* Remove notes about the new API being added in 3.4 since 3.4 is no longer 
supported
* Re-add the UID class documentation (oops, removed in issue36409)

--
assignee: docs@python
components: Documentation
messages: 351309
nosy: bigfootjon, docs@python
priority: normal
pull_requests: 15381
severity: normal
status: open
title: Update plistlib documentation
type: enhancement
versions: Python 3.9

___
Python tracker 

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



[issue38003] Change 2to3 to replace 'basestring' with '(str,bytes)'

2019-09-07 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Replacing 'basestring' with 'str' is not a bug in the behavioral sense because 
it is intended and documented.
https://docs.python.org/3/library/2to3.html#2to3fixer-basestring

How the current behavior is correct: 2to3 converts syntactically valid 2.x code 
to syntactically valid 3.x code.  It cannot, however, guarantee semantic 
correctness.  A particular problem is that str is semantically ambiguous in 
2.x, as it is used both for (encoded) text and binary data.  To resolve the 
ambiguity, 2.6 introduced 'bytes' as a synonym for 'str'.  2to3 assumes that 
'bytes' means binary data, including text that will still be encoded in 3.x, 
while 'str' means text that is encoded bytes in 2.x but *will be unicode* in 
3.x.  Hence it changes 'unicode' to unambiguous 'str' and 'basestring' == 
Union(unicode, str) to Union(str, str) == 'str'.

If you fool 2to3 by applying isinstance(value, basestring) to a value that will 
still be bytes at that point in 3.x, you get a semantic change.  Possible fixes:

1. Since you decode value after the check, do it before the check.

if isinstance(value, bytes):
value = value.decode(encoding)
if not isinstance(value, unicode):
some other code

2. Replace 'basestring' with '(unicode, basestring)'

In both cases, the 'unicode' to 'str' replacement should result in correct 3.x 
code.

3. Edit Lib/lib2to3/fixes/fix_basestring.py to replace with '(str, bytes)'.  
This should be straightforward, but ask on python-list if you need help.

As for your second example, 2to3 is not meant for 2&3 code using exception 
tricks and six/future imports.  Turning 2&3 code into idiomatic 3-only code is 
a separate subject.

Since other have and will run into the same issues, I intend to post a revised 
version of the explanation above, with fixes for a revised example, to 
python-list as "2to3, str, and basestring".  Any further discussion should go 
there.

--
resolution: rejected -> not a bug

___
Python tracker 

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



[issue38052] Include sspipe Module with Core Python

2019-09-07 Thread Juan Telleria


Change by Juan Telleria :


--
type:  -> enhancement

___
Python tracker 

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



[issue38052] Include sspipe Module with Core Python

2019-09-07 Thread Juan Telleria


New submission from Juan Telleria :

Could sspipe be included as a Core Python module?

https://sspipe.github.io/

https://github.com/sspipe/sspipe

https://pypi.org/project/sspipe/

sspipe allows to use syntax such as:

from sspipe import p, px
import numpy as np
import pandas as pd

(
  np.linspace(0, pi, 100) 
  | p({'x': px, 'y': np.sin(px)}) 
  | p(pd.DataFrame)
  | px[px.x > px.y].head()
  | p(print, "Example 6: pandas and numpy support:\n", px)
)

--
components: Extension Modules
messages: 351307
nosy: Juan Telleria2
priority: normal
severity: normal
status: open
title: Include sspipe Module with Core Python
versions: Python 3.9

___
Python tracker 

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



[issue38051] time.strftime handling %z/%Z badly

2019-09-07 Thread John Daily


New submission from John Daily :

My apologies if this is a duplicate; there are more than a few bug reports on 
time and strftime, but I wasn't able to locate any reporting this specifically.

I'd be happy to do more in-depth tests with some guidance. I see that this is 
largely the responsibility of system libraries, but it seems likely that Python 
is doing something incorrectly when invoking them since the behavior is broken 
in both Mac and Windows.

On both my personal Mac laptop and work Windows laptop, time.strftime('%z') 
gives the wrong output. On Windows, '%Z' also fails.

I'm currently at -0400 (EDT) and my best guess is that because the tm_isdst 
flag is set to false, it's interpreting my Eastern time zone as it would be 
when we're no longer on DST.

Technically displaying "UTC" is also a bug, since the actual time zone is 
"GMT". Python 3.6 on my Amazon Linux instance handles everything correctly.


Mac, 3.7.3:

>>> epoch = int(datetime.datetime.now().timestamp())
>>> epoch
1567872682
>>> gmt = time.gmtime(epoch)
>>> gmt.tm_zone
'UTC'
>>> time.strftime('%Z', gmt)
'UTC'
>>> time.strftime('%z', gmt)
'-0500'

Python 3.7.1, Windows 7

>>> gmt.tm_zone
'UTC'
>>> time.strftime('%Z', gmt)
'Eastern Standard Time'
>>> time.strftime('%z', gmt)
'-0500'

Python 3.6.8, Amazon Linux

>>> epoch = int(datetime.datetime.now().timestamp())
>>> gmt = time.gmtime(epoch)
>>> gmt.tm_zone
'GMT'
>>> time.strftime('%Z', gmt)
'GMT'
>>> time.strftime('%z', gmt)
'+'

--
messages: 351306
nosy: macintux
priority: normal
severity: normal
status: open
title: time.strftime handling %z/%Z badly
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



[issue12731] python lib re uses obsolete sense of \w in full violation of UTS#18 RL1.2a

2019-09-07 Thread Justin Arthur


Change by Justin Arthur :


--
nosy: +JustinTArthur

___
Python tracker 

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



Re: fileinput module not yielding expected results

2019-09-07 Thread Jason Friedman
>
> If you're certain that the headers are the same in each file,
> then there's no harm and much simplicity in reading them each
> time they come up.
>
>  with fileinput ...:
>  for line in f:
>  if fileinput.isfirstline():
>  headers = extract_headers(line)
>  else:
>  pass # process a non-header line here
>
> Yes, the program will take slightly longer to run.  No, you won't
> notice it.
>
> Ah, thank you Dan. I followed your advice ... the working code:

with fileinput.input(sys.argv[1:]) as f:
reader = csv.DictReader(f)
for row in reader:
if fileinput.isfirstline():
continue
for key, value in row.items():
pass #processing

I was hung up on that continue on firstline, because I thought that would
skip the header of the first file. I think now the csv.DictReader(f)
command consumes it first.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue38003] Change 2to3 to replace 'basestring' with '(str,bytes)'

2019-09-07 Thread Benjamin Peterson


Benjamin Peterson  added the comment:

meant to say "really couldn't"

--

___
Python tracker 

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



[issue38003] Change 2to3 to replace 'basestring' with '(str,bytes)'

2019-09-07 Thread Benjamin Peterson


Benjamin Peterson  added the comment:

Even at this late stage, we could really change 2to3's behavior here. 
Presumably many others are relying on the current behavior.

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



Re: fileinput module not yielding expected results

2019-09-07 Thread Barry Scott



> On 7 Sep 2019, at 16:33, Dan Sommers <2qdxy4rzwzuui...@potatochowder.com> 
> wrote:
> 
>with fileinput ...:
>for line in f:
>if fileinput.isfirstline():
>headers = extract_headers(line)
>else:
>pass # process a non-header line here

If you always know you can skip the first line I use this pattern

with fileinput ...:
next(f) # skip header
for line in f:
# process a non-header line here

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


[issue38050] open('file.txt') path not found

2019-09-07 Thread Steve Dower


Steve Dower  added the comment:

Potentially an IDLE issue, if valid but incorrect code is causing it to break.

Sean, we'll need you to provide step-by-step instructions (including copies of 
any files you are using) to see the problem ourselves, otherwise there's no way 
we can help. Please also include the full text of any error messages you 
receive. Without the error text (not just "I got an error"), we have no idea 
what could be going wrong.

--
assignee:  -> terry.reedy
components: +IDLE -Windows
nosy: +terry.reedy
stage: resolved -> test needed
status: closed -> open

___
Python tracker 

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



[issue26868] Document PyModule_AddObject's behavior on error

2019-09-07 Thread Brandt Bucher


Change by Brandt Bucher :


--
pull_requests: +15380
pull_request: https://github.com/python/cpython/pull/15725

___
Python tracker 

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



Re: fileinput module not yielding expected results

2019-09-07 Thread Dan Sommers

On 9/7/19 11:12 AM, Jason Friedman wrote:


$ grep "File number" ~/result | sort | uniq
File number: 3

I expected that last grep to yield:
File number: 1
File number: 2
File number: 3
File number: 4
File number: 5
File number: 6


As per https://docs.python.org/3/library/fileinput.html#fileinput.fileno,
fileno is the underlying file descriptor of the file, and not at
all what you're looking for.


My ultimate goal is as follows. I have multiple CSV files, each with the
same header line. I want to read the header line from the first file and
ignore it for subsequent files.


If you're certain that the headers are the same in each file,
then there's no harm and much simplicity in reading them each
time they come up.

with fileinput ...:
for line in f:
if fileinput.isfirstline():
headers = extract_headers(line)
else:
pass # process a non-header line here

Yes, the program will take slightly longer to run.  No, you won't
notice it.
--
https://mail.python.org/mailman/listinfo/python-list


fileinput module not yielding expected results

2019-09-07 Thread Jason Friedman
import csv
import fileinput
import sys

print("Version: " + str(sys.version_info))
print("Files: " + str(sys.argv[1:]))

with fileinput.input(sys.argv[1:]) as f:
for line in f:
print(f"File number: {fileinput.fileno()}")
print(f"Is first line: {fileinput.isfirstline()}")


I run this:
$ python3 program.py ~/Section*.csv > ~/result

I get this:
$ grep "^Version" ~/result
Version: sys.version_info(major=3, minor=7, micro=1, releaselevel='final',
serial=0)

$ grep "^Files" ~/result
Files: ['/home/jason/Section01.csv', '/home/jason/Section02.csv',
'/home/jason/Section03.csv', '/home/jason/Section04.csv',
'/home/jason/Section05.csv', '/home/jason/Section06.csv']

$ grep -c "True" ~/result
6

That all makes sense to me, but this does not:

$ grep "File number" ~/result | sort | uniq
File number: 3

I expected that last grep to yield:
File number: 1
File number: 2
File number: 3
File number: 4
File number: 5
File number: 6

My ultimate goal is as follows. I have multiple CSV files, each with the
same header line. I want to read the header line from the first file and
ignore it for subsequent files.

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


Which PyQt-compatible, performant graphing library should I use?

2019-09-07 Thread kangalioo654
Hi,

Currently I'm making a statistics tool for a game I'm playing with PyQt5. I'm 
not happy with my current graphing library though. In the beginning I've used 
matplotlib, which was way too laggy for my use case. Currently I have 
pyqtgraph, which is snappy, but is missing useful features.

The Python graphing library selection is overwhelming, which is why I'm asking 
here for a recommendation.

Things that I need the library to support:

* PyQt5 integration
* plot layout in a grid
* performant navigation
* scatter plots, simple and stacked bar charts

Things that I don't strictly *require*, but would be really useful:

* log scale support (specifically for y-axis)
* tooltip support, or alternatively click callback support
* plot legend
* datetime axes support (like in matplotlib)
* configurable colors, scatter spot sizes, bar widths, etc.

Here are some screenshots how my application currently looks like with 
pyqtgraph:
https://i.redd.it/rx423arbw5l31.png
https://i.redd.it/r68twvfmw5l31.png

I would be really grateful for some recommendations!
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How python knows where non standard libraries are stored ?

2019-09-07 Thread Eryk Sun
On 9/7/19, ast  wrote:
>
> Eg on my system, here is the content of sys.path:
>
>  >>> import sys
>  >>> sys.path
> ['',

In the REPL, "" is added for loading modules from the current
directory. When executing a script, this would be the script
directory.

> 'C:\\Users\\jean-marc\\Desktop\\python',

Probably this directory is in your %PYTHONPATH% environment variable,
which gets inserted here, normally ahead of everything else except for
the script directory.

> 'C:\\Program Files\\Python36-32\\python36.zip',

The zipped standard-library location is assumed to be beside the DLL or EXE.

Next the interpreter adds the PythonPath directories from the
registry. These are found in subkeys of
r"[HKLM|HKCU]\Python\PythonCore\3.6-32\PythonPath". The base key has
default core paths for the standard library, which normally are
ignored unless the interpreter can't find its home directory.

> 'C:\\Program Files\\Python36-32\\DLLs',
> 'C:\\Program Files\\Python36-32\\lib',

These two are derived from the default core standard-library paths,
which are hard-coded in the C macro, PYTHONPATH:

#define PYTHONPATH L".\\DLLs;.\\lib"

At startup the interpreter searches for its home directory if
PYTHONHOME isn't set. (Normally it should not be set.) If the zipped
standard library exists, its directory is used as the home directory.
Otherwise it checks for the landmark module "lib/os.py" in the
application directory (i.e. argv0_path), and its ancestor directories
down to the drive root. (If we're executing a virtual environment, the
argv0_path gets set from the "home" value in its pyvenv.cfg file.)
Normally the home directory is argv0_path.

The home directory is used to resolve the "." components in the
hard-coded PYTHONPATH string. If no home directory has been found, the
interpreter uses the default core paths from the "PythonPath" registry
key as discussed above. If even that isn't found, it just adds the
relative paths, ".\\DLLs" and ".\\lib".

> 'C:\\Program Files\\Python36-32',

Windows Python has this peculiar addition. It always adds argv0_path
(typically the application directory). Perhaps at some time in the
past it was necessary because extension modules were located here.
AFAIK, this is vestigial now, unless some embedding applications rely
on it.

At this point if it still hasn't found the home directory, the
interpreter checks for the "lib/os.py" landmark in all of the
directories that have been added to the module search path. This is a
last-ditch effort to find the standard library and set sys.prefix.

> 'C:\\Program Files\\Python36-32\\lib\\site-packages']

Now we're into the site module additions, including .pth files, which
is pretty well documented via help(site) and the docs:

https://docs.python.org/3/library/site.html

The -S command-line option prevents importing the site module at startup.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue31387] asyncio should make it easy to enable cooperative SIGINT handling

2019-09-07 Thread Ryan Hiebert


Change by Ryan Hiebert :


--
nosy: +ryanhiebert

___
Python tracker 

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



[issue29988] with statements are not ensuring that __exit__ is called if __enter__ succeeds

2019-09-07 Thread Ryan Hiebert


Change by Ryan Hiebert :


--
nosy: +ryanhiebert

___
Python tracker 

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



[issue38050] open('file.txt') path not found

2019-09-07 Thread Sean Frazier


Sean Frazier  added the comment:

If you are running a program and an the program crashes, then doesn't work 
properly afterward, what would you call that?

--

___
Python tracker 

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



[issue38050] open('file.txt') path not found

2019-09-07 Thread Eric V. Smith


Eric V. Smith  added the comment:

This is almost certainly not a bug in Python. This forum is for reporting bugs 
in Python, not for getting help on using Python. I suggest you try the 
python-tutor mailing list: https://mail.python.org/mailman/listinfo/tutor

--
nosy: +eric.smith
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



[issue32972] unittest.TestCase coroutine support

2019-09-07 Thread Thrlwiti


Change by Thrlwiti :


--
nosy: +THRlWiTi

___
Python tracker 

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



Re: How python knows where non standard libraries are stored ?

2019-09-07 Thread dieter
ast  writes:
> I looked for windows environment variables to tell python
> how to fill sys.path at startup but I didn't found.
>
> So how does it work ?

Read the (so called) docstring at the beginning of the module
"site.py".

Either locate the module source in the file system
and read it in an editor
or in an interactive Python do:

   import site
   help(site)

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


[issue38050] open('file.txt') path not found

2019-09-07 Thread Sean Frazier


New submission from Sean Frazier :

I am running a problem in 'Think Python' and was having no issues with:

fin = open('words.txt') 

Then when I was working with the reference file, running a function, my IDLE 
crashed and is no longer able to locate files using [var = open('file.txt')]

I have tried opening as 'r' and 'w', with no luck.

Also, sometimes I do not get an error, but when I go to read the list, it is 
empty ''.

--
components: Windows
messages: 351300
nosy: Sean Frazier, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: open('file.txt') path not found
type: resource usage
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



[issue38003] Change 2to3 to replace 'basestring' with '(str,bytes)'

2019-09-07 Thread Bob Kline


Bob Kline  added the comment:

OK, I give up. In parting I will point out that the official Python 2 
documentation says "basestring() This abstract type is the superclass for str 
and unicode. It cannot be called or instantiated, but it can be used to test 
whether an object is an instance of str or unicode. isinstance(obj, basestring) 
is equivalent to isinstance(obj, (str, unicode))." That's exactly what the code 
we are converting (much of which was written years before Python 3 even 
existed) was doing. As for the idea that we weren't really "planning to use it 
as logical text" (ignoring the fact that _everyone_ used Python 2 str objects 
to represent logical text back in 2003, and ignoring the fact that the repro 
case given at the top of this report converts the 8-bit string value to Unicode 
-- why else would it do that except to use the value as "logical text"?) ... 
well, I don't know where to start. I'm done here. :->}

--

___
Python tracker 

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



[issue38046] Can't use sort_keys in json.dumps with mismatched types

2019-09-07 Thread Roundup Robot


Change by Roundup Robot :


--
pull_requests: +15379
pull_request: https://github.com/python/cpython/pull/15691

___
Python tracker 

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



How python knows where non standard libraries are stored ?

2019-09-07 Thread ast

Hello

List sys.path contains all paths where python shall
look for libraries.

Eg on my system, here is the content of sys.path:

>>> import sys
>>> sys.path
['',
'C:\\Users\\jean-marc\\Desktop\\python',
'C:\\Program Files\\Python36-32\\python36.zip',
'C:\\Program Files\\Python36-32\\DLLs',
'C:\\Program Files\\Python36-32\\lib',
'C:\\Program Files\\Python36-32',
'C:\\Program Files\\Python36-32\\lib\\site-packages']

The last path is used as a location to store libraries
you install yourself.

If I am using a virtual environment (with venv) this last
path is different

'C:\\Users\\jean-marc\\Desktop\\myenv\\lib\\site-packages'

I looked for windows environment variables to tell python
how to fill sys.path at startup but I didn't found.

So how does it work ?
--
https://mail.python.org/mailman/listinfo/python-list


[issue15382] os.utime() mishandles some arguments

2019-09-07 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

The documentation issue was fixed in issue23738. The documentation no longer 
claims that ns can be None. If specified it must be a tuple of floats.

--
nosy: +serhiy.storchaka
resolution:  -> out of date
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



[issue38049] Add command-line interface for the ast module

2019-09-07 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
dependencies: +Multiline ast.dump()

___
Python tracker 

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



[issue38049] Add command-line interface for the ast module

2019-09-07 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +15378
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/15724

___
Python tracker 

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



[issue38049] Add command-line interface for the ast module

2019-09-07 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

The proposed PR adds a simple command-line interface to the ast module, similar 
to CLI of the tokenize and dis modules. It reads the content of a specified 
file (or stdin), parses it with ast.parse() and outputs the tree with 
ast.dump().

It can be used for learning internals of the Python compiler, in addition to 
tokenize and dis.

--
components: Library (Lib)
messages: 351297
nosy: benjamin.peterson, brett.cannon, rhettinger, serhiy.storchaka, yselivanov
priority: normal
severity: normal
status: open
title: Add command-line interface for the ast module
type: enhancement
versions: Python 3.9

___
Python tracker 

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



[issue37995] Multiline ast.dump()

2019-09-07 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

> It would be great is the tool wasn't tightly bound to our particular AST and 
> could be used for any hand-rolled AST.

I do not think it is possible. Every tree has its specifics: what types of 
nodes are supported (AST, list and primitive immutable values), what children 
the node can have (node._fields and node._attributes), how to get a child 
(getattr(node, name), but can be absent), what is the node name 
(node.__class__.__name__), how to represent nodes (constructor, list display 
and literals for primitives), what options are supported (annotate_fields, 
include_attributes and indent), what nodes are simple and what are complex. All 
these details are different in every AST implementation. Recursive walking the 
tree is trivial in general, handling specifics makes every foramating function 
unique.

What was interesting in the first Raymond's implementation, is that some simple 
nodes are written in one line. Its code can't be used with ast.AST because of 
different tree structure and different meaning of simple nodes (and also nodes 
with a single child are very rare), but PR 15631 has been updated to produce 
more compact output by using other heuristics:

>>> print(ast.dump(node, indent=3))
Module(
   body=[
  Expr(
 value=Call(
func=Name(id='spam', ctx=Load()),
args=[
   Name(id='eggs', ctx=Load()),
   Constant(value='and cheese', kind=None)],
keywords=[]))],
   type_ignores=[])

--

___
Python tracker 

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



[issue20806] os.times document points to wrong section of non-Linux manual

2019-09-07 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed
versions: +Python 3.7, Python 3.8, Python 3.9 -Python 2.7, Python 3.1, Python 
3.2, Python 3.3, Python 3.4

___
Python tracker 

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



[issue37937] Mention ``frame.f_trace`` in :func:`sys.settrace` docs.

2019-09-07 Thread Ram Rachum


Ram Rachum  added the comment:

Serhiy: I confirmed what you're saying and corrected the documentation. Could 
you please review?

--

___
Python tracker 

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



[issue38048] unususal behavior

2019-09-07 Thread Steven D'Aprano


Steven D'Aprano  added the comment:

Hi Gaurav, 

It is very unlikely that you have "discovered a bug in Python". Millions of 
people use Python every day, and the chances that you will have noticed 
something that everyone else has missed is tiny.

More likely you have misunderstood something. 

Unfortunately, it is impossible to diagnose your issue with the information you 
have provided. But my guess is that it has something to do with the terminal or 
IDE you are using.

As Eric said, you should take this question to another forum, explain how you 
are running your code (in IDLE, Jupyter, the Windows command line, a Linux 
terminal, an IDE like Spyder, PyCharm, etc...) and see if somebody can either 
explain what is happening or confirm that it is an actual bug in the 
interpreter on your system.

This is not a help desk or forum, we're not going to diagnose your issue for 
you, but the Python community is very large and there are plenty of places that 
will be happy to help.

--
nosy: +steven.daprano

___
Python tracker 

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



[issue37937] Mention ``frame.f_trace`` in :func:`sys.settrace` docs.

2019-09-07 Thread Serhiy Storchaka


New submission from Serhiy Storchaka :

AFAIK setting frame.f_trace *instead* of calling sys.settrace() does not work. 
You need to call sys.settrace() to enable tracing.

--
nosy: +serhiy.storchaka

___
Python tracker 

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



[issue20806] os.times document points to wrong section of non-Linux manual

2019-09-07 Thread miss-islington


miss-islington  added the comment:


New changeset a6eac83c1804fd14ed076b1776ffeea8dcb9478a by Miss Islington (bot) 
in branch '3.7':
bpo-20806: Reference both times(2) and times(3) and link to MSDN. (GH-15479)
https://github.com/python/cpython/commit/a6eac83c1804fd14ed076b1776ffeea8dcb9478a


--

___
Python tracker 

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



[issue20806] os.times document points to wrong section of non-Linux manual

2019-09-07 Thread miss-islington


miss-islington  added the comment:


New changeset cc51a6d7c7b6b06fb537860428347d88776d802b by Miss Islington (bot) 
in branch '3.8':
bpo-20806: Reference both times(2) and times(3) and link to MSDN. (GH-15479)
https://github.com/python/cpython/commit/cc51a6d7c7b6b06fb537860428347d88776d802b


--
nosy: +miss-islington

___
Python tracker 

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



[issue38048] unususal behavior

2019-09-07 Thread Gaurav Kumar Pandit


Gaurav Kumar Pandit  added the comment:

The programme has detected a bug in python .For This reson I am using c++ not 
python.
Useless python bsdk

Sent from Mail for Windows 10

From: Eric V. Smith
Sent: 07 September 2019 12:38 PM
To: grvkmrpan...@gmail.com
Subject: [issue38048] unususal behavior

Eric V. Smith  added the comment:

This forum is for reporting bugs in python, not for getting help with writing 
python programs.

I suggest you ask about this on the python-tutor mailing list: 
https://mail.python.org/mailman/listinfo/tutor

Good luck!

--
nosy: +eric.smith
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___

--

___
Python tracker 

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



[issue37461] email.parser.Parser hang

2019-09-07 Thread Larry Hastings


Larry Hastings  added the comment:


New changeset c28e4a5160d3283b12514c7c28ed6e0a2a52271a by larryhastings 
(Abhilash Raj) in branch '3.5':
[3.5] bpo-37461: Fix infinite loop in parsing of specially crafted email 
headers (GH-14794) (#15446)
https://github.com/python/cpython/commit/c28e4a5160d3283b12514c7c28ed6e0a2a52271a


--

___
Python tracker 

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



[issue38048] unususal behavior

2019-09-07 Thread Eric V. Smith


Eric V. Smith  added the comment:

This forum is for reporting bugs in python, not for getting help with writing 
python programs.

I suggest you ask about this on the python-tutor mailing list: 
https://mail.python.org/mailman/listinfo/tutor

Good luck!

--
nosy: +eric.smith
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



[issue20806] os.times document points to wrong section of non-Linux manual

2019-09-07 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15376
stage:  -> patch review
pull_request: https://github.com/python/cpython/pull/15722

___
Python tracker 

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



[issue20806] os.times document points to wrong section of non-Linux manual

2019-09-07 Thread miss-islington


Change by miss-islington :


--
pull_requests: +15377
pull_request: https://github.com/python/cpython/pull/15723

___
Python tracker 

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



[issue20806] os.times document points to wrong section of non-Linux manual

2019-09-07 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:


New changeset 3ccdbc33385a849c60a268def578cb06b8d41be6 by Serhiy Storchaka 
(Joannah Nanjekye) in branch 'master':
bpo-20806: Reference both times(2) and times(3) and link to MSDN. (GH-15479)
https://github.com/python/cpython/commit/3ccdbc33385a849c60a268def578cb06b8d41be6


--

___
Python tracker 

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



[issue38048] unususal behavior

2019-09-07 Thread Gaurav Kumar Pandit


New submission from Gaurav Kumar Pandit :

when I run the programme the cursur is blinking and is taking many number of 
inputs but in the source code I have not written any syntax for taking input

--
components: Windows
files: test.py
messages: 351286
nosy: Gaurav Kumar Pandit, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: unususal behavior
type: behavior
versions: Python 3.7
Added file: https://bugs.python.org/file48597/test.py

___
Python tracker 

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



Guppy 3/Heapy 3.0.5

2019-09-07 Thread YiFei
I am happy to announce Guppy 3 3.0.5

Guppy 3 is a library and programming environment for Python,
currently providing in particular the Heapy subsystem, which supports
object and heap memory sizing, profiling and debugging. It also
includes a prototypical specification language, the Guppy
Specification Language (GSL), which can be used to formally specify
aspects of Python programs and generate tests and documentation from a
common source.

Guppy 3 is a fork of Guppy-PE, created by Sverker Nilsson for Python 2.

The main news in this release:

o Wheel binary compatibility fix for Python >= 3.7, < 3.7.4
o Prefix thread states with interpreter number in RootState
o Made first heap call faster
o Use _PySys_GetSizeOf as default size getter
o Allow xt_hd_traverse to be KeyboardInterrupt-ed

License: MIT

The project homepage is on GitHub:

https://github.com/zhuyifei1999/guppy3

Enjoy,

YiFei Zhu
--
Python-announce-list mailing list -- python-announce-list@python.org
To unsubscribe send an email to python-announce-list-le...@python.org
https://mail.python.org/mailman3/lists/python-announce-list.python.org/

Support the Python Software Foundation:
http://www.python.org/psf/donations/


[issue36742] CVE-2019-10160: urlsplit NFKD normalization vulnerability in user:password@

2019-09-07 Thread Larry Hastings


Larry Hastings  added the comment:


New changeset 095373c32d16df575ba5fcb5f44bf44119b26193 by larryhastings (Victor 
Stinner) in branch '3.5':
bpo-36742: Corrects fix to handle decomposition in usernames (GH-13812) 
(GH-13814) (#14772)
https://github.com/python/cpython/commit/095373c32d16df575ba5fcb5f44bf44119b26193


--

___
Python tracker 

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



[issue36576] Some test_ssl and test_asyncio tests fail with OpenSSL 1.1.1 on Python 3.4 and 3.5

2019-09-07 Thread Larry Hastings


Larry Hastings  added the comment:


New changeset 4d1c2541c125fe9d211016193ebfd5899a8511aa by larryhastings (Victor 
Stinner) in branch '3.5':
bpo-36576: Skip test_ssl and test_asyncio tests failing with OpenSSL 1.1.1 
(#12694)
https://github.com/python/cpython/commit/4d1c2541c125fe9d211016193ebfd5899a8511aa


--
nosy: +larry

___
Python tracker 

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