[issue13153] IDLE crash with unicode bigger than 0xFFFF

2011-10-14 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

[Yes, indexing will still be O(1), though I personally consider that less 
important than most make it to be. Consistency across platforms and total time 
and space performance of typical apps should be the concern. There is ongoing 
work on improving the new implementation. Some operations already take less 
space and run faster.]

The traceback may very well be helpful. It implies that copying a supplemental 
char does not produce proper utf-8 encoded bytes. Or if it does, tkinter (or tk 
underneath it) does not recognize them. But then the problem should be the 
initial byte, not the continuation bytes, which are the same for all chars and 
which all have 10 for their two high order bits. See
https://secure.wikimedia.org/wikipedia/en/wiki/Utf-8
for a fuller explanation.

Line 1009 is the definition of Misc.mainloop(). I believe self.tk represents 
the embedded tcl interpreter, which is a black box from Python's viewpoint. 
Perhaps we should wrap the call with

try:
  self.tk.mainloop(n)
except Exception as e:
  

This should catch any miscellaneous crashes which are not otherwise caught and 
maybe turn the crash issues into bug reports -- the same way that running from 
the command line did. (It will still be good to catch what we can at error 
sites and give better, more specific messages.) (What I am not familiar with is 
how the command line interpreter might turn a tcl error into a python exception 
and why IDLE does not.)

When I copy '𐒢' and paste into the command line interpreter or Notepad++, I get 
'??'. I am guessing that ?? represent a surrogate pair and that Windows 
separately encodes each. The result would be 'illegal' utf-8 with an illegal 
continuation chars. An application can choose to decode the 'illegal' utf-8 -- 
or not. Python can when "errors='surrogate_escape" (or something like that) is 
specified. It might be possible to access the raw undecoded bytes of the 
clipboard with the third party pythonwin module. I do not know if there is 
anyway to do so with tk.

I wonder if tcl is calling back to Python for decoding and whether there was a 
change in the default for errors or the callback specification that would 
explain a change from 2.7 to 3.2.

Ezio, do you know anything about these speculations?

--

___
Python tracker 

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



[issue13185] Why does Python interpreter care about curvy quotes in comments?

2011-10-14 Thread Phillip Feldman

Changes by Phillip Feldman :


--
versions: +Python 2.7

___
Python tracker 

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



[issue13185] Why does Python interpreter care about curvy quotes in comments?

2011-10-14 Thread Phillip Feldman

New submission from Phillip Feldman :

When I try to run a Python script that contains curvy quotes inside comments, 
the interpreter gets upset:

SyntaxError: Non-ASCII character '\x92' in file ... on line 20198, but no 
encoding declared; see http://www.python.org/peps/pep-0263.html for details

Given that the quotes are appearing only in comments, why does the interpreter 
care about them?  Why should it be doing anything at all with comments other 
than stripping them off?

--
messages: 145583
nosy: Phillip.M.Feldman
priority: normal
severity: normal
status: open
title: Why does Python interpreter care about curvy quotes in comments?

___
Python tracker 

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



[issue13184] Multi-layered symlinks cause runtime error. sys.path is malformed.

2011-10-14 Thread Jason Howlett

New submission from Jason Howlett :

This error is observed in Python 2.7.2.

Steps to recreate problem:

1) Create directory ~/pytest.
2) Untar Python 2.7.2 sources into ~/pytest
3) configure, build, and install with --prefix=~/pytest/pyinstall
4) mkdir -p ~/pytest/other/bin
5) cd ~/pytest/other/bin
6) ln -s ../../pyinstall/bin/python
7) cd ~/pytest
8) ln -s other/bin bin
9) bin/python

This will result in the following exception:
Traceback (most recent call last):
  File "/home/jason/pytest/bin/../../pyinstall/lib/python2.7/site.py", line 
564, in 
main()
  File "/home/jason/pytest/bin/../../pyinstall/lib/python2.7/site.py", line 
546, in main
known_paths = addusersitepackages(known_paths)
  File "/home/jason/pytest/bin/../../pyinstall/lib/python2.7/site.py", line 
279, in addusersitepackages
user_site = getusersitepackages()
  File "/home/jason/pytest/bin/../../pyinstall/lib/python2.7/site.py", line 
254, in getusersitepackages
user_base = getuserbase() # this will also set USER_BASE
  File "/home/jason/pytest/bin/../../pyinstall/lib/python2.7/site.py", line 
243, in getuserbase
from sysconfig import get_config_var
ImportError: No module named sysconfig

Placing 'print sys.path' on line 242 of site.py prints out something like this:

['/home/jason/pyinstall/lib/python27.zip', 
'/home/jason/pyinstall/lib/python2.7', 
'/home/jason/pyinstall/lib/python2.7/plat-linux2', 
'/home/jason/pyinstall/lib/python2.7/lib-tk', 
'/home/jason/pyinstall/lib/python2.7/lib-old', 
'/home/jason/pyinstall/lib/python2.7/lib-dynload']

Notice that the root directory is /home/jason/pyinstall instead of the correct 
value /home/jason/pytest/pyinstall.

Now, on line 65 of site.py, add import sysconfig. For some reason this works at 
this point in site.py, but not down on line 243.

In sysconfig.py, at line 94, add the following:
print 'SYSCONFIG:', sys.exec_prefix, _EXEC_PREFIX

This will print the following:
SYSCONFIG: /home/jason/pytest/bin/../../pyinstall /home/jason/pyinstall

Line 93 of sysconfig.py is a call to normpath that collapses the path. The root 
of this problem is that the value of sys.exec_prefix is not correct. The value 
it has will work fine if ls'ing it in a shell as it handles the symlink 
/home/jason/pytest/bin properly. Path calculations internal to python, however, 
do not end up with the correct results.

I believe the fix to this problem is to modify Modules/getpath.c, starting at 
line 488, and instead of looking only for a symlink in the python executable, 
also look for a link in any of the path elements leading up to the executable. 
Detecting and expanding these out should result, in this example, with 
sys.exec_prefix being /home/jason/pytest/pyinstall and the correct behavior in 
sysconfig, site, etc.

--
components: Interpreter Core
messages: 145582
nosy: Jason.Howlett
priority: normal
severity: normal
status: open
title: Multi-layered symlinks cause runtime error.  sys.path is malformed.
type: crash
versions: Python 2.7

___
Python tracker 

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



[issue13153] IDLE crash with unicode bigger than 0xFFFF

2011-10-14 Thread João Bernardo

João Bernardo  added the comment:

Just to complete my monologue:
Here's the traceback from running IDLE in cmd line.


C:\Python32\Lib\idlelib>python -i idle.py
Traceback (most recent call last):
  File "idle.py", line 11, in 
idlelib.PyShell.main()
  File "C:\Python32\Lib\idlelib\PyShell.py", line 1429, in main
root.mainloop()
  File "C:\Python32\Lib\tkinter\__init__.py", line 1009, in mainloop
self.tk.mainloop(n)
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 1-2: invalid 
continuation byte


Not much meaningful but is better than nothing... Looks like some traceback is 
missing, and this one points to tkinter.

--

___
Python tracker 

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



[issue13153] IDLE crash with unicode bigger than 0xFFFF

2011-10-14 Thread João Bernardo

João Bernardo  added the comment:

Just for comparison, on Python 2.7.1 (x32 on Windows 7) it's possible to paste 
the char (but can't use it) and a nice error is given. 

>>> u'𐒢'
Unsupported characters in input

So the problem was partially solved but something might have happened with the 
3.x port...

Searching on both source codes, I can see the following block was commented on 
Python3.2 but not on Python2.7 (Maybe someone removed someone else's bug fix?) 
and an `assert` was added.

#--- Lines 605 to 613 of PyShell.py

assert isinstance(source, str)
#   v-- on Python2.7 it is types.UnicodeType instead
#if isinstance(source, str):
#from idlelib import IOBinding
#try:
#source = source.encode(IOBinding.encoding)
#except UnicodeError:
#self.tkconsole.resetoutput()
#self.write("Unsupported characters in input\n")
#return

I uncommented those lines, removed the `assert` and deleted __pycache__ for 
fresh bytecode but the error keeps happening.

This function `runsource()` is only called after the return key is pressed so 
the bug was introduced on another part of the program.

I'll search further but it's hard to do that without traceback of the error.

(Maybe `runit()` is the problem because it seems to build the line and call 
`runsource(line)`)

--
PS: @Terry Reedy
That looks nice to have different lengths for chars but what will be the impact 
on performance? Indexing will still be in constant time?

--

___
Python tracker 

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



[issue12344] Add **kwargs to get_reinitialized_command

2011-10-14 Thread Thomas Holmes

Thomas Holmes  added the comment:

It's quite alright. Thanks for finishing it up. I realize I ended up a by out 
of my depth with regards to packaging's internals and the nuance involved in 
this fix. Thanks for all the help.

--

___
Python tracker 

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



[issue13179] IDLE uses common tkinter variables across all editor windows

2011-10-14 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

This is more of a feature request than a bug report, in that the behavior 
appear intentional. But that is a moot point in that new IDLE features do not 
have to wait for a new release. The proposed new behavior seems plausibly 
better. I just wonder if anything in flist.vars *should* carry over (maybe as a 
copy) to all edit windows, but I do not know its contents.

Also, I can imagine that someone who knows about (I did not before) and likes 
the 'code context' option (I might start using it) would want it to be always 
on once turned on. That suggests that it should be added to the configure 
dialog before being made local with this patch. I might feel the same about at 
least some of the other vars also.

--
nosy: +terry.reedy
type: behavior -> feature request
versions: +Python 3.3 -Python 2.6, Python 3.1

___
Python tracker 

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



[issue13174] test_os failures on Fedora 15: listxattr() returns ['security.selinux']

2011-10-14 Thread Terry J. Reedy

Changes by Terry J. Reedy :


--
stage:  -> patch review
type:  -> behavior

___
Python tracker 

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



[issue13171] Bug in file.read(), can access unknown data.

2011-10-14 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

This issue has come up enough (tracker and python-list) that I think adding a 
mild adaptation of the C standard paragraph might be a good idea. Changing to a 
doc issue.

--
assignee:  -> docs@python
components: +Documentation -IO, Library (Lib), Windows
nosy: +docs@python, terry.reedy

___
Python tracker 

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



[issue13168] Python 2.6 having trouble finding modules when invoked via a symlink

2011-10-14 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Try upgrading to 2.6.6, 2.6.7 or 2.7.2. 

In any case, 2.6 is in security-fix only mode, so unless you have a problem 
with the most recent releases (2.7.2 or 3.2.2) this issue should be closed as 
out-of-date.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue13163] `port` and `host` are confused in `_get_socket

2011-10-14 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

My understanding is that an undocumented internal methods has two bugs that 
cancel, so that correct calls work correctly -- but tracebacks do not. I think 
this should be fixed, especially given a working patch.

Optionally add a doc string, which is how we usually (often, when someone gets 
around to it) do doc internal functions. Perhaps include the current comment 
(which I do not understand).

If you, Victor, are not in the contributors file, add a one-line patch for that.

Optionally (but it would certainly be good learning practice) add NEWS item. 
Something like
"Issue 13163: fix smtplib.SMTP._get_socket so that tracebacks correctly 
identity host and port arguments.
However, this is best done when someone is ready to apply and push the patch, 
as frequent changes to NEWS make patches stale.

--
nosy: +terry.reedy
type:  -> behavior

___
Python tracker 

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



[issue4431] Distutils MSVC doesn't create manifest file

2011-10-14 Thread Mark Hammond

Mark Hammond  added the comment:

My experience is that for VS2008 at least, the /MANIFESTFILE: option seems to 
be ignored if there is nothing to put in the manifest, and this tends to be 
true if you use a static CRT instead of the DLL based one (ie, if you use /MT)

Issue 7833 has a patch designed to both (a) remove the manifest entirely if the 
only assembly reference is to the CRT and (b) give the setup.py author finer 
control over this behaviour.

--

___
Python tracker 

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



[issue13153] IDLE crash with unicode bigger than 0xFFFF

2011-10-14 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

The current Windows build used 2-byte unicode chars because that is what 
Windows does. In 3.3, all builds will use a new unicode implementation that 
uses 1,2,or4 bytes as needed. But I suspect we will still have the paste 
problem unless we can somehow bypass the tk limitation.

Printing a Python string to the screen does not seem to involve conversion to a 
tk string. Or else tk blindly copies surrogate pairs to Windows even though it 
cannot create them.

In any case, true window-closing crashes (as opposed to an error traceback) are 
obnoxious bugs that we try to fix if possible. I verified this on my 64-bit Win 
7 system. Thanks for the report. Feel free to look into the code if you can.

--
nosy: +terry.reedy
type: behavior -> crash

___
Python tracker 

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



[issue13153] IDLE crash with unicode bigger than 0xFFFF

2011-10-14 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti
type:  -> behavior

___
Python tracker 

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



[issue13152] textwrap: support custom tabsize

2011-10-14 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

I am a bit surprised this was not part of the original design.
'Tabsize' make 'expand_tabs' redundant and tabsize==0 could be interpreted as 
expand_tabs==False. On the other hand, the meaning of 'expand_tabs' could be 
expanded to include the tabsize. I am almost tempted to suggest making 
expand_tabs > 1 be interpreted as tabsize and make expand_tabs==True(1, the 
current default) be interpreted as expand_tabs==8 (the new default) for 
back_compatibility.

Patch as is has new tests and looks good on first reading.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue13178] Need tests for Unicode handling in install_distinfo and install_data

2011-10-14 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

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



[issue13144] Global Module Index link in the offline documentation is incorrect

2011-10-14 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti
versions:  -Python 2.6

___
Python tracker 

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



[issue12967] IDLE RPC Proxy for standard IO streams lacks 'errors' attribute

2011-10-14 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +ezio.melotti

___
Python tracker 

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



[issue13149] optimization for append-only StringIO

2011-10-14 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Like parts of the Python test suite, I use StringIO to capture print/write 
output for testing in an output...output/getvalue/reset(seek(0),truncate(0)) 
cycle. While this enhancement would not currently affect me (as I only do a few 
prints each cycle), I can easily imagine other cases where it would.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue13177] Avoid chained exceptions in lru_cache

2011-10-14 Thread Ezio Melotti

Ezio Melotti  added the comment:

Canceling the chained exception might work as a workaround, but it requires yet 
another try/except and it's not very elegant in my opinion.

Raymond, about __missing__ it shouldn't be a problem here, because we are using 
"in" to look in the cache, and the cache is either a dict or an OrderedDict and 
they don't use __missing__.

I also did some crude benchmark using strings (see attached file):
always hit
try: 0.3375518321990967
in : 0.43109583854675293
always miss
try: 2.7987680435180664
in : 0.3211240768432617
5 hit, 5 miss
try: 18.37925887107849
in : 5.305108070373535
9 hit, 1 miss
try: 8.38001799583435
in : 6.524656057357788

Of course this will change if the hash() function gets more expensive, or if 
the ratio hits:miss is different.

--
Added file: http://bugs.python.org/file23412/issue13177-bench.py

___
Python tracker 

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



[issue13139] multiprocessing.map skips finally blocks

2011-10-14 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

One might ask why an Exception in one process kills all in the Pool. Perhaps 
multiprocessing emulates threading too closely.
Perhaps it is assumed that if one is bad, all are. Jesse?

--
nosy: +jnoller, terry.reedy
versions:  -Python 2.6

___
Python tracker 

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



[issue13131] FD leak in urllib2

2011-10-14 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Can you test both the leak and fix (if needed) on 3.2? 
(I am on Win7).

--
nosy: +terry.reedy

___
Python tracker 

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



[issue13127] xml.dom.Attr.name is not labeled as read-only

2011-10-14 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

The docs are unchanged in 3.2. I presume the behavior is also.

--
nosy: +terry.reedy
versions: +Python 3.2, Python 3.3

___
Python tracker 

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



[issue13052] IDLE: replace ending with '\' causes crash

2011-10-14 Thread Ezio Melotti

Ezio Melotti  added the comment:

Defining the desired behavior is a good place where to start.  Next it would be 
good to have tests that reflect the desired behavior, and eventually make them 
pass with a proper patch.

Currently IDLE seems to understand \n, \t, etc. in the "Replace with" field, 
but not in the "Find" field.  That means that it's possible to easily replace 
e.g. 4 spaces with a \t, but not the other way around.
This works regardless of the "Regular expression" checkbox.

When "Regular expression" is checked, backreferences like \1 also work (if used 
correctly).

I think these behaviors are fine and should be preserved.  For the non-regex 
mode, re.escape() could be used if the \n, \t, etc. still work, but I think 
that for the regex mode the right way to go is to catch regex errors.  This 
will protect against wrong backreferences and trailing \, without altering the 
meaning of the regex.

We could also support \n, \t, etc. in the "Find" box, but that's a separate 
issue.

Regarding the print(input()) and the other example, they all seem to work fine 
here with 3.2/XP.

--
stage: needs patch -> test needed

___
Python tracker 

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



[issue12967] IDLE RPC Proxy for standard IO streams lacks 'errors' attribute

2011-10-14 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Thank you for redirecting this issue. The goal should be to make the proxies 
completely transparent. They mostly are, but occasional issues arise when they 
are not. Sometimes the source of a problem is not clear. I wonder, for 
instance, whether the non-function in IDLE of

>>> print(input())
abc\
abc\

has anything to do with the bidirectional communication or is entirely internal 
to IDLE.

--
nosy: +terry.reedy

___
Python tracker 

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



[issue13052] IDLE: replace ending with '\' causes crash

2011-10-14 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

IDLE is sufficiently undocumented that I think we may, *if necessary*, treat 
the details of 'expected behavior' as undefined, or look to other programs for 
guidance. Certainly, 'crash' is unexpected and undesired ;-).

Without "[] Regular expression" checked, I expect a simple 'normal mode' "find 
the literal string and replace with literal string" behavior. This is how 
Notepad and Notepad++ work. Neither has any problem with trailing '\'. The main 
'special chars' I noticed are those normally significant to dialogs: the [Tab] 
key advances focus, [Enter] key executes the currently highlighted command. 
(The other two programs start with [Find] rather than [Replace] selected, but 
that is a minor and visually noticeable detail.) ^C and ^V work as expected in 
the entry boxes, other control chars beep.

In this mode, it is an implementation detail that the re module is used, and it 
should be transparent that it is. So 'backreferences' are meaningless. But in 
regular expression mode, they should act as an experienced re user would 
expect. (What that is, I an not sure, as I am not such ;-).

Notepad++ separates 'Regular expression' from the other options and has a boxed 
three-button radio group

|-Search mode-| 
| () Normal   |
| () Extended (\n, \r, \t, \0, \x...) |
| () Regular expression   |
|-|

These amount to treating the find/replace entries as uninterpreted string 
literals (as with input()*), cooked \-interpreted string literals, and as (raw 
literal) relational expressions. We could consider Extended mode as a new 
feature.

* While raw string literals do not allow training '\', the input function does 
(in the standard interpreter window)

>>> print(input())
abc\
abc\

However, this does *not* work in IDLE 3.2.2, Win 7:

>>> print(input())
abd\  [hit Enter here]
  [which IDLE echoes here]
  [must Enter again]
  [which IDLE echoes again]
>>>   [to get new prompt]
>>> x=input()
abc\
 

>>> x
''

Entering "a\bc" is also messed up:

>>> x=input()
a\bc

>>> x
''
>>> x=input()
a\bc
>>> x
'a\\bc'

The difference between the two above involves the IDLE history mechanism, which 
(wrongly, in my view) treats response to input() as part of the statement.

I wonder if this is related to the current bug. Does the replace dialog use 
input()? Or is input entirely handled by tk, and should I open another report?

Ezio's other point:
'''
m = prog.match(chars, col)
if not prog:
return False
...
I think that "if not prog" in the snippet I pasted should be "if not m".  
Pattern objects are always True (I assume prog is always a pattern object).'''

I would guess that you are correct and this should be fixed also.

--

___
Python tracker 

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



[issue12405] packaging does not record/remove directories it creates

2011-10-14 Thread Vinay Sajip

Vinay Sajip  added the comment:

s/dependencies between dependencies/dependencies between distributions/

--

___
Python tracker 

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



[issue12405] packaging does not record/remove directories it creates

2011-10-14 Thread Vinay Sajip

Vinay Sajip  added the comment:

> If one project creates a/b/thing and another project uses
> a/b/otherthing, then the directories would be recorded in the first
> project’s RECORD, but they should be removed only when both projects
> are removed.

I'm not sure what you mean by "using". AFAIK, each distribution's files 
(recorded in RECORD) would be unique to that distribution (else distros like 
Debian will have problems, since files are owned by one package and one package 
only).

I think all that is needed is as follows:

1. Record any directories that are created in RECORD, ideally bottom-up.

2. On uninstallation, remove all .pyc/.pyo files and __pycache__ directories, 
and remove all directories named in RECORD, unless they are non-empty (once 
.pyc/.pyo and __pycache__ are removed).

If you are talking about dependencies between dependencies, I still don't see 
what your point is. IIUC, if distA depends on distB, distA's RECORD will 
contain all files which were installed as part of the installation of distA, 
and likewise for distB.

--

___
Python tracker 

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



[issue11715] Building Python on multiarch Debian and Ubuntu

2011-10-14 Thread Ross Lagerwall

Ross Lagerwall  added the comment:

I see this requires dpkg-architecture which isn't always available. While it 
isn't hard to install it, it isn't very clear that this is the cause of the nis 
and crypt modules failing to build on a fresh install of 11.10.

What would be nice is if there were some way of determining this information 
without dpkg-architecture such as reading it from 
/etc/ld.so.conf.d/x86_64-linux-gnu.conf.

--
nosy: +rosslagerwall

___
Python tracker 

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



[issue13177] Avoid chained exceptions in lru_cache

2011-10-14 Thread Eric Snow

Eric Snow  added the comment:

Could you just cancel the chained exception?

   >>> try: {}["asdf"]
   ... except KeyError:
   ...   try: raise Exception()
   ...   except Exception as x:
   ... x.__cause__ = None
   ... x.__context__ = None
   ... x.__traceback__ = None
   ... raise x
   ... 
   Traceback (most recent call last):
 File "", line 8, in 
   Exception

in contrast to:

   >>> try: {}["asdf"]
   ... except KeyError:
   ...   try: raise e
   ...   except Exception as x: 
   ... raise x
   ... 
   Traceback (most recent call last):
 File "", line 1, in 
   KeyError: 'asdf'
   
   During handling of the above exception, another exception occurred:
   
   Traceback (most recent call last):
 File "", line 5, in 
 File "", line 3, in 
 File "", line 8, in 
   Exception

--
nosy: +eric.snow

___
Python tracker 

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



[issue13052] IDLE: replace ending with '\' causes crash

2011-10-14 Thread Roger Serwy

Roger Serwy  added the comment:

I don't have the beep problem you describe under Linux using Python 3.2 
(r32:88445, Mar 25 2011, 19:56:22). That may be a platform-specific bug.

Here's a patch to use re.escape instead. 

A minor side effect of using re.escape is that it is not possible to use \n 
itself in the replace string. It gets escaped as \\n.

--
Added file: http://bugs.python.org/file23411/patch13052_re.diff

___
Python tracker 

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



[issue13052] IDLE: replace ending with '\' causes crash

2011-10-14 Thread Ezio Melotti

Ezio Melotti  added the comment:

Thanks for the patch.

This seems to fix the problem with the trailing \, but not the other issues.  
As I mentioned in my previous message I think re.escape might be a better 
solution.
I also wonder if there are tests for this, and how difficult would be to add 
them if they are missing.

--

___
Python tracker 

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



[issue9150] IDLE should not save trailing whitespace after strip trailing whitespace has been used

2011-10-14 Thread Roger Serwy

Changes by Roger Serwy :


--
nosy: +serwy

___
Python tracker 

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



[issue13183] pdb skips frames after hitting a breakpoint and running step

2011-10-14 Thread Xavier de Gaye

Changes by Xavier de Gaye :


--
type:  -> behavior

___
Python tracker 

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



[issue13183] pdb skips frames after hitting a breakpoint and running step

2011-10-14 Thread Xavier de Gaye

New submission from Xavier de Gaye :

Pdb skips frames after hitting a breakpoint and running step commands
that walk back the frame stack.

Run the following two tests with the two files named foo.py and bar.py:

===   foo.py   
from bar import bar

def foo():
bar()

def nope():
pass

def foobar():
foo()
nope()

foobar()

===   bar.py   
def bar():
print('1')

===   test_1   
$ python3 --version
Python 3.2

$ python3 -m pdb foo.py
> /path/to/foo.py(1)()
-> from bar import bar
(Pdb) from bar import bar
(Pdb) break bar
Breakpoint 1 at /path/to/bar.py:1
(Pdb) continue
> /path/to/bar.py(2)bar()
-> print('1')
(Pdb) step
1
--Return--
> /path/to/bar.py(2)bar()->None
-> print('1')
(Pdb) step
--Call--
> /path/to/foo.py(6)nope()
-> def nope():
(Pdb)

===   test_2   
$ python3 -m pdb foo.py
> /path/to/foo.py(1)()
-> from bar import bar
(Pdb) break nope
Breakpoint 1 at /path/to/foo.py:6
(Pdb) from bar import bar
(Pdb) break bar
Breakpoint 2 at /path/to/bar.py:1
(Pdb) continue
> /path/to/bar.py(2)bar()
-> print('1')
(Pdb) step
1
--Return--
> /path/to/bar.py(2)bar()->None
-> print('1')
(Pdb) step
--Return--
> /path/to/foo.py(4)foo()->None
-> bar()
(Pdb)

===

Note: stop_here, break_anywhere and dispatch_call are methods of the
Bdb class.

test_1 fails to stop in foo() after the second 'step' command because
the trace function is not set for all the frames being created in the
foo module, since stop_here() and break_anywhere() are both False
whenever dispatch_call() is invoked in this module. So after the
second 'step' command, trace_dispatch is not invoked by the
interpreter until a new frame is created, which happens when nope() is
called.

test_2 succeeds and stops in foo() after the second 'step' command.
After setting the dummy breakpoint 1 in the foo module in test_2,
break_anywhere() becomes True in the foo module and the trace function
is set for all the frames created in this module (with an associated
performance penalty).

The problem exists in all python versions.

The attached patch fixes this problem by restoring the trace function
on returning from a frame when the command is 'step'.

The patch includes a test case.

--
components: Library (Lib)
files: restore_trace.patch
keywords: patch
messages: 145557
nosy: xdegaye
priority: normal
severity: normal
status: open
title: pdb skips frames after hitting a breakpoint and running step
versions: Python 3.2
Added file: http://bugs.python.org/file23410/restore_trace.patch

___
Python tracker 

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



[issue13052] IDLE: replace ending with '\' causes crash

2011-10-14 Thread Roger Serwy

Roger Serwy  added the comment:

I see that Ezio added me to the nosy list.

Here's a patch that identifies bogus escape characters at the end of the 
replvar string and appends an extra \ to fix it.

--
keywords: +patch
Added file: http://bugs.python.org/file23409/patch13052.diff

___
Python tracker 

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



[issue13182] pysetup run bdist_wininst does not work (tries to use "install" command)

2011-10-14 Thread Paul Moore

New submission from Paul Moore :

PS D:\Data\python-sample\python> pysetup run bdist_wininst
running bdist_wininst
running build
running build_py
Invalid command install
Traceback (most recent call last):
  File "D:\Data\cpython\lib\packaging\command\__init__.py", line 57, in 
get_command_class
cls = _COMMANDS[name]
KeyError: 'install'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\Data\cpython\lib\packaging\run.py", line 653, in main
return dispatcher()
  File "D:\Data\cpython\lib\packaging\run.py", line 642, in __call__
return func(self, self.args)
  File "D:\Data\cpython\lib\packaging\run.py", line 91, in wrapper
return f(*args, **kwargs)
  File "D:\Data\cpython\lib\packaging\run.py", line 288, in _run
dist.run_command(cmd, dispatcher.command_options[cmd])
  File "D:\Data\cpython\lib\packaging\dist.py", line 709, in run_command
cmd_obj.run()
  File "D:\Data\cpython\lib\packaging\command\bdist_wininst.py", line 119, in 
run
reinit_subcommands=True)
  File "D:\Data\cpython\lib\packaging\command\cmd.py", line 323, in 
get_reinitialized_command
command, reinit_subcommands)
  File "D:\Data\cpython\lib\packaging\dist.py", line 660, in 
get_reinitialized_command
command = self.get_command_obj(command_name)
  File "D:\Data\cpython\lib\packaging\dist.py", line 583, in get_command_obj
cls = get_command_class(command)
  File "D:\Data\cpython\lib\packaging\command\__init__.py", line 59, in 
get_command_class
raise PackagingModuleError("Invalid command %s" % name)
packaging.errors.PackagingModuleError: Invalid command install

Looking at bdist_wininst.py (line 118) it is indeed trying to use an "install" 
command, which is not present in command\__init__.py

--
assignee: tarek
components: Distutils2
messages: 14
nosy: alexis, eric.araujo, pmoore, tarek
priority: normal
severity: normal
status: open
title: pysetup run bdist_wininst does not work (tries to use "install" command)
type: behavior
versions: Python 3.3

___
Python tracker 

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



[issue13181] pysetup install creates .pyc files but pysetup remove doesn't delete them

2011-10-14 Thread Paul Moore

New submission from Paul Moore :

The title explains. Here is an example:

PS D:\Data\python-sample\python> pysetup install
Installing from source directory: 'D:\\Data\\python-sample\\python'
running install_dist
running build
running build_py
running install_lib
byte-compiling D:\Data\cpython\Lib\site-packages\hello.py to 
hello.cpython-33.pyc
running install_distinfo
creating D:\Data\cpython\Lib\site-packages\hello-0.1.dist-info
creating D:\Data\cpython\Lib\site-packages\hello-0.1.dist-info\METADATA
creating D:\Data\cpython\Lib\site-packages\hello-0.1.dist-info\INSTALLER
creating D:\Data\cpython\Lib\site-packages\hello-0.1.dist-info\REQUESTED
creating D:\Data\cpython\Lib\site-packages\hello-0.1.dist-info\RECORD
PS D:\Data\python-sample\python> pysetup remove hello
Removing 'hello':
  D:\Data\cpython\Lib\site-packages\hello.py
  D:\Data\cpython\Lib\site-packages\hello-0.1.dist-info\METADATA
  D:\Data\cpython\Lib\site-packages\hello-0.1.dist-info\INSTALLER
  D:\Data\cpython\Lib\site-packages\hello-0.1.dist-info\REQUESTED
  D:\Data\cpython\Lib\site-packages\hello-0.1.dist-info\RECORD
Proceed (y/n)? y
Success: removed 5 files and 1 dirs
PS D:\Data\python-sample> dir D:\Data\cpython\Lib\site-packages\__pycache__


Directory: D:\Data\cpython\Lib\site-packages\__pycache__


ModeLastWriteTime Length Name
- -- 
-a---14/10/2011 18:53314 hello.cpython-33.pyc

The pyc file should have been removed. It's not critical (the pyc file gets 
ignored, see PEP 3147) but as pysetup created it, pysetup should remove it...

--
assignee: tarek
components: Distutils2
messages: 145554
nosy: alexis, eric.araujo, pmoore, tarek
priority: low
severity: normal
status: open
title: pysetup install creates .pyc files but pysetup remove doesn't delete them
type: behavior
versions: Python 3.3

___
Python tracker 

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



[issue13175] packaging uses wrong line endings in RECORD files on Windows

2011-10-14 Thread Paul Moore

Paul Moore  added the comment:

Unfortunately, no. I have been unable to get this in a reproducible form - but 
I have seen it a few times now. I will keep trying to reproduce.

The worst thing is that packaging fails to recognise the data in RECORD and 
won't uninstall the package. It would be helpful if packaging were a little 
more permissive in how it handles this sort of problem in RECORD.

--

___
Python tracker 

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



[issue13180] pysetup silently ignores invalid entries in setup.cfg

2011-10-14 Thread Paul Moore

New submission from Paul Moore :

With a simple setup.cfg defining a distribution containing a single Python 
module, if you misspell the "modules" keyword (say, as "module") then pysetup 
does nothing without reporting the error.

This silent failure is very hard to debug, and even if pysetup is ignoring 
unknown items by design, it should at a minimum report ignored items and 
probably try to warn on common misspellings like this one.

PS D:\Data\python-sample\python> type .\setup.cfg
[metadata]
name = hello
version = 0.1
author = Paul Moore
author-email = p.f.mo...@gmail.com
summary = Test Python module

[files]
module = hello
PS D:\Data\python-sample\python> pysetup run build
running build
PS D:\Data\python-sample\python> dir


Directory: D:\Data\python-sample\python


ModeLastWriteTime Length Name
- -- 
-a---13/10/2011 19:46 42 hello.py
-a---14/10/2011 18:42155 setup.cfg

(No build directory created!)

--
assignee: tarek
components: Distutils2
messages: 145552
nosy: alexis, eric.araujo, pmoore, tarek
priority: normal
severity: normal
status: open
title: pysetup silently ignores invalid entries in setup.cfg
type: behavior
versions: Python 3.3

___
Python tracker 

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



[issue13172] pysetup run --list-commands fails with a traceback

2011-10-14 Thread Paul Moore

Paul Moore  added the comment:

No it didn't - I had not built the _msi module when I built Python for some 
reason. I have built _msi now, and everything works. Sorry for the false alarm.

Arguably, the command shouldn't fail, it should simply omit the bdist_msi 
command from the listing. But as _msi is part of Python, the installation is 
broken if it isn't present so I guess that handling the issue gracefully isn't 
really important. (I assume the missing _msi extension isn't an issue on Unix).

--

___
Python tracker 

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



[issue13173] Default values for string.Template

2011-10-14 Thread Bfontaine

Bfontaine  added the comment:

Here is my code as a diff

--
keywords: +patch
Added file: 
http://bugs.python.org/file23408/string_template_default_values.patch

___
Python tracker 

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



[issue13052] IDLE: replace ending with '\' causes crash

2011-10-14 Thread Ezio Melotti

Changes by Ezio Melotti :


--
nosy: +serwy

___
Python tracker 

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



[issue13039] IDLE editor: shell-like behaviour on line starting with ">>>"

2011-10-14 Thread Roger Serwy

Roger Serwy  added the comment:

Here's a patch.

The smart_backspace_event code considers sys.ps1 even though it's not a PyShell 
instance. The "context_use_ps1" flag is already used to modify other behavior 
of the editor window when it is a PyShell instance, so it is appropriate to use 
it here as well.

--
keywords: +patch
nosy: +serwy
Added file: http://bugs.python.org/file23407/patch13039.diff

___
Python tracker 

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



[issue10945] bdist_wininst depends on MBCS codec, unavailable on non-Windows

2011-10-14 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

The problem is that the config file is parsed using GetPrivateProfileString, 
and the result is then passed to TextOut, SetDlgItemText, CreateWindow, etc. 
all of which are defined to accept MBCS strings. I agree that this can't work 
correctly in the general case.

Changing the GUI functions to operate on Unicode strings is certainly feasible 
and a good idea. The main challenge then is the format of the INI file. IIUC, 
GetPrivateProfileStringW is willing to process UTF-16 (with BOM) encoded INI 
files, but I never tested whether it actually does. If it does, I recommend to 
have the INI file encoded in UTF-16 (with BOM, using LE for safety).

In porting wininst.exe, it seems tempting to use the TEXT family of APIs. I'd 
advise against that, and recommend to explicitly use the *W functions.

--

___
Python tracker 

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



[issue13169] Regular expressions with 0 to 65536 repetitions raises OverflowError

2011-10-14 Thread Matthew Barnett

Matthew Barnett  added the comment:

The limit is an implementation detail. The pattern is compiled into codes which 
are then interpreted, and it just happens that the codes are (usually) 16 bits, 
giving a range of 0..65535, but it uses 65535 to represent no limit and doesn't 
warn if you actually write 65535.

There's an alternative regex implementation here:

http://pypi.python.org/pypi/regex

--

___
Python tracker 

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



[issue11751] Increase distutils.filelist / packaging.manifest test coverage

2011-10-14 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 368134e10d09 by Éric Araujo in branch '2.7':
Increase test coverage for distutils.filelist (#11751).
http://hg.python.org/cpython/rev/368134e10d09

--

___
Python tracker 

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



[issue12344] Add **kwargs to get_reinitialized_command

2011-10-14 Thread Éric Araujo

Éric Araujo  added the comment:

BTW, sorry I did not make a patch that could be applied on top of your repo; I 
intended to, but your patch did not apply cleanly, so when merging conflicts I 
also did other editions and then it was too late.

I hope you appreciate how I solved the issue of going twice through 
kwargs.items(): The code is here twice, but only one of these code paths will 
be followed in each call :)

--

___
Python tracker 

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



[issue13176] Broken link in bugs.rst

2011-10-14 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset ebf3f2a4c61a by Éric Araujo in branch '2.7':
Update dead references from py.org/dev/faq to the devguide (#13176)
http://hg.python.org/cpython/rev/ebf3f2a4c61a

--

___
Python tracker 

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



[issue13151] pysetup3 run bdist_wininst fails

2011-10-14 Thread Éric Araujo

Changes by Éric Araujo :


--
dependencies: +bdist_wininst depends on MBCS codec, unavailable on non-Windows

___
Python tracker 

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



[issue13151] pysetup3 run bdist_wininst fails

2011-10-14 Thread Éric Araujo

Éric Araujo  added the comment:

I’ll apply your hack and fix the other issues.

--
assignee: tarek -> eric.araujo

___
Python tracker 

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



[issue12405] packaging does not record/remove directories it creates

2011-10-14 Thread Éric Araujo

Éric Araujo  added the comment:

If one project creates a/b/thing and another project uses a/b/otherthing, then 
the directories would be recorded in the first project’s RECORD, but they 
should be removed only when both projects are removed.

--

___
Python tracker 

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



[issue4431] Distutils MSVC doesn't create manifest file

2011-10-14 Thread Éric Araujo

Changes by Éric Araujo :


--
nosy: +eric.araujo, mhammond
title: Distutils MSVC doesn't create manifest file (with fix) -> Distutils MSVC 
doesn't create manifest file
versions: +Python 3.3 -Python 2.6

___
Python tracker 

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



[issue13171] Bug in file.read(), can access unknown data.

2011-10-14 Thread STINNER Victor

STINNER Victor  added the comment:

Le 14/10/2011 14:37, Alexander Steppke a écrit :
> "When a file is opened with update mode ('+' as the second or third character 
> in the above list of mode argument values),

You can just say " '+' in the file mode ".

> the fflush function or to a file positioning function (fseek, fsetpos, or 
> rewind),

You should translate these names into Python method names:
  fflush -> file.flush()
  fseek/fsetpos -> file.seek()
  rewind -> (not exposed in Python)

--

___
Python tracker 

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



[issue10945] bdist_wininst depends on MBCS codec, unavailable on non-Windows

2011-10-14 Thread Éric Araujo

Éric Araujo  added the comment:

>> It is not code under the users’ control (i.e. setup.py)
>> that uses MBCS, but the bdist_wininst command itself.
> bdist_command append configuration data to a wininst-xxx.exe binary.
Are you sure?  The string that’s encoded with mbcs comes from the get_inidata 
method in bdist_wininst.py; get_inidata only works with strings (either string 
literals or str objects (in 3.x) given as attributes of the command object or 
in the DistributionMetadata object).

> Where does this file come from? Can we modify wininst-xxx.exe binaries?
If needed, we can: the code lives in PC/bdist_wininst.

> Use the ASCII encoding is the safest solution
I don’t think so.  Distutils supports author='Éric', so bdist_wininst should 
too :)

--
nosy: +loewis
priority: normal -> high

___
Python tracker 

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



[issue13179] IDLE uses common tkinter variables across all editor windows

2011-10-14 Thread Roger Serwy

New submission from Roger Serwy :

IDLE's EditorWindow.py relies on using FileList.py's "vars" dictionary to store 
Tkinter variables instead of using its own. As a consequence, 
toggling a checked menu item in one editor window toggles the menu item in ALL 
editor windows.

To reproduce this error, open two editor windows with Code Context initially 
disabled. Enable Code Context in one window and then click "Options" in the 
other. You'll see Code Context checked when it shouldn't be.

Attached is a patch to fix this problem. It causes EditorWindow to have its own 
dictionary for handling these Tkinter variables instead of using the flist's 
"vars". The comment in FileList.py suggests that this design is a relic from an 
old version of IDLE, since getrawvar is no longer a function.

self.vars = {} # For EditorWindow.getrawvar (shared Tcl variables)

--
components: IDLE
files: patch_EditorWindow.diff
keywords: patch
messages: 145539
nosy: serwy
priority: normal
severity: normal
status: open
title: IDLE uses common tkinter variables across all editor windows
type: behavior
versions: Python 2.6, Python 2.7, Python 3.1, Python 3.2
Added file: http://bugs.python.org/file23406/patch_EditorWindow.diff

___
Python tracker 

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



[issue13176] Broken link in bugs.rst

2011-10-14 Thread Éric Araujo

Éric Araujo  added the comment:

Thanks for the report!

--
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue11880] add a {dist-info} category to distutils2

2011-10-14 Thread Éric Araujo

Éric Araujo  added the comment:

Hi Berker!  Welcome to Python core development.  Tips and guidelines for 
working on distutils are found here: 
http://wiki.python.org/moin/Distutils/Contributing

It’s best if you work on packaging from the cpython repo, but you can also use 
the distutils2 repo it that’s more convenient.

Feel free to ask any question!

--

___
Python tracker 

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



[issue13176] Broken link in bugs.rst

2011-10-14 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 9ef20fbd340f by Éric Araujo in branch '3.2':
Update dead references from py.org/dev/faq to the devguide (#13176)
http://hg.python.org/cpython/rev/9ef20fbd340f

--
nosy: +python-dev

___
Python tracker 

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



[issue12568] Add functions to get the width in columns of a character

2011-10-14 Thread Tom Christiansen

Tom Christiansen  added the comment:

> Martin v. Löwis  added the comment:

> I think the WideCharToMultibyte approach is just incorrect.

> I'm -1 on using wcswidth, though. 

Like you, I too seriously question using wcswidth() for this at all:

The wcswidth() function either shall return 0 (if pwcs points to a
null wide-character code), or return the number of column positions
to be occupied by the wide-character string pointed to by pwcs, or
return -1 (if any of the first n wide-character codes in the wide-
character string pointed to by pwcs is not a printable wide-
character code).

I would be willing to bet (a small amount of) money it does not correctly
inplmented Unicode print widths, even though one would certainly *think* it
does according to this:

 The wcswidth() function determines the number of column positions
 required for the first n characters of pwcs, or until a null wide
 character (L'\0') is encountered.

There are a bunch of "interesting" cases I would want it tested against.

> We already have unicodedata.east_asian_width, which implements 
> http://unicode.org/reports/tr11/ 

> The outcomes of this function are these:
> - F: full-width, width 2, compatibility character for a narrow char
> - H: half-width, width 1, compatibility character for a narrow char
> - W: wide, width 2
> - Na: narrow, width 1
> - A: ambiguous; width 2 in Asian context, width 1 in non-Asian context
> - N: neutral; not used in Asian text, so has no width. Practically, width can 
> be considered as 1

Um, East_Asian_Width=Ambiguous (EA=A) isn't actually good enough for this.
And EA=N cannot be consider 1, either.

For example, some of the Marks are EA=A and some are EA=N, yet how may
print columns they take varies.  It is usually 0, but can be 1 at the start
of the file/string or immediately after a linebreak sequence.  Then there
are things like the variation selectors which are never anything.

Now consider the many \pC code points, like 

U+0009  CHARACTER TABULATION
U+00AD  SOFT HYPHEN 
U+200C  ZERO WIDTH NON-JOINER
U+FEFF  ZERO WIDTH NO-BREAK SPACE
U+2062  INVISIBLE TIMES

A TAB is its own problem but SHY we know is only width=1 immediately
before a linebreak or EOF, and ZWNJ and ZWNBSP are both certainly
width=0.  So are the INVISIBLE * code points.

Context:

Imagine you're trying to format a string so that it takes up exactly 20
columns: you need to know how many spaces to pad it with based on the
print width.  That is what the #12568 is needing
to do, and you have to do much more than East Asian Width properties.

I really do think that what #12568 is asking for is to have the equivalent
of the Perl Unicode::GCString's columns() method, and that you aren't going
to be able to handle text alignment of Unicode with anything that is much
less of that.  After all, #12568's title is "Add functions to get the width
in columns of a character".  I would very much like to compare what
columns() thinks compared with what wcswidth() thinks.  I bet wcswidth() is
very simple-minded at best.

I may of course be wrong.

--tom

--

___
Python tracker 

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



[issue13176] Broken link in bugs.rst

2011-10-14 Thread Éric Araujo

Changes by Éric Araujo :


--
assignee: docs@python -> eric.araujo
nosy: +eric.araujo

___
Python tracker 

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



[issue7833] bdist_wininst installers fail to load extensions built with Issue4120 patch

2011-10-14 Thread Éric Araujo

Éric Araujo  added the comment:

Looks good.

Style nit: I don’t put backslashes at end-of-lines in parens (in one re.compile 
call you have that).  Also, I use -- where I can’t use —.

--

___
Python tracker 

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



[issue13175] packaging uses wrong line endings in RECORD files on Windows

2011-10-14 Thread Éric Araujo

Éric Araujo  added the comment:

packaging.util creates a RECORD file with OS-specific line endings and 
csv.writerow; packaging.command.install_distinfo uses LF everywhere and 
csv.writerow.  I’m not sure this is related to binary vs. text I/O; maybe it’s 
some other code like the RESOURCES system that’s giving lines with endings to 
install_distinfo, which then adds CRLF.  Do you have a RECORD file to upload 
for inspection?

--

___
Python tracker 

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



[issue13174] test_os failures on Fedora 15: listxattr() returns ['security.selinux']

2011-10-14 Thread Éric Araujo

Éric Araujo  added the comment:

Patch looks good, modulo one thing: the “xattr” name is confusing, I’d like it 
better if it was found_xattr or expected_xattr or something clearer.

--
nosy: +eric.araujo

___
Python tracker 

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



[issue13173] Default values for string.Template

2011-10-14 Thread Éric Araujo

Éric Araujo  added the comment:

Thanks for your interest in Python.  Can you repost your code as a diff?  (See 
the devguide for more info)

--
nosy: +eric.araujo
versions: +Python 3.3 -Python 3.2

___
Python tracker 

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



[issue13172] pysetup run --list-commands fails with a traceback

2011-10-14 Thread Éric Araujo

Éric Araujo  added the comment:

Can you tell me if this works:

>>> import _msi
>>> from packaging.command.bdist_msi import bdist_msi

--

___
Python tracker 

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



[issue13157] Build Python outside the source directory

2011-10-14 Thread Éric Araujo

Éric Araujo  added the comment:

Building outside of the source directory was supported, if the source directory 
was clean.  In practice, the source directory could be unclean as long as a few 
files were not there (Parser/*.o, Modules/_testembed), so it was quite 
annoying.  If the patch allows people to build inside the source directory and 
in other directories without cleaning, I’m +1!

--
nosy: +eric.araujo

___
Python tracker 

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



[issue12386] packaging fails in install_distinfo when writing RESOURCES

2011-10-14 Thread Éric Araujo

Éric Araujo  added the comment:

I’ve reproduced the bug and fixed it by opening in text mode, following all 
other calls to open in the same file.  This should now work for ASCII paths and 
non-ASCII paths that use the same encoding as open’s default, but it’ll 
probably break with non-ASCII paths under a C locale, so I’ve opened #13178.

--
nosy: +pmoore
resolution:  -> fixed
stage: needs patch -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue12386] packaging fails in install_distinfo when writing RESOURCES

2011-10-14 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 1f3459b08298 by Éric Araujo in branch 'default':
Fix writing of the RESOURCES file by packaging (#12386)
http://hg.python.org/cpython/rev/1f3459b08298

--
nosy: +python-dev

___
Python tracker 

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



[issue13178] Need tests for Unicode handling in install_distinfo and install_data

2011-10-14 Thread Éric Araujo

New submission from Éric Araujo :

Currently, packaging code opens dist-info files (RECORD, RESOURCES) for writing 
without giving an explicit encoding.  We need to add tests and probably to 
explicitly specify UTF-8 when writing an reading.

--
assignee: tarek
components: Distutils2
keywords: easy
messages: 145526
nosy: alexis, eric.araujo, haypo, tarek
priority: normal
severity: normal
stage: needs patch
status: open
title: Need tests for Unicode handling in install_distinfo and install_data
versions: 3rd party, Python 3.3

___
Python tracker 

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



[issue13114] check -r fails with non-ASCII unicode long_description

2011-10-14 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset d5fb646e7ce1 by Éric Araujo in branch 'default':
Add tests for Unicode handling in packaging’ check and register (#13114)
http://hg.python.org/cpython/rev/d5fb646e7ce1

--

___
Python tracker 

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



[issue11751] Increase distutils.filelist / packaging.manifest test coverage

2011-10-14 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 866d098367c1 by Éric Araujo in branch '3.2':
Increase test coverage for distutils.filelist (#11751).
http://hg.python.org/cpython/rev/866d098367c1

New changeset ba894d8a2a57 by Éric Araujo in branch 'default':
Merge #11751 from 3.2
http://hg.python.org/cpython/rev/ba894d8a2a57

New changeset a30d4864a8e4 by Éric Araujo in branch 'default':
Increase test coverage for packaging.manifest (#11751).
http://hg.python.org/cpython/rev/a30d4864a8e4

--
nosy: +python-dev

___
Python tracker 

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



[issue12568] Add functions to get the width in columns of a character

2011-10-14 Thread Martin v . Löwis

Martin v. Löwis  added the comment:

I think the WideCharToMultibyte approach is just incorrect.

I'm -1 on using wcswidth, though. We already have unicodedata.east_asian_width, 
which implements http://unicode.org/reports/tr11/ 
The outcomes of this function are these:
- F: full-width, width 2, compatibility character for a narrow char
- H: half-width, width 1, compatibility character for a narrow char
- W: wide, width 2
- Na: narrow, width 1
- A: ambiguous; width 2 in Asian context, width 1 in non-Asian context
- N: neutral; not used in Asian text, so has no width. Practically, width can 
be considered as 1

--

___
Python tracker 

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



[issue12602] Missing cross-references in Doc/using

2011-10-14 Thread Éric Araujo

Éric Araujo  added the comment:

BTW, I’ve done nothing about #1739468 because I don’t see why you wanted to add 
a link.

--

___
Python tracker 

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



[issue13177] Avoid chained exceptions in lru_cache

2011-10-14 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

One possibility is to move the call to user_function() outside of the KeyError 
exception handler so that user exceptions won't be chained:

def wrapper(*args, **kwds):
nonlocal hits, misses
key = args
if kwds:
key += kwd_mark + tuple(sorted(kwds.items()))
try:
with lock:
result = cache[key]
cache_renew(key)# record recent use of this key
hits += 1
return result
except KeyError:
pass
result = user_function(*args, **kwds)
with lock:
cache[key] = result # record recent use of this key
misses += 1
if len(cache) > maxsize:
cache_popitem(0)# purge least recently used cache entry
return result

--

___
Python tracker 

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



[issue12602] Missing cross-references in Doc/using

2011-10-14 Thread Éric Araujo

Éric Araujo  added the comment:

[Terry]
> It may suggest a meta-issue though - perhaps 'Documenting Python'
> should grow a devguide-style description of the Docs layout in source
> control

I would just describe the layout of the Doc subtree in the same devguide page.  
Care to open another bug for that?

> If we consistently applied the "italicize non-literal symbolic parameter 
> names"
> rule to command line examples, we would italicize 'command', 'module-name',
> 'script', and 'args' in
> 
> python [-BdEiOQsStuUvVWxX3?] [-c command | -m module-name | script | - ] 
> [args]
> 
> just like in function signatures. I actually would like that as it would
> similarly diffentiate them from the literal constants meant to be entered as
> written. Has that ever been discussed by the doc group?

Not that I recall.  Currently the “python [-Bd etc.]” line is currently a code 
block, and as such cannot gain inline markup (:file:), but this is not 
insurmountable.

--

___
Python tracker 

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



[issue13177] Avoid chained exceptions in lru_cache

2011-10-14 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

Another issue is that I want to keep the related accesses to the OrderedDict 
inside the "with lock" in order to avoid a race condition between the 
testing-for-membership step and the retrieve-the-cached-value step.

--

___
Python tracker 

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



[issue12602] Missing cross-references in Doc/using

2011-10-14 Thread Éric Araujo

Éric Araujo  added the comment:

Attached path adds these links:
> Missing incoming:
> - from "Invoking the Interpreter" in the tutorial
> - direct link from runpy.run_module to -m switch

> Missing outgoing:
> - direct link from 

[issue5252] 2to3 should detect and delete import of removed statvfs module

2011-10-14 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Benjamin, you seem to have rejected this feature request. Close it?

--
nosy: +terry.reedy

___
Python tracker 

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



[issue13177] Avoid chained exceptions in lru_cache

2011-10-14 Thread Raymond Hettinger

Raymond Hettinger  added the comment:

This changes behavior so that hash() gets called twice for the key tuple, 
resulting in decreased performance.

In an earlier version of the lru_cache before the "with lock" was introduced, 
the try/except form was more atomic.  It also worked well with dict subclasses 
that use __missing__ (which is bypassed with the LBYL style of lookup).

I'll look at this more shortly -- thanks for the links to the other tracker 
items.

--
priority: normal -> low

___
Python tracker 

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



[issue12386] packaging fails in install_distinfo when writing RESOURCES

2011-10-14 Thread Éric Araujo

Éric Araujo  added the comment:

I have a test.

--

___
Python tracker 

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



[issue13177] Avoid chained exceptions in lru_cache

2011-10-14 Thread Ezio Melotti

Ezio Melotti  added the comment:

Here's an example (copied from msg142063) of what the traceback is without the 
patch:
>>> from functools import lru_cache
>>> @lru_cache()
... def func(arg): raise ValueError()
... 
>>> func(3)
Traceback (most recent call last):
  File "/home/wolf/dev/py/3.2/Lib/functools.py", line 176, in wrapper
result = cache[key]
KeyError: (3,)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "", line 1, in 
  File "/home/wolf/dev/py/3.2/Lib/functools.py", line 180, in wrapper
result = user_function(*args, **kwds)
  File "", line 2, in func
ValueError

The patch gets rid of the first traceback (the one before "During handling...").
I should also mention that my second point might not be valid if the cache hits 
are mostly successful.  I haven't done any specific benchmark, and I don't know 
how fast is 'key in dict' compared to raising an exception.  If it's e.g. 10 
times faster, it should make lru_cache faster when the hits:miss ratio is lower 
than 10:1.

--

___
Python tracker 

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



[issue13171] Bug in file.read(), can access unknown data.

2011-10-14 Thread Alexander Steppke

Alexander Steppke  added the comment:

Thank you for the update Victor. It seems to me that this is exactly the same 
issue.

At the moment the current documentation says 
(http://docs.python.org/library/stdtypes.html#bltin-file-objects):

"Note: This function is simply a wrapper for the underlying fread() C function, 
and will behave the same in corner cases, such as whether the EOF value is 
cached."

This is a hint to the current behavior but I would not expect from this that 
file.read() can return any kind of data, if used directly after file.write(). 
Maybe one could include a link or a snippet of the C standard which states that 
one shall not do this:

"When a file is opened with update mode ('+' as the second or third character 
in the above list of mode argument values), both input and output may be 
performed on the associated stream. However, output shall not be directly 
followed by input without an intervening call to the fflush function or to a 
file positioning function (fseek, fsetpos, or rewind), and input shall not be 
directly followed by output without an
intervening call to a file positioning function, unless the input operation 
encounters end-of-file." 
 
(from http://www.open-std.org/jtc1/sc22/wg14/www/docs/n1124.pdf, page 272)

--

___
Python tracker 

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



[issue13163] `port` and `host` are confused in `_get_socket

2011-10-14 Thread Víctor Terrón

Víctor Terrón  added the comment:

Patch updated. It is now a two-line patch. How impressive :-)
Anyway, I have verified that the entire test suite runs without failure.
Should Misc/NEWS be updated for such a trivial modification?

--
Added file: http://bugs.python.org/file23404/smtplib.py.diff

___
Python tracker 

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



[issue13177] Avoid chained exceptions in lru_cache

2011-10-14 Thread Ezio Melotti

New submission from Ezio Melotti :

The attached patch changes lru_cache to use if/else instead of try/except.
This has 2 effects:
1) it avoids chained exceptions and makes the error messages clearer;
2) it probably makes lru_cache a bit faster since building and catching 
exceptions is expensive. It also gets rid of the KeyError=KeyError 
optimization/hack;

For a couple of examples of 1) see #12749 (msg142059, msg142063), or #13169 
(msg145469).  See also related issue #6210.

--
assignee: rhettinger
files: issue13177.diff
keywords: needs review, patch
messages: 145511
nosy: ezio.melotti, rhettinger
priority: normal
severity: normal
stage: patch review
status: open
title: Avoid chained exceptions in lru_cache
type: behavior
versions: Python 3.2, Python 3.3
Added file: http://bugs.python.org/file23403/issue13177.diff

___
Python tracker 

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



[issue13163] `port` and `host` are confused in `_get_socket

2011-10-14 Thread Víctor Terrón

Changes by Víctor Terrón :


Removed file: http://bugs.python.org/file23397/smtplib.py.diff

___
Python tracker 

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



[issue4431] Distutils MSVC doesn't create manifest file (with fix)

2011-10-14 Thread Corey O'Brien

Corey O'Brien  added the comment:

Building py2exe with VS2010 I had this same issue and the /MANIFEST fix 
mentioned here fixed the problem.

I also think that this issue should be re-opened.

--
nosy: +coreypobrien

___
Python tracker 

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



[issue10945] bdist_wininst depends on MBCS codec, unavailable on non-Windows

2011-10-14 Thread STINNER Victor

STINNER Victor  added the comment:

> It is not code under the users’ control (i.e. setup.py)
> that uses MBCS, but the bdist_wininst command itself.

bdist_command append configuration data to a wininst-xxx.exe binary. Where does 
this file come from? Can we modify wininst-xxx.exe binaries?


If we can modify the binaries, we can change the format to store the 
configuration data as UTF-8 instead of the ANSI code page.

It's surprising and "unsafe" (not portable) to use the ANSI code page for an 
installer: if you build your installer on a french setup (ANSI=cp1252), the 
configuration was be interpreted incorrectly on a japanese setup (ANSI=cp932). 
Example:

>>> 'Hé ho'.encode('cp1252').decode('cp932')
Traceback (most recent call last):
  File "", line 1, in 
UnicodeDecodeError: 'cp932' codec can't decode bytes in position 1-2: illegal 
multibyte sequence

So if the configuration data (package metadata) contains non-ASCII characters, 
you will not be able to use your installer on a computer using a different ANSI 
code page than the code page of the computer used to build the installer... In 
the best case, you will just get mojibake.

If we cannot modify wininst-xx.exe, an alternative to be able to generate 
installers on non-Windows platforms is to use the most common ANSI code page 
(cp1252?), or maybe ASCII.

Use the ASCII encoding is the safest solution because you will be able to use 
your installer on all Windows setup (all ANSI code pages are compatible with 
ASCII), but you will not be able to generate an installer if the package 
metadata contains at least one non-ASCII character...

--

___
Python tracker 

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



[issue13171] Bug in file.read(), can access unknown data.

2011-10-14 Thread STINNER Victor

STINNER Victor  added the comment:

This issue is a duplicate of the issue #1394612 which has been closed as 
invalid. Read the following message:

http://bugs.python.org/issue1394612#msg27200

I suppose that Python 3 is not affected by this issue because it doesn't use 
fread/fwrite anymore, but directly read/write (the low level, unbuffered, API).

It looks like Python cannot do anything for this issue, except documenting this 
surprising behaviour. Would you like to write a patch for the documentation?

--

___
Python tracker 

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



[issue13169] Regular expressions with 0 to 65536 repetitions raises OverflowError

2011-10-14 Thread Maurice de Rooij

Maurice de Rooij  added the comment:

So if I understand correctly, the maximum of 65535 repetitions is by design?

Have tried a workaround by repeating the repetitions by placing it inside a 
capturing group, which is perfectly legal with Perl regular expressions:

$mystring = "test";
if($mystring =~ m/^(.{0,32766}){0,3}test/s) { print "Yes\n"; }
(32766 being the max repetitions in Perl)

Unfortunately, in Python this does not work and raises a "nothing to repeat" 
sre_constants error:
re.search('(?s)\A(.{0,65535}){0,3}test', 'test')

This, however works, which yields 65536 repetitions of DOTALL:
re.search('(?s)\A.{0,65535}.{0,1}test', 'test')

In the end this solves my problem sort or less, but requires extra logic in my 
script and complicates stuff unnecessary.

A suggestion might be to make repetitions of repeats possible?

--

___
Python tracker 

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



[issue13158] tarfile.TarFile.getmembers misses some entries

2011-10-14 Thread Sebastien Binet

Sebastien Binet  added the comment:

thanks!

> The format of the archive is of very bad quality BTW ;-)
well, that's C++ :P

-s

--

___
Python tracker 

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



[issue13158] tarfile.TarFile.getmembers misses some entries

2011-10-14 Thread Lars Gustäbel

Lars Gustäbel  added the comment:

Thanks for the report. There was a problem decoding a special and rare kind of 
header field in the archive. The format of the archive is of very bad quality 
BTW ;-)

--
resolution:  -> fixed
stage:  -> committed/rejected
status: open -> closed

___
Python tracker 

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



[issue13158] tarfile.TarFile.getmembers misses some entries

2011-10-14 Thread Roundup Robot

Roundup Robot  added the comment:

New changeset 341008eab87d by Lars Gustäbel in branch '3.2':
Issue #13158: Fix decoding and encoding of base-256 number fields in tarfile.
http://hg.python.org/cpython/rev/341008eab87d

New changeset 158430b2b552 by Lars Gustäbel in branch 'default':
Merge with 3.2: Issue #13158: Fix decoding and encoding of base-256 number 
fields in tarfile.
http://hg.python.org/cpython/rev/158430b2b552

--
nosy: +python-dev

___
Python tracker 

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



[issue13171] Bug in file.read(), can access unknown data.

2011-10-14 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

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



[issue13171] Bug in file.read(), can access unknown data.

2011-10-14 Thread Alexander Steppke

Alexander Steppke  added the comment:

Additionally after calling tmp.close() the file 'tmp' contains the string 
'test', which is followed by about 4kB of binary data similar to the previous 
output of tmp.read().

--

___
Python tracker 

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



[issue13171] Bug in file.read(), can access unknown data.

2011-10-14 Thread Alexander Steppke

Changes by Alexander Steppke :


--
components: +IO
title: Bug in tempfile module -> Bug in file.read(), can access unknown data.

___
Python tracker 

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



[issue13171] Bug in tempfile module

2011-10-14 Thread Alexander Steppke

Alexander Steppke  added the comment:

Hi David,

I followed your suggestion and tried to reproduce the problem without the 
tempfile module. It turns out that is indeed an underlying issue. I am not sure 
what the root cause is but now this is even a bigger problem: read() returns 
information from some file/memory that it was never intended to access. 

The session looks similar to the tempfile session:

>>> tmp = open('tmp', 'w+t')
>>> tmp.read()
''
>>> tmp.write('test')
>>> tmp.read()
'hp\'\x02\xe4\xb9>7\x80\x88\x81\x02\x01\x00\x00\x00\x00\x00\x00\x00\x12\x00\x00\
x00\xe86(\x02p\x11\x8d\x02\x01\x00\x00\x00@\xfd)\x02\xe7Y\x9aN\x01\x00\x00\x00\x
00\x00\x00\x00\x14\x00\x00\x00\x087(\x02\x00\x00\x00\x00\xe9Y\x0b\xa2\x00\x93+\x
02\x01\x00\x00\x00\x00\x00\x00\x00\x00\x9b,\x02\x02\x00\x00\x00\xe06(\x02\xc0W5\

At the moment the bug could only be reproduced using CPython 2.7.1 on Windows 
XP and Windows 7. 

Alexander

--

___
Python tracker 

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



[issue11880] add a {dist-info} category to distutils2

2011-10-14 Thread Berker Peksag

Berker Peksag  added the comment:

I'd like to work on this issue. What is the correct location of the Distutils2 
project?

I have found these links:
http://hg.python.org/distutils2/file/98e0d3c53a2f/distutils2/
http://hg.python.org/cpython/file/2c223d686feb/Lib/packaging

Thanks!

--

___
Python tracker 

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



[issue13176] Broken link in bugs.rst

2011-10-14 Thread Berker Peksag

New submission from Berker Peksag :

http://www.python.org/dev/workflow/ is missing in 3.2 documentation.

See: http://docs.python.org/py3k/bugs.html

It works with latest version of the documentation: 
http://docs.python.org/dev/bugs.html

--
assignee: docs@python
components: Documentation
files: broken_link_v1.patch
keywords: patch
messages: 145499
nosy: berkerpeksag, docs@python
priority: normal
severity: normal
status: open
title: Broken link in bugs.rst
versions: Python 3.2
Added file: http://bugs.python.org/file23402/broken_link_v1.patch

___
Python tracker 

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



  1   2   >