Re: How to work on a package

2018-02-07 Thread dieter
Roel Schroeven  writes:
> dieter schreef op 7/02/2018 8:21:
> ...
>> Likely, there are many ways to execute tests for your package.
>
>> I am using "setuptools" for packaging (an extension
>> of Python's standard "disutils"). Its "setup.py" supports the "test"
>> command. This means, properly set up, I can run tests
>> with "python setup.py test".
>
> That can solve the testing issue, I guess, even though it feels weird
> to me that the most straightforward way doesn't work.
>
> But testing is not the only issue. Often I'd like to start the Python
> interpreter to load one of the modules in the package to try some
> things out, or write a little script to do the same. These things are
> very natural to me when writing Python code, so it seems very strange
> to me that there's no easy way when working on a packages.

I use a "virtualenv" for this: it is like a private Python environment
with its own set of packages.

The "setup" from "setuptools" not only supports a "test" command
but also a "develop" command. This "links" the package (source)
into Python's (the one you used to run "setup.py"; i.e. usually
the one of a "virtualenv") library and thereby makes it available
for this Python.

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


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

2018-02-07 Thread INADA Naoki

Change by INADA Naoki :


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



[issue32431] Two bytes objects of zero length don't compare equal

2018-02-07 Thread Xiang Zhang

Xiang Zhang  added the comment:

In my mind I don't think here is any problem. The code

val = PyBytes_FromStringAndSize (NULL, 20);
Py_SIZE(val) = 0;

doesn't create a zero length bytes object. A resizing I think should always 
means reorganizing the internal representation, including changing the size 
attribute. Using Py_SIZE won't trigger a full resizing. The code is not 
resizing but just breaks the internal representation and then leads to bugs. In 
C level, if you want, it's easy to muck Python objects. And exposing that much 
implementation details in documentation seems unnecessary.

--
nosy: +xiang.zhang

___
Python tracker 

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



[issue32791] Add\Remove Programs entry is not created.

2018-02-07 Thread WilliamM

New submission from WilliamM :

I've been writing a script for the Python 3.X install package and encountering 
some issues due to that.

I'm using the installation property InstallAllUsers=1 but find that Python is 
still placing it's Add/Remove programs entry in user context.

Applications usually write system level installs to 
HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall or 
HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall

What I'm encountering with Python is that it's writing them to 
HKCU:\Software\Microsoft\Windows\CurrentVersion\Uninstall

This is causing some difficulty as it prevents software such as SCCM, KACE, 
Altiris from being able to detect the main program install or a user with 
elevated privileges from being able to remove it.

Deploying the software will end up with the entry located the System Account's 
registry within 
HKU\S-5-1-18\Software\Microsoft\WIndows\CurrentVersion\Uninstall\{Prodct GUID}

To add a bit more info, only the dependencies show up in 
HKLM:\SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall

Python 3.6.4 TCL/TK support (32-Bit)
Python 3.6.4 Development Libraries (32-Bit)
Python 3.6.5 Documentation (32-Bit)
Python 3.6.4 Utility Scripts (32-Bit)
Python 3.6.4 Executables (32-Bit)
Python launcher (32-Bit)
Python 3.6.4 Test Suite (32-Bit)
Python 3.6.4 Core Interpreter  (32-Bit)
Python 3.6.4 Standard Library (32-Bit)

However the "Python 3.6.4 (32-Bit)" Install that has the installation and 
bundled uninstall package is located in 
HKU\S-1-5-18\Software\Microsoft\WIndows\CurrentVersion\Uninstall\{9218130b-5ad0-4cf7-82be-6993cfd6cb84}

Is there a known workaround/solution for this or something that can be resolved 
in a later build?

--
components: Windows
messages: 311814
nosy: WilliamM, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: Add\Remove Programs entry is not created.
type: behavior
versions: Python 3.6

___
Python tracker 

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



[issue32790] Keep trailing zeros in precision for string format option g

2018-02-07 Thread Severin Wünsch

New submission from Severin Wünsch :

The documentation starts the the string format parameter 'g':

General format. For a given precision p >= 1, this rounds the number to **p 
significant digits** and then formats the result in either fixed-point format 
or in scientific notation, depending on its magnitude.

I think the behavior of format is inconsistent here:
>>> format(0.1949, '.2g')
returns '0.19' as expected but
>>> format(0.1950, '.2g')
returns '0.2' instead of '0.20'

This behavior for float is in my opinion the correct one here
>>> format(0.1950, '.2f')
returns '0.20'

--
messages: 311813
nosy: sk1d
priority: normal
severity: normal
status: open
title: Keep trailing zeros in precision for string format option g
type: behavior
versions: Python 3.7

___
Python tracker 

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



[issue32786] Didnot work strftime() when hangeul in format sting

2018-02-07 Thread Larry Hastings

Change by Larry Hastings :


--
nosy:  -larry

___
Python tracker 

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



[issue32786] Didnot work strftime() when hangeul in format sting

2018-02-07 Thread Myungseo Kang

Myungseo Kang  added the comment:

It works correctly in python 3.6

I think this problem is occured only python 3.4
First, I changed this code like below.

```
'{0:%Y}년 {0:%-m}월 {0:%-d}일'.format(proposal.hold_end_date)
```

But I wonder why doesn't work in only python 3.4

--

___
Python tracker 

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



[issue32394] socket lib beahavior change in 3.6.4

2018-02-07 Thread Ma Lin

Ma Lin  added the comment:

Here is PR 5585 for 3.6 branch.

For 3.7+, I would suggest patch in socketmodule.c like this:

PyMODINIT_FUNC
PyInit__socket(void)
{
PyObject *m, *has_ipv6;
...
...
...
+#ifdef MS_WINDOWS
+   return remove_unusable_flags(m);
+#else
return m;
+#endif
}

In this way, we handle the flags in a separated function 
remove_unusable_flags(m).
It keeps both socket.py and socketmodule.c neat.

Timelines FYI:

3.6.5 candidate: 2018-03-12 (tenative)
3.6.5 final: 2018-03-26 (tentative)

3.7.0 beta 2: 2018-02-26
3.7.0 beta 3: 2018-03-26
3.7.0 beta 4: 2018-04-30

> What's about other OS/flags?
> Should we commit that every exposed socket flag is supported in runtime?
> It looks like very heavy burden.

I have an idea about this concern, I will post it after some experiments.

--

___
Python tracker 

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



[issue32394] socket lib beahavior change in 3.6.4

2018-02-07 Thread Ma Lin

Change by Ma Lin :


--
pull_requests: +5403

___
Python tracker 

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



Re: Benchmarking Django on PyPy with unittest?

2018-02-07 Thread Dan Stromberg
You could probably use the "requests" module to time how long various
operations take in your Django website.

On Wed, Feb 7, 2018 at 2:26 AM, Etienne Robillard  wrote:
> Also, i need to isolate and measure the speed of gevent loop engine
> (gevent.monkey), epoll, and python-specific asyncio coroutines. :-)
>
> Etienne
>
>
>
> Le 2018-02-07 à 04:39, Etienne Robillard a écrit :
>>
>> Hi,
>>
>> is it possible to benchmark a django application  with unittest module in
>> order to compare and measure the speed/latency of the django orm with
>> sqlite3 against ZODB databases?
>> i'm interested in comparing raw sqlite3 performance versus ZODB (schevo).
>> i would like to make specific testsuite(s) for benchmarking django 1.11.7,
>> django 2.0, pypy, etc.
>>
>> What do you think?
>>
>> Etienne
>>
>
> --
> Etienne Robillard
> tkad...@yandex.com
> https://www.isotopesoftware.ca/
>
> --
> https://mail.python.org/mailman/listinfo/python-list
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to work on a package

2018-02-07 Thread Rob Gaddi

On 02/07/2018 03:17 PM, Grant Edwards wrote:

On 2018-02-07, Rob Gaddi  wrote:


When I'm working on a module, the trick is to write a setup.py (using
setuptools) from the very get-go.  Before I write a single line of code,
I've got a setup.py and the directory framework.

Then you install the package using pip -e (or in practice --user -e).
That's the missing piece.  That way you can import your module from the
interpreter, because it's now on the path, but its physical location is
right there where you left it, complete with your VCS metadata and etc.


How do you work on a package that must remain installed and usable the
whole time you're working on it?

IOW, only specific test apps or apps run in a specific directory
should get the "in-progress" foo module when they do an "import foo".



Achievable with a virtualenv, but now the process is even that much more 
complicated.


--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order.  See above to fix.
--
https://mail.python.org/mailman/listinfo/python-list


Re: How to work on a package

2018-02-07 Thread Grant Edwards
On 2018-02-07, Rob Gaddi  wrote:

> When I'm working on a module, the trick is to write a setup.py (using 
> setuptools) from the very get-go.  Before I write a single line of code, 
> I've got a setup.py and the directory framework.
>
> Then you install the package using pip -e (or in practice --user -e). 
> That's the missing piece.  That way you can import your module from the 
> interpreter, because it's now on the path, but its physical location is 
> right there where you left it, complete with your VCS metadata and etc.

How do you work on a package that must remain installed and usable the
whole time you're working on it?

IOW, only specific test apps or apps run in a specific directory
should get the "in-progress" foo module when they do an "import foo".

-- 
Grant Edwards   grant.b.edwardsYow! Am I in GRADUATE
  at   SCHOOL yet?
  gmail.com

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


Re: How to work on a package

2018-02-07 Thread Roel Schroeven

Rob Gaddi schreef op 7/02/2018 22:24:

On 02/07/2018 12:34 PM, Roel Schroeven wrote:

dieter schreef op 7/02/2018 8:21:

Likely, there are many ways to execute tests for your package.
I am using "setuptools" for packaging (an extension
of Python's standard "disutils"). Its "setup.py" supports the "test"
command. This means, properly set up, I can run tests
with "python setup.py test".
That can solve the testing issue, I guess, even though it feels weird to 
me that the most straightforward way doesn't work.


But testing is not the only issue. Often I'd like to start the Python 
interpreter to load one of the modules in the package to try some things 
out, or write a little script to do the same. These things are very 
natural to me when writing Python code, so it seems very strange to me 
that there's no easy way when working on a packages.


Don't other people do that?



The state of Python packaging is... unfortunate. Improving, due to huge 
amounts of work by some very dedicated people, but still unfortunate.


When I'm working on a module, the trick is to write a setup.py (using 
setuptools) from the very get-go.  Before I write a single line of code, 
I've got a setup.py and the directory framework.


Then you install the package using pip -e (or in practice --user -e). 
That's the missing piece.  That way you can import your module from the 
interpreter, because it's now on the path, but its physical location is 
right there where you left it, complete with your VCS metadata and etc.


That seems like a workable solution. I'll try that out.
Thanks!


Best regards,
Roel

--
The saddest aspect of life right now is that science gathers knowledge
faster than society gathers wisdom.
  -- Isaac Asimov

Roel Schroeven

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


[issue32773] distutils should NOT preserve timestamps

2018-02-07 Thread Jay Yin

Change by Jay Yin :


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

___
Python tracker 

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



[issue32706] test_check_hostname() of test_ftplib started to fail randomly

2018-02-07 Thread Barry A. Warsaw

Barry A. Warsaw  added the comment:

Yep, I'm seeing those same failures in our internal build of 3.7.0b1.  I'll 
just disable the tests for now and nosy on this issue.

--
nosy: +barry

___
Python tracker 

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



[issue32773] distutils should NOT preserve timestamps

2018-02-07 Thread Jay Yin

Jay Yin  added the comment:

would it be ok for me to make a patch for this as practice?, I will be making a 
PR though, I will be making the -- option available for backward compatibility.

--

___
Python tracker 

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



[issue32585] Add ttk::spinbox to tkinter.ttk

2018-02-07 Thread Alan Moore

Alan Moore  added the comment:

Thanks, I'm guessing  the update_idletasks() needed to be called after 
changing the value of command, since the button clicks do this as part 
of the method. If that's not right, let me know.

I've added the options to the list and pushed the changes to the PR.

On 02/07/2018 03:21 PM, Serhiy Storchaka wrote:
> Serhiy Storchaka  added the comment:
>
> I have fixed tests on HiDPI displays. Two issues are left:
>
> 1. test_command still fails randomly. Seems adding update_idletasks() 
> invocation fixes this. And calling pack() looks redundant.
>
> 2. Following warnings are emitted:
>
> SpinboxTest.OPTIONS doesn't contain "exportselection"
> SpinboxTest.OPTIONS doesn't contain "font"
> SpinboxTest.OPTIONS doesn't contain "foreground"
>
> Just add these options to the list. Maybe conditionally if they are not 
> supported in 8.5.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue30825] csv.Sniffer does not detect lineterminator

2018-02-07 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

While Sniffer *returns* a dialect with lineterminator = '\r\n', it *uses* '\n' 
for splitting.  This is slightly odd, as it leaves lines terminated by '\r' 
while detecting within-line parameters, but it does not affect such detection.

Are there csv files in the wild that use \r as line terminator.  If so, they 
will not currently get split.

--

___
Python tracker 

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



[issue30825] csv.Sniffer does not detect lineterminator

2018-02-07 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Looking at the code and docstring, lineterminator was intentionally (knowingly) 
not sniffed, making this a feature addition.

--

___
Python tracker 

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



[issue30825] csv.Sniffer does not detect lineterminator

2018-02-07 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

The csv expert listed in https://devguide.python.org/experts/ is marked as 
inactive, and I have never used the module.  So you might need to ask for help 
on core-mentorship list.

The csv doc for Sniffer.sniff says "Analyze the given sample and return a 
Dialect subclass reflecting the parameters found."  It is not clear to me 
whether 'the parameters found' is meant to be all possible parameters or just 
those found.  So, to be conservative, I will initially treat this an a feature 
addition for the the next version, rather than a bug to also be fixed in 
current versions.  It does seem like a reasonable request.

--
nosy: +skip.montanaro, terry.reedy
type: behavior -> enhancement
versions: +Python 3.8 -Python 3.6

___
Python tracker 

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



Re: How to work on a package

2018-02-07 Thread Rob Gaddi

On 02/07/2018 12:34 PM, Roel Schroeven wrote:

dieter schreef op 7/02/2018 8:21:

Likely, there are many ways to execute tests for your package.



I am using "setuptools" for packaging (an extension
of Python's standard "disutils"). Its "setup.py" supports the "test"
command. This means, properly set up, I can run tests
with "python setup.py test".


That can solve the testing issue, I guess, even though it feels weird to 
me that the most straightforward way doesn't work.


But testing is not the only issue. Often I'd like to start the Python 
interpreter to load one of the modules in the package to try some things 
out, or write a little script to do the same. These things are very 
natural to me when writing Python code, so it seems very strange to me 
that there's no easy way when working on a packages.


Don't other people do that?



The state of Python packaging is... unfortunate. Improving, due to huge 
amounts of work by some very dedicated people, but still unfortunate.


When I'm working on a module, the trick is to write a setup.py (using 
setuptools) from the very get-go.  Before I write a single line of code, 
I've got a setup.py and the directory framework.


Then you install the package using pip -e (or in practice --user -e). 
That's the missing piece.  That way you can import your module from the 
interpreter, because it's now on the path, but its physical location is 
right there where you left it, complete with your VCS metadata and etc.


--
Rob Gaddi, Highland Technology -- www.highlandtechnology.com
Email address domain is currently out of order.  See above to fix.
--
https://mail.python.org/mailman/listinfo/python-list


[issue32585] Add ttk::spinbox to tkinter.ttk

2018-02-07 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

I have fixed tests on HiDPI displays. Two issues are left:

1. test_command still fails randomly. Seems adding update_idletasks() 
invocation fixes this. And calling pack() looks redundant.

2. Following warnings are emitted:

SpinboxTest.OPTIONS doesn't contain "exportselection"
SpinboxTest.OPTIONS doesn't contain "font"
SpinboxTest.OPTIONS doesn't contain "foreground"

Just add these options to the list. Maybe conditionally if they are not 
supported in 8.5.

--

___
Python tracker 

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



[issue32585] Add ttk::spinbox to tkinter.ttk

2018-02-07 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

If set DPI to low value, the size of a spinbox widget (winfo_width(), 
winfo_height()) is (185, 20), and the test is passed. If set it to high value, 
the size is (305, 30), and the test is failed.

--

___
Python tracker 

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



Re: How to work on a package

2018-02-07 Thread Roel Schroeven

dieter schreef op 7/02/2018 8:21:

Likely, there are many ways to execute tests for your package.



I am using "setuptools" for packaging (an extension
of Python's standard "disutils"). Its "setup.py" supports the "test"
command. This means, properly set up, I can run tests
with "python setup.py test".


That can solve the testing issue, I guess, even though it feels weird to 
me that the most straightforward way doesn't work.


But testing is not the only issue. Often I'd like to start the Python 
interpreter to load one of the modules in the package to try some things 
out, or write a little script to do the same. These things are very 
natural to me when writing Python code, so it seems very strange to me 
that there's no easy way when working on a packages.


Don't other people do that?

--
The saddest aspect of life right now is that science gathers knowledge
faster than society gathers wisdom.
  -- Isaac Asimov

Roel Schroeven

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


[issue32585] Add ttk::spinbox to tkinter.ttk

2018-02-07 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

This is because of HiDPI display. Mouse events are generated with pixel 
coordinates (x=width - 5, y=5), but these coordinates are out of a button on 
scaled widget.

--

___
Python tracker 

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



[issue31937] Add the term "dunder" to the glossary

2018-02-07 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

David, 

I have no objection to closing this issue and I totally agree with your comment.

--

___
Python tracker 

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



[issue32585] Add ttk::spinbox to tkinter.ttk

2018-02-07 Thread Serhiy Storchaka

Serhiy Storchaka  added the comment:

Tests that are failing on my computer:

==
FAIL: test_command (tkinter.test.test_ttk.test_widgets.SpinboxTest)
--
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/tkinter/test/test_ttk/test_widgets.py", 
line 1145, in test_command
self.assertTrue(success)
AssertionError: [] is not true

==
FAIL: test_format (tkinter.test.test_ttk.test_widgets.SpinboxTest)
--
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/tkinter/test/test_ttk/test_widgets.py", 
line 1199, in test_format
self.assertEqual(len(value), 10)
AssertionError: 1 != 10

==
FAIL: test_increment (tkinter.test.test_ttk.test_widgets.SpinboxTest)
--
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/tkinter/test/test_ttk/test_widgets.py", 
line 1186, in test_increment
self.assertEqual(self.spin.get(), '5')
AssertionError: '1' != '5'
- 1
+ 5


==
FAIL: test_to (tkinter.test.test_ttk.test_widgets.SpinboxTest)
--
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/tkinter/test/test_ttk/test_widgets.py", 
line 1163, in test_to
self.assertEqual(self.spin.get(), '5')
AssertionError: '4' != '5'
- 4
+ 5


==
FAIL: test_values (tkinter.test.test_ttk.test_widgets.SpinboxTest)
--
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/tkinter/test/test_ttk/test_widgets.py", 
line 1248, in test_values
self.assertEqual(self.spin.get(), '1')
AssertionError: 'a' != '1'
- a
+ 1


==
FAIL: test_wrap (tkinter.test.test_ttk.test_widgets.SpinboxTest)
--
Traceback (most recent call last):
  File "/home/serhiy/py/cpython/Lib/tkinter/test/test_ttk/test_widgets.py", 
line 1220, in test_wrap
self.assertEqual(self.spin.get(), '1')
AssertionError: '10' != '1'
- 10
?  -
+ 1


--

This may be a race condition depended on window manager or speed of CPU or GPU.

--

___
Python tracker 

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



Re: Where is _sre.SRE_Match?

2018-02-07 Thread Chris Angelico
On Thu, Feb 8, 2018 at 4:57 AM,   wrote:
> On Wednesday, February 7, 2018 at 5:20:42 PM UTC, Chris Angelico wrote:
>> On Thu, Feb 8, 2018 at 4:15 AM, Peng Yu wrote:
>> > Hi,
>> >
>> > I see _sre.SRE_Match is returned by re.match. But I don't find where
>> > it is defined. Does anybody know how to get its help page within
>> > python command line? Thanks.
>> >
>>  import re
>>  m = re.match('a', 'abc')
>>  print type(m)
>> > 
>>  _sre.SRE_Match
>> > Traceback (most recent call last):
>> >   File "", line 1, in 
>> > NameError: name '_sre' is not defined
>> >
>>
>> You can "import _sre" if you want access to that module, but the
>> leading underscore is a strong indication that this isn't something
>> you should be looking at - it's an implementation detail.
>>
>> Python 3 makes this type public:
>>
>> >>> import re
>> >>> re.match('a', 'abc')
>> 
>> >>> re.Match
>> 
>>
>> So if you truly need to examine this type, I suggest switching to a
>> newer Python.
>>
>> ChrisA
>
> I'm confused:-
>
> Python 3.6.3 (default, Oct  3 2017, 21:45:48)
> [GCC 7.2.0] on linux
> Type "help", "copyright", "credits" or "license" for more information.
 import re
 re.match('a', 'abc')
> <_sre.SRE_Match object; span=(0, 1), match='a'>

>
> Perhaps not, https://bugs.python.org/issue30397 so 3.7 only.
>

Hmm, sorry for the confusion. I thought it landed earlier. (My default
'python3' is 3.7 so I didn't notice on testing.)

Well, as you can see from the tracker issue, the classes were
deliberately exposed in the way that I described. So... it's not just
a matter of getting Python 3, but of getting *the latest* Python, in
which what you request is easier.

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


Re: Where is _sre.SRE_Match?

2018-02-07 Thread breamoreboy
On Wednesday, February 7, 2018 at 5:20:42 PM UTC, Chris Angelico wrote:
> On Thu, Feb 8, 2018 at 4:15 AM, Peng Yu wrote:
> > Hi,
> >
> > I see _sre.SRE_Match is returned by re.match. But I don't find where
> > it is defined. Does anybody know how to get its help page within
> > python command line? Thanks.
> >
>  import re
>  m = re.match('a', 'abc')
>  print type(m)
> > 
>  _sre.SRE_Match
> > Traceback (most recent call last):
> >   File "", line 1, in 
> > NameError: name '_sre' is not defined
> >
> 
> You can "import _sre" if you want access to that module, but the
> leading underscore is a strong indication that this isn't something
> you should be looking at - it's an implementation detail.
> 
> Python 3 makes this type public:
> 
> >>> import re
> >>> re.match('a', 'abc')
> 
> >>> re.Match
> 
> 
> So if you truly need to examine this type, I suggest switching to a
> newer Python.
> 
> ChrisA

I'm confused:-

Python 3.6.3 (default, Oct  3 2017, 21:45:48) 
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import re
>>> re.match('a', 'abc')
<_sre.SRE_Match object; span=(0, 1), match='a'>
>>> 

Perhaps not, https://bugs.python.org/issue30397 so 3.7 only.

--
Kindestregards.

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


Re: Packaging uwsgi flask app for non-programmers?

2018-02-07 Thread Israel Brewster



> On Feb 6, 2018, at 8:24 PM, Dennis Lee Bieber  wrote:
> 
> On Tue, 6 Feb 2018 12:12:26 -0900, Israel Brewster 
> declaimed the following:
> 
>> I have been working on writing an Alexa skill which, as part of it, requires 
>> a local web server on the end users machine - the Alexa skill sends commands 
>> to this server, which runs them on the local machine. I wrote this local 
>> server in Flask, and run it using uwsgi, using a command like: "uwsgi 
>> serverconfig.ini".
>> 
> 
>   
> 
>> Not terribly difficult, but when I think of my target audience (Alexa 
>> users), I could easily see even these steps being "too complicated". I was 
>> looking at pyinstaller to create a simple double-click application, but it 
>> appears that pyinstaller needs a python script as the "base" for the 
>> application, whereas my "base" is uwsgi. Also, I do need to leave a config 
>> file accessible for the end user to be able to edit. Is there a way to use 
>> pyinstaller in this scenario, or perhaps some other option that might work 
>> better to package things up?
> 
>   Not mentioned is getting your end-user to possibly have to open up
> fire-wall rules to allow INBOUND connections (even if, somehow, limited to
> LAN -- don't want to leave a WAN port open).

Not mentioned because it's not needed - I establish a ngrok tunnel to provide 
external https access to the local server. I just include the ngrok binary with 
my package, and run it using subprocess.Popen. Since it doesn't even require 
you to have an account to use it, that bypasses the need to set up 
port-forwards and firewall rules quite nicely. Also solves the problem of 
dynamic IP's without having to burden the end user with dyndns or the like - I 
just "register" the URL you get when connecting. Admittedly though, that was a 
large concern of mine until I was pointed to ngrok as a solution.

Ideally, I'd just access across the local network, Alexa device to local 
machine, but that's not an option - at least, not yet.

> -- 
>   Wulfraed Dennis Lee Bieber AF6VN
>wlfr...@ix.netcom.comHTTP://wlfraed.home.netcom.com/
> 
> -- 
> https://mail.python.org/mailman/listinfo/python-list

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


[issue31937] Add the term "dunder" to the glossary

2018-02-07 Thread R. David Murray

R. David Murray  added the comment:

EAFP and BDFL are not python folk terminology (the former never was, the latter 
may have originated with us but it has widespread use).  They are also 
acronyms.  'dunder' is the phonetic spelling of a way of pronouncing 
punctuation.  Raymond's examples of 'stir' and 'repper' are similar: phonetic 
spellings of ways of pronouncing something that isn't a word.

It seems to me that such phonetic spellings do no belong in the glossary.  The 
counter argument is that unlike the other two 'dunder' does appear 
*occasionally* in text...but the only place it appears in our documentation 
(that I can find via grep) is in the enum docs, and there it should be replaced 
by the correct term "special methods", especially since it there it is spelled 
"__dunder__".

For 'stir' and 'repper' the text spelling is __str__/str and __repr__/repr, for 
'dunder XXX' the correct text spelling is the special method name, and for the 
"dunder method" the correct spelling (and I would argue the correct 
pronunciation :) is "special method".  That is, 'dunder' is mostly used in 
speech, not text.  It is not a "word" in the sense that the rest of the 
glossary entries are.
  
So, I vote with Raymond and others that this term does *not* belong in our 
glossary.

I recommend closing this issue as rejected.

--
nosy: +r.david.murray

___
Python tracker 

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



[issue32775] fnmatch.translate() can produce a pattern which emits a nested set warning

2018-02-07 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


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

___
Python tracker 

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



Re: Where is _sre.SRE_Match?

2018-02-07 Thread Chris Angelico
On Thu, Feb 8, 2018 at 4:15 AM, Peng Yu  wrote:
> Hi,
>
> I see _sre.SRE_Match is returned by re.match. But I don't find where
> it is defined. Does anybody know how to get its help page within
> python command line? Thanks.
>
 import re
 m = re.match('a', 'abc')
 print type(m)
> 
 _sre.SRE_Match
> Traceback (most recent call last):
>   File "", line 1, in 
> NameError: name '_sre' is not defined
>

You can "import _sre" if you want access to that module, but the
leading underscore is a strong indication that this isn't something
you should be looking at - it's an implementation detail.

Python 3 makes this type public:

>>> import re
>>> re.match('a', 'abc')

>>> re.Match


So if you truly need to examine this type, I suggest switching to a
newer Python.

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


Where is _sre.SRE_Match?

2018-02-07 Thread Peng Yu
Hi,

I see _sre.SRE_Match is returned by re.match. But I don't find where
it is defined. Does anybody know how to get its help page within
python command line? Thanks.

>>> import re
>>> m = re.match('a', 'abc')
>>> print type(m)

>>> _sre.SRE_Match
Traceback (most recent call last):
  File "", line 1, in 
NameError: name '_sre' is not defined

-- 
Regards,
Peng
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Packaging uwsgi flask app for non-programmers?

2018-02-07 Thread Israel Brewster
On Feb 6, 2018, at 12:12 PM, Israel Brewster  wrote:
> 
> I have been working on writing an Alexa skill which, as part of it, requires 
> a local web server on the end users machine - the Alexa skill sends commands 
> to this server, which runs them on the local machine. I wrote this local 
> server in Flask, and run it using uwsgi, using a command like: "uwsgi 
> serverconfig.ini".
> 
> The problem is that in order for this to work, the end user must:
> 
> 1) Install python 3.6 (or thereabouts)
> 2) Install a number of python modules, and
> 3) run a command line (from the appropriate directory)
> 
> Not terribly difficult, but when I think of my target audience (Alexa users), 
> I could easily see even these steps being "too complicated". I was looking at 
> pyinstaller to create a simple double-click application, but it appears that 
> pyinstaller needs a python script as the "base" for the application, whereas 
> my "base" is uwsgi. Also, I do need to leave a config file accessible for the 
> end user to be able to edit. Is there a way to use pyinstaller in this 
> scenario, or perhaps some other option that might work better to package 
> things up?

A related question, should a way to create a full package not be available, 
would be Is there a way to do a "local" (as in, in the same directory) install 
of Python3.6, and to do it in such a way as I could script it from the shell 
(or python, whatever)? The idea would then be to basically set up a fully 
self-contained virtualenv on the users machine, such that they just have to run 
a "setup.sh" script or the like.

BTW, this would be on a Mac - my local skill server works using AppleScript, so 
it's not actually portable to other OS's :-P

> 
> ---
> Israel Brewster
> Systems Analyst II
> Ravn Alaska
> 5245 Airport Industrial Rd
> Fairbanks, AK 99709
> (907) 450-7293
> ---
> 
> 
> 
> 
> -- 
> https://mail.python.org/mailman/listinfo/python-list

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


[issue31937] Add the term "dunder" to the glossary

2018-02-07 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

Just added the term in the glossary

If you want to review this PR, thank you

--
nosy: +matrixise

___
Python tracker 

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



[issue31937] Add the term "dunder" to the glossary

2018-02-07 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


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



[issue32769] Add 'annotations' to the glossary

2018-02-07 Thread Stéphane Wirtel

New submission from Stéphane Wirtel :

There is a description of the annotation in the Glossary, but with 'function 
annotation'

maybe we could rename 'function annotation' by 'annotation'

--
nosy: +matrixise

___
Python tracker 

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



[issue32784] Wrong argument name for csv.DictReader in documentation

2018-02-07 Thread Mariatta Wijaya

Mariatta Wijaya  added the comment:

Thanks everyone!

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



[issue32784] Wrong argument name for csv.DictReader in documentation

2018-02-07 Thread Mariatta Wijaya

Mariatta Wijaya  added the comment:


New changeset 672fd7d8162f76aff8423fa5c7bfd2b1e91faf57 by Mariatta (Stéphane 
Wirtel) in branch '2.7':
bpo-32784: Wrong argument name for csv.DictReader in documentation (GH-5575)
https://github.com/python/cpython/commit/672fd7d8162f76aff8423fa5c7bfd2b1e91faf57


--
nosy: +Mariatta

___
Python tracker 

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



[issue32789] Note missing from logging.debug() docs

2018-02-07 Thread Pedro

Pedro  added the comment:

Might be cleaner to just say, "The arguments are interpreted as for 
debug/info/warning/error/critical/exception/log," but with the bookmark URL 
pointing to the Logger methods.

--

___
Python tracker 

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



[issue32789] Note missing from logging.debug() docs

2018-02-07 Thread Pedro

New submission from Pedro :

The docs for Logger.debug() 
(https://docs.python.org/3/library/logging.html#logging.Logger.debug) specify 
that exc_info can take an exception instance as of version 3.5.

However, the docs for logging.debug() 
(https://docs.python.org/3/library/logging.html#logging.debug) do not, even 
though logging.debug() redirects to an instance of Logger and so can take the 
same types of arguments.

--
assignee: docs@python
components: Documentation
messages: 311792
nosy: docs@python, pgacv2
priority: normal
severity: normal
status: open
title: Note missing from logging.debug() docs
type: enhancement
versions: 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



[issue32767] Mutating a list while iterating: clarify the docs

2018-02-07 Thread Stefan Pochmann

Stefan Pochmann  added the comment:

And `bytearray`.

--

___
Python tracker 

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



[issue32783] ln(2) isn't accurate in _math.c in cpython

2018-02-07 Thread Mark Dickinson

Mark Dickinson  added the comment:

Closing. There's no actual bug here.

--
resolution:  -> not a bug
stage: needs patch -> 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



[issue32783] ln(2) isn't accurate in _math.c in cpython

2018-02-07 Thread Mark Dickinson

Mark Dickinson  added the comment:

> I'm inclined to just close this as "not a bug".

Sounds good to me.

The ideal would probably be to use a hex literal here. They're part of C99 (see 
section 6.4.4.2), but last time I checked Visual Studio didn't support them. I 
don't know whether that's changed recently.

--

___
Python tracker 

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



[issue32784] Wrong argument name for csv.DictReader in documentation

2018-02-07 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

Hi David, 

At the final, I didn't propose my PR with the renaming. because PyPy and 
CPython use f as the first parameter of these classes.

If @Serhiy does the review of my PR, we can close this issue.

--

___
Python tracker 

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



Re: Distance between point and a line passing through other two points

2018-02-07 Thread Richard Damon

On 2/7/18 6:06 AM, Dhananjay wrote:

Hello all,

I have 3 points with coordinates (x0,y0,z0), (x1,y1,z1) and (x2,y2,z2).
I also have a line joining points (x1,y1,z1) and (x2,y2,z2).
For example,
p0=[5.0, 5.0, 5.0]
p1=[3.0, 3.0, 3.0]
p2=[4.0, 4.0, 4.0]

a = np.array(p0)
b = np.array(p1)
c = np.array(p2)

I want to write a script that can calculate shortest distance d between
point (x0,y0,z0) and the line((x1,y1,z1), (x2,y2,z2)).
In other words,
d = distance(a, line(b,c))
Since I have information of the coordinates of these points only, I am not
sure how to put it into python script to get distance d.

On searching Internet, some solutions are discussed for 2D coordinates
(i.e. for (x0,y0), (x1,y1) and (x2,y2) ).
However, I need solution for 3D coordinates.

Any direction or suggestion would be great help.
Thanking you in advance,

-- Joshi


This sounds a lot more like a math problem then a python problem (unless 
python has a geometry package to use for this).


The 3D solution is very close to the 2D version, if you draw the angle 
p0 -> p1 -> p2 and take the cross product of the vectors p1-p0 and p2-p1 
the result will be a vector perpendicular to plane defined by p0, p1, p2 
with a magnitude of


|p1-p0| * |p2-p1| * sin(angle between line (p1,p0) and (p2,p1))

The distance you want is |p1-p0| * sin(angle between line (p1,p0) and 
(p2,p1))


With a bit of thought you should be able to get the answer.

--
Richard Damon

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


[issue32788] Better error handling in sqlite3

2018-02-07 Thread Serhiy Storchaka

New submission from Serhiy Storchaka :

The proposed patch makes unexpected errors raised when look up an attribute or 
a key in a dict (like MemoryError, KeyboardInterrupt, etc) be leaked to a user 
instead of be overridden by TypeError or AttributeError.

--
components: Extension Modules
messages: 311786
nosy: ghaering, serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Better error handling in sqlite3
type: enhancement
versions: Python 3.8

___
Python tracker 

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



[issue32784] Wrong argument name for csv.DictReader in documentation

2018-02-07 Thread R. David Murray

R. David Murray  added the comment:

Stéphane: I don't understand your question about changing the name of the 
parameter.  As far as I can see the only thing to do here is backport the doc 
fix to 2.7.

--

___
Python tracker 

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



[issue31572] Avoid suppressing all exceptions in PyObject_HasAttr()

2018-02-07 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
dependencies: +Better error handling in ctypes, Better error handling in sqlite3

___
Python tracker 

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



[issue32788] Better error handling in sqlite3

2018-02-07 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +5398

___
Python tracker 

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



Re: Distance between point and a line passing through other two points

2018-02-07 Thread Antoon Pardon
On 07-02-18 12:06, Dhananjay wrote:
> Hello all,
>
> ...
> I want to write a script that can calculate shortest distance d between
> point (x0,y0,z0) and the line((x1,y1,z1), (x2,y2,z2)).
> In other words,
> d = distance(a, line(b,c))
> Since I have information of the coordinates of these points only, I am not
> sure how to put it into python script to get distance d.
>
> On searching Internet, some solutions are discussed for 2D coordinates
> (i.e. for (x0,y0), (x1,y1) and (x2,y2) ).
> However, I need solution for 3D coordinates.

Look at the vector solutions: 
https://en.wikipedia.org/wiki/Distance_from_a_point_to_a_line#Vector_formulation

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


[issue32787] Better error handling in ctypes

2018-02-07 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
nosy: +amaury.forgeotdarc, belopolsky, meador.inge

___
Python tracker 

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



[issue32787] Better error handling in ctypes

2018-02-07 Thread Serhiy Storchaka

Change by Serhiy Storchaka :


--
keywords: +patch
pull_requests: +5397

___
Python tracker 

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



[issue32787] Better error handling in ctypes

2018-02-07 Thread Serhiy Storchaka

New submission from Serhiy Storchaka :

The proposed patch makes unexpected errors raised when look up an attribute or 
a key in a dict (like MemoryError, KeyboardInterrupt, etc) be leaked to a user 
instead of be overridden by TypeError or AttributeError.

--
components: Extension Modules, ctypes
messages: 311785
nosy: serhiy.storchaka
priority: normal
severity: normal
stage: patch review
status: open
title: Better error handling in ctypes
type: enhancement
versions: Python 3.8

___
Python tracker 

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



Re: Distance between point and a line passing through other two points

2018-02-07 Thread Chris Angelico
On Wed, Feb 7, 2018 at 10:06 PM, Dhananjay  wrote:
> Hello all,
>
> I have 3 points with coordinates (x0,y0,z0), (x1,y1,z1) and (x2,y2,z2).
> I also have a line joining points (x1,y1,z1) and (x2,y2,z2).
> For example,
> p0=[5.0, 5.0, 5.0]
> p1=[3.0, 3.0, 3.0]
> p2=[4.0, 4.0, 4.0]
>
> a = np.array(p0)
> b = np.array(p1)
> c = np.array(p2)
>
> I want to write a script that can calculate shortest distance d between
> point (x0,y0,z0) and the line((x1,y1,z1), (x2,y2,z2)).
> In other words,
> d = distance(a, line(b,c))
> Since I have information of the coordinates of these points only, I am not
> sure how to put it into python script to get distance d.
>
> On searching Internet, some solutions are discussed for 2D coordinates
> (i.e. for (x0,y0), (x1,y1) and (x2,y2) ).
> However, I need solution for 3D coordinates.
>
> Any direction or suggestion would be great help.
> Thanking you in advance,

With a line and a point not on that line, you can find exactly one
plane that contains them all. (If the point is on the line, well, its
distance is zero and nothing else matters. Your example points aren't
particularly interesting, as the line through (3,3,3) and (4,4,4) also
passes through (5,5,5).) So ultimately, this is solved the same way.

Geometrically, you find the distance between a point and a line by
dropping a perpendicular to that line and measuring that distance.
Imagine drawing a triangle between the three points, dropping a perp,
and measuring it off. Or type "distance point to line three
dimensions" into your favourite web search engine and find a formula
that way. Either way, once you have the mathematics settled, it should
be fairly easy to translate that into Python.

Enjoy!

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


Distance between point and a line passing through other two points

2018-02-07 Thread Dhananjay
Hello all,

I have 3 points with coordinates (x0,y0,z0), (x1,y1,z1) and (x2,y2,z2).
I also have a line joining points (x1,y1,z1) and (x2,y2,z2).
For example,
p0=[5.0, 5.0, 5.0]
p1=[3.0, 3.0, 3.0]
p2=[4.0, 4.0, 4.0]

a = np.array(p0)
b = np.array(p1)
c = np.array(p2)

I want to write a script that can calculate shortest distance d between
point (x0,y0,z0) and the line((x1,y1,z1), (x2,y2,z2)).
In other words,
d = distance(a, line(b,c))
Since I have information of the coordinates of these points only, I am not
sure how to put it into python script to get distance d.

On searching Internet, some solutions are discussed for 2D coordinates
(i.e. for (x0,y0), (x1,y1) and (x2,y2) ).
However, I need solution for 3D coordinates.

Any direction or suggestion would be great help.
Thanking you in advance,

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


[issue32786] Didnot work strftime() when hangeul in format sting

2018-02-07 Thread Larry Hastings

Larry Hastings  added the comment:

This is not an Argument Clinic problem.

--
components: +Library (Lib) -Argument Clinic

___
Python tracker 

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



[issue1100942] Add datetime.time.strptime and datetime.date.strptime

2018-02-07 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

I have updated the patch for 3.8, create a PR and fixed the documentation of 
_strptime._strptime, because this function returns a 3-tuple and not a 2-tuple 
as indicated in its comment. 

Thank you

--
versions: +Python 3.8 -Python 3.7

___
Python tracker 

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



[issue16202] sys.path[0] security issues

2018-02-07 Thread Thomas Arendsen Hein

Thomas Arendsen Hein  added the comment:

I just stumbled across this problem when starting "idle3" in a directory 
containing a copy of textwrap.py which was not compatible with python3.

In issue13506 idle3 was changed to behave like the regular python shell, i.e. 
as described here in this issue, and since my ~/.pythonrc.py imports readline, 
I could reproduce this problem by creating a bogus readline.py file and 
starting a python interpreter.

So besides being a security issue when starting python or idle in untrusted 
directories, it may cause technical issues when working in directories 
containing .py files with certain names.

--
nosy: +ThomasAH

___
Python tracker 

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



Re: Benchmarking Django on PyPy with unittest?

2018-02-07 Thread Etienne Robillard
Also, i need to isolate and measure the speed of gevent loop engine 
(gevent.monkey), epoll, and python-specific asyncio coroutines. :-)


Etienne


Le 2018-02-07 à 04:39, Etienne Robillard a écrit :

Hi,

is it possible to benchmark a django application  with unittest module 
in order to compare and measure the speed/latency of the django orm 
with sqlite3 against ZODB databases?
i'm interested in comparing raw sqlite3 performance versus ZODB 
(schevo). i would like to make specific testsuite(s) for benchmarking 
django 1.11.7, django 2.0, pypy, etc.


What do you think?

Etienne



--
Etienne Robillard
tkad...@yandex.com
https://www.isotopesoftware.ca/

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


[issue1100942] Add datetime.time.strptime and datetime.date.strptime

2018-02-07 Thread Stéphane Wirtel

Change by Stéphane Wirtel :


--
pull_requests: +5396

___
Python tracker 

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



[issue29248] os.readlink fails on Windows

2018-02-07 Thread SSE4

SSE4  added the comment:

opened PR https://github.com/python/cpython/pull/5577

--
nosy: +SSE4

___
Python tracker 

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



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

2018-02-07 Thread INADA Naoki

INADA Naoki  added the comment:


New changeset 2942b909d9a428e6683d90b3436cfa4a81bd5d8a by INADA Naoki in branch 
'2.7':
bpo-32616: Disable computed gotos by default for clang < 5 (GH-5574)
https://github.com/python/cpython/commit/2942b909d9a428e6683d90b3436cfa4a81bd5d8a


--

___
Python tracker 

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



[issue29248] os.readlink fails on Windows

2018-02-07 Thread Roundup Robot

Change by Roundup Robot :


--
pull_requests: +5395

___
Python tracker 

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



Benchmarking Django on PyPy with unittest?

2018-02-07 Thread Etienne Robillard

Hi,

is it possible to benchmark a django application  with unittest module 
in order to compare and measure the speed/latency of the django orm with 
sqlite3 against ZODB databases?
i'm interested in comparing raw sqlite3 performance versus ZODB 
(schevo). i would like to make specific testsuite(s) for benchmarking 
django 1.11.7, django 2.0, pypy, etc.


What do you think?

Etienne

--
Etienne Robillard
tkad...@yandex.com
https://www.isotopesoftware.ca/

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


[issue32786] Didnot work strftime() when hangeul in format sting

2018-02-07 Thread Stéphane Wirtel

Stéphane Wirtel  added the comment:

Thank you for your contribution,

Just one question, do you have the same issue with Python 3.6 because
Python 3.4 is a security release, Python 3.6 is a bugfix release.

Thank you,

--
nosy: +matrixise

___
Python tracker 

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



[issue32781] lzh_tw is missing in locale.py

2018-02-07 Thread Po-Hsu Lin

Po-Hsu Lin  added the comment:

Yes I think you are right, 
return None sounds like a good approach to me as we might have zh_TW translated 
but not lzh_TW.

--

___
Python tracker 

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



[issue32751] wait_for(future, ...) should wait for the future (even if a timeout occurs)

2018-02-07 Thread Andrew Svetlov

Andrew Svetlov  added the comment:

Theoretically we can start monitoring cancelled tasks and report about them if 
the task is still not finished, say, in a minute or two.
It is a new feature, sure.

I'm fine with waiting for cancelled task in wait_for().

--

___
Python tracker 

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



[issue32751] wait_for(future, ...) should wait for the future (even if a timeout occurs)

2018-02-07 Thread Nathaniel Smith

Nathaniel Smith  added the comment:

How do you tell the difference between a cancelled task that's about to exit, 
and one that will never exit?

--

___
Python tracker 

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



[issue31961] subprocess._execute_child doesn't accept a single PathLike argument for args

2018-02-07 Thread Eryk Sun

Eryk Sun  added the comment:

If a PathLike args value is supported in Windows, then it must be processed 
through list2cmdline, in case it needs to be quoted. Also, the preferred usage 
is to pass args as a list when shell is false. This common case shouldn't be 
penalized as a TypeError. Also, passing `executable` as PathLike should be 
supported, as is already the case in the POSIX implementation. For example.

_execute_child:

if executable is not None and not isinstance(executable, str):
executable = os.fsdecode(executable)

if not isinstance(args, str):
try:
args = list2cmdline(args)
except TypeError:
if isinstance(args, bytes):
args = os.fsdecode(args)
elif isinstance(args, os.PathLike):
args = list2cmdline([args])
else:
raise

list2cmdline should support PathLike arguments via os.fsdecode. This removes an 
existing inconsistency since the POSIX implementation converts args via 
PyUnicode_FSConverter in Modules/_posixsubprocess.c. For example:

list2cmdline:

for arg in seq:
if not isinstance(arg, str):
arg = os.fsdecode(arg)

Finally, passing args as a string when shell is false can never be deprecated 
on Windows. list2cmdline works in most cases, but Windows CreateProcess takes a 
command line, and applications are free to parse the command line however they 
want. IMHO, the case that should be deprecated is passing args as a 
list/sequence when shell is true.

--
nosy: +eryksun

___
Python tracker 

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



[issue32394] socket lib beahavior change in 3.6.4

2018-02-07 Thread Andrew Svetlov

Andrew Svetlov  added the comment:

Ok

--

___
Python tracker 

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



[issue32751] wait_for(future, ...) should wait for the future (even if a timeout occurs)

2018-02-07 Thread Andrew Svetlov

Andrew Svetlov  added the comment:

Agree.
Should we report about cancelled but still executing tasks?
It would be a nice feature.
I'm talking not about `wait_for` only but task cancellation in general.

--

___
Python tracker 

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