New submission from Andres Gomez :
1. Redirect the stderr and stdout with contextlib's redirect_stderr,
redirect_stdout or just by replacing the fd in sys.stderr and sys.stdout
2. We run a subprocess with subprocess.run()
3. The documentation for subprocess states:
https://docs.python.
Andres Ayala added the comment:
Script to reproduce:
import os
import pathlib
# Change to the Root directory
os.chdir('/')
# Create a relative path object.
p = pathlib.Path('spam')
print(p.resolve())
Expected output:
/span
Incorrect output
//span
Change by Andres Ayala :
--
nosy: +killerrex
___
Python tracker
<https://bugs.python.org/issue33660>
___
___
Python-bugs-list mailing list
Unsubscribe:
Andres Ayala added the comment:
I see, with mixed types you need to use __new__ to construct the elements (I
imagine is specially important for non mutable types)
I have modified the example of the coordinates to try to use a mixed type. Is
not the most useful thing, but it mix the bytes
New submission from Andres Ayala :
I have to read and write many files for an old fortran program where the
elements are coded as integer (so 0 is the X, 1 is the Y...) and I have some
tags associated to each one.
So I tried to create an Enum with some additional fields:
class Coord(Enum
Andres Petralli added the comment:
Re: rarity. There is at least one more person that ran into the same issue as
seen in this report: https://github.com/Azure/azure-cli/issues/5184
--
___
Python tracker
<https://bugs.python.org/issue32
Andres Petralli added the comment:
Moving doesn't work, but even removing the firewire adapter (which was unused
on my system), doesn't remove it from the output of ifconfig.
I did however work around the issue by just patching up uuid in a suboptimal
manner (truncated the 64bit in
Andres Petralli added the comment:
This could be purely incidental to have shown up in 10.13, but yes, the problem
comes from the fact that the first hardware ID in the list of devices happens
to be an EUI-64 address with 64 bits now. This is the Firewire interface of my
Mac Pro and maybe
Andres Petralli added the comment:
Here's the output from my system. This is a Mac Pro with a firewire port. Looks
as if the address was picked up from fw0: actually, not lo0. Guess _find_mac
just iterates until it hits a matching word for a hw address:
lo0: flags=8049 mtu
New submission from Andres Petralli :
uuid.py is getting a 64 bit hardware address for the loopback adapter in High
Sierra, specifically in _ifconfig_getnode(). The function expects a 48 bit mac
address, but is instead getting 64 bits back and converting it to an int value
that is too long
Changes by Oscar Andres Alvarez Montero :
--
nosy: +Oscar Andres Alvarez Montero
___
Python tracker
<http://bugs.python.org/issue26049>
___
___
Python-bugs-list m
Andres Riancho added the comment:
FYI, I'm using Python 2.7.6
--
___
Python tracker
<http://bugs.python.org/issue826897>
___
___
Python-bugs-list m
Changes by Andres Riancho :
--
type: -> behavior
___
Python tracker
<http://bugs.python.org/issue826897>
___
___
Python-bugs-list mailing list
Unsubscrib
Changes by Andres Riancho :
--
versions: +Python 2.7
___
Python tracker
<http://bugs.python.org/issue826897>
___
___
Python-bugs-list mailing list
Unsubscribe:
Andres Riancho added the comment:
Django's issue [0] shows the ugly code people write to work around this python
bug.
[0] https://code.djangoproject.com/ticket/15863
--
___
Python tracker
<http://bugs.python.org/iss
Andres Riancho added the comment:
Well, closing this as wont-fix is far from ideal. +4 years have past from the
last activity in this issue but people are still being hit by this issue.
In my case I'm not creating any special sub-class, I just use one of Python's
built-in libs:
Andres Riancho added the comment:
Is this a duplicate for http://bugs.python.org/issue10015
#10015 ?
--
nosy: +Andres.Riancho
___
Python tracker
<http://bugs.python.org/issue14
Andres Adjimann added the comment:
sorry my bad.
--
resolution: -> invalid
status: open -> closed
___
Python tracker
<http://bugs.python.org/issue18607>
___
__
New submission from Andres Adjimann:
There is something wrong with struct.unpack.
import struct
print struct.calcsize('BHB')
8
print struct.calcsize('BHB')
9
--
messages: 194009
nosy: Andres.Adjimann
priority: normal
severity: normal
status: open
title
New submission from Andres Riancho:
In pool.py, the worker function reads as follows:
http://svn.python.org/view/python/trunk/Lib/multiprocessing/pool.py?view=markup
"""
68 job, i, func, args, kwds = task
69 try:
70 result = (True, fun
Pedro Andres Aranda Gutierrez added the comment:
Thanks a lot again :-)
We have a saying here: you'll never go to sleep without having learnt
something new :-)
On Tue, Jan 17, 2012 at 4:11 PM, patrick vrijlandt
wrote:
>
> patrick vrijlandt added the comment:
>
> Hi,
>
&g
Pedro Andres Aranda Gutierrez added the comment:
Touché :-)
I was just frustrated because my XMLs never have tail or text as
attributes and I wanted to have more compact code...
On Mon, Jan 16, 2012 at 12:14 PM, patrick vrijlandt
wrote:
>
> patrick vrijlandt added the comment:
>
New submission from Pedro Andres Aranda Gutierrez :
I have extended the xml.etree.ElementTree.Element class and pass the text
attribute in the arguments. This creates much more compact code:
import xml.etree.ElementTree as xml
class Element(xml.Element):
def __init__(self
New submission from Pedro Andres Aranda Gutierrez :
When creating ElementTree objects that hold SVG drawings, I need a CDATA object
similar to the ProcessingInstruction object. There was a circumvention of the
problem for Python 2.6:
http://stackoverflow.com/questions/174890/how-to-output
Andres Riancho added the comment:
Yes, the traceback was in my code because as I stated before: "my w3af code had
a section of urllib2's code in logHandler.py" in other words, I copy+pasted a
section of urllib2 into my code.
Can't provide a
Andres Riancho added the comment:
One more comment to be added. Please take a look at the following [0] w3af bug
report. The interesting part starts at "[ Sun Nov 28 01:25:47 2010 - debug ]
Traceback (most recent call last):".
In there you'll find that my w3af code had a secti
Andres Riancho added the comment:
Please take a deeper look. I think you're trusting the "old code" more than my
bug report. Some things to keep in mind:
* The "headers" parameter is a dict. It will never have a getheaders method
* The If you search the whole u
New submission from Andres Riancho :
Buggy Code:
"""
def http_error_302(self, req, fp, code, msg, headers):
# Some servers (incorrectly) return multiple Location headers
# (so probably same goes for URI). Use first header.
if '
Julian Andres Klode added the comment:
The problem I see here is that there is no public way to simply get a C string
from a unicode object similar to PyBytes_AsString() for bytes. That's bad
because we don't want to rewrite the whole code to duplicate strings all the
time and
Andres Freund added the comment:
As soon as some bytes are signalled as being available one can simply do a
normal get(). I don't really see the problem here?
Sure, the get() might not be completely non-blocking (especially if the
transferred event is more than the size of a pipe-buffer
Changes by Andres Moreira :
--
nosy: +andrix
___
Python tracker
<http://bugs.python.org/issue7946>
___
___
Python-bugs-list mailing list
Unsubscribe:
Julian Andres Klode added the comment:
This bug still exists in Python 3.1.2.
--
___
Python tracker
<http://bugs.python.org/issue6483>
___
___
Python-bugs-list m
Andres Riancho added the comment:
The problem is still there in 2.7:
>>> urlparts = urlparse.urlparse('C:\\boot.ini')
>>> urlparts
('c', '', '\\boot.ini', '', '', '')
>>> if not urlparts.path:
..
New submission from Andres Riancho :
Buggy code:
"""
if 'location' in headers:
newurl = headers.getheaders('location')[0]
elif 'uri' in headers:
newurl = headers.getheaders('uri')[0]
els
Julian Andres Klode added the comment:
I believe this may be related to Python/import.c (l. 592):
def->m_base.m_copy = PyDict_Copy(dict);
It creates a copy of the module dictionary, but the reference count of
this copy is not decreased when the module object is deallocated, thus
caus
New submission from Julian Andres Klode :
The documentation states that m_size should be -1 if no additional
memory is needed. But this causes the objects inside the module to not
be deallocated at all.
The attached module (test) stores an object of a type 'Test', which
prints "
New submission from Julian Andres Klode :
The given example function initspam fails if an
Based on some experience with my own code, I have found out that the
function import_spam() fails when the module is not importable. In this
case, it returns 0, although it should return -1 when an error
New submission from Andres Moreira :
Hi,
using ipython2.5 in Ubuntu 9.04. I've get this traceback:
In [1]: max?
---
NameError Traceback (most recent call last)
/var/lib/python-su
Andres Moreira added the comment:
Yes are micro-optimizations, but when I parsed a lot of url(10.000 or
more) that 10% or 8% or 5% is very well for me :). It was little
contribution to that module, anyway, i think that there are more
optimizatoins to do but I will try to do it then
Andres Moreira added the comment:
Hi haypo,
sorry for submit all the file, it's my first time here and I'm not very
used to this process yet. :)
Now I attach the patch.
--
keywords: +patch
Added file: http://bugs.python.org/file12744/urlp
Andres Moreira added the comment:
And that is the profile code.
Added file: http://bugs.python.org/file12743/profile_urlparse.py
___
Python tracker
<http://bugs.python.org/issue4
Andres Moreira added the comment:
Hi haypo,
Ok I've been testing with python 2.6 and I put the results here:
optimizedurlparse is the file with my patch
First test optimizedurlparse, second urlparse:
#:/opt/python2.6/release26-maint$ ./python mio/profile_urlparse.py
t
New submission from Andres Moreira :
Hi,
I make a little change in the urlsplit function of urlparse module. And
the performance when I'm parsing a lot of urls was improved a bit.
In the best case was improved around a 20% percent.
Python version:
2.5.2 (r252:60911, Oct 5 2008, 19:
Andres Riancho <[EMAIL PROTECTED]> added the comment:
- Problem: The secure flag of cookies is ignored by the load method.
- Why is it related to this issue? Because the secure flag is a name
without a value:
pie=good; other=thing; secure
- Why is it bad?
Because the RFC says that we
Andres Riancho <[EMAIL PROTECTED]> added the comment:
My problem, and the problem if the original bug reporter (sirilyan) is
that the load method ignores names that don't have values. Quoting the
original bug report:
>>> import Cookie
>>> q = Cookie.SimpleCookie(&
Andres Riancho <[EMAIL PROTECTED]> added the comment:
The RFC I'm talking about is: http://www.ietf.org/rfc/rfc2109.txt
___
Python tracker <[EMAIL PROTECTED]>
<http://bugs.pyt
Andres Riancho <[EMAIL PROTECTED]> added the comment:
Sorry to bother you guys after so much time, but I think that there is
at least one bit of the RFC that isn't respected by this "name=value"
thing... If we look at the RFC we'll see this:
cookie-av =
Andres Riancho added the comment:
As I said in my original bug report, if you don't remove the
content-length header or add the data, you are sending an invalid request:
START Request=
GET http://f00/1.php HTTP/1.1
Content-length: 63
Accept-encoding: identity
Accept: */*
User-
Andres Riancho added the comment:
According to the RFC:
If urllib2 gets a 302 in response to a request, it MUST send the *same*
request to the URI specified in the Location header, without modifying
the method, headers, or any data (urllib2 is not RFC compliant here)
In urllib2, a 301 and a
Andres Riancho added the comment:
As mentioned in the RFC, and quoted by orsenthil, "however, most
existing user agent implementations treat 302 as if it were a 303
response", which is true for urllib2.py too ( see line 585 ):
http_error_301 = http_error_303 = http
Changes by Andres Riancho:
--
title: urllib 302 POST -> urllib2 302 POST
__
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue1401>
__
___
Python-bugs-li
New submission from Andres Riancho:
There is an error in urllib2 when doing a POST request to a URI that
responds with a 302 redirection. The problem is in urllib2.py:536, where
the HTTPRedirectHandler creates the new Request based on the original one:
newurl = newurl.replace
andres added the comment:
I've attached a compressed config.log.
Incidentally, we were able to get Python to compile by appending the
following line to pyconfig.h:
#define SETPGRP_HAVE_ARG
-Andres
On Oct 29, 2007, at 1:00 PM, Martin v. Löwis wrote:
>
> Martin v. Löwis added
New submission from andres:
Compiling python 2.5.1 on Mac OS X 10.5 (Leopard) fails with the
following message:
gcc -fno-strict-aliasing -Wno-long-double -no-cpp-precomp
-mno-fused-madd -DNDEBUG -g -O3 -Wall -Wstrict-prototypes -I.
-I./Include -DPy_BUILD_CORE -c ./Modules/posixmodule.c -o
New submission from andres:
Repeated socket connection attempts hang for >2s on Python 2.5.1 & OS X
10.4 after 250 attempts have been made.
--
components: Library (Lib), Macintosh
files: sockettest.py
messages: 56601
nosy: andres
severity: normal
status: open
title: socket.py h
Andres Riancho
added the comment:
I think this should be reopened. The findall call is running for 3 hours
now. I think that it's a clear case of an infinite loop.
__
Tracker &l
Andres Riancho
added the comment:
Have you tested it ?
Is the re.findall() finishing it's work ? I left it working for 5
minutes or more, and got no response.
Cheers,
__
Tracker &l
57 matches
Mail list logo