Philipp Hagemeister added the comment:
Update testcase, and call split before splitdrive
--
Added file: http://bugs.python.org/file42319/fix-path-traversal-26657.patch
___
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/i
Philipp Hagemeister added the comment:
Please find attached a patch which adds a testcase for Windows (on all
platforms) as well as code to fix the problem. Since os.path.split returns
everything after the final slash/backslash, it only needs to be called once.
Note that the usage
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512
Hi Bill,
the best way to ask for features or file bugs on youtube-dl is asking
us at http://github.com/rg3/youtube-dl/issues . Luckily, I this list
from time to time ;)
Simply use
youtube-dl --username u...@gmail.com --password secret :ytfav
Hi anonymous,
your code is working perfectly right. It's just that the only time that
you find anything matching //div[@class=col f-cb] is this one:
div class=col f-cb
div class=name s-fc3 f-fl名称/div
div class=down s-fc3 f-fl视频下载/div
div class=desc s-fc3 f-fl课程简介/div
/div
And
Hi Gregg,
to get a smaller response, you can simply pass in a timestamp, like this:
client = xmlrpclib.ServerProxy('http://pypi.python.org/pypi')
import time
client.changelog(int(time.time() - 600))
[['vs.bootstrap.plonetheme', '1.0.1', 1361451748, 'update description,
classifiers'],
:33 AM, Philipp Hagemeister phi...@phihag.dewrote:
Hi Gregg,
to get a smaller response, you can simply pass in a timestamp, like this:
client = xmlrpclib.ServerProxy('http://pypi.python.org/pypi')
import time
client.changelog(int(time.time() - 600))
[['vs.bootstrap.plonetheme', '1.0.1
On 02/21/2013 02:58 PM, Michael Herman wrote:
Oh - and I haven't tried this site, but you may be able to set something up
on there to email when the changelog is updated.
http://www.changedetection.com/
They just query the whole page - I could do that myself, easily. But the
problem is that
http://learnpythonthehardway.org/book/
I have never used that myself, but I have seeen plenty of stackoverflow
and student questions about it. In short, it's horrible.
The book mostly consists of basic Python programs, and beginners often
fail to grasp even the most basic structures
I don't know anything about the status of this PEP or why it hasn't been
implemented, but here's what strikes me as obviously complex:
Doesn't one need to traverse the entire class hierarchy on every
function call? So if I have
class A:
def foo(self):
return 1
class B(A):
inv: True
socket.socket.send is a low-level method and basically just the
C/syscall method send(3) / send(2). It can send less bytes than you
requested.
socket.socket.sendall is a high-level Python-only method that sends the
entire buffer you pass or throws an exception. It does that by calling
send until
New submission from Philipp Hagemeister:
On my system, {} has become significantly slower in 3.3:
$ python3.2 -m timeit -n 100 '{}'
100 loops, best of 3: 0.0314 usec per loop
$ python3.3 -m timeit -n 100 '{}'
100 loops, best of 3: 0.0892 usec per loop
$ hg id -i
ee7b713fec71
On 10/09/2012 09:37 AM, mikcec82 wrote:
In my script I open and close an html (in a FOR cycle); could be this the
problem?
Unless you're running your Python script as a kernel driver (and you
can't do that accidentally), there is no way that your user-space
program should cause a bluescreen.
On 08/02/2012 11:49 AM, Ulrich Eckhardt wrote:
try:
# redirect input() to raw_input() like Python 3
input = raw_input
except NameError:
# no raw input, probably running Python 3 already
pass
What do you think? Any better alternatives?
That's the generic
Let's go thorugh this program:
On 08/02/2012 12:58 PM, danielashi...@googlemail.com wrote:
import cPickle, pickle
you probably want to transparently fall back to pickle if cPickle is not
available.
print 'WELLCOME TO THE LIBET CLOCK EXPERIMENT DATA ANALYSIST'
file=raw_input('\nPLEASE ENTER
New submission from Philipp Hagemeister:
The s6_addr8 field of in6_addr structs is nonstandard, and therefore not
supported on all platforms (android in my example). cpython's socket module
should use the standard s6_addr field instead.
--
components: IO
hgrepos: 144
messages: 167233
Changes by Philipp Hagemeister phi...@phihag.de:
--
keywords: +patch
Added file: http://bugs.python.org/file26664/issue15538.patch
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15538
On 07/30/2012 09:05 AM, Vikas Kumar Choudhary wrote:
`lspci | grep Q | grep $isp_str1 | grep $isp_str2 | cut -c1-7'
The rough Python equivalent would be
import subprocess
[ l.partition(' ')[0] # or l[:7], if you want to copy it verbatim
for l in
On 07/30/2012 01:31 PM, Jürgen A. Erhard wrote:
On Mon, Jul 30, 2012 at 12:35:38PM +0200, Philipp Hagemeister wrote:
import subprocess
[ l.partition(' ')[0] # or l[:7], if you want to copy it verbatim
for l in subprocess.check_output(['lspci']).splitlines()
if 'Q' in l and isp_str1
On 07/26/2012 01:15 PM, Stefan Behnel wrote:
exits with a UnicodeDecodeError.
... that tells you the exact code line where the error occurred.
Which property of a UnicodeDecodeError does include that information?
On cPython 2.7 and 3.2, I see only start and end, both of which refer to
the
On 07/26/2012 02:24 PM, Stefan Behnel wrote:
Read again: *code* line. The OP was apparently failing to see that
the error did not originate in the source code lines that he had
wrapped with a try-except statement but somewhere else, thus leading
to the misguided impression that the exception
Unlike the print statement, pass has no overboarding complexity (like
, printing tuples, etc.) - it just serves as a marker (and
practicality beats purity).
And you don't ever want to use pass as a value (say, for map() or the
right side of an assignment). In fact, if pass were a function, users
Hi Jaroslav,
you can catch a UnicodeDecodeError just like any other exception. Can
you provide a full example program that shows your problem?
This works fine on my system:
import sys
open('tmp', 'wb').write(b'\xff\xff')
try:
buf = open('tmp', 'rb').read()
buf.decode('utf-8')
except
On 07/23/2012 01:23 PM, Henrik Faber wrote:
With an arbitrary dictionaty d, are d.keys() and d.values()
guaraneed to be in the same order?
Yes. From the documentation[1]:
If items(), keys(), values(), iteritems(), iterkeys(), and itervalues()
are called with no intervening modifications to the
On 07/15/2012 08:58 PM, Roy Smith wrote:
What motivated you to migrate from unittest to nose?
Mostly I was just looking for a better way to run our existing tests.
We've got a bunch of tests written in standard unittest, but no good way
to start at the top of the tree and run them all with
On 07/16/2012 01:47 PM, Peter Otten wrote:
http://docs.python.org/library/unittest#test-discovery
That's precisely it. Can we improve the discoverability of the discover
option, for example by making it the default action, or including a
message use discover to find test files automatically if
On 07/16/2012 02:37 PM, Philipp Hagemeister wrote:
Can we improve the discoverability of the discover
option, for example by making it the default action, or including a
message use discover to find test files automatically if there are no
arguments?
Oops, already implemented as of Python 3.2
multiprocessing just mimicks the threading module here, see
http://bugs.python.org/issue1230540 . Why do you need excepthook in the
first place?
You can perfectly simulate it by wrapping the root method (target in
your example) in a try .. catch:
import multiprocessing
import sys
def
On 06/13/2012 11:00 AM, Dave Cook wrote:
Originally, I was trying to send formatted
tracebacks back to the main process on a queue.
You can still do that:
import multiprocessing
import sys
def queueErrors(q):
def decorator(func):
def wrapped(*args, **kwargs):
try:
If you're looking for skilled developers, the best way to find them is
probably to search their current work.
http://careers.stackoverflow.com/ and the more experimental
http://githire.com/ are two excellent developer-friendly solutions for that.
- Philipp
On 03/01/2012 12:08 AM, Greg Harezlak
I want to forbid my application to access the filesystem. The easiest
way seems to be chrooting and droping privileges. However, surprisingly,
python loads the codecs from the filesystem on-demand, which makes my
program crash:
import os
os.getuid()
0
os.chroot('/tmp')
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512
As a general rule, feel free to contact youtube-dl developers and users
at https://github.com/rg3/youtube-dl/issues/ . youtube-dl is just one
application, which happens to be written in Python.
l...@mail.python.org wrote:
I did find my way
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512
As already said, you should file your request at
https://github.com/rg3/youtube-dl/issue , not here.
A few things to note:
* Not all sites necessarily send the Content-Length header.
* RTMP URLs would have to be treated differently
* Sending a
Instead of comments, you can often use docstrings
(http://www.python.org/dev/peps/pep-0257/ ):
This is hard to read due to the indentation, and cannot be accessed
programmatically:
#Update the GUI
def update_gui(self, new_word):
Instead, use this:
def update_gui(self, new_word):
What are the traps to be avoided?
Assuming you're not using any OS features (scan the code for /dev and
/proc), the transition from Solaris to Linux will be seamless.
Your main problem will be the transition from the archaic Python 2.3 to
a modern one. Luckily, all 2.x Pythons should be
the hex string?
Regards,
Philipp Hagemeister
signature.asc
Description: OpenPGP digital signature
--
http://mail.python.org/mailman/listinfo/python-list
Mark Dickinson wrote:
(...) If you want to be
able to interpret instances of X as integers in the various Python
contexts that expect integers (e.g., hex(), but also things like list
indexing), you should implement the __index__ method:
Thanks. Somehow forgot this magic method and deleted it
New submission from Philipp Hagemeister phi...@phihag.de:
From DOM Level 3[1]: An implementation conforms to a DOM Level 3 module
if it supports all the interfaces for that module and the associated
semantics.. minidom supports only some Level 3 functions such as
Node.renameNode
We acknowledge your problems with a network script idenifying live hosts
on your network.
Seriously, you have to tell us a little bit more so that we can help
you. How about you actually post the script, and actually post the
trouble (What exactly do you expect? What exactly do you see? What
Hi Shruti,
your message is kind of hard to read. Please note the following:
· Do not put useless junk(issue) in title.
· Multiple exclamation marks convey a sure sign of a diseased mind,
especially syntactically interesting constructions such as ??..
· You didn't purchase your keyboard in August
Where is the fault in my reasoning here?
1) According to http://docs.python.org/dev/install/, The most
convenient way is to add a path configuration file to a directory that’s
already on Python’s path, (...).
2) Path configuration files have an extension of .pth, (...)
12 = 3) A file test.pth
David Lyon wrote:
(...)
12 = 3) A file test.pth with the content /example/ should result in
sys.path containing /example/.
No. Python, once finding the .pth will process it.
Yes, but that processing will add /example/ to sys.path, right?
4) (the current directory) is the first element
David Lyon wrote:
On Mon, 18 May 2009 14:34:33 +0200, Philipp Hagemeister phi...@phihag.de
wrote:
Yes, but that processing will add /example/ to sys.path, right?
It actually works the other way around. The directories listed in
sys.path are scanned for .pth files.
No, they are not. That's
New submission from Philipp Hagemeister phi...@phihag.de:
At line 300 (version 72674) there is the following interesting construction:
if hasattr(os, symlink):
if hasattr(os, symlink):
(...)
(...)
hasattr is idempotent.
Additionally, test_posixpath.py is missing
Changes by Philipp Hagemeister phi...@phihag.de:
--
title: test_posixpath.py - Clean up test_posixpath.py
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue6036
Philipp Hagemeister phi...@phihag.de added the comment:
The patch has been applied to trunk, but not branches/py3k. Sorry for
that, I should really get into the habit of providing patches for both
branches.
--
status: closed - open
___
Python tracker
New submission from Philipp Hagemeister phi...@phihag.de:
In the documentation, the signature is given as parse(filename_or_file,
parser), although the next paragraph reads (...) *parser*, if given,
(...).
The latter is correct, and there is a new bufsize parameter, too.
--
assignee
Philipp Hagemeister phi...@phihag.de added the comment:
Updated patch to use the new ipaddr module instead of the
platform-specific socket.inet_pton (unavailable on some platforms,
including Windows XP)
Updated formatting
--
Added file: http://bugs.python.org/file13851/mcast
Changes by Philipp Hagemeister phi...@phihag.de:
Removed file: http://bugs.python.org/file13198/mcast-example.diff
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue5379
New submission from Philipp Hagemeister phi...@phihag.de:
From the documentation of socket.inet_aton (and socket.inet_ntoa):
inet_aton() does not support IPv6, and getnameinfo() should be used
instead for IPv4/v6 dual stack support.
socket.getnameinfo can not replace inet_aton/inet_ntoa at all
New submission from Philipp Hagemeister phi...@phihag.de:
socket.inet_ntop is only available on some UNIX platforms, although for
example Windows users may want to use it. The new ipaddr module provides
a platform-independent conversion to the packed format on all platforms
and should therefore
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512
Hi Dave,
I've solved this now using ipaddr. ipaddr will be in the stdlib as soon
as its developers realize there are actually not one, but two proposals
to fix the remaining issues waiting for their input.
Anyway, since ipaddr:r68, you can do the
and alignment in
http://docs.python.org/library/struct.html.
Regards,
Philipp Hagemeister
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.9 (GNU/Linux)
iEYEAREKAAYFAkmv2JkACgkQ9eq1gvr7CFymKACghFXMZb9D6pkWZQdapvwTsKJ5
b0UAn0Uvbcguv/rdxjFKXhMQz22+Notn
=ZiKx
-END PGP SIGNATURE-
--
http
New submission from Philipp Hagemeister phi...@phihag.de:
Currently, the testStringToIPv6 and testIPv6ToStrings tests in
Lib/test/test_socket.py only check for variants 1 and 2 (but not 3) from
RFC 4291 2.2.
Furthermore, there are no assertions that check wrong inputs are
appropriately refused
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512
socket.inet_pton which does exactly what I want is not available on 2.x
on Windows. Strangely, the documentation of socket.inet_aton (IPv4 only)
reads:
inet_aton() does not support IPv6, and getnameinfo() should be used
instead for IPv4/v6 dual
?
netaddr[3] has the function I'm looking for Addr('::1').packed(), but
it's way over the top for this purpose; an assembler implementation
would be more readable.
Kind regards,
Philipp Hagemeister
[1] http://bugs.python.org/issue5379
[2] http://ipaddr-py.googlecode.com
[3] http://code.google.com/p
New submission from Philipp Hagemeister phi...@phihag.de:
The multicast example Demo/sockets/mcast.py
1. mentions that multicast is only implemented on SGI (and optional on
other systems). That is not the case anymore.
2. Includes completely unrelated code for broadcast transmission
56 matches
Mail list logo