[issue30449] Improve __slots__ datamodel documentation

2017-05-25 Thread Raymond Hettinger

Raymond Hettinger added the comment:


New changeset 2b44e302ec3079363c4d5c875677945953705c58 by Raymond Hettinger 
(Aaron Hall, MBA) in branch 'master':
bpo-30449 Terse slots (#1819)
https://github.com/python/cpython/commit/2b44e302ec3079363c4d5c875677945953705c58


--

___
Python tracker 

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



Re: Top Python Interview Questions

2017-05-25 Thread Terry Reedy

On 5/26/2017 1:03 AM, Aarusha wrote:

PYTHON INTERVIEW QUESTIONS

Mindmajix has compiled Python Interview questions which would benefit the 
learners to attend the Python interviews.

Q. How is Python executed?


It depends on the implementation (interpreter or compiler).


Python files are compiled to bytecode.


CPython compiles to cpython bytecode.
Jython compiles to Java.
Iron Python compiles to C#.
Cython and others compiles to C (or C++) which is compiled to machine code.
PyPy compiles to ?? or via JIT to machine code.
Multiple implementations compile to Javascript.


 which is then executed by the host.

Alternate Answer:
Type python .pv at the command line.


.py


Q. What is the difference between .py and .pyc files?

.py files are Python source files. .pyc files are the compiled bvtecode files 
that is generated by the Python compiler

Q. How do you invoke the Python interpreter for interactive use?

python or pythonx.y where x.y are the version of the Python interpreter desired.


Only if OS uses pythonx.y.  On Windows, "py -x.y"


Checkout more here! https://mindmajix.com/python-interview-questions


Q. How are Phon [???] blocks defined?

Q. What is the Pthon interpreter prompt?

Site needs proofreading.

--
Terry Jan Reedy

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


Re: Scala considering significant indentation like Python

2017-05-25 Thread Rustom Mody
On Wednesday, May 24, 2017 at 8:01:53 PM UTC+5:30, Rustom Mody wrote:
> On Wednesday, May 24, 2017 at 2:14:15 AM UTC+5:30, Ben Finney wrote:
> > Grant Edwards grant.b.edwards writes:
> > 
> > > On 2017-05-23, Michael Torrie  wrote:
> > > > Sometimes things get longer than a page (like a class definition).
> > >
> > > A nice folding mode works nicely for that sort of thing. I normally
> > > use emacs, but it doesn't seem to have a folding mode built-in, and
> > > the add-on one's I've tried didn't seem to work in a very useful way.
> > 
> > The ‘set-selective-display’ command will collapse the current buffer's
> > text to lines indented to the specified number of columns; the same
> > command with no argument will expand the buffer to normal again. The
> > command is bound to ‘C-x $’ in default Emacs.
> 
> I would have thought hideshow minor mode is what is desired??
> 
> M-x (info "(emacs)Hideshow")
> 
> Which however happens to have rather ridiculous keybindings
> If you like org-mode style TAB and Shift-TAB here's a hack  — barely tried 
> out!!
> 
> --
> ;; Add to your init
> ;; To get Tab and Shift-Tab to behave as in org-mode
> 
> (defvar rusi/hs-hide nil "Current state of hideshow for toggling all.")
> ;;;###autoload
> (defun rusi/hs-toggle-all () "Toggle hideshow all."
>   (interactive)
>   (setq rusi/hs-hide (not rusi/hs-hide))
>   (if rusi/hs-hide
>   (hs-hide-all)
> (hs-show-all)))
> 
> (add-hook 'hs-minor-mode-hook
> (lambda ()
>   (define-key hs-minor-mode-map (kbd "") 'rusi/hs-toggle-all)
>   (define-key hs-minor-mode-map (kbd "") 'hs-toggle-hiding)))
> 
> (add-hook 'python-mode-hook 'hs-minor-mode)
> (add-hook 'c-mode-hook  'hs-minor-mode)
> (add-hook 'emacs-lisp-mode-hook 'hs-minor-mode)
> ;; etc
> 
> --

There also this which seems to be more polished than my 4-line hack
https://github.com/shanecelis/hideshow-org

[All of which Grant Edwards probably wont see because this is posted from 
google groups]
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue17942] IDLE Debugger: Improve GUI

2017-05-25 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
assignee:  -> terry.reedy
stage: needs patch -> patch review
versions: +Python 3.6, Python 3.7 -Python 2.7, Python 3.4, Python 3.5

___
Python tracker 

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



[issue30310] tkFont.py assumes that all font families are encoded as ascii in Python 2.7

2017-05-25 Thread Serhiy Storchaka

Changes by Serhiy Storchaka :


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

___
Python tracker 

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



[issue30310] tkFont.py assumes that all font families are encoded as ascii in Python 2.7

2017-05-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:


New changeset 96f502059717a692ca3abd968b26c5ea2918ad3a by Serhiy Storchaka in 
branch '2.7':
[2.7] bpo-30310: tkFont now supports unicode options (e.g. font family). (#1567)
https://github.com/python/cpython/commit/96f502059717a692ca3abd968b26c5ea2918ad3a


--

___
Python tracker 

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



Top Python Interview Questions

2017-05-25 Thread Aarusha
PYTHON INTERVIEW QUESTIONS

Mindmajix has compiled Python Interview questions which would benefit the 
learners to attend the Python interviews.

Q. How is Python executed?

Python files are compiled to bytecode. which is then executed by the host.
Alternate Answer:
Type python .pv at the command line.

Q. What is the difference between .py and .pyc files?

.py files are Python source files. .pyc files are the compiled bvtecode files 
that is generated by the Python compiler

Q. How do you invoke the Python interpreter for interactive use?

python or pythonx.y where x.y are the version of the Python interpreter desired.

Checkout more here! https://mindmajix.com/python-interview-questions
-- 
https://mail.python.org/mailman/listinfo/python-list


ANNOUNCE: Mailman 3.1.0 final!

2017-05-25 Thread Barry Warsaw
Hello Mailpeople!

On behalf of the entire team and all our wonderful contributors, I'm happy to
announce the release of GNU Mailman 3.1 final.  My deep thanks go to all the
Mailman project sprinters at Pycon 2017 for getting us over the line!

Two years after the original release of Mailman 3.0, this version contains a
huge number of improvements across the entire stack.  Many bugs have been
fixed and new features added in the Core, Postorius (web u/i), and HyperKitty
(archiver).  Upgrading from Mailman 2.1 should be better too.  We are seeing
more production sites adopt Mailman 3, and we've been getting great feedback
as these have rolled out.

Important: mailman-bundler, our previous recommended way of deploying Mailman
3, has been deprecated.  Abhilash Raj is putting the finishing touches on
Docker images to deploy everything, and he'll have a further announcement in a
week or two.

Feedback is welcome:
https://github.com/maxking/docker-mailman

What is GNU Mailman?

GNU Mailman is free software for managing electronic mail discussion and
e-newsletter lists.  Mailman is integrated with the web, making it easy for
users to manage their accounts and for list owners to administer their lists.
Mailman supports built-in archiving, automatic bounce processing, content
filtering, digest delivery, and more.  Mailman 3 is released under the terms
of the GNU General Public License, version 3.

The best places to start for all things related to this release:

http://docs.mailman3.org/
http://www.list.org/
https://gitlab.com/mailman

(Note: due to timezone skew, some of the tarballs may not be available on PyPI
until tomorrow.)

Happy Mailman Day,
-Your friendly neighborhood cabal

An overview of what's new in Mailman 3.1


Feature parity with Mailman 2.1
---
* You should be able to do just about everything that you could do in Mailman
  2.1 *except* for topics and sibling/umbrella lists.

Core

* Added support for Python 3.5 and 3.6
* MySQL is now an officially supported database
* Many improvements with importing Mailman 2.1 lists
* DMARC mitigations have been added, based on, but different than the same
  feature in Mailman 2.1
* The REST API requires HTTP/1.1
* A new REST API version (3.1) has been added which changes how UUIDs are
  interpreted, fixing the problem for some JavaScript libraries
* Many new REST resources and methods have been added
* Individual mailing lists can augment the system's header matching rules
* `mailman create` now creates missing domains by default
* `mailman digests` now has `--verbose` and `--dry-run` options
* `mailman shell` now supports readline history
* `mailman members` can filter members based on their subscription roles
* A new template system has been added for all messages originating from
  inside Mailman.
* The Message-ID-Hash header replaces X-Message-ID-Hash
* New placeholders have been added for headers and footers
* Unsubscriptions can now be confirmed and/or moderated

Postorius/HyperKitty

* General U/I and U/X improvements
* Many more features from the Core's have been plumbed through
* We've adopted Django social auth logins and dropped Persona (since it's no
  longer supported upstream).  You can now log in via Facebook, Google,
  GitHub, and GitLab.

Backward incompatibilities
--
* Core/REST: Held message resources now have an `original_subject` key that is
  not RFC 2047 decoded.  `subject` is now RFC 2047 decoded.
* Core/REST: If you've run pre-release versions from git head, and stored
  welcome and goodbye templates via REST, the template key names have changed
  backward incompatibility.


pgpP2nQuprfjQ.pgp
Description: OpenPGP digital signature
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

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


cx_Oracle 6.0b2

2017-05-25 Thread Anthony Tuininga
What is cx_Oracle?

cx_Oracle is a Python extension module that enables access to Oracle
Database for Python 2.x and 3.x and conforms to the Python database API 2.0
specifications with a number of enhancements.


Where do I get it?
https://oracle.github.io/python-cx_Oracle

The easiest method to install cx_Oracle 6.0b1 is via pip as in

python -m pip install cx_Oracle --upgrade --pre

Note that the --pre option is required since this is a prerelease.


What's new?

This release focused on correcting issues discovered over the past month
and polishing items in preparation for a production release. The full
release notes can be read here:

http://cx-oracle.readthedocs.io/en/latest/releasenotes.html#version-6-0-beta-2-may-2017

Please provide any feedback via GitHub issues (https://github.com/oracle/
python-cx_Oracle/issues).
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

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


[issue30463] Add __slots__ to ABC convenience class

2017-05-25 Thread Aaron Hall

Changes by Aaron Hall :


--
pull_requests: +1908

___
Python tracker 

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



[issue14111] IDLE Debugger should handle interrupts

2017-05-25 Thread Louie Lu

Louie Lu added the comment:

The patch is upload to PR 1821, if Roger get a GitHub account and linked to 
b.p.o, we can rebase the first commit and change the author in commit message 
to Roger's account information.

--

___
Python tracker 

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



[issue14111] IDLE Debugger should handle interrupts

2017-05-25 Thread Louie Lu

Changes by Louie Lu :


--
pull_requests: +1907

___
Python tracker 

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



Re: Nested Loop Triangle

2017-05-25 Thread Jason Friedman
>
> I need the triangle to be in reverse. The assignment requires a nested
> loop to generate a triangle with the user input of how many lines.
>
> Currently, I get answers such as: (A)
> 
> OOO
> OO
> O
>
> When I actually need it to be like this: (B)
> 
>   OOO
>OO
> O
>

Try the rjust string method.

Python 3.6.1 (default, Apr  8 2017, 09:56:20)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> print("O".rjust(1))
O
>>> print("O".rjust(2))
 O
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to install Python package from source on Windows

2017-05-25 Thread Michael Torrie
On 05/25/2017 07:58 PM, Chris Angelico wrote:
> On Fri, May 26, 2017 at 11:28 AM, Deborah Swanson
>  wrote:
>> Since none of you have XP SP2 with Anaconda3 Python 3.4.3, to either
>> confirm or deny my results, and I no longer have the message with the
>> traceback showing what happened, nothing anybody says at this point
>> matters wrt to what happens in XP SP2.
> 
> Sure, we don't ACTUALLY have an SP2 system to test. But would you
> believe me if I said "Python 3.4.3 will ask you to have a webcam
> connected to the computer"? If I absolutely insist that on MY system
> Python keeps asking for a webcam, without ever showing the actual
> message or saying what I'm doing that triggers it? Think about how
> your messages look to us.

In fairness, she did post tracebacks that clearly show pip version 7 is
trying to build the module from source, but fails because the compiler
isn't present. Now she erred in saying that Python is attempting to
install Visual Studio.  There's nothing in any of the tracebacks that
shows Python trying to download and install a multi-GB compiler suite.

Unless she's willing to install the stock python 3.4 from python.org,
there's very little we can do to help with what's clearly an Anaconda
packaging issue.

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


Re: How to install Python package from source on Windows

2017-05-25 Thread MRAB

On 2017-05-26 02:59, Michael Torrie wrote:

On 05/25/2017 04:37 PM, Deborah Swanson wrote:

Here's a question: does Anaconda have a special build of Python, or is



it a standard Python bundled with extra stuff?


I'm not sure, and it's an excellent question. Anaconda stopped
installing Python on XP at 3.4.3.  python.org doesn't install 3.5 on XP,
but I don't know which build was the last one that would. 


Anaconda and python.org do have completely separate and different build
processes, but I suspect the incompatibility for XP SP2 in both has to
do with failed attempts to install Visual Studio 2015. I've seen it too
many times not to be fairly sure of that. XP SP3 evidently does work, if
Michael Torrie had no problem. 


I suspect python.org Python 3.4 will work fine on XP2 without VS.
Anaconda must be doing thingd differently.

FTR, Windows XP SP3 was released in 2008 and Python 3.4 was released in 
2014.


Yes, I think it's well worth trying the standard Python 3.4 from python.org.
--
https://mail.python.org/mailman/listinfo/python-list


[issue30439] Expose the subinterpreters C-API in the stdlib.

2017-05-25 Thread Nick Coghlan

Nick Coghlan added the comment:

A naming suggestion: let's leave the `interpreters` & `_interpreters` names 
free for a possible future PEP to make this a public API with a fallback 
multiprocessing backed implementation for implementations that don't have 
native subinterpreter support.

Then for this "testing and experimentation only" API, we'd go with 
"_subinterpreters" to match the name typically used to refer to the CPython 
feature.

--
nosy: +ncoghlan

___
Python tracker 

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



[issue30478] Python 2.7 crashes in Linux environment

2017-05-25 Thread Nick Coghlan

Nick Coghlan added the comment:

Hi HuyK, thanks for the issue report, and in particular the pointers to the key 
external libraries the script uses.

It seems ftd2xx relies on ctypes to wrap an external library, which means that 
this report falls under the general policy of "triggering a segfault with 
ctypes is assumed to be a bug in the usage of ctypes, rather than a bug in 
ctypes itself". 

If you'd like to investigate further before filing a bug report with the ftd2xx 
authors, you may want to try out the Python 2.7 backport of Python 3's 
faulthandler library: https://faulthandler.readthedocs.io/

That should be able to give you a Python traceback at the point where the 
segfault occurs, rather than trying to reverse engineer that information from 
the core dump.

--
nosy: +ncoghlan
resolution:  -> third party
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



[issue30478] Python 2.7 crashes in Linux environment

2017-05-25 Thread HuyK

HuyK added the comment:

Hi Louie Lu,

You will need a touch-screen device running corresponding firmware in order to 
run the python application. FYI, I tried to run only weather data fetching or 
only COM port communication but the crash did not happen. It happens when I run 
both tasks.
Anyway, I attach the python script for your reference.
First, I got the issue with 2.7.9. And after updating to 2.7.13, I still get 
the crash issue

Thanks,
HuyK

--
Added file: http://bugs.python.org/file46904/weather_station.py

___
Python tracker 

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



[issue30420] Clarify kwarg handing for subprocess convenience APIs

2017-05-25 Thread Nick Coghlan

Nick Coghlan added the comment:

The just merged PR covers the "list `cwd` in the nominal signatures for 
`run()`, `call()`, `check_call()`, and `check_output()`" part of the proposal.

The rest of the proposed fixes are still pending a patch (and keeping in mind 
Martin's caveat on minimising duplication between the "Frequently Used 
Arguments" section and the full Popen documentation)

--

___
Python tracker 

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



[issue30478] Python 2.7 crashes in Linux environment

2017-05-25 Thread Louie Lu

Louie Lu added the comment:

Hi Huyk, which version of Python does the error message generated?

Also, could you try to provide a minimum reproduce python script and upload it? 
it will be more easy to debug this problem if we can reproduce this.

--
nosy: +louielu

___
Python tracker 

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



[issue30471] "as" keyword in comprehensions

2017-05-25 Thread Raymond Hettinger

Raymond Hettinger added the comment:

As Brett says, the place to propose this is on python-ideas.  

I'm going to mark it here as closed/rejected because it will likely have to go 
through a lengthy process (possibly including a PEP) before having a chance of 
being accepted.  Please don't take this as discouragement.  It is just that the 
tracker is the wrong forum for the conversation to start.

On the plus side, the idea does seem like a nice convenience.  On the minus 
side, we really like that inconveniences serve as a nudge to not put too much 
inside a list comprehension and use a regular for-loop instead.  Also, Guido in 
the past has resisted similar suggestions for making assignments inside a 
while-loop conditional expression ("while (f.read(10) as block) != '': ...).

--
nosy: +rhettinger
resolution:  -> rejected
stage:  -> resolved
status: open -> closed
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



[issue30420] Clarify kwarg handing for subprocess convenience APIs

2017-05-25 Thread Nick Coghlan

Nick Coghlan added the comment:


New changeset 368cf1d20630498ca7939069a05d744fabb570aa by Nick Coghlan (Alex 
Gaynor) in branch 'master':
bpo-30420: List cwd parameter in subprocess convenience APIs (GH-1685)
https://github.com/python/cpython/commit/368cf1d20630498ca7939069a05d744fabb570aa


--

___
Python tracker 

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



[issue30477] tuple.index error message improvement

2017-05-25 Thread Raymond Hettinger

Raymond Hettinger added the comment:

> Is it a performance worry?

It really depends on what people are doing with their down.  If indexing 
potentially missing values is common, there will be a performance impact.  

Also, the cost of a __repr__ varies wildly depending on the data (i.e. a 
collections.Counter instance has an expensive __repr__, decimal objects have 
computations to runs as well).

>From a user point of view, a repr might be helpful or it might be 
>disasterously lengthy (a webpage, a giant bytearray, a long list of tuples).

Personally, I would rather not do this PR which seems to have the view that the 
exception is an error condition as opposed to being a normal way to terminate a 
series of index() calls.

--
nosy: +rhettinger

___
Python tracker 

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



[issue30449] Improve __slots__ datamodel documentation

2017-05-25 Thread Raymond Hettinger

Raymond Hettinger added the comment:

Overall this looks good.  Please do fix the one review comment.

--

___
Python tracker 

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



[issue30449] Improve __slots__ datamodel documentation

2017-05-25 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
assignee: docs@python -> rhettinger

___
Python tracker 

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



Re: How to install Python package from source on Windows

2017-05-25 Thread Michael Torrie
On 05/25/2017 04:37 PM, Deborah Swanson wrote:
>> Here's a question: does Anaconda have a special build of Python, or is
> 
>> it a standard Python bundled with extra stuff?
> 
> I'm not sure, and it's an excellent question. Anaconda stopped
> installing Python on XP at 3.4.3.  python.org doesn't install 3.5 on XP,
> but I don't know which build was the last one that would. 
> 
> Anaconda and python.org do have completely separate and different build
> processes, but I suspect the incompatibility for XP SP2 in both has to
> do with failed attempts to install Visual Studio 2015. I've seen it too
> many times not to be fairly sure of that. XP SP3 evidently does work, if
> Michael Torrie had no problem. 

I suspect python.org Python 3.4 will work fine on XP2 without VS.
Anaconda must be doing thingd differently.

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


Re: How to install Python package from source on Windows

2017-05-25 Thread Chris Angelico
On Fri, May 26, 2017 at 11:28 AM, Deborah Swanson
 wrote:
> Since none of you have XP SP2 with Anaconda3 Python 3.4.3, to either
> confirm or deny my results, and I no longer have the message with the
> traceback showing what happened, nothing anybody says at this point
> matters wrt to what happens in XP SP2.

Sure, we don't ACTUALLY have an SP2 system to test. But would you
believe me if I said "Python 3.4.3 will ask you to have a webcam
connected to the computer"? If I absolutely insist that on MY system
Python keeps asking for a webcam, without ever showing the actual
message or saying what I'm doing that triggers it? Think about how
your messages look to us.

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


[issue30478] Python 2.7 crashes in Linux environment

2017-05-25 Thread HuyK

New submission from HuyK:

Hi all,

I have a python script to run  as a Weather Station application. The python 
script runs on Raspberry Pi 3 board. It gets weather data from OpenWeatherMap 
website and sends result to a remote touch-screen device via COM port to display

It uses two main libraries to handle the task:
https://pypi.python.org/pypi/ftd2xx
https://github.com/csparpa/pyowm

I got the python script just exits without any error after sometimes. Checking 
the return code with the command "echo $?" in Pi's console window and got 139 
which means a Segmentation Fault

We tried to generate coredump system when the python script crashes and we got 
this:
"Core was generated by 'python weather_station.py'
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x0005b614 in complex_subtype_from_string (type=0x746150, v=0x72616843) at 
../Objects/complexobject.c:1075"

I tried to update to Python 2.7.13 but the crashes still happens.

My question is if the segmentation fault related to complexobject.c has been 
reported and fixed?

Best regards,
HuyK

--
components: Interpreter Core
files: python_crashes.png
messages: 294520
nosy: HuyK
priority: normal
severity: normal
status: open
title: Python 2.7 crashes in Linux environment
type: crash
versions: Python 2.7
Added file: http://bugs.python.org/file46903/python_crashes.png

___
Python tracker 

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



Re: using configobj string interpolation and logging.config.dictConfig

2017-05-25 Thread Tim Williams
On Thursday, May 25, 2017 at 5:16:13 PM UTC-4, Peter Otten wrote:
> Tim Williams wrote:
> 
> > On Wednesday, May 24, 2017 at 5:47:37 PM UTC-4, Peter Otten wrote:
> >> Tim Williams wrote:
> >> 
> >> > Just as a followup, if I use 'unrepr=True' in my ConfigObj, I don't
> >> > have to convert the strings.
> >> 
> >> I'd keep it simple and would use JSON...
> > 
> > I looked at JSON at first, but went with configobj because I didn't see
> > where it did string interpolation, which I needed for other parts of my
> > INI file, and I'm trying to use it to specify my log file in my handler.
> > 
> > Which brings me to ...
> 
> > I have this stripped down INI file:
> > 
> ...
> 
> How do you get
> 
> > LogFile = '%(CaptureDrive)s%(RootDir)s/test.log'
> 
> to be interpolated while leaving
> 
> > format = '%(asctime)s: (%(levelname)s)  %(message)s'
> 
> as is?
> 
> > However, when I try to call logging.config.dictConfig() on it, the stream
> > that is opened on creating the logging.FileHandler object is
> > "%(LogFile)s", not "C:/TestData/test.log".
> 
> I don't even get this far:
> 
> >>> c = configobj.ConfigObj("second.ini", unrepr=True)
> >>> c.dict()
> Traceback (most recent call last):
> ...
> configobj.MissingInterpolationOption: missing option "asctime" in 
> interpolation.
> 
> I tried to escape % as %%, but that doesn't seem to work. When I provide 
> bogus replacements
> 
> >>> c = configobj.ConfigObj("third.ini", unrepr=True)
> >>> pprint.pprint(c.dict()["loggng"])
> {'CaptureDrive': 'C:/',
>  'LogFile': 'C:/TestData/test.log',
>  'RootDir': 'TestData',
>  'asctime': 'ASCTIME',
>  'formatters': {'fmt1': {'datefmt': '',
>  'format': 'ASCTIME: (LEVELNAME)  MESSAGE'}},
>  'handlers': {'console': {'class': 'logging.StreamHandler',
>   'level': 'INFO',
>   'stream': 'ext://sys.stdout'},
>   'file': {'class': 'logging.FileHandler',
>'filename': 'C:/TestData/test.log',
>'level': 'WARN'}},
>  'level': 'INFO',
>  'levelname': 'LEVELNAME',
>  'loggers': {'root': {'handlers': ['file', 'console'], 'level': 'INFO'}},
>  'message': 'MESSAGE',
>  'version': 1}
> 
> I get the expected output.

I'm at home now, so I don't have my environment, but if I do a c.dict() I get 
the error about asctime also. If I just pass in the dict object or do a 
'dict(config['loggng'])', I don't get that.
-- 
https://mail.python.org/mailman/listinfo/python-list


RE: How to install Python package from source on Windows

2017-05-25 Thread Deborah Swanson
Since none of you have XP SP2 with Anaconda3 Python 3.4.3, to either
confirm or deny my results, and I no longer have the message with the
traceback showing what happened, nothing anybody says at this point
matters wrt to what happens in XP SP2.

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


Re: How to install Python package from source on Windows

2017-05-25 Thread breamoreboy
On Friday, May 26, 2017 at 12:11:41 AM UTC+1, Deborah Swanson wrote:
> breamoreboy wrote, on Thursday, May 25, 2017 3:23 PM
> > 
> > On Thursday, May 25, 2017 at 10:32:56 PM UTC+1, Deborah Swanson wrote:
> > > > Michael Torrie wrote, on Thursday, May 25, 2017 1:57 PM
> > > > > I didn't see a traceback where you tried to upgrade pip 
> > to 9.0.1.
> > > 
> > > It's a long thread. You just didn't find it.
> > > 
> > 
> > You've never attempted to upgrade pip that I can see.  You 
> > were invited to do so 
> > https://www.mail-archive.com/python-list@python.org/msg426173.
> html but apparently didn't bother.
> 
> Kindest regards.
> 
> Mark Lawrence.
> 
> I apologize. I wrote it up, with the traceback, but the group had moved
> on and I decided not to send it.
> 
> Unfortunately I deleted that message and now I no longer have a pip to
> run
> 
> python -m pip install --upgrade pip
> 
> So I can't make another traceback. But the upgrade attempt did uninstall
> the old pip, which is why I don't have one now, and it died trying to
> install Visual Studio 2015.
> 
> Deborah

As others have suggested either your setup is screwed, or you have a file that 
is masking one in the stdlib.  Certainly there is no way that you should be 
seeing any reference to Visual Studio.  Does Anaconda give you a repair option 
that you could try?  Failing that how about installing Python 3.4 from here 
https://www.python.org/downloads/release/python-344/ in parallel with the 
Anaconda setup?  It least it would give you a chance to make progress.

Kindest regards.

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


Re: How to install Python package from source on Windows

2017-05-25 Thread eryk sun
On Thu, May 25, 2017 at 11:11 PM, Deborah Swanson
 wrote:
> Unfortunately I deleted that message and now I no longer have a pip

You still have ensurepip to be able to install and upgrade pip:

python -m ensurepip --verbose --default-pip
python -m pip install --upgrade pip

Or use get-pip.py:

https://pip.pypa.io/en/stable/installing
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to install Python package from source on Windows

2017-05-25 Thread MRAB

On 2017-05-26 00:11, Deborah Swanson wrote:

breamore...@gmail.com wrote, on Thursday, May 25, 2017 3:23 PM


On Thursday, May 25, 2017 at 10:32:56 PM UTC+1, Deborah Swanson wrote:
> > Michael Torrie wrote, on Thursday, May 25, 2017 1:57 PM
> > > I didn't see a traceback where you tried to upgrade pip 
to 9.0.1.
> 
> It's a long thread. You just didn't find it.
> 

You've never attempted to upgrade pip that I can see.  You 
were invited to do so 
https://www.mail-archive.com/python-list@python.org/msg426173.

html but apparently didn't bother.

Kindest regards.

Mark Lawrence.

I apologize. I wrote it up, with the traceback, but the group had moved
on and I decided not to send it.

Unfortunately I deleted that message and now I no longer have a pip to
run

python -m pip install --upgrade pip

So I can't make another traceback. But the upgrade attempt did uninstall
the old pip, which is why I don't have one now, and it died trying to
install Visual Studio 2015.


Here's an experiment I performed:

C:\Python34\Scripts contained the files "pip.exe", "pip3.4.exe" and 
"pip3.exe". I deleted them.


C:\Python34\Lib\site-packages contained the folders "pip" and 
"pip-9.0.1.dist-info". I deleted them too.


OK, so starting from that state, I download pip:

C:\Python34>python -m ensurepip
Ignoring indexes: https://pypi.python.org/simple/
Requirement already satisfied (use --upgrade to upgrade): setuptools in 
c:\python34\lib\site-packages

Downloading/unpacking pip
Installing collected packages: pip
Successfully installed pip
Cleaning up...

C:\Python34>scripts\pip3.4 -V
pip 1.5.4 from C:\Python34\lib\site-packages (python 3.4)

I now have pip, but it's not the latest version.

C:\Python34>python -m pip install --upgrade pip
Downloading/unpacking pip from 
https://pypi.python.org/packages/b6/ac/7015eb97dc749283ffdec1c3a88ddb8ae03b8fad0f0e611408f196358da3/pip-9.0.1-py2.py3-none-any.whl#md5=297dbd16ef53bcef0447d245815f5144

Installing collected packages: pip
  Found existing installation: pip 1.5.4
Uninstalling pip:
  Successfully uninstalled pip
Successfully installed pip
Cleaning up...

C:\Python34>scripts\pip -V
pip 9.0.1 from C:\Python34\lib\site-packages (python 3.4)


And at no point did it ask for a compiler.
--
https://mail.python.org/mailman/listinfo/python-list


Re: Concatenating files in order

2017-05-25 Thread Cameron Simpson

On 25May2017 20:37, Mahmood Naderan  wrote:
Cameron, thanks for the points. In fact the file name contains multiple '_' 
characters. So, I appreciate what you recommended.


 filenames = {}
 for name in glob.glob('*chunk_*'):
   left, right = name.rsplit('_', 1)
   if left.endswith('chunk') and right.isdigit():
 filenames[int(right)] = filename
 sorted_filenames = [ filenames[k] for k in sorted(filenames.keys()) ]

It seems that 'filename' should be 'right'.


No, 'filename' should be 'name': the original filename. Thanks for the catch.

The idea is to have a map of int->filename so that you can open the files in 
numeric order.  So 'right' is just the numeric suffix - you need 'name' for the 
open() call.


Cheers,
Cameron Simpson 
--
https://mail.python.org/mailman/listinfo/python-list


RE: How to install Python package from source on Windows

2017-05-25 Thread Deborah Swanson
breamore...@gmail.com wrote, on Thursday, May 25, 2017 3:23 PM
> 
> On Thursday, May 25, 2017 at 10:32:56 PM UTC+1, Deborah Swanson wrote:
> > > Michael Torrie wrote, on Thursday, May 25, 2017 1:57 PM
> > > > I didn't see a traceback where you tried to upgrade pip 
> to 9.0.1.
> > 
> > It's a long thread. You just didn't find it.
> > 
> 
> You've never attempted to upgrade pip that I can see.  You 
> were invited to do so 
> https://www.mail-archive.com/python-list@python.org/msg426173.
html but apparently didn't bother.

Kindest regards.

Mark Lawrence.

I apologize. I wrote it up, with the traceback, but the group had moved
on and I decided not to send it.

Unfortunately I deleted that message and now I no longer have a pip to
run

python -m pip install --upgrade pip

So I can't make another traceback. But the upgrade attempt did uninstall
the old pip, which is why I don't have one now, and it died trying to
install Visual Studio 2015.

Deborah

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


[issue30477] tuple.index error message improvement

2017-05-25 Thread Joe Jevnik

Joe Jevnik added the comment:

As a more meta question: I have noticed that many error messages in the stdlib 
use PyErr_SetString, or choose to use the type name instead of the repr of the 
object. Is there a reason for this? I normally try to fill the error message 
with as much context as possible to make debugging easier. Is it a performance 
worry?

--

___
Python tracker 

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



[issue30477] tuple.index error message improvement

2017-05-25 Thread Joe Jevnik

Joe Jevnik added the comment:

I agree, "%R in tuple" is enough information for me. This would also remove the 
need to manually repr the object.

--
type: enhancement -> 

___
Python tracker 

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



[issue30477] tuple.index error message improvement

2017-05-25 Thread Brett Cannon

Brett Cannon added the comment:

I'm wondering if including the whole "tuple.index(%R)" part is still necessary? 
The traceback will tell you what method you called, so wouldn't "%R not in 
tuple" be enough?

--
components: +Interpreter Core
type:  -> enhancement

___
Python tracker 

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



[issue30477] tuple.index error message improvement

2017-05-25 Thread Joe Jevnik

New submission from Joe Jevnik:

The old error of tuple.index(x): x not in tuple seemed very confusing to me. It 
was also harder to quickly understand what the program was doing wrong. This 
saves people a second pass through the program under the debugger because they 
can just see what the invalid value was.

The reason I am explicitly calling repr instead of using %R is that I didn't 
want to call repr twice if I didn't need to. If people think that is fine the 
format can just be tuple.index(%R): %R not in tuple instead.

--
messages: 294516
nosy: brett.cannon, ll
priority: normal
pull_requests: 1906
severity: normal
status: open
title: tuple.index error message improvement
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



RE: How to install Python package from source on Windows

2017-05-25 Thread Deborah Swanson
MRAB wrote, on Thursday, May 25, 2017 2:46 PM
> 
> On 2017-05-25 21:24, Chris Angelico wrote:
> > On Fri, May 26, 2017 at 6:16 AM, Deborah Swanson 
> >  wrote:
> >>> Anyway I can confirm that VS is not required for installing and 
> >>> using pip on XP, nor is it required for recordclass, since it's 
> >>> available in wheel form.
> >>
> >> See my tracebacks earlier in this thread. You confirmed 
> that it works 
> >> in XP SP3, only.
> > 
> > Doesn't matter whether VS works on SP3 but not SP2 - the point was 
> > that pip works without VS.
> > 
> Here's a question: does Anaconda have a special build of Python, or is

> it a standard Python bundled with extra stuff?

I'm not sure, and it's an excellent question. Anaconda stopped
installing Python on XP at 3.4.3.  python.org doesn't install 3.5 on XP,
but I don't know which build was the last one that would. 

Anaconda and python.org do have completely separate and different build
processes, but I suspect the incompatibility for XP SP2 in both has to
do with failed attempts to install Visual Studio 2015. I've seen it too
many times not to be fairly sure of that. XP SP3 evidently does work, if
Michael Torrie had no problem. 

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


Re: How to install Python package from source on Windows

2017-05-25 Thread breamoreboy
On Thursday, May 25, 2017 at 10:32:56 PM UTC+1, Deborah Swanson wrote:
> > Michael Torrie wrote, on Thursday, May 25, 2017 1:57 PM
> > > I didn't see a traceback where you tried to upgrade pip to
> > > 9.0.1.  
> 
> It's a long thread. You just didn't find it.
> 

You've never attempted to upgrade pip that I can see.  You were invited to do 
so https://www.mail-archive.com/python-list@python.org/msg426173.html but 
apparently didn't bother.

Kindest regards.

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


[issue30449] Improve __slots__ datamodel documentation

2017-05-25 Thread Aaron Hall

Aaron Hall added the comment:

I created a new PR based on rhettinger's feedback (which on consideration was 
quite correct) with a fresh branch from master. 

Terseness is retained, and I think this revision makes the documentation more 
correct and complete. The rewording makes the behavior more clear (IMHO).

No example code is needed for this revision, so I didn't give any, but one or 
two class definitions might be desirable.

Feedback is quite welcome!

--

___
Python tracker 

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



Re: Concatenating files in order

2017-05-25 Thread Mahmood Naderan via Python-list
Hi guys,


Cameron, thanks for the points. In fact the file name contains multiple '_' 
characters. So, I appreciate what you recommended.





  filenames = {}

  for name in glob.glob('*chunk_*'):

left, right = name.rsplit('_', 1)

if left.endswith('chunk') and right.isdigit():

  filenames[int(right)] = filename

  sorted_filenames = [ filenames[k] for k in sorted(filenames.keys()) ]




It seems that 'filename' should be 'right'.  



Regards,

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


Re: How to install Python package from source on Windows

2017-05-25 Thread MRAB

On 2017-05-25 21:24, Chris Angelico wrote:

On Fri, May 26, 2017 at 6:16 AM, Deborah Swanson
 wrote:

Anyway I can confirm that VS is not required for installing
and using pip on XP, nor is it required for recordclass,
since it's available in wheel form.


See my tracebacks earlier in this thread. You confirmed that it works in
XP SP3, only.


Doesn't matter whether VS works on SP3 but not SP2 - the point was
that pip works without VS.

Here's a question: does Anaconda have a special build of Python, or is 
it a standard Python bundled with extra stuff?

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


[issue30449] Improve __slots__ datamodel documentation

2017-05-25 Thread Aaron Hall

Changes by Aaron Hall :


--
pull_requests: +1905

___
Python tracker 

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



[issue30471] "as" keyword in comprehensions

2017-05-25 Thread Brett Cannon

Brett Cannon added the comment:

The best place to propose this is on the python-ideas mailing list. My 
suspicion, though, is people will say it's not worth the new syntax as you can 
also undo your comprehensions as normal code and simply assign to a variable 
name directly.

--
nosy: +brett.cannon

___
Python tracker 

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



RE: How to install Python package from source on Windows

2017-05-25 Thread Deborah Swanson
> Michael Torrie wrote, on Thursday, May 25, 2017 1:57 PM
> > I didn't see a traceback where you tried to upgrade pip to
> > 9.0.1.  

It's a long thread. You just didn't find it.

This is my last reply on this thread to anything to do with XP SP2
(observations in XP SP3 do not apply) or Visual Studio. I've answered
all of the questions, some of them multiple times. Please reread the
thread if you have more questions.

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


Re: using configobj string interpolation and logging.config.dictConfig

2017-05-25 Thread Peter Otten
Tim Williams wrote:

> On Wednesday, May 24, 2017 at 5:47:37 PM UTC-4, Peter Otten wrote:
>> Tim Williams wrote:
>> 
>> > Just as a followup, if I use 'unrepr=True' in my ConfigObj, I don't
>> > have to convert the strings.
>> 
>> I'd keep it simple and would use JSON...
> 
> I looked at JSON at first, but went with configobj because I didn't see
> where it did string interpolation, which I needed for other parts of my
> INI file, and I'm trying to use it to specify my log file in my handler.
> 
> Which brings me to ...

> I have this stripped down INI file:
> 
...

How do you get

> LogFile = '%(CaptureDrive)s%(RootDir)s/test.log'

to be interpolated while leaving

> format = '%(asctime)s: (%(levelname)s)  %(message)s'

as is?

> However, when I try to call logging.config.dictConfig() on it, the stream
> that is opened on creating the logging.FileHandler object is
> "%(LogFile)s", not "C:/TestData/test.log".

I don't even get this far:

>>> c = configobj.ConfigObj("second.ini", unrepr=True)
>>> c.dict()
Traceback (most recent call last):
...
configobj.MissingInterpolationOption: missing option "asctime" in 
interpolation.

I tried to escape % as %%, but that doesn't seem to work. When I provide 
bogus replacements

>>> c = configobj.ConfigObj("third.ini", unrepr=True)
>>> pprint.pprint(c.dict()["loggng"])
{'CaptureDrive': 'C:/',
 'LogFile': 'C:/TestData/test.log',
 'RootDir': 'TestData',
 'asctime': 'ASCTIME',
 'formatters': {'fmt1': {'datefmt': '',
 'format': 'ASCTIME: (LEVELNAME)  MESSAGE'}},
 'handlers': {'console': {'class': 'logging.StreamHandler',
  'level': 'INFO',
  'stream': 'ext://sys.stdout'},
  'file': {'class': 'logging.FileHandler',
   'filename': 'C:/TestData/test.log',
   'level': 'WARN'}},
 'level': 'INFO',
 'levelname': 'LEVELNAME',
 'loggers': {'root': {'handlers': ['file', 'console'], 'level': 'INFO'}},
 'message': 'MESSAGE',
 'version': 1}

I get the expected output.

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


RE: How to install Python package from source on Windows

2017-05-25 Thread Deborah Swanson
Michael Torrie wrote, on Thursday, May 25, 2017 1:57 PM
> 
> On 05/25/2017 02:16 PM, Deborah Swanson wrote:
> >> I just fired up my Windows XP SP3 virtual machine, which has
> >> no development tools whatsoever on it (no VS, nothing). I 
> >> installed 32-bit Python 3.4 from the official python.org 
> >> download. Then I did the pip
> >> upgrade:
> > 
> > Yes XP SP3 can install Visual Studio 2015. No, XP SP2 cannot.
> 
> Huh?  What are you talking about?  Where are you reading that 
> I installed Visual Studio? I never had any version of VS 
> installed, nor was any needed.

Python will attempt to install Visual Studio, and it fails on XP SP2.

> > See my tracebacks earlier in this thread. You confirmed 
> that it works 
> > in XP SP3, only.
> 
> I didn't see a traceback where you tried to upgrade pip to 
> 9.0.1.  Did you post that?  Anyway, it also appears you're 
> not using the stock Python 3.4 from python.org, so perhaps 
> whatever version of Python you're using has been modified in 
> some way.  Perhaps the Anaconda folks have a forum or mailing 
> list that may be more helpful.
> 
> The main point, however, is that upgrading pip and installing 
> recordclass does not require visual studio at all, on any OS 
> (including
> XP) where a recordclass wheel is available.  That was my point.
> 
> As to what I confirmed, you were going on and on about how 
> Pip somehow requires Visual Studio to be installed, when in 
> fact it doesn't.  As stock Python 3.4 can apparently run on 
> SP2, pip will run also, without visual studio.
> 
> Though at the risk of drawing your ire, most programs that 
> run on XP require SP3.  I'm a bit surprised that Python 3.4 
> will even run at all on SP2.
> -- 
> https://mail.python.org/mailman/listinfo/python-list
> 

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


Re: How to install Python package from source on Windows

2017-05-25 Thread MRAB

On 2017-05-25 21:24, Chris Angelico wrote:

On Fri, May 26, 2017 at 6:16 AM, Deborah Swanson
 wrote:

Anyway I can confirm that VS is not required for installing
and using pip on XP, nor is it required for recordclass,
since it's available in wheel form.


See my tracebacks earlier in this thread. You confirmed that it works in
XP SP3, only.


Doesn't matter whether VS works on SP3 but not SP2 - the point was
that pip works without VS.

Looking at the previous posts, I can see that she failed to install 
recordclass because it couldn't find a compiler.


When I tried to install recordclass, pip downloaded the sources and 
compiled them.


I then uninstalled recordclass.

I updated pip, which didn't need a compiler.

I installed recordclass again. Pip downloaded the wheel, and it didn't 
need a compiler.


So if she's saying that updating pip requires a compiler, then there's 
something screwy with her system.

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


Re: How to install Python package from source on Windows

2017-05-25 Thread Michael Torrie
On 05/25/2017 02:16 PM, Deborah Swanson wrote:
>> I just fired up my Windows XP SP3 virtual machine, which has 
>> no development tools whatsoever on it (no VS, nothing). I 
>> installed 32-bit Python 3.4 from the official python.org 
>> download. Then I did the pip
>> upgrade:
> 
> Yes XP SP3 can install Visual Studio 2015. No, XP SP2 cannot.

Huh?  What are you talking about?  Where are you reading that I
installed Visual Studio? I never had any version of VS installed, nor
was any needed.

> See my tracebacks earlier in this thread. You confirmed that it works in
> XP SP3, only.

I didn't see a traceback where you tried to upgrade pip to 9.0.1.  Did
you post that?  Anyway, it also appears you're not using the stock
Python 3.4 from python.org, so perhaps whatever version of Python you're
using has been modified in some way.  Perhaps the Anaconda folks have a
forum or mailing list that may be more helpful.

The main point, however, is that upgrading pip and installing
recordclass does not require visual studio at all, on any OS (including
XP) where a recordclass wheel is available.  That was my point.

As to what I confirmed, you were going on and on about how Pip somehow
requires Visual Studio to be installed, when in fact it doesn't.  As
stock Python 3.4 can apparently run on SP2, pip will run also, without
visual studio.

Though at the risk of drawing your ire, most programs that run on XP
require SP3.  I'm a bit surprised that Python 3.4 will even run at all
on SP2.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: How to install Python package from source on Windows

2017-05-25 Thread Chris Angelico
On Fri, May 26, 2017 at 6:16 AM, Deborah Swanson
 wrote:
>> Anyway I can confirm that VS is not required for installing
>> and using pip on XP, nor is it required for recordclass,
>> since it's available in wheel form.
>
> See my tracebacks earlier in this thread. You confirmed that it works in
> XP SP3, only.

Doesn't matter whether VS works on SP3 but not SP2 - the point was
that pip works without VS.

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


[issue30476] Add _GenerateCRCTable() to zipfile.py to pre-compute CRC Table

2017-05-25 Thread Shubha Ramani

New submission from Shubha Ramani:

It is wasteful to generate the CRC Table every time, via _crctable = 
list(map(_gen_crc, range(256))). Better to have a pre-computed table.

I will submit the patch which incorporates this feature along with 
micro-benchmark results. Related issue:

http://bugs.python.org/issue30467

http://bugs.python.org/issue30468

--
messages: 294513
nosy: serhiy.storchaka, shubhar
priority: normal
severity: normal
status: open
title: Add   _GenerateCRCTable() to zipfile.py to pre-compute CRC Table
type: performance
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



RE: How to install Python package from source on Windows

2017-05-25 Thread Deborah Swanson
Michael Torrie wrote, on Thursday, May 25, 2017 12:12 PM
> 
> On 05/25/2017 10:09 AM, Deborah Swanson wrote:
> > Could be, maybe it's something they do for every 
> installation, whether 
> > it will use it or not. But it always breaks when it can't install 
> > Visual Studio. Upgrade pip does run and it works up to that 
> point. It 
> > gets as far as uninstalling the old pip, but then there's no way to 
> > get any pip reinstalled.
> 
> I just fired up my Windows XP SP3 virtual machine, which has 
> no development tools whatsoever on it (no VS, nothing). I 
> installed 32-bit Python 3.4 from the official python.org 
> download. Then I did the pip
> upgrade:

Yes XP SP3 can install Visual Studio 2015. No, XP SP2 cannot.

Please read earlier in this thread for the details.

> C:\Python34>python -m pip install -U pip
> Collecting pip
>   Downloading pip-9.0.1-py2.py3-none-any.whl (1.3MB)
> 100% || 1.3MB 137kB/s 
> Installing collected packages: pip
>   Found existing installation: pip 7.1.2
> Uninstalling pip-7.1.2:
>   Successfully uninstalled pip-7.1.2
> Successfully installed pip-9.0.1
> 
> C:\Python34>python -m pip install recordclass
> Collecting recordclass
>   Downloading recordclass-0.4.3-cp34-cp34m-win32.whl
> Installing collected packages: recordclass
> Successfully installed recordclass-0.4.3
> 
> 
> I'm not sure what's wrong with your python installation but 
> it has nothing to do with Windows XP or Visual Studio.  It 
> might help if you cut and paste the exact errors you are 
> seeing.  Also did you mention before whether you're running 
> the standard Python 3.4 package from python.org or are you 
> running some third-party system? I thought you mentioned 
> something about anaconda.

Please read earlier in this thread if you are still confused. Previous
of my posts also contain complete tracebacks.
 
> Anyway I can confirm that VS is not required for installing 
> and using pip on XP, nor is it required for recordclass, 
> since it's available in wheel form.

See my tracebacks earlier in this thread. You confirmed that it works in
XP SP3, only.

Deborah

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


[issue30448] test_subprocess creates a core dump on FreeBSD

2017-05-25 Thread Eric Snow

Eric Snow added the comment:

At this point I'm not convinced the failure is due to my recent changes.  
Regardless, I do agree with you about detecting hard crashes.

--

___
Python tracker 

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



[issue30459] PyList_SET_ITEM could be safer

2017-05-25 Thread Espie Marc

Espie Marc added the comment:

it's still 100% safe as a macro since each parameter is not used more than 
once. only the return type is an issue.

--

___
Python tracker 

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



using configobj string interpolation and logging.config.dictConfig (was Re: dictConfig: logging.StreamHandler object is not iterable.)

2017-05-25 Thread Tim Williams
On Wednesday, May 24, 2017 at 5:47:37 PM UTC-4, Peter Otten wrote:
> Tim Williams wrote:
> 
> > Just as a followup, if I use 'unrepr=True' in my ConfigObj, I don't have
> > to convert the strings.
> 
> I'd keep it simple and would use JSON...

I looked at JSON at first, but went with configobj because I didn't see where 
it did string interpolation, which I needed for other parts of my INI file, and 
I'm trying to use it to specify my log file in my handler.

Which brings me to ...

I have this stripped down INI file:

[loggng]
version = 1
level = 'INFO'
RootDir = 'TestData'
CaptureDrive = 'C:/'
LogFile = '%(CaptureDrive)s%(RootDir)s/test.log'
[[formatters]]
[[[fmt1]]]
format = '%(asctime)s: (%(levelname)s)  %(message)s'
datefmt =
[[handlers]]
[[[console]]]
class = 'logging.StreamHandler'
level = 'INFO'
stream = 'ext://sys.stdout'
[[[file]]]
class = 'logging.FileHandler'
level = 'WARN'
filename = '%(LogFile)s'
#filename = 'cfg://loggng.LogFile'
[[loggers]]
[[[root]]]
level = 'INFO'
handlers = ['file','console']

When I parse the INI file with configobj:
config = configobj.ConfigObj('loggingtest.ini', unrepr=True, raise_errors=True)

config['loggng']['handlers']['file']['filename'] evaluates correctly to 
C:/TestData/test.log

However, when I try to call logging.config.dictConfig() on it, the stream that 
is opened on creating the logging.FileHandler object is "%(LogFile)s", not 
"C:/TestData/test.log".

Stepping into the debugger, I see that the dictionary is changed in 
BaseConfigurator.convert()

def convert(self, value):
"""
Convert values to an appropriate type. dicts, lists and tuples are
replaced by their converting alternatives. Strings are checked to
see if they have a conversion format and are converted if they do.
"""
if not isinstance(value, ConvertingDict) and isinstance(value, dict):
value = ConvertingDict(value)
value.configurator = self

BEFORE calling ConvertingDict(value), the value dict has the correct value for 
key filename:

>>> value
{'class': 'logging.FileHandler', 'level': 'WARN', 'filename': 
'C:/TestData/test.log'}

AFTER calling ConvertingDict(value):

>>> value
{'filename': '%(LogFile)s', 'class': 'logging.FileHandler', 'level': 'WARN'}

If I try to use 
filename = 'cfg://loggng.LogFile'
in my INI file, I get a ValueError calling logging.config.dictConfig(config):


pydev debugger: starting (pid: 70744)
Traceback (most recent call last):
  File "C:\Python34\lib\logging\config.py", line 557, in configure
handler = self.configure_handler(handlers[name])
  File "C:\Python34\lib\logging\config.py", line 723, in configure_handler
kwargs = dict([(k, config[k]) for k in config if valid_ident(k)])
  File "C:\Python34\lib\logging\config.py", line 723, in 
kwargs = dict([(k, config[k]) for k in config if valid_ident(k)])
  File "C:\Python34\lib\logging\config.py", line 318, in __getitem__
return self.convert_with_key(key, value)
  File "C:\Python34\lib\logging\config.py", line 284, in convert_with_key
result = self.configurator.convert(value)
  File "C:\Python34\lib\logging\config.py", line 455, in convert
value = converter(suffix)
  File "C:\Python34\lib\logging\config.py", line 404, in cfg_convert
d = self.config[m.groups()[0]]
  File "C:\Python34\lib\logging\config.py", line 317, in __getitem__
value = dict.__getitem__(self, key)
KeyError: 'loggng'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "L:\timothy.j.williams1\Documents\My 
Programs\eclipse_neon\eclipse\plugins\org.python.pydev_5.3.0.201610121612\pysrc\pydevd.py",
 line 1531, in 
globals = debugger.run(setup['file'], None, None, is_module)
  File "L:\timothy.j.williams1\Documents\My 
Programs\eclipse_neon\eclipse\plugins\org.python.pydev_5.3.0.201610121612\pysrc\pydevd.py",
 line 938, in run
pydev_imports.execfile(file, globals, locals)  # execute the script
  File "L:\timothy.j.williams1\Documents\My 
Programs\eclipse_neon\eclipse\plugins\org.python.pydev_5.3.0.201610121612\pysrc\_pydev_imps\_pydev_execfile.py",
 line 25, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
  File "L:\workspace\MyPython\src\testlog.py", line 8, in 
logging.config.dictConfig(config)
  File "C:\Python34\lib\logging\config.py", line 789, in dictConfig
dictConfigClass(config).configure()
  File "C:\Python34\lib\logging\config.py", line 565, in configure
'%r: %s' % (name, e))
ValueError: Unable to configure handler 'file': 'loggng'

testlog.py:
import logging, logging.config, 

[issue30413] Add fnmatch.filterfalse function

2017-05-25 Thread Brett Cannon

Brett Cannon added the comment:

I don't think os.normcase() calling os.fspath() needs to be a worry. 
Pragmatically it's just getting a str/bytes from an object that knows how to 
return a str/bytes for a path. IOW it's no different than 
os.normcase(str(path)) and so embedding the call such that it's not a flat-out 
no-op shouldn't be a general concern.

--

___
Python tracker 

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



[issue30475] Docs for PyDict_GetItemWithError() should say it returns a borrowed reference.

2017-05-25 Thread Eric Snow

Changes by Eric Snow :


--
pull_requests: +1904

___
Python tracker 

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



[issue30460] file opened for updating cannot write after read

2017-05-25 Thread Jeremy Kloth

Jeremy Kloth added the comment:

It seems to me that it is a quite simple fix:

--- a/Objects/fileobject.c
+++ b/Objects/fileobject.c
@@ -1110,7 +1110,7 @@ file_read(PyFileObject *f, PyObject *args)
-clearerr(f->f_fp);
+if (ferror(f->f_fp)) clearerr(f->f_fp);

which is exactly what the empty read case does above this.

This fixes my error, and produces no changes to the test suite.

I guess it could be wrapped in an #ifdef MS_WINDOWS, just it case, but that 
seems unnecessary as the previous code does not.

--

___
Python tracker 

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



[issue30368] [2.7] OpenSSL compilation fails on AMD64 Windows7 SP1 VS9.0 2.7

2017-05-25 Thread Jeremy Kloth

Jeremy Kloth added the comment:

Updated PR.  It seems that in my testing back and forth, some build artifacts 
were affecting my outcomes.  That's what I get for cutting corners...

Per Zach's comment, I've changed to VS project files to use the prepare_ssl.py 
include directories (include{suffix} vs inc{suffix}).  This simplifies 
build_ssl.py further.

I have, however, left the "fix_buildinf()" code in place since it requires an 
update to the checked-in external OpenSSL before it can be removed.

--

___
Python tracker 

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



Re: How to install Python package from source on Windows

2017-05-25 Thread Michael Torrie
On 05/25/2017 10:09 AM, Deborah Swanson wrote:
> Could be, maybe it's something they do for every installation, whether
> it will use it or not. But it always breaks when it can't install Visual
> Studio. Upgrade pip does run and it works up to that point. It gets as
> far as uninstalling the old pip, but then there's no way to get any pip
> reinstalled.

I just fired up my Windows XP SP3 virtual machine, which has no
development tools whatsoever on it (no VS, nothing). I installed 32-bit
Python 3.4 from the official python.org download. Then I did the pip
upgrade:

C:\Python34>python -m pip install -U pip
Collecting pip
  Downloading pip-9.0.1-py2.py3-none-any.whl (1.3MB)
100% || 1.3MB 137kB/s
Installing collected packages: pip
  Found existing installation: pip 7.1.2
Uninstalling pip-7.1.2:
  Successfully uninstalled pip-7.1.2
Successfully installed pip-9.0.1

C:\Python34>python -m pip install recordclass
Collecting recordclass
  Downloading recordclass-0.4.3-cp34-cp34m-win32.whl
Installing collected packages: recordclass
Successfully installed recordclass-0.4.3


I'm not sure what's wrong with your python installation but it has
nothing to do with Windows XP or Visual Studio.  It might help if you
cut and paste the exact errors you are seeing.  Also did you mention
before whether you're running the standard Python 3.4 package from
python.org or are you running some third-party system? I thought you
mentioned something about anaconda.

Anyway I can confirm that VS is not required for installing and using
pip on XP, nor is it required for recordclass, since it's available in
wheel form.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Nested Loop to Generate Triangle

2017-05-25 Thread MRAB

On 2017-05-25 17:28, Victor Demelo wrote:

I need the triangle to be in reverse. The assignment requires a nested loop to 
generate a triangle with the user input of how many lines.

Currently, I get answers such as:

OOO
OO
O

When I actually need it to be like this:

 OOO
  OO
   O


I just need to get it flipped-over on the other side.

Here is the code I have written, thank you.



base_size = int(input("How many lines? "))
columns = base_size
  
for row in range (base_size) :

for columns in range (columns) :
print('O', end='')
print()


On row 0 (the top row) you want 0 spaces then base_size repeats of 'O'.

On row 1 you want 1 spaces then (base_size - 1) repeats of 'O'.

On row 2 you want 2 spaces then (base_size - 2) repeats of 'O'.

Do you see the pattern?
--
https://mail.python.org/mailman/listinfo/python-list


[issue30459] PyList_SET_ITEM could be safer

2017-05-25 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I prefer to leave this as macro rather than assuming the compiler will heed the 
inline hint.

--

___
Python tracker 

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



[issue30475] Docs for PyDict_GetItemWithError() should say it returns a borrowed reference.

2017-05-25 Thread Eric Snow

Changes by Eric Snow :


--
assignee:  -> eric.snow
components: +Documentation
stage:  -> needs patch
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



[issue30475] Docs for PyDict_GetItemWithError() should say it returns a borrowed reference.

2017-05-25 Thread Eric Snow

New submission from Eric Snow:

Per Object/dictobject.c, PyDict_GetItemWithError() returns a borrowed 
reference.  However, the documentation does not say so.  That should be fixed.

--
messages: 294506
nosy: eric.snow
priority: normal
severity: normal
status: open
title: Docs for PyDict_GetItemWithError() should say it returns a borrowed 
reference.

___
Python tracker 

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



[issue30468] Propagate zipfile.py pypy issue #905 patch to CPython 3.7

2017-05-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I'm not the initial author of zipfile. That initial code for decrypting  was 
added in issue698833.

I like your idea about replacing the generating code with the precomputed 
table. Please open a separate issue for this.

--

___
Python tracker 

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



Re: Emacs command to select only lines indented below a specified level

2017-05-25 Thread Fred Stluka

Ben,

Excellent answer!  Thanks!

--Fred

Fred Stluka -- mailto:f...@bristle.com -- http://bristle.com/~fred/
Bristle Software, Inc -- http://bristle.com -- Glad to be of service!
Open Source: Without walls and fences, we need no Windows or Gates.


On 5/23/17 6:46 PM, Ben Finney wrote:

Fred Stluka  writes:


On 5/23/17 4:43 PM, Ben Finney wrote:


The ‘set-selective-display’ command […] is bound to ‘C-x $’ in
default Emacs.

How do I specify the number of columns when using "C-x $"?

You will remember, from doing the Emacs tutorial when you first learned
Emacs, that all commands have a “prefix argument” available
 that the command
can use to modify its behaviour.

So, use the prefix argument to specify the number of columns for
‘set-selective-display’.

E.g.:

 M-9 C-x $  # Indentation >= 9 disappears.
 C-u C-x $  # Indentation >= 4 disappears.
 C-u 1 3 C-x $  # Indentation >= 13 disappears.
 C-u C-u C-u $  # Indentation >= 64 disappears.
 C-x $  # All lines reappear.

etc.


Same for using the command at the M-x prompt. I type "M-x" and see the
M-x prompt, then then type "set-selective-display" using tab to
autocomplete it. But I can't then type a column number after a space
or in parens or anything. What am I missing?

Time to work through the Emacs tutorial again; ‘C-h t’ :-)



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


Re: How to install Python package from source on Windows

2017-05-25 Thread eryk sun
On Thu, May 25, 2017 at 4:09 PM, Deborah Swanson
 wrote:
> Could be, maybe it's something they do for every installation, whether
> it will use it or not. But it always breaks when it can't install Visual
> Studio. Upgrade pip does run and it works up to that point. It gets as
> far as uninstalling the old pip, but then there's no way to get any pip
> reinstalled.

ensurepip bootstraps the installation of setuptools and pip. The two
wheels [1] get copied to a temp directory and added directly to
sys.path (zipped packages are supported in sys.path). Then pip is run
directly out of the wheel and proceeds to install setuptools and pip
from the same two wheels that were copied to the temp directory. No
extension modules need to be built. No C compiler is required, nor
should one be invoked.

[1]: https://www.python.org/dev/peps/pep-0491

If running ensurepip tries to use distutils or setuptools to build an
extension module, then something is fundamentally wrong with the
installation of Python 3.4. I would uninstall it and install a freshly
downloaded copy of 3.4.4:

32-bit: https://www.python.org/ftp/python/3.4.4/python-3.4.4.msi
64-bit: https://www.python.org/ftp/python/3.4.4/python-3.4.4.amd64.msi

Before installing 3.4.4, remove all traces of the old 3.4
installation(s) that may have been left behind after uninstalling.
Remove the installation directory and delete any registry keys for
"Python\PythonCore\3.4"  found under HKCU\Software, HKLM\Software, or
HKLM\Software\WOW6432Node. Make sure PYTHONHOME isn't set in the
environment variables, and if PYTHONPATH is set, ensure that it does
not include any directories that are part of a standard installation.

If you choose to reinstall 3.4, make sure you enable the option to
install pip (which is implemented using ensurepip) and the option to
add Python to PATH. If you're installing for all users to a secured
directory, I also recommend selecting the advanced option to
pre-compile the standard library.

After installing, open a command prompt and run the following command
to upgrade to the latest version of pip:

python -m pip install --upgrade pip

After upgrading, you should be able to install wheels that use the
newer tag fields in the wheel filename.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue30473] defaultdict raises SystemError, __missing__ returned NULL in thread

2017-05-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

In 3.6 _PyStack_UnpackDict() returns just args if there are no keyword 
arguments. But if args is NULL, the result of _PyStack_UnpackDict() is treated 
as error.

Thank you for the reproducer Louie!

--
assignee:  -> haypo
components: +Interpreter Core
nosy: +serhiy.storchaka
priority: normal -> critical
stage:  -> needs patch

___
Python tracker 

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



[issue30468] Propagate zipfile.py pypy issue #905 patch to CPython 3.7

2017-05-25 Thread Alecsandru Patrascu

Alecsandru Patrascu added the comment:

Serhiy, I am curious why did you have chosen to compute the CRC32 table 
everytime? It is standard (the generator polynomial does not change) and always 
will output the same values. And it is also less computational intensive to 
loading a precomputed array vs calculating it each time a zip archive is 
extracted.

--
nosy: +alecsandru.patrascu

___
Python tracker 

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



[issue30459] PyList_SET_ITEM could be safer

2017-05-25 Thread Stefan Krah

Stefan Krah added the comment:

I guess since it's documented, it would be ok to change for 3.7.  BTW, we also 
allow "static inline" now in headers, so perhaps we could make it a function.

--
nosy: +skrah

___
Python tracker 

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



[issue30439] Expose the subinterpreters C-API in the stdlib.

2017-05-25 Thread Eric Snow

Eric Snow added the comment:

proposed: https://mail.python.org/pipermail/python-ideas/2017-May/045765.html

--

___
Python tracker 

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



[issue30178] Indent methods and attributes of MimeTypes class

2017-05-25 Thread Mariatta Wijaya

Mariatta Wijaya added the comment:

Thanks Jim and Stéphane.

--
resolution:  -> fixed
stage: backport needed -> 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



[issue30459] PyList_SET_ITEM could be safer

2017-05-25 Thread Espie Marc

Espie Marc added the comment:

Note that the API is fully documented for returning void... not anything else.

"No basis" right. We're taling 1 pieces of software. a lot of what is 
actually used in the world.

I'm very surprised, considering python has routinely done "spring cleanup" by 
breaking fairly old apis.
 
If this breaks, people will fix their code, seriously.

In most places, we would rather have undocumented, unportable code, break 
*cleanly*, rather than rely on a fuzzy behavior that could possibly change at 
any moment, and that was never documented as doing anything.


Or is there some kind of mystique that, because this is low-level C 
implementation, somehow, python programmers are not going to be able to cope 
with the internals ?

--

___
Python tracker 

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



[issue22257] PEP 432: Redesign the interpreter startup sequence

2017-05-25 Thread Eric Snow

Changes by Eric Snow :


--
pull_requests: +1903

___
Python tracker 

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



[issue30441] os.environ raises RuntimeError: dictionary changed size during iteration

2017-05-25 Thread Osvaldo Santana Neto

Osvaldo Santana Neto added the comment:

New version of patch:

1. Use RLock instead of Lock (Mark & Antoine recomendation)
2. Add lock acquire at `__setitem__` and `__delitem__` as following (Mark & 
Antoine recomendation)
3. Add lock protection in `__repr__` implementation.

I've some questions pending:

1. Is it a good idea to wrap self._data access with lock in __getitem__? (I 
suspect it's not)
2. Is it a good idea to lock protect self.copy() and self.setdefault() (I 
suspect it's not because both uses __iter__ that is already protected)

--
Added file: 
http://bugs.python.org/file46902/fix_os_environ_iter_issue_low_level_thread_lock_2.diff

___
Python tracker 

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



Re: Nested Loop to Generate Triangle

2017-05-25 Thread Peter Pearson
On Thu, 25 May 2017 09:28:31 -0700 (PDT), Victor Demelo wrote:
> I need the triangle to be in reverse. The assignment requires a nested
> loop to generate a triangle with the user input of how many lines.
>
> Currently, I get answers such as:
> 
> OOO
> OO
> O
>
> When I actually need it to be like this:
> 
>  OOO
>   OO
>O
>
> I just need to get it flipped-over on the other side.
>
> Here is the code I have written, thank you.
>
> base_size = int(input("How many lines? "))
> columns = base_size
>  
> for row in range (base_size) :
>for columns in range (columns) :
>print('O', end='')
>print()

Seems like you're close to a solution.  You just need to print
a certain number of spaces at the beginning of each line, right?

Warning: When you say

for columns in range (columns) :

you're creating a confusing situation with the name "columns":
the original meaning, an integer equal to base_size, is now "shadowed"
by a new meaning.  This sort of thing tends to create trouble.  Besides,
you probably meant to say range(base_size), not range(columns).

I don't know how much you're supposed to know about Python basics,
but have you encountered expressions like 5*"Hello" yet?

-- 
To email me, substitute nowhere->runbox, invalid->com.
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue30473] defaultdict raises SystemError, __missing__ returned NULL in thread

2017-05-25 Thread Louie Lu

Louie Lu added the comment:

This bug is introduce at commit: 37e4ef7b17ce6e98ca725c0a53ae14c313c0e48c, then 
fixed at commit: 998c20962ca3e2e693c1635efe76c0144dde76fc

--

___
Python tracker 

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



[issue30468] Propagate zipfile.py pypy issue #905 patch to CPython 3.7

2017-05-25 Thread Shubha Ramani

Shubha Ramani added the comment:

Serhiy yes what you said makes sense. Thanks for clarifying. Updates 
(benchmarking results) shortly...stay tuned.

--

___
Python tracker 

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



Nested Loop Triangle

2017-05-25 Thread Victor Demelo
I need the triangle to be in reverse. The assignment requires a nested loop to 
generate a triangle with the user input of how many lines. 

Currently, I get answers such as: (A)
 
OOO 
OO 
O 

When I actually need it to be like this: (B)
 
  OOO 
   OO 
O 



I need the display (A) to just be in revered, so I need it starting from the 
right side and go left, and not the left side going right with the '0' stacking 
on top one another.


#Code
base_size = int(input("How many lines? ")) 
columns = base_size 
  
for row in range (base_size) : 
   for columns in range (columns) : 
   print('O', end='') 
   print()  
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Nested Loop to Generate Triangle

2017-05-25 Thread Victor Demelo
On Thursday, May 25, 2017 at 12:28:45 PM UTC-4, Victor Demelo wrote:
> I need the triangle to be in reverse. The assignment requires a nested loop 
> to generate a triangle with the user input of how many lines.
> 
> Currently, I get answers such as:
> 
> OOO
> OO
> O
> 
> When I actually need it to be like this:
> 
>   OOO
>OO
> O
> 
> 
> I just need to get it flipped-over on the other side.
> 
> Here is the code I have written, thank you.
> 
> 
> 
> base_size = int(input("How many lines? "))
> columns = base_size
>  
> for row in range (base_size) :
>for columns in range (columns) :
>print('O', end='')
>print()

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


Re: Nested Loop to Generate Triangle

2017-05-25 Thread Victor Demelo
On Thursday, May 25, 2017 at 12:28:45 PM UTC-4, Victor Demelo wrote:
> I need the triangle to be in reverse. The assignment requires a nested loop 
> to generate a triangle with the user input of how many lines.
> 
> Currently, I get answers such as:
> 
> OOO
> OO
> O
> 
> When I actually need it to be like this:
> 
>   OOO
>OO
> O
> 
> 
> I just need to get it flipped-over on the other side.
> 
> Here is the code I have written, thank you.
> 
> 
> 
> base_size = int(input("How many lines? "))
> columns = base_size
>  
> for row in range (base_size) :
>for columns in range (columns) :
>print('O', end='')
>print()

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


Nested

2017-05-25 Thread Victor Demelo
d
-- 
https://mail.python.org/mailman/listinfo/python-list


Nested Loop to Generate Triangle

2017-05-25 Thread Victor Demelo
I need the triangle to be in reverse. The assignment requires a nested loop to 
generate a triangle with the user input of how many lines.

Currently, I get answers such as:

OOO
OO
O

When I actually need it to be like this:

 OOO
  OO
   O


I just need to get it flipped-over on the other side.

Here is the code I have written, thank you.



base_size = int(input("How many lines? "))
columns = base_size
 
for row in range (base_size) :
   for columns in range (columns) :
   print('O', end='')
   print()
-- 
https://mail.python.org/mailman/listinfo/python-list


[issue30468] Propagate zipfile.py pypy issue #905 patch to CPython 3.7

2017-05-25 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I assigned this issue to me as the maintainer of the zipfile module. This means 
that I undertake to examine the results of benchmarking, make the review of the 
proposed patch, and merge it if it improves the performance and doesn't have 
negative side effects. This shouldn't stop you from writing your patch.

Actually there was a reason why the code is written in that way. But maybe that 
reason no longer actual or there are stronger arguments for other ways. It is 
hard to say until I reproduce benchmarking results.

--

___
Python tracker 

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



Re: Yet another Python SNMP lib

2017-05-25 Thread Kouli
>
> Unsure why you mention C. Python has a solid and efficient
> implementation of SNMP with PySNMP, and except a misunderstanding about
> how SNMPv3 should work, it seems better to use it than relying on
> Net-SNMP which has many bugs and nobody really willing to correct them.
>

Wow. I'd like to excuse the authors of PySNMP: from what I had seen
mentioned on internet, I thought it differs from Net-SNMP mainly in being
written in pure Python and having lower performance. I wish I had skimmed
through the PySNMP documentation before as I have done few minutes ago :-)

PySNMP solves many of issues mentioned in my original message. I can just
add a better (more suitable to me) "OSM" (object - SMI - mapper). You are
right, Vincent: sorry for even mentioning Net-SNMP bindings.

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


RE: How to install Python package from source on Windows

2017-05-25 Thread Deborah Swanson
Chris Angelico wrote, on Thursday, May 25, 2017 12:47 AM
> 
> On Thu, May 25, 2017 at 4:57 PM, Deborah Swanson 
>  wrote:
> > Oh, what bliss it must be to run on a system that hasn't 
> been declared 
> > a pariah by everyone and his dog. (But yet it covers all 
> the essential 
> > bases quite nicely.)
> >
> > I tried ensurepip, but it also wants to install a recent version of 
> > Visual something-or-other, and it breaks and dies when it can't. So 
> > pipless I will be for the near term.
> >
> > Pip may be pure Python, but it seems everything that wants to do 
> > anything with pip wants a recent version of Visual 
> something-or-other 
> > to do it with.
> 
> I'm beginning to wonder if maybe there's a non-standard file 
> in the installation that's getting imported ahead of the 
> standard library, and THAT is what's looking for MSVS.
> 
> ChrisA

Could be, maybe it's something they do for every installation, whether
it will use it or not. But it always breaks when it can't install Visual
Studio. Upgrade pip does run and it works up to that point. It gets as
far as uninstalling the old pip, but then there's no way to get any pip
reinstalled.

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


[issue30450] Pull Windows dependencies from GitHub rather than svn.python.org

2017-05-25 Thread Steve Dower

Steve Dower added the comment:

> I don't think we've ever advertised the svn windows deps as a service we 
> provide the community.

Except in the dev guide :) ([after looking] well, linked from the dev guide 
https://github.com/python/cpython/blob/master/PCbuild/readme.txt#L230 )

Maybe we just need to pick a date and publicise it separately. Is this process 
PEP-worthy? Considering the amount of decisions we had to make regarding 
putting code in git, it might be worth writing up how it works in a brief PEP 
and including an EOL for svn.p.o

--

___
Python tracker 

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



[issue30414] multiprocesing.Queue silently ignore messages after exc in _feeder

2017-05-25 Thread Antoine Pitrou

Antoine Pitrou added the comment:

This is committed and pushed, thank you!

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



[issue30414] multiprocesing.Queue silently ignore messages after exc in _feeder

2017-05-25 Thread Antoine Pitrou

Antoine Pitrou added the comment:


New changeset bdd964710deffe8593063dcb63157e5b55a82c61 by Antoine Pitrou in 
branch '2.7':
[2.7] bpo-30414: multiprocessing.Queue._feed do not break from main loop on exc 
(GH-1683) (#1817)
https://github.com/python/cpython/commit/bdd964710deffe8593063dcb63157e5b55a82c61


--

___
Python tracker 

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



[issue30446] Embedded 3.6.1 distribution cannot find _socket module

2017-05-25 Thread Steve Dower

Steve Dower added the comment:

I've been meaning to get to looking at this issue for a couple of days now, 
sorry.

There are two critical pieces here:
* don't delete or move _socket.pyd
* don't delete or move python36._pth (but possibly update it)

The first one should be obvious - I assume you haven't messed that bit up :)

The second one is the "static" way of setting sys.path, as Zach suggests. By 
default, it should include 'python36.zip' and '.', which is the directory 
containing python36._pth and python36.dll. If you move any of these around, 
sys.path will be automatically inferred, which could break things.

Further, if you move/remove python36._pth, the registry and environment will be 
used to locate files rather than only looking in the application directory. 
This may be bad.

One final tip - you can rename python36._pth to your_exe_name._pth if you want, 
and if you are embedding then you can get roughly equivalent behaviour using 
PySys_SetPath.

If none of this works, we'll need you to provide some information about your 
application, especially the code used to initialize the interpreter, import 
socket, and the layout of all the files in your app. (Right now, you're asking 
us to guess basically every detail that is relevant to the bug, hence we're 
replying with "read the docs" and "try everything" rather than a specific fix 
;) )

--

___
Python tracker 

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



[issue30459] PyList_SET_ITEM could be safer

2017-05-25 Thread Raymond Hettinger

Raymond Hettinger added the comment:

> Well, there is not going to be a lot of breakage. This 
> problem is the only instance I've encountered in the 
> full OpenBSD ports tree.

That is no basis for knowing what the entire rest of the world has done with 
done with this API (perhaps valid working code using chained assignments).

--

___
Python tracker 

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



[issue30467] Propagate zipfile.py pypy issue #905 patch to CPython 2.7

2017-05-25 Thread Shubha Ramani

Shubha Ramani added the comment:

Please assign this bug to me.

--

___
Python tracker 

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



[issue30468] Propagate zipfile.py pypy issue #905 patch to CPython 3.7

2017-05-25 Thread Shubha Ramani

Shubha Ramani added the comment:

serhiy sure I will attach proof of the performance bottle-neck on 2.7 and 3.7 
before I submit a patch. Please assign this bug to me.

--

___
Python tracker 

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



[issue30468] Propagate zipfile.py pypy issue #905 patch to CPython 3.7

2017-05-25 Thread Shubha Ramani

Shubha Ramani added the comment:

Please assign this bug to me. I will submit a patch

--

___
Python tracker 

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



[issue30414] multiprocesing.Queue silently ignore messages after exc in _feeder

2017-05-25 Thread Antoine Pitrou

Antoine Pitrou added the comment:


New changeset 89004d761361332314beb08b443bff5b092ec36e by Antoine Pitrou in 
branch '3.5':
[3.5] bpo-30414: multiprocessing.Queue._feed do not break from main loop on exc 
(GH-1683) (#1816)
https://github.com/python/cpython/commit/89004d761361332314beb08b443bff5b092ec36e


--

___
Python tracker 

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



[issue30414] multiprocesing.Queue silently ignore messages after exc in _feeder

2017-05-25 Thread Antoine Pitrou

Antoine Pitrou added the comment:


New changeset 2783cc42629b9445ea848ce36bbf213ef7789271 by Antoine Pitrou in 
branch '3.6':
[3.6] bpo-30414: multiprocessing.Queue._feed do not break from main loop on exc 
(GH-1683) (#1815)
https://github.com/python/cpython/commit/2783cc42629b9445ea848ce36bbf213ef7789271


--

___
Python tracker 

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



[issue30473] defaultdict raises SystemError, __missing__ returned NULL in thread

2017-05-25 Thread Xiang Zhang

Xiang Zhang added the comment:

Interestingly I could only reproduce the failure on 3.6 but not master.

--
nosy: +xiang.zhang

___
Python tracker 

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



[issue30414] multiprocesing.Queue silently ignore messages after exc in _feeder

2017-05-25 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
pull_requests: +1902

___
Python tracker 

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



  1   2   >