[issue1028] Tkinter binding involving Control-spacebar raises unicode error

2011-02-12 Thread Georg Brandl

Changes by Georg Brandl ge...@python.org:


--
assignee: kbk - ned.deily
nosy: +ned.deily

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



[issue4709] Mingw-w64 and python on windows x64

2011-02-12 Thread Christoph Gohlke

Changes by Christoph Gohlke cgoh...@uci.edu:


--
nosy: +cgohlke

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



[issue11180] More efficient nlargest()/nsmallest()

2011-02-12 Thread Raymond Hettinger

Raymond Hettinger rhettin...@users.sourceforge.net added the comment:

Updated the benchmarking code to include a 4th variant that accumulates sorted 
sublists during the partitioning phase.

Results from one run:

n: 10   k: 100
[105856, 105917, 105951, 105977, 106366] nsmallest
[166465, 166478, 166507, 166639, 166748] heapifying_smallest
[253705, 260410, 264225, 289600, 333626] selecting_smallest
[111048, 117112, 144633, 168109, 402758] partitioning_smallest

--
Added file: http://bugs.python.org/file20749/heapq_benchmark.py

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



[issue11180] More efficient nlargest()/nsmallest()

2011-02-12 Thread Raymond Hettinger

Changes by Raymond Hettinger rhettin...@users.sourceforge.net:


Removed file: http://bugs.python.org/file20748/heapq_benchmark.py

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



[issue11149] [PATCH] Configure should enable -fwrapv for clang

2011-02-12 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

This is a potential crasher.
It would also be nice if you listed those cases where Python assumes signed 
overflow behaviour. Can you open a separate issue for that?

--
nosy: +mark.dickinson, pitrou
priority: normal - high
versions: +Python 2.7, Python 3.3

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



[issue11199] urllib hangs when closing connection

2011-02-12 Thread rg3

New submission from rg3 sarbalap+freshm...@gmail.com:

If you run the attached program, you can see the program hangs in the 
connection close stage. Uncommenting the sleep line makes the program work, so 
I suspect some kind of race condition.

The URL used belongs to a Slackware Linux mirror. I have not been able to 
reproduce this problem when using a different FTP mirror or using HTTP mirrors. 

The remote server seems to be using pure-ftpd. I have built the software and 
tested on localhost, but I could not reproduce the problem either.

--
components: Extension Modules
files: test.py
messages: 128444
nosy: rg3
priority: normal
severity: normal
status: open
title: urllib hangs when closing connection
type: behavior
versions: Python 2.6
Added file: http://bugs.python.org/file20750/test.py

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



[issue11198] re sub subn backreferrence too few replacements

2011-02-12 Thread muxum

muxum mxgn...@gmx.de added the comment:

aww ic

--

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



[issue10999] os.chflags refers to stat constants, but the constants are not documented in the stat module

2011-02-12 Thread R. David Murray

R. David Murray rdmur...@bitdance.com added the comment:

Looks good to me.

I wonder if the existing example should be moved up above the description of 
the chmod flags, though.  This update puts it even farther away from the 
functions it is an example of.

--

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



[issue3119] pickle.py is limited by python's call stack

2011-02-12 Thread Éric Araujo

Changes by Éric Araujo mer...@netwok.org:


--
superseder: eliminate recursion in pickling - 

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



[issue9523] Improve dbm modules

2011-02-12 Thread Ray.Allen

Ray.Allen ysj@gmail.com added the comment:

  1. Make keys(), values(), items() methods return view object for ndbm, gdbm 
  and dumb objects. I following the codes in dictobject.c.
 Did you have to copy the code?  Isn’t it possible to somehow reuse it?

I feel not so easy to reuse the code, there could be several differences in the 
c code. Resuing the code may make the code more complecated. But if someone 
could find a better way to reuse the code, it would be nice.


  The keysview object support len(), in operator, and iteratable, while 
  valuesview and itemsview object only support len() and iteratable.
 That does not seem to comply with the definition of dict views. 

Oh, yes, I missed the rich compare functions and isdisjoint() method of view 
objects.


 Do the views yield elements in the same order?  (In a dict, iteration order 
 is undefined but consistent between the various views, IIUC.)
gdbm and dumb views yield elements in the same order, ndbm views doesn't. I 
missed it.


  3. Remove dumb's keys() method which calls self._index.keys() since it is 
  unnecessary.
 Does dumb have no keys method then?
Yes, it does. Its keys() method is provided by Mapping abc already.


Here is the updated patch:
1. Add rich compare functions and disjoint() method to dbm view objects to make 
them as MappingView objects, and add abc registration for them.
2. Make ndbm view objects yield elements in the same order.
3. Other changes during to the codeview: http://codereview.appspot.com/4185044/

--

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



[issue9523] Improve dbm modules

2011-02-12 Thread Ray.Allen

Changes by Ray.Allen ysj@gmail.com:


Added file: http://bugs.python.org/file20751/issue_9523.diff

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



[issue11200] Addition of abiflags breaks distutils

2011-02-12 Thread Toshio Kuratomi

New submission from Toshio Kuratomi a.bad...@gmail.com:

When trying to build distribute on the latest python-3.2rc I get the following 
traceback in the unittests (two others that are similar as well):

==
ERROR: test_develop (setuptools.tests.test_develop.TestDevelopTest)
--
Traceback (most recent call last):
  File /usr/lib/python3.2/distutils/util.py, line 283, in subst_vars
return re.sub(r'\$([a-zA-Z_][a-zA-Z_0-9]*)', _subst, s)
  File /usr/lib/python3.2/re.py, line 167, in sub
return _compile(pattern, flags).sub(repl, string, count)
  File /usr/lib/python3.2/distutils/util.py, line 280, in _subst
return os.environ[var_name]
  File /usr/lib/python3.2/os.py, line 450, in __getitem__
value = self._data[self.encodekey(key)]
KeyError: b'abiflags'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File build/src/setuptools/tests/test_develop.py, line 52, in test_develop
cmd.ensure_finalized()
  File /usr/lib/python3.2/distutils/cmd.py, line 109, in ensure_finalized
self.finalize_options()
  File build/src/setuptools/command/develop.py, line 51, in finalize_options
easy_install.finalize_options(self)
  File build/src/setuptools/command/easy_install.py, line 225, in 
finalize_options
self.expand_dirs()
  File build/src/setuptools/command/easy_install.py, line 335, in expand_dirs
'install_scripts', 'install_data',])
  File build/src/setuptools/command/easy_install.py, line 323, in 
_expand_attrs
val = subst_vars(val, self.config_vars)
  File /usr/lib/python3.2/distutils/util.py, line 285, in subst_vars
raise ValueError(invalid variable '$%s' % var)
ValueError: invalid variable '$b'abiflags''

It seems that something in the addition of abiflags is causing distutils to 
search for abiflags in os.environ.  After talking with tarek on IRC we decided 
to open a bug here to see whether this is desirable change in behaviour within 
the stdlib.

The revision introducing abiflags is here: 
http://svn.python.org/view?view=revrevision=85697

--
components: Library (Lib)
messages: 128448
nosy: a.badger, barry, doko, tarek
priority: normal
severity: normal
status: open
title: Addition of abiflags breaks distutils
versions: Python 3.2

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



[issue11200] Addition of abiflags breaks distutils

2011-02-12 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +georg.brandl

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



[issue11200] Addition of abiflags breaks distutils

2011-02-12 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

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



[issue11200] Addition of abiflags breaks distutils

2011-02-12 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Actually, looks like distribute should be updated to include abiflags in 
self.config_vars in setuptools/command/easy_install.py. There seems to be a 
whole bunch of code pasted directly from distutils and it isn't up-to-date 
anymore. Compare:
https://bitbucket.org/tarek/distribute/src/4ab9b96dc540/setuptools/command/easy_install.py#cl-195
with:
http://code.python.org/hg/branches/py3k/file/9b1daa80168d/Lib/distutils/command/install.py#l321

This bug probably needs to be reported to the distribute issue tracker instead. 
Tarek, Éric, can you proceed?

--
assignee:  - tarek
nosy: +pitrou
resolution:  - invalid
status: open - pending

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



[issue11201] Python installation error 2203

2011-02-12 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
nosy: +loewis

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



[issue11201] Python installation error 2203

2011-02-12 Thread Brian Curtin

Brian Curtin cur...@acm.org added the comment:

Can you confirm that the checksum and size of the file you downloaded matches 
what's on the site: http://www.python.org/download/releases/2.7.1/

--
components: +Windows
nosy: +brian.curtin

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



[issue11202] Win32: shutil.move does not inherit permissions

2011-02-12 Thread Anders Østhus

New submission from Anders Østhus grapz...@gmail.com:

Hi

I'm running Python 2.7.1 (r271:86832, Nov 27 2010, 17:19:03) [MSC v.1500 64 bit 
(AMD64)] on win32 (Server 2008 R2).

I've discovered that when moving files with shutil.move, the file won't inherit 
the security settings as it should.

When using shutil.copy, it does get the right permissions.

--
components: IO
messages: 128452
nosy: Anders.Østhus
priority: normal
severity: normal
status: open
title: Win32: shutil.move does not inherit permissions
versions: Python 2.7

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



[issue11202] Win32: shutil.move does not inherit permissions

2011-02-12 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
components: +Library (Lib) -IO
nosy: +tarek

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



[issue11201] Python installation error 2203

2011-02-12 Thread Ana Koren

New submission from Ana Koren ana.ko...@gmail.com:

I'm running Windows 7 (32-bit) and I downloaded Python 2.7.1 Windows Installer 
but I can't install it. I get this message:
The installer has encountered an unexpected error installing this package. 
This may indicate a problem with this package. The error code is 2203.

--
messages: 128449
nosy: corenova
priority: normal
severity: normal
status: open
title: Python installation error 2203
versions: Python 2.7

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



[issue11201] Python installation error 2203

2011-02-12 Thread Ana Koren

Ana Koren ana.ko...@gmail.com added the comment:

Yes, I downloaded it from there.

--

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



[issue11202] Win32: shutil.move does not inherit permissions

2011-02-12 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Intuitively, this seems rather normal to me. If I move a file under Unix, I 
don't expect its access rights or ownership to change. Move really means what 
it means: you have to update its permission explicitly if that's what you need 
(shutil.copystat() can help you with that, I think).

--
nosy: +pitrou

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



[issue11202] Win32: shutil.move does not inherit permissions

2011-02-12 Thread Brian Curtin

Brian Curtin cur...@acm.org added the comment:

shutil.move is implemented using copy2, which as the documentation states at 
the top, On Windows, file owners, ACLs and alternate data streams are not 
copied.

See http://docs.python.org/library/shutil

--
nosy: +brian.curtin
resolution:  - rejected
stage:  - committed/rejected

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



[issue11201] Python installation error 2203

2011-02-12 Thread corenova

corenova ana.ko...@gmail.com added the comment:

I get the same message when trying to install older versions (2.x) as well as 
new 3.1.3
I also tried ActivePython and same thing happens.

--

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



[issue11202] Win32: shutil.move does not inherit permissions

2011-02-12 Thread Brian Curtin

Changes by Brian Curtin cur...@acm.org:


--
status: open - closed

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



[issue11201] Python installation error 2203

2011-02-12 Thread Martin v . Löwis

Martin v. Löwis mar...@v.loewis.de added the comment:

Are you perhaps trying to run the installer from a network folder, or some 
other location that needs your personal credentials for access?

Please run

   msiexec /i python-2.7.1.msi /l*v python.log

and attach the resulting python.log to this report (compress if it's too large).

--

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



[issue9298] binary email attachment issue with base64 encoding

2011-02-12 Thread Yves Dorfsman

Yves Dorfsman y...@zioup.com added the comment:

I will. Please don't use my patch yet, it breaks something else in the 
test_email:

./python Lib/test/regrtest.py test_email
[1/1] test_email
test test_email failed -- Traceback (most recent call last):
  File /export/incoming/python/py3k/Lib/email/test/test_email.py, line 1146, 
in test_body
eq(msg.get_payload(), '+vv8/f7/')
AssertionError: '+vv8/f7/\n' != '+vv8/f7/'
- +vv8/f7/
? -
+ +vv8/f7/

1 test failed:
test_email


This is with my code patch, not the test patch. I'll look at it, and post 
again, could be the extra newline you were talking about.

--

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



[issue11204] re module: strange behaviour of space inside {m, n}

2011-02-12 Thread John Machin

New submission from John Machin sjmac...@lexicon.net:

A pattern like rb{1,3}\Z matches b, bb, and bbb, as expected. There is 
no documentation of the behaviour of rb{1, 3}\Z -- it matches the LITERAL 
TEXT b{1, 3} in normal mode and b{1,3} in verbose mode.

# paste the following at the interactive prompt:
pat = rb{1, 3}\Z
bool(re.match(pat, bb)) # False
bool(re.match(pat, b{1, 3})) # True
bool(re.match(pat, bb, re.VERBOSE)) # False
bool(re.match(pat, b{1, 3}, re.VERBOSE)) # False
bool(re.match(pat, b{1,3}, re.VERBOSE)) # True

Suggested change, in decreasing order of preference:
(1) Ignore leading/trailing spaces when parsing the m and n components of {m,n}
(2) Raise an exception if the exact syntax is not followed
(3) Document the existing behaviour

Note: deliberately matching the literal text would be expected to be done by 
escaping the left brace:

pat2 = rb\{1, 3}\Z
bool(re.match(pat2, b{1, 3})) # True

and this is not prevented by the suggested changes.

--
messages: 128472
nosy: sjmachin
priority: normal
severity: normal
status: open
title: re module: strange behaviour of space inside {m, n}
versions: Python 2.7, Python 3.1

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



[issue10084] SSL support for asyncore

2011-02-12 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

First comments:

- secure_connection() should be named ssl_something() like other
methods. ssl_start() perhaps?

- in ssl_shutdown():
+elif err.args[0] == ssl.SSL_ERROR_SSL:
+pass

SSL_ERROR_SSL doesn't exist.  Perhaps you mean ssl.SSL_ERROR_EOF?

- in send(), you should handle SSL_ERROR_WANT_READ and
SSL_ERROR_WANT_WRITE as in recv(). Also:
+if err.args[0] in (ssl.SSL_ERROR_EOF, 
ssl.SSL_ERROR_ZERO_RETURN):
+return 0

lacks a self.handle_close()?

- in recv(), you have return '' where it should be return b''

- in test_ssl_established(), I think it would be nice if you used e.g.
getpeercert() to check that we really are in SSL mode. Also, you could
make certificate checking mandatory using e.g.:

ssl_context = ssl.SSLContext(ssl.PROTOCOL_SSLv23)
ssl_context.verify_mode = ssl.CERT_REQUIRED
cert_path = os.path.join(os.path.dirname(__file__), keycert.pem)
ssl_context.load_cert_chain(cert_path)
ssl_context.load_verify_locations(cert_path)

- in addition to test_handle_read() and test_handle_write(), there
should be a test where a server and a client really send data to each
other, and receive at all

(also, I'm not sure why these tests can't be shared with non-SSL test
classes)

- test_create_socket() and test_bind() don't seem to test anything
SSL-related

--

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



[issue11126] Wave.py does not always write proper length in header

2011-02-12 Thread jtidman

jtidman jtid...@siliconcoral.com added the comment:

Yep, your solution is better.  I can provide some text files (lists of numbers) 
and two programs, wave2text.py and text2wav.py.  These are the programs I wrote 
that found this issue in the first place.  Add a few checks and you could run 
text2wave.py and then wave2text.py and verify that the results of these two 
steps match the original text files.

I look forward to working on this module with you.  Unfortunately the time 
frame would have to be sometime in 2011, as I am currently very busy.

--

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



[issue3860] GzipFile and BZ2File should support context manager protocol

2011-02-12 Thread K Richard Pixley

K Richard Pixley r...@noir.com added the comment:

Documentation needs to be updated to state that these are now context managers. 
 This is important since they aren't in python-2.x.

I'm not sure whether this should be added to the new in python blurbs.

--
nosy: +teamnoir

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



[issue10084] SSL support for asyncore

2011-02-12 Thread Giampaolo Rodola'

Giampaolo Rodola' g.rod...@gmail.com added the comment:

Initial draft of a patch including tests and a new ssl_dispatcher subclass.
asynchat needs to be changed as well, probably by using a mixin class.

--
keywords: +patch
Added file: http://bugs.python.org/file20752/asyncore_ssl_v1.patch

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



[issue11203] gzip doc is behind

2011-02-12 Thread K Richard Pixley

New submission from K Richard Pixley r...@noir.com:

The documentation for gzip should include the close method.

It's use in the 2.7 documentation implies it's existence but it should also be 
stated explicitly that it exists.

In the 3.x documentation, the use of close not in the examples since the 
examples use context manager.  For 3.x documentation there should be both an 
explicit mention of the close method as well as an explicit mention that 
GzipFile supports the context manager protocol.

Yes, the use of the context manager in the examples implies that this is true 
but documentation on other modules states so explicitly so this module should 
too.

--
assignee: docs@python
components: Documentation
messages: 128460
nosy: docs@python, teamnoir
priority: normal
severity: normal
status: open
title: gzip doc is behind
type: feature request
versions: Python 2.7, Python 3.3

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



[issue11202] Win32: shutil.move does not inherit permissions

2011-02-12 Thread Anders Østhus

Anders Østhus grapz...@gmail.com added the comment:

Ok, but the whole page you linked to (http://docs.python.org/library/shutil) 
confuses me then.

It states at the top:
Warning

Even the higher-level file copying functions (copy(), copy2()) can’t copy all 
file metadata.

On POSIX platforms, this means that file owner and group are lost as well as 
ACLs. On Mac OS, the resource fork and other metadata are not used. This means 
that resources will be lost and file type and creator codes will not be 
correct. On Windows, file owners, ACLs and alternate data streams are not 
copied.

Then, under shutil.copy: Permission bits are copied. I'm assuming this is UGO 
permissions on POSIX systems, and thus correct according to the top text.

shutil.copy2 says: Similar to shutil.copy, but with metadata.

Files copied with both shutil.copy and shutil.copy2 both inherits the 
permissions from their destination, but shutil.move does not.

According to the shutil doc page, neither copy or copy2 should do this. And 
since they do, and you say shutil.move is implemented using shutil.copy2, 
shouldn't files moved with shutil.move also then inherit the permissions?

--
status: closed - open

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



[issue11202] Win32: shutil.move does not inherit permissions

2011-02-12 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 According to the shutil doc page, neither copy or copy2 should do
 this. And since they do, and you say shutil.move is implemented using
 shutil.copy2, shouldn't files moved with shutil.move also then inherit
 the permissions?

There's a misunderstanding I think. shutil.move()'s main path uses
os.rename(). Only does it fall back on copy2() when rename() fails.

--

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



[issue11202] Win32: shutil.move does not inherit permissions

2011-02-12 Thread Anders Østhus

Anders Østhus grapz...@gmail.com added the comment:

Ok.

But that makes the whole method inconsistent.

Basically, if it's on the same filesystem, rename the file, and thus not 
inheriting ACL. If it's on another use copy2, and inherit ACL.

That makes no sense, atleast not to me :)

--

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



[issue9523] Improve dbm modules

2011-02-12 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

 Add rich compare functions and disjoint() method to dbm view objects
 to make them as MappingView objects, and add abc registration for them.
I’d prefer you not to register them, but test isinstance(keys(), KeysView), so 
that we’re sure no method is missing.  (Does not validate behavior, but it’s a 
starting point.)

Other comments on Rietveld (the code review site).

BTW, if you’re posting updated patches on Rietveld you can remove patches from 
this bug report, so that people don’t review old patches.  It would also be 
simpler to keep all discussion there :)

--

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



[issue5736] Add the iterator protocol to dbm modules

2011-02-12 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

#9523 has a more comprehensive patch in progress, adding __iter__ and other 
mapping methods, so I’m closing this one.

--
resolution:  - duplicate
stage:  - committed/rejected
status: open - closed
superseder:  - Improve dbm modules
versions:  -Python 3.2

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



[issue9523] Improve dbm modules

2011-02-12 Thread Éric Araujo

Éric Araujo mer...@netwok.org added the comment:

Closed #5736 as superseded.  Please make sure the comments there about the 
peculiar API of gdbm don’t come up or are addressed in your patch.

--

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



[issue11202] Win32: shutil.move does not inherit permissions

2011-02-12 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 Ok.
 
 But that makes the whole method inconsistent.
 
 Basically, if it's on the same filesystem, rename the file, and thus
 not inheriting ACL. If it's on another use copy2, and inherit ACL.

I think you're misunderstanding copy2. It will copy the ACL from the
source file, not from the target directory or filesystem.
Actually, if you look at copy2's implementation, it's just copyfile()
followed by copystat().

--

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



[issue11202] Win32: shutil.move does not inherit permissions

2011-02-12 Thread Anders Østhus

Anders Østhus grapz...@gmail.com added the comment:

On my system (Win Server 2008 R2 64-Bit, Python 2.7.1), when I use copy, copy2 
or move(to another filesystem), the file _will_ get the ACL of the DST folder, 
and remove any ACL in SRC file that the DST folder does not have.

Thus, it doesn't copy it from the source file, but inherits from the DST folder.

--

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



[issue11202] Win32: shutil.move does not inherit permissions

2011-02-12 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

 On my system (Win Server 2008 R2 64-Bit, Python 2.7.1), when I use
 copy, copy2 or move(to another filesystem), the file _will_ get the
 ACL of the DST folder, and remove any ACL in SRC file that the DST
 folder does not have.
 
 Thus, it doesn't copy it from the source file, but inherits from the
 DST folder.

Again, this follows from the warning at the top of the shutil doc page:

“On Windows, file owners, ACLs and alternate data streams are not
copied.”

If they are not copied, then obviously they simply get the default value
for a new file, which is simply the value of the containing folder.

--

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



[issue11202] Win32: shutil.move does not inherit permissions

2011-02-12 Thread Anders Østhus

Anders Østhus grapz...@gmail.com added the comment:

Thank you for taking the time to explain it to me, but it still seems 
inconsistent to me.

I did a test with the functions copy, copy2, move, os.rename, copyfile, both on 
the same filesystem and another filesystem, and the result is:

Same filesystem:
shutil.copy:Inherit
shutil.copy2:   Inherit
shutil.move:Original
os.rename:  Original
shutil.copyfile:Inherit

Different filesystem:
shutil.copy:Inherit
shutil.copy2:   Inherit
shutil.move:Inherit
os.rename:  Inherit
shutil.copyfile:Inherit

On the same system, the result will differ if you move the file to a different 
location on the same filesystem, or if you move it to another filesystem.

But still, I'm happy. I'll just use copy/copy2 and then delete the original 
file afterwards :)

--

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



[issue11202] Win32: shutil.move does not inherit permissions

2011-02-12 Thread Antoine Pitrou

Changes by Antoine Pitrou pit...@free.fr:


--
status: open - closed

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



[issue10181] Problems with Py_buffer management in memoryobject.c (and elsewhere?)

2011-02-12 Thread Pauli Virtanen

Pauli Virtanen p...@iki.fi added the comment:

I spent today some time to rewrite `memoryobject.c`, and cleaning up the 
Py_buffer handling in it. (I wrote also the Numpy PEP 3118 implementation, so 
this was straightforward to do.)

The end result is here: https://bitbucket.org/pv/cpython-stuff/changesets   
(bookmark bug/memoryview)

Some points of note:

- Clarification of ownership conventions for Py_buffer in docs:

  http://bitbucket.org/pv/cpython-stuff/changeset/805971191369

  The new implementation is written to respect the invariants
  mentioned there.

- Rewritten memoryobject:

  http://bitbucket.org/pv/cpython-stuff/src/817edc63ce4d/Objects/memoryobject.c

I didn't yet heavily test this (eg. against Numpy), but at least the Python 
test suite passes. There are also some minor corners that need to be polished. 
Also some new tests would be needed, as I slightly extended the slicing 
capabilities of memoryview.

Only one nasty point turned up: the existence of PyMemoryView_FromBuffer. This 
function breaks the ownership rules: the pointers in Py_buffer structure can 
point inside the structure --- and the structure can reside e.g. on the stack. 
Deep copying Py_buffer cannot in general be done, because this can mess up 
whatever bf_releasebuffer tries to do. The workaround here was to do a deep 
copy *only* for those pointers that point inside the struct --- although this 
violates the spirit of the ownership model, it should be essentially always 
safe to do, and I believe it is the correct solution (at least if 
PyMemoryView_FromBuffer is to be retained).

***

Comments are welcome.

--
nosy: +pv

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



[issue11160] ZipFile.comment expects bytes

2011-02-12 Thread yeswanth

yeswanth swamiyeswa...@yahoo.com added the comment:

IMO the Zipfile.comment should accept strings too instead of just accepting 
bytes , so patching should help i guess

--
nosy: +swamiyeswanth

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



[issue11181] TLS end connection not detected properly in retrbinary

2011-02-12 Thread Adi Roiban

Adi Roiban a...@roiban.ro added the comment:

Hi,

I apologies for raising this issues.

It looks like FTP_TLS is not available in Python 3.1 ... and retrbinary is 
working in Python 2.7.

What I actually done, was backporting ftplib.py from 2.7 to 2.5 and using 
pyOpenSSL instead of the standard ssl module.

It looks like the standard „ssl” module from 2.7 return 0 instead of 
ssl.ZeroReturnError.

--
resolution:  - invalid
status: open - closed
versions:  -Python 3.2, Python 3.3

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



[issue10181] Problems with Py_buffer management in memoryobject.c (and elsewhere?)

2011-02-12 Thread Antoine Pitrou

Antoine Pitrou pit...@free.fr added the comment:

Hello,

 I spent today some time to rewrite `memoryobject.c`, and cleaning up
 the Py_buffer handling in it. (I wrote also the Numpy PEP 3118
 implementation, so this was straightforward to do.)

Thanks for trying this.

 - Rewritten memoryobject:
 
 http://bitbucket.org/pv/cpython-stuff/src/817edc63ce4d/Objects/memoryobject.c

Some worrying things here:

* memoryview_getbuffer() doesn't call the original object's getbuffer.
  This means that if I do:
m = memoryview(some_object)
n = memoryview(m)
m.release()
  n ends up holding a buffer to some_object's memory, but some_object 
  doesn't know about it and can free the pointer at any time.

* same for _get_sub_buffer_index() and _get_sub_buffer_slice0().
  Actually, the whole concept of non-owner memoryviews seems flawed.

* the fact that slicing increments the parent memoryview's refcount 
  means that a loop like:
 while len(m):
   # do something
   m = m[1:]
  will end up keeping N chained memoryviews on the heap. Currently only
  the last memoryview remains alive.

Some other things:

* why do you accept the ellipsis when indexing? what is it supposed to 
  mean?

* please don't use #warning. Just put the TODO in a /* ... */.

* please no #if PY_VERSION_HEX = 0x0300. Just make your source
  py3k-compatible and we'll take care of backporting it to 2.x if your
  patch is accepted ;)

--

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



[issue11160] ZipFile.comment expects bytes

2011-02-12 Thread yeswanth

yeswanth swamiyeswa...@yahoo.com added the comment:

can we use str.encode() function to convert string into bytes ?

--

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



[issue11197] information leakage with SimpleHTTPServer

2011-02-12 Thread Gregory P. Smith

Gregory P. Smith g...@krypto.org added the comment:

Agreed, fixing this is going to be too complex for 3.2.0, it'll be done for 
3.2.1.

Reading over the http.server Simple and CGI HTTPRequestHandler code I see there 
many problems with the way this code does things today.

General:
 * I'm not sure urllib.parse.unquote() is called on the path in the correct 
place all the time.  Studying of some RFCs will be required to confirm that.  
Specifically the CGI handler unquotes the path before fixing it up.  The Simple 
handler never unquotes the path.

Simple (and subclasses such as CGI):
 * The mentioned directory traversal vulnerability.

CGI:
 * The _url_collapse_path_split called by is_cgi lets os.sep's through 
unchecked so a request for /foo/bar\..\..\..\..\..\../ for example should still 
find its way out on windows.  issue2254 wasn't 100% fixed.
 * _url_collapse_path_split should really ignore the query string and anchor; 
though the way it is used it likely just wastes time processing them and 
discarding the result.
 * It uses fork() + execve() on posix systems. It should always use subprocess 
instead in order to be thread safe.

The first thing I'll be doing is coming up with test cases demonstrating each 
of these issues.

--
versions:  -Python 2.5

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



[issue9298] binary email attachment issue with base64 encoding

2011-02-12 Thread Yves Dorfsman

Yves Dorfsman y...@zioup.com added the comment:

I've got two issues with this code (Lib/email/test/test_email.py):


1128 def test_body(self):
1129 eq = self.assertEqual
1130 bytes = b'\xfa\xfb\xfc\xfd\xfe\xff'
1131 msg = MIMEApplication(bytes)
1132 eq(msg.get_payload(), '+vv8/f7/')
1133 eq(msg.get_payload(decode=True), bytes)

1) Even though it works, I find the use of a defined type as the name of a 
variable confusing (line 1130, bytes).

2) The test on line 1132 fails if the base64 payload has an extra newline at 
the end, but newlines are not an issue in base64 and are actually expected. In 
fact the test at line 1133 shows that once decoded, the bytes are reverted to 
their original form.

Is there a way to find who is the author of this test, and what was the intent? 
Would the following test be acceptable (still testing a valid base64 encoding):

eq(msg.get_payload().strip(), '+vv8/f7/')


Thanks.

--

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