Opened 13 years ago

Closed 11 years ago

#6380 closed (fixed) don't follow symlinks

Reported by: Adrian <aribao@…> Owned by: nobody
Component: Internationalization Version: master
Severity: Keywords: make-messages symlinks follow symbolic links
Cc: aribao@… Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: yes
Easy pickings: no UI/UX: no


I have created a repository with my apps, and when I need one for one of my projects, I link the code from the repository to the project path. This give me a problem.
When I want to use make-messages to extract all the translation strings, it doesn't follow this symbolic links.
I have patched to be able to extract the strings from the applications linked to the project.
I hope it helps.

Attachments (1) (1.0 KB) - added by Adrian <aribao@…> 13 years ago.
Patch to allow follow symbolic links

Download all attachments as: .zip

Change History (6)

Changed 13 years ago by Adrian <aribao@…>

Attachment: added

Patch to allow follow symbolic links

comment:1 Changed 13 years ago by Simon Greenhill <dev@…>

Patch needs improvement: set
Triage Stage: UnreviewedAccepted

comment:2 Changed 13 years ago by aribao@…

I'd like to make some improvements in this patch, what should I do? Something missing?
Thank you.

comment:3 Changed 13 years ago by Malcolm Tredinnick

If you want to upload a new patch, just do so. We'll only ever worry about the last patch.

There are a few improvements needed here, though:

  1. It doesn't need a nested function like this. Just declare a top-level function. It's much easier to read because there's no confusion about which code belongs to which function.
  2. Needs to be formatted as per PEP 8. In particular, no spaces after parentheses and spaces after commas.
  3. You seem to be going to a lot of effort to reinvent the behaviour of os.walk here. Why not just continue to use os.walk() to descend the directories and use the tip in the Python docs for os.walk for handling symlinks? That would require less extra code, I suspect, plus will use the already debugged os.walk() function instead of having to reinvent our own version.

comment:4 Changed 11 years ago by Ramiro Morales

The followlinks parameter of os.walk() was added in Python 2.6.

comment:5 Changed 11 years ago by Jannis Leidel

Resolution: fixed
Status: newclosed

(In [12443]) Fixed #6380 - Follow symlinks when examining source code and templates for translation strings.

Note: See TracTickets for help on using tickets.
Back to Top