ANN: pyftpdlib 1.3.1 released

2014-04-14 Thread Giampaolo Rodola'
Hello,
I'm pleased to announce release 1.3.1 of Python FTP Server library
(pyftpdlib).
http://code.google.com/p/pyftpdlib/

=== About ===

Python FTP server library provides an high-level portable interface to
easily write very fast asynchronous FTP/S servers with Python.

=== Changes ===

- #282: async IO loop now uses /dev/poll on Solaris (far more scalable than
poll())
- #262: FTPS is now able to load a certificate chain file.
- #277: added a make file for running tests and for other repetitive tasks
(also for Windows).
- #281: source tarballs are now hosted on PYPI to make pip install
pyftpdlib easier.
- #283: fixed a pretty annoying logging-related issue.
- #261: (FTPS) SSL shutdown() was broken on Windows.

=== Links ===

* Online docs: http://code.google.com/p/pyftpdlib/wiki/Tutorial
* FAQs: http://code.google.com/p/pyftpdlib/wiki/FAQ
* Issue tracker: http://code.google.com/p/pyftpdlib/issues/list

-- 
Giampaolo - http://grodola.blogspot.com
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

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


SQLObject 1.5.2

2014-04-14 Thread Oleg Broytman
Hello!

I'm pleased to announce version 1.5.2, the second bugfix release of branch
1.5 of SQLObject.


What's new in SQLObject
===

* Adapt duplicate error message strings for SQLite 3.8.

Contributor for this release is Neil Muller.

For a more complete list, please see the news:
http://sqlobject.org/News.html


What is SQLObject
=

SQLObject is an object-relational mapper.  Your database tables are described
as classes, and rows are instances of those classes.  SQLObject is meant to be
easy to use and quick to get started with.

SQLObject supports a number of backends: MySQL, PostgreSQL, SQLite,
Firebird, Sybase, MSSQL and MaxDB (also known as SAPDB).


Where is SQLObject
==

Site:
http://sqlobject.org

Development:
http://sqlobject.org/devel/

Mailing list:
https://lists.sourceforge.net/mailman/listinfo/sqlobject-discuss

Archives:
http://news.gmane.org/gmane.comp.python.sqlobject

Download:
https://pypi.python.org/pypi/SQLObject/1.5.2

News and changes:
http://sqlobject.org/News.html

Oleg.
-- 
 Oleg Broytmanhttp://phdru.name/p...@phdru.name
   Programmers don't die, they just GOSUB without RETURN.
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

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


ANN: MyNewspaper v4.0

2014-04-14 Thread Iñigo Serna
Hi there,

I'm really pleased to announce a new release of MyNewspaper, a web-based
personal ATOM/RSS aggregator and feeds reader.
This new version has been completely rewritten from scratch.

It's under GNU Affero GPL License version 3 or later.

Some technical points of interest:
- written in Python 3.2+
- backend based on BottlePy web micro framework, FeedParser, SQLite,
DateUtil
- frontend with javascript (jQuery, jQueryUI)

More information, and download link at:
- [main] https://inigo.katxi.org/devel/mynewspaper
- [code repository] https://bitbucket.org/inigoserna/mynewspaper4


BLURB:
MyNewspaper can be considered an old project, as first version dates from
2005, and since then it has adopted and adapted different web paradigms:
CGI running on a web server in v1.0, pure web app in v2.0, javascript and
AJAX for v3.0.
A couple of years after v3.0 release I abandoned it to join Google Reader
wave, but since the announce of its shutdown I turned to MyNewspaper as I
didn't like any of the alternatives. Thus I rewrote from scratch all the
code. It was fast, I had a working version in a month, many weeks before
Google Reader closed, but then it took about 10 months more to write the
documentation…
Anyway, this is now version 4.0, a very fast and nice web-based feeds
reader for personal use.


Of course, all comments, suggestions etc. are welcome.

Best regards,
Iñigo Serna
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

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


ANN: Bookmarks v1.0

2014-04-14 Thread Iñigo Serna
Hi there,

Bookmarks is a simple personal web-based application to manage web
bookmarks.

It's written in Python 3.2+ and uses BottlePy web microframework and jQuery
javascript library. Both are included with the package.
It was coded as a funny practice, but it includes some nice features:
advanced search, tags cloud, years cloud.
I think this little application can be useful for anyone learning Python
web programming.

It's under GNU Affero GPL License version 3 or later.


More information, and download link at:
- [main] https://inigo.katxi.org/devel/bookmarks
- [code repository] https://bitbucket.org/inigoserna/bookmarks


Of course, all comments, suggestions etc. are welcome.

Best regards,
Iñigo Serna
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

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


Calico Scheme in Python

2014-04-14 Thread Doug Blank
We are writing to let you know of a recent spin-off from our Scheme
implementation work: we now have a version implemented in Python. This is a
full Scheme with proper tail-call recursion handling written in Python.

We also added some interesting Python-Scheme interactions:

* Scheme can use Python functions and libraries
* You can define Scheme functions for use in Python
* Python's list class serves the role for Scheme's vector class

Some sample uses:

You can just use calicoscheme.py as a script in Python, IronPython, or
Jython:

$ python calicoscheme.py
Calico Scheme, version 3.0.0

Use (exit) to exit
== (+ 1 1)
2

This environment has access to Python's built-ins through
calicoscheme.ENVIRONMENT:

== (sum '(1 2 3))

sum is found in the Python environment.

You can also import and use Python libraries directly:

== (using math numpy)
(math numpy)
== (math.sin 3.14)
0.0015926529164868282
== (numpy.array 10)
array(100)
== (exit) # or control+d

You can also use calicoscheme inside Python:

$ python
 import calicoscheme
 calicoscheme.ENVIRONMENT = globals()# set the environment to the
locals here
 calicoscheme.start_rm()
== (+ 1 1)
2
== (define! f (lambda (n) (+ n 1))) ### define! puts it in the
external env
== (exit)
goodbye

And back in Python you can call the define! function using Scheme's
infrastructure:

 f(100)
101

You can also call into Scheme like so:

 calicoscheme.execute_string_rm((define x 23))
void
 calicoscheme.execute_string_rm(x)
23

To download and get more information, please see:

http://calicoproject.org/Calico_Scheme
-- 
https://mail.python.org/mailman/listinfo/python-announce-list

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


Re: Teaching python to non-programmers

2014-04-14 Thread alex23

On 11/04/2014 3:42 PM, Rustom Mody wrote:

On Friday, April 11, 2014 10:41:26 AM UTC+5:30, Chris Angelico wrote:

On Fri, Apr 11, 2014 at 2:37 PM, Rustom Mody  wrote:

Right. Its true that when I was at a fairly large corporate, I was not told:
Please always top post!

What I was very gently and super politely told was:
Please dont delete mail context



Then you were told that by someone who does not understand email.



You seem to be cocksure who is right.
Im just curious who you think it is :-)


http://www.ietf.org/rfc/rfc1855.txt

If you are sending a reply to a message or a posting be sure you
summarize the original at the top of the message, or include just
enough text of the original to give a context.  This will make
sure readers understand when they start to read your response.
Since NetNews, especially, is proliferated by distributing the
postings from one host to another, it is possible to see a
response to a message before seeing the original.  Giving context
helps everyone.  But do not include the entire original!

RFC1855 is the PEP8 of posting online :)
--
https://mail.python.org/mailman/listinfo/python-list


Re: MemoryError in data conversion

2014-04-14 Thread dieter
Mok-Kong Shen mok-kong.s...@t-online.de writes:

 The code attached below produces in one of the two IMHO similar cases
 (excepting the sizes of the lists involved) MemoryError. Could experts
 kindly tell why that's so and whether there is any work-around feasible.

MemoryError means: the Python process wants more memory from the
operating system than this can give.

Your options:

  *  increase the memory resources (RAM, swap space) of your system

  *  check the memory related configuration of your operating system
 (there may be a limit for memory allocated to processes -
 try to increase this)

  *  change your algorithm such that less memory is needed

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


Re: Teaching python to non-programmers

2014-04-14 Thread Ian Kelly
On Mon, Apr 14, 2014 at 12:13 AM, alex23 wuwe...@gmail.com wrote:
 http://www.ietf.org/rfc/rfc1855.txt

 If you are sending a reply to a message or a posting be sure you
 summarize the original at the top of the message, or include just
 enough text of the original to give a context.  This will make
 sure readers understand when they start to read your response.
 Since NetNews, especially, is proliferated by distributing the
 postings from one host to another, it is possible to see a
 response to a message before seeing the original.  Giving context
 helps everyone.  But do not include the entire original!

 RFC1855 is the PEP8 of posting online :)

But it also says:

  Don't get involved in flame wars.  Neither post nor respond
  to incendiary material.

So we're already pretty much not in compliance.
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Teaching python to non-programmers

2014-04-14 Thread Mark Lawrence

On 14/04/2014 01:20, Steven D'Aprano wrote:

On Mon, 14 Apr 2014 00:54:02 +0100, Mark Lawrence wrote:


but the powers that be deem fit not
to take any action over.


There is no Internet police. Which is a good thing, for if there were,
this sort of criticism of the Internet police is exactly the sort of
thing that would bring down their wrath onto you.



I've been known on the odd occasion to get my bottom smacked.  The full 
wrath is reserved for Greek internet experts.


--
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.


Mark Lawrence

---
This email is free from viruses and malware because avast! Antivirus protection 
is active.
http://www.avast.com


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


Learner looking for assistance

2014-04-14 Thread Anthony Smith
Hi All

I am probably doing something wrong but don't know what 
Any help would great 

Code below 

the calc_total does not return a estimated_total_weight

if add the estimated_total_weight the rest of the code works 

I am at a lose as to why ?

def calc_total(self):
amount = 0
if self.estimated_weight_hd  0:
amount = self.number * self.estimated_weight_hd
return amount

def save(self):
self.estimated_total_weight = self.calc_total()
super(SaleNote, self).save()

def calc_total_price(self):
amount_price = 0
if self.sale_head  0:
amount_price = self.number * self.sale_head
return amount_price
else:
if self.estimated_total_weight  0:
amount_price = self.estimated_total_weight * self.sale_kg
return amount_price

def save(self):
self.total_price = self.calc_total_price()
super(SaleNote, self).save()

thanks 

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


Re: MemoryError in data conversion

2014-04-14 Thread Peter Otten
Mok-Kong Shen wrote:

 The code attached below produces in one of the two IMHO similar cases
 (excepting the sizes of the lists involved) MemoryError. Could experts
 kindly tell why that's so and whether there is any work-around feasible.

Here's a simpler way to reproduce the error:

 import ast
 def nested_list_literal(n):
... return [ * n + 42 + ] * n
... 
 ast.literal_eval(nested_list_literal(98))
[[42]]
 ast.literal_eval(nested_list_literal(99))
s_push: parser stack overflow
Traceback (most recent call last):
  File stdin, line 1, in module
  File /usr/lib/python3.3/ast.py, line 47, in literal_eval
node_or_string = parse(node_or_string, mode='eval')
  File /usr/lib/python3.3/ast.py, line 35, in parse
return compile(source, filename, mode, PyCF_ONLY_AST)
MemoryError

You ran into a limitation of the compiler. For us to suggest a workaround 
you'd have to explain why you want to convert the list returned from 
buildhuffmantree() into python source code and back.

 Thanks in advances.
 
 M. K. Shen
 
 -
 
 import ast
 
 def buildhuffmantree(slist,flist):
item=slist[:]
freq=flist[:]
while len(item)2:
  mn=min(freq)
  id=freq.index(mn)
  u=item[id]
  del item[id]
  del freq[id]
  mn1=min(freq)
  id=freq.index(mn1)
  v=item[id]
  del item[id]
  del freq[id]
  item.append([u,v])
  freq.append(mn+mn1)
return(item)
 
 def processing(slist,flist):
bintree=buildhuffmantree(slist,flist)
print(bintree)
byarray=bytearray(str(bintree),latin-1)
bintree1=ast.literal_eval(byarray.decode(latin-1))
print(bintree1)
print(bintree==bintree1)
 
 slist1=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 'eof']
 
 flist1=[18, 16, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1, 1, -1]
 
 slist2=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17,
  18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
  34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49,
  50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65,
  66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81,
  82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97,
  98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110,
  111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122, 123,
  124, 125, 126, 127, 'eof']
 
 flist2=[2, 2, 0, 2, 0, 0, 1, 2, 1, 0, 2, 0, 0, 1, 1, 0, 2, 0, 0, 0, 1,
  0, 0, 0, 2, 0, 0, 1, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 1, 0, 0, 0,
  0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  0, 1, 0, 2, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
  0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 1, 0, 0, 0, 0,
  0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
  0, 0, -1]
 
 processing(slist1,flist1)  ### This works fine
 print()
 
 processing(slist2,flist2)  ### This leads to MemoryError


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


Re: Language summit notes

2014-04-14 Thread wxjmfauth
Le dimanche 13 avril 2014 22:13:36 UTC+2, Terry Reedy a écrit :
 Everyone, please ignore Jim's unicode/fsr trolling, which started in 
 
 July 2012. Don't quote it, don't try to answer it.
 
 
 
 -- 
 
 Terry Jan Reedy

---

FYI:
I was waiting for the final 3.4 release.
I'm only now maintaining interactive interpreters
(with an s) to toy with unicode (and the coding
of characters) and some other tasks.

Python succeeded to become some kind of an anti
unicode tool (in the math sense, antisymmetric, non
symmetric, symmetric). Very interesting.

jmf


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


Re: Language summit notes

2014-04-14 Thread wxjmfauth
-

Unicode == Coding of the characters (all schemes) == math.

For those who are interested in that field, I recommand to
try to understand why we (the world) have to live with
all these coding schemes.

jmf

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


Re: Learner looking for assistance

2014-04-14 Thread Ben Finney
Anthony Smith jackie.walkab...@gmail.com writes:

 the calc_total does not return a estimated_total_weight

 if add the estimated_total_weight the rest of the code works 

 I am at a lose as to why ?

When it's too confusing, simplify. The code you present is fine, but is
more complex than it needs to be for the specific problem.

Also, it's not complete: it appears to be part of some larger program
that we don't have. And, it appears to have suffered re-formatting when
you put it in your message, so it won't run. (Post only in plain text,
not HTML; and copy-paste the code in plain text.)

So: start simple, make something you understand, then gradually build it
up until the point where it exhibits the behaviour you're confused by.

Then, show that simple-as-possible-but-no-simpler version here, complete
with the input you're using and the resulting output.

URL:http://www.sscce.org/

You may find that this process gives you enough understanding that you
are then able to solve the problem. Great! But, even if not, we'll need
you to go through that process so we can understand. Feel free to post
the simple version here if it still leaves you confused.

-- 
 \ “Nothing worth saying is inoffensive to everyone. Nothing worth |
  `\saying will fail to make you enemies. And nothing worth saying |
_o__)will not produce a confrontation.” —Johann Hari, 2011 |
Ben Finney

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


gdb python core dump file : not in executable format: File format not

2014-04-14 Thread Wesley
Hi guys,
   Today I am debugging an issue related to memory leak.
I use gdb 7.7 and python 2.7.6 to generate one core dump file from production 
env.

And then, just use gdb to debug the coredump upon the same machine.
Got error that seems not support debug core file using pyton?

Here is snippet:
[root@localhost server]# gdb --core  memleak.core 
GNU gdb (GDB) 7.7
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later http://gnu.org/licenses/gpl.html
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type show copying
and show warranty for details.
This GDB was configured as x86_64-unknown-linux-gnu.
Type show configuration for configuration details.
For bug reporting instructions, please see:
http://www.gnu.org/software/gdb/bugs/.
Find the GDB manual and other documentation resources online at:
http://www.gnu.org/software/gdb/documentation/.
For help, type help.
Type apropos word to search for commands related to word.
[New LWP 25738]
[New LWP 25739]
[New LWP 25740]
[New LWP 25745]
[New LWP 25746]
[New LWP 25747]
[New LWP 25635]
Core was generated by `python'.
#0  0x0030016e15e3 in ?? ()
(gdb) file /root/server/deviceserver.py 
/root/server/deviceserver.py: not in executable format: File format not 
recognized
(gdb) file /root/server/deviceserver
/root/server/deviceserver: No such file or directory.
(gdb) file /root/server/deviceserver.py 
/root/server/deviceserver.py: not in executable format: File format not 
recognized
(gdb) 
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Learner looking for assistance

2014-04-14 Thread Anthony Smith
On Monday, 14 April 2014 17:43:41 UTC+10, Anthony Smith  wrote:
 Hi All
 
 
 
 I am probably doing something wrong but don't know what 
 
 Any help would great 
 
 
 
 Code below 
 
 
 
 the calc_total does not return a estimated_total_weight
 
 
 
 if add the estimated_total_weight the rest of the code works 
 
 
 
 I am at a lose as to why ?
 
 
 
 def calc_total(self):
 
   amount = 0
 
   if self.estimated_weight_hd  0:
 
 amount = self.number * self.estimated_weight_hd
 
   return amount
 
   
 
   def save(self):
 
   self.estimated_total_weight = self.calc_total()
 
   super(SaleNote, self).save()
 
   
 
 def calc_total_price(self):
 
   amount_price = 0
 
   if self.sale_head  0:
 
   amount_price = self.number * self.sale_head
 
 return amount_price
 
 else:
 
 if self.estimated_total_weight  0:
 
 amount_price = self.estimated_total_weight * self.sale_kg
 
   return amount_price
 
 
 
 def save(self):
 
   self.total_price = self.calc_total_price()
 
   super(SaleNote, self).save()
 
 
 
 thanks 
 
 
 
 anthony

Thanks Ben this involves django as well forgot to mention in ear
lier post Maybe it a django issue rather code. Thats why I posted it here first.

thanks 

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


Re:Learner looking for assistance

2014-04-14 Thread Dave Angel
Anthony Smith jackie.walkab...@gmail.com Wrote in message:
 Hi All
 
 I am probably doing something wrong but don't know what 
 Any help would great 
 

As Ben pointed out,  you should be more careful with your
 copy/paste,  and especially with your indentation.  I'll assume
 these are all methods of a single class SaleNote,  and that none
 are nested.  If that's the case,  your problem is most likely
 that the second definition of save hides the first.


 Code below 
 
 the calc_total does not return a estimated_total_weight

Right,  it returns amount.  If it gets called,  which it doesn't
 from your code here. And it doesn't save that value, it only gets
 saved by the dead code below in the first save method.
 

 
 if add the estimated_total_weight the rest of the code works 
 
 I am at a lose as to why ?
 
 def calc_total(self):
   amount = 0
   if self.estimated_weight_hd  0:
 amount = self.number * self.estimated_weight_hd
   return amount
   
   def save(self):
   self.estimated_total_weight = self.calc_total()
   super(SaleNote, self).save()
   
 def calc_total_price(self):
   amount_price = 0
   if self.sale_head  0:
   amount_price = self.number * self.sale_head
 return amount_price
 else:
 if self.estimated_total_weight  0:
 amount_price = self.estimated_total_weight * self.sale_kg
   return amount_price
 
 def save(self):
   self.total_price = self.calc_total_price()
   super(SaleNote, self).save()
 
 

To make the rest of the code more readable,  consider using else
 clauses on every if, so that you can more readily spot missing
 cases. Turns out that wasn't your problem,  but it costs every
 reader of your code the time to decide that. 

Personally,  I'd be using the max function,  which would simplify
 the first function to one line. 

-- 
DaveA

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


Re: MemoryError in data conversion

2014-04-14 Thread Mok-Kong Shen

Am 14.04.2014 09:46, schrieb Peter Otten:


You ran into a limitation of the compiler. For us to suggest a workaround
you'd have to explain why you want to convert the list returned from
buildhuffmantree() into python source code and back.


That list gives the Huffman encoding tree for compressing a given piece
of source text. I am writing a Python code to implement an algorithm
(not new, being first sketched in the literature since decades but yet
having no publically available implementation as far as I am aware) of
encryption processing that has Huffman data compression as its major
constituent. Now, for good security against cryptanalysis, this list
(which has to be included in the ciphertext for decryption by the
recipient) has to be well scrambled in some way. I choose to use 8-bit
bytes as units for the scrambling. Hence I convert the list to a
bytearray for performing scrambling. On decryption I reverse the
scrambling and get back the original bytearray and use ast to recover
from it the list so as to be able to do the decompression. Hopefully
this description is sufficiently clear.

M. K. Shen


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


Re:MemoryError in data conversion

2014-04-14 Thread Dave Angel
Mok-Kong Shen mok-kong.s...@t-online.de Wrote in message:
 
 The code attached below produces in one of the two IMHO similar cases
 (excepting the sizes of the lists involved) MemoryError. Could experts
 kindly tell why that's so and whether there is any work-around feasible.

Where's your stack trace for the error?  If it happens that it
 gets the error in the Ast call, then examine byarray.  I expect
 it's too large or too complex for the compiler. 




-- 
DaveA

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


Martijn Faassen: The Call of Python 2.8

2014-04-14 Thread Mark Lawrence
http://blog.startifact.com/posts/the-call-of-python-28.html so in 
response to the last line, who *IS* going to do all of the required work?


--
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.


Mark Lawrence

---
This email is free from viruses and malware because avast! Antivirus protection 
is active.
http://www.avast.com


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


Re: Martijn Faassen: The Call of Python 2.8

2014-04-14 Thread Chris Angelico
On Mon, Apr 14, 2014 at 10:56 PM, Mark Lawrence breamore...@yahoo.co.uk wrote:
 http://blog.startifact.com/posts/the-call-of-python-28.html so in response
 to the last line, who *IS* going to do all of the required work?

Only someone for whom it's less work to build Python 2.8 than it is to
port their code to Python 3. In other words, some organization with a
megantic (that's one step below gigantic, you know [1]) Python
codebase, and some (but not heaps of) resources to put into it.
Personally, I don't see it happening; very little of the code required
will be backportable from Python 3 (in contrast to PEP 466 security
patches), so every bit of that work will be for the 2.x line only; and
any features added in 2.8 can't be used until you're prepared to drop
2.7 support. That means a fair amount of work *and* you have to drop
2.7 support. If you're going to do that, why not just port your code
to 3.x and be done with it? Who has the resources to put hours and
hours of dev time into a 2.8?

ChrisA

[1] Megantic is only +3/+3, but gigantic is 8/8. Look! :)
http://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=370794
http://gatherer.wizards.com/Pages/Card/Details.aspx?multiverseid=195627
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Martijn Faassen: The Call of Python 2.8

2014-04-14 Thread Marko Rauhamaa
Chris Angelico ros...@gmail.com:

 If you're going to do that, why not just port your code to 3.x and be
 done with it? Who has the resources to put hours and hours of dev time
 into a 2.8?

Somewhat related. Only yesterday I ported/reimplemented a software
package to python3. On the finish line, I ran into a problem: xlwt
only supports 2.6, 2.7 and 3.3. My system has python3.2.

So I backtracked to python2.7.

So not only do we have a schism between python2 and python3 but there's
one between 3.0 and 3.3. I can't help but wonder if PEP 414 was a
mistake.

Serves me right for being an early adopter.


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


Re: MemoryError in data conversion

2014-04-14 Thread Peter Otten
Mok-Kong Shen wrote:

 Am 14.04.2014 09:46, schrieb Peter Otten:
 
 You ran into a limitation of the compiler. For us to suggest a workaround
 you'd have to explain why you want to convert the list returned from
 buildhuffmantree() into python source code and back.
 
 That list gives the Huffman encoding tree for compressing a given piece
 of source text. I am writing a Python code to implement an algorithm
 (not new, being first sketched in the literature since decades but yet
 having no publically available implementation as far as I am aware) of
 encryption processing that has Huffman data compression as its major
 constituent. Now, for good security against cryptanalysis, this list
 (which has to be included in the ciphertext for decryption by the
 recipient) has to be well scrambled in some way. I choose to use 8-bit
 bytes as units for the scrambling. Hence I convert the list to a
 bytearray for performing scrambling. On decryption I reverse the
 scrambling and get back the original bytearray and use ast to recover
 from it the list so as to be able to do the decompression. Hopefully
 this description is sufficiently clear.

You could use json, but you may run into the same problem with that, too 
(only later):

 import json
 items = []
 for i in range(1000):
... s = json.dumps(items)
... items = [items]
... 
Traceback (most recent call last):
  File stdin, line 2, in module
  File /usr/lib/python3.3/json/__init__.py, line 236, in dumps
return _default_encoder.encode(obj)
  File /usr/lib/python3.3/json/encoder.py, line 191, in encode
chunks = self.iterencode(o, _one_shot=True)
  File /usr/lib/python3.3/json/encoder.py, line 249, in iterencode
return _iterencode(o, 0)
RuntimeError: maximum recursion depth exceeded while encoding a JSON object
 i
995

The safest option is probably to serialize the original flist and slist, and 
use them to create the tree on the fly.

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


Re: Martijn Faassen: The Call of Python 2.8

2014-04-14 Thread Chris Angelico
On Mon, Apr 14, 2014 at 11:51 PM, Marko Rauhamaa ma...@pacujo.net wrote:
 Chris Angelico ros...@gmail.com:

 If you're going to do that, why not just port your code to 3.x and be
 done with it? Who has the resources to put hours and hours of dev time
 into a 2.8?

 Somewhat related. Only yesterday I ported/reimplemented a software
 package to python3. On the finish line, I ran into a problem: xlwt
 only supports 2.6, 2.7 and 3.3. My system has python3.2.

 So I backtracked to python2.7.

 So not only do we have a schism between python2 and python3 but there's
 one between 3.0 and 3.3. I can't help but wonder if PEP 414 was a
 mistake.

 Serves me right for being an early adopter.

So get Python 3.3 for your system, then. It's not that hard. You might
need to build it from source (not hard at all), or grab packages from
a newer version of Debian/RHEL/etc (also not hard, although there
might be additional consequential package requirements). The two
should happily coexist.

Also, the EOL for Python 3.2 is way *way* nearer than EOL of the 2.x
line. If you declare that your package requires 2.6/2.7/3.3
(preferably also support 3.4), so be it. It won't be long before all
supported systems can get 3.3+, so that won't be a problem. PEP 414
was useful because we can confidently target a newer 3.3 and expect
that people will be able to get there before long.

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


Re: Martijn Faassen: The Call of Python 2.8

2014-04-14 Thread Marko Rauhamaa
Chris Angelico ros...@gmail.com:

 So get Python 3.3 for your system, then.

That'll have to wait till it's time for an OS overhaul. I don't do those
every year.


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


Re: Martijn Faassen: The Call of Python 2.8

2014-04-14 Thread Mark Lawrence

On 14/04/2014 14:51, Marko Rauhamaa wrote:

Chris Angelico ros...@gmail.com:


If you're going to do that, why not just port your code to 3.x and be
done with it? Who has the resources to put hours and hours of dev time
into a 2.8?


The people who haven't had enough time over the last eight years to plan 
their upgrade path to 3.x.  Eight years comes from the date of the first 
message here https://mail.python.org/pipermail/python-3000/ which was 
21/03/2006, so feel free to come up with a different answer for the time 
span.




Somewhat related. Only yesterday I ported/reimplemented a software
package to python3. On the finish line, I ran into a problem: xlwt
only supports 2.6, 2.7 and 3.3. My system has python3.2.

So I backtracked to python2.7.

So not only do we have a schism between python2 and python3 but there's
one between 3.0 and 3.3. I can't help but wonder if PEP 414 was a
mistake.


I still believe that PEP 404 was the correct thing to do.  PEP 414 was a 
no brainer :)




Serves me right for being an early adopter.


No, serves the community right for not providing enough support to 
authors in getting their packages updated.





Marko




--
My fellow Pythonistas, ask not what our language can do for you, ask 
what you can do for our language.


Mark Lawrence

---
This email is free from viruses and malware because avast! Antivirus protection 
is active.
http://www.avast.com


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


Re: Martijn Faassen: The Call of Python 2.8

2014-04-14 Thread Chris Angelico
On Tue, Apr 15, 2014 at 12:40 AM, Marko Rauhamaa ma...@pacujo.net wrote:
 Chris Angelico ros...@gmail.com:

 So get Python 3.3 for your system, then.

 That'll have to wait till it's time for an OS overhaul. I don't do those
 every year.

What OS? Since getting 3.3 isn't just a matter of grab the .msi/.dmg
file from python.org, I'm guessing it's neither Windows nor OS X, so
I'd guess you're most likely talking about Linux. On Linux, it's
pretty easy to build Python from source. Debian Wheezy ships Python
3.2, so with that distro you should be able to do this:

# apt-get build-dep python3

and it'll install everything you need to build Python 3.2 (and 3.3
needs the same packages). Then you just grab the source code and do
the classic configure and make.

Or if you don't want to build from source, you could get a package of
3.3 from somewhere. In the case of Debian, that would mean grabbing
the Python package from Jessie:

https://packages.debian.org/jessie/python3.3

I haven't tested, but that package will most likely install happily on
a Debian Wheezy. Chances are you can find an equivalent for other
Linuxes (I don't have much experience with rpm-based distros, but I'm
sure there's some equivalent of apt-get build-dep). For non-Linux
systems, I don't know how hard it is to get a newer Python, but it
seems highly unlikely that you're forced to wait for an OS upgrade.

Remember, there's nothing wrong with having lots of versions of Python
installed. The package manager might provide a couple (maybe 3.1 and
3.2), but having 3.3 installed won't break scripts that depend on 3.2
being there, unless you actually switch over what 'python3' does - and
even that's unlikely to break much, since most Linux distros are going
to be depending more on the 2.x version than the 3.x... and those that
depend on 3.x are sufficiently forward-looking to be shipping 3.3 or
even 3.4, so the point is moot.

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


Re: Martijn Faassen: The Call of Python 2.8

2014-04-14 Thread Chris Angelico
On Tue, Apr 15, 2014 at 12:46 AM, Mark Lawrence breamore...@yahoo.co.uk wrote:
 So not only do we have a schism between python2 and python3 but there's
 one between 3.0 and 3.3. I can't help but wonder if PEP 414 was a
 mistake.


 I still believe that PEP 404 was the correct thing to do.  PEP 414 was a no
 brainer :)

I'm pretty sure the 414 there wasn't a typo, since he's talking about
the schism between 3.0 and 3.3. But let's face it, there's a *lot* of
schism between there, and it's all the same sort of thing: code
written for 3.0 will usually run happily on 3.3, and code written to
take advantage of 3.3's features won't work on 3.0. That's kinda how
new versions work, yaknow...

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


Re: Martijn Faassen: The Call of Python 2.8

2014-04-14 Thread wxjmfauth
I will most probably backport two quite large applications
to Py27 (scientific data processing apps).
It's more a question of willingness, than a technical
difficulty. Then basta.
Note: cp1252 is good enough. (latin1/iso8859-1 not!).

jmf

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


Re: Martijn Faassen: The Call of Python 2.8

2014-04-14 Thread Pete Forman
Mark Lawrence breamore...@yahoo.co.uk writes:

 On 14/04/2014 14:51, Marko Rauhamaa wrote:
 Chris Angelico ros...@gmail.com:

 If you're going to do that, why not just port your code to 3.x and
 be done with it? Who has the resources to put hours and hours of dev
 time into a 2.8?

 The people who haven't had enough time over the last eight years to
 plan their upgrade path to 3.x. Eight years comes from the date of the
 first message here https://mail.python.org/pipermail/python-3000/
 which was 21/03/2006, so feel free to come up with a different answer
 for the time span.

Would it help if we adopted a non-numeric name for this product to
support eXisting Python for those who were notified some years ago that
Python 2 would be superseded? How about Python XP?

I thought not ;-)

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


Python hackathon ideas

2014-04-14 Thread Claudiu Popa
Hello!

I'm planning a Python hackathon in my area, which will be held in a
couple of weeks. Being my first organized hackathon, I don't quite
know on what we will be working. One idea I have is to find a couple
of open source projects and start contributing to them.
Another idea is to work on Python issues from the bug tracker, but
finding easy ones to contribute is not an easy task even for an
intermediate developer like me.
So, what I am looking for is open source Python projects with:

- no tests or very few tests at all
- no documentation or very scarce documentation
- Python 2 only (and we'll try to port them to Python 3)

I know about Python 3 Wall of superpowers, but most of the Python 2
only projects seems too big
for us to tackle in one day. If you know these kind of projects or you
have one which
needs those kind of things, please tell me. Any idea will be appreciated.

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


Re: Martijn Faassen: The Call of Python 2.8

2014-04-14 Thread Ian Kelly
On Apr 14, 2014 11:46 AM, wxjmfa...@gmail.com wrote:

 I will most probably backport two quite large applications
 to Py27 (scientific data processing apps).

These applications are already on Python 3? Why do you want them on Python
2? Even the people talking about a 2.8 are only seeing it as an upgrade
path to Python 3.

 It's more a question of willingness, than a technical
 difficulty. Then basta.
 Note: cp1252 is good enough. (latin1/iso8859-1 not!).

Because cp1252 includes that holiest of holies, the Euro sign, I assume.

Point of curiosity: if the first 256 codepoints of Unicode happened to
correspond to cp1252 instead of Latin-1, would you still object to the FSR?
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Martijn Faassen: The Call of Python 2.8

2014-04-14 Thread Ned Batchelder

On 4/14/14 2:59 PM, Ian Kelly wrote:

Point of curiosity: if the first 256 codepoints of Unicode happened to
correspond to cp1252 instead of Latin-1, would you still object to the FSR?


Many of us on the list would appreciate it if you didn't open that 
particular can of worms.  You are of course always welcome to write to 
JMF privately, although he has never responded to me over that channel.


--
Ned Batchelder, http://nedbatchelder.com

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


Re: gdb python core dump file : not in executable format: File format not

2014-04-14 Thread david.gar...@gmail.com
Does this help?

http://plasmodic.github.io/ecto/ecto/usage/external/debugging.html


http://gnuradio.org/redmine/projects/gnuradio/wiki/TutorialsDebugging


http://downloads.conceptive.be/downloads/camelot/doc/sphinx/build/advanced/debug.html

http://forums.gentoo.org/viewtopic-p-7123814.html


On Mon, Apr 14, 2014 at 1:19 AM, Wesley nisp...@gmail.com wrote:

 Hi guys,
Today I am debugging an issue related to memory leak.
 I use gdb 7.7 and python 2.7.6 to generate one core dump file from
 production env.

 And then, just use gdb to debug the coredump upon the same machine.
 Got error that seems not support debug core file using pyton?

 Here is snippet:
 [root@localhost server]# gdb --core  memleak.core
 GNU gdb (GDB) 7.7
 Copyright (C) 2014 Free Software Foundation, Inc.
 License GPLv3+: GNU GPL version 3 or later 
 http://gnu.org/licenses/gpl.html
 This is free software: you are free to change and redistribute it.
 There is NO WARRANTY, to the extent permitted by law.  Type show copying
 and show warranty for details.
 This GDB was configured as x86_64-unknown-linux-gnu.
 Type show configuration for configuration details.
 For bug reporting instructions, please see:
 http://www.gnu.org/software/gdb/bugs/.
 Find the GDB manual and other documentation resources online at:
 http://www.gnu.org/software/gdb/documentation/.
 For help, type help.
 Type apropos word to search for commands related to word.
 [New LWP 25738]
 [New LWP 25739]
 [New LWP 25740]
 [New LWP 25745]
 [New LWP 25746]
 [New LWP 25747]
 [New LWP 25635]
 Core was generated by `python'.
 #0  0x0030016e15e3 in ?? ()
 (gdb) file /root/server/deviceserver.py
 /root/server/deviceserver.py: not in executable format: File format not
 recognized
 (gdb) file /root/server/deviceserver
 /root/server/deviceserver: No such file or directory.
 (gdb) file /root/server/deviceserver.py
 /root/server/deviceserver.py: not in executable format: File format not
 recognized
 (gdb)
 --
 https://mail.python.org/mailman/listinfo/python-list




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


Re: Martijn Faassen: The Call of Python 2.8

2014-04-14 Thread Phil Dobbin
On 14/04/2014 13:56, Mark Lawrence wrote:

 http://blog.startifact.com/posts/the-call-of-python-28.html so in
 response to the last line, who *IS* going to do all of the required work?
 

On a related note, Guido announced today that there will be no 2.8 
that the eol for 2.7 will be 2020.

Cheers,

  Phil...

-- 
currently (ab)using
CentOS 6.5, Debian Squeeze  Wheezy, Fedora 19  20, OS X Snow Leopard,
RHEL 7, Ubuntu Precise  Saucy
GnuGPG Key : http://phildobbin.org/publickey.asc
Based in London, UK


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


Re: MemoryError in data conversion

2014-04-14 Thread Mok-Kong Shen

Am 14.04.2014 15:59, schrieb Peter Otten:


You could use json, but you may run into the same problem with that, too
(only later):


import json
items = []
for i in range(1000):

... s = json.dumps(items)
... items = [items]
...
Traceback (most recent call last):
   File stdin, line 2, in module
   File /usr/lib/python3.3/json/__init__.py, line 236, in dumps
 return _default_encoder.encode(obj)
   File /usr/lib/python3.3/json/encoder.py, line 191, in encode
 chunks = self.iterencode(o, _one_shot=True)
   File /usr/lib/python3.3/json/encoder.py, line 249, in iterencode
 return _iterencode(o, 0)
RuntimeError: maximum recursion depth exceeded while encoding a JSON object

i

995

The safest option is probably to serialize the original flist and slist, and
use them to create the tree on the fly.


Thank you very much for your efforts to help me.

I have yet a question out of curiosity: Why is my 2nd list structure,
that apparently is too complex for handling by eval and json, seemingly
not a problem for pickle?

M. K. Shen

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


Python, Linux, and the setuid bit

2014-04-14 Thread Ethan Furman
For anyone in the unenviable position of needing [1] to run Python scripts with the setuid bit on, there is an 
suid-python wrapper [2] that makes this possible.


When I compiled it I was given a couple warnings.  Can any one shed light on 
what they mean?

==
suid-python.c: In function ‘malloc_abort’:
suid-python.c:119:17: warning: format ‘%d’ expects argument of type ‘int’, but 
argument 3 has type ‘size_t’ [-Wformat]
suid-python.c: In function ‘remove_env_prefix’:
suid-python.c:200:32: warning: cast from pointer to integer of different size 
[-Wpointer-to-int-cast]
suid-python.c:201:32: warning: cast from pointer to integer of different size 
[-Wpointer-to-int-cast]
==

and the code segments in question:

==
void *
malloc_abort(size_t size)
{
void *buf;

buf = malloc(size);
if (!buf)
{
fprintf(stderr, Could not allocate %d bytes.  errno=%d\n,
size, errno);
exit(1);
}

return buf;
}
--
int
remove_env_prefix(char **envp, char *prefix)
{
char **envp_read;
char **envp_write;
int prefix_len = strlen(prefix);
int removed_count = 0;

envp_write = envp;
for (envp_read = envp; *envp_read; envp_read++)
{
if (!strncmp(*envp_read, prefix, prefix_len))
{
/* Step past the environment variable that we don't want. */
removed_count++;
continue;
}

if (envp_read != envp_write)
{
*envp_write = *envp_read;
}

envp_write++;
}

/* Set the remaining slots to NULL. */
if (envp_write  envp_read)
{
memset(envp_write, 0, ((unsigned int) envp_read -
   (unsigned int) envp_write));
}

return removed_count;
}
==

Thanks!

--
~Ethan~

[1] Need, or really really really convenient to have. ;)
[2] http://selliott.org/python/
--
https://mail.python.org/mailman/listinfo/python-list


Re: Python, Linux, and the setuid bit

2014-04-14 Thread John Gordon
In mailman.9260.1397511440.18130.python-l...@python.org Ethan Furman 
et...@stoneleaf.us writes:

  fprintf(stderr, Could not allocate %d bytes.  errno=%d\n,
  size, errno);

%d is not the correct specifier for printing objects of type size_t.

  char **envp_read;
  char **envp_write;

  if (envp_write  envp_read)
  {
  memset(envp_write, 0, ((unsigned int) envp_read -
 (unsigned int) envp_write));
  }

I think it's complaining about casting the char ** objects to unsigned int.

-- 
John Gordon Imagine what it must be like for a real medical doctor to
gor...@panix.comwatch 'House', or a real serial killer to watch 'Dexter'.

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


Re: Python, Linux, and the setuid bit

2014-04-14 Thread Grant Edwards
On 2014-04-14, John Gordon gor...@panix.com wrote:
 In mailman.9260.1397511440.18130.python-l...@python.org Ethan Furman 
 et...@stoneleaf.us writes:

  fprintf(stderr, Could not allocate %d bytes.  errno=%d\n,
  size, errno);

 %d is not the correct specifier for printing objects of type size_t.

I believe %zu is the correct format specifier for size_t values.

  char **envp_read;
  char **envp_write;

  if (envp_write  envp_read)
  {
  memset(envp_write, 0, ((unsigned int) envp_read -
 (unsigned int) envp_write));
  }

 I think it's complaining about casting the char ** objects to unsigned int.

If we assume that the author is trying to clear memory between the
addresses pointed to by the two variables, then it's probably better
be cast to (char *) before the subtracted.  That should result in an
integer value.

-- 
Grant Edwards   grant.b.edwardsYow! Please come home with
  at   me ... I have Tylenol!!
  gmail.com
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Python, Linux, and the setuid bit

2014-04-14 Thread Grant Edwards
On 2014-04-14, Grant Edwards invalid@invalid.invalid wrote:
 On 2014-04-14, John Gordon gor...@panix.com wrote:

  char **envp_read;
  char **envp_write;

  if (envp_write  envp_read)
  {
  memset(envp_write, 0, ((unsigned int) envp_read -
 (unsigned int) envp_write));
  }

 I think it's complaining about casting the char ** objects to unsigned int.

 If we assume that the author is trying to clear memory between the
 addresses pointed to by the two variables, then it's probably better
 be cast to (char *) before the subtracted.

Wow, I mangled that sentence.  It should have been something like:

then it's probably better to cast them to (char *) before the
subtraction.

 memset(envp_write, 0, ((char*)envp_read)-((char*)envp_write));

-- 
Grant Edwards   grant.b.edwardsYow! My mind is making
  at   ashtrays in Dayton ...
  gmail.com
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: MemoryError in data conversion

2014-04-14 Thread Gregory Ewing

Mok-Kong Shen wrote:

I have yet a question out of curiosity: Why is my 2nd list structure,
that apparently is too complex for handling by eval and json, seemingly
not a problem for pickle?


Pickle is intended for arbitrary data structures, so it
is designed to be able to handle deeply-nested and/or
recursive data. Eval only has to handle nesting to depths
likely to be encountered in source code. Apparently the
json parser also assumes you're not going to be using
very deep nesting.

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


Re: Python, Linux, and the setuid bit

2014-04-14 Thread Chris Angelico
On Tue, Apr 15, 2014 at 7:13 AM, Ethan Furman et...@stoneleaf.us wrote:
 When I compiled it I was given a couple warnings.  Can any one shed light on
 what they mean?

They mean, most likely, that the author compiled the program on his
own computer and not on any other. If I had to make a guess, I'd say
that it would compile nicely on a 32-bit system, and you're running a
64-bit system; according to gcc on my amd64 Debian Wheezy here,
sizeof(short) is 2 bytes, int is 4, long is 8.

Do you feel like patching the program? As Grant says, casting to (char
*) is the more usual way to do this sort of arithmetic. Since they're
being cast to (unsigned int), you'll *probably* get away with this, as
long as the environment doesn't exceed 4GB in size (!!), so you could
just ignore it (it's a warning, not an error, after all); but you can
probably fix it for all platforms by making the two changes Grant
suggested.

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


Re: Python hackathon ideas

2014-04-14 Thread Chris Angelico
On Tue, Apr 15, 2014 at 4:54 AM, Claudiu Popa pcmantic...@gmail.com wrote:
 - Python 2 only (and we'll try to port them to Python 3)

 I know about Python 3 Wall of superpowers, but most of the Python 2
 only projects seems too big
 for us to tackle in one day.

I suspect that, by now, any Py2 projects that could be ported to Py3
in one day have already been ported, or else nobody cares about them.

Generally, the best way to find a project to contribute to is to find
one that you actively and personally use. Dig into it and find
something that makes you go Wow, I didn't know you could do that with
it!, and there's a chance for a docs patch. Or dig through the bug
tracker and confirm some bugs; that's more useful than a lot of people
realize. Bug occurs on X with Y and Z... let's see if it happens for
me too.

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


Re:Python, Linux, and the setuid bit

2014-04-14 Thread Dave Angel
Ethan Furman et...@stoneleaf.us Wrote in message:
 For anyone in the unenviable position of needing [1] to run Python scripts 
 with the setuid bit on, there is an 
 suid-python wrapper [2] that makes this possible.
 
 When I compiled it I was given a couple warnings.  Can any one shed light on 
 what they mean?
 
 ==
 suid-python.c: In function �malloc_abort�:
 suid-python.c:119:17: warning: format �%d� expects argument of type �int�, 
 but argument 3 has type �size_t� [-Wformat]
 suid-python.c: In function �remove_env_prefix�:
 suid-python.c:200:32: warning: cast from pointer to integer of different size 
 [-Wpointer-to-int-cast]
 suid-python.c:201:32: warning: cast from pointer to integer of different size 
 [-Wpointer-to-int-cast]
 ==
 
 and the code segments in question:
 
 ==
 void *
 malloc_abort(size_t size)
 {
  void *buf;
 
  buf = malloc(size);
  if (!buf)
  {
  fprintf(stderr, Could not allocate %d bytes.  errno=%d\n,
  size, errno);

Your variable 'size' is declared as size_t, which is an integer
 the size of a pointer. Not necessarily the same as an int. But if
 your size is reasonable,  no harm done. The correct fix is to use
 some other format rather than % d, I forget what one. Second
 choice is to cast to an int. Third lousy choice,  ignore the
 warning. 


  exit(1);
  }
 
  return buf;
 }
 --
 int
 remove_env_prefix(char **envp, char *prefix)
 {
  char **envp_read;
  char **envp_write;
  int prefix_len = strlen(prefix);
  int removed_count = 0;
 
  envp_write = envp;
  for (envp_read = envp; *envp_read; envp_read++)
  {
  if (!strncmp(*envp_read, prefix, prefix_len))
  {
  /* Step past the environment variable that we don't want. */
  removed_count++;
  continue;
  }
 
  if (envp_read != envp_write)
  {
  *envp_write = *envp_read;
  }
 
  envp_write++;
  }
 
  /* Set the remaining slots to NULL. */
  if (envp_write  envp_read)
  {
  memset(envp_write, 0, ((unsigned int) envp_read -
 (unsigned int) envp_write));

(you really should have put a comment,  so we'd know this is line
 200, 201)

It's incorrect to cast each pointer to an int, but not the
 difference of two pointers.  Subtract the first,  then cast if
 you must.  But the difference of two pointers is type ptr_diff,
 and that should already be the type mem set is expecting.
 


 
 


-- 
DaveA

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


Re: Python, Linux, and the setuid bit

2014-04-14 Thread Ethan Furman

On 04/14/2014 06:33 PM, Dave Angel wrote:


(you really should have put a comment,  so we'd know this is line
  200, 201)


Sorry, not used to asking questions about C code.  ;)  I'll make sure and do 
that next time.

Thanks for the help!

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


Re: Python, Linux, and the setuid bit

2014-04-14 Thread Ethan Furman

Thanks to everyone for the pointers.  ;)

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


Re: Python, Linux, and the setuid bit

2014-04-14 Thread Chris Angelico
On Tue, Apr 15, 2014 at 11:38 AM, Ethan Furman et...@stoneleaf.us wrote:
 Thanks to everyone for the pointers.  ;)

Pun intended, I hope...?

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


Re: Python hackathon ideas

2014-04-14 Thread Rustom Mody
On Tuesday, April 15, 2014 12:24:47 AM UTC+5:30, Claudiu Popa wrote:
 Hello!
 
 I'm planning a Python hackathon in my area, which will be held in a
 couple of weeks. Being my first organized hackathon, I don't quite
 know on what we will be working.

Just yesterday I discovered that kodos that used to work is now not working
probably due to bit rot http://kodos.sourceforge.net/

Its a python-based and python-supporting app to create/debug regular 
expressions.
Whether its a scale suitable for your hackathon I dont really know.

All the best for the hackathon!
-- 
https://mail.python.org/mailman/listinfo/python-list


Re: Martijn Faassen: The Call of Python 2.8

2014-04-14 Thread Terry Reedy

On 4/14/2014 9:51 AM, Marko Rauhamaa wrote:

Chris Angelico ros...@gmail.com:


If you're going to do that, why not just port your code to 3.x and be
done with it? Who has the resources to put hours and hours of dev time
into a 2.8?


Somewhat related. Only yesterday I ported/reimplemented a software
package to python3. On the finish line, I ran into a problem: xlwt
only supports 2.6, 2.7 and 3.3. My system has python3.2.

So I backtracked to python2.7.

So not only do we have a schism between python2 and python3 but there's
one between 3.0 and 3.3. I can't help but wonder if PEP 414 was a
mistake.


The 'mistake' is your OS, whatever it is, not providing 3.3. It is 
already so old that it is off bugfix maintenance. Any decent system 
should have 3.4 available now.


In any case, I think PEP 393 (new unicode implementation) is reason 
enough to jump to 3.3.


--
Terry Jan Reedy

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


Re: Martijn Faassen: The Call of Python 2.8

2014-04-14 Thread Terry Reedy

On 4/14/2014 8:56 AM, Mark Lawrence wrote:

http://blog.startifact.com/posts/the-call-of-python-28.html so in
response to the last line, who *IS* going to do all of the required work?


Steve Dower of Microsoft proposed a similar idea of a migration version 
of 2.7 after talking with people from businesses that use Python. His 
proposal engenders the same question. I don't really care. I just know 
that I am not volunteering my time to help billion-dollar corporations 
with 1000s of employees.


--
Terry Jan Reedy

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


Re: Martijn Faassen: The Call of Python 2.8

2014-04-14 Thread Marko Rauhamaa
Terry Reedy tjre...@udel.edu:

 Any decent system should have 3.4 available now.

Really, now? Which system is that?


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


[issue17088] ElementTree incorrectly refuses to write attributes without namespaces when default_namespace is used

2014-04-14 Thread Stefan Behnel

Stefan Behnel added the comment:

@gene_wood: that's unrelated. This ticket is about attributes being rejected 
incorrectly.

Fixing the example of the OP:

 from xml.etree.ElementTree import *
 svg = ElementTree(XML(
... svg width=12cm height=4cm viewBox=0 0 1200 400 
xmlns=http://www.w3.org/2000/svg; version=1.1
... rect x=1 y=1 width=1198 height=398 fill=none stroke=blue 
stroke-width=2 /
... /svg
... ))
 tostring(svg.getroot())   # formatting is mine
b'svg:svg xmlns:svg=http://www.w3.org/2000/svg; height=4cm version=1.1 
viewBox=0 0 1200 400 width=12cm\n
  svg:rect fill=none height=398 stroke=blue stroke-width=2 
width=1198 x=1 y=1 /\n
  /svg:svg'
 svg.write('simple_new.svg',encoding='UTF-8',default_namespace='http://www.w3.org/2000/svg')
Traceback (most recent call last):
  File stdin, line 1, in module
  File /usr/lib/python3.3/xml/etree/ElementTree.py, line 826, in write
qnames, namespaces = _namespaces(self._root, default_namespace)
  File /usr/lib/python3.3/xml/etree/ElementTree.py, line 942, in _namespaces
add_qname(key)
  File /usr/lib/python3.3/xml/etree/ElementTree.py, line 920, in add_qname
cannot use non-qualified names with 
ValueError: cannot use non-qualified names with default_namespace option
 svg.write('simple_new.svg',encoding='UTF-8')
 

So, it works without namespace defaulting and fails with an incorrect error 
when a default namespace is provided. Clearly a bug.

Regarding the proposed patch: it looks like the right thing to do in general, 
but it has a relatively high code impact. I would prefer a patch with lower 
churn. One thing that could be tried is to use only one tag cache dict and 
extend the key from the plain tag to (tag, is_attribute). Might have a 
performance impact on the already slow serialiser, though. In any case, both 
approaches are quite wasteful, because they duplicate the entire 
namespace-prefix mapping just because there might be a single namespace that 
behaves differently for atributes. An alternative could be to split the *value* 
of the mapping in two: (element_prefix, attribute_prefix). This would keep the 
overhead at serialisation low, with only slightly more work when building the 
mapping. At first sight, I like that idea better.

This code returns a list in one case and a set-like view in another (Py3):

+if default_namespace:
+prefixes_list = [ (default_namespace, ) ]
+prefixes_list.extend(namespaces.items())
+else:
+prefixes_list = namespaces.items()

I can't see the need for this change. Why can't the default namespace be stored 
in the namespaces dict right from the start, as it was before?

As a minor nitpick, this lambda based sort key:

key=lambda x: x[1]):  # sort on prefix

is better expressed using operator.itemgetter(1).

I'd also rename the defaultable flag to is_attribute and pass it as keyword 
argument (bare boolean parameters are unreadable in function calls).

Given the impact of this change, I'd also suggest not applying it to Py2.x 
anymore.

--

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



[issue21196] Name mangling example in Python tutorial

2014-04-14 Thread Chandan Kumar

Chandan Kumar added the comment:

Uploading the patch for the improvement to the name mangling section of the 
Python tutorial.  Please note that the modification is much smaller than I 
proposed earlier.

--
keywords: +patch
Added file: http://bugs.python.org/file34814/docs_name_mangling.patch

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



[issue21212] Documentation of octal representation

2014-04-14 Thread Bill

New submission from Bill:

This documentation section:
https://docs.python.org/3/faq/programming.html?highlight=octal#how-do-i-convert-a-string-to-a-number
seems still to refer to Python 2 octal representation rules.  So I think it 
needs updating.

--
assignee: docs@python
components: Documentation
messages: 216069
nosy: docs@python, ees1wc
priority: normal
severity: normal
status: open
title: Documentation of octal representation
versions: Python 3.5

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



[issue1484] logging: callHandlers tests handler levels instead of logger levels?

2014-04-14 Thread Artur

Artur added the comment:

So what is logger level for if it's not used on calling handlers?

--
nosy: +artur.ambroziak
versions: +Python 2.7 -Python 2.4, Python 2.5

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



[issue21213] Memory bomb by incorrect custom serializer to json.dumps

2014-04-14 Thread saaj

New submission from saaj:

I was chaning an implementation of the function that is passed to json.dumps to 
extend serializable types. By a mistake (**return** instead of **raise**) it 
turned into, which at its minum can be expressed as::

  def d(obj):
return TypeError(repr(obj))

  json.dumps(1j, default = d) 

After a few moments by laptop froze, though after a minute I could open shell 
in separate session, and top command showed that python interpretter is 
consuming about 4GiB of memory and 50% of 4 logical cores. 

Worst about it it doesn't end with any exception, it just keeps running. 
Without ``repr`` it ends up with somewhat expected ``RuntimeError: maximum 
recursion depth exceeded while getting the str of an object``.

The same behaviour is on python3, where it just consumes memory with less speed.

OS:
Linux Mint 15 Olivia
Linux 3.8.0-31-generic #46-Ubuntu SMP Tue Sep 10 20:03:44 UTC 2013 x86_64

Packages are last available:
python  2.7.4-0ubuntu1
python3 3.3.1-0ubuntu1

P.S. Sorry for confirming on console at python.org.

--
components: Library (Lib)
messages: 216071
nosy: saaj
priority: normal
severity: normal
status: open
title: Memory bomb by incorrect custom serializer to json.dumps
versions: Python 2.7, Python 3.3

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



[issue21214] PEP8 doesn't verifies last line.

2014-04-14 Thread Max

New submission from Max:

PEP8 doesn't verifies last line at all. Also W292 will never be checked.
Reproducible on PEP8 = 1.5.0

--
messages: 216072
nosy: f1ashhimself
priority: normal
severity: normal
status: open
title: PEP8 doesn't verifies last line.
type: behavior

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



[issue18321] Multivolume support in tarfile module

2014-04-14 Thread Lars Gustäbel

Lars Gustäbel added the comment:

Okay, let me tell you why I reject your contribution at this point.

The patch you submitted may be well-suited for your purposes but it does not 
meet the requirements of a standard library implementation because it is not 
generic and comprehensive enough.

It contains duplicate code, spelling mistakes and needless code changes e.g.  
in test_tarfile.py.

It does not expose one set of volumes as one tar archive to the user. It is not 
possible to iterate over all members of all volumes in one go. It does not 
allow random-access.

Actually, it does not implement complete multivolume support but only the 
easy parts.  For example, it fails to read GNU tar archives that are split in 
the middle of a pax header block sequence. The other way around, when writing 
it makes a split only when it is inside the data part of a member. Hence, it is 
possible that a volume turns out smaller than max_volume_size which is not only 
inaccurate but also bad on a tape device.

If you decide that you still want multivolume support in tarfile, feel free to 
reopen this issue with a new and significantly better patch. I gave you a 
number of clues on what I think is required.

--
assignee:  - lars.gustaebel
resolution:  - rejected
status: open - closed

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



[issue21214] PEP8 doesn't verifies last line.

2014-04-14 Thread Mark Dickinson

Mark Dickinson added the comment:

The pep8 tool is a third-party package: it isn't part of the core Python 
project.  You probably want to report this at the pep8 bugtracker:

http://github.com/jcrocholl/pep8/issues

--
nosy: +mark.dickinson
resolution:  - 3rd party
status: open - closed

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



[issue21212] Documentation of octal representation

2014-04-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset fb7bc8fe0d49 by Eric V. Smith in branch '3.4':
Fix text about int() with octal numbers. Closes #21212.
http://hg.python.org/cpython/rev/fb7bc8fe0d49

New changeset 6107a727c60a by Eric V. Smith in branch 'default':
Merge 3.4: Fix text about int() with octal numbers. Closes #21212.
http://hg.python.org/cpython/rev/6107a727c60a

--
nosy: +python-dev
resolution:  - fixed
stage:  - committed/rejected
status: open - closed

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



[issue21212] Documentation of octal representation

2014-04-14 Thread Eric V. Smith

Eric V. Smith added the comment:

Fixed. Thanks!

--
nosy: +eric.smith
resolution: fixed - 
stage: committed/rejected - 
status: closed - open

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



[issue21212] Documentation of octal representation

2014-04-14 Thread Berker Peksag

Changes by Berker Peksag berker.pek...@gmail.com:


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

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



[issue21169] getpass.getpass() fails with non-ASCII characters in prompt

2014-04-14 Thread R. David Murray

R. David Murray added the comment:

Ok, I'll reopen the issue to do that.

--
status: closed - open

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



[issue21169] getpass.getpass() fails with non-ASCII characters in prompt

2014-04-14 Thread Kushal Das

Kushal Das added the comment:

Another patch with docs update and one line code comment.

--
Added file: http://bugs.python.org/file34815/issue21169_v7.patch

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



[issue20077] Format of TypeError differs between comparison and arithmetic operators

2014-04-14 Thread R. David Murray

R. David Murray added the comment:

I think 'please review' was directed at anyone, and yes, using the review link 
is one way to do a review, but when there isn't enough line-by-line commenting 
to make the code review tool worth using you can just post on the issue.  (And 
when you do use the review link, it is helpful to post a message here that you 
did, since one doesn't appear automatically...which is something we need to 
fix.)

--
nosy: +r.david.murray

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



[issue21215] build-deps instructions for Ubuntu

2014-04-14 Thread Glenn Jones

New submission from Glenn Jones:

The package listed in the dev guide may not exist depending on the version of 
Ubuntu. It may be necessary to use python3.3 or python3.4.

--
components: Devguide
messages: 216080
nosy: Glenn.Jones, ezio.melotti
priority: normal
severity: normal
status: open
title: build-deps instructions for Ubuntu

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



[issue21169] getpass.getpass() fails with non-ASCII characters in prompt

2014-04-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset bdde36cd9048 by R David Murray in branch '3.4':
#21169: add comment and doc update for getpass change.
http://hg.python.org/cpython/rev/bdde36cd9048

New changeset fe532dccf8f6 by R David Murray in branch 'default':
Merge: #21169: add comment and doc update for getpass change.
http://hg.python.org/cpython/rev/fe532dccf8f6

--

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



[issue21169] getpass.getpass() fails with non-ASCII characters in prompt

2014-04-14 Thread R. David Murray

R. David Murray added the comment:

I decided to tweak the language slightly, Kushal.  If this isn't what you were 
looking for, Martin, let me know.

--
status: open - closed

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



[issue20434] Process crashes if not enough memory to import module

2014-04-14 Thread Eric Snow

Eric Snow added the comment:

I was going to say we should consider changing the API of _PyBytes_Resize() and 
_PyString_Resize().  However, having looked at the two functions, I guess it 
makes sense.

Looking at the patch, I'd argue that we still need to set the string to NULL in 
the error case.  Only in the out-of-memory case do the two functions change it 
to NULL for you.

--

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



[issue19980] Improve help('non-topic') response

2014-04-14 Thread Jessica McKellar

Jessica McKellar added the comment:

Elias, thanks for your patch!

I think it's important to add the second part of Terry's suggestion which gives 
the user a specific next step to take, namely:

 Try help('help') for information on recognized strings or help(str) for help 
 on the str class.

Can you add that to your patch?

Additionally, we'll want to make sure we don't accidentally break this new 
functionality. Can you add a few test cases, for example what happens when you 
run help on a module (e.g. help(os), 2) help on an instance of a class (e.g. 
help(1)), and help on a string that doesn't have a special meaning, (e.g. 
help(abcxyz))?

I don't see any existing tests for help(), but it is an instance of 
site._Helper (as reported by type(help)), and site tests live in 
Lib/test/test_site.py. It also gets loaded into builtins, so tests could also 
live in Lib/test/test_builtins.py.

--
nosy: +Jessica.McKellar, jesstess

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



[issue21209] q.put(some_tuple) fails when PYTHONASYNCIODEBUG=1

2014-04-14 Thread Guido van Rossum

Guido van Rossum added the comment:

This is nice (a backport 3.3 would be even nicer) but at least for the PyPI
repo version of Tulip I'd like to have work-around so people won't run into
this when they are using a slightly outdated Python version. I'll think
about which of my work-arounds is safe for that while not breaking the
intended functionality of CoroWrapper (i.e. that it prints a warning when
destructed before it has reached the end). That may require setting an
additional flag.

--

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



[issue21215] build-deps instructions for Ubuntu

2014-04-14 Thread Glenn Jones

Changes by Glenn Jones gl...@millenniumhand.co.uk:


--
keywords: +patch
Added file: http://bugs.python.org/file34816/ubuntu-build-dep.patch

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



[issue21215] build-deps instructions for Ubuntu

2014-04-14 Thread R. David Murray

R. David Murray added the comment:

Since you are saying that it is sometimes necessary to use a different 
package, perhaps we should be saying that in the devguide?  And providing the 
possible names.

--
nosy: +barry, r.david.murray

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



[issue20434] Process crashes if not enough memory to import module

2014-04-14 Thread Kristján Valur Jónsson

Kristján Valur Jónsson added the comment:

I would also advocate for a better api, that leaves it up to the caller what to 
do, much like realloc() does.  A convenience macro that frees the block on 
error could then be provided.  But this is 2.7 and we don't change stuff there 
:)

Can you elaborate on your second comment?  Is there some place where I forgot 
to clear the object?

--

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



[issue21215] build-deps instructions for Ubuntu

2014-04-14 Thread Glenn Jones

Glenn Jones added the comment:

On Ubuntu 13.10, using python3 did not install the dependencies (apt reported 
using the python3-defaults source package instead of python3). The python3.4, 
package does not exist, but the python3.3 package did work.

This may be that we're specifying the wrong package or that the upstream Ubuntu 
package has a bug or maybe we just need to use the specific package depending 
on what's available in the ubuntu version.

barry, what do you think?

--

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



[issue12546] builtin __format__ methods cannot fill with \x00 char

2014-04-14 Thread Eric V. Smith

Changes by Eric V. Smith e...@trueblade.com:


--
type: enhancement - behavior
versions: +Python 2.7, Python 3.4

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



[issue17498] error responses from server are masked in smtplib when server closes connection

2014-04-14 Thread Kushal Das

Kushal Das added the comment:

New version of the patch which can be successfully applied to tip.

--
Added file: http://bugs.python.org/file34817/issue17498_v2.patch

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



[issue20434] Process crashes if not enough memory to import module

2014-04-14 Thread Eric Snow

Eric Snow added the comment:

For example, in the patch binascii_b2a_uu() in Modules/binascii.c no longer 
sets rv to NULL even though in one of the _PyString_Resize() error cases rv is 
not automatically set to NULL.  And simply setting rv to NULL would be 
backward-incompatible as well.

--

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



[issue20624] Clarify recommendation to inherit from Exception

2014-04-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 8dc1b45bd467 by Mark Dickinson in branch '3.4':
Issue #20624: Exception docs wording tweak - clarify that it's okay to inherit 
from a subclass of Exception.
http://hg.python.org/cpython/rev/8dc1b45bd467

New changeset 262204877004 by Mark Dickinson in branch 'default':
Issue #20624: Merge exception docs tweak from 3.4 branch.
http://hg.python.org/cpython/rev/262204877004

--
nosy: +python-dev

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



[issue6623] Lib/ftplib.py Netrc class should be removed.

2014-04-14 Thread Matt Chaput

Matt Chaput added the comment:

This patch is the same as my previous one, except instead of removing Netrc 
usage from the ftplib.test() function, it replaces it with the netrc.netrc 
object. Note that there are no existing tests for the ftplib.test() function.

Also did some very minor cleanups (bare raise is no longer valid) to get rid of 
warnings/errors in static analyzer.

--
Added file: http://bugs.python.org/file34818/remove_Netrc_class2.patch

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



[issue12546] builtin __format__ methods cannot fill with \x00 char

2014-04-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 520ce42ba2b8 by Eric V. Smith in branch '2.7':
Issue #12546: Allow \x00 as a fill character for builtin type __format__ 
methods.
http://hg.python.org/cpython/rev/520ce42ba2b8

--
nosy: +python-dev

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



[issue20968] mock.MagicMock does not mock __truediv__

2014-04-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 445ef3b58109 by Michael Foord in branch '3.4':
Issue 20968. unittest.mock.MagicMock now supports division
http://hg.python.org/cpython/rev/445ef3b58109

--
nosy: +python-dev

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



[issue20434] Process crashes if not enough memory to import module

2014-04-14 Thread Kristján Valur Jónsson

Kristján Valur Jónsson added the comment:

This is _PyString_Resize(). I don't immediatlly see an error case where the 
string isn't freed:

int
_PyString_Resize(PyObject **pv, Py_ssize_t newsize)
{
register PyObject *v;
register PyStringObject *sv;
v = *pv;
if (!PyString_Check(v) || Py_REFCNT(v) != 1 || newsize  0 ||
PyString_CHECK_INTERNED(v)) {
*pv = 0;
Py_DECREF(v);
PyErr_BadInternalCall();
return -1;
}
/* XXX UNREF/NEWREF interface should be more symmetrical */
_Py_DEC_REFTOTAL;
_Py_ForgetReference(v);
*pv = (PyObject *)
PyObject_REALLOC((char *)v, PyStringObject_SIZE + newsize);
if (*pv == NULL) {
PyObject_Del(v);
PyErr_NoMemory();
return -1;
}
_Py_NewReference(*pv);
sv = (PyStringObject *) *pv;
Py_SIZE(sv) = newsize;
sv-ob_sval[newsize] = '\0';
sv-ob_shash = -1;  /* invalidate cached hash value */
return 0;
}

--

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



[issue20624] Clarify recommendation to inherit from Exception

2014-04-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset f729a0e90c4f by Mark Dickinson in branch '2.7':
Issue #20624: Merge exception docs tweak from 3.4 branch.
http://hg.python.org/cpython/rev/f729a0e90c4f

--

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



[issue20624] Clarify recommendation to inherit from Exception

2014-04-14 Thread Mark Dickinson

Mark Dickinson added the comment:

Fixed.  Closing.

--
resolution:  - fixed
status: open - closed
versions: +Python 3.5 -Python 3.3

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



[issue17826] Setting a side_effect on mock from create_autospec doesn't work

2014-04-14 Thread Michael Foord

Michael Foord added the comment:

Can you explain why we need to check for the call_count here? I don't 
understand why this is needed.

--

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



[issue12220] minidom xmlns not handling spaces in xmlns attribute value field

2014-04-14 Thread Marek Stepniowski

Marek Stepniowski added the comment:

Added test to amathew's patch.

--
nosy: +mstepniowski
Added file: 
http://bugs.python.org/file34819/minidom_space_char_in_namespace_with_test.patch

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



[issue7776] http.client.HTTPConnection tunneling is broken

2014-04-14 Thread Senthil Kumaran

Senthil Kumaran added the comment:

I verified the patch and this indeed corrects a nasty bug in sending a wrong 
header when doing it a lower level HTTPSConnection to proxy and set_tunnel (bad 
term) to the end host..I was worried as why we did not observe this earlier and 
it seems to me that the advertised way to do HTTPS CONNECT is via Proxy Handler 
or urllib.request and when doing it via a ProxyHandler, these wierdly named 
action (set_tunnel) happen underneath, but the skip_hosts bit is set as we got 
headers from the higher level method. and the host header is carried 
transparently to the tunnel connection request and thus we escaped this. 

The patch fixes the problem and cleans up a bit. Thanks for that , Nikolaus.

This code (http/client.py) will require more attention beyond this bug too.

--

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



[issue20968] mock.MagicMock does not mock __truediv__

2014-04-14 Thread Michael Foord

Michael Foord added the comment:

Thanks!

--
assignee:  - michael.foord
resolution:  - fixed
stage:  - committed/rejected
status: open - closed

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



[issue15104] Unclear language in __main__ description

2014-04-14 Thread Sam Lucidi

Sam Lucidi added the comment:

I've attempted to synthesize the ideas in this thread into a clearer 
explanation of __main__. What I've written doesn't attempt to explain anything 
else about module naming, but it does try to address the common package and 
module uses of __main__.

--
keywords: +patch
nosy: +mansam
Added file: 
http://bugs.python.org/file34820/clarify-__main__-documentation.patch

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



[issue15104] Unclear language in __main__ description

2014-04-14 Thread R. David Murray

R. David Murray added the comment:

I've made some review comments.

--

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



[issue15104] Unclear language in __main__ description

2014-04-14 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
stage: needs patch - patch review
versions: +Python 3.5 -Python 3.2, Python 3.3

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



[issue4963] mimetypes.guess_extension result changes after mimetypes.init()

2014-04-14 Thread Toshio Kuratomi

Toshio Kuratomi added the comment:

Took a look at this and was able to reproduce it on Fedora Linux 20 and current 
cpython head.  It is somewhat random though.  I'm able to get reasonably 
consistent failures using image/jpeg and iterating the test case about 20 times.

Additionally, it looks like the data structure that 
mimetypes.guess_extensions() is reading its extensions from is a list so it 
doesn't have to do with dictionary sort order.  It has something to do with the 
way the extensions are read in from the files and then given to add_type().

Talking to r.david.murray I think that this particular problem can be solved by 
simply sorting the list of extensions prior to guess_extension taking the first 
extension off of the list.

The question of what to do when the first extension in the list isn't the best 
extension should be resolved in Issue1043134.

I'll attach a patch with test case for this problem.

--
nosy: +a.badger
Added file: http://bugs.python.org/file34821/issue4963.patch

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



[issue12546] builtin __format__ methods cannot fill with \x00 char

2014-04-14 Thread Roundup Robot

Roundup Robot added the comment:

New changeset 7c484551bce1 by Eric V. Smith in branch '3.4':
Issue #12546: Allow \x00 as a fill character for builtin type __format__ 
methods.
http://hg.python.org/cpython/rev/7c484551bce1

New changeset bd90e68dc81f by Eric V. Smith in branch 'default':
Closes issue #12546: Allow \x00 as a fill character for builtin type __format__ 
methods.
http://hg.python.org/cpython/rev/bd90e68dc81f

--

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



[issue12546] builtin __format__ methods cannot fill with \x00 char

2014-04-14 Thread Eric V. Smith

Eric V. Smith added the comment:

Fixed in 2.7, 3.4, 3.5.

--
resolution:  - fixed
stage: patch review - committed/rejected
status: open - closed

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



[issue15104] Unclear language in __main__ description

2014-04-14 Thread Sam Lucidi

Sam Lucidi added the comment:

Thanks, I've revised the change based on your comments.

--
Added file: 
http://bugs.python.org/file34822/clarify-__main__-documentation.patch

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



[issue15916] change doctest DocTestSuite not to raise ValueError if no docstrings

2014-04-14 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
Removed message: http://bugs.python.org/msg174146

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



[issue15916] change doctest DocTestSuite not to raise ValueError if no docstrings

2014-04-14 Thread R. David Murray

Changes by R. David Murray rdmur...@bitdance.com:


--
Removed message: http://bugs.python.org/msg174145

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



[issue18518] return-ing within code timed with timeit.timeit causes wrong return value of timeit.timeit

2014-04-14 Thread jonathan ferretti

jonathan ferretti added the comment:

Added note to timeit function briefly explaining how to avoid it the issue and 
the cause

--
keywords: +patch
nosy: +jonathan.ferretti
type: enhancement - behavior
Added file: http://bugs.python.org/file34823/timeit.patch

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



[issue21198] Minor tarfile documentation bug

2014-04-14 Thread Matt Chaput

Matt Chaput added the comment:

Simple patch to remove the underscore in tarfile.rst.

--
keywords: +patch
nosy: +maatt
Added file: http://bugs.python.org/file34824/issue21198.patch

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



  1   2   3   4   >