anatoly techtonik added the comment:
Ok. Does the data (string literals) has a scope? Does Python know at runtime
that a string literal stored in its memory was defined in the input stream or a
file?
--
___
Python tracker rep...@bugs.python.org
R. David Murray added the comment:
No.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17439
___
___
Python-bugs-list mailing list
Unsubscribe:
New submission from John Szakmeister:
While trying to test a fix for Nose, I discovered that multiprocessing is
picking up the CPU count incorrectly. It should be using hw.availcpu instead
of hw.ncpu. The latter is the number of cpus installed in the system, but the
former is the number
Changes by Richard Oudkerk shibt...@gmail.com:
--
nosy: +sbt
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17444
___
___
Python-bugs-list mailing
Gurmeet Singh added the comment:
Please consider following before making a decision:
__
io.BufferedReader does not implement read1 (the last lines of trace
below)
It does. You made a mistake in your experiment (you called read1() on a FileIO
object, not a BufferedReader object).
Changes by Antoine Pitrou pit...@free.fr:
--
stage: - patch review
versions: +Python 2.7, Python 3.2, Python 3.3, Python 3.4
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17444
___
Antoine Pitrou added the comment:
You called read1() on fl (a FileIO object) and not cfl (a BufferedReader
object). Your fault for choosing confusing variable names :-)
len(fl.read1(70934549))
Traceback (most recent call last):
File pyshell#44, line 1, in module
len(fl.read1(70934549))
Gurmeet Singh added the comment:
Please consider following before making a decision:
io.FileIO does not implements single OS system call on read() - instead
reads a file until EOF i.e. ignores the arguments supplied to read()
Your experiments show otherwise, the argument supplied to read()
Gurmeet Singh added the comment:
@Antoine - wait I will do it
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17440
___
___
Python-bugs-list
Antoine Pitrou added the comment:
os.fdopen() in 2.x would always create a FILE*, and therefore inherit fread()'s
semantics even in unbuffered mode. In 3.x, unbuffered I/O instead calls
read() directly, and happily returns partial reads; this is by design.
So, I guess imaplib should be fixed
Antoine Pitrou added the comment:
I don't think there's any reason to open the subprocess in unbuffered mode (you
aren't sharing the stdio streams with anyone else). Just be careful to call
flush() on stdin before attempting to read any response from stdout.
--
Gurmeet Singh added the comment:
@Antoine
It worked. I was wrong to say read1() was not implemented. Sorry.
But please do consider other issues.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17440
Antoine Pitrou added the comment:
If only one system call is being made, then I think that
fl.read(256) and fl.read(70934549) should take same amount of time to
complete - assuming disk I/O is the time consuming factor in this
operation (as compared to memory processing).
What do you mean?
Changes by emmanuel garcia6.emman...@wanadoo.fr:
--
nosy: +emmanuel
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14916
___
___
Python-bugs-list
Gurmeet Singh added the comment:
I did the following to understand time taken for in memory copy:
1 fl = io.FileIO('c:/temp9/Capability/Analyzing Data.mp4', 'rb')
2 byt = fl.read(70934549)
3 byt2 = None
4 byt2 = byt[:]
5 fl.close()
6 fl = io.FileIO('c:/temp9/Capability/Analyzing Data.mp4', 'rb')
STINNER Victor added the comment:
obj.update(buffer[:size])
This code does an useless memory copy: obj.update(memoryview(buffer)[:size])
can be used instead.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17436
Gurmeet Singh added the comment:
Sorry, typo in the last post - I meant in memory - memory copy not in place
memory copy.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17440
___
New submission from Barry A. Warsaw:
This came up at the Pycon 2013 Python 3 porting clinic. There are many cases
in the stdlib that claim (either explicitly or implicitly) to accept bytes or
strings, but that don't return the type of the arguments they accept. An
example is
Changes by STINNER Victor victor.stin...@gmail.com:
--
nosy: +haypo
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16997
___
___
Python-bugs-list
Changes by STINNER Victor victor.stin...@gmail.com:
--
nosy: +haypo
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17094
___
___
Python-bugs-list
Antoine Pitrou added the comment:
Bytes objects are immutable, so trying to copy them doesn't copy anything
actually (it's an optimization):
b = bx *10
id(b)
139720033059920
b2 = b[:]
id(b2)
139720033059920
FileIO.read() only calls the underlying read() once, you can check the
R. David Murray added the comment:
There was a long thread about this on python-dev that might be worth going back
over, where I had the same misconception (that functions should always return
the same type as their arguments). While I think that should be the default
design, it isn't always
Barry A. Warsaw added the comment:
On Mar 17, 2013, at 03:10 PM, R. David Murray wrote:
There was a long thread about this on python-dev that might be worth going
back over, where I had the same misconception (that functions should always
return the same type as their arguments). While I think
Gurmeet Singh added the comment:
Thanks for letting me know about the optimization.
I trusted you that the system call is made once, though I looked up code to see
if size of the read in buffer is being passed to the C routine. I should
apologize though for raising this issue - since it is
New submission from Ronny Pfannschmidt:
examples that are found on a property dont detect the line number
class example(object):
@property
def me(self):
1/0
pass
--
messages: 184384
nosy: Ronny.Pfannschmidt
priority: normal
severity: normal
status: open
title:
Antoine Pitrou added the comment:
The time of line 7 was much greater than line 13.
Well, yes, reading 70 MB is much longer than reading a single byte :-)
I feel that the underlying system call takes the size argument
Indeed it does. It would be totally inefficient if it didn't.
so I
Antoine Pitrou added the comment:
Anyway, I'm now closing the issue as invalid.
--
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17440
___
Antoine Pitrou added the comment:
Since this has dragged on for quite a while, I'm probably just going to
release 2.7.4 with a pointer to defusedxml in the release notes. (docs,
though, perhaps)
+1 too.
--
nosy: +pitrou
___
Python tracker
Gregory P. Smith added the comment:
Yes imaplib can be fixed pretty easily and should use buffered IO regardless.
I'm pondering if the default behavior of subprocess needs fixing as
existing python 2.x code being ported to 3 doesn't expect this changed
behavior of the PIPE file objects. It
New submission from Raymond Hettinger:
'def'.isidentifier()
True
--
components: Interpreter Core
messages: 184389
nosy: rhettinger
priority: normal
severity: normal
status: open
title: str.identifier shouldn't accept Python keywords
type: behavior
versions: Python 3.2, Python 3.3,
Changes by Ned Deily n...@acm.org:
--
nosy: +ned.deily, ronaldoussoren
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17444
___
___
Kristján Valur Jónsson added the comment:
I will backport this. I have recently seen this happening in 2.7 in our
company and it would make sense to fix this before 2.7.4 is released.
--
nosy: +kristjan.jonsson
___
Python tracker
Florent Xicluna added the comment:
According to the documentation, the reserved words are classified as
identifiers:
http://docs.python.org/3/reference/lexical_analysis.html#keywords
There's an easy workaround:
from keyword import iskeyword
def is_valid_identifier(s):
... return
Roundup Robot added the comment:
New changeset ff9636af9505 by Terry Jan Reedy in branch '3.2':
Issue #17415: Clarify 'this' referent by moving containing sentence just after
http://hg.python.org/cpython/rev/ff9636af9505
New changeset bceb81b0016e by Terry Jan Reedy in branch '2.7':
Issue
Terry J. Reedy added the comment:
If foo is a symbolic link, changing A/foo/../B to A/B could change the
meaning, so I am sure the rewrite is correct. I used Ezio's version with a few
more changes. I particular, I changed 'This collapsing', which is slightly
awkward anyway, to 'This string
Changes by R. David Murray rdmur...@bitdance.com:
--
nosy: +r.david.murray
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17446
___
___
R. David Murray added the comment:
Or maybe 'is_usable_identifier' :)
--
nosy: +r.david.murray
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17447
___
emmanuel added the comment:
run the attached shell script to observe the bug
./bug.sh 0 - shows the bug
./bug.sh 1 - shows the expected behaviour (using a workaround)
tested on linux with python 2.7
--
Added file: http://bugs.python.org/file29431/bug.sh
Serhiy Storchaka added the comment:
os.path.normpath() works not only with strings but with bytes objects too.
--
nosy: +serhiy.storchaka
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17415
Christian Theune added the comment:
I feel unsure how to help this move along.
I agree that making it possible for applications to carefully work with
MemoryErrors is a good idea. I don't think heuristics to determine which
situation we are in will solve this but make it more spooky. (This
Serhiy Storchaka added the comment:
Hmm. I were going to use this method for re's named group (see issue14462).
There is a possibility that some third-party code uses it for checking on
general Unicode-aware identifiers. The language specifification says that
keywords is a subset of
Changes by emmanuel garcia6.emman...@wanadoo.fr:
Added file: http://bugs.python.org/file29432/bug.sh
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14916
___
Changes by emmanuel garcia6.emman...@wanadoo.fr:
Removed file: http://bugs.python.org/file29431/bug.sh
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue14916
___
Changes by Serhiy Storchaka storch...@gmail.com:
--
resolution: fixed -
status: closed - open
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17299
___
Kevin Barry added the comment:
emmanuel,
Thanks for the suggestion. Your workaround is exactly the same as using dup2
(in C) to replace stdin/stdout/stderr with the pty, however. If you added the
following lines to your C code, it would have the same effect as the
command-line redirection in
Serhiy Storchaka added the comment:
I'm not sure what is wrong and can't check on Windows, but it is possible that
this patch fixes tests. Please check it if you can.
--
Added file: http://bugs.python.org/file29433/test_cpickle_fileio.patch
___
Amaury Forgeot d'Arc added the comment:
There may be an issue with the GetFullPathName system call.
Could you copy the result of these functions:
import sys, locale
print(locale.getdefaultlocale())
print(sys.getdefaultencoding())
--
nosy: +amaury.forgeotdarc
Antoine Pitrou added the comment:
I think you want to open the files in binary mode, not text mode.
--
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17299
___
Changes by Christian Theune c...@gocept.com:
--
nosy: +barry
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16381
___
___
Python-bugs-list mailing
emmanuel added the comment:
Kevin,
Indeed the code I submitted can be written entirely in C using pipe fork execl
dup2 etc. as you suggest. The only purpose of mixing bash and C is to have a
short self-contained file showing the problem.
Anyway, whether in C or bash the workaround is less
Roundup Robot added the comment:
New changeset d5aa922f97f9 by Brett Cannon in branch '3.3':
Issue #16880: _imp.load_dynamic() is not defined on a platform that
http://hg.python.org/cpython/rev/d5aa922f97f9
--
nosy: +python-dev
___
Python tracker
Terry J. Reedy added the comment:
The top of the os doc makes it clear that path = byte string or unicode string
and I meant 'string' in that generalized sense. I think 'string' is used that
way elsewhere in the 3.x docs. I though of 'text manipulation', but as the doc
again makes clear, unix
Brett Cannon added the comment:
And this was merged into default in
http://hg.python.org/cpython/rev/3c3c9ad7c297 but for some reason it didn't
show up attached to this issue.
--
___
Python tracker rep...@bugs.python.org
Terry J. Reedy added the comment:
I considered your point, re-read the walk entry, and still wish to leave it as
it is. First, we are not in the business of providing synonyms for everything.
Second, The abbreviations BFS and DFS did not immediately register with me,
even though I am quite
Greg Ward added the comment:
The particular use case that triggered this: Mercurial's test suite. It runs
hg blah blah and compares the output against known good output. But
Mercurial's output is just bytes, because pretty much everything in a Mercurial
repo is just bytes (file data of
Kevin Barry added the comment:
One additional issue, which my patch doesn't address, is that
PyRun_InteractiveLoop should really take *two* FILE* arguments, with the second
one being optional. This is because on Linux (and presumably on other *nixes)
if a read operation is blocked on a file
Kushal Das added the comment:
On Fedora 17, x86_64
./python
Python 3.4.0a0 (default:fb50eb64e097, Feb 22 2013, 11:43:18)
[GCC 4.7.2 20120921 (Red Hat 4.7.2-2)] on linux
Type help, copyright, credits or license for more information.
import resource
[92450 refs, 32257 blocks]
Matthew Barnett added the comment:
I already use it in the regex module for named groups. I don't think it would
ever be a problem in practice because the names are invariably handled as
strings.
--
nosy: +mrabarnett
___
Python tracker
Roundup Robot added the comment:
New changeset 5d56e1214e95 by R David Murray in branch '3.2':
#16057: Clarify why the base method default is called in custom encoders.
http://hg.python.org/cpython/rev/5d56e1214e95
New changeset 5f76e7db97ac by R David Murray in branch '3.3':
Merge #16057:
R. David Murray added the comment:
Thanks Kushal.
--
nosy: +r.david.murray
resolution: - fixed
stage: patch review - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue16057
Kalon Mills added the comment:
Serhiy, sorry I'm not sure I understand your question. But if you take a look
at the script that exhibits the problem I think the bug that I'm reporting
becomes more clear.
Namely, using the dialect configuration shown in the script, the round trip
conversion
R. David Murray added the comment:
Looks to me like this issue is out of date.
--
nosy: +r.david.murray
resolution: - out of date
stage: test needed - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
Diane Trout added the comment:
So as a first stab at fixing this. I modified imaplib to wrap the process.stdin
/ process.stdout from with io.BufferedWriter / io.BufferedReader. I didn't use
the TextIOWrapper as the imaplib wanted to work with the raw \r\n.
The change seems to have fixed the
Colin Su added the comment:
TESTFN will be in format @test_{pid}_tmp instead of @test right now.
So it's not easy to have exactly the same name @test_{pid}_tmp in case if you
put @test_{X}_tmp (for X in range(1,10)) so many files into the top
folder.
does it need to keep open anymore?
New submission from Rafael Santos:
When running test_xml, an exception is thrown if no SAXReader is available, but
the test is not skipped.
[1/1] test_sax
test test_sax crashed -- Traceback (most recent call last):
File /Users/tucif/Documents/dev/cpython/cpython/Lib/test/test_sax.py, line
Changes by Rafael Santos tuci...@gmail.com:
--
keywords: +patch
Added file: http://bugs.python.org/file29435/skiptestsax.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17448
___
Changes by Rafael Santos tuci...@gmail.com:
--
title: test_xml should skip when no xml parsers are found - test_sax should
skip when no xml parsers are found
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17448
Martin v. Löwis added the comment:
I'm rejecting the patch, on grounds of PEP 11. We only support MSVC compilers
up to 3 years after the extended support by Microsoft has expired. For MSC 5,
this is long past. For MSC 6, extended support was discontinued in 2005, for
MSVC 2002, in 2009. For
New submission from Dave Malcolm:
Does the devguide document the benchmarking suite anywhere? I can't see it
anywhere in the index on http://docs.python.org/devguide/ and google doesn't
seem to show anything.
suggested content:
* how to run the benchmarks for a Python 2 implementation
*
Roundup Robot added the comment:
New changeset 114e363ebf83 by R David Murray in branch '3.2':
#17448: Make test_sax skip if there are no xml parsers.
http://hg.python.org/cpython/rev/114e363ebf83
New changeset 3ab80610b2a2 by R David Murray in branch '3.3':
Merge #17448: Make test_sax skip if
R. David Murray added the comment:
Thanks, Rafael.
--
nosy: +r.david.murray
resolution: - fixed
stage: - committed/rejected
status: open - closed
versions: +Python 3.2, Python 3.4
___
Python tracker rep...@bugs.python.org
Changes by Terry J. Reedy tjre...@udel.edu:
--
assignee: docs@python - terry.reedy
stage: needs patch - committed/rejected
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue17415
R. David Murray added the comment:
That looks like a bug in difflib (regardless of what type it returns). But
note that I'm agreeing that returning the same type you are given is generally
preferrable.
--
___
Python tracker rep...@bugs.python.org
paul j3 added the comment:
I think the `re.compile(r'^-.+$')` behavior could be better achieved by
inserting a simple test in `_parse_optional` before the
`_negative_number_matcher` test.
# behave more like optparse even if the argument looks like a option
if
New submission from Christina Chan:
Tried to install python 2.7.3 on Linux 2.6.18-194.8.1.el5 x86_64 with the
following steps:-
1. after gunzip, did ./configure in Python-2.7.3 directory
2. make
here is the error I ran into when executing make:-
Python build finished, but the necessary bits
New submission from Matt Bachmann:
Found a line in splitdoc that was not being exercised.
I added a test for it.
--
components: Library (Lib)
files: splitdoc_description_test.patch
keywords: patch
messages: 184427
nosy: Matt.Bachmann
priority: normal
severity: normal
status: open
76 matches
Mail list logo