15 print(counter: , counter
16
17 while (end == 0): #
---returns syntax error on this while statement
Among other responses, there is no indent after print.
should be
print()
while x:
#now
THanks ... I am new to Python ...
Comparing the result of find with -1 fixes the bug ... some
of the endobj start in the firt position ...
You're right about the lines ending in \n by accident,
EXCEPT in PDF files items are separated by obj \n
and endobj\n
--
-
Hello Python Community.
I'm pleased to announce pyxser-1.5.2r, a python extension which
contains functions to serialize and deserialize Python Objects
into XML. This is a model based serializer. This release is
supports Python 2.4 to Python 2.5.
What can do this serializer?
* Serialization of
I'm creating a one way sync program, it's to automate backing up data
over the wan from our shops to a server at head office. It uses
filecmp.dircmp() but the performance seems poor to me.
for x in dc.diff_files:
srcfp = os.path.join(src, x)
self.fn777(srcfp)
There's a zillion utility apps that I've had kicking around in my
head for years, but I've never implemented because I absolutely
hate GUI programming.
But I'm increasingly impressed by the quality, stability, and sheer
number, of Gnome apps that I keep coming across that use Python
under the
dads wrote:
I'm creating a one way sync program, it's to automate backing up data
over the wan from our shops to a server at head office. It uses
filecmp.dircmp() but the performance seems poor to me.
for x in dc.diff_files:
srcfp = os.path.join(src, x)
On Sat, 2011-01-08 at 16:07 +, kj wrote:
There's a zillion utility apps that I've had kicking around in my
head for years, but I've never implemented because I absolutely
hate GUI programming.
But I'm increasingly impressed by the quality, stability, and sheer
number, of Gnome apps that
On Sat, Jan 8, 2011 at 8:07 AM, kj no.em...@please.post wrote:
There's a zillion utility apps that I've had kicking around in my
head for years, but I've never implemented because I absolutely
hate GUI programming.
But I'm increasingly impressed by the quality, stability, and sheer
number,
On Fri, 7 Jan 2011 18:42:45 -0800 (PST), John jlsp...@gmail.com wrote:
q_file = open(questions_location) #opens the document successfully
for line in q_file:
print line
# prints document successfully
line
# prints last line of document
for line in q_file:
print
If I have an absolute path to a file (i.e. '/home/roy/foo.py'), is there
a way to import that as a module WITHOUT modifying sys.path? I'm using
Python 2.6.
I've read PEP 328, and don't really understand how the absolute imports
it's talking about are supposed to work. Should I be using
On 1/8/2011 3:03 PM, Roy Smith wrote:
If I have an absolute path to a file (i.e. '/home/roy/foo.py'), is there
a way to import that as a module WITHOUT modifying sys.path? I'm using
Python 2.6.
Import from another file in /home/roy. (since '.' is part of sys.path).
Or put module or package of
Roy Smith r...@panix.com writes:
If I have an absolute path to a file (i.e. '/home/roy/foo.py'), is
there a way to import that as a module WITHOUT modifying sys.path? I'm
using Python 2.6.
Importing a module with ‘import’ is done by using the module's name,
which is only *incidentally*
I am a newbie to python. Python supports what I thinks it is called
list display, for example:
[i for i in range(10)]
[i for i in range(10) if i6]
Does anyone know a good documentation for this. I have read the
language reference but it is confusing.
Olive
--
They're called List Comprehensions
http://docs.python.org/tutorial/datastructures.html#list-comprehensions
http://docs.python.org/tutorial/datastructures.html#list-comprehensions
On Sat, Jan 8, 2011 at 4:57 PM, Olive not0read0...@yopmail.com wrote:
I am a newbie to python. Python supports what
On Sat, Jan 8, 2011 at 1:57 PM, Olive not0read0...@yopmail.com wrote:
I am a newbie to python. Python supports what I thinks it is called
list display, for example:
[i for i in range(10)]
[i for i in range(10) if i6]
Does anyone know a good documentation for this. I have read the
language
On Sat, 08 Jan 2011 22:57:45 +0100, Olive wrote:
I am a newbie to python. Python supports what I thinks it is called list
display, for example:
[i for i in range(10)]
[i for i in range(10) if i6]
This is called a list comprehension, not list display.
Does anyone know a good
In article 877heff4fl@benfinney.id.au,
Ben Finney ben+pyt...@benfinney.id.au wrote:
Roy Smith r...@panix.com writes:
If I have an absolute path to a file (i.e. '/home/roy/foo.py'), is
there a way to import that as a module WITHOUT modifying sys.path? I'm
using Python 2.6.
In article mailman.658.1294522447.6505.python-l...@python.org,
Terry Reedy tjre...@udel.edu wrote:
Import from another file in /home/roy. (since '.' is part of sys.path).
Or put module or package of modules in Lib/site-packages.
But why the horror of modifying sys.path? It is normal
I'm very pleased to announce, on behalf of the PyCon 2011 Program
committee, and entire PyCon 2011 volunteer staff, that the full list
of PyCon 2011 talks is now public, and available!
This was an especially hard year for the PyCon program committee: we
had over 200 proposals for only 95 total
On 1/8/2011 5:48 PM, Roy Smith wrote:
In articlemailman.658.1294522447.6505.python-l...@python.org,
Terry Reedytjre...@udel.edu wrote:
Import from another file in /home/roy. (since '.' is part of sys.path).
Or put module or package of modules in Lib/site-packages.
But why the horror of
In article tvxmo.3345$wj4.1...@newsfe12.ams2,
Stefaan Himpe stefaan.hi...@gmail.com wrote:
Recently someone asked me this question, to which I could not give an
answer. I'm hoping for some insight, or a manual page. What follows is
python 2.6.
The problem is with the difference between
from
Ying Zu zuy...@gmail.com wrote:
How to read ansic file into a pre-defined class?
This is not an ansic file. It's just a plain old data file.
I have a series of files written in the following format,
2 # number of classes
100 # number of items for the first class object
0 foo
Double Squares
A double-square number is an integer X which can be expressed as the
sum of two perfect squares. For example, 10 is a double-square because
10 = 32 + 12. Your task in this problem is, given X, determine the
number of ways in which it can be written as the sum of two squares.
For
On 01/09/2011 01:10 AM, aregee wrote:
Double Squares
A double-square number is an integer X which can be expressed as the
sum of two perfect squares. For example, 10 is a double-square because
10 = 32 + 12. Your task in this problem is, given X, determine the
number of ways in which it can
On 01/08/2011 10:10 PM, aregee wrote:
Double Squares
A double-square number is an integer X which can be expressed as the
sum of two perfect squares. For example, 10 is a double-square because
10 = 32 + 12. Your task in this problem is, given X, determine the
number of ways in which it can be
Georg Brandl ge...@python.org added the comment:
This is not a bug in Python: name resolution may not work in the chroot unless
you add the libraries that are loaded on the fly by the libc.
It *may* also work if you make one name resolution (using socket.getaddressinfo
for example) *before*
Senthil Kumaran orsent...@gmail.com added the comment:
On Fri, Jan 07, 2011 at 07:14:30PM +, Shawn Ligocki wrote:
I think the problem is that http://118114.cn; says it redirects to
http://www.118114.cn:;, but it seems like urllib2 should be able to
deal with that or at least report back
New submission from Ross Lagerwall rosslagerw...@gmail.com:
This patch adds sethostname to the socket module (since socket has
gethostname()).
--
components: Library (Lib)
files: sethostname.patch
keywords: patch
messages: 125761
nosy: giampaolo.rodola, loewis, rosslagerwall
priority:
ulidtko ulid...@gmail.com added the comment:
Can I perform a name resolution before chrooting, save the result and use it
later for creating an instance of http.server.HTTPServer, as a workaround?
--
___
Python tracker rep...@bugs.python.org
Senthil Kumaran orsent...@gmail.com added the comment:
The title got reset by my previous response. Changing it again.
I vote for closing this report as Invalid as I see that the error message which
is raised is proper and meaningful.
httplib.InvalidURL: nonnumeric port: ''
--
ulidtko ulid...@gmail.com added the comment:
Ok, I can do it with socket.gethostbyname().
Thanks for clarifications.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10865
___
anatoly techtonik techto...@gmail.com added the comment:
Martin, shouldn't there be at least majority to reach consensus on this matter,
or you're self-proclaimed BSDL II? =)
At least failed .pyd module name should be present in error message.
--
status: closed - open
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
See r87856
--
resolution: - accepted
status: open - closed
type: - feature request
versions: +Python 3.2
___
Python tracker rep...@bugs.python.org
Georg Brandl ge...@python.org added the comment:
This is already fixed in dev docs, just needs backporting.
--
nosy: +georg.brandl
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10863
Georg Brandl ge...@python.org added the comment:
No idea what a BSDL is, but a developer is definitely entitled to close a bug
without resorting to a majority decision (what is that, anyway? should we
hold monthly parliament over bugs?).
You're of course free to reopen with a different
Georg Brandl ge...@python.org added the comment:
The possible downside, as with any new feature, is that code using the
new feature will not run on on previous micro (x.y.z) releases.
That's absolutely no downside: I daresay 99% of test runs by developers are
done at the branch head, not
Georg Brandl ge...@python.org added the comment:
The loop looks strange to me too, not to mention inefficient compared with a
regex replacement done in C.
--
nosy: +georg.brandl
___
Python tracker rep...@bugs.python.org
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
See r87858.
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10533
___
Georg Brandl ge...@python.org added the comment:
This is not a bug in the implementation: the file object is only closed when
you passed a file name to open().
Like other APIs that allow file names or objects to be passed in, it is the
caller's responsibility to close the file object if an
Antoine Pitrou pit...@free.fr added the comment:
Ok, done in r87860.
--
resolution: - fixed
stage: - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10859
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
See r87862.
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9717
___
Changes by Raymond Hettinger rhettin...@users.sourceforge.net:
--
resolution: - rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10648
___
Martin v. Löwis mar...@v.loewis.de added the comment:
I'm with Raymond here (probably not surprisingly): -1 on backporting new
features into 2.7. This really is foremost about having policies and sticking
to them; special cases aren't special enough to break the rules.
Personally, I haven't
Georg Brandl ge...@python.org added the comment:
Okay, that's reasonable enough. Closing (or shall we wait for the majority to
consent first?)
--
resolution: - rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
Antoine Pitrou pit...@free.fr added the comment:
James, could you propose a proper patch? Even better if you also give a couple
of timing results, just for the record?
--
versions: +Python 3.2 -Python 2.7, Python 3.1
___
Python tracker
New submission from Марк Коренберг socketp...@gmail.com:
python mmap objects issue msync() in destructor even if mapping was created
with prot=mmap.PROT_READ only
--
messages: 125780
nosy: mmarkk
priority: normal
severity: normal
status: open
title: python mmap objects issue msync()
Марк Коренберг socketp...@gmail.com added the comment:
Soory, this is dup of Issue2643
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10867
___
Марк Коренберг socketp...@gmail.com added the comment:
i'm crazy today. sorry twice. this is not dup of 2643 :(
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10867
___
Changes by Antoine Pitrou pit...@free.fr:
--
nosy: +loewis
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10834
___
___
Python-bugs-list mailing
Changes by Antoine Pitrou pit...@free.fr:
--
assignee: meador.inge - mark.dickinson
stage: needs patch - patch review
versions: +Python 3.3 -Python 3.2
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue3132
Skip Montanaro s...@pobox.com added the comment:
On my Mac it displays 12345. I don't see that as a big problem.
It raises ValueError for a year of -1. This is with build py3k:87566.
If someone wants to feed a year to time.strftime I don't see that
as a big problem. I less sure about
R. David Murray rdmur...@bitdance.com added the comment:
I agree that when dealing with prexisting folding it is better to preserve it.
The case I was talking about is, say, prepending re to a subject and refolding
it. It is the transformation step where I think turning fws into a single
Charles-Francois Natali neolo...@free.fr added the comment:
python mmap objects issue msync() in destructor even if mapping was created
with prot=mmap.PROT_READ only
Actually, the call to msync(2) from destructor has been removed altogether in
py3k. See http://bugs.python.org/issue2643.
STINNER Victor victor.stin...@haypocalc.com added the comment:
Victor: How do I determine what code page my old w2k is using?.
python.exe -c 'import locale; print(ANSI code page:
{}.format(locale.getpreferredencoding()))'
On Windows, #8611 (and #9425) permit to use non-ASCII characters
STINNER Victor victor.stin...@haypocalc.com added the comment:
I think bugs in core syntax should have high priority.
It took me 7 months to implement the first part (#8611 and #9425). I plan to do
the second part (#3080) in Python 3.3 (it's too late for Python 3.2, final is
planned for
STINNER Victor victor.stin...@haypocalc.com added the comment:
Let's try r87850. I'm now waiting for the buildbot.
The test pass on both OpenIndiana buildbots, so I close the issue.
On my Mac it displays 12345. I don't see that as a big problem.
Why do you say problem? It is the correct
Changes by STINNER Victor victor.stin...@haypocalc.com:
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10864
___
Philippe Devalkeneer phil.le.bienheur...@gmail.com added the comment:
Here a new patch with sqlite3_int64 type, and unit test.
--
Added file:
http://bugs.python.org/file20313/broken_long_sqlite_userfunctions.diff
___
Python tracker
R. David Murray rdmur...@bitdance.com added the comment:
Antoine didn't want to backport that patch. Does the fix applied in issue
678250 address this?
--
nosy: +r.david.murray
___
Python tracker rep...@bugs.python.org
STINNER Victor victor.stin...@haypocalc.com added the comment:
time.asctime(), time.ctime() and time.strftime() are no more not limited for
the year field if accept2dyear=0. Except with Visual Studio or on Solaris: the
year is limited to the range [1; ].
--
STINNER Victor victor.stin...@haypocalc.com added the comment:
time.asctime(), time.ctime() and time.strftime() are no more not limited for
the year field if accept2dyear=0. Except with Visual Studio or on Solaris: the
year is limited to the range [1; ].
datetime.strftime() is limited to
Skip Montanaro s...@pobox.com added the comment:
Skip On my Mac it displays 12345. I don't see that as a big problem.
haypo Why do you say problem? It is the correct result :-)
I agree. I interpreted your ticket as complaining that it should raise
a ValueError if year :
STINNER Victor victor.stin...@haypocalc.com added the comment:
Le samedi 08 janvier 2011 à 17:02 +, Skip Montanaro a écrit :
I agree. I interpreted your ticket as complaining that it should raise
a ValueError if year :
Only on OpenIndiana because on this specific OS, %Y only
ingemar inge...@sijohansson.com added the comment:
python.exe -c import locale; print('ANSI code page:
{}'.format(locale.getpreferredencoding()))
ANSI code page: cp1252
python.exe -c import os; fn=os.fsencode('ä'); print(ascii(fn))
b'\xe4'
and no error raised
--
Doug Hellmann doug.hellm...@gmail.com added the comment:
I just ran into this problem with pstats under Python 2.7. The ticket is
marked as fixed, but it looks like the change was only checked in under the
py3k branch.
What's the policy on fixing stuff like this for 2.7 patch releases?
Jose-Luis Fernandez-Barros jlfbar...@gmail.com added the comment:
Thanks for your answer.
Error remains at development The Python Standard Library, secction 12. Data
Compression and Archiving
http://docs.python.org/dev/py3k/library/zlib.html#module-zlib
zlib.compress(string[, level])
Марк Коренберг socketp...@gmail.com added the comment:
I have changed title of the bug. This is more precisely describe the problem.
In my code, I do mmap.close(), so msync does not called.
Generally, calling msync() on read-only mapping is not needed at all. And meven
more, calling msync()
ipatrol ipatrol6...@yahoo.com added the comment:
Going through more than a few registry keys, here are some that stood out for
me:
HKEY_CURRENT_USER\Software\Microsoft\Microsoft SDKs\Windows\v6.0A
InstallationFolder
HKEY_CURRENT_USER\Software\Microsoft\Microsoft SDKs\Windows\v6.1
Georg Brandl ge...@python.org added the comment:
Quite right, this is now fixed in r87870.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10863
___
Changes by Georg Brandl ge...@python.org:
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10863
___
Terry J. Reedy tjre...@udel.edu added the comment:
If the source will not compile with __INSURE__ defined, then perhaps no one has
ever tried to do that with 3.x. That would suggest that the ifdef could be
removed. In any case, the non-function call should be removed.
Is the other function
Terry J. Reedy tjre...@udel.edu added the comment:
I think this needs at least two patches: one to change comments, another to
remove two fields. Can you prepare something?
--
nosy: +terry.reedy
___
Python tracker rep...@bugs.python.org
Changes by Stefan Krah stefan-use...@bytereef.org:
--
nosy: +skrah
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9880
___
___
Python-bugs-list
Changes by Terry J. Reedy tjre...@udel.edu:
--
versions: +Python 3.2 -Python 3.0
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue3821
___
___
Changes by Éric Araujo mer...@netwok.org:
--
status: open - pending
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9264
___
___
Python-bugs-list
Charles-Francois Natali neolo...@free.fr added the comment:
have changed title of the bug. This is more precisely describe the problem
Yes, its's not quite the same problem.
I think, that flush() should be no-op if mapping is read-only.
This has already be done for py3k. See
New submission from Edoardo Spadolini keri...@gmail.com:
If we make ABCMeta.register() return the registered class, like
atexit.register() does for the registered function, we can then use it as a
decorator:
Now:
class Foo:
...
ABarC.register(Foo)
With this change:
@ABarC.register
R. David Murray rdmur...@bitdance.com added the comment:
I ran into a redirection loop when cookies were blocked from google, who should
know better. And then they had the gall to blacklist my ip for an attempted
DOS attack. So a feature request may not be out of order; but I for one would
Antoine Pitrou pit...@free.fr added the comment:
Looks like a good idea to me.
--
nosy: +benjamin.peterson, gvanrossum, pitrou
stage: - patch review
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10868
Éric Araujo mer...@netwok.org added the comment:
Thanks for the report and patch. Some comments:
+Register a virtual subclass of an ABC. Returns the said subclass.
Should be “Return”, for consistency.
+return subclass # For usage as a decorator
I’d move that to the docstring.
Stefan Krah stefan-use...@bytereef.org added the comment:
I narrowed this issue down to -ftree-vectorize, which is part of
-O3.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9880
___
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
Clarified what it means to be a mapping in r87871 and r87872.
--
resolution: - fixed
status: open - closed
___
Python tracker rep...@bugs.python.org
Edoardo Spadolini keri...@gmail.com added the comment:
Ok, edited the docs too; hope I did everything right...
--
Added file:
http://bugs.python.org/file20315/abcmeta_register_deco_with_docs.diff
___
Python tracker rep...@bugs.python.org
Éric Araujo mer...@netwok.org added the comment:
Great, thanks.
We’ll see later if more cross-links are needed.
--
stage: needs patch - committed/rejected
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10533
Ned Deily n...@acm.org added the comment:
A simpler way to reproduce:
TERM= python -c 'import curses; curses.wrapper(lambda a:a.getch())'
I looked at adding an automated test case for this but it is a little tricky to
make it bulletproof across all environments. Since the problem is really a
New submission from David White dappa...@gmail.com:
When using ast.increment_lineno(), it visits the root node twice. Therefore if
the root node contains the lineno attribute, it is incremented twice. (Often,
the root node will not have a lineno attribute, so there is no effect. This is
Éric Araujo mer...@netwok.org added the comment:
Edited your patch to fix some nits. If there is no opposition, I’ll commit
this to py3k when 3.2 is out.
--
Added file: http://bugs.python.org/file20316/abcmeta_register_v3.diff
___
Python tracker
Charles-Francois Natali neolo...@free.fr added the comment:
It's due to the way the python interpreter handles signals: when the signal is
received, python runs a stub signal handler that just sets a flag indicating
that the signal has been received: the actual handler is executed later,
Raymond Hettinger rhettin...@users.sourceforge.net added the comment:
+1
--
nosy: +rhettinger
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10868
___
Changes by David White dappa...@gmail.com:
--
keywords: +patch
Added file: http://bugs.python.org/file20317/increment_linenos_27.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10869
___
Changes by David White dappa...@gmail.com:
Added file: http://bugs.python.org/file20318/increment_linenos_31.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10869
___
Changes by David White dappa...@gmail.com:
--
resolution: - fixed
Added file: http://bugs.python.org/file20319/increment_linenos_3k.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10869
David White dappa...@gmail.com added the comment:
I've uploaded the patches. Beware, this is my first attempt to contribute.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10869
___
Éric Araujo mer...@netwok.org added the comment:
I did a bit of testing on demo files. The first one I tested with had mixed
EOLs, in which case the newlines attribute will be a tuple and open(...,
newline=r.newlines) will fail. For reference:
Changes by Éric Araujo mer...@netwok.org:
--
keywords: +needs review
nosy: +aronacher, rhettinger
resolution: fixed -
stage: - patch review
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10869
Changes by Éric Araujo mer...@netwok.org:
--
nosy: +eric.araujo
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10835
___
___
Python-bugs-list
Changes by Éric Araujo mer...@netwok.org:
--
nosy: +eric.araujo
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9419
___
___
Python-bugs-list
Changes by Éric Araujo mer...@netwok.org:
--
nosy: +eric.araujo
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue10512
___
___
Python-bugs-list
Changes by Éric Araujo mer...@netwok.org:
--
nosy: +pitrou
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue9504
___
___
Python-bugs-list mailing
1 - 100 of 115 matches
Mail list logo