[issue31030] sys.executable can be not normalized

2017-07-28 Thread Eryk Sun

Eryk Sun added the comment:

Terry, the Windows implementation calls GetModuleFileNameW to get the 
executable's fully-qualified path from the loader. However, depending on how 
Python is started, this could be a \\?\ path, which leads to a bug in the 
startup code that determines the prefix path based on the landmark "lib\os.py". 
Probably the easiest solution would be to normalize the executable path to 
remove the \\?\ or \\.\ prefix. This prefix isn't useful here anyway since 
Windows doesn't properly support running programs from long paths, not even in 
Windows 10. I'll open a new issue for this.

--
nosy: +eryksun

___
Python tracker 

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



[issue30781] IDLE: configdialog -- switch to ttk widgets.

2017-07-28 Thread Terry J. Reedy

Terry J. Reedy added the comment:


New changeset 8364feff6730f54063116b607605167d9027ce85 by Terry Jan Reedy in 
branch '3.6':
[3.6] bpo-30781: IDLE - Use ttk Notebook in ConfigDialog (GH-2938) (#2944)
https://github.com/python/cpython/commit/8364feff6730f54063116b607605167d9027ce85


--

___
Python tracker 

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



[issue30781] IDLE: configdialog -- switch to ttk widgets.

2017-07-28 Thread Terry J. Reedy

Terry J. Reedy added the comment:

The 'this' in 'this is a usability bug' refers to the fact that up and down 
move the blue selection highlight but not the selection, so that delete does 
not necessarily delete what appears to be selected.

--

___
Python tracker 

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



[issue30781] IDLE: configdialog -- switch to ttk widgets.

2017-07-28 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
pull_requests: +2993

___
Python tracker 

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



[issue30781] IDLE: configdialog -- switch to ttk widgets.

2017-07-28 Thread Terry J. Reedy

Terry J. Reedy added the comment:


New changeset b331f80b4765c3201674a7ca8b35c9d4a65efe79 by Terry Jan Reedy in 
branch 'master':
bpo-30781: IDLE - Use ttk Notebook in ConfigDialog (#2938)
https://github.com/python/cpython/commit/b331f80b4765c3201674a7ca8b35c9d4a65efe79


--

___
Python tracker 

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



[issue30302] Improve .__repr__ implementation for datetime.timedelta

2017-07-28 Thread Roundup Robot

Changes by Roundup Robot :


--
pull_requests: +2992

___
Python tracker 

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



[issue31004] IDLE, configdialog: Factor out FontTab class from ConfigDialog

2017-07-28 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I will push Notebook when CI passes.  We can then do Step 2 for class 
FontPage(Frame).  Consider the font code frozen for now.  Pass 'note', not the 
dialog, as the parent.  This makes tab switching work better.

Create the highlight frame first and pass it as a second argument to FontPage.  
Adding set_samples to load_font_config should solve the initial font problem.

--

___
Python tracker 

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



[issue30781] IDLE: configdialog -- switch to ttk widgets.

2017-07-28 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I did not try to match the height in that commit.  I wanted to see what would 
happen if we enlarge the dialog to accommodate more widgets.  It is now about 
10% larger.  The highlight sample looks better with a bit more room.  The font 
sample works better in that the box does not expand until it has to.  The total 
size does not change.

Focus traversal has been neglected on C.D., which is a bit of a bug.  On the 
original, the focus disappears and comes back.  On the notebook it visibly 
cycles around one tab, including the tab.  I changed takefocus to True for 
fontlist and helplist.

When focus is on a tab, Left and Right change tabs.  With the enable call, 
Cntl_Tab and Cntl-Shift-Tab always work to change tabs.

I decided to push this in spite of the test problem.  It is easy to check that 
helplist clicking work on htest.  Maybe fixing up and down on helplist, as done 
with fontlist, will somehow help.  This is a usability bug, not a test bug. I 
should make the boxes identical before giving up.

--

___
Python tracker 

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



[issue31056] Import Module Not Working According To Documentation Python 3.6.2

2017-07-28 Thread Steve Dower

Steve Dower added the comment:

The embeddable ZIP is not an "install" - it's a tool for including in your own 
application.

Run the actual installer and try again, or use the package on nuget.org if you 
need to achieve zero system impact (which it sounds like you don't if you're 
modifying PATH).

--

___
Python tracker 

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



[issue31054] Python 2.7.8 Release does not update the system Path variable

2017-07-28 Thread Steve Dower

Steve Dower added the comment:

Correct. This is already in newer installers.

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



[issue31054] Python 2.7.8 Release does not update the system Path variable

2017-07-28 Thread Terry J. Reedy

Terry J. Reedy added the comment:

We are guessing that you are using Windows.  The 2.7.8 installer is years old 
and will not be changed.  The same is true for any released installer.

I believe that the 2.7 installers already give one the *option* to change the 
path.  If so, this issue should be closed.  Please try out the 2.7.13 installer.

Changing the path should not be done automatically.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue31045] Add a language switch to the Python documentation

2017-07-28 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I left out 2.7 because I don't know if the 2.7 docs have been or will be 
included.  

I am looking forward to this because I know someone who programs in Python and 
is also looking to learn 'professional' Japanese, including CS.  I myself might 
try the Spanish translations, if there are any.

--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python, terry.reedy
stage:  -> patch review
type:  -> enhancement
versions: +Python 3.6, Python 3.7

___
Python tracker 

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



[issue30802] datetime.datetime.strptime('200722', '%Y%U')

2017-07-28 Thread Matheus Vieira Portela

Matheus Vieira Portela added the comment:

Agreed that we should attain to ISO 8601, as it solves two questions that 
occurred in this thread:

- According to the specification, it is clear that a week must start on Monday 
and end on Sunday. Hence datetime.strptime('201726', '%Y%U') could be safely 
assigned to 2017/06/26 without ambiguity

- It also makes clear on what to do when a week overlaps two years.

IMHO there is no reason to not implement this feature and remove the 
requirement of using %U with the year and day of the week.

--

___
Python tracker 

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



[issue31042] Inconsistency in documentation of operator.index

2017-07-28 Thread Terry J. Reedy

Terry J. Reedy added the comment:

To me, 'roughly' is wrong.  Either the equivalence is exact, or it is 
completely absent .  There is no 'nearly' or 'roughly' about this situation.

This is difference from  iterator_class_x(args) being mathematically equivalent 
to generator_function_y(args) in the sense of yielding *exactly* the same 
sequence of objects, but being different in the Python sense that 
type(iterator_class_x) != type(generator_function_y).  

Note: even in this case, I was once in favor of changing 'equivalent' to 
'roughly equivalent' in the itertools doc.  I now regret that because 'roughly' 
could be misunderstood.  I think that 'mathematically equivalent' or 
'equivalent when iterated' or 'equivalent*' would be better, with an 
explanatory note at the top.

As for this issue, __index__ is a reserved name.  
https://docs.python.org/3/reference/lexical_analysis.html#reserved-classes-of-identifiers

a.__index__ =  is an unauthorized use of a *reserved* word and the 
effect of such usage is not and need not be documented.  

The entry for __*__ does include "*Any* use of __*__ names, in any context, 
that does not follow explicitly documented use, is subject to breakage without 
warning."  To me, that says that the effect of the reserved-word assignment is 
undefined.  It could be made to raise an exception.

To be even clearer, I believe we should explicitly state what I consider 
implicit: something like "Any such use breaks these manuals, in the sense that 
it may make statements herein untrue.  These manuals assume that reserved names 
are used as specified."

--
nosy: +terry.reedy
stage:  -> needs patch
type:  -> enhancement
versions:  -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



[issue31027] test_listcomps fails when run directly

2017-07-28 Thread Zackery Spytz

Changes by Zackery Spytz :


--
pull_requests: +2991

___
Python tracker 

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



[issue31030] sys.executable can be not normalized

2017-07-28 Thread Terry J. Reedy

Terry J. Reedy added the comment:

On Windows, sys.executable is normalized before or during startup. 
C:\Programs\Python36>Lib\..\python -m test test_sys prints
 test_executable (__main__.SysModuleTest) ... ok

C:\Programs\Python36>Lib\..\python -c "import sys; print(sys.executable)"
C:\Programs\Python36\python.exe

--
nosy: +terry.reedy

___
Python tracker 

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



[issue31027] test_listcomps fails when run directly

2017-07-28 Thread Terry J. Reedy

Terry J. Reedy added the comment:

On Windows, fresh 3.7, python -m test.test_listcomps fails same way.
python -m test test_listcomps is okay.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue31026] test_dbm fails when run directly

2017-07-28 Thread Terry J. Reedy

Terry J. Reedy added the comment:

OK on Windows, skipping test_whichdb_ndbm (neither _dbm nor _gdbm are present.)

--
nosy: +terry.reedy

___
Python tracker 

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



[issue30781] IDLE: configdialog -- switch to ttk widgets.

2017-07-28 Thread Cheryl Sabella

Cheryl Sabella added the comment:

Looks good under Ubuntu.  The height of the window is longer, so everything is 
a bit stretched out.  That helps on the Keys tab, but not so much on Highlights 
or Extensions.  It's not awful, but there's unneeded (for now?) empty space.

One thing that's different is that there is an initial focus selected on each 
tab when switching tabs, but then focus is lost when moving back to another 
tab.  

Example: When the config dialog is opened, focus is on the fonts, like it was 
after Louie's change.  However, when I first click 'Keys', there is a box 
around 'Use a Built-in Key Set', even if it isn't selected. So, that's new 
(there was no focus before).  When I then click back to 'Fonts', the fontlist 
doesn't have focus anymore.  Before this change, fontlist still had focus after 
switching to another tab and then going back to fonts.  Might be why the test 
isn't working.

All the tests pass, but I get the error if I uncomment the helplist tests:
==
FAIL: test_source_selected (idlelib.idle_test.test_configdialog.GeneralTest)
--
Traceback (most recent call last):
  File "/home/cheryl/cpython/Lib/idlelib/idle_test/test_configdialog.py", line 
315, in test_source_selected
self.assertEqual(helplist.get('anchor'), 'source')
AssertionError: '' != 'source'
+ source

--

--
nosy: +csabella

___
Python tracker 

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



[issue28734] argparse: successive parsing wipes out nargs=? values

2017-07-28 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
nosy: +bethard

___
Python tracker 

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



[issue30781] IDLE: configdialog -- switch to ttk widgets.

2017-07-28 Thread Terry J. Reedy

Terry J. Reedy added the comment:

New PR replaces the custom TabbedPageSet with ttk.Notebook.  On Windows, with 
default settings, the look is nearly identical, but the selected tab is more 
obvious.  A method call (note.enable_traversal) will enable navigation between 
tabs with cntl-tab and cntl-shift-tab.  This will work a bit better with 
extracted page classes.

On the otherhand, attaching the frame to a notebook instead of the one disables 
one of the simulated mouse clicks.  I added the remaining part of 
tkinter.test.support.simulate_click(sp??) to no avail (not surprising since 
designed for Xwindows.  I also moved the location of the simulated click.  
Using ttk.Frame requires the padx, pady to padding change in PR2654.

Please test on linuxes (and mac if possible).  Does the tabset look at least as 
good?  Does the test run if the #s are removed?

--

___
Python tracker 

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



[issue30781] IDLE: configdialog -- switch to ttk widgets.

2017-07-28 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
pull_requests: +2990

___
Python tracker 

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



Re: Getting a dictionnary from a module's variables

2017-07-28 Thread Gregory Ewing

ast wrote:

dir(config) provides a list, some processing is needed to
remove some __identifiers__ and get a dict

Is there a simple way to do that, without processing ?


Here's an alternative that leverages the import machinery.

d = {}
exec("from config import *", d)
del d['__builtins__']

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


[issue30853] IDLE: configdialog -- factor out VarTrace class

2017-07-28 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
title: IDLE: configdialog -- factor out Tracer subclass -> IDLE: configdialog 
-- factor out VarTrace class

___
Python tracker 

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



[issue30853] IDLE: configdialog -- factor out Tracer subclass

2017-07-28 Thread Terry J. Reedy

Changes by Terry J. Reedy :


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



[issue30853] IDLE: configdialog -- factor out Tracer subclass

2017-07-28 Thread Terry J. Reedy

Terry J. Reedy added the comment:


New changeset ecc80b3f1b56f1e4df9e592f8527e622a6b45e01 by Terry Jan Reedy in 
branch '3.6':
[3.6] bpo-30853: IDLE - touch-up configdialog.VarTrace and tests. (GH-2936) 
(#2937)
https://github.com/python/cpython/commit/ecc80b3f1b56f1e4df9e592f8527e622a6b45e01


--

___
Python tracker 

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



[issue30853] IDLE: configdialog -- factor out Tracer subclass

2017-07-28 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
pull_requests: +2989

___
Python tracker 

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



[issue30853] IDLE: configdialog -- factor out Tracer subclass

2017-07-28 Thread Terry J. Reedy

Terry J. Reedy added the comment:


New changeset 5d0f30aae5fccc99690923fc5c7cb58de8ad7eec by Terry Jan Reedy in 
branch 'master':
bpo-30853: IDLE - touch-up configdialog.VarTrace and tests. (#2936)
https://github.com/python/cpython/commit/5d0f30aae5fccc99690923fc5c7cb58de8ad7eec


--

___
Python tracker 

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



[issue30788] email.policy.SMTP.fold() issue for long filenames with spaces

2017-07-28 Thread Joel Hillacre

Joel Hillacre added the comment:

Just wanted to ping this and see if there was someone available to review my PR 
associated with this issue.

--

___
Python tracker 

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



[issue31073] Change metadata handling in check command

2017-07-28 Thread Andrew Pinkham

New submission from Andrew Pinkham:

The new warehouse uses the author_email field to create a mailto link. Donald 
Stufft recommended leaving out the author_email field while still specifying 
the author field should a maintainer wish to have their name associated without 
their email.

Conversation with Donald:
https://github.com/pypa/warehouse/issues/2155

Unfortunately, specifying author but not author_email causes the `setup.py 
check` command to throw an error. "check: missing meta-data: if 'author' 
supplied, 'author_email' must be supplied too"

I would like to remove that check from being performed given the recommended 
fix for warehouse. The logic that performs this check is currently in the 
distutils check command.

https://github.com/python/cpython/blob/master/Lib/distutils/command/check.py

Additionally, AFAICT, it is impossible to disable the metadata check in 
distutils. I would also like to add a negative option to allow the metadata 
check to be skipped.

--
components: Distutils
messages: 299436
nosy: dstufft, jambonrose, merwok
priority: normal
severity: normal
status: open
title: Change metadata handling in check command
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



[issue31056] Import Module Not Working According To Documentation Python 3.6.2

2017-07-28 Thread Joey DiGiorgio

Joey DiGiorgio added the comment:

I understand your comments. I will be at computer that has not ever had Python 
installed in about an hour and will try it there to see if I can produce an 
example showing the issue. I just found it weird that Python 3.5.2 worked just 
fine in the same environment using exactly the same steps with only the system 
path environment variable changed. That is why I filed this issue.

I will report back.

--

___
Python tracker 

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



[issue28053] parameterize what serialization is used in multiprocessing

2017-07-28 Thread Will S

Will S added the comment:

Just to follow up in case anyone comes across my last message later:

I just had to change the last line from

multiprocessing.reducer = pickle2reducer.Pickle2Reducer()

to

multiprocessing.context._default_context.reducer = 
pickle2reducer.Pickle2Reducer()

--

___
Python tracker 

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



[issue31006] typing.NamedTuple should add annotations to its constructor (__new__) parameters.

2017-07-28 Thread Antony Lee

Antony Lee added the comment:

I'll just repost the issue there for now 
(https://github.com/python/typing/issues/454).  May work on a patch at some 
point (looks relatively simple) but no guarantees, so if someone else wants to 
take over feel free to do so.

--

___
Python tracker 

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



[issue30992] Invalid PGP Key Prevents Archive Validation

2017-07-28 Thread Ned Deily

Ned Deily added the comment:

P.S., the pubkeys.txt file on python.org and the "OpenPGP Public Keys" section 
of https://www.python.org/downloads/ have now been updated.

--

___
Python tracker 

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



[issue30853] IDLE: configdialog -- factor out Tracer subclass

2017-07-28 Thread Terry J. Reedy

Terry J. Reedy added the comment:

IDLE *will* fail if idleConf.SetOption is called with a wrong config-type 
(KeyError) or the wrong number of other arguments (TypeError).  I did not add 
the check because it does not cover the non-default callbacks (the majority), 
let alone all the other idleConf calls.  The important thing is to make sure 
that every callback gets called in a test (and indeed, eventually, that every 
line is executed).  Enhancing the doc string should be enough.

--

___
Python tracker 

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



[issue31004] IDLE, configdialog: Factor out FontTab class from ConfigDialog

2017-07-28 Thread Terry J. Reedy

Terry J. Reedy added the comment:

When replying by email, snip the quote.

--

___
Python tracker 

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



[issue31056] Import Module Not Working According To Documentation Python 3.6.2

2017-07-28 Thread Paul Moore

Paul Moore added the comment:

OK, so the problem is that no-one here (or as far as I can see on the SO 
discussion, either) can reproduce your issue. So we have to assume that it's 
something wrong with your environment, and not a Python issue.

If you can produce an example that allows us to reproduce the issue, then we'll 
be able to comment further, but as things stand there's no evidence that it's a 
Python problem.

--

___
Python tracker 

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



[issue30853] IDLE: configdialog -- factor out Tracer subclass

2017-07-28 Thread Terry J. Reedy

Terry J. Reedy added the comment:


New changeset 02f88d2a411a6a789b33be281adfc3570c49efd5 by Terry Jan Reedy in 
branch '3.6':
[3.6] bpo-30853: IDLE: Convert font and general vars to use VarTrace (GH-2914) 
(#2935)
https://github.com/python/cpython/commit/02f88d2a411a6a789b33be281adfc3570c49efd5


--

___
Python tracker 

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



[issue30853] IDLE: configdialog -- factor out Tracer subclass

2017-07-28 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
pull_requests: +2988

___
Python tracker 

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



[issue31061] asyncio segfault when using threadpool and "_asyncio" native module

2017-07-28 Thread Yury Selivanov

Yury Selivanov added the comment:

Thank you for trying to get to the bottom of this!

--

___
Python tracker 

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



[issue31061] asyncio segfault when using threadpool and "_asyncio" native module

2017-07-28 Thread Alexander Mohr

Alexander Mohr added the comment:

the problem with this crash is that it only happens periodically in our prod 
environment :( If I try running the exact same docker container with the same 
inputs locally it doesn't reproduce, so frustrating.  I've created a whole 
workflow now for deploying with a debug python to get a core file with symbols. 
 Hopefully have some more info w/in a day.  Thanks for the tips!

--

___
Python tracker 

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



[issue31056] Import Module Not Working According To Documentation Python 3.6.2

2017-07-28 Thread Joey DiGiorgio

Joey DiGiorgio added the comment:

I will mark the question appropriately as python3. I don't fully understand 
your comment about venv. If you mean virtual environment or something, that is 
not the case.

I am running an a standard Windows 7 install with Python3 as the only Python 
install on my path (I used the embedded zip package).

I did print sys.path and got the value of "WorkingDir" which is what I 
expected. I am running Python 3 from within "WorkingDir" and only trying to 
import a module that is within "WorkingDir".

--

___
Python tracker 

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



[issue26732] multiprocessing sentinel resource leak

2017-07-28 Thread Steve Holden

Steve Holden added the comment:

IIRC sockets can be marked as inheritable or not. It seems to me it would be a 
useful enhancement to allow the same determination for the pipes.

--
nosy: +holdenweb

___
Python tracker 

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



[issue31072] add filter to zipapp

2017-07-28 Thread Paul Moore

Paul Moore added the comment:

Yes, they can be.

--

___
Python tracker 

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



[issue31061] asyncio segfault when using threadpool and "_asyncio" native module

2017-07-28 Thread Yury Selivanov

Yury Selivanov added the comment:

> so looks like disabling the _asyncio module just caused the crash to happen 
> less often, closing and will continue investigating after a get a core file

Interesting. So it crashes even with pure Python Future/Task implementations?

Another idea to debug this is to try to see what happens when you run your code 
with CFuture and PyTask, and with PyFuture/CTask.

--

___
Python tracker 

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



[issue31061] asyncio segfault when using threadpool and "_asyncio" native module

2017-07-28 Thread Alexander Mohr

Alexander Mohr added the comment:

so looks like disabling the _asyncio module just caused the crash to happen 
less often, closing and will continue investigating after a get a core file

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



[issue30853] IDLE: configdialog -- factor out Tracer subclass

2017-07-28 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
pull_requests: +2987

___
Python tracker 

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



[issue30853] IDLE: configdialog -- factor out Tracer subclass

2017-07-28 Thread Terry J. Reedy

Terry J. Reedy added the comment:


New changeset 5b59154c0d3d91c0766b9177f6b737b1abcbf3f6 by Terry Jan Reedy 
(csabella) in branch 'master':
bpo-30853: IDLE: Convert font and general vars to use VarTrace (#2914)
https://github.com/python/cpython/commit/5b59154c0d3d91c0766b9177f6b737b1abcbf3f6


--

___
Python tracker 

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



[issue26732] multiprocessing sentinel resource leak

2017-07-28 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Kevin:

> Regarding your comment regarding the behavior being expected with the "fork" 
> method, I would suggest a documentation modification in the description of 
> the fork method to add something to the effect of "All resources of the 
> parent are inherited by the child process; this includes the ability of later 
> children to act as the parent of earlier children via the various functions 
> in this package."

I would rather keep the latter part ("the ability of later children to act as 
the parent of earlier children via the various functions in this package") an 
implementation detail rather than a documented feature.  Who knows, perhaps 
some day we'll change the implementation so that those are not inherited 
anymore.

--

___
Python tracker 

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



[issue26732] multiprocessing sentinel resource leak

2017-07-28 Thread Antoine Pitrou

Antoine Pitrou added the comment:

Victor, you can try to backport the fix, it should be interesting, though I 
suspect you will run into conflicts :-)

--

___
Python tracker 

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



[issue31072] add filter to zipapp

2017-07-28 Thread Irmen de Jong

Irmen de Jong added the comment:

That sounds fine to me. I guess the paths passed to the function should be 
relative to the root folder being zipped?

--

___
Python tracker 

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



[issue1222585] C++ compilation support for distutils

2017-07-28 Thread Dirkjan Ochtman

Changes by Dirkjan Ochtman :


--
nosy:  -djc

___
Python tracker 

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



[issue31056] Import Module Not Working According To Documentation Python 3.6.2

2017-07-28 Thread Brett Cannon

Brett Cannon added the comment:

I also can't reproduce on Python 3.6 on Windows 10, so I'm closing this.

Looking at your SO question I noticed you didn't specify `python3` but `python` 
which suggests a venv, so I'm wondering if that's mucking with things? You also 
don't need to add __init__.py as long as you're executing within the directory 
(which it seems you are based on how you explained things). Basically you 
should be able to print out sys.path and see if the directory containing your 
code is listed there. If it isn't then something wonky is going on with your 
environment.

But if you are executing the code from outside the directory then do realize 
that Python 3 no longer supports implicit relative imports so module_a won't be 
picked up in a package context (that would require `from . import module_a`).

--
nosy: +brett.cannon
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



[issue30992] Invalid PGP Key Prevents Archive Validation

2017-07-28 Thread Ned Deily

Ned Deily added the comment:

Thanks for the report.  I have opened 
https://github.com/python/pythondotorg/pull/1109 to remove the obsolete MD5 key 
from the pubkeys file.  Until the updated file is deployed and the website page 
updated, another workaround may be to use the --allow-weak-digest-algos option 
of gpg:

gpg --import --allow-weak-digest-algos pubkeys.txt

In general, problems with the python.org website should be reported on its 
issue tracker:

https://www.python.org/about/help/
https://github.com/python/pythondotorg/issues

--
nosy: +ned.deily
resolution:  -> third party
stage:  -> resolved
status: open -> closed
type: security -> 

___
Python tracker 

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



[issue31004] IDLE, configdialog: Factor out FontTab class from ConfigDialog

2017-07-28 Thread Cheryl Sabella

Cheryl Sabella added the comment:

OK, once 30853 is merged, I'll recopy the font code into the class.

On Fri, Jul 28, 2017 at 2:06 AM, Terry J. Reedy 
wrote:

>
> Terry J. Reedy added the comment:
>
> For steps 2 and 3, setUpClass will have to create or retrieve a reverence
> to the page class instance.  For page functions, 'dialog' will have to be
> changed to 'self.page'.  For hightlight and key pages, I will write the
> tests using 'self.page', which would start as  a synonym for 'dialog' (set
> in setUpClass).  I might convert GeneralTest before you copy it.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

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



[issue31006] typing.NamedTuple should add annotations to its constructor (__new__) parameters.

2017-07-28 Thread Ivan Levkivskyi

Ivan Levkivskyi added the comment:

This looks like a reasonable idea, if it is possible to implement this without 
complications. Would you like to submit a PR at 
https://github.com/python/typing ?

(We have a separate upstream repo for typing while it is provisional.)

--
nosy: +levkivskyi
stage:  -> needs patch
type:  -> enhancement

___
Python tracker 

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



[issue31024] typing.Tuple is class but is defined as data inside https://docs.python.org/3.6/objects.inv

2017-07-28 Thread Ivan Levkivskyi

Ivan Levkivskyi added the comment:

The fact that it is a class is an implementation detail and may change before 
Python 3.7 beta (situation is the same for Callable). Guido explicitly doesn't 
like to "advertise" it as a class yet. Unless he changed his mind, I would 
propose to close the issue, and instead consider treating this special case in 
Sphinx.

--
nosy: +gvanrossum, levkivskyi

___
Python tracker 

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



[issue31071] *args unpacking can mask TypeErrors

2017-07-28 Thread R. David Murray

R. David Murray added the comment:

Thanks for the report.  Retitling because this has nothing to do with map:

>>> def foo(*args):
... raise TypeError('fake')
... yield 1
... 
>>> foo(1, *foo())
Traceback (most recent call last):
  File "", line 1, in 
TypeError: foo() argument after * must be an iterable, not generator
>>> foo(*foo())
Traceback (most recent call last):
  File "", line 1, in 
  File "", line 2, in foo
TypeError: fake

--
nosy: +r.david.murray
stage:  -> needs patch
title: Bad error message about maps not iterable -> *args unpacking can mask 
TypeErrors
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



[issue31072] add filter to zipapp

2017-07-28 Thread Paul Moore

Paul Moore added the comment:

I'd propose an extra argument to zipapp.create_archive, include_file=None (feel 
free to bikeshed on the name). If the argument is not None, then it should be a 
callable which will be called with a pathlib.Path object for each file that's 
selected for inclusion in the archive. The function should return a boolean - 
False means don't include this file.

Because the create_archive function only gets a list of files internally (it 
uses Path.rglob()), the callable won't get passed directories, only the actual 
files (but it can of course check the full path to see what directory the file 
is in).

The include_file argument is ignored when copying anything other than a 
filesystem directory (i.e., when the source argument is a filename or an open 
file object).

--

___
Python tracker 

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



Re: zipapp should not include temporary files?

2017-07-28 Thread Irmen de Jong
On 28/07/2017 18:36, Irmen de Jong wrote:
> On 27/07/2017 00:03, Paul Moore wrote:
>> If you want to create a feature request for a filter function on 
>> bugs.python.org and assign it to me, I'll take a look at it. \
> 
> 
> I will do this, thanks in advance.

Should have included a link perhaps. Here it is: 
http://bugs.python.org/issue31072

Irmen

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


[issue31072] add filter to zipapp

2017-07-28 Thread Irmen de Jong

New submission from Irmen de Jong:

As briefly discussed on comp.lang.python, I propose to add an optional filter 
callback function to zipapp.create_archive.


The function could perhaps work like the os.walk generator or maybe just lets 
you to return a simple boolean for every folder/file that it wants to include 
in the zip.

My use case is that I sometimes don't want to include every file in the root 
folder into the zip file (I want to be able to skip temporary or irrelevant 
folders such as .git/.svn, .tox, .tmp and sometimes want to avoid including 
*.pyc/*.pyo files).  Right now, I first have to manually clean up the folder 
before I can use zipapp.create_archive.


(Instead of providing a filter callback fuction, another approach may be to 
provide your own dir/file generator instead, that fully replaces the internal 
file listing logic of zipapp.create_archive?)

--
assignee: paul.moore
components: Library (Lib)
keywords: easy
messages: 299409
nosy: irmen, paul.moore
priority: normal
severity: normal
status: open
title: add filter to zipapp
type: enhancement

___
Python tracker 

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



[issue31065] Documentation for Popen.poll is unclear

2017-07-28 Thread R. David Murray

R. David Murray added the comment:

Agreed.  Explicit is good.

--

___
Python tracker 

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



[issue30581] os.cpu_count() returns wrong number of processors on system with > 64 logical processors

2017-07-28 Thread Roundup Robot

Changes by Roundup Robot :


--
pull_requests: +2986

___
Python tracker 

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



Re: Installation Python 3.6.x on Windows using command line installer (without GUI)

2017-07-28 Thread Irmen de Jong
On 27/07/2017 20:55, Andreas Jung wrote:
> 
> I need to installed Python 3.6.x on Windows as part of an automated process 
> without user-interaction. Recently Python releases provided MSI files for 
> installation using the "msiexec" utility however there are no more MSI 
> release files available for Python 3.6.X. Are there any alternatives?
> 
> -aj
> 

https://docs.python.org/3/using/windows.html#installing-without-ui

Irmen

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


Re: zipapp should not include temporary files?

2017-07-28 Thread Irmen de Jong
On 27/07/2017 00:03, Paul Moore wrote:
> On Wednesday, 26 July 2017 18:37:15 UTC+1, Irmen de Jong  wrote:

>> What do you think? Should the zipapp module perhaps be improved to 
>> automatically skip
>> obvious temporary files or perhaps allow to provide a filter function?

> If you want to create a feature request for a filter function on 
> bugs.python.org and assign it to me, I'll take a look at it. \


I will do this, thanks in advance.

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


[issue31058] FileFinder fails to find modules for import if modules are created at runtime and don't result in a directory mtime update

2017-07-28 Thread Paul Goins

Paul Goins added the comment:

Ack; missed that.  Thanks, and sorry for the noise.

--

___
Python tracker 

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



[issue31022] ERROR: testRegularFile (test.test_socket.SendfileUsingSendTest) random failure on AppVeyor

2017-07-28 Thread STINNER Victor

STINNER Victor added the comment:

I tried to reproduce the bug on my Windows 8.1 VM. I ran the test more than 
1,000 times. In parallel, I ran "python -m test -j0 -rW" to increase the system 
load, but it wasn't enough to reproduce the bug.

--

___
Python tracker 

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



[issue29654] SimpleHTTPRequestHandler should support browser cache

2017-07-28 Thread STINNER Victor

STINNER Victor added the comment:

FYI there was a race condition, impacting Windows. I just fixed it: bpo-31066, 
commit 28ce07ae9e34c70eea6b52515c7e1cefd41e.

--
nosy: +haypo

___
Python tracker 

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



[issue31066] FAIL: test_last_modified (test.test_httpservers.SimpleHTTPServerTestCase), on AMD64 Windows8.1 Non-Debug 3.x

2017-07-28 Thread STINNER Victor

Changes by STINNER Victor :


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



[issue31066] FAIL: test_last_modified (test.test_httpservers.SimpleHTTPServerTestCase), on AMD64 Windows8.1 Non-Debug 3.x

2017-07-28 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 28ce07ae9e34c70eea6b52515c7e1cefd41e by Victor Stinner in 
branch 'master':
bpo-31066: Fix test_httpservers.test_last_modified() (#2933)
https://github.com/python/cpython/commit/28ce07ae9e34c70eea6b52515c7e1cefd41e


--

___
Python tracker 

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



[issue31071] Bad error message about maps not iterable

2017-07-28 Thread Stefan Pochmann

New submission from Stefan Pochmann:

Python 3.6 makes it sound like maps aren't iterable:

>>> map(str, *map(int, [[]]))
Traceback (most recent call last):
  File "", line 1, in 
map(str, *map(int, [[]]))
TypeError: type object argument after * must be an iterable, not map

More, including a likely explanation, in my question and its answer here:
https://stackoverflow.com/q/45363330/1672429

Apparently the TypeError from int([]) gets mistaken for a TypeError indicating 
non-iterability of the map object.

--
messages: 299402
nosy: Stefan Pochmann
priority: normal
severity: normal
status: open
title: Bad error message about maps not iterable
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



[issue1222585] C++ compilation support for distutils

2017-07-28 Thread Josef Kemetmüller

Josef Kemetmüller added the comment:

python-3.4-distutils-C++.patch with Erik Hvatum's suggestions applied.

--
Added file: http://bugs.python.org/file47046/python-3.x-distutils-C++.patch

___
Python tracker 

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



[issue31067] test_subprocess.test_leak_fast_process_del_killed() fails randomly on AMD64 FreeBSD 10.x Shared 3.6

2017-07-28 Thread STINNER Victor

STINNER Victor added the comment:


New changeset cc42c121eb5346f673247f95dac575aadb77d66c by Victor Stinner in 
branch 'master':
bpo-31067: test_subprocess calls reap_children() (#2931)
https://github.com/python/cpython/commit/cc42c121eb5346f673247f95dac575aadb77d66c


--

___
Python tracker 

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



[issue31066] FAIL: test_last_modified (test.test_httpservers.SimpleHTTPServerTestCase), on AMD64 Windows8.1 Non-Debug 3.x

2017-07-28 Thread STINNER Victor

STINNER Victor added the comment:

I can reproduce the failure if I insert time.sleep(1) after os.fstat().

Attached PR should fix the race condition.

--

___
Python tracker 

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



[issue31066] FAIL: test_last_modified (test.test_httpservers.SimpleHTTPServerTestCase), on AMD64 Windows8.1 Non-Debug 3.x

2017-07-28 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +2985

___
Python tracker 

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



[issue31041] test_handle_called_with_mp_queue() of test_logging: threading_cleanup() failed to cleanup, on AMD64 FreeBSD 10.x Shared 3.x

2017-07-28 Thread STINNER Victor

STINNER Victor added the comment:

I ran "./python -m test -v test_logging --fail-env-changed -F" in 3 terminals 
on the FreeBSD 10 buildbot, and I failed to reproduce the bug. I ran my test 
for 5 minutes.

Maybe threading_cleanup() should call support.gc_collect().

--

___
Python tracker 

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



[issue29070] Integration tests for pty.spawn on Linux and all other platforms

2017-07-28 Thread Roundup Robot

Changes by Roundup Robot :


--
pull_requests: +2983

___
Python tracker 

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



[issue26228] pty.spawn hangs on FreeBSD 9.3, 10.x

2017-07-28 Thread Roundup Robot

Changes by Roundup Robot :


--
pull_requests: +2984

___
Python tracker 

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



[issue31065] Documentation for Popen.poll is unclear

2017-07-28 Thread Mark Dickinson

Mark Dickinson added the comment:

> I don't there's

I don't *think* there's ...

Stupid fingers.

--

___
Python tracker 

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



[issue31065] Documentation for Popen.poll is unclear

2017-07-28 Thread Mark Dickinson

Mark Dickinson added the comment:

Right, after following the source, I realise that `poll` is indeed returning 
`self.returncode` in all cases, and if the process hasn't terminated yet then 
`self.returncode` is still at its initial value of `None`.

I can think of other ways that the result could potentially be indicated, 
though: when I poll, I'm asking whether the child process is still running or 
not, so a boolean result wouldn't be unreasonable. Or perhaps an exception 
(like doing `get(block=False)` on a queue does). I don't there's a good reason 
not to be explicit here.

--

___
Python tracker 

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



[issue1222585] C++ compilation support for distutils

2017-07-28 Thread Josef Kemetmüller

Josef Kemetmüller added the comment:

python-3.4-distutils-C++.patch with changes of Erik Hvatum applied.

--
nosy: +Josef Kemetmüller
Added file: http://bugs.python.org/file47045/python-3.x-distutils-C++.patch

___
Python tracker 

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



[issue5288] tzinfo objects with sub-minute offsets are not supported (e.g. UTC+05:53:28)

2017-07-28 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

> My concern is that it makes timestamp parsing more complex

To the contrary.  The timezone field can now be parsed the same way as the time 
field plus the sign.

--

___
Python tracker 

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



[issue5288] tzinfo objects with sub-minute offsets are not supported (e.g. UTC+05:53:28)

2017-07-28 Thread STINNER Victor

STINNER Victor added the comment:

> I did add a few lines of code to support subsecond formatting, but at some 
> point we should be able to unify timedelta and timezone formatting.

My concern is that it makes timestamp parsing more complex because we would 
have to handle the theorical case of timezone with microsecond precision.

--

___
Python tracker 

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



Re: how to group by function if one of the group has relationship with another one in the group?

2017-07-28 Thread Ho Yeung Lee
actually i used in this application
if same color is neighbor like connected then group them

i use for segmentation of words in screen capture

https://stackoverflow.com/questions/45294829/how-to-group-by-function-if-any-one-of-the-group-members-has-neighbor-relationsh

i asked here too, but i do not know how to use partial and do not know what 
center is.


On Tuesday, July 25, 2017 at 5:00:25 PM UTC+8, Peter Otten wrote:
> Ho Yeung Lee wrote:
> 
> > from itertools import groupby
> > 
> > testing1 = [(1,1),(2,3),(2,4),(3,5),(3,6),(4,6)]
> > def isneighborlocation(lo1, lo2):
> > if abs(lo1[0] - lo2[0]) == 1  or lo1[1] == lo2[1]:
> > return 1
> > elif abs(lo1[1] - lo2[1]) == 1  or lo1[0] == lo2[0]:
> > return 1
> > else:
> > return 0
> > 
> > groupda = groupby(testing1, isneighborlocation)
> > for key, group1 in groupda:
> > print key
> > for thing in group1:
> > print thing
> > 
> > expect output 3 group
> > group1 [(1,1)]
> > group2 [(2,3),(2,4]
> > group3 [(3,5),(3,6),(4,6)]
> 
> groupby() calculates the key value from the current item only, so there's no 
> "natural" way to apply it to your problem.
> 
> Possible workarounds are to feed it pairs of neighbouring items (think 
> zip()) or a stateful key function. Below is an example of the latter:
> 
> $ cat sequential_group_class.py
> from itertools import groupby
> 
> missing = object()
> 
> class PairKey:
> def __init__(self, continued):
> self.prev = missing
> self.continued = continued
> self.key = False
> 
> def __call__(self, item):
> if self.prev is not missing and not self.continued(self.prev, item):
> self.key = not self.key
> self.prev = item
> return self.key
> 
> def isneighborlocation(lo1, lo2):
> x1, y1 = lo1
> x2, y2 = lo2
> dx = x1 - x2
> dy = y1 - y2
> return dx*dx + dy*dy <= 1
> 
> items = [(1,1),(2,3),(2,4),(3,5),(3,6),(4,6)]
> 
> for key, group in groupby(items, key=PairKey(isneighborlocation)):
> print key, list(group)
> 
> $ python sequential_group_class.py 
> False [(1, 1)]
> True [(2, 3), (2, 4)]
> False [(3, 5), (3, 6), (4, 6)]

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


Re: how to group by function if one of the group has relationship with another one in the group?

2017-07-28 Thread Ho Yeung Lee
actually i used in this application
if same color is neighbor like connected then group them

i use for segmentation of words in screen capture

https://stackoverflow.com/questions/45294829/how-to-group-by-function-if-any-one-of-the-group-members-has-neighbor-relationsh

i asked here too, but i do not know how to use partial and do not know what 
center is.



On Wednesday, July 26, 2017 at 2:06:08 PM UTC+8, ast wrote:
> "Ho Yeung Lee"  a écrit dans le message de 
> news:ef0bd11a-bf55-42a2-b016-d93f3b831...@googlegroups.com...
> > from itertools import groupby
> >
> > testing1 = [(1,1),(2,3),(2,4),(3,5),(3,6),(4,6)]
> > def isneighborlocation(lo1, lo2):
> >if abs(lo1[0] - lo2[0]) == 1  or lo1[1] == lo2[1]:
> >return 1
> >elif abs(lo1[1] - lo2[1]) == 1  or lo1[0] == lo2[0]:
> >return 1
> >else:
> >return 0
> >
> > groupda = groupby(testing1, isneighborlocation)
> > for key, group1 in groupda:
> >print key
> >for thing in group1:
> >print thing
> >
> > expect output 3 group
> > group1 [(1,1)]
> > group2 [(2,3),(2,4]
> > group3 [(3,5),(3,6),(4,6)]
> 
> Its not clear to me how you build the groups
> 
> Why (1,1) is not in group2 since (1,1) is
> a neighbor to both (2,3) and (2,4) ?

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


[issue31070] test_threaded_import: KeyError ignored in _get_module_lock..cb on AMD64 Windows8.1 Refleaks 3.x

2017-07-28 Thread STINNER Victor

New submission from STINNER Victor:

See bpo-bpo-30891 and bpo-30876 for recent changes in importlib.

http://buildbot.python.org/all/builders/AMD64%20Windows8.1%20Refleaks%203.x/builds/57/steps/test/logs/stdio

1:33:30 [312/406/2] test_threaded_import passed (30 sec) -- running: 
test_decimal (826 sec), test_set (84 sec), test_mmap (1151 sec)
beginning 6 repetitions
123456
...Exception ignored in: .cb at 
0x00813CA18EB8>
Traceback (most recent call last):
  File "", line 176, in cb
KeyError: ('random',)
...

--
components: Tests
messages: 299393
nosy: haypo, serhiy.storchaka
priority: normal
severity: normal
status: open
title: test_threaded_import: KeyError ignored in _get_module_lock..cb 
on AMD64 Windows8.1 Refleaks 3.x
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



[issue31069] test_multiprocessing_spawn leaked a process on AMD64 Windows8.1 Refleaks 3.x

2017-07-28 Thread STINNER Victor

New submission from STINNER Victor:

It's just a warning, but later I would like to make a buildbot fail on such 
warnings, so I would like to first fix all these warnings.

http://buildbot.python.org/all/builders/AMD64%20Windows8.1%20Refleaks%203.x/builds/59/steps/test/logs/stdio

0:46:17 [119/406] test_multiprocessing_spawn passed (2667 sec) -- running: 
test_asyncio (290 sec), test_userstring (54 sec), test_regrtest (471 sec)
beginning 6 repetitions
123456
...Warning -- Dangling processes: {}
...

--
components: Tests
messages: 299392
nosy: haypo
priority: normal
severity: normal
status: open
title: test_multiprocessing_spawn leaked a process on AMD64 Windows8.1 Refleaks 
3.x
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



[issue31068] test_ttk_guionly hangs on AMD64 Windows8.1 Refleaks 2.7

2017-07-28 Thread STINNER Victor

New submission from STINNER Victor:

Builds:

* 52: build interrupted after 132 hours
* 53: test_ttk_guionly passed
* 54: test_ttk_guionly passed
* 55: build interrupted after 14 hours

Example:

http://buildbot.python.org/all/builders/AMD64%20Windows8.1%20Refleaks%202.7/builds/52/steps/test/logs/stdio

...
running: test_ttk_guionly (472605 sec)
running: test_ttk_guionly (472635 sec)
running: test_ttk_g
command interrupted, attempting to kill
program finished with exit code 1
elapsedTime=475847.19

--
components: Tests, Tkinter
messages: 299391
nosy: haypo
priority: normal
severity: normal
status: open
title: test_ttk_guionly hangs on AMD64 Windows8.1 Refleaks 2.7
versions: Python 2.7

___
Python tracker 

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



[issue31067] test_subprocess.test_leak_fast_process_del_killed() fails randomly on AMD64 FreeBSD 10.x Shared 3.6

2017-07-28 Thread STINNER Victor

Changes by STINNER Victor :


--
pull_requests: +2982

___
Python tracker 

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



[issue31067] test_subprocess.test_leak_fast_process_del_killed() fails randomly on AMD64 FreeBSD 10.x Shared 3.6

2017-07-28 Thread STINNER Victor

New submission from STINNER Victor:

http://buildbot.python.org/all/builders/AMD64%20FreeBSD%2010.x%20Shared%203.6/builds/355/steps/test/logs/stdio

==
FAIL: test_leak_fast_process_del_killed 
(test.test_subprocess.POSIXProcessTestCase)
--
Traceback (most recent call last):
  File 
"/usr/home/buildbot/python/3.6.koobs-freebsd10/build/Lib/test/test_subprocess.py",
 line 2434, in test_leak_fast_process_del_killed
self.assertRaises(OSError, os.waitpid, pid, 0)
AssertionError: OSError not raised by waitpid

--
components: Tests
messages: 299390
nosy: haypo
priority: normal
severity: normal
status: open
title: test_subprocess.test_leak_fast_process_del_killed() fails randomly on 
AMD64 FreeBSD 10.x Shared 3.6
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



[issue5288] tzinfo objects with sub-minute offsets are not supported (e.g. UTC+05:53:28)

2017-07-28 Thread Alexander Belopolsky

Alexander Belopolsky added the comment:

Victor,

Tim called for removal of all restrictions on the offsets.  See msg248468.  I 
left the range restriction intact because we have some algorithms that rely on 
that, but in general I agree with Tim.  There is nothing to be gained from 
restricting the offsets.  It is just some extra code to enforce gratuitous 
limitations.

Note that Olson's database limits its precision to seconds for historical 
reasons.  The mean solar time offsets that they record are known to subsecond 
precision.

I did add a few lines of code to support subsecond formatting, but at some 
point we should be able to unify timedelta and timezone formatting.

--

___
Python tracker 

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



Re: Falsey Enums

2017-07-28 Thread Ethan Furman

On 07/28/2017 01:13 AM, Ben Finney wrote:

Ethan Furman writes:



class X(Enum):
 Falsey = 0
 Truthy = 1
 Fakey = 2
 def __bool__(self):
 return bool(self.value)


I am surprised this is not already the behaviour of an Enum class,
without overriding the ‘__bool__’ method.

What would be a good reason not to have this behaviour by default for
‘Enum.__bool__’? (i.e. if this were reported as a bug on the ‘enum.Enum’
implementation, what would be good reasons not to fix it?)


It matches the docs. ;)

  
https://docs.python.org/3/library/enum.html#boolean-value-of-enum-classes-and-members

  Enum members that are mixed with non-Enum types (such as int, str, etc.)
  are evaluated according to the mixed-in type’s rules; otherwise, all
  members evaluate as True. To make your own Enum’s boolean evaluation
  depend on the member’s value add the following to your class:

  Enum classes always evaluate as True.

The rationale is in PEP 435, in the functional API section.

  The reason for defaulting to 1 as the starting number and not 0 is that 0 is 
False
  in a boolean sense, but enum members all evaluate to True .


Which still begs the question of:  why?  According to memory, and as Rustom guessed, an Enum member is a thing, and all 
things in Python default to being True.  If `bool(thing) == False` is a desirable characteristic then extra steps must 
be taken.  Either:


- subclass a type that already has that characteristic, such as int or float, or
- add your own __bool__ method (__nonzero__ in Python 2)

Looked at another way:  The value attribute is just that -- an attribute.  Depending on the use-case that attribute can 
be irrelevant (which is why we have auto(), etc.), so by default Enum does not use the .value attribute in figuring out 
if a member is something vs nothing (or truthy vs falsey).


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


[issue30853] IDLE: configdialog -- factor out Tracer subclass

2017-07-28 Thread Cheryl Sabella

Cheryl Sabella added the comment:

"Either *add* or *make_callback* could check len = 3 and callback[0] in 
idleConf.config_types, with a test added."

I didn't add this because I wasn't sure what you wanted to happen if it wasn't 
right.  I suspect it should fail gracefully (not break IDLE), but in what way?

--

___
Python tracker 

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



[issue31065] Documentation for Popen.poll is unclear

2017-07-28 Thread R. David Murray

R. David Murray added the comment:

Yes we can add "otherwise return None".  However it is pretty clear as is, 
since "poll" implies an immediate return, and if there's no return code to 
return, the logical value in Python to get back is None :)

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



[issue31057] pydoc for tempfile.TemporaryDirectory should say it returns the name

2017-07-28 Thread R. David Murray

R. David Murray added the comment:

Boy, I wasn't thinking very clearly when I wrote that.

As pointed out on the PR, tempfile.TemporaryDirectory of course returns a 
TemporaryDirectory object.  That's in the nature of Python.  I was reading so 
poorly that I didn't even notice it was the docstring you were modifying :(

The main docs phrase this more clearly, especially the sentence that says the 
name can be retrieved from the name property (and I see I was wrong, it does 
use 'name', not 'path').  We don't want to copy all of the text from there, but 
it could be used as a model to improve the phrasing.

--

___
Python tracker 

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



Re: Recent Spam problem

2017-07-28 Thread Skip Montanaro
Yes, it's more "leaky," though that's not quite the term I'd use. Instead,
I'd say there are fewer checks. On the mailing list side of things, you
have all the Postfix bells and whistles, which stop a ton of crap, much of
it before the message is officially entered into the mail.python.org
system. Behind that is a SpamBayes instance to pick up any loose ends.

The Usenet gateway feeds into the system behind everything except the
SpamBayes instance. It gets only sporadic attention from me. If I'm not
paying attention, stuff which starts to "leak" through doesn't get trained
as spam so it can help minimize the chances that later versions of the same
crap get through.

One thing which never got produced was an easy way for a list moderator to
say, "Hey, this got through and it's spam." Sorting through "unsure"
messages and retraining automatically using some Mailman/SpamBayes conduit
would be a nice addition to the overall system. If you wanted to write
software, that's where I'd focus my efforts.

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


Re: Getting a dictionnary from a module's variables

2017-07-28 Thread ast


"ast"  a écrit dans le message de 
news:597b31fb$0$4823$426a3...@news.free.fr...

I answer to myself

import config
dico = {k:v for k, v in vars(conf).items() if not (k.startswith('__') or 
k.endswith('__'))}

that's not so difficult 


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


[issue31066] FAIL: test_last_modified (test.test_httpservers.SimpleHTTPServerTestCase), on AMD64 Windows8.1 Non-Debug 3.x

2017-07-28 Thread STINNER Victor

New submission from STINNER Victor:

http://buildbot.python.org/all/builders/AMD64%20Windows8.1%20Non-Debug%203.x/builds/985/steps/test/logs/stdio

==
FAIL: test_last_modified (test.test_httpservers.SimpleHTTPServerTestCase)
Checks that the datetime returned in Last-Modified response header
--
Traceback (most recent call last):
  File 
"D:\buildarea\3.x.ware-win81-release\build\lib\test\test_httpservers.py", line 
512, in test_last_modified
self.assertEqual(last_modif_header, self.last_modif_header)
AssertionError: 'Fri, 28 Jul 2017 01:20:09 GMT' != 'Fri, 28 Jul 2017 01:20:06 
GMT'
- Fri, 28 Jul 2017 01:20:09 GMT
? ^
+ Fri, 28 Jul 2017 01:20:06 GMT
? ^

--
components: Tests
messages: 299385
nosy: haypo
priority: normal
severity: normal
status: open
title: FAIL: test_last_modified 
(test.test_httpservers.SimpleHTTPServerTestCase), on AMD64 Windows8.1 Non-Debug 
3.x
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



Getting a dictionnary from a module's variables

2017-07-28 Thread ast

Hello

I have a file conf.py which only contains some
variables definition like that:

a = 7
b = 9
c = 3

In my main program I would like to get a dictionnary
dico = {'a' :7,'b':9, 'c':3}

I tried:

import conf

dico = vars(conf)
but there is among a huge amount of stuff to remove

dir(config) provides a list, some processing is needed to
remove some __identifiers__ and get a dict

Is there a simple way to do that, without processing ?



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


[issue30302] Improve .__repr__ implementation for datetime.timedelta

2017-07-28 Thread STINNER Victor

STINNER Victor added the comment:


New changeset 8e45318b0d8df9340ac41b1d0447ffc83c7f5102 by Victor Stinner 
(Utkarsh Upadhyay) in branch 'master':
bpo-30302: Update WhatsNew and documentation. (#2929)
https://github.com/python/cpython/commit/8e45318b0d8df9340ac41b1d0447ffc83c7f5102


--

___
Python tracker 

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



  1   2   >