[issue25910] Fixing links in documentation

2016-02-27 Thread SilentGhost

SilentGhost added the comment:

Perhaps, I'm misreading the log output, but it seems to me that it's 
Doc/tools/susp-ignored.csv that needs updating. Here is the attached patch.

--

___
Python tracker 

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



[issue13573] csv.writer uses str() for floats instead of repr()

2016-02-27 Thread Raymond Hettinger

Changes by Raymond Hettinger :


--
resolution:  -> fixed
status: open -> closed

___
Python tracker 

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



[issue13573] csv.writer uses str() for floats instead of repr()

2016-02-27 Thread Roundup Robot

Roundup Robot added the comment:

New changeset d3ac0214b7b8 by Raymond Hettinger in branch '2.7':
Issue 13573: Document that csv.writer uses str() for floats instead of repr().
https://hg.python.org/cpython/rev/d3ac0214b7b8

--

___
Python tracker 

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



[issue26453] SystemError on invalid numpy.ndarray / Path operation

2016-02-27 Thread Antony Lee

New submission from Antony Lee:

Running
```
from pathlib import Path
import numpy as np
np.arange(30) / Path("foo")
```
raises
```
TypeError: argument should be a path or str object, not 

During handling of the above exception, another exception occurred:

SystemError:  
returned a result with an error set



During handling of the above exception, another exception occurred:

SystemError:  
returned a result with an error set

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/tmp/foo.py", line 3, in 
np.arange(30) / Path("foo")
  File "/usr/lib/python3.5/pathlib.py", line 879, in __rtruediv__
return self._from_parts([key] + self._parts)
  File "/usr/lib/python3.5/pathlib.py", line 637, in _from_parts
self = object.__new__(cls)
SystemError:  
returned a result with an error set
```
Note that this does NOT appear for small arrays; I haven't determined the 
threshold.
Crossposted as https://github.com/numpy/numpy/issues/7360.

--
components: Interpreter Core
messages: 260967
nosy: Antony.Lee
priority: normal
severity: normal
status: open
title: SystemError on invalid numpy.ndarray / Path operation
versions: Python 3.5

___
Python tracker 

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



[issue26448] dis.findlabels ignores EXTENDED_ARG

2016-02-27 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +ncoghlan, yselivanov

___
Python tracker 

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



[issue26443] cross building extensions picks up host headers

2016-02-27 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +doko

___
Python tracker 

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



[issue26440] tarfile._FileInFile.seekable is broken in stream mode

2016-02-27 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +lars.gustaebel

___
Python tracker 

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



[issue26439] ctypes.util.find_library fails when ldconfig/glibc not available (e.g., AIX)

2016-02-27 Thread Ned Deily

Changes by Ned Deily :


--
nosy: +David.Edelsohn

___
Python tracker 

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



[issue26452] Wrong line number attributed to comprehension expressions

2016-02-27 Thread Greg Price

New submission from Greg Price:

In a multi-line list comprehension (or dict or set comprehension), the code for 
the main expression of the comprehension is wrongly attributed to the *last* 
line of the comprehension, which might be several lines later.

This makes for quite baffling tracebacks when an exception occurs -- for 
example this program:
```
def f():
return [j
for i in range(3)
if i]

f()
```
produces (with CPython from current `default`):
```
Traceback (most recent call last):
  File "foo.py", line 15, in 
f()
  File "foo.py", line 3, in f
for i in range(3)
  File "foo.py", line 4, in 
if i]
NameError: name 'j' is not defined
```
showing the line `if i]`, which has nothing to do with the error and gives very 
little hint as to where the exception is being raised.

Disassembly confirms that the line numbers on the code object are wrong:
```
  2   0 BUILD_LIST   0
  3 LOAD_FAST0 (.0)
>>6 FOR_ITER18 (to 27)

  3   9 STORE_FAST   1 (i)

  4  12 LOAD_FAST1 (i)
 15 POP_JUMP_IF_FALSE6
 18 LOAD_GLOBAL  0 (j)
 21 LIST_APPEND  2
 24 JUMP_ABSOLUTE6
>>   27 RETURN_VALUE
```
The `LOAD_GLOBAL` instruction for `j` is attributed to line 4, when it should 
be line 2.

A similar issue affects multi-line function calls, which get attributed to a 
line in the last argument.  This is less often so seriously confusing because 
the function called is right there as the next frame down on the stack, but 
it's much more common and it makes the traceback look a little off -- I've 
noticed this as a minor annoyance for years, before the more serious 
comprehension issue got my attention.

Historically, line numbers were constrained to be wrong in these ways because 
the line-number table `co_lnotab` on a code object required its line numbers to 
increase monotonically -- and the code for the main expression of a 
comprehension comes after all the `for` and `if` clauses, so it can't get a 
line number earlier than theirs.  Victor Stinner's recent work in 
https://hg.python.org/cpython/rev/775b74e0e103 lifted that restriction in the 
`co_lnotab` data structure, so it's now just a matter of actually entering the 
correct line numbers there.

I have a draft patch to do this, attached here.  It fixes the issue both for 
comprehensions and function calls, and includes tests.  Things I'd still like 
to do before considering the patch ready:
* There are a couple of bits of logic that I knock out that can probably be 
simplified further.
* While I'm looking at this, there are several other forms of expression and 
statement that have or probably have similar issues, and I'll want to go and 
review them too to either fix or determine that they're fine.  The ones I've 
thought of are included in the draft test file, either as actual tests (with 
their current answers) or TODO comments for me to investigate.

Comments very welcome on the issue and my draft patch, and meanwhile I'll 
continue with the further steps mentioned above.

Thanks to Benjamin Peterson for helping diagnose this issue with me when we ran 
into a confusing traceback that ran through a comprehension.

--
components: Interpreter Core
files: lines.diff
keywords: patch
messages: 260966
nosy: Greg Price
priority: normal
severity: normal
status: open
title: Wrong line number attributed to comprehension expressions
type: behavior
versions: Python 2.7, Python 3.2, Python 3.3, Python 3.4, Python 3.5, Python 3.6
Added file: http://bugs.python.org/file42042/lines.diff

___
Python tracker 

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



[issue23041] csv needs more quoting rules

2016-02-27 Thread Berker Peksag

Changes by Berker Peksag :


--
nosy: +berker.peksag
stage: needs patch -> patch review
versions: +Python 3.6 -Python 3.5

___
Python tracker 

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



[issue13573] csv.writer uses str() for floats instead of repr()

2016-02-27 Thread Berker Peksag

Berker Peksag added the comment:

csv.writer() documentation says:

"All other non-string data are stringified with str() before being written."

https://docs.python.org/2.7/library/csv.html#csv.writer

I guess adding a sentence to document the special case for floats wouldn't hurt.

--
keywords: +easy
nosy: +berker.peksag
stage:  -> needs patch

___
Python tracker 

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



[issue6294] Improve shutdown exception ignored message

2016-02-27 Thread Martin Panter

Changes by Martin Panter :


--
resolution:  -> duplicate
status: open -> closed
superseder:  -> Broken "Exception ignored in:" message on exceptions in __repr__
versions: +Python 3.5, Python 3.6 -Python 3.2

___
Python tracker 

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



[issue22836] Broken "Exception ignored in:" message on exceptions in __repr__

2016-02-27 Thread Martin Panter

Martin Panter added the comment:

FTR Python 2’s exception report in __del__() is a bit different, here is what 
it now looks like:

>>> o = VeryBroken()
>>> del o
Exception __main__.BrokenStrException:  in  ignored

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



[issue22836] Broken "Exception ignored in:" message on exceptions in __repr__

2016-02-27 Thread Roundup Robot

Roundup Robot added the comment:

New changeset cf70b1204e44 by Martin Panter in branch '3.5':
Issue #22836: Keep exception reports sensible despite errors
https://hg.python.org/cpython/rev/cf70b1204e44

New changeset 2b597e03f7f4 by Martin Panter in branch 'default':
Issue #22836: Merge exception reporting from 3.5
https://hg.python.org/cpython/rev/2b597e03f7f4

--

___
Python tracker 

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



[issue25488] IDLE: Remove '', user_dir, and idlelib from sys.path when added

2016-02-27 Thread Terry J. Reedy

Terry J. Reedy added the comment:

Upload: A listing of console (cross-platform) and icon (Windows-specific) IDLE 
starting methods and the effect on sys.path and current directory.  I believe 
that some of the details of the 'constant' part of sys.path are system 
dependent, but stable across methods for a particular python version.

--
Added file: http://bugs.python.org/file42041/idle-start.txt

___
Python tracker 

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



[issue25488] IDLE: Remove '', user_dir, and idlelib from sys.path when added

2016-02-27 Thread Terry J. Reedy

Terry J. Reedy added the comment:

In private email, eryk sun reports  "/usr/bin/idle3 instead prepends 3 
directories: ['', current_directory_absolute, '/usr/bin']. If I use the -r 
option to run a script, it instead prepends script_directory_relative, '', 
'/usr/bin']. I think these should be [''] and [script_directory_absolute], 
respectively."

Windows does not have idle3.  None of the directories above are needed to run 
IDLE and I believe any could contain masking files.

--

___
Python tracker 

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



[issue26451] CSV documentation doesn't open with an example

2016-02-27 Thread Alex LordThorsen

New submission from Alex LordThorsen:

Had a friend get stuck on the CSV documentation. They didn't know what a CSV 
was (to start with) and couldn't find an example that made sense to them.  they 
went to other sources to figure out how to read CSV files in the end.

I made this patch in the hope that starting out with a very minimal example 
file format followed by an example python read will make landing on the CSV 
docs easier to follow for new programmers.

--
assignee: docs@python
components: Documentation
files: csv_documentation.patch
keywords: patch
messages: 260960
nosy: Alex.LordThorsen, docs@python
priority: normal
severity: normal
status: open
title: CSV documentation doesn't open with an example
versions: Python 3.6
Added file: http://bugs.python.org/file42040/csv_documentation.patch

___
Python tracker 

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



[issue26450] make html fails on OSX

2016-02-27 Thread Martin Panter

Martin Panter added the comment:

Yeah if you want to propose a specific change for the devguide, or even a 
patch, go right ahead :)

--

___
Python tracker 

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



[issue26450] make html fails on OSX

2016-02-27 Thread Martin Panter

Martin Panter added the comment:

The only thing I can think of is checking the PATH environment variable. What 
is it inside the Makefile, and what is it when you run the command manually?

--

___
Python tracker 

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



[issue26450] make html fails on OSX

2016-02-27 Thread Martin Panter

Martin Panter added the comment:

Sorry I didn’t read the last bit of your message where you run sphinx-build 
manually. So I take back my last comment :)

--
status: closed -> open

___
Python tracker 

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



[issue26450] make html fails on OSX

2016-02-27 Thread Martin Panter

Martin Panter added the comment:

I suspect this is not OS X specific. The documentation that you linked says 
“Sphinx is maintained separately and is not included in this tree.”

By your output I suspect you need to install the sphinx-build program. On Arch 
Linux I had to install it myself:

$ pacman -Qo sphinx-build
/usr/bin/sphinx-build is owned by python-sphinx 1.3.4-1
$ pacman -Qi python-sphinx
Name   : python-sphinx
Version: 1.3.4-1
Description: Python3 documentation generator
Architecture   : any
URL: http://sphinx.pocoo.org/

--
nosy: +martin.panter
resolution:  -> not a bug
status: open -> closed

___
Python tracker 

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



[issue26450] make html fails on OSX

2016-02-27 Thread Alex LordThorsen

New submission from Alex LordThorsen:

Did a fresh hg clone of the python 3.6 code base (3.6.0a0) on  OSX 10.10.5 and 
made a modification to a library rst. I went to build my changes and ran

$ make html
sphinx-build -b html -d build/doctrees -D latex_paper_size=  . build/html
make: sphinx-build: No such file or directory
make: *** [build] Error 1

I looked at https://docs.python.org/devguide/documenting.html#building-doc to 
see about what I can do about this failure and didn't see anything OSX 
specific. 

$ sphinx-build -b html . build/html

Works, however.

--
components: Build
messages: 260954
nosy: Alex.Lord
priority: normal
severity: normal
status: open
title: make html fails on OSX
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



[issue22836] Broken "Exception ignored in:" message on exceptions in __repr__

2016-02-27 Thread Roundup Robot

Roundup Robot added the comment:

New changeset fca9f02e10e5 by Martin Panter in branch '2.7':
Issue #22836: Keep exception reports sensible despite errors
https://hg.python.org/cpython/rev/fca9f02e10e5

--
nosy: +python-dev

___
Python tracker 

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



[issue25488] IDLE: Remove '', user_dir, and idlelib from sys.path when added

2016-02-27 Thread Terry J. Reedy

Terry J. Reedy added the comment:

#25507 addresses the tkinter.font problem of Note 2 in the first message.

--
title: IDLE: Remove '' and idlelib from sys.path when added -> IDLE: Remove '', 
user_dir, and idlelib from sys.path when added
versions:  -Python 3.4

___
Python tracker 

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



[issue21042] ctypes.util.find_library() should return full pathname instead of filename in linux

2016-02-27 Thread Berker Peksag

Berker Peksag added the comment:

I don't think we need an entry in whatsnew/3.6.rst for this (we already have 
documented the change in a versionchanged directive and a Misc/NEWS item)

--
nosy: +berker.peksag

___
Python tracker 

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



[issue26436] Add the regex-dna benchmark

2016-02-27 Thread Terry J. Reedy

Terry J. Reedy added the comment:

DNA matching can be done with difflib.  Serious high-volume work should use 
compiled specialized matchers and aligners.

This particular benchmark, explained a bit at 
https://benchmarksgame.alioth.debian.org/u64q/regexdna-description.html#regexdna,
 manipulates and searches standard FASTA format representations of sequences 
with the regex available in each language.  (The site has another Python 
implementation at 
https://benchmarksgame.alioth.debian.org/u64q/program.php?test=regexdna=python3=1.
 It uses unicode strings rather than bytes, and multiprocessing.Pool to run 
re.findall in parallel.)

FASTA uses lowercase a,c,g,t for known bases and at least 11 uppercase letters 
for subsets of bases representing partially known bases.  The third task is to 
expand upper case letters to subsets of lowercase letters.  Since the rules 
requires use of re and one substitution at a time, the 2 Python programs run 
re.sub over the current sequence 11 times.  More idiomatic for Python, and 
probably faster, would be to use seq.replace(old,new) instead.  Perhaps even 
more idiomatic and probably faster still, would be to use str.translate, as in 
this reduced example.

>>> table = {ord('B') : '(c|g|t)', ord('D') : '(a|g|t)'}
>>> 'aBcDg'.translate(table)
'a(c|g|t)c(a|g|t)g'

--

___
Python tracker 

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



[issue25910] Fixing links in documentation

2016-02-27 Thread Martin Panter

Martin Panter added the comment:

BTW it looks like the suspicious.csv file needs updating to compensate for this 
change:

http://buildbot.python.org/all/builders/Docs%203.5/builds/654/steps/suspicious/logs/stdio

WARNING: [using/unix:31] ":Packaging" found in 
"https://en.opensuse.org/Portal:Packaging;
WARNING: Found 1/297 unused rules:
using/unix,,:Packaging,http://en.opensuse.org/Portal:Packaging

--
nosy: +martin.panter

___
Python tracker 

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



[issue21042] ctypes.util.find_library() should return full pathname instead of filename in linux

2016-02-27 Thread Martin Panter

Martin Panter added the comment:

Thanks, this looks pretty good to me. I just need to remember to write a What’s 
New entry.

--

___
Python tracker 

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



[issue26449] Tutorial on Python Scopes and Namespaces uses confusing 'read-only' terminology

2016-02-27 Thread Ezio Melotti

Ezio Melotti added the comment:

I agree with Raymond.  IMHO the term "read-only" does a good job at conveying 
the fact that you can still access/read the value of the variable but you can't 
assign to it.  "read-only" is about /what/ you can do with the variable, even 
though it would also be good to clarify /why/ you can only read.

--
nosy: +ezio.melotti

___
Python tracker 

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



[issue26449] Tutorial on Python Scopes and Namespaces uses confusing 'read-only' terminology

2016-02-27 Thread Raymond Hettinger

Raymond Hettinger added the comment:

FWIW, the learners in my Python classes seem to find the words "read-only" to 
be helpful.  Also, I think "not visible" conveys the wrong mental model 
("shadowed" being a little more accurate).  

I also disagree with saying that "variables are never read-only". In fact, 
unless declared "nonlocal", the namespace for the nested scope can't be written 
to; likewise, we also have dict proxies in classes that are specifically 
designed to be read-only; further, there are many read-only attributes in 
Python.

The current paragraph is succinct and accurate.   That said, there is no doubt 
that creative people can find ways to misread it, so I think  there is room to 
add an extra paragraph that elaborates on the rules:

1) variable *lookups* will search from locals to nested scopes to globals to 
builtins, stopping at the first match or raising NameError if not found; and, 

2) variable *writes* always go into locals unless explicitly declared as being 
in another namespace with "nonlocal" or "global".

The docs can't smooth this over by changing a single misinterpreted word.  One 
way or another, either in the tutorial or in a FAQ, users need to learn why x=1 
doesn't write to an enclosing scope without a namespace declaration and why 
self.x+=1 can read a class variable, increment the value, and then write to an 
instance variable.  Learning this is fundamental to understanding the language 
and it can't be glossed over by saying that the word "read-only" was confusing. 
 Everyone gets what "read-only" means; instead, the challenge is to grapple 
with what the rules are and why the language behaves this way.

--
nosy: +rhettinger

___
Python tracker 

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



[issue15663] Investigate providing Tcl/Tk 8.6 with OS X installers

2016-02-27 Thread Aivar Annamaa

Aivar Annamaa added the comment:

install_name_tool can specify relative paths (see eg. 
https://wincent.com/wiki/@executable_path,_@load_path_and_@rpath). Therefore 
you don't need it in users' systems.

I've used it successfully for bundling Python 3.5 and Tk 8.6 with my IDE, see 
https://bitbucket.org/plas/thonny/src/master/packaging
/mac/build_requirements_old.sh and 
https://bitbucket.org/plas/thonny/src/master/packaging/mac/update_links.sh

--
nosy: +Aivar.Annamaa

___
Python tracker 

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



[issue26393] random.shuffled

2016-02-27 Thread Raymond Hettinger

Raymond Hettinger added the comment:

I concur with Terry.

--
assignee:  -> rhettinger
resolution:  -> rejected
status: open -> closed

___
Python tracker 

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



[issue26436] Add the regex-dna benchmark

2016-02-27 Thread Antoine Pitrou

Antoine Pitrou added the comment:

I would add another kind of question: is it stressing something useful that 
isn't already stressed by the two other regex benchmarks we already have?

Given that it seems built around a highly-specialized use case (DNA matching?) 
and we don't even know if regular expressions are actually the tool of choice 
in the field (unless someone here is a specialist), I'm rather skeptical.

(in general, everything coming the "Computer Language Benchmarks Game" should 
be taken with a grain of salt IMHO: it's mostly people wanting to play writing 
toy programs)

--

___
Python tracker 

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



[issue26436] Add the regex-dna benchmark

2016-02-27 Thread Brett Cannon

Brett Cannon added the comment:

Terry's right about what I meant; is the code of such quality that you would 
let it into the stdlib?

As for execution time, I would vote for increasing the input size to take 1 
second as it's just going to get faster and faster just  from CPU improvements 
alone.

--

___
Python tracker 

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



[issue26285] Garbage collection of unused input sections from CPython binaries

2016-02-27 Thread Alecsandru Patrascu

Changes by Alecsandru Patrascu :


--
nosy: +gregory.p.smith, lemburg, scoder, steve.dower, zach.ware

___
Python tracker 

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



[issue26359] CPython build options for out-of-the box performance

2016-02-27 Thread Alecsandru Patrascu

Changes by Alecsandru Patrascu :


--
nosy: +brett.cannon, gregory.p.smith, lemburg, pitrou, r.david.murray, scoder, 
skrah, steve.dower, zach.ware

___
Python tracker 

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



[issue24663] ast.literal_eval does not handle empty set literals

2016-02-27 Thread yota moteuchi

yota moteuchi added the comment:

Well, I would disagree with R. David Murray on this.

literal_eval() is meant to safely parse literal pythons "containers" structures.

{1, 2, 3} is a valid literal set(), why would an empty one not be parse-able as 
well. I can not predict, when I dump the structure with repr(), if the set() 
will be empty or not.

--
nosy: +yota moteuchi

___
Python tracker 

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



[issue26448] dis.findlabels ignores EXTENDED_ARG

2016-02-27 Thread Eric Fahlgren

Eric Fahlgren added the comment:

Lookin' good so far.  How about we try it on all the opcodes that have 
arguments?

See attached example for which I can see two obvious improvements:
1) It could be improved by taking apart that "args" list and using it to 
synthesize "sample_code" rather than having to hand duplicate the values in two 
places, albeit with different byte order.
2) Likewise, my hard-coded "offsets" table is pretty awful. :)

Also, is there already a test for the dis module in which you could just add 
this as a case?

--
Added file: http://bugs.python.org/file42039/testfindlabels.py

___
Python tracker 

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



[issue26252] Add an example to importlib docs on setting up an importer

2016-02-27 Thread Anish Shah

Changes by Anish Shah :


--
nosy:  -anish.shah

___
Python tracker 

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



[issue26269] zipfile should call lstat instead of stat if available

2016-02-27 Thread Anish Shah

Changes by Anish Shah :


--
nosy:  -anish.shah

___
Python tracker 

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



[issue26283] zipfile can not handle the path build by os.path.join()

2016-02-27 Thread Anish Shah

Changes by Anish Shah :


--
nosy:  -anish.shah

___
Python tracker 

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



[issue26442] Doc refers to xmlrpc.client but means xmlrpc.server

2016-02-27 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
versions:  -Python 3.2, Python 3.3, Python 3.4

___
Python tracker 

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



[issue26448] dis.findlabels ignores EXTENDED_ARG

2016-02-27 Thread Barun Parruck

Barun Parruck added the comment:

Sorry, the previous file had a bug.

--
Added file: http://bugs.python.org/file42038/testfindlabels2.py

___
Python tracker 

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



[issue26436] Add the regex-dna benchmark

2016-02-27 Thread Terry J. Reedy

Terry J. Reedy added the comment:

I believe Brett is asking whether the code looks like the sort of Python code 
that one of us might write, as opposed to 'language X in Python'.  In my quick 
perusal, As far as I looked, I would say yes, except for using floats and while 
instead of int and for because the former are supposedly faster.  (See the loop 
in the middle of random_fasta.)  So do we want a benchmark micro-optimized for 
CSF's system or written 'normally' (with for, int, and range). I did not notice 
any PEP 8 style violations.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue26420] IDLE for Python 3.5.1 for x64 Windows exits when pasted a string with non-BMP characters

2016-02-27 Thread Terry J. Reedy

Terry J. Reedy added the comment:

If you start IDLE from the console with 'python -m idlelib' you should see a 
TclError message when pasting.  This is a known limitation of tcl/tk.  Printing 
gives a traceback in IDLE's shell.
>>> print('\U00020BB7')
Traceback (most recent call last):
  File "", line 1, in 
print('\U00020BB7')
  File "C:\Programs\Python35\lib\idlelib\PyShell.py", line 1344, in write
return self.shell.write(s, self.tags)
UnicodeEncodeError: 'UCS-2' codec can't encode character '\U00020bb7' in 
position 0: Non-BMP character not supported in Tk

--
nosy: +terry.reedy
resolution:  -> duplicate
stage:  -> resolved
status: open -> closed
superseder:  -> IDLE crashes when pasting non-BMP unicode char on Py3
title: IDEL for Python 3.5.1 for x64 Windows exits when pasted a string with 
non-BMP characters -> IDLE for Python 3.5.1 for x64 Windows exits when pasted a 
string with non-BMP characters

___
Python tracker 

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



[issue26407] csv.writer.writerows masks exceptions from __iter__

2016-02-27 Thread Terry J. Reedy

Terry J. Reedy added the comment:

The TypeError is correct.  You passed a non-iterable.  I agree that adding 
information, *if possible*, when 'non-iterable' is determined by an exception 
being raised, would be nice.  I don't know how easy this would be.

--
nosy: +terry.reedy
stage:  -> test needed
type: behavior -> enhancement
versions: +Python 3.6

___
Python tracker 

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



[issue26404] socketserver context manager

2016-02-27 Thread Terry J. Reedy

Terry J. Reedy added the comment:

This seems like an appropriate enhancement.  I notice that the serve_forever 
examples did not previously have server_close().  Was this an oversight or will 
the server_close in __exit__ just be a no-op?

--
nosy: +terry.reedy

___
Python tracker 

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



[issue26394] Have argparse provide ability to require a fallback value be present

2016-02-27 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



[issue26393] random.shuffled

2016-02-27 Thread Terry J. Reedy

Terry J. Reedy added the comment:

It is against our policy to wrap random half-line expressions as new function.  
Doing so would bloat Python until it became unusable.  This should be rejected.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue26449] Tutorial on Python Scopes and Namespaces uses confusing 'read-only' terminology

2016-02-27 Thread Martijn Pieters

Changes by Martijn Pieters :


--
assignee:  -> docs@python
components: +Documentation
nosy: +docs@python

___
Python tracker 

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



[issue26449] Tutorial on Python Scopes and Namespaces uses confusing 'read-only' terminology

2016-02-27 Thread Martijn Pieters

New submission from Martijn Pieters:

>From the 9.2. Python Scopes and Namespace section:

> If a name is declared global, then all references and assignments go directly 
> to the middle scope containing the module’s global names. To rebind variables 
> found outside of the innermost scope, the nonlocal statement can be used; if 
> not declared nonlocal, those variable are read-only (an attempt to write to 
> such a variable will simply create a new local variable in the innermost 
> scope, leaving the identically named outer variable unchanged).

This terminology is extremely confusing to newcomers; see 
https://stackoverflow.com/questions/35667757/read-only-namespace-in-python for 
an example. Variables are never read-only. The parent scope name simply is *not 
visible*, which is an entirely different concept. Can this section be 
re-written to not use the term 'read-only'?

--
messages: 260933
nosy: mjpieters
priority: normal
severity: normal
status: open
title: Tutorial on Python Scopes and Namespaces uses confusing 'read-only' 
terminology

___
Python tracker 

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



[issue26436] Add the regex-dna benchmark

2016-02-27 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

> I assume the code looks idiomatic to you?

Sorry, I have not understood your question. Could you please reformulate?

The performance of all Python versions is rough the same. 2.7 is about 8% 
slower than 3.2 and 3.3, 3.4-default are about 3-4% slower than 3.2 and 3.3.

I have taken input data size such that the regex-dna benchmark runs rough the 
same time as the slowest regex benchmark regex-compile (0.7 sec per iteration 
on my computer, about a minute with default options). This is 1/50 of the size 
used in The Computer Language Benchmarks Game.

Since the benchmark generates input data, its size can easily be changed. 
Needed only update control sums.

--

___
Python tracker 

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



[issue26448] dis.findlabels ignores EXTENDED_ARG

2016-02-27 Thread Barun Parruck

Barun Parruck added the comment:

Four test cases have been included in the unittests, using the module unittest. 
One is the original one you gave me, the others are some that I played around 
with it, and thought would be useful to include.

I would love some code reviews at this point!

--
Added file: http://bugs.python.org/file42037/testfindlabels.py

___
Python tracker 

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



[issue26415] Out of memory, trying to parse a 35MB dict

2016-02-27 Thread Serhiy Storchaka

Serhiy Storchaka added the comment:

I though this might be tokenizer issue, but this is just large memory 
consumption for AST tree. Simpler example:

./python -c 'import ast; ast.parse("0,"*100, mode="eval")'

It takes over 450MB of memory on 32-bit system, over 450 bytes per tuple item. 
Increase the multiplier to 1000 leads to swapping and failing with 
MemoryError.

Of course it would be nice to decrease memory consumption, but this looks 
rather as new feature.

--
assignee: serhiy.storchaka -> 
versions: +Python 3.6 -Python 2.7, Python 3.4

___
Python tracker 

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